From 5cd3baa37323f7aea9923c8ad59b5abc79af923b Mon Sep 17 00:00:00 2001 From: avirox Date: Tue, 3 Jan 2006 20:18:18 +0000 Subject: [PATCH] git-svn-id: svn://svn.icculus.org/nexuiz/trunk@767 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- TeamNexuiz/game/gamec/GameC.dsp | 4 + TeamNexuiz/game/gamec/cl_impulse.c | 38 +++++++ TeamNexuiz/game/gamec/engineer.c | 162 ++++++++++++++++------------ TeamNexuiz/game/gamec/g_damage.c | 4 +- TeamNexuiz/game/gamec/g_world.c | 1 + TeamNexuiz/game/gamec/tfcombat.c | 45 +++++++- TeamNexuiz/game/gamec/tfdefs.c | 11 +- TeamNexuiz/game/gamec/tffunctions.c | 11 +- TeamNexuiz/game/gamec/tfgrenades.c | 2 +- TeamNexuiz/game/gamec/tfsentry.c | 34 +++++- TeamNexuiz/game/progs.src | 3 + 11 files changed, 231 insertions(+), 84 deletions(-) diff --git a/TeamNexuiz/game/gamec/GameC.dsp b/TeamNexuiz/game/gamec/GameC.dsp index ff99206a7..f3a8f1bd1 100644 --- a/TeamNexuiz/game/gamec/GameC.dsp +++ b/TeamNexuiz/game/gamec/GameC.dsp @@ -344,6 +344,10 @@ SOURCE=.\tfsentry.c # End Source File # Begin Source File +SOURCE=.\tftesla.c +# End Source File +# Begin Source File + SOURCE=.\w_crylink.c # End Source File # End Group diff --git a/TeamNexuiz/game/gamec/cl_impulse.c b/TeamNexuiz/game/gamec/cl_impulse.c index dc3240cb9..9899cce05 100644 --- a/TeamNexuiz/game/gamec/cl_impulse.c +++ b/TeamNexuiz/game/gamec/cl_impulse.c @@ -68,6 +68,44 @@ void ImpulseCommands (void) DoReload (2, (CLIP_MAX_CRYLINK - self.clip_crylink)); } } + if (self.impulse == 68) { + local entity barrel; + barrel = spawn(); + barrel.mdl = "models/sentry/turr1_barrel.md3"; + barrel.yaw_speed = 10; + setmodel(barrel, barrel.mdl); + setorigin(barrel, self.origin + '8 0 8'); + barrel.angles_y = barrel.angles_y; + + local entity barrel2; + barrel2 = spawn(); + barrel2.mdl = "models/sentry/turr1_barrel.md3"; + barrel2.yaw_speed = 10; + barrel2.angles_y = barrel2.angles_z + 90; + setmodel(barrel2, barrel.mdl); + setorigin(barrel2, '0 0 0'); + + setattachment(barrel2, barrel, "tag_barrel_bullet1"); + + local float barrel_tag; + local vector fire_from; + barrel_tag = gettagindex (barrel2, "tag_barrel_bullet1"); + fire_from = gettaginfo (barrel2, barrel_tag); + bprint(vtos(fire_from)); + bprint("\n"); + + local entity e; + e = spawn(); + e.scale = 4; + setmodel(e, "models/plasmatrail.mdl"); + setorigin (e, fire_from); + bprint(vtos(e.origin)); + bprint("\n"); + + } + if (self.impulse == 67) { + TeamFortress_Build (3); + } if (self.impulse == 69) { /* local entity isneardoor; local string st; diff --git a/TeamNexuiz/game/gamec/engineer.c b/TeamNexuiz/game/gamec/engineer.c index c7dfabfdb..a95cb0061 100644 --- a/TeamNexuiz/game/gamec/engineer.c +++ b/TeamNexuiz/game/gamec/engineer.c @@ -3,6 +3,11 @@ void () MagnetMineTouch; void () MagTimer; void () RemoveMagnetMine; +//tesla +void () Tesla_Die; +void () Tesla_Pain; +void () Tesla_Idle; +void () Tesla_Touch; void () SUB_NULL; @@ -69,6 +74,14 @@ void () TeamFortress_EngineerBuild = if ((self.is_building == 1)) { sprint (self, "You stop building.\n"); + + if (self.weaponentity.pos1 != '0 0 0') + { +// self.reload_time = time; + self.weaponentity.pos1 = '0 0 0'; + self.weaponentity.lip = PLAYER_WEAPONSELECTION_SPEED; + } + self.pausetime = 0; self.tfstate = (self.tfstate - (self.tfstate & 65536)); TeamFortress_SetSpeed (self); @@ -100,7 +113,7 @@ float(entity obj, entity builder) CheckArea = pos = pointcontents(obj.origin); if (pos == -2 || pos == -6) { - return TF_FLARE_LIT; + return 0; } src_x = obj.origin_x + obj.maxs_x + 16; src_y = obj.origin_y + obj.maxs_y + 16; @@ -108,20 +121,20 @@ float(entity obj, entity builder) CheckArea = pos = pointcontents(src); if (pos == -2 || pos == -6) { - return TF_FLARE_LIT; + return 0; } end_x = obj.origin_x + obj.mins_x - 16; end_y = obj.origin_y + obj.mins_y - 16; end_z = obj.origin_z + obj.mins_z - 16; - traceline(src, end, TF_FLARE_OFF, obj); - if (trace_fraction != TF_FLARE_OFF) + traceline(src, end, 1, obj); + if (trace_fraction != 1) { - return TF_FLARE_LIT; + return 0; } pos = pointcontents(end); if (pos == -2 || pos == -6) { - return TF_FLARE_LIT; + return 0; } src_x = obj.origin_x + obj.mins_x - 16; src_y = obj.origin_y + obj.maxs_y + 16; @@ -129,41 +142,50 @@ float(entity obj, entity builder) CheckArea = pos = pointcontents(src); if (pos == -2 || pos == -6) { - return TF_FLARE_LIT; + return 0; } end_x = obj.origin_x + obj.maxs_x + 16; end_y = obj.origin_y + obj.mins_y - 16; end_z = obj.origin_z + obj.mins_z - 16; - traceline(src, end, TF_FLARE_OFF, obj); - if (trace_fraction != TF_FLARE_OFF) + traceline(src, end, 1, obj); + if (trace_fraction != 1) { - return TF_FLARE_LIT; + return 0; } pos = pointcontents(end); if (pos == -2 || pos == -6) { - return TF_FLARE_LIT; + return 0; } - traceline(builder.origin, obj.origin, TF_FLARE_OFF, builder); - if (trace_fraction != TF_FLARE_OFF) + traceline(builder.origin, obj.origin, 1, builder); + if (trace_fraction != 1) { - return TF_FLARE_LIT; + return 0; } - return TF_FLARE_OFF; + return 1; }; void(float objtobuild) TeamFortress_Build = { + if (self.is_building == 1) { // double-checks incase someone uses code with TeamFortress_EngineerBuild(number) + TeamFortress_EngineerBuild(); + return; + } + if ((self.reload_time + .25) > time) { + sprint(self, "You cant build while reloading.\n"); + return; + } + local float btime; local entity te; local vector tmp1; local vector tmp2; newmis = spawn(); makevectors(self.v_angle); - v_forward_z = TF_FLARE_LIT; + v_forward_z = 0; v_forward = normalize(v_forward) * 64; newmis.origin = self.origin + v_forward; - if (objtobuild == TF_FLARE_OFF) + if (objtobuild == 1) { if (self.has_dispenser) { @@ -189,7 +211,7 @@ void(float objtobuild) TeamFortress_Build = tmp2 = '16 16 48'; // newmis.mdl = "progs/turrbase.mdl"; newmis.mdl = "models/sentry/turr1_base.md3"; - newmis.scale = .75; +// newmis.scale = .75; newmis.netname = "sentrygun"; // btime = time + 5; btime = .1; @@ -203,10 +225,11 @@ void(float objtobuild) TeamFortress_Build = } tmp1 = '-16 -16 0'; tmp2 = '16 16 48'; - newmis.mdl = "progs/newtesla.mdl"; + newmis.mdl = "models/engineer/tesla/tesla.md3"; + newmis.scale = .70; //temp -- morphed's models too freaking huge :x newmis.netname = "tesla"; - btime = (time + 7); + btime = (time + 6); } // Begin telepad 1 if (objtobuild == 5) @@ -226,20 +249,20 @@ void(float objtobuild) TeamFortress_Build = } // End telepad 1 } - if (CheckArea(newmis, self) == TF_FLARE_LIT) + if (CheckArea(newmis, self) == 0) { sprint(self, "Not enough room to build here\n"); dremove(newmis); return; } - self.is_building = TF_FLARE_OFF; + self.is_building = 1; self.immune_to_check = time + 10; -// self.maxspeed = TF_FLARE_LIT; // make sure player cant move +// self.maxspeed = 0; // make sure player cant move self.tfstate = self.tfstate | 65536; /* self.weapon = self.current_weapon; // get rid of player's weapon model - self.current_weapon = TF_FLARE_LIT; + self.current_weapon = 0; self.weaponmodel = ""; - self.weaponframe = TF_FLARE_LIT;*/ + self.weaponframe = 0;*/ // TeamFortress_SetSpeed(self); // hmm? player cant move? newmis.owner = self; newmis.classname = "timer"; @@ -257,6 +280,7 @@ void(float objtobuild) TeamFortress_Build = setorigin(newmis, newmis.origin); newmis.flags = newmis.flags - (newmis.flags & 512); + self.velocity = '0 0 0'; // stop player movement DoReload (5, (btime - time)); // Engineer build function shared with reload one // 5 is for building, btime minus time is for build time }; @@ -273,20 +297,21 @@ void(entity bld) CheckBelowBuilding = { below_z = below_z - 24; } - traceline(bld.origin, below, TF_FLARE_OFF, bld); - if (trace_fraction == TF_FLARE_OFF) + traceline(bld.origin, below, 1, bld); + if (trace_fraction == 1) { bld.movetype = 6; bld.flags = bld.flags - (bld.flags & 512); } }; +void () Tesla_Animate; void() TeamFortress_FinishedBuilding = { local entity oldself; local vector source; - if (self.owner.is_building != TF_FLARE_OFF) + if (self.owner.is_building != 1) { return; } @@ -294,14 +319,14 @@ void() TeamFortress_FinishedBuilding = self = self.owner; oldself.owner = world; oldself.real_owner = self; - self.is_building = TF_FLARE_LIT; + self.is_building = 0; self.tfstate = self.tfstate - (self.tfstate & 65536); self.current_weapon = self.weapon; self.StatusRefreshTime = time + 0.1; TeamFortress_SetSpeed(self); -/* if (oldself.weapon == TF_FLARE_OFF) +/* if (oldself.weapon == 1) { - self.has_dispenser = TF_FLARE_OFF; + self.has_dispenser = 1; sprint(self, "You finish building the dispenser.\n"); teamsprint(self.team_no, self, self.netname); teamsprint(self.team_no, self, " has built a Dispenser.\n"); @@ -346,33 +371,33 @@ void() TeamFortress_FinishedBuilding = local entity barrel; barrel = spawn(); // barrel.mdl = "models/sentry/turr1_base.md3"; - barrel.mdl = "models/sentry/turr1_barrel.md3"; - barrel.scale = .75; - barrel.solid = 2; +// barrel.mdl = "models/sentry/turr1_barrel.md3"; +// barrel.scale = .75; + //barrel.solid = 2; // barrel.angles_x = barrel.angles_x - 70; // barrel.angles_z = barrel.angles_z - 90; -/* barrel.angles_x = TF_FLARE_LIT; +/* barrel.angles_x = 0; barrel.angles_y = oldself.angles_y; - barrel.angles_z = TF_FLARE_LIT;*/ + barrel.angles_z = 0;*/ // barrel.movetype = 4; // barrel.movetype = MOVETYPE_FOLL`OW; barrel.yaw_speed = 10; // barrel.angles_z = barrel.angles_z - 45; - setmodel(barrel, barrel.mdl); + setmodel(barrel, "models/sentry/turr1_barrel.md3"); // setsize(barrel, '-16 -16 0', '16 16 48'); // temp //'d // setorigin(barrel, oldself.origin + '0 0 8'); setorigin(barrel, '0 0 0'); - self.has_sentry = TF_FLARE_OFF; + self.has_sentry = 1; sprint(self, "You finish building the sentry gun.\n"); teamsprint(self.team_no, self, self.netname); teamsprint(self.team_no, self, " has built a Sentry Gun.\n"); oldself.classname = "building_sentrygun_base"; oldself.netname = "sentry gun"; - oldself.takedamage = TF_FLARE_LIT; + oldself.takedamage = 0; oldself.th_die = Sentry_Die; self.ammo_cells = self.ammo_cells - 130; setsize(oldself, '-16 -16 0', '16 16 4'); @@ -380,13 +405,13 @@ void() TeamFortress_FinishedBuilding = newmis.classname = "building_sentrygun"; newmis.health = 150; newmis.max_health = newmis.health; - newmis.weapon = TF_FLARE_OFF; + newmis.weapon = 1; newmis.th_die = Sentry_Die; newmis.th_pain = Sentry_Pain; // newmis.mdl = "progs/turrgun.mdl"; newmis.mdl = "models/sentry/turr1_body.md3"; - newmis.scale = .75; - sound(oldself, 3, "weapons/tnkatck4.wav", TF_FLARE_OFF, TF_FLARE_OFF); +// newmis.scale = .75; + sound(oldself, 3, "weapons/tnkatck4.wav", 1, 1); newmis.solid = 2; setmodel(newmis, newmis.mdl); setsize(newmis, '-16 -16 0', '16 16 48'); @@ -405,11 +430,11 @@ void() TeamFortress_FinishedBuilding = newmis.think = lvl1_sentry_stand; newmis.nextthink = time + 0.5; newmis.yaw_speed = 10; - newmis.heat = TF_FLARE_LIT; - newmis.angles_x = TF_FLARE_LIT; + newmis.heat = 0; + newmis.angles_x = 0; // newmis.angles_y = oldself.angles_y; newmis.angles_y = oldself.angles_y; - newmis.angles_z = TF_FLARE_LIT; + newmis.angles_z = 0; newmis.waitmin = anglemod(newmis.angles_y - 50); newmis.waitmax = anglemod(newmis.angles_y + 50); if (newmis.waitmin > newmis.waitmax) @@ -427,17 +452,18 @@ void() TeamFortress_FinishedBuilding = setattachment(barrel, newmis, "tag_body_barrel"); - }/* + } else { //tesla if ((oldself.weapon == 3)) { - self.has_tesla = TF_FLARE_OFF; + self.has_tesla = 1; sprint (self, "You finish building the tesla coil.\n"); + oldself.real_owner = self; teamsprint (self.team_no, self, self.netname); teamsprint (self.team_no, self, " has built a tesla.\n"); - sound (oldself, 3, "weapons/guerilla_set.wav", TF_FLARE_OFF, TF_FLARE_OFF); + sound (oldself, 3, "weapons/guerilla_set.wav", 1, 1); oldself.classname = "building_tesla"; oldself.netname = "tesla"; oldself.takedamage = 2; @@ -453,38 +479,38 @@ void() TeamFortress_FinishedBuilding = oldself.flags = (oldself.flags - (oldself.flags & 512)); oldself.team_no = self.team_no; oldself.think = Tesla_Idle; -// oldself.think = tsla_on1; oldself.nextthink = (time + 2); -// oldself.nextthink = time + 0.1; -// oldself.has_holo = time + 2; // next Tesla_Idle run oldself.touch = Tesla_Touch; oldself.enemy = world; - oldself.maxammo_shells = TF_FLARE_LIT; - oldself.maxammo_nails = TF_FLARE_LIT; - oldself.maxammo_rockets = TF_FLARE_LIT; + oldself.maxammo_shells = 0; + oldself.maxammo_nails = 0; + oldself.maxammo_rockets = 0; oldself.max_health = 100; oldself.ammo_cells = 50; - oldself.tf_items = TF_FLARE_LIT; - if (!(self.weapons_carried & 8)) + oldself.tf_items = 0; + /*if (!(self.weapons_carried & 8)) { oldself.ammo_shells = 2; oldself.ammo_nails = 2; - oldself.ammo_rockets = TF_FLARE_OFF; + oldself.ammo_rockets = 1; oldself.currentammo = 5; oldself.max_health = 200; oldself.ammo_cells = 120; - } -// oldself.colormap = self.colormap; // Custom TF ColorMap -// oldself.job = 0; // Custom TF Animations timing + }*/ + oldself.currentammo = 0; // 6 Upgrades. (6 minus this number is pgrade count) oldself.health = oldself.max_health; oldself.waitmin = ((oldself.ammo_shells + 2) * (oldself.ammo_nails + 2)); - oldself.waitmax = TF_FLARE_LIT; -// 4 upgrades! - if (infokey(world, "balancedtesla") == "1") { - oldself.currentammo = 2; } + oldself.waitmax = 0; + + // The tesla animater -- till I learn to be a better coder ;) + local entity tesanim; + tesanim = spawn(); + tesanim.owner = oldself; + tesanim.think = Tesla_Animate; + tesanim.nextthink = oldself.nextthink; } -// TELEPAD 2 BEGIN - if (oldself.weapon == 5) +// TELEPAD 2 BEGIN*/ + /*if (oldself.weapon == 5) { self.has_teleporter = (self.has_teleporter + 1); sprint (self, "You finish building the Teleporter Pad.\n"); @@ -532,8 +558,8 @@ void() TeamFortress_FinishedBuilding = oldself.all_active=0; // OfN - reset HACKER improvements } // TELEPAD 2 END - } - }*/ + }*/ + } W_SetCurrentAmmo(); }; diff --git a/TeamNexuiz/game/gamec/g_damage.c b/TeamNexuiz/game/gamec/g_damage.c index f8131f07b..b33ea30f6 100644 --- a/TeamNexuiz/game/gamec/g_damage.c +++ b/TeamNexuiz/game/gamec/g_damage.c @@ -36,7 +36,7 @@ void Obituary (entity attacker, entity targ, float deathtypeN) // Renamed "death bprint ("^1",s, " blew his own sorry ass up\n"); else if (deathtypeN == 35) bprint ("^1",s, " is still seeing stars from his flash grenade.\n"); - else if (deathtypeN == 9) + else if (deathtypeN == 99) bprint ("^1",s, " nails himself to death.\n"); else bprint ("^1",s, " couldn't resist the urge to self immolate\n"); @@ -95,6 +95,8 @@ void Obituary (entity attacker, entity targ, float deathtypeN) // Renamed "death bprint ("^1",s, " sees the light of ", attacker.netname, "'s flash grenade\n"); else if (deathtypeN == 9) bprint ("^1",s, " gets nailed to the wall from ", attacker.netname, "'s nail grenade\n"); + else if (deathtypeN == 51) //tesla + bprint ("^1",s, " gets fried by ", attacker.netname, "'s tesla coil :D\n"); else bprint ("^1",s, " was killed by ", attacker.netname, "\n"); diff --git a/TeamNexuiz/game/gamec/g_world.c b/TeamNexuiz/game/gamec/g_world.c index 6b76e92eb..97b8b00d1 100644 --- a/TeamNexuiz/game/gamec/g_world.c +++ b/TeamNexuiz/game/gamec/g_world.c @@ -215,6 +215,7 @@ void worldspawn (void) precache_model ("models/ammo/grenade/grenade.md3"); precache_model ("models/grenades/fragnade.md3"); precache_model ("models/magmine/magnetmine.md3"); // mag mine + precache_model ("models/sentry/turr1_barrel.md3"); // plays music for the level if there is any diff --git a/TeamNexuiz/game/gamec/tfcombat.c b/TeamNexuiz/game/gamec/tfcombat.c index fb5472cf6..55e23b036 100644 --- a/TeamNexuiz/game/gamec/tfcombat.c +++ b/TeamNexuiz/game/gamec/tfcombat.c @@ -101,6 +101,12 @@ void (entity targ, entity attacker) Killed = self = oself; return; } + if (self.classname == "building_tesla") + { + self.th_die (); + self = oself; + return; + } self.enemy = attacker; if ((self.flags & 32)) { @@ -128,11 +134,20 @@ 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") // TEMP + if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door" && targ.classname != "building_tesla") // TEMP { //// return; //// } //// + /*if (targ.classname == "building_tesla") + { + targ.health = (targ.health - take); + if ((targ.health <= 0)) + { + Killed (targ, attacker); + } + return; + }*/ if (!targ.takedamage) { return; @@ -147,7 +162,7 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = { damage = (damage * 4); } - if (((targ.classname != "player") && (targ.classname != "bot"))) + if (((targ.classname != "player") && (targ.classname != "bot") && (targ.classname != "building_tesla"))) { if (!Activated (targ, attacker)) { @@ -249,6 +264,25 @@ void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = take = 1; } targ.health = (targ.health - take); + + if (((attacker.classname == "player") && (((((((targ.classname == "player") || (targ.classname == "building_sentrygun")) || (targ.classname == "building_tesla")) || (targ.classname == "building_teleporter")) || (targ.classname == "building_camera")) || (targ.classname == "monster_helo")) || (targ.classname == "laser_drone")))) + { + if ((((targ.team_no > 0) && (targ.team_no == attacker.team_no)) && (targ != attacker))) + { + if ((teamplay & 16)) + { + return; + } + else + { + if ((teamplay & 8)) + { + take = take / 2; + } + } + } + } + if ((targ.armorvalue < 1)) { targ.armorclass = 0; @@ -283,7 +317,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") // TEMP + if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door" && targ.classname != "building_tesla") // TEMP { //// return; //// } //// @@ -308,7 +342,7 @@ void (entity targ, entity inflictor, entity attacker, float damage, float T_flag { damage = (damage * 4); } - if (((((((targ.classname != "player") && (targ.classname != "bot")) && (targ.classname != "building_sentrygun")) && (targ.classname != "building_dispenser")) && (targ.classname != "building_teleporter_entrance")) && (targ.classname != "building_teleporter_exit"))) + if ((((((((((((targ.classname != "player") && (targ.classname != "bot")) && (targ.classname != "building_tesla")) && (targ.classname != "building_sentrygun")) && (targ.classname != "building_dispenser")) && (targ.classname != "trip_bomb")) && (targ.classname != "building_teleporter")) && (targ.classname != "building_camera")) && (targ.classname != "probe")) && (targ.classname != "monster_helo")) && (targ.classname != "laser_drone"))) { if (!Activated (targ, attacker)) { @@ -453,7 +487,8 @@ void (entity targ, entity inflictor, entity attacker, float damage, float T_flag } return; } - if (((attacker.classname == "player") && (((((targ.classname == "player") || (targ.classname == "building_sentrygun")) || (targ.classname == "building_dispenser")) || (targ.classname == "building_teleporter_entrance")) || (targ.classname == "building_teleporter_exit")))) +// if (((attacker.classname == "player") && (((((targ.classname == "player") || (targ.classname == "building_sentrygun")) || (targ.classname == "building_dispenser")) || (targ.classname == "building_teleporter_entrance")) || (targ.classname == "building_teleporter_exit")))) + if (((attacker.classname == "player") && ((((((targ.classname == "player") || (targ.classname == "building_sentrygun")) || (targ.classname == "building_tesla")) || (targ.classname == "building_teleporter")) || (targ.classname == "building_camera")) || (targ.classname == "laser_drone")))) { if (((((targ.team_no > 0) && (targ.team_no == attacker.team_no)) && (targ != attacker)) && (T_flags & 2))) { diff --git a/TeamNexuiz/game/gamec/tfdefs.c b/TeamNexuiz/game/gamec/tfdefs.c index 6b30d0628..43104b53d 100644 --- a/TeamNexuiz/game/gamec/tfdefs.c +++ b/TeamNexuiz/game/gamec/tfdefs.c @@ -10,6 +10,8 @@ float (entity e, float healamount, float ignore) T_Heal; // Temporary Defs (till I implement real systems for these) //float joinorder; // menu implemented :) +.float undercover_team; // is undercover as team number... Are we gonna use this one, wazat? +.float is_undercover; // is just undercover.. // Team Scores float team1score; @@ -238,7 +240,6 @@ void () button_wait; void () SUB_Remove; // tfsentry -.float undercover_team; // is undercover as team number... Are we gonna use this one, wazat? .float super_damage_finished; // turrets can get super charged too! //DP_QC_GETTAGINFO //idea: VorteX, LordHavoc (somebody else?) @@ -250,6 +251,10 @@ vector(entity ent, float tagindex) gettaginfo = #452; //gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index). //gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example. +//tftesla +float modelindex_null = 0; +.float has_turretized_tesla; // is the player's tesla turretized? +float modelindex_eyes = 0; // classes // engiener @@ -258,7 +263,9 @@ vector(entity ent, float tagindex) gettaginfo = #452; .float has_sentry; // player has sentry gun .float has_tesla; // player has tesla coil .float has_teleporter; // player has telepad (2 max) -.entity barrel_ent; +.entity barrel_ent; // sentry gun's barrel entity +.entity animation_ent; // an object's entity that controls its animations (dirty, but effective) +.float weapons_carried; // used with tesla /******************* End Moved From Section **************/ /////////////////////////////////////////////////////////// diff --git a/TeamNexuiz/game/gamec/tffunctions.c b/TeamNexuiz/game/gamec/tffunctions.c index ed32e0e44..56ec17753 100644 --- a/TeamNexuiz/game/gamec/tffunctions.c +++ b/TeamNexuiz/game/gamec/tffunctions.c @@ -1851,9 +1851,11 @@ void() TeamFortress_ChangeClass = void (float o, float m, void () g) weapon_thinkf; void () Reload_Restore_Weapon = { - self.owner.weaponentity.pos1 = '0 0 0'; - self.owner.weaponentity.lip = PLAYER_WEAPONSELECTION_SPEED; - dremove(self); + if (self.owner.weaponentity.pos1 != '0 0 0') + { + self.owner.weaponentity.pos1 = '0 0 0'; + self.owner.weaponentity.lip = PLAYER_WEAPONSELECTION_SPEED; + } }; void (float rweapon, float amount) DoReload = @@ -1895,7 +1897,8 @@ void (float rweapon, float amount) DoReload = newmis.owner = self; newmis.think = Reload_Restore_Weapon; newmis.nextthink = time + rtime; - self.reload_time = time + rtime; + if (rweapon != 5) + self.reload_time = time + rtime; }; // Xavior's self.playerclass to self.class conversion diff --git a/TeamNexuiz/game/gamec/tfgrenades.c b/TeamNexuiz/game/gamec/tfgrenades.c index 244ff3c6f..4d886a739 100644 --- a/TeamNexuiz/game/gamec/tfgrenades.c +++ b/TeamNexuiz/game/gamec/tfgrenades.c @@ -238,7 +238,7 @@ void() NailGrenadeLaunchNail = self.angles_x = TF_FLARE_LIT; self.angles_z = TF_FLARE_LIT; makevectors(self.angles); - deathmsg = 9; + deathmsg = 99; //temp launch_spike(self.origin, v_forward); newmis.touch = superspike_touch; newmis.weapon = 9; diff --git a/TeamNexuiz/game/gamec/tfsentry.c b/TeamNexuiz/game/gamec/tfsentry.c index 98d53134f..bd40200d8 100644 --- a/TeamNexuiz/game/gamec/tfsentry.c +++ b/TeamNexuiz/game/gamec/tfsentry.c @@ -420,7 +420,7 @@ void W_Sentry_Fire(vector org, vector vel, float damage) spike.touch = W_NailGrenade_Spike_Poke; spike.velocity = vel * 6; spike.angles = vectoangles (spike.velocity); - spike.scale = 0.75; +// spike.scale = 0.75; // setattachment(spike, self.barrel_ent, "tag_body_barrel"); } @@ -474,9 +474,11 @@ float () Sentry_Fire = local float barrel_tag; local vector fire_from; +// barrel_tag = gettagindex (self.barrel_ent, "tag_bullet"); barrel_tag = gettagindex (self.barrel_ent, "tag_barrel_bullet1"); fire_from = gettaginfo (self.barrel_ent, barrel_tag); + /* bprint (ftos(barrel_tag)); bprint (" \n"); bprint (vtos(fire_from)); @@ -487,8 +489,34 @@ float () Sentry_Fire = //(entity targ, entity inflictor, entity attacker, float damage) T_Damage // fireBullet (fire_from, dir, .1, 2, 666, 1); // T_Damage(self.enemy, self, self, 4); -// dir = (self.enemy.origin - fire_from); -fire_from = fire_from + v_forward + v_up; +//fire_from = fire_from + self.barrel_ent.view_ofs + v_forward + v_right + v_up; + +local entity testent; +local entity testent2; + +testent = spawn (); +testent.movetype = 0; +testent.solid = SOLID_BBOX; +setmodel(testent, "models/sentry/bullet.MD3"); +//setorigin(testent, fire_from); +setattachment(testent, self.barrel_ent, "tag_barrel_bullet1"); + +barrel_tag = gettagindex (testent, ""); +fire_from = gettaginfo (testent, barrel_tag); +dir = (self.enemy.origin - fire_from); + + +//barrel_tag = gettagindex (testent, "tag_bullet"); +//fire_from = gettaginfo (testent, testent.tag_index); +//dir = (self.enemy.origin - fire_from); + +/*testent2 = spawn (); +testent2.movetype = 0; +testent2.solid = SOLID_BBOX; +//testent2.scale = 5; +setmodel(testent2, "models/plasmatrail.mdl"); +setorigin(testent2, fire_from);*/ + W_Sentry_Fire(fire_from, dir, 4); diff --git a/TeamNexuiz/game/progs.src b/TeamNexuiz/game/progs.src index 1f65b2a70..99c08d76e 100644 --- a/TeamNexuiz/game/progs.src +++ b/TeamNexuiz/game/progs.src @@ -10,6 +10,7 @@ gamec/tfitems.c // TF Items gamec/tfclient.c // TF Client-Side stuff gamec/tfplats.c // TF Platforms gamec/tfgrenades.c // TF Grenades +gamec/tfmenus.c // TF Text Menus gamec/extensions.h @@ -80,6 +81,8 @@ gamec/domination.c gamec/mauvebot.c gamec/tfai.c // TF AI +gamec/tfsentry.c // TF Sentry Gun +gamec/tftesla.c // TF Tesla Coil gamec/tfcombat.c // TF Combat System gamec/tfmapitems.c // TF Map Items gamec/tfbuttons.c // TF Buttons -- 2.39.2