Skip to content

Commit

Permalink
Merge branch 'individual-pipe-cooldowns' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
drzel committed Jan 29, 2024
2 parents 2659b75 + 868b803 commit d5f5d20
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ sound files are found in `fortress/sound/hitaudio/` and `fortress/sound/announc
-------------------------------

* Website backend for match results, stats. Get a token at fortressone.org, connect to a FortressOne server, and `login <token>`.


* `localinfo pipecooldown_time <number>` time in seconds for demo pipe cooldown
* `localinfo allpipes_cooldown on/off` whether cooldown is applied to individual pipes or all pipes. i.e. with this on the demo can not det any of his pipes immediately after firing. (default off)
* `localinfo discord_channel_id <number>` to specify discord_channel. Required for autoreporting.
* `localinfo fo_matchrated 2` whether match is rated / affects trueskill. 2 is false for 1v1 and 2v2 only.
* `localinfo backend_address <uri>` to specify backend API endpoint. Default: https://www.fortressone.org/
Expand Down
11 changes: 7 additions & 4 deletions ssqc/client.qc
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,11 @@ void () DecodeLevelParms = {
// maximum amount of pipebombs in game [unlimited]
detpipe_limit_world = CF_GetSetting("dw", "detpipe_limit_world", "-1");

// use old tf pipebomb cooldown (0.8 seconds) [off]
old_pipecooldown = CF_GetSetting("op", "old_pipecooldown", "off");
// set pipe cooldown time [0.5]
pipecooldown_time = CF_GetSetting("pcdt", "pipecooldown_time", "0.5");

// cooldown applies to all pipes [off]
allpipes_cooldown = CF_GetSetting("apcd", "allpipes_cooldown", "off");

// allow medic aura [on]
medicaura = CF_GetSetting("ma", "medicaura", "on");
Expand Down Expand Up @@ -880,7 +883,7 @@ void () DecodeLevelParms = {
old_sniperrange = FALSE;
Role_None.detpipe_limit = 6;
detpipe_limit_world = -1;
old_pipecooldown = FALSE;
pipecooldown_time = 0.5;
medicaura = TRUE;
old_biodamage = FALSE;
cannon_lock = TRUE;
Expand Down Expand Up @@ -948,7 +951,7 @@ void () DecodeLevelParms = {
old_sniperrange = TRUE;
Role_None.detpipe_limit = 7;
detpipe_limit_world = 7;
old_pipecooldown = TRUE;
pipecooldown_time = 0.8;
medicaura = FALSE;
old_biodamage = TRUE;
cannon_lock = FALSE;
Expand Down
4 changes: 2 additions & 2 deletions ssqc/demoman.qc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void () TeamFortress_DetpackCountDown;
void CheckStateQ3Goal(entity trig);

float (float force) TeamFortress_DetonatePipebombs = {
if (time < self.pipecooldown && !force)
if (allpipes_cooldown && time < self.pipecooldown && !force)
return impulse_queue ? FALSE : TRUE;

if (self.detpipe_nesting > 0)
Expand All @@ -34,7 +34,7 @@ float (float force) TeamFortress_DetonatePipebombs = {
rewound = RewindPlayersExceptSelf(self.pipecooldown);

for (float i = 0; i < count; i++) {
if (pipes[i].owner == self) {
if (pipes[i].owner == self && pipes[i].created_at < time - pipecooldown_time) {
deathmsg = pipes[i].flags & FL_ONGROUND ? pipes[i].weapon :
DMSG_GREN_PIPE_AIR;

Expand Down
3 changes: 2 additions & 1 deletion ssqc/qw.qc
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ float old_dropflag;
float old_sniperrange;
//float detpipe_limit;
float detpipe_limit_world;
float old_pipecooldown;
float pipecooldown_time;
float allpipes_cooldown;
float medicaura;
float old_biodamage;
float flame_knockback;
Expand Down
2 changes: 1 addition & 1 deletion ssqc/tfort.qc
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ void () TeamFortress_ShowTF = {
} else {
sprint(self, PRINT_HIGH, "Pipebomb limit (team): unlimited\n");
}
CF_PrintSetting("Old pipebomb cooldown", old_pipecooldown, "", 1);
CF_PrintSetting("Pipebomb cooldown time", pipecooldown_time, "", 0.5);

sprint(self, PRINT_HIGH, "\n== Combat Medic ==\n");
CF_PrintSetting("Medic aura ability", medicaura, "", 1);
Expand Down
5 changes: 1 addition & 4 deletions ssqc/weapons.qc
Original file line number Diff line number Diff line change
Expand Up @@ -1334,10 +1334,7 @@ void W_FireGrenade(vector org, vector v_ang, float use_ctime=0) {
proj.nextthink = time + 2.5;
proj.fpp.gren_type = GREN_RED;
} else {
if (old_pipecooldown)
self.pipecooldown = time + 0.8;
else
self.pipecooldown = time + 0.5;
self.pipecooldown = time + pipecooldown_time;
ExplodeOldestPipebomb();
proj.classname = "pipebomb";
proj.touch = PipebombTouch;
Expand Down

0 comments on commit d5f5d20

Please sign in to comment.