diff --git a/game.cpp b/game.cpp index 59126265..b8af54df 100644 --- a/game.cpp +++ b/game.cpp @@ -1124,12 +1124,6 @@ int monstersnear(stalemate1& sm) { bool eaten = false; if(hardcore && sm.who == moPlayer) return 0; - dynamicval sw(passive_switch, passive_switch); - if(sm.moveto->item && itemclass(sm.moveto->item) == IC_TREASURE) - passive_switch = active_switch(); - if(items[itOrbMagnetism]) forCellEx(c2, sm.moveto) - if(canPickupItemWithMagnetism(c2, sm.comefrom) && itemclass(c2->item) == IC_TREASURE) - passive_switch = active_switch(); int res = 0; bool fast = false; @@ -1256,12 +1250,24 @@ int monstersnear2() { for(int i=0; i sw(passive_switch, passive_switch); + + // check for safe orbs and switching first + for(auto &sm: stalemate::moves) { + if(hasSafeOrb(sm.moveto)) { multi::cpid--; return 0; } - + if(sm.moveto->item && itemclass(sm.moveto->item) == IC_TREASURE) + passive_switch = active_switch(); + if(items[itOrbMagnetism]) forCellEx(c2, sm.moveto) + if(canPickupItemWithMagnetism(c2, sm.comefrom)) { + if(itemclass(c2->item) == IC_TREASURE) + passive_switch = active_switch(); + if(hasSafeOrb(c2)) + return 0; + } + } + for(int i=0; iitem == itCompass) { - if(!c2->item) - moveItem(c3, c2, false); - } - else if(markOrb(itOrbMagnetism)) - collectItem(c3, false); - } + } } void beastcrash(cell *c, cell *beast) { @@ -6317,6 +6313,24 @@ bool canPickupItemWithMagnetism(cell *c, cell *from) { return true; } +bool doPickupItemsWithMagnetism(cell *c) { + cell *csaf = NULL; + if(items[itOrbMagnetism]) + forCellEx(c3, c) if(canPickupItemWithMagnetism(c3, c)) { + if(c3->item == itCompass) { + if(!c->item) + moveItem(c3, c, false); + } + else if(c3->item == itOrbSafety || c3->item == itBuggy || c3->item == itBuggy2) + csaf = c3; + else if(markOrb(itOrbMagnetism)) + collectItem(c3, false); + } + if(csaf) + return collectItem(csaf, false); + return false; + } + void pickupMovedItems(cell *c) { if(!c->item) return; if(isPlayerOn(c)) collectItem(c, true); @@ -7491,6 +7505,7 @@ bool movepcto(int d, int subdir, bool checkonly) { } if(!boatmove && collectItem(c2)) return true; + if(doPickupItemsWithMagnetism(c2)) return true; if(isIcyLand(cwt.c) && cwt.c->wall == waNone && markOrb(itOrbWinter)) { invismove = false; diff --git a/orbs.cpp b/orbs.cpp index 058df6c3..12909430 100644 --- a/orbs.cpp +++ b/orbs.cpp @@ -108,12 +108,14 @@ void reduceOrbPowers() { reduceOrbPower(itOrbDigging, 100); reduceOrbPower(itOrbTeleport, 200); reduceOrbPower(itOrbSpace, 150); + reduceOrbPower(itOrbMagnetism, 150); reduceOrbPowerAlways(itOrbSafety); reduceOrbPower(itOrbThorns, 150); reduceOrbPower(itOrbWater, 150); reduceOrbPower(itOrbAir, 150); reduceOrbPower(itOrbFrog, 77); reduceOrbPower(itOrbDash, 77); + reduceOrbPower(itOrbPhasing, 77); reduceOrbPower(itOrbDiscord, 67); reduceOrbPower(itOrbSummon, 333); reduceOrbPower(itOrbMatter, 333); @@ -1298,6 +1300,7 @@ int orbcharges(eItem it) { return 40; case itOrbFrog: case itOrbDash: + case itOrbPhasing: return 45; case itOrb37: case itOrbEnergy: @@ -1324,6 +1327,7 @@ int orbcharges(eItem it) { case itOrbPsi: case itOrbDigging: case itOrbTeleport: + case itOrbMagnetism: return 77; case itOrbDomination: return 90;