From b8f7675878d7d2230cae2c32a81c6bb237e040af Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 14 Aug 2017 21:32:02 +0200 Subject: [PATCH] Automatic evoking of Beauty/Freedom/Sword/SwordII on Inventory --- complex.cpp | 12 ++++++++++-- game.cpp | 6 +++++- inventory.cpp | 38 ++++++++++++++++++++++++++++++++++++++ orbs.cpp | 5 ++--- 4 files changed, 55 insertions(+), 6 deletions(-) diff --git a/complex.cpp b/complex.cpp index 3c34a047..99d81838 100644 --- a/complex.cpp +++ b/complex.cpp @@ -2485,9 +2485,17 @@ namespace sword { return ((s2*S42/c2->type - s1*S42/c1->type) + S21 + angle) % S42; } + void shuffle(int i) { + sword::angle[i] = euclid ? S7*hrand(6) : purehepta ? 3*hrand(S14)+1 : hrand(S42); + } + + void reset() { + items[itOrbSword] = items[itOrbSword2] = 0; + shuffle(multi::cpid); + } + void shuffle() { - for(int i=0; imonst && !isFriendly(c2->monst) && !isIvy(c2->monst)) { + c2->stuntime += 3; + checkStunKill(c2); + } + } + + void evokeOrb(eItem it) { + if(it == itOrbFreedom) + for(int i=0; imonst)) + evokeBeautyAt(c); + } + + if(it == itOrbSword || it == itOrbSword2) { + for(int i=0; iitem = it; + evokeOrb(orbmap[uni]); checkmove(); popScreenAll(); } diff --git a/orbs.cpp b/orbs.cpp index 784bfcf7..f674ad2f 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -545,7 +545,7 @@ void teleportTo(cell *dest) { bfs(); - items[itOrbSword] = 0; + sword::reset(); items[itOrbSword2] = 0; if(shmup::on) shmup::teleported(); @@ -568,8 +568,7 @@ void jumpTo(cell *dest, eItem byWhat, int bonuskill = 0, eMonster dashmon = moNo } countLocalTreasure(); - items[itOrbSword] = 0; - items[itOrbSword2] = 0; + sword::reset(); stabbingAttack(c1, dest, moPlayer, bonuskill); playerMoveEffects(c1, dest); if(cwt.c->item != itOrbYendor && cwt.c->item != itHolyGrail)