From 70abbe64fcd93db5d9d1789fa5313fd8891b5508 Mon Sep 17 00:00:00 2001 From: div0 Date: Thu, 4 Sep 2008 12:16:23 +0000 Subject: [PATCH] make item respawn times customizable as groups; fix weapons cfg git-svn-id: svn://svn.icculus.org/nexuiz/trunk@4335 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/defs.qh | 4 +++ data/qcsrc/server/miscfunctions.qc | 5 ++++ data/qcsrc/server/t_items.qc | 42 ++++++++++++++++-------------- data/weapons.cfg | 6 ++++- data/weaponsPro.cfg | 29 ++++++++++++++++++--- 5 files changed, 63 insertions(+), 23 deletions(-) diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 74f258f9d..3597780d9 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -22,6 +22,10 @@ float g_tourney; float g_ctf_win_mode; float g_race_qualifying; float tourneyInMatchStage; +float g_pickup_respawntime_short; +float g_pickup_respawntime_medium; +float g_pickup_respawntime_long; +float g_pickup_respawntime_powerup; float sv_cheats; float sv_gentle; diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index f2ad56faa..2a381c8c4 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -737,6 +737,11 @@ void readlevelcvars(void) sv_pogostick = cvar("sv_pogostick"); sv_doublejump = cvar("sv_doublejump"); + g_pickup_respawntime_short = cvar("g_pickup_respawntime_short"); + g_pickup_respawntime_medium = cvar("g_pickup_respawntime_medium"); + g_pickup_respawntime_long = cvar("g_pickup_respawntime_long"); + g_pickup_respawntime_powerup = cvar("g_pickup_respawntime_powerup"); + if(g_minstagib) g_nixnex = g_rocketarena = 0; if(g_nixnex) g_rocketarena = 0; diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 2855bab80..8f8e93e36 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -556,7 +556,7 @@ void minstagib_items (float itemid) self.effects = EF_ADDITIVE; self.strength_finished = 30; StartItem ("models/items/g_strength.md3", - "misc/powerup.wav", 120, + "misc/powerup.wav", g_pickup_respawntime_powerup, "Invisibility", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 1000); } // replace with extra lives @@ -564,7 +564,7 @@ void minstagib_items (float itemid) { self.max_health = 1; StartItem ("models/items/g_h100.md3", - "misc/megahealth.wav", 120, + "misc/megahealth.wav", g_pickup_respawntime_powerup, "Extralife", IT_NAILS, 0, FL_POWERUP, generic_pickupevalfunc, 1000); } @@ -574,7 +574,7 @@ void minstagib_items (float itemid) self.effects = EF_ADDITIVE; self.invincible_finished = 30; StartItem ("models/items/g_invincible.md3", - "misc/powerup_shield.wav", 120, + "misc/powerup_shield.wav", g_pickup_respawntime_powerup, "Speed", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 1000); } @@ -591,9 +591,12 @@ float weaponswapping; void weapon_defaultspawnfunc(float wpn, float weight) { entity e; + float t; var .float ammofield; e = get_weaponinfo(wpn); + t = g_pickup_respawntime_short; + if(e.items && e.items != IT_SUPERWEAPON) { ammofield = Item_CounterField(e.items); @@ -601,7 +604,10 @@ void weapon_defaultspawnfunc(float wpn, float weight) self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(e.items))); } - StartItem (e.model, "weapons/weaponpickup.wav", 15, e.message, 0, e.weapons, FL_WEAPON, weapon_pickupevalfunc, weight); + if(e.items == IT_SUPERWEAPON) + t = g_pickup_respawntime_powerup; + + StartItem (e.model, "weapons/weaponpickup.wav", t, e.message, 0, e.weapons, FL_WEAPON, weapon_pickupevalfunc, weight); if (self.modelindex) // don't precache if self was removed weapon_action(e.weapon, WR_PRECACHE); } @@ -668,7 +674,7 @@ void spawnfunc_weapon_rocketlauncher (void) void spawnfunc_item_rockets (void) { if(!self.ammo_rockets) self.ammo_rockets = g_pickup_rockets; - StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", 15, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000); + StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", g_pickup_respawntime_short, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000); } void spawnfunc_item_shells (void); @@ -685,13 +691,13 @@ void spawnfunc_item_bullets (void) { if(!self.ammo_nails) self.ammo_nails = g_pickup_nails; - StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", 15, "bullets", IT_NAILS, 0, 0, commodity_pickupevalfunc, 2000); + StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", g_pickup_respawntime_short, "bullets", IT_NAILS, 0, 0, commodity_pickupevalfunc, 2000); } void spawnfunc_item_cells (void) { if(!self.ammo_cells) self.ammo_cells = g_pickup_cells; - StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", 15, "cells", IT_CELLS, 0, 0, commodity_pickupevalfunc, 2000); + StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_short, "cells", IT_CELLS, 0, 0, commodity_pickupevalfunc, 2000); } void spawnfunc_item_shells (void) { @@ -707,7 +713,7 @@ void spawnfunc_item_shells (void) { if(!self.ammo_shells) self.ammo_shells = g_pickup_shells; - StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", 15, "shells", IT_SHELLS, 0, 0, commodity_pickupevalfunc, 500); + StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", g_pickup_respawntime_short, "shells", IT_SHELLS, 0, 0, commodity_pickupevalfunc, 500); } void spawnfunc_item_armor_small (void) { @@ -715,7 +721,7 @@ void spawnfunc_item_armor_small (void) { self.armorvalue = g_pickup_armorsmall; if(!self.max_armorvalue) self.max_armorvalue = g_pickup_armorsmall_max; - StartItem ("models/items/g_a1.md3", "misc/armor1.wav", 15, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, 1000); + StartItem ("models/items/g_a1.md3", "misc/armor1.wav", g_pickup_respawntime_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, 1000); } void spawnfunc_item_armor_medium (void) { @@ -723,7 +729,7 @@ void spawnfunc_item_armor_medium (void) { self.armorvalue = g_pickup_armormedium; if(!self.max_armorvalue) self.max_armorvalue = g_pickup_armormedium_max; - StartItem ("models/items/g_armormedium.md3", "misc/armor1.wav", 20, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000); + StartItem ("models/items/g_armormedium.md3", "misc/armor1.wav", g_pickup_respawntime_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000); } void spawnfunc_item_armor_large (void) { @@ -731,7 +737,7 @@ void spawnfunc_item_armor_large (void) { self.armorvalue = g_pickup_armorlarge; if(!self.max_armorvalue) self.max_armorvalue = g_pickup_armorlarge_max; - StartItem ("models/items/g_a25.md3", "misc/armor25.wav", 30, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000); + StartItem ("models/items/g_a25.md3", "misc/armor25.wav", g_pickup_respawntime_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000); } void spawnfunc_item_health_small (void) { @@ -739,7 +745,7 @@ void spawnfunc_item_health_small (void) { self.max_health = g_pickup_healthsmall_max; if(!self.health) self.health = g_pickup_healthsmall; - StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", 15, "5 Health", IT_5HP, 0, 0, commodity_pickupevalfunc, 20000); + StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", g_pickup_respawntime_short, "5 Health", IT_5HP, 0, 0, commodity_pickupevalfunc, 20000); } void spawnfunc_item_health_medium (void) { @@ -747,7 +753,7 @@ void spawnfunc_item_health_medium (void) { self.max_health = g_pickup_healthmedium_max; if(!self.health) self.health = g_pickup_healthmedium; - StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", 15, "25 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, 20000); + StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", g_pickup_respawntime_short, "25 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, 20000); } void spawnfunc_item_health_large (void) { @@ -755,7 +761,7 @@ void spawnfunc_item_health_large (void) { self.max_health = g_pickup_healthlarge_max; if(!self.health) self.health = g_pickup_healthlarge; - StartItem ("models/items/g_h50.md3", "misc/mediumhealth.wav", 20, "50 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, 20000); + StartItem ("models/items/g_h50.md3", "misc/mediumhealth.wav", g_pickup_respawntime_medium, "50 Health", IT_25HP, 0, 0, commodity_pickupevalfunc, 20000); } void spawnfunc_item_health_mega (void) { @@ -772,7 +778,7 @@ void spawnfunc_item_health_mega (void) { self.max_health = g_pickup_healthmega_max; if(!self.health) self.health = g_pickup_healthmega; - StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", 30, "100 Health", IT_HEALTH, 0, 0, commodity_pickupevalfunc, 20000); + StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", g_pickup_respawntime_long, "100 Health", IT_HEALTH, 0, 0, commodity_pickupevalfunc, 20000); } } @@ -796,7 +802,7 @@ void spawnfunc_item_strength (void) { precache_sound("weapons/strength_fire.wav"); self.strength_finished = 30; self.effects = EF_ADDITIVE; - StartItem ("models/items/g_strength.md3", "misc/powerup.wav", 120, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000); + StartItem ("models/items/g_strength.md3", "misc/powerup.wav", g_pickup_respawntime_powerup, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000); } } @@ -812,11 +818,9 @@ void spawnfunc_item_invincible (void) { } else { self.invincible_finished = 30; self.effects = EF_ADDITIVE; - StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", 120, "Invulnerability", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000); + StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", g_pickup_respawntime_powerup, "Invulnerability", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000); } } -//void item_speed (void) {self.speed_finished = 30;StartItem ("models/items/g_speed.md3", "misc/powerup.wav", 120, "Speed Powerup", IT_SPEED, FL_POWERUP, generic_pickupevalfunc, 10000);} -//void item_slowmo (void) {self.slowmo_finished = 30;StartItem ("models/items/g_slowmo.md3", "misc/powerup.wav", 120, "Slow Motion", IT_SLOWMO, FL_POWERUP, generic_pickupevalfunc, 10000);} void spawnfunc_item_minst_cells (void) { if (g_minstagib) diff --git a/data/weapons.cfg b/data/weapons.cfg index 7a0244362..4cd859e84 100644 --- a/data/weapons.cfg +++ b/data/weapons.cfg @@ -35,6 +35,10 @@ set g_pickup_healthlarge 50 set g_pickup_healthlarge_max 999 set g_pickup_healthmega 100 set g_pickup_healthmega_max 999 +set g_pickup_respawntime_short 15 +set g_pickup_respawntime_medium 20 +set g_pickup_respawntime_long 30 +set g_pickup_respawntime_powerup 120 set g_balance_laser_primary_damage 35 set g_balance_laser_primary_edgedamage 10 @@ -170,7 +174,7 @@ set g_balance_nex_refire 1.5 set g_balance_nex_animtime 0.3 set g_balance_nex_ammo 5 -set g_balance_minstanex_refire 1.5 +set g_balance_minstanex_refire 1 set g_balance_minstanex_animtime 0.3 set g_balance_minstanex_ammo 10 diff --git a/data/weaponsPro.cfg b/data/weaponsPro.cfg index 8e184246e..7e0c1d485 100644 --- a/data/weaponsPro.cfg +++ b/data/weaponsPro.cfg @@ -7,6 +7,8 @@ set g_start_weapon_crylink 0 set g_start_weapon_nex 0 set g_start_weapon_hagar 0 set g_start_weapon_rocketlauncher 0 +set g_start_weapon_minstanex 0 +set g_start_weapon_porto 0 set g_start_ammo_shells 40 set g_start_ammo_nails 0 set g_start_ammo_rockets 0 @@ -33,6 +35,10 @@ set g_pickup_healthlarge 50 set g_pickup_healthlarge_max 100 set g_pickup_healthmega 100 set g_pickup_healthmega_max 200 +set g_pickup_respawntime_short 15 +set g_pickup_respawntime_medium 20 +set g_pickup_respawntime_long 30 +set g_pickup_respawntime_powerup 120 set g_balance_laser_primary_damage 20 set g_balance_laser_primary_edgedamage 10 @@ -131,12 +137,19 @@ set g_balance_crylink_primary_radius 20 set g_balance_crylink_primary_speed 7000 set g_balance_crylink_primary_spread 0 set g_balance_crylink_primary_shots 1 -set g_balance_crylink_primary_lifetime 30 set g_balance_crylink_primary_bounces 0 set g_balance_crylink_primary_refire 0.1 set g_balance_crylink_primary_animtime 0.1 set g_balance_crylink_primary_ammo 1 set g_balance_crylink_primary_bouncedamagefactor 0.5 + +set g_balance_crylink_primary_middle_lifetime 30 // range: virtually infinite +set g_balance_crylink_primary_middle_fadetime 0 +set g_balance_crylink_primary_star_lifetime 0.1 // range: 700 full, fades to 2100 +set g_balance_crylink_primary_star_fadetime 0.2 +set g_balance_crylink_primary_other_lifetime 0.1 // range: 700 full, fades to 2100 +set g_balance_crylink_primary_other_fadetime 0.2 + set g_balance_crylink_secondary_damage 15 set g_balance_crylink_secondary_edgedamage 0 set g_balance_crylink_secondary_force 100 @@ -144,20 +157,24 @@ set g_balance_crylink_secondary_radius 20 set g_balance_crylink_secondary_speed 7000 set g_balance_crylink_secondary_spread 0.08 set g_balance_crylink_secondary_shots 5 -set g_balance_crylink_secondary_lifetime 30 set g_balance_crylink_secondary_bounces 0 set g_balance_crylink_secondary_refire 0.6 set g_balance_crylink_secondary_animtime 0.3 set g_balance_crylink_secondary_ammo 5 set g_balance_crylink_secondary_bouncedamagefactor 0.5 +set g_balance_crylink_secondary_middle_lifetime 30 // range: virtually infinite +set g_balance_crylink_secondary_middle_fadetime 0 +set g_balance_crylink_secondary_line_lifetime 30 // range: virtually infinite +set g_balance_crylink_secondary_line_fadetime 0 + set g_balance_nex_damage 70 set g_balance_nex_force 0 set g_balance_nex_refire 0.7 set g_balance_nex_animtime 0.3 set g_balance_nex_ammo 5 -set g_balance_minstanex_refire 1.5 +set g_balance_minstanex_refire 1 set g_balance_minstanex_animtime 0.3 set g_balance_minstanex_ammo 10 @@ -197,3 +214,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 -- 2.39.2