From 699cf8fcd1292c1b476bda79b86e317a573d48f4 Mon Sep 17 00:00:00 2001 From: div0 Date: Tue, 2 Sep 2008 19:06:56 +0000 Subject: [PATCH] new weapon (no models for it yet, and still using debug code): the Port-O-Launch To activate, use impulse 99 and impulse 239. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4297 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/common/constants.qh | 26 ++++++++-------- data/qcsrc/server/cl_weapons.qc | 19 ++++++------ data/qcsrc/server/portals.qc | 2 ++ data/qcsrc/server/progs.src | 1 + data/qcsrc/server/w_grenadelauncher.qc | 42 -------------------------- data/scripts/entities.def | 2 +- data/weapons.cfg | 7 ++++- data/weaponsPro.cfg | 1 - 8 files changed, 34 insertions(+), 66 deletions(-) diff --git a/data/qcsrc/common/constants.qh b/data/qcsrc/common/constants.qh index 649631280..8f94fe38a 100644 --- a/data/qcsrc/common/constants.qh +++ b/data/qcsrc/common/constants.qh @@ -277,23 +277,25 @@ const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint // Weapon indexes // %weaponaddpoint float WEP_FIRST = 1; -float WEP_LASER = 1; float WEPBIT_LASER = 1; // always: 2^(w-1) -float WEP_SHOTGUN = 2; float WEPBIT_SHOTGUN = 2; -float WEP_UZI = 3; float WEPBIT_UZI = 4; -float WEP_GRENADE_LAUNCHER = 4; float WEPBIT_GRENADE_LAUNCHER = 8; -float WEP_ELECTRO = 5; float WEPBIT_ELECTRO = 16; -float WEP_CRYLINK = 6; float WEPBIT_CRYLINK = 32; -float WEP_NEX = 7; float WEPBIT_NEX = 64; -float WEP_HAGAR = 8; float WEPBIT_HAGAR = 128; -float WEP_ROCKET_LAUNCHER = 9; float WEPBIT_ROCKET_LAUNCHER = 256; -float WEP_LAST = 9; float WEPBIT_ALL = 511; -float WEP_COUNT = 10; +float WEP_LASER = 1; float WEPBIT_LASER = 1; // always: 2^(w-1) +float WEP_SHOTGUN = 2; float WEPBIT_SHOTGUN = 2; +float WEP_UZI = 3; float WEPBIT_UZI = 4; +float WEP_GRENADE_LAUNCHER = 4; float WEPBIT_GRENADE_LAUNCHER = 8; +float WEP_ELECTRO = 5; float WEPBIT_ELECTRO = 16; +float WEP_CRYLINK = 6; float WEPBIT_CRYLINK = 32; +float WEP_NEX = 7; float WEPBIT_NEX = 64; +float WEP_HAGAR = 8; float WEPBIT_HAGAR = 128; +float WEP_ROCKET_LAUNCHER = 9; float WEPBIT_ROCKET_LAUNCHER = 256; +float WEP_PORTO = 10; float WEPBIT_PORTO = 512; +float WEP_LAST = 10; float WEPBIT_ALL = 1023; +float WEP_COUNT = 11; float IT_SHELLS = 256; float IT_NAILS = 512; float IT_ROCKETS = 1024; float IT_CELLS = 2048; -float IT_AMMO = 3840; +float IT_SUPERWEAPON = 4096; +float IT_AMMO = 7936; float IT_STRENGTH = 8192; float IT_INVINCIBLE = 16384; float IT_HEALTH = 32768; diff --git a/data/qcsrc/server/cl_weapons.qc b/data/qcsrc/server/cl_weapons.qc index eeb1be2a5..68d972bf1 100644 --- a/data/qcsrc/server/cl_weapons.qc +++ b/data/qcsrc/server/cl_weapons.qc @@ -415,13 +415,14 @@ void Nixnex_GiveCurrentWeapon() void RegisterWeapons() { // %weaponaddpoint - register_weapon(WEP_LASER, w_laser, 0, "laser", "laser", "Laser"); - register_weapon(WEP_SHOTGUN, w_shotgun, IT_SHELLS, "shotgun", "shotgun", "Shotgun"); - register_weapon(WEP_UZI, w_uzi, IT_NAILS, "uzi", "uzi", "Machine Gun"); - register_weapon(WEP_GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, "gl", "grenadelauncher", "Mortar"); - register_weapon(WEP_ELECTRO, w_electro, IT_CELLS, "electro", "electro", "Electro"); - register_weapon(WEP_CRYLINK, w_crylink, IT_CELLS, "crylink", "crylink", "Crylink"); - register_weapon(WEP_NEX, w_nex, IT_CELLS, "nex", "nex", "Nex"); - register_weapon(WEP_HAGAR, w_hagar, IT_ROCKETS, "hagar", "hagar", "Hagar"); - register_weapon(WEP_ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, "rl", "rocketlauncher", "Rocket Launcher"); + register_weapon(WEP_LASER, w_laser, 0, "laser", "laser", "Laser"); + register_weapon(WEP_SHOTGUN, w_shotgun, IT_SHELLS, "shotgun", "shotgun", "Shotgun"); + register_weapon(WEP_UZI, w_uzi, IT_NAILS, "uzi", "uzi", "Machine Gun"); + register_weapon(WEP_GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, "gl", "grenadelauncher", "Mortar"); + register_weapon(WEP_ELECTRO, w_electro, IT_CELLS, "electro", "electro", "Electro"); + register_weapon(WEP_CRYLINK, w_crylink, IT_CELLS, "crylink", "crylink", "Crylink"); + register_weapon(WEP_NEX, w_nex, IT_CELLS, "nex", "nex", "Nex"); + register_weapon(WEP_HAGAR, w_hagar, IT_ROCKETS, "hagar", "hagar", "Hagar"); + register_weapon(WEP_ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, "rl", "rocketlauncher", "Rocket Launcher"); + register_weapon(WEP_PORTO, w_porto, IT_CELLS, "porto" , "porto", "Port-O-Launch"); } diff --git a/data/qcsrc/server/portals.qc b/data/qcsrc/server/portals.qc index d22e3f639..a5e5da773 100644 --- a/data/qcsrc/server/portals.qc +++ b/data/qcsrc/server/portals.qc @@ -143,6 +143,8 @@ float Portal_FindSafeOrigin(entity portal) void Portal_Touch() { + if(other.classname == "porto") + return; if(time < self.portal_activatetime) return; makevectors(self.angles); diff --git a/data/qcsrc/server/progs.src b/data/qcsrc/server/progs.src index f795957b8..7e408f666 100644 --- a/data/qcsrc/server/progs.src +++ b/data/qcsrc/server/progs.src @@ -80,6 +80,7 @@ w_crylink.qc w_nex.qc w_hagar.qc w_rocketlauncher.qc +w_porto.qc t_items.qc cl_weapons.qc diff --git a/data/qcsrc/server/w_grenadelauncher.qc b/data/qcsrc/server/w_grenadelauncher.qc index af677ff29..fb286879a 100644 --- a/data/qcsrc/server/w_grenadelauncher.qc +++ b/data/qcsrc/server/w_grenadelauncher.qc @@ -1,8 +1,3 @@ -#ifdef PORTAR -.float portar_grenade_id; -#endif - -#ifndef PORTAR void W_Grenade_Explode (void) { vector org2; @@ -76,27 +71,6 @@ void W_Grenade_Damage (entity inflictor, entity attacker, float damage, float de self.think (); } } -#else -void W_Grenade_Explode (void) -{ - remove(self); -} -void W_Grenade_Touch1 (void) -{ - print(vtos(trace_plane_normal), "\n"); - if(self.portar_grenade_id == 0) - { - self.portar_grenade_id = time; - if(!Portal_SpawnInPortalAtTrace(self.owner, self.velocity, self.portar_grenade_id)) - remove(self); - } - else - { - Portal_SpawnOutPortalAtTrace(self.owner, self.velocity, self.portar_grenade_id); - remove(self); - } -} -#endif void W_Grenade_Attack (void) { @@ -104,11 +78,7 @@ void W_Grenade_Attack (void) if (cvar("g_use_ammunition")) self.ammo_rockets = self.ammo_rockets - cvar("g_balance_grenadelauncher_primary_ammo"); -#ifndef PORTAR W_SetupShot (self, '25 6 -8', FALSE, 4, "weapons/grenade_fire.wav"); -#else - W_SetupShot (self, '0 0 0', FALSE, 4, "weapons/grenade_fire.wav"); -#endif //W_SetupShot (self, '25 8 -8', FALSE, 4, "weapons/grenade_fire.wav"); // TODO: move model to the right a little pointparticles(particleeffectnum("grenadelauncher_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); @@ -118,11 +88,7 @@ void W_Grenade_Attack (void) gren.classname = "grenade"; gren.bot_dodge = TRUE; gren.bot_dodgerating = cvar("g_balance_grenadelauncher_primary_damage"); -#ifndef PORTAR gren.movetype = MOVETYPE_BOUNCE; -#else - gren.movetype = MOVETYPE_BOUNCEMISSILE; -#endif gren.solid = SOLID_BBOX; gren.effects = EF_LOWPRECISION; gren.modelflags = MF_GRENADE; @@ -133,11 +99,7 @@ void W_Grenade_Attack (void) gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime"); gren.think = W_Grenade_Explode; gren.touch = W_Grenade_Touch1; -#ifndef PORTAR gren.velocity = w_shotdir * cvar("g_balance_grenadelauncher_primary_speed") + v_up * cvar("g_balance_grenadelauncher_primary_speed_up"); -#else - gren.velocity = w_shotdir * cvar("g_balance_grenadelauncher_primary_speed"); -#endif W_SetupProjectileVelocity(gren); gren.avelocity_x = random () * -500 - 500; @@ -147,7 +109,6 @@ void W_Grenade_Attack (void) void W_Grenade_Attack2 (void) { -#ifndef PORTAR local entity gren; if (cvar("g_use_ammunition")) @@ -183,9 +144,6 @@ void W_Grenade_Attack2 (void) gren.angles = vectoangles (gren.velocity); gren.flags = FL_PROJECTILE; -#else - // nothing yet (maybe find the last one and detonate it?) -#endif } void spawnfunc_weapon_grenadelauncher (void) diff --git a/data/scripts/entities.def b/data/scripts/entities.def index 0f53c6257..7827f8883 100644 --- a/data/scripts/entities.def +++ b/data/scripts/entities.def @@ -500,7 +500,7 @@ NOANGLE: Ignore angle attenuation. Laser beam emitter -------- KEYS -------- target: target_position the laser targets (may be another entity, preferably target_position, possibly controlled by misc_follow) -mdl: name of particle effect for the beam end point (see effectinfo.txt; default is misc_laser_beam_end) +mdl: name of particle effect for the beam end point (see effectinfo.txt; default is laser_deadly if dmg is set, and none if not) colormod: color of the laser beam (default: red, that is, 1 0 0) dmg: damage inflicted by the beam per second, or -1 for an instant-death ray targetname: name to target this (then its state is toggled) diff --git a/data/weapons.cfg b/data/weapons.cfg index c8a26e707..8df658c4a 100644 --- a/data/weapons.cfg +++ b/data/weapons.cfg @@ -169,7 +169,6 @@ set g_balance_nex_animtime 0.3 set g_balance_minstagib_nex_refire 1.5 set g_balance_minstagib_nex_animtime 0.3 set g_balance_nex_ammo 5 -set g_balance_nex_respawntime_modifier 1 set g_balance_hagar_primary_damage 40 set g_balance_hagar_primary_edgedamage 15 @@ -207,3 +206,9 @@ set g_balance_rocketlauncher_laserguided_speedaccel 0 set g_balance_rocketlauncher_laserguided_speedstart 1000 set g_balance_rocketlauncher_laserguided_turnrate 0.75 //0.5 set g_balance_rocketlauncher_laserguided_allow_steal 1 + +// TESTING: port-o-launch +set g_balance_porto_primary_refire 1.5 +set g_balance_porto_primary_speed 400 +set g_balance_porto_primary_lifetime 10 +set g_balance_porto_primary_ammo 25 diff --git a/data/weaponsPro.cfg b/data/weaponsPro.cfg index 039f7cca7..f2e355a31 100644 --- a/data/weaponsPro.cfg +++ b/data/weaponsPro.cfg @@ -158,7 +158,6 @@ set g_balance_nex_animtime 0.3 set g_balance_minstagib_nex_refire 1.5 set g_balance_minstagib_nex_animtime 0.3 set g_balance_nex_ammo 5 -set g_balance_nex_respawntime_modifier 1 set g_balance_hagar_primary_damage 40 set g_balance_hagar_primary_edgedamage 20 -- 2.39.2