From 01fde204509280d8f549715114cbd27e490049b6 Mon Sep 17 00:00:00 2001 From: ketmar Date: Thu, 30 Aug 2018 09:22:13 +0000 Subject: [PATCH] shopkeeper hit by spear trap will react accordingly now FossilOrigin-Name: 8d89a367ffacfba515b54771e8a3a38797cf4a44d1180cb4b4aae2baa5359f9c --- mapent/characters/shopkeeper.vc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mapent/characters/shopkeeper.vc b/mapent/characters/shopkeeper.vc index 2b6b142..efe7247 100644 --- a/mapent/characters/shopkeeper.vc +++ b/mapent/characters/shopkeeper.vc @@ -831,6 +831,22 @@ void setFollowStates () { } +override bool onSpearTrapHit (MapObject spear) { + if (heldBy) heldBy.holdItem = none; + + countsAsKill = false; + status = THROWN; + counter = stunMax; + yVel = -6; + xVel = (spear.ix+8 < ix+8 ? 4 : -4); + spear.playSound('sndHit'); + hp -= global.config.spearDmg; + spillBlood(); + + return false; +} + + override void thinkFrame () { ::thinkFrame(); //if (hitByArrow) writeln("after ::think hp=", hp); -- 2.11.4.GIT