From e24fab6d34326e758ca5219094343d5480dc8197 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Wed, 19 Feb 2014 14:49:10 -0500 Subject: [PATCH] Add healing logic, add burst_damage --- bal-wep-xonotic.cfg | 7 ++++++ qcsrc/common/weapons/w_arc.qc | 46 ++++++++++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/bal-wep-xonotic.cfg b/bal-wep-xonotic.cfg index 04bc67fd3..02c71b0ba 100644 --- a/bal-wep-xonotic.cfg +++ b/bal-wep-xonotic.cfg @@ -254,12 +254,19 @@ set g_balance_arc_beam_falloff_halflifedist 0 set g_balance_arc_beam_falloff_maxdist 0 set g_balance_arc_beam_falloff_mindist 0 set g_balance_arc_beam_force 2000 +set g_balance_arc_beam_healing_amax 200 +set g_balance_arc_beam_healing_aps 50 +set g_balance_arc_beam_healing_hmax 200 +set g_balance_arc_beam_healing_hps 50 set g_balance_arc_beam_maxangle 10 set g_balance_arc_beam_nonplayerdamage 80 set g_balance_arc_beam_range 1000 set g_balance_arc_beam_refire 0.5 set g_balance_arc_beam_returnspeed 8 set g_balance_arc_beam_tightness 0.5 +set g_balance_arc_burst_damage 500 +set g_balance_arc_burst_healing_aps 100 +set g_balance_arc_burst_healing_hps 100 set g_balance_arc_switchdelay_drop 0.3 set g_balance_arc_switchdelay_raise 0.3 set g_balance_arc_weaponreplace "" diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index 575392f8c..d75fc183e 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -28,12 +28,19 @@ REGISTER_WEAPON( w_cvar(id, sn, NONE, beam_falloff_maxdist) \ w_cvar(id, sn, NONE, beam_falloff_mindist) \ w_cvar(id, sn, NONE, beam_force) \ + w_cvar(id, sn, NONE, beam_healing_amax) \ + w_cvar(id, sn, NONE, beam_healing_aps) \ + w_cvar(id, sn, NONE, beam_healing_hmax) \ + w_cvar(id, sn, NONE, beam_healing_hps) \ w_cvar(id, sn, NONE, beam_maxangle) \ w_cvar(id, sn, NONE, beam_nonplayerdamage) \ w_cvar(id, sn, NONE, beam_range) \ w_cvar(id, sn, NONE, beam_refire) \ w_cvar(id, sn, NONE, beam_returnspeed) \ w_cvar(id, sn, NONE, beam_tightness) \ + w_cvar(id, sn, NONE, burst_damage) \ + w_cvar(id, sn, NONE, burst_healing_aps) \ + w_cvar(id, sn, NONE, burst_healing_hps) \ w_prop(id, sn, float, switchdelay_raise, switchdelay_raise) \ w_prop(id, sn, float, switchdelay_drop, switchdelay_drop) \ w_prop(id, sn, string, weaponreplace, weaponreplace) \ @@ -300,16 +307,47 @@ void W_Arc_Beam_Think(void) if(is_player && SAME_TEAM(self.owner, trace_ent)) { - // hit a team mate heal them now - new_beam_type = ARC_BT_HEAL; + float roothealth, rootarmor; + if(burst) + { + roothealth = WEP_CVAR(arc, burst_healing_hps); + rootarmor = WEP_CVAR(arc, burst_healing_aps); + } + else + { + roothealth = WEP_CVAR(arc, beam_healing_hps); + rootarmor = WEP_CVAR(arc, beam_healing_aps); + } + + if(trace_ent.health <= WEP_CVAR(arc, beam_healing_hmax) && roothealth) + { + trace_ent.health = min(trace_ent.health + (roothealth * dt), WEP_CVAR(arc, beam_healing_hmax)); + } + if(trace_ent.armorvalue <= WEP_CVAR(arc, beam_healing_amax) && rootarmor) + { + trace_ent.armorvalue = min(trace_ent.armorvalue + (rootarmor * dt), WEP_CVAR(arc, beam_healing_amax)); + } + + // stop rot, set visual effect + if(roothealth || rootarmor) + { + trace_ent.pauserothealth_finished = max(trace_ent.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot); + trace_ent.pauserotarmor_finished = max(trace_ent.pauserotarmor_finished, time + autocvar_g_balance_pause_armor_rot); + new_beam_type = ARC_BT_HEAL; + } } else { float rootdamage; if(is_player) - rootdamage = WEP_CVAR(arc, beam_damage); + { + if(burst) + { rootdamage = WEP_CVAR(arc, burst_damage); } + else + { rootdamage = WEP_CVAR(arc, beam_damage); } + } else - rootdamage = WEP_CVAR(arc, beam_nonplayerdamage); + { rootdamage = WEP_CVAR(arc, beam_nonplayerdamage); } if(accuracy_isgooddamage(self.owner, trace_ent)) { -- 2.39.2