From: TimePath Date: Sat, 29 Aug 2015 12:26:05 +0000 (+1000) Subject: Merge branch 'master' into Mario/monsters_broken X-Git-Tag: xonotic-v0.8.2~1997^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b557753cb5b1d9c92ef9ab17cb03d74bcbb75485;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/monsters_broken # Conflicts: # qcsrc/common/monsters/sv_monsters.qc --- b557753cb5b1d9c92ef9ab17cb03d74bcbb75485 diff --cc qcsrc/common/monsters/monster/mage.qc index d586321f6,46ce94dd7..8f92d693a --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@@ -241,9 -236,9 +241,9 @@@ void M_Mage_Defend_Heal( } else { - Send_Effect("healing_fx", head.origin, '0 0 0', 1); + Send_Effect(EFFECT_HEALING, head.origin, '0 0 0', 1); head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health); - if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE)) + if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE) && head.sprite) WaypointSprite_UpdateHealth(head.sprite, head.health); } } @@@ -260,9 -254,9 +260,9 @@@ void M_Mage_Attack_Push( { sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM); RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy); - Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1); + Send_Effect(EFFECT_TE_EXPLOSION, self.origin, '0 0 0', 1); - self.frame = mage_anim_attack; + setanim(self, self.anim_shoot, true, true, true); self.attack_finished_single = time + (autocvar_g_monster_mage_attack_push_delay); } diff --cc qcsrc/common/monsters/monster/shambler.qc index 49bc3d8e6,80325a2fa..4640fe945 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@@ -46,28 -40,26 +46,28 @@@ const float shambler_anim_death = 8 .float shambler_lastattack; // delay attacks separately -void shambler_smash() +void M_Shambler_Attack_Smash() { makevectors(self.angles); - Send_Effect("explosion_medium", (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1); + Send_Effect(EFFECT_EXPLOSION_MEDIUM, (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1); sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM); - tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * 500, MOVE_NORMAL, self); + // RadiusDamage does NOT support custom starting location, which means we must use this hack... + + tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * autocvar_g_monster_shambler_attack_smash_range, MOVE_NORMAL, self); if(trace_ent.takedamage) - Damage(trace_ent, self, self, (autocvar_g_monster_shambler_attack_smash_damage) * Monster_SkillModifier(), DEATH_MONSTER_SHAMBLER_SMASH, trace_ent.origin, normalize(trace_ent.origin - self.origin)); + Damage(trace_ent, self, self, (autocvar_g_monster_shambler_attack_smash_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_SMASH, trace_ent.origin, normalize(trace_ent.origin - self.origin)); } -void shambler_swing() +void M_Shambler_Attack_Swing() { float r = (random() < 0.5); - monster_melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? shambler_anim_swingr : shambler_anim_swingl), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, true); - if(r) + if(r && Monster_Attack_Melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? self.anim_melee2 : self.anim_melee3), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, true)) { - defer(0.5, shambler_swing); + Monster_Delay(1, 0, 0.5, M_Shambler_Attack_Swing); self.attack_finished_single += 0.5; + self.anim_finished = self.attack_finished_single; } } diff --cc qcsrc/common/monsters/sv_monsters.qc index c977aa67e,9f8028aa8..e7ea9f8c4 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@@ -907,19 -835,24 +907,19 @@@ void Monster_Move(float runspeed, floa self.angles_y += turny; } - monster_checkattack(self, self.enemy); + Monster_Attack_Check(self, self.enemy); } -void monster_remove(entity mon) +void Monster_Remove(entity mon) { - if(!mon) - return; // nothing to remove - - Send_Effect(EFFECT_ITEM_PICKUP, mon.origin, '0 0 0', 1); + if(!mon) { return; } - if(mon.weaponentity) - remove(mon.weaponentity); - - if(mon.iceblock) - remove(mon.iceblock); + if(!MUTATOR_CALLHOOK(MonsterRemove, mon)) - Send_Effect("item_pickup", mon.origin, '0 0 0', 1); ++ Send_Effect(EFFECT_ITEM_PICKUP, mon.origin, '0 0 0', 1); + if(mon.weaponentity) { remove(mon.weaponentity); } + if(mon.iceblock) { remove(mon.iceblock); } WaypointSprite_Kill(mon.sprite); - remove(mon); }