From: Mario Date: Tue, 20 Jun 2017 11:05:51 +0000 (+1000) Subject: Update spider's web attack to use the highspeed stat instead of maxspeed/airspeed X-Git-Tag: xonotic-v0.8.5~2715 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7b052d5dba58d84e4c38b45f6520f92c660d7188;p=xonotic%2Fxonotic-data.pk3dir.git Update spider's web attack to use the highspeed stat instead of maxspeed/airspeed --- diff --git a/qcsrc/common/effects/all.inc b/qcsrc/common/effects/all.inc index 060367a3c..7d2f1d592 100644 --- a/qcsrc/common/effects/all.inc +++ b/qcsrc/common/effects/all.inc @@ -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") diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 251b1edc7..5b95b2c9f 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -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 { diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index a5863623e..d234e2604 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -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); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 7ec7f95ac..3a22b360d 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -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)