X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fmage.qc;h=82b7d273c23458fb9f333e7bf090c5949f99a453;hb=f41f81f37e3ecf5a2d14f7bc7ffd7bbf09fff32e;hp=a39f0a2039907de7d1c451aad867018b93dd1915;hpb=8cb2cb16bb4e54acd682ad3714bbb70535a6afc1;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index a39f0a203..82b7d273c 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -12,7 +12,7 @@ METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weapon if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) { if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range; actor.enemy = Monster_FindTarget(actor); - W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_MageSpike_FIRE, CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_MageSpike_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_MAGE.m_id); if (!IS_PLAYER(actor)) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin); M_Mage_Attack_Spike(actor, w_shotdir); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready); @@ -118,9 +118,10 @@ void M_Mage_Attack_Spike_Explode(entity this, entity directhitentity) this.realowner.mage_spike = NULL; Send_Effect(EFFECT_EXPLOSION_SMALL, this.origin, '0 0 0', 1); - RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, directhitentity); + RadiusDamage (this, this.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), + NULL, NULL, 0, DEATH_MONSTER_MAGE.m_id, DMG_NOWEP, directhitentity); - delete (this); + delete(this); } void M_Mage_Attack_Spike_Touch(entity this, entity toucher) @@ -162,7 +163,7 @@ void M_Mage_Attack_Spike_Think(entity this) // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P ) if ((autocvar_g_monster_mage_attack_spike_smart) && vdist(eorg - this.origin, >, autocvar_g_monster_mage_attack_spike_smart_mindist)) { - // Is it a better idea (shorter distance) to trace to the target itthis? + // Is it a better idea (shorter distance) to trace to the target itself? if ( vlen2(this.origin + olddir * this.wait) < vlen2(eorg - this.origin)) traceline(this.origin, this.origin + olddir * this.wait, false, this); else @@ -219,14 +220,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 +235,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 { @@ -271,7 +272,8 @@ void M_Mage_Defend_Heal(entity this) void M_Mage_Attack_Push(entity this) { sound(this, CH_SHOTS, SND_TAGEXP1, 1, ATTEN_NORM); - RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), NULL, NULL, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, this.enemy); + RadiusDamage (this, this, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), + NULL, NULL, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE.m_id, DMG_NOWEP, this.enemy); Send_Effect(EFFECT_TE_EXPLOSION, this.origin, '0 0 0', 1); setanim(this, this.anim_shoot, true, true, true); @@ -370,7 +372,7 @@ bool M_Mage_Attack(int attack_type, entity actor, entity targ, .entity weaponent return false; } -spawnfunc(monster_mage) { Monster_Spawn(this, MON_MAGE.monsterid); } +spawnfunc(monster_mage) { Monster_Spawn(this, true, MON_MAGE.monsterid); } #endif // SVQC @@ -450,7 +452,6 @@ METHOD(Mage, mr_anim, bool(Mage this, entity actor)) #endif #ifdef SVQC .float speed; -spawnfunc(item_health_large); METHOD(Mage, mr_setup, bool(Mage this, entity actor)) { TC(Mage, this); @@ -460,15 +461,9 @@ METHOD(Mage, mr_setup, bool(Mage this, entity actor)) if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_mage_speed_stop); } if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_mage_damageforcescale); } - actor.monster_loot = spawnfunc_item_health_large; + actor.monster_loot = ITEM_HealthBig; actor.monster_attackfunc = M_Mage_Attack; return true; } - -METHOD(Mage, mr_precache, bool(Mage this)) -{ - TC(Mage, this); - return true; -} #endif