void StatusCheck() { if(self.PushTime != 0 && time >= self.PushTime) { self.pusher = world; self.PushTime = 0; } if(self.waterlevel >= 2) { // need to silence any speech if(self.fire || self.acid) snap_misc_m2m(" \n"); if(self.fire) { sound(self, CHAN_ITEM, "misc/null.wav", 1, ATTN_NORM); self.fire = 0; self.flamer = self; sprint(self, PRINT_MEDIUM, "The fire has been extinguished!\n"); // snap_misc_m2m("The fire has been extinguished!\n"); } if(self.acid) { self.acid = 0; self.acider = self; sprint(self, PRINT_MEDIUM, "The acid has been washed away!\n"); // snap_misc_m2m("The acid has been nutralized!\n"); } } if(self.health > 0) { if(self.fire != 0 && time >= self.fire) { float FireCount; if(FireCount != 1 && FireCount != 2) { sprint(self, PRINT_HIGH, "Fire!\n"); // snap_misc_m2m("You're on fire!\n"); FireCount = 0; } FireCount = FireCount + 1; if(!(self.takedamage)) self.takedamage = 2; self.deathtype = "fire"; T_Damage(self, self.flamer, self.flamer, 5); self.fire = time + 0.5; } if(self.poison != 0 && time >= self.poison) { float PoisonCount; if(PoisonCount != 1 && PoisonCount != 2) { sprint(self, PRINT_HIGH, "Poison!\n"); // snap_misc_m2m("You're poisoned!\n"); PoisonCount = 0; } PoisonCount = PoisonCount + 1; if(!(self.takedamage)) self.takedamage = 2; self.deathtype = "poison"; T_Damage(self, self.poisoner, self.poisoner, 10); self.poison = time + 0.5; } if(self.acid != 0 && time >= self.acid) { float AcidCount; if(AcidCount != 1 && AcidCount != 2) { sprint(self, PRINT_HIGH, "Acid!\n"); // snap_misc_m2m("You're being burned by acid!\n"); AcidCount = 0; } AcidCount = AcidCount + 1; if(!(self.takedamage)) self.takedamage = 2; self.deathtype = "acid"; T_Damage(self, self.acider, self.acider, 5); self.acid = time + 0.5; } } } void HealthStatusCheck() { // need to silence any speech if(self.fire || self.poison || self.acid) snap_misc_m2m(" \n"); if(self.fire) { sound(self, CHAN_ITEM, "misc/null.wav", 1, ATTN_NORM); self.fire = 0; self.flamer = self; sprint(self, PRINT_MEDIUM, "The fire has been extinguished!\n"); // snap_misc_m2m("The fire has been extinguished!\n"); } if(self.poison) { self.poison = 0; self.poisoner = self; sprint(self, PRINT_MEDIUM, "You've been healed from the poison!\n"); // snap_misc_m2m("You've been healed from the poison!\n"); } if(self.acid) { self.acid = 0; self.acider = self; sprint(self, PRINT_MEDIUM, "The acid has been nutralized!\n"); // snap_misc_m2m("The acid has been nutralized!\n"); } } void RadiusEffects(entity Concerned, entity Attacker, float Radius, string EffectType, entity Ignored, entity Ignored2) { entity Effected; if(EffectType == "otherelectricwater") { sound(Concerned, CHAN_WEAPON, "misc/explosionlarge.wav", 1, ATTN_NORM); sound(Concerned, CHAN_AUTO, "misc/explosionlarge.wav", 0.5, ATTN_NONE); } Effected = findradius(Concerned.origin, Radius); while(Effected) { // check to see if the entity is the one to be ignored or is the world or is in animate // and move to the next entity if it is if(Effected != Ignored && Effected != Ignored2) { if(Effected.classname == "detonator" || Effected.classname == "player" || Effected.classname == "bot" || Effected.classname == "monster") { if(Effected.health > 0 || Effected.classname == "detonator") { // check to see if there is an unobstructed path from the entity causing the radius, to the others within it traceline(Concerned.origin, Effected.origin, false, Concerned); // detect for electricity in water if(EffectType == "otherelectricwater") { if(random() > 0.5) { if(!(Effected.takedamage)) Effected.takedamage = 2; Effected.deathtype = "otherelectricwater"; T_Damage(Effected, Concerned, Attacker, 300); } } // end electricwater effect detect if(trace_ent == Effected) { // detect for poison if(EffectType == "poison") { sound(Effected, CHAN_AUTO, "player/slimbrn2.wav", 1, ATTN_NORM); Effected.poisoner = Attacker; Effected.poison = time + 0.5; } // detect for acid if(EffectType == "acid") { sound(Effected, CHAN_AUTO, "player/slimbrn2.wav", 1, ATTN_NORM); Effected.acider = Attacker; Effected.acid = time + 0.5; } // detect for fire if(EffectType == "fire") { /* if(Effected.fire == 0 && Effected.classname != "detonator") { sound(Effected, CHAN_ITEM, "ambience/fire1.wav", 1, ATTN_NORM); W_SetCurrentAmmo(); } */ if(Effected.classname == "detonator") Effected.nextthink = time; Effected.flamer = Attacker; Effected.fire = time + 0.5; } } // end trace_fraction detect // end checks for ignored entities and such } } } // advance to next entity within radius Effected = Effected.chain; } // end while loop } // end function void IncindiaryThink() { if(time >= self.force) { sound(self, CHAN_ITEM, "misc/null.wav", 1, ATTN_NORM); remove(self); } else { // if(random() > 0.5) RadiusEffects(self, self.owner, 240, "fire", self, self.owner); } self.think = IncindiaryThink; self.nextthink = time + 0.05; } void HookStatusCheck() { // need to silence any speech if(self.owner.fire || self.owner.poison || self.owner.acid) { if(self.enemy.fire == 0 || self.enemy.poison == 0 || self.enemy.acid == 0) { local entity tempself; tempself = self; self = self.owner; snap_misc_m2m(" \n"); self = tempself; } } if(self.owner.fire && self.enemy.fire == 0) { sound(self.owner, CHAN_ITEM, "misc/null.wav", 1, ATTN_NORM); self.owner.fire = 0; self.owner.flamer = self.owner; sprint(self.owner, PRINT_MEDIUM, "The fire has been extinguished!\n"); // snap_misc_m2m("The fire has been extinguished!\n"); } if(self.owner.poison && self.enemy.poison == 0) { self.owner.poison = 0; self.owner.poisoner = self.owner; sprint(self.owner, PRINT_MEDIUM, "You've been healed from the poison!\n"); // snap_misc_m2m("You've been healed from the poison!\n"); } if(self.owner.acid && self.enemy.acid == 0) { self.owner.acid = 0; self.owner.acider = self.owner; sprint(self.owner, PRINT_MEDIUM, "The acid has been nutralized!\n"); // snap_misc_m2m("The acid has been nutralized!\n"); } } void MakePlayerHealth() { setmodel(self, "maps/b_bh25.bsp"); setorigin(self, self.owner.origin); self.solid = SOLID_TRIGGER; self.touch = health_touch; self.noise = "items/health1.wav"; self.healamount = 25; self.healtype = 1; setsize (self, VEC_ORIGIN, '32 32 56'); // PlaceItem(); float oldz; self.mdl = self.model; // so it can be restored on respawn self.flags = FL_ITEM; // make extra wide self.solid = SOLID_TRIGGER; self.movetype = MOVETYPE_TOSS; self.velocity = VEC_ORIGIN; self.origin_z = self.origin_z + 6; oldz = self.origin_z; } void PlayerHealth() { if(self.DropHealth < 1) { sprint(self, PRINT_MEDIUM, "Already dropped!\n"); return; } sprint(self, PRINT_MEDIUM, "Dropped!\n"); self.DropHealth = 0; local entity newitem; newitem = spawn(); newitem.classname = "item_health"; newitem.RocketID = self.netname; newitem.owner = self; newitem.think = MakePlayerHealth; newitem.nextthink = time + 0.1; }