]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add healing logic, add burst_damage
authorSamual Lenks <samual@xonotic.org>
Wed, 19 Feb 2014 19:49:10 +0000 (14:49 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 19 Feb 2014 19:49:10 +0000 (14:49 -0500)
bal-wep-xonotic.cfg
qcsrc/common/weapons/w_arc.qc

index 04bc67fd37d631e32369d7dff1b5672e862f1bed..02c71b0ba6905ff1708b3a5cad794dfe1c7f6c69 100644 (file)
@@ -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 ""
index 575392f8ca9f96d043dbb968dc8d8c0059963419..d75fc183e2e37e3259ccb46075a450229d3b3bdd 100644 (file)
@@ -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))
                                {