From: Mario Date: Tue, 24 Apr 2018 09:36:04 +0000 (+1000) Subject: Lower the frequency of spider web shots, and only fire them when the target is close... X-Git-Tag: xonotic-v0.8.5~7^2~1^2~50 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fc48d5efba26c57b5ceb719e840d8824fdebb2bc;p=xonotic%2Fxonotic-data.pk3dir.git Lower the frequency of spider web shots, and only fire them when the target is close to in range --- diff --git a/monsters.cfg b/monsters.cfg index 15a98c0534..3727463491 100644 --- a/monsters.cfg +++ b/monsters.cfg @@ -15,7 +15,8 @@ set g_monster_zombie_speed_walk 300 set g_monster_spider_attack_bite_damage 35 set g_monster_spider_attack_bite_delay 1.5 set g_monster_spider_attack_web_damagetime 7 -set g_monster_spider_attack_web_delay 1.5 +set g_monster_spider_attack_web_delay 3 +set g_monster_spider_attack_web_range 800 set g_monster_spider_attack_web_speed 1300 set g_monster_spider_attack_web_speed_up 150 set g_monster_spider_damageforcescale 0.600000024 diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 344d855be0..21ac20c96c 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -10,6 +10,7 @@ float autocvar_g_monster_spider_attack_web_damagetime; float autocvar_g_monster_spider_attack_web_speed; float autocvar_g_monster_spider_attack_web_speed_up; float autocvar_g_monster_spider_attack_web_delay; +float autocvar_g_monster_spider_attack_web_range = 800; float autocvar_g_monster_spider_attack_bite_damage; float autocvar_g_monster_spider_attack_bite_delay; @@ -58,12 +59,15 @@ METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity TC(SpiderAttack, thiswep); bool isPlayer = IS_PLAYER(actor); if (fire & 1) - if ((!isPlayer && time >= actor.spider_web_delay) || weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_monster_spider_attack_web_delay)) { + if ((!isPlayer && time >= actor.spider_web_delay) || (isPlayer && weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_monster_spider_attack_web_delay))) { if (!isPlayer) { - actor.spider_web_delay = time + 3; + actor.spider_web_delay = time + autocvar_g_monster_spider_attack_web_delay; setanim(actor, actor.anim_shoot, true, true, true); - actor.attack_finished_single[0] = time + (autocvar_g_monster_spider_attack_web_delay); - actor.anim_finished = time + 1; + if(actor.animstate_endtime > time) + actor.anim_finished = actor.animstate_endtime; + else + actor.anim_finished = time + 1; + actor.attack_finished_single[0] = actor.anim_finished + 0.2; } if (isPlayer) actor.enemy = Monster_FindTarget(actor); W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_SpiderAttack_FIRE, CH_WEAPON_B, 0, DEATH_MONSTER_SPIDER.m_id); @@ -178,8 +182,11 @@ bool M_Spider_Attack(int attack_type, entity actor, entity targ, .entity weapone } case MONSTER_ATTACK_RANGED: { - wep.wr_think(wep, actor, weaponentity, 1); - return true; + if(vdist(actor.enemy.origin - actor.origin, <=, autocvar_g_monster_spider_attack_web_range)) + { + wep.wr_think(wep, actor, weaponentity, 1); + return true; + } } }