From: Samual Lenks Date: Mon, 1 Jul 2013 00:28:57 +0000 (-0400) Subject: More work on config X-Git-Tag: xonotic-v0.8.0~152^2~355 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf40d15309613ea166d29da0b526f0a3f292971e;p=xonotic%2Fxonotic-data.pk3dir.git More work on config --- diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index 1645a62bc..7bbe29d6e 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -4,7 +4,7 @@ g_mod_balance Xonotic set g_start_weapon_laser -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" set g_start_weapon_shotgun -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" set g_start_weapon_uzi -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" -set g_start_weapon_grenadelauncher -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" +set g_start_weapon_mortar -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" set g_start_weapon_electro -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" set g_start_weapon_crylink -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" set g_start_weapon_nex -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default" @@ -374,51 +374,51 @@ set g_balance_uzi_reload_ammo 60 //default: 30 set g_balance_uzi_reload_time 2 // }}} // {{{ mortar -set g_balance_grenadelauncher_primary_type 0 -set g_balance_grenadelauncher_primary_damage 50 -set g_balance_grenadelauncher_primary_edgedamage 25 -set g_balance_grenadelauncher_primary_force 250 -set g_balance_grenadelauncher_primary_radius 120 -set g_balance_grenadelauncher_primary_speed 1900 -set g_balance_grenadelauncher_primary_speed_up 225 -set g_balance_grenadelauncher_primary_speed_z 0 -set g_balance_grenadelauncher_primary_spread 0 -set g_balance_grenadelauncher_primary_lifetime 5 -set g_balance_grenadelauncher_primary_lifetime2 1 -set g_balance_grenadelauncher_primary_refire 0.8 -set g_balance_grenadelauncher_primary_animtime 0.3 -set g_balance_grenadelauncher_primary_ammo 2 -set g_balance_grenadelauncher_primary_health 15 -set g_balance_grenadelauncher_primary_damageforcescale 0 -set g_balance_grenadelauncher_primary_remote_minbouncecnt 0 +set g_balance_mortar_primary_type 0 +set g_balance_mortar_primary_damage 50 +set g_balance_mortar_primary_edgedamage 25 +set g_balance_mortar_primary_force 250 +set g_balance_mortar_primary_radius 120 +set g_balance_mortar_primary_speed 1900 +set g_balance_mortar_primary_speed_up 225 +set g_balance_mortar_primary_speed_z 0 +set g_balance_mortar_primary_spread 0 +set g_balance_mortar_primary_lifetime 5 +set g_balance_mortar_primary_lifetime2 1 +set g_balance_mortar_primary_refire 0.8 +set g_balance_mortar_primary_animtime 0.3 +set g_balance_mortar_primary_ammo 2 +set g_balance_mortar_primary_health 15 +set g_balance_mortar_primary_damageforcescale 0 +set g_balance_mortar_primary_remote_minbouncecnt 0 -set g_balance_grenadelauncher_secondary_type 1 -set g_balance_grenadelauncher_secondary_damage 60 -set g_balance_grenadelauncher_secondary_edgedamage 30 -set g_balance_grenadelauncher_secondary_force 250 -set g_balance_grenadelauncher_secondary_radius 120 -set g_balance_grenadelauncher_secondary_speed 1400 -set g_balance_grenadelauncher_secondary_speed_up 150 -set g_balance_grenadelauncher_secondary_speed_z 0 -set g_balance_grenadelauncher_secondary_spread 0 -set g_balance_grenadelauncher_secondary_lifetime 5 -set g_balance_grenadelauncher_secondary_lifetime_bounce 0.5 -set g_balance_grenadelauncher_secondary_lifetime_stick 0 -set g_balance_grenadelauncher_secondary_refire 0.7 -set g_balance_grenadelauncher_secondary_animtime 0.3 -set g_balance_grenadelauncher_secondary_ammo 2 -set g_balance_grenadelauncher_secondary_health 30 -set g_balance_grenadelauncher_secondary_damageforcescale 4 -set g_balance_grenadelauncher_secondary_remote_detonateprimary 0 +set g_balance_mortar_secondary_type 1 +set g_balance_mortar_secondary_damage 60 +set g_balance_mortar_secondary_edgedamage 30 +set g_balance_mortar_secondary_force 250 +set g_balance_mortar_secondary_radius 120 +set g_balance_mortar_secondary_speed 1400 +set g_balance_mortar_secondary_speed_up 150 +set g_balance_mortar_secondary_speed_z 0 +set g_balance_mortar_secondary_spread 0 +set g_balance_mortar_secondary_lifetime 5 +set g_balance_mortar_secondary_lifetime_bounce 0.5 +set g_balance_mortar_secondary_lifetime_stick 0 +set g_balance_mortar_secondary_refire 0.7 +set g_balance_mortar_secondary_animtime 0.3 +set g_balance_mortar_secondary_ammo 2 +set g_balance_mortar_secondary_health 30 +set g_balance_mortar_secondary_damageforcescale 4 +set g_balance_mortar_secondary_remote_detonateprimary 0 -set g_balance_grenadelauncher_bouncefactor 0.5 -set g_balance_grenadelauncher_bouncestop 0.075 +set g_balance_mortar_bouncefactor 0.5 +set g_balance_mortar_bouncestop 0.075 -set g_balance_grenadelauncher_switchdelay_drop 0.2 -set g_balance_grenadelauncher_switchdelay_raise 0.2 +set g_balance_mortar_switchdelay_drop 0.2 +set g_balance_mortar_switchdelay_raise 0.2 -set g_balance_grenadelauncher_reload_ammo 0 //default: 12 -set g_balance_grenadelauncher_reload_time 2 +set g_balance_mortar_reload_ammo 0 //default: 12 +set g_balance_mortar_reload_time 2 // }}} // {{{ electro set g_balance_electro_lightning 0 @@ -671,7 +671,7 @@ set g_balance_devastator_lifetime 10 set g_balance_devastator_refire 1.1 set g_balance_devastator_animtime 0.4 set g_balance_devastator_ammo 4 -set g_balance_devastator_health 30 // 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but grenadelauncher still can most the time. +set g_balance_devastator_health 30 // 30 // 5 hitpoints above maximum laser value -- this way lasers can't blow it up, but mortar still can most the time. set g_balance_devastator_damageforcescale 1 // low damage force scale so that it can still be affected by other hits, but not so much that it does a 90 degree turn set g_balance_devastator_detonatedelay 0.02 // positive: timer till detonation is allowed, negative: "security device" that prevents ANY remote detonation if it could hurt its owner, zero: detonatable at any time set g_balance_devastator_guiderate 90 // max degrees per second diff --git a/qcsrc/common/weapons/config.qh b/qcsrc/common/weapons/config.qh index 3945ead23..b2dd89f39 100644 --- a/qcsrc/common/weapons/config.qh +++ b/qcsrc/common/weapons/config.qh @@ -11,7 +11,6 @@ float WEP_CONFIG_COUNT; string wep_config_queue[MAX_WEP_CONFIG]; #define WEP_CONFIG_QUEUE(a) { \ - print(sprintf("foobar: %g: %s\n", WEP_CONFIG_COUNT, a)); \ wep_config_queue[WEP_CONFIG_COUNT] = a; \ ++WEP_CONFIG_COUNT; } @@ -49,7 +48,8 @@ string wep_config_queue[MAX_WEP_CONFIG]; #name, \ autocvar_g_balance_##weapon##_##name)) } \ #endif - + +// WEAPONTODO: remove prop #define WEP_CONFIG_WRITE_PROPS(weapon,prop,name) \ { WEP_CONFIG_QUEUE(sprintf("set g_balance_%s_%s %g\n", \ #weapon, \ diff --git a/qcsrc/common/weapons/w_devastator.qc b/qcsrc/common/weapons/w_devastator.qc index c947cf905..4bee14be9 100644 --- a/qcsrc/common/weapons/w_devastator.qc +++ b/qcsrc/common/weapons/w_devastator.qc @@ -35,6 +35,7 @@ REGISTER_WEAPON( WEP_ADD_CVAR(weapon, MO_NONE, speed) \ WEP_ADD_CVAR(weapon, MO_NONE, speedaccel) \ WEP_ADD_CVAR(weapon, MO_NONE, speedstart) \ + WEP_ADD_CVAR(weapon, MO_NONE, foobarsdfsd) \ WEP_ADD_PROP(weapon, reloading_ammo, reload_ammo) \ WEP_ADD_PROP(weapon, reloading_time, reload_time) \ WEP_ADD_PROP(weapon, switchdelay_raise, switchdelay_raise) \ diff --git a/qcsrc/common/weapons/w_fireball.qc b/qcsrc/common/weapons/w_fireball.qc index 72a597712..f2a558fc2 100644 --- a/qcsrc/common/weapons/w_fireball.qc +++ b/qcsrc/common/weapons/w_fireball.qc @@ -414,6 +414,15 @@ float w_fireball(float req) { return TRUE; // fireball has infinite ammo } + case WR_CONFIG: + { + #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) + #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) + FIREBALL_SETTINGS(fireball) + #undef WEP_ADD_CVAR + #undef WEP_ADD_PROP + return TRUE; + } case WR_RESETPLAYER: { self.fireball_primarytime = time; diff --git a/qcsrc/common/weapons/w_hook.qc b/qcsrc/common/weapons/w_hook.qc index cca5aa1ad..6d4c39fee 100644 --- a/qcsrc/common/weapons/w_hook.qc +++ b/qcsrc/common/weapons/w_hook.qc @@ -311,6 +311,15 @@ float w_hook(float req) { return self.ammo_cells >= WEP_CVAR_SEC(hook, ammo); } + case WR_CONFIG: + { + #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) + #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) + HOOK_SETTINGS(hook) + #undef WEP_ADD_CVAR + #undef WEP_ADD_PROP + return TRUE; + } case WR_RESETPLAYER: { self.hook_refire = time; diff --git a/qcsrc/common/weapons/w_machinegun.qc b/qcsrc/common/weapons/w_machinegun.qc index 93eee7df1..cc12a99ce 100644 --- a/qcsrc/common/weapons/w_machinegun.qc +++ b/qcsrc/common/weapons/w_machinegun.qc @@ -349,6 +349,15 @@ float w_uzi(float req) } return ammo_amount; } + case WR_CONFIG: + { + #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) + #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) + UZI_SETTINGS(uzi) + #undef WEP_ADD_CVAR + #undef WEP_ADD_PROP + return TRUE; + } case WR_RELOAD: { W_Reload(min(max(WEP_CVAR(uzi, sustained_ammo), WEP_CVAR(uzi, first_ammo)), WEP_CVAR(uzi, burst_ammo)), autocvar_g_balance_uzi_reload_ammo, autocvar_g_balance_uzi_reload_time, "weapons/reload.wav"); diff --git a/qcsrc/common/weapons/w_minelayer.qc b/qcsrc/common/weapons/w_minelayer.qc index a2fd7e8c7..931d599dc 100644 --- a/qcsrc/common/weapons/w_minelayer.qc +++ b/qcsrc/common/weapons/w_minelayer.qc @@ -563,6 +563,15 @@ float w_minelayer(float req) else return FALSE; } + case WR_CONFIG: + { + #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) + #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) + MINELAYER_SETTINGS(minelayer) + #undef WEP_ADD_CVAR + #undef WEP_ADD_PROP + return TRUE; + } case WR_RESETPLAYER: { self.minelayer_mines = 0; diff --git a/qcsrc/common/weapons/w_porto.qc b/qcsrc/common/weapons/w_porto.qc index a6164362c..a0eb6cc0e 100644 --- a/qcsrc/common/weapons/w_porto.qc +++ b/qcsrc/common/weapons/w_porto.qc @@ -297,6 +297,15 @@ float w_porto(float req) return TRUE; } + case WR_CONFIG: + { + #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) + #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) + PORTO_SETTINGS(porto) + #undef WEP_ADD_CVAR + #undef WEP_ADD_PROP + return TRUE; + } case WR_THINK: { if(WEP_CVAR(porto, secondary)) diff --git a/qcsrc/common/weapons/w_rifle.qc b/qcsrc/common/weapons/w_rifle.qc index f2b67ffc2..a7c7e262e 100644 --- a/qcsrc/common/weapons/w_rifle.qc +++ b/qcsrc/common/weapons/w_rifle.qc @@ -230,6 +230,15 @@ float w_rifle(float req) ammo_amount += self.(weapon_load[WEP_RIFLE]) >= WEP_CVAR_SEC(rifle, ammo); return ammo_amount; } + case WR_CONFIG: + { + #define WEP_ADD_CVAR(weapon,mode,name) WEP_CONFIG_WRITE_CVARS(weapon,mode,name) + #define WEP_ADD_PROP(weapon,prop,name) WEP_CONFIG_WRITE_PROPS(weapon,prop,name) + RIFLE_SETTINGS(rifle) + #undef WEP_ADD_CVAR + #undef WEP_ADD_PROP + return TRUE; + } case WR_RESETPLAYER: { self.rifle_accumulator = time - WEP_CVAR(rifle, bursttime);