From 1d157a30fee6a39386fa8089f80995e2f309a4b0 Mon Sep 17 00:00:00 2001 From: avirox Date: Thu, 2 Feb 2006 02:21:41 +0000 Subject: [PATCH] - Added JetJump for scout - Tweaked sentrygun fire (we're gonna need this replaced) - Added "switch_teams" function for info_tfgoal items - Added Proximity Mine to Soldier class git-svn-id: svn://svn.icculus.org/nexuiz/trunk@944 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- TeamNexuiz/game/gamec/GameC.dsp | 4 ++ TeamNexuiz/game/gamec/class.c | 2 +- TeamNexuiz/game/gamec/g_world.c | 1 + TeamNexuiz/game/gamec/scout.c | 58 ++++++++++++++++++++++-- TeamNexuiz/game/gamec/soldier.c | 11 +++-- TeamNexuiz/game/gamec/tf_constants.c | 1 + TeamNexuiz/game/gamec/tfcombat.c | 4 +- TeamNexuiz/game/gamec/tfdefs.c | 4 ++ TeamNexuiz/game/gamec/tfitems.c | 2 +- TeamNexuiz/game/gamec/tfmapitems.c | 68 ++++++++++++++++++++++++++++ TeamNexuiz/game/gamec/tfsentry.c | 4 ++ 11 files changed, 146 insertions(+), 13 deletions(-) diff --git a/TeamNexuiz/game/gamec/GameC.dsp b/TeamNexuiz/game/gamec/GameC.dsp index 99ccf0343..69d5e07e9 100644 --- a/TeamNexuiz/game/gamec/GameC.dsp +++ b/TeamNexuiz/game/gamec/GameC.dsp @@ -308,6 +308,10 @@ SOURCE=.\w_setrope.c # PROP Default_Filter "" # Begin Source File +SOURCE=.\tf_w_proxi.c +# End Source File +# Begin Source File + SOURCE=.\w_electro.c # End Source File # Begin Source File diff --git a/TeamNexuiz/game/gamec/class.c b/TeamNexuiz/game/gamec/class.c index 36dd9d852..bd16760f7 100644 --- a/TeamNexuiz/game/gamec/class.c +++ b/TeamNexuiz/game/gamec/class.c @@ -519,7 +519,7 @@ void (float classnum) SetMaxAmmoFor = self.maxammo_shells = 200; self.maxammo_nails = 200; self.maxammo_cells = 40; - self.maxammo_rockets = 40; + self.maxammo_rockets = 45; self.clip_crylink = CLIP_MAX_CRYLINK; self.tp_grenades_1 = 9; } diff --git a/TeamNexuiz/game/gamec/g_world.c b/TeamNexuiz/game/gamec/g_world.c index 10b890f8a..9a51ce8b0 100644 --- a/TeamNexuiz/game/gamec/g_world.c +++ b/TeamNexuiz/game/gamec/g_world.c @@ -222,6 +222,7 @@ void worldspawn (void) precache_model ("models/grenades/fragnade.md3"); precache_model ("models/magmine/magnetmine.md3"); // mag mine precache_model ("models/sentry/turr1_barrel.md3"); + precache_model ("models/proxi/proxymine2.md3"); // Misc TN Stuff precache_model ("models/team/team.sp2"); diff --git a/TeamNexuiz/game/gamec/scout.c b/TeamNexuiz/game/gamec/scout.c index 8bc4c0fc2..54ccad2cf 100644 --- a/TeamNexuiz/game/gamec/scout.c +++ b/TeamNexuiz/game/gamec/scout.c @@ -98,17 +98,67 @@ void ScoutSpecial() ActivateSpecialShield(FALSE); } +void () FireJetFlame = +{ + local entity missile; + local vector org; + local vector end; + + local vector trueaim; + org = self.origin + self.view_ofs; + end = self.origin + self.view_ofs + v_forward * 4096; + traceline(org,end,TRUE,self); + trueaim = trace_endpos; + + sound (self, CHAN_WEAPON, "weapons/flamer.wav", 1, ATTN_NORM); + self.ammo_nails = self.ammo_nails - 4; + org = self.origin + self.view_ofs/* + v_forward * 1 + v_right * 14 + v_up * -5*/; + + missile = spawn (); + missile.owner = self; + missile.classname = "flame"; + missile.think = W_Flamer_Dissipate; + missile.nextthink = time + 0.01; + //missile.touch = W_Flamer_Touch; + missile.solid = SOLID_BBOX; + setorigin (missile, org); + setmodel (missile, "models/sprites/hagarexplosion.spr32"); + setsize (missile, '0 0 0', '0 0 0'); + missile.effects = EF_LOWPRECISION | EF_ADDITIVE; + missile.alpha = 0.7;//0.3; + missile.scale = 0.005;//0.015;//0.15; + missile.colormod = '1 1 1'; // set full colors, then reduce later + missile.frame = random() * 4 + 2; + + missile.movetype = MOVETYPE_BOUNCE; + missile.gravity = -0.07; // fall lightly up +// missile.velocity = (v_forward + v_right * crandom() * 0.035 + v_up * crandom() * 0.015) * cvar("g_balance_flamer_speed"); + missile.velocity = normalize(trueaim - org) * 600; + + missile.angles = vectoangles (missile.velocity); +}; + void ScoutGrenade(float req) { if(req == WR_GRENADE1) { - if(W_ThrowGrenade(W_ConcussionGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_concussion_refire"); + if (self.ammo_rockets < JETJUMP_NEEDROCKETS) + { + sprint(self, "You need more rockets to power the JetPack\n"); + return; + } + FireJetFlame(); + self.jump_pad = 1; + self.ammo_rockets = self.ammo_rockets - JETJUMP_NEEDROCKETS; + self.velocity = v_forward * 900 + '0 0 250' + v_up * 100; + self.flags = self.flags - (self.flags & FL_ONGROUND); + self.grenade_time = time + 2; } else if(req == WR_GRENADE2) { - - self.grenade_time = time + 2; + if(W_ThrowGrenade(W_ConcussionGrenade)) + self.grenade_time = time + cvar("g_balance_grenade_concussion_refire"); +// self.grenade_time = time + 2; } } diff --git a/TeamNexuiz/game/gamec/soldier.c b/TeamNexuiz/game/gamec/soldier.c index 9c3d12055..4c9eb9754 100644 --- a/TeamNexuiz/game/gamec/soldier.c +++ b/TeamNexuiz/game/gamec/soldier.c @@ -189,18 +189,19 @@ void SoldierSpecial() } - +void () Prox; void SoldierGrenade(float req) { if(req == WR_GRENADE1) { - if(W_ThrowGrenade(W_MirvGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_mirv_refire"); + Prox (); +// if(W_ThrowGrenade(W_MirvGrenade)) +// self.grenade_time = time + cvar("g_balance_grenade_mirv_refire"); } else if(req == WR_GRENADE2) { - if(W_ThrowGrenade(W_FragGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_frag_refire"); +// if(W_ThrowGrenade(W_FragGrenade)) +// self.grenade_time = time + cvar("g_balance_grenade_frag_refire"); } } diff --git a/TeamNexuiz/game/gamec/tf_constants.c b/TeamNexuiz/game/gamec/tf_constants.c index 397cbda3a..1cb9c8b50 100644 --- a/TeamNexuiz/game/gamec/tf_constants.c +++ b/TeamNexuiz/game/gamec/tf_constants.c @@ -53,4 +53,5 @@ float BODYSHOT = 0; float LEGSHOT = 1; float CHESTSHOT = 2; float HEADSHOT = 3; +float JETJUMP_NEEDROCKETS = 15; vector PL_FEIGN_VIEW_OFS = '0 0 10'; // feign view offset diff --git a/TeamNexuiz/game/gamec/tfcombat.c b/TeamNexuiz/game/gamec/tfcombat.c index 8f6eaf9c1..e18d9059f 100644 --- a/TeamNexuiz/game/gamec/tfcombat.c +++ b/TeamNexuiz/game/gamec/tfcombat.c @@ -146,7 +146,7 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = local float damagearmor; - if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door" && targ.classname != "building_tesla") // TEMP + if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door" && targ.classname != "building_tesla" && targ.netname != "proxi") // TEMP { //// return; //// } //// @@ -362,7 +362,7 @@ void (entity targ, entity inflictor, entity attacker, float damage, float T_flag local float no_damage; local float moment; - if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door" && targ.classname != "building_tesla") // TEMP + if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door" && targ.classname != "building_tesla" && targ.netname != "proxi") // TEMP { //// return; //// } //// diff --git a/TeamNexuiz/game/gamec/tfdefs.c b/TeamNexuiz/game/gamec/tfdefs.c index f23863b70..1235eda43 100644 --- a/TeamNexuiz/game/gamec/tfdefs.c +++ b/TeamNexuiz/game/gamec/tfdefs.c @@ -100,6 +100,10 @@ float blueflagexists; .void() th_missile; .void() th_melee; +//switch teams function +.string no_switch_team; +.string switch_teams; + // spy feign .float is_feigning; diff --git a/TeamNexuiz/game/gamec/tfitems.c b/TeamNexuiz/game/gamec/tfitems.c index 46fb5d315..5be4b33a4 100644 --- a/TeamNexuiz/game/gamec/tfitems.c +++ b/TeamNexuiz/game/gamec/tfitems.c @@ -97,7 +97,7 @@ void() maprules = // older Team:Nexuiz maps use this, so i'm routing it to "maprules" void () Map_Rules = { - seld.classname = "maprules"; + self.classname = "maprules"; maprules(); }; diff --git a/TeamNexuiz/game/gamec/tfmapitems.c b/TeamNexuiz/game/gamec/tfmapitems.c index 55ebf8ec7..753b20f5d 100644 --- a/TeamNexuiz/game/gamec/tfmapitems.c +++ b/TeamNexuiz/game/gamec/tfmapitems.c @@ -1265,6 +1265,74 @@ void(entity Goal, entity Player, entity AP, float addb) Apply_Results = sprint(Player,"Item is missing.\n"); } } + // New Team:Nexuiz function: "switch_teams" property -- switches all team-related objects to the opposite + // team (ie self.team_no equal to "1" is now equal to "2" and vise verse). It will not switch team items + // which have a "no_switch_team" property set. + if (Goal.switch_teams) + { + local entity t_ent; + + t_ent = find (world,classname,"item_tfgoal"); + while (t_ent) + { + if (t_ent.team_no && !t_ent.no_switch_team) + { + if (t_ent.team_no == 1) + t_ent.team_no = 2; + if (t_ent.team_no == 2) + t_ent.team_no = 1; + } + t_ent = find (t_ent, classname, "item_tfgoal"); + } + t_ent = find (world,classname,"info_tfgoal"); + while (t_ent) + { + if (t_ent.team_no && !t_ent.no_switch_team) + { + if (t_ent.team_no == 1) + t_ent.team_no = 2; + if (t_ent.team_no == 2) + t_ent.team_no = 1; + } + t_ent = find (t_ent, classname, "info_tfgoal"); + } + t_ent = find (world,classname,"func_door"); + while (t_ent) + { + if (t_ent.team_no && !t_ent.no_switch_team) + { + if (t_ent.team_no == 1) + t_ent.team_no = 2; + if (t_ent.team_no == 2) + t_ent.team_no = 1; + } + t_ent = find (t_ent, classname, "func_door"); + } + t_ent = find (world,classname,"trigger_hurt"); + while (t_ent) + { + if (t_ent.team_no && !t_ent.no_switch_team) + { + if (t_ent.team_no == 1) + t_ent.team_no = 2; + if (t_ent.team_no == 2) + t_ent.team_no = 1; + } + t_ent = find (t_ent, classname, "trigger_hurt"); + } + t_ent = find (world,classname,"trigger_multiple"); + while (t_ent) + { + if (t_ent.team_no && !t_ent.no_switch_team) + { + if (t_ent.team_no == 1) + t_ent.team_no = 2;t_ent.owned_by_team_no = 2; + if (t_ent.team_no == 2) + t_ent.team_no = 1; + } + t_ent = find (t_ent, classname, "trigger_multiple"); + } + } /*if (Player.autodiscard) //Not a function in NexTF { oldself = self; diff --git a/TeamNexuiz/game/gamec/tfsentry.c b/TeamNexuiz/game/gamec/tfsentry.c index bd40200d8..fcb9a84b6 100644 --- a/TeamNexuiz/game/gamec/tfsentry.c +++ b/TeamNexuiz/game/gamec/tfsentry.c @@ -516,6 +516,10 @@ testent2.solid = SOLID_BBOX; //testent2.scale = 5; setmodel(testent2, "models/plasmatrail.mdl"); setorigin(testent2, fire_from);*/ + dir = self.enemy.origin - self.origin; + makevectors(self.origin + dir); + + fire_from = self.origin + v_forward * 20; W_Sentry_Fire(fire_from, dir, 4); -- 2.39.2