3 .float triggerhealtime;
4 void trigger_heal_touch(entity this, entity toucher)
6 if (this.active != ACTIVE_ACTIVE)
9 // only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
10 if (toucher.iscreature)
12 if (toucher.takedamage)
13 if (!IS_DEAD(toucher))
14 if (toucher.triggerhealtime < time)
16 EXACTTRIGGER_TOUCH(this, toucher);
17 toucher.triggerhealtime = time + 1;
19 if (toucher.health < this.max_health)
21 toucher.health = min(toucher.health + this.health, this.max_health);
22 toucher.pauserothealth_finished = max(toucher.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
23 _sound (toucher, CH_TRIGGER, this.noise, VOL_BASE, ATTEN_NORM);
29 spawnfunc(trigger_heal)
31 this.active = ACTIVE_ACTIVE;
34 settouch(this, trigger_heal_touch);
38 this.max_health = 200; //Max health topoff for field
40 this.noise = "misc/mediumhealth.wav";
41 precache_sound(this.noise);