X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fmutator%2Fgamemode_ctf.qh;h=14bf281e7106f355cb74102e49ea209cd312e790;hp=b4d2459c3e26ed078e84ff89a11afa0b5725939c;hb=95a5a2479a35e264473e8ba3fc4e584553da42b3;hpb=c13fdf2b49eff1d26abc73d42e33636162a9b527 diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qh b/qcsrc/server/mutators/mutator/gamemode_ctf.qh index b4d2459c3..14bf281e7 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qh +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qh @@ -3,21 +3,32 @@ #ifdef SVQC #include "../gamemode.qh" + +void ctf_Initialize(); + +REGISTER_MUTATOR(ctf, false) +{ + MUTATOR_STATIC(); + MUTATOR_ONADD + { + GameRules_teams(true); + GameRules_limit_score(autocvar_capturelimit_override); + GameRules_limit_lead(autocvar_captureleadlimit_override); + + ctf_Initialize(); + } + return 0; +} + // used in cheats.qc void ctf_RespawnFlag(entity flag); // score rule declarations const int ST_CTF_CAPS = 1; -const int SP_CTF_CAPS = 4; -const int SP_CTF_CAPTIME = 5; -const int SP_CTF_PICKUPS = 6; -const int SP_CTF_DROPS = 7; -const int SP_CTF_FCKILLS = 8; -const int SP_CTF_RETURNS = 9; CLASS(Flag, Pickup) - ATTRIB(Flag, m_mins, vector, PL_MIN_CONST + '0 0 -13') - ATTRIB(Flag, m_maxs, vector, PL_MAX_CONST + '0 0 -13') + ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned + ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4); ENDCLASS(Flag) Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); } void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); } @@ -54,6 +65,14 @@ const float VEHICLE_FLAG_SCALE = 1.0; .string snd_flag_touch; .string snd_flag_pass; +// score fields +.float score_assist; +.float score_capture; +.float score_drop; // note: negated +.float score_pickup; +.float score_return; +.float score_team_capture; // shouldn't be too high + // effects .string toucheffect; .string passeffect; @@ -65,7 +84,6 @@ entity ctf_worldflaglist; .entity ctf_staleflagnext; // waypoint sprites -.entity bot_basewaypoint; // flag waypointsprite .entity wps_helpme; .entity wps_flagbase; .entity wps_flagcarrier; @@ -113,8 +131,9 @@ float ctf_captimerecord; // record time for capturing the flag .entity ctf_dropper; // don't allow spam of dropping the flag .int max_flag_health; .float next_take_time; -.bool ctf_flagdamaged; +.bool ctf_flagdamaged_byworld; int ctf_teams; +.entity enemy; // when flag is back in the base, it remembers last player who carried/touched the flag, useful to bots // passing/throwing properties .float pass_distance; @@ -144,17 +163,11 @@ const int HAVOCBOT_CTF_ROLE_ESCORT = 64; .bool havocbot_cantfindflag; -vector havocbot_ctf_middlepoint; -float havocbot_ctf_middlepoint_radius; - void havocbot_role_ctf_setrole(entity bot, int role); // team checking #define CTF_SAMETEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? DIFF_TEAM(a,b) : SAME_TEAM(a,b)) #define CTF_DIFFTEAM(a,b) ((autocvar_g_ctf_reverse || (ctf_oneflag && autocvar_g_ctf_oneflag_reverse)) ? SAME_TEAM(a,b) : DIFF_TEAM(a,b)) - -// networked flag statuses -.int ctf_flagstatus = _STAT(CTF_FLAGSTATUS); #endif const int CTF_RED_FLAG_TAKEN = 1;