]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Update spider's web attack to use the highspeed stat instead of maxspeed/airspeed
authorMario <mario@smbclan.net>
Tue, 20 Jun 2017 11:05:51 +0000 (21:05 +1000)
committerMario <mario@smbclan.net>
Tue, 20 Jun 2017 11:05:51 +0000 (21:05 +1000)
qcsrc/common/effects/all.inc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc

index 060367a3c55594b33b46e094196330045bb3f911..7d2f1d592739b4777ba1c1ee2940f6ce72a8bed3 100644 (file)
@@ -153,6 +153,8 @@ EFFECT(0, ICEORGLASS,               "iceorglass")
 EFFECT(0, ICEFIELD,                 "icefield")
 EFFECT(0, FIREFIELD,                "firefield")
 EFFECT(0, HEALING,                  "healing_fx")
+EFFECT(0, ARMOR_REPAIR,             "armorrepair_fx")
+EFFECT(0, AMMO_REGEN,               "ammoregen_fx")
 EFFECT(1, LASER_BEAM_FAST,          "nex242_misc_laser_beam_fast")
 EFFECT(0, RESPAWN_GHOST,            "respawn_ghost")
 
index 251b1edc7ac786c27dde2df73c0e67b915c1ea12..5b95b2c9f8d34728abd6d4efced44f5198731972 100644 (file)
@@ -219,14 +219,14 @@ void M_Mage_Defend_Heal(entity this)
        FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_monster_mage_heal_range, M_Mage_Defend_Heal_Check(this, it),
        {
                washealed = true;
-               string fx = "";
+               entity fx = EFFECT_Null;
                if(IS_PLAYER(it))
                {
                        switch(this.skin)
                        {
                                case 0:
                                        if(it.health < autocvar_g_balance_health_regenstable) it.health = bound(0, it.health + (autocvar_g_monster_mage_heal_allies), autocvar_g_balance_health_regenstable);
-                                       fx = EFFECT_HEALING.eent_eff_name;
+                                       fx = EFFECT_HEALING;
                                        break;
                                case 1:
                                        if(it.ammo_cells) it.ammo_cells = bound(it.ammo_cells, it.ammo_cells + 1, g_pickup_cells_max);
@@ -234,22 +234,22 @@ void M_Mage_Defend_Heal(entity this)
                                        if(it.ammo_rockets) it.ammo_rockets = bound(it.ammo_rockets, it.ammo_rockets + 1, g_pickup_rockets_max);
                                        if(it.ammo_shells) it.ammo_shells = bound(it.ammo_shells, it.ammo_shells + 2, g_pickup_shells_max);
                                        if(it.ammo_nails) it.ammo_nails = bound(it.ammo_nails, it.ammo_nails + 5, g_pickup_nails_max);
-                                       fx = "ammoregen_fx";
+                                       fx = EFFECT_AMMO_REGEN;
                                        break;
                                case 2:
                                        if(it.armorvalue < autocvar_g_balance_armor_regenstable)
                                        {
                                                it.armorvalue = bound(0, it.armorvalue + (autocvar_g_monster_mage_heal_allies), autocvar_g_balance_armor_regenstable);
-                                               fx = "armorrepair_fx";
+                                               fx = EFFECT_ARMOR_REPAIR;
                                        }
                                        break;
                                case 3:
                                        it.health = bound(0, it.health - ((it == this)  ? (autocvar_g_monster_mage_heal_self) : (autocvar_g_monster_mage_heal_allies)), autocvar_g_balance_health_regenstable);
-                                       fx = EFFECT_RAGE.eent_eff_name;
+                                       fx = EFFECT_RAGE;
                                        break;
                        }
 
-                       Send_Effect_(fx, it.origin, '0 0 0', 1);
+                       Send_Effect(fx, it.origin, '0 0 0', 1);
                }
                else
                {
index a5863623ecac3217e4ff92d038fa5b3fdaffd669..d234e2604984f27e0e3a71c68708df6ab9ce6f86 100644 (file)
@@ -116,11 +116,9 @@ void M_Shambler_Attack_Lightning_Think(entity this)
 
 void M_Shambler_Attack_Lightning(entity this)
 {
-       entity gren;
-
        monster_makevectors(this, this.enemy);
 
-       gren = new(grenade);
+       entity gren = new(grenade);
        gren.owner = gren.realowner = this;
        gren.bot_dodge = true;
        gren.bot_dodgerating = (autocvar_g_monster_shambler_attack_lightning_damage);
index 7ec7f95acb3ba9e17bb128dab4d41921bff18b69..3a22b360d3ff89ba71d207b2c02b01f88fa1a4f1 100644 (file)
@@ -18,16 +18,12 @@ void M_Spider_Attack_Web(entity this);
 
 REGISTER_MUTATOR(spiderweb, true);
 
-MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics)
+MUTATOR_HOOKFUNCTION(spiderweb, PlayerPhysics_UpdateStats)
 {
-    entity player = M_ARGV(0, entity);
+       entity player = M_ARGV(0, entity);
 
-       if (time >= player.spider_slowness)
-               return false;
-       PHYS_MAXSPEED(player) *= 0.5; // half speed while slow from spider
-       PHYS_MAXAIRSPEED(player) *= 0.5;
-       PHYS_AIRSPEEDLIMIT_NONQW(player) *= 0.5;
-       PHYS_AIRSTRAFEACCELERATE(player) *= 0.5;
+       if(time < player.spider_slowness)
+               STAT(MOVEVARS_HIGHSPEED, player) *= 0.5;
 }
 
 MUTATOR_HOOKFUNCTION(spiderweb, MonsterMove)