X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fspider.qc;h=52bf37f7d2608f175ddc373c060d95c90c28990f;hp=cd79ac40e2faa674c31d00c94087d3e8c2a41819;hb=797bf448a96c0c13d783c7c919bb2caf6fa16707;hpb=078dd992e6bb1094cfd86148cc4df33e8a62587b diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index cd79ac40e..52bf37f7d 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -66,7 +66,7 @@ METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity actor.anim_finished = time + 1; } if (isPlayer) actor.enemy = Monster_FindTarget(actor); - W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_SpiderAttack_FIRE, CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_SpiderAttack_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_SPIDER.m_id); if (!isPlayer) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin); M_Spider_Attack_Web(actor); weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, w_ready); @@ -103,7 +103,7 @@ void M_Spider_Attack_Web_Explode(entity this) Send_Effect(EFFECT_ELECTRO_IMPACT, this.origin, '0 0 0', 1); RadiusDamage(this, this.realowner, 0, 0, 25, NULL, NULL, 25, this.projectiledeathtype, DMG_NOWEP, NULL); - FOREACH_ENTITY_RADIUS(this.origin, 25, it != this && it.takedamage && !IS_DEAD(it) && it.health > 0 && it.monsterid != MON_SPIDER.monsterid, + FOREACH_ENTITY_RADIUS(this.origin, 25, it != this && it.takedamage && !IS_DEAD(it) && GetResource(it, RES_HEALTH) > 0 && it.monsterid != MON_SPIDER.monsterid, { it.spider_slowness = time + (autocvar_g_monster_spider_attack_web_damagetime); }); @@ -151,7 +151,7 @@ void M_Spider_Attack_Web(entity this) setsize(proj, '-4 -4 -4', '4 4 4'); proj.takedamage = DAMAGE_NO; proj.damageforcescale = 0; - proj.health = 500; + SetResourceExplicit(proj, RES_HEALTH, 500); proj.event_damage = func_null; proj.flags = FL_PROJECTILE; IL_PUSH(g_projectiles, proj); @@ -168,9 +168,9 @@ void M_Spider_Attack_Web(entity this) bool M_Spider_Attack(int attack_type, entity actor, entity targ, .entity weaponentity) { + Weapon wep = WEP_SPIDER_ATTACK; switch(attack_type) { - Weapon wep = WEP_SPIDER_ATTACK; case MONSTER_ATTACK_MELEE: { wep.wr_think(wep, actor, weaponentity, 2); @@ -227,7 +227,7 @@ METHOD(Spider, mr_anim, bool(Spider this, entity actor)) METHOD(Spider, mr_setup, bool(Spider this, entity actor)) { TC(Spider, this); - if(!actor.health) actor.health = (autocvar_g_monster_spider_health); + if(!GetResource(this, RES_HEALTH)) SetResourceExplicit(actor, RES_HEALTH, autocvar_g_monster_spider_health); if(!actor.speed) { actor.speed = (autocvar_g_monster_spider_speed_walk); } if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_spider_speed_run); } if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_spider_speed_stop); }