1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2026-06-07 13:22:11 +00:00

Ivy can now grow through single-tile wide chasms

This commit is contained in:
Zeno Rogue
2026-04-17 20:10:55 +02:00
parent 394534f250
commit ce39b2e96d
5 changed files with 16 additions and 6 deletions
+2 -1
View File
@@ -240,6 +240,7 @@ EX void computePathdist(eMonster param, bool include_allies IS(true)) {
cell *c2 = cw1.peek();
flagtype f = P_MONSTER;
if(param == moIvyRoot) f |= P_IVY;
if(param == moTameBomberbird) f |= P_FLYING | P_ISFRIEND;
if(isPrincess(param)) f |= P_ISFRIEND | P_USEBOAT | P_CHAIN;
if(param == moGolem) f |= P_ISFRIEND;
@@ -251,7 +252,7 @@ EX void computePathdist(eMonster param, bool include_allies IS(true)) {
if(qb >= qtarg) {
if(param == moTortoise && nogoSlow(c, c2)) continue;
if(param == moIvyRoot && strictlyAgainstGravity(c, c2, false, MF_IVY)) continue;
if(param == moIvyRoot && !ivy_passable(c, c2)) continue;
if(param == moWorm && (cellUnstable(c) || cellEdgeUnstable(c) || prairie::no_worms(c))) continue;
if(!isFriendly(param) && items[itOrbLava] && c2->cpdist <= 5 && pseudohept(c) && makeflame(c2, 1, true))
continue;
+1 -1
View File
@@ -214,7 +214,7 @@ EX bool isFlying(eMonster m) {
}
EX bool survivesChasm(eMonster m) {
return isFlying(m);
return isFlying(m) || isAnyIvy(m);
}
EX bool ignoresPlates(eMonster m) {
+2 -2
View File
@@ -1041,7 +1041,7 @@ EX void moveivy() {
}
continue;
}
if(c2 && c2->pathdist < pd && passable(c2, c, 0) && !strictlyAgainstGravity(c2, c, false, MF_IVY))
if(c2 && c2->pathdist < pd && ivy_passable(c2, c))
mi = movei(c, j), pd = c2->pathdist;
}
c = c->move(c->mondir);
@@ -1437,7 +1437,7 @@ EX void movemutant() {
if(isPlayerOn(c2)) continue;
if((c2->land == laOvergrown || !pseudohept(c2)) && passable(c2, c, 0)) {
if((c2->land == laOvergrown || !pseudohept(c2)) && ivy_passable(c2, c)) {
if(c2->land == laClearing && !closed_or_bounded && c2->mpdist > 7) continue;
c2->monst = moMutant;
c2->mondir = c->c.spin(j);
+1 -1
View File
@@ -1482,7 +1482,7 @@ EX eItem targetRangedOrb(cell *c, orbAction a) {
if(c->monst ? (
CHK(canAttack(cf, moFriendlyIvy, c, c->monst, f), XLAT("Cannot attack there!"))
) : (
CHK(passable(c, cf, P_ISFRIEND | P_MONSTER), XLAT("Cannot grow there!")) &&
CHK(passable(c, cf, P_ISFRIEND | P_MONSTER | P_IVY), XLAT("Cannot grow there!")) &&
CHK(!strictlyAgainstGravity(c, cf, false, MF_IVY), XLAT("Cannot grow against gravity!"))
))
dirs.push_back(d);
+10 -1
View File
@@ -138,6 +138,7 @@ EX bool anti_alchemy(cell *w, cell *from) {
#define P_PHASE Flag(33) // phasing movement
#define P_PULLMAGNET Flag(34) // pull the other part of the magnet
#define P_WATERCURSE Flag(35) // Curse of Water
#define P_IVY Flag(36) // ivy
#endif
EX bool passable(cell *w, cell *from, flagtype flags) {
@@ -270,7 +271,7 @@ EX bool passable(cell *w, cell *from, flagtype flags) {
}
if(isChasmy(w)) {
if(in_gravity_zone(w)) ;
else if(!F(P_AETHER | P_FLYING | P_BLOW | P_JUMP1 | P_BULLET | P_DEADLY | P_REPTILE)) return false;
else if(!F(P_AETHER | P_FLYING | P_BLOW | P_JUMP1 | P_BULLET | P_DEADLY | P_REPTILE | P_IVY)) return false;
}
if(w->wall == waRoundTable && from && from->wall != waRoundTable && (flags & P_ISPLAYER)) return true;
@@ -467,6 +468,14 @@ EX bool isNeighbor1(cell *f, cell *w) {
return !f || f == w || isNeighbor(f, w);
}
EX bool ivy_passable(cell *c2, cell *c) {
if(!passable(c2, c, P_IVY)) return false;
if(isWatery(c2)) return false;
if(strictlyAgainstGravity(c2, c, false, MF_IVY)) return false;
if(cellUnstableOrChasm(c) && cellUnstableOrChasm(c2)) return false;
return true;
}
EX bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) {
jumpdata jdummy;
if(w->monst && !(extra & P_MONSTER) && !isPlayerOn(w))