]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: update condition for doing a rocket jump
authorterencehill <piuntn@gmail.com>
Sat, 9 Sep 2017 13:18:38 +0000 (15:18 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 9 Sep 2017 13:18:38 +0000 (15:18 +0200)
qcsrc/server/bot/default/havocbot/havocbot.qc

index a03470e57c1307e024f1d1682dfb45cd50c39aeb..778869f5b6d30c203dbfc44821d06347d9a09ca6 100644 (file)
@@ -615,6 +615,10 @@ void havocbot_movetogoal(entity this)
        if(skill>6)
        if (!(IS_ONGROUND(this)))
        {
+               #define ROCKETJUMP_DAMAGE() WEP_CVAR(devastator, damage) * 0.8 \
+                       * ((this.strength_finished < time) ? autocvar_g_balance_powerup_strength_selfdamage : 1) \
+                       * ((this.invincible_finished < time) ? autocvar_g_balance_powerup_invincible_takedamage : 1)
+
                tracebox(this.origin, this.mins, this.maxs, this.origin + '0 0 -65536', MOVE_NOMONSTERS, this);
                if(tracebox_hits_trigger_hurt(this.origin, this.mins, this.maxs, trace_endpos ))
                if(this.items & IT_JETPACK)
@@ -657,7 +661,7 @@ void havocbot_movetogoal(entity this)
 
                        return;
                }
-               else if(this.health > WEP_CVAR(devastator, damage) * 0.5 * ((this.strength_finished < time) ? autocvar_g_balance_powerup_strength_selfdamage : 1))
+               else if(this.health + this.armorvalue > ROCKETJUMP_DAMAGE())
                {
                        if(this.velocity.z < 0)
                        {