mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-24 05:17:17 +00:00
fixed the issue with Orb of Aether being marked as used due to Minefield uncovering
This commit is contained in:
parent
41ee2f4a7c
commit
92d98847fb
51
game.cpp
51
game.cpp
@ -3340,6 +3340,23 @@ void gainShard(cell *c2, const char *msg) {
|
|||||||
invismove = false;
|
invismove = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void uncoverMinesFull(cell *c2) {
|
||||||
|
int mineradius =
|
||||||
|
(items[itBombEgg] < 1 && !tactic::on) ? 0 :
|
||||||
|
items[itBombEgg] < 20 ? 1 :
|
||||||
|
items[itBombEgg] < 30 ? 2 :
|
||||||
|
3;
|
||||||
|
|
||||||
|
bool nomine = !normal_gravity_at(c2);
|
||||||
|
if(!nomine && uncoverMines(c2, mineradius, 0, true) && markOrb(itOrbAether))
|
||||||
|
nomine = true;
|
||||||
|
|
||||||
|
if(!nomine) {
|
||||||
|
uncoverMines(c2, mineradius, 0, false);
|
||||||
|
mayExplodeMine(c2, moPlayer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void playerMoveEffects(cell *c1, cell *c2) {
|
void playerMoveEffects(cell *c1, cell *c2) {
|
||||||
|
|
||||||
if(peace::on) items[itOrbSword] = c2->land == laBurial ? 100 : 0;
|
if(peace::on) items[itOrbSword] = c2->land == laBurial ? 100 : 0;
|
||||||
@ -3348,17 +3365,7 @@ void playerMoveEffects(cell *c1, cell *c2) {
|
|||||||
|
|
||||||
destroyWeakBranch(c1, c2, moPlayer);
|
destroyWeakBranch(c1, c2, moPlayer);
|
||||||
|
|
||||||
bool nomine = (c2->wall == waMineMine || c2->wall == waMineUnknown) && markOrb(itOrbAether);
|
uncoverMinesFull(c2);
|
||||||
|
|
||||||
if(!nomine) {
|
|
||||||
uncoverMines(c2,
|
|
||||||
(items[itBombEgg] < 1 && !tactic::on) ? 0 :
|
|
||||||
items[itBombEgg] < 20 ? 1 :
|
|
||||||
items[itBombEgg] < 30 ? 2 :
|
|
||||||
3, 0
|
|
||||||
);
|
|
||||||
mayExplodeMine(c2, moPlayer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if((c2->wall == waClosePlate || c2->wall == waOpenPlate) && !markOrb(itOrbAether))
|
if((c2->wall == waClosePlate || c2->wall == waOpenPlate) && !markOrb(itOrbAether))
|
||||||
toggleGates(c2, c2->wall);
|
toggleGates(c2, c2->wall);
|
||||||
@ -7081,9 +7088,17 @@ void knightFlavorMessage(cell *c2) {
|
|||||||
msgid++;
|
msgid++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void uncoverMines(cell *c, int lev, int dist) {
|
bool uncoverMines(cell *c, int lev, int dist, bool just_checking) {
|
||||||
if(c->wall == waMineUnknown)
|
bool b = false;
|
||||||
c->wall = waMineOpen;
|
if(c->wall == waMineMine && just_checking) return true;
|
||||||
|
if(c->wall == waMineUnknown) {
|
||||||
|
if(just_checking)
|
||||||
|
return true;
|
||||||
|
else {
|
||||||
|
c->wall = waMineOpen;
|
||||||
|
b = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool minesNearby = false;
|
bool minesNearby = false;
|
||||||
bool nominesNearby = false;
|
bool nominesNearby = false;
|
||||||
@ -7096,14 +7111,18 @@ void uncoverMines(cell *c, int lev, int dist) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(lev && (nominesNearby || mineopens) && !minesNearby) for(int i=0; i<c->type; i++)
|
if(lev && (nominesNearby || mineopens) && !minesNearby) for(int i=0; i<c->type; i++)
|
||||||
if(c->move(i) && (c->move(i)->wall == waMineUnknown || c->move(i)->wall == waMineOpen))
|
if(c->move(i) && (c->move(i)->wall == waMineUnknown || c->move(i)->wall == waMineOpen)) {
|
||||||
uncoverMines(c->move(i), lev-1, dist+1);
|
b |= uncoverMines(c->move(i), lev-1, dist+1, just_checking);
|
||||||
|
if(b && just_checking) return true;
|
||||||
|
}
|
||||||
|
|
||||||
if(minesNearby && !nominesNearby && dist == 0) {
|
if(minesNearby && !nominesNearby && dist == 0) {
|
||||||
forCellEx(c2, c)
|
forCellEx(c2, c)
|
||||||
if(c2->wall == waMineMine && c2->land == laMinefield)
|
if(c2->wall == waMineMine && c2->land == laMinefield)
|
||||||
c2->landparam |= 1;
|
c2->landparam |= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace orbbull {
|
namespace orbbull {
|
||||||
|
2
hyper.h
2
hyper.h
@ -695,7 +695,7 @@ bool makeEmpty(cell *c);
|
|||||||
bool isCrossroads(eLand l);
|
bool isCrossroads(eLand l);
|
||||||
enum orbAction { roMouse, roKeyboard, roCheck, roMouseForce, roMultiCheck, roMultiGo };
|
enum orbAction { roMouse, roKeyboard, roCheck, roMouseForce, roMultiCheck, roMultiGo };
|
||||||
void moveItem (cell *from, cell *to, bool activateYendor);
|
void moveItem (cell *from, cell *to, bool activateYendor);
|
||||||
void uncoverMines(cell *c, int lev, int dist);
|
bool uncoverMines(cell *c, int lev, int dist, bool just_checking);
|
||||||
void killMonster(cell *c, eMonster who_killed, flagtype flags = 0);
|
void killMonster(cell *c, eMonster who_killed, flagtype flags = 0);
|
||||||
void toggleGates(cell *ct, eWall type, int rad);
|
void toggleGates(cell *ct, eWall type, int rad);
|
||||||
bool destroyHalfvine(cell *c, eWall newwall = waNone, int tval = 6);
|
bool destroyHalfvine(cell *c, eWall newwall = waNone, int tval = 6);
|
||||||
|
17
shmup.cpp
17
shmup.cpp
@ -1769,20 +1769,11 @@ void movePlayer(monster *m, int delta) {
|
|||||||
}
|
}
|
||||||
movecost(m->base, c2, 1);
|
movecost(m->base, c2, 1);
|
||||||
|
|
||||||
bool nomine = (c2->wall == waMineMine || c2->wall == waMineUnknown) && markOrb(itOrbAether);
|
if(c2->wall == waMineMine && !markOrb(itOrbAether) && !markOrb(itOrbWinter)) {
|
||||||
|
items[itOrbLife] = 0;
|
||||||
if(!nomine) {
|
m->dead = true;
|
||||||
uncoverMines(c2,
|
|
||||||
items[itBombEgg] < 20 ? 1 :
|
|
||||||
items[itBombEgg] < 30 ? 2 :
|
|
||||||
3, 0
|
|
||||||
);
|
|
||||||
if(c2->wall == waMineMine && !markOrb(itOrbWinter)) {
|
|
||||||
items[itOrbLife] = 0;
|
|
||||||
m->dead = true;
|
|
||||||
}
|
|
||||||
mayExplodeMine(c2, moPlayer);
|
|
||||||
}
|
}
|
||||||
|
uncoverMinesFull(c2);
|
||||||
|
|
||||||
if(isWatery(c2) && isWatery(m->base) && m->inBoat)
|
if(isWatery(c2) && isWatery(m->base) && m->inBoat)
|
||||||
moveItem(m->base, c2, true);
|
moveItem(m->base, c2, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user