From 3ef4c5c0bb48d685fe99dec2cd333688d48a1525 Mon Sep 17 00:00:00 2001 From: avirox Date: Sun, 19 Feb 2006 15:57:52 +0000 Subject: [PATCH] - Fixed Triggers to work properly with TF maps (one entity needs a function though..) - Tweaked Civilian class stats a bit git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1095 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- TeamNexuiz/game/gamec/class.c | 5 ++++- TeamNexuiz/game/gamec/g_triggers.c | 31 +++++++++++++++++++++++++++--- TeamNexuiz/game/gamec/tfdoors.c | 8 ++++++-- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/TeamNexuiz/game/gamec/class.c b/TeamNexuiz/game/gamec/class.c index c1cb2fd6f..1eb7b0391 100644 --- a/TeamNexuiz/game/gamec/class.c +++ b/TeamNexuiz/game/gamec/class.c @@ -129,7 +129,7 @@ void ChangeClass(float announce_change, float instant_change) // set starting health - if(!instant_change)//portion == 1.0) + if(!instant_change && self.class != CLASS_CIVILIAN)//portion == 1.0) self.health = ceil(self.max_health * 1.2); else self.health = self.max_health; @@ -547,4 +547,7 @@ void (float classnum) SetMaxAmmoFor = self.ammo_metal = 0; self.maxammo_metal = 200; } + else if (classnum == CLASS_CIVILIAN) { +// self.health = 50; + } }; diff --git a/TeamNexuiz/game/gamec/g_triggers.c b/TeamNexuiz/game/gamec/g_triggers.c index 88d9b556a..27ea8dd39 100644 --- a/TeamNexuiz/game/gamec/g_triggers.c +++ b/TeamNexuiz/game/gamec/g_triggers.c @@ -1,3 +1,5 @@ +// Move to tfdefs: +entity damage_attacker; // ADD FUNCTION FOR void() SUB_UseTargets; @@ -205,17 +207,39 @@ void() multi_trigger = } }; +void() multi_killed = +{ + self.enemy = damage_attacker; + multi_trigger(); +}; + void() multi_use = { self.enemy = activator; multi_trigger(); }; -void() multi_touch = +void() multi_touch = { + local entity te; if (other.classname != "player") + { return; - + } + if (other.is_dead == 1) + return; + if (!Activated(self, other)) + { + if (self.else_goal != TF_FLARE_LIT) + { + te = Findgoal(self.else_goal); + if (te) + { + DoResults(te, other, self.goal_result & 2); + } + } + return; + } // if the trigger has an angles field, check player's facing direction if (self.movedir != '0 0 0') { @@ -225,7 +249,7 @@ void() multi_touch = } self.enemy = other; - multi_trigger (); + multi_trigger(); }; void multi_eventdamage (vector hitloc, float damage, entity inflictor, entity attacker, float deathtype) @@ -296,6 +320,7 @@ void() trigger_multiple = if (self.spawnflags & SPAWNFLAG_NOTOUCH) objerror ("health and notouch don't make sense\n"); self.max_health = self.health; + self.th_die = multi_killed; // added by xavior self.event_damage = multi_eventdamage; self.takedamage = DAMAGE_YES; self.solid = SOLID_BBOX; diff --git a/TeamNexuiz/game/gamec/tfdoors.c b/TeamNexuiz/game/gamec/tfdoors.c index 939de09f7..8011796b2 100644 --- a/TeamNexuiz/game/gamec/tfdoors.c +++ b/TeamNexuiz/game/gamec/tfdoors.c @@ -503,6 +503,8 @@ void() func_door = self.team_no = 1; } + if(self.noise2) precache_sound (self.noise2); //tz 05 11 10 + if (CheckExistence() == TF_FLARE_LIT) { dremove(self); @@ -544,14 +546,16 @@ void() func_door = precache_sound("misc/null.wav"); precache_sound("misc/null.wav"); self.noise1 = "misc/null.wav"; - self.noise2 = "misc/null.wav"; + if (!self.noise2) + self.noise2 = "misc/null.wav"; } if (self.sounds == TF_FLARE_OFF) { precache_sound("doors/drclos4.wav"); precache_sound("doors/doormv1.wav"); self.noise1 = "doors/drclos4.wav"; - self.noise2 = "doors/doormv1.wav"; + if (!self.noise2) + self.noise2 = "doors/doormv1.wav"; } if (self.sounds == 2) { -- 2.39.2