SERVER: Per-player Barricade Rewards

This commit is contained in:
cypress 2024-06-16 14:16:30 -07:00
parent cbe69fc269
commit d646d7eb19
3 changed files with 11 additions and 8 deletions

View file

@ -511,11 +511,12 @@ float round_changetime;
float blink_return;
float delay_at_round;
float spawn_delay;
float maxreward;
float totalreward;
float totalpowerups;
float sounds_playing;
float barricade_reward_maximum;
.float barricade_reward;
float rounds;
float rounds_change;

View file

@ -59,12 +59,12 @@ void() screen_shake =
void() Window_repaired =
{
if (maxreward > totalreward)
if (barricade_reward_maximum > self.enemy.barricade_reward)
{
sound(self, 0,"sounds/misc/ching.wav", 1, ATTN_NORM);
Player_AddScore(self.enemy, 10, true);
totalreward = totalreward + 10;
self.enemy.barricade_reward += 10;
}
screen_shake();
self.enemy = world;

View file

@ -240,16 +240,18 @@ void() NewRound =
// Set everyone to full health.
tempe.health = tempe.max_health;
// Reset total repaired barricades for this round
tempe.barricade_reward = 0;
tempe = find(tempe, classname, "player");
}
set_z_health();
maxreward = 50 * rounds;
if (maxreward > 500)
maxreward = 500;
barricade_reward_maximum = 50 * rounds;
if (barricade_reward_maximum > 500)
barricade_reward_maximum = 500;
totalreward = 0;
Current_Zombies = 0;
spawn_delay = 0;
totalpowerups = 0;