From 60980bcb8b816d359e33cb197be37dd127c45c23 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 22 Feb 2024 18:11:12 +0100 Subject: [PATCH] bow:: rusalka curses now work --- crossbow.cpp | 5 +++++ pcmove.cpp | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/crossbow.cpp b/crossbow.cpp index 1a3b12c2..e461927e 100644 --- a/crossbow.cpp +++ b/crossbow.cpp @@ -369,6 +369,8 @@ EX bool fire_on_mouse(cell *c) { return b; } +EX int rusalka_curses = 0; + EX void shoot() { flagtype attackflags = AF_BOW; if(items[itOrbSpeed]&1) attackflags |= AF_FAST; @@ -382,6 +384,7 @@ EX void shoot() { vector> healthy_dragons; map> kraken_hits; int dragon_hits = 0; + rusalka_curses++; // for achievements for(auto& mov: bowpath) { @@ -458,6 +461,8 @@ EX void shoot() { if(m && attackMonster(c, attackflags | AF_MSG, who)) hit_anything = true; + if(m == moRusalka) rusalka_curses++; + if(!c->monst || isAnyIvy(m)) { spread_plague(cf, c, movei(mov.prev).rev().d, moPlayer); produceGhost(c, m, moPlayer); diff --git a/pcmove.cpp b/pcmove.cpp index ddabd34c..80ff32d7 100644 --- a/pcmove.cpp +++ b/pcmove.cpp @@ -309,6 +309,8 @@ bool pcmove::try_shooting(bool auto_target) { nextmovetype = hit_anything ? lmAttack : lmSkip; lastmovetype = hit_anything ? lmAttack : lmSkip; lastmove = NULL; + while(bow::rusalka_curses--) rusalka_curse(); + mi = movei(cwt.at, STAY); if(last_gravity_state && !gravity_state) playerMoveEffects(mi); @@ -1101,6 +1103,12 @@ void pcmove::tell_why_impassable() { } } +EX void rusalka_curse() { + changes.ccell(cwt.at); + if(cwt.at->wall == waNone) cwt.at->wall = waShallow; + else if(cwt.at->wall == waShallow || isAlch(cwt.at->wall)) cwt.at->wall = waDeepWater; + } + bool pcmove::attack() { auto& c2 = mi.t; if(!fmsAttack) return false; @@ -1177,11 +1185,7 @@ bool pcmove::attack() { changes.value_add(wandering_jiangshi, 1); } attackMonster(c2, attackflags | AF_MSG, moPlayer); - if(m == moRusalka) { - changes.ccell(cwt.at); - if(cwt.at->wall == waNone) cwt.at->wall = waShallow; - else if(cwt.at->wall == waShallow || isAlch(cwt.at->wall)) cwt.at->wall = waDeepWater; - } + if(m == moRusalka) rusalka_curse(); changes.ccell(c2); // salamanders are stunned for longer time when pushed into a wall if(c2->monst == moSalamander && (mip.t == c2 || !mip.t)) c2->stuntime = 10;