2 .float triggerhealtime;
3 void trigger_heal_touch(entity this, entity toucher)
5 if (this.active != ACTIVE_ACTIVE)
8 // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
9 if (toucher.iscreature)
11 if (toucher.takedamage)
12 if (!IS_DEAD(toucher))
13 if (toucher.triggerhealtime < time)
15 EXACTTRIGGER_TOUCH(this, toucher);
16 toucher.triggerhealtime = time + 1;
18 if (toucher.health < this.max_health)
20 toucher.health = min(toucher.health + this.health, this.max_health);
21 toucher.pauserothealth_finished = max(toucher.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
22 _sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
28 spawnfunc(trigger_heal)
30 this.active = ACTIVE_ACTIVE;
33 settouch(this, trigger_heal_touch);
37 this.max_health = 200; //Max health topoff for field
39 this.noise = "misc/mediumhealth.wav";
40 precache_sound(this.noise);