1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 17:40:36 +00:00
hyperrogue/flags.cpp

680 lines
20 KiB
C++
Raw Normal View History

2016-08-26 09:58:03 +00:00
// Hyperbolic Rogue
// implementation of various simple flags for lands, items, monsters, and walls
// Copyright (C) 2011-2016 Zeno Rogue, see 'hyper.cpp' for details
bool isIcyLand(eLand l) {
return l == laIce || l == laCocytus;
}
bool isIcyLand(cell *c) {
return isIcyLand(c->land);
}
bool isGravityLand(eLand l) {
2017-03-23 10:53:57 +00:00
return
l == laIvoryTower || l == laEndorian ||
l == laMountain || l == laDungeon;
2016-08-26 09:58:03 +00:00
}
// watery
bool isWatery(cell *c) {
return c->wall == waCamelotMoat || c->wall == waSea || c->wall == waLake;
}
bool isChasmy(cell *c) {
return c->wall == waChasm || c->wall == waSulphur || c->wall == waSulphurC;
}
bool isWateryOrBoat(cell *c) {
return isWatery(c) || c->wall == waBoat;
}
bool isNoFlight(cell *c) {
return
c->wall == waBoat || c->wall == waVineHalfA || c->wall == waVineHalfB ||
2017-03-23 10:53:57 +00:00
c->wall == waStrandedBoat || c->wall == waTrunk ||
c->wall == waBigBush || c->wall == waSmallBush;
2016-08-26 09:58:03 +00:00
}
bool boatStrandable(cell *c) {
return c->wall == waNone && (c->land == laLivefjord || c->land == laOcean);
}
// monster/wall types
bool isFire(cell *w) {
return w->wall == waFire || w->wall == waPartialFire || w->wall == waEternalFire;
}
bool isThumper(eWall w) {
return w == waThumperOff || w == waThumperOn;
}
bool isThumper(cell *c) {
return isThumper(c->wall);
}
bool isActivable(cell *c) {
return c->wall == waThumperOff || c->wall == waBonfireOff;
}
bool hasTimeout(cell *c) {
return c->wall == waThumperOn || c->wall == waFire || c->wall == waPartialFire ||
c->wall == waTempWall || c->wall == waTempFloor || c->wall == waTempBridge;
}
bool isMimic(eMonster m) {
return m == moMirror || m == moMirage;
}
bool isMimic(cell *c) {
return isMimic(c->monst);
}
bool isPrincess(eMonster m) {
return
m == moPrincess || m == moPrincessMoved ||
m == moPrincessArmed || m == moPrincessArmedMoved;
}
bool isGolemOrKnight(eMonster m) {
return
m == moGolem || m == moGolemMoved ||
m == moKnight || m == moKnightMoved ||
m == moTameBomberbird || m == moTameBomberbirdMoved ||
m == moMouse || m == moMouseMoved ||
m == moFriendlyGhost ||
isPrincess(m);
}
bool isGolemOrKnight(cell *c) { return isGolemOrKnight(c->monst); }
bool isNonliving(eMonster m) {
return
m == moMirage || m == moMirror || m == moGolem || m == moGolemMoved ||
m == moZombie || m == moGhost || m == moShadow || m == moSkeleton ||
m == moEvilGolem || m == moIllusion || m == moEarthElemental ||
2017-03-23 10:53:57 +00:00
m == moWaterElemental || m == moDraugr;
2016-08-26 09:58:03 +00:00
}
bool isMetalBeast(eMonster m) {
return m == moMetalBeast || m == moMetalBeast2;
}
bool isStunnable(eMonster m) {
return m == moPalace || m == moFatGuard || m == moSkeleton || isPrincess(m) ||
2017-03-23 10:53:57 +00:00
isMetalBeast(m) || m == moTortoise || isDragon(m) ||
m == moReptile;
2016-08-26 09:58:03 +00:00
}
bool hasHitpoints(eMonster m) {
return m == moPalace || m == moFatGuard || m == moVizier || isPrincess(m);
}
bool isMountable(eMonster m) {
2017-03-23 10:53:57 +00:00
return isWorm(m) && m != moTentacleGhost;
2016-08-26 09:58:03 +00:00
}
bool isFriendly(eMonster m) {
2017-03-23 10:53:57 +00:00
return isMimic(m) || isGolemOrKnight(m) || m == moIllusion || m == moFriendlyIvy;
}
bool isFriendlyOrPlayer(eMonster m) {
return isFriendly(m) || m == moPlayer;
2016-08-26 09:58:03 +00:00
}
bool isFriendly(cell *c) {
2017-03-23 10:53:57 +00:00
if(items[itOrbDomination] && c->monst && c->monst != moTentacleGhost) {
for(int i=0; i<numplayers(); i++)
if(sameMonster(c, playerpos(i)))
return true;
}
2016-08-26 09:58:03 +00:00
return isFriendly(c->monst);
}
bool isBug(eMonster m) {
return m >= moBug0 && m < moBug0+BUGCOLORS;
}
bool isBug(cell *c) {
return isBug(c->monst);
}
bool isFriendlyOrBug(cell *c) { // or killable discord!
// do not attack the stunned Princess
if(isPrincess(c->monst) && c->stuntime) return false;
return isFriendly(c) || isBug(c) || (c->monst && markOrb(itOrbDiscord) && !c->stuntime);
}
bool isIvy(eMonster m) {
return m == moIvyRoot || m == moIvyHead || m == moIvyBranch || m == moIvyWait ||
m == moIvyNext || m == moIvyDead;
}
bool isIvy(cell *c) {
return isIvy(c->monst);
}
bool isMonsterPart(eMonster m) {
2017-03-23 10:53:57 +00:00
return m == moMutant || (isIvy(m) && m != moIvyRoot) ||
m == moDragonTail || m == moKrakenT;
2016-08-26 09:58:03 +00:00
}
bool isMutantIvy(eMonster m) {
return m == moMutant;
}
2017-03-23 10:53:57 +00:00
bool isAnyIvy(eMonster m) {
return isIvy(m) || isMutantIvy(m) || m == moFriendlyIvy;
}
2016-08-26 09:58:03 +00:00
bool isBulletType(eMonster m) {
return
m == moBullet || m == moFlailBullet ||
m == moFireball || m == moTongue || m == moAirball;
}
bool isMutantIvy(cell *c) { return isMutantIvy(c->monst); }
bool isDemon(eMonster m) {
return m == moLesser || m == moLesserM || m == moGreater || m == moGreaterM;
}
bool isDemon(cell *c) {
return isDemon(c->monst);
}
bool isWormHead(eMonster m) {
return m == moWorm || m == moTentacle || m == moHexSnake || m == moDragonHead;
}
bool isWorm(eMonster m) {
return m == moWorm || m == moWormtail || m == moWormwait ||
m == moTentacle || m == moTentacletail || m == moTentaclewait ||
m == moTentacleEscaping || m == moTentacleGhost ||
m == moHexSnake || m == moHexSnakeTail ||
m == moDragonHead || m == moDragonTail;
}
bool isWorm(cell *c) {
return isWorm(c->monst);
}
bool isWitch(eMonster m) {
// evil golems don't count
return m >= moWitch && m < moWitch+NUMWITCH-1;
}
bool isOnCIsland(cell *c) {
return (c->wall == waCIsland || c->wall == waCTree || c->wall == waCIsland2);
}
bool isGhostable(eMonster m) {
return m && !isFriendly(m) && !isIvy(m) && !isMultitile(m) && !isMutantIvy(m);
}
bool cellUnstable(cell *c) {
return (c->land == laMotion && c->wall == waNone) || c->wall == waTrapdoor;
}
bool cellUnstableOrChasm(cell *c) {
return
(c->land == laMotion && c->wall == waNone) ||
c->wall == waChasm || c->wall == waTrapdoor;
}
bool cellHalfvine(cell *c) {
return c->wall == waVineHalfA || c->wall == waVineHalfB;
}
bool isWarped(eLand l) {
2017-03-23 10:53:57 +00:00
return l == laWarpCoast || l == laWarpSea;
2016-08-26 09:58:03 +00:00
}
bool isElementalShard(eItem i) {
return
i == itFireShard || i == itAirShard || i == itEarthShard || i == itWaterShard;
}
eMonster elementalOf(eLand l) {
if(l == laEFire) return moFireElemental;
if(l == laEWater) return moWaterElemental;
if(l == laEAir) return moAirElemental;
if(l == laEEarth) return moEarthElemental;
return moNone;
}
2017-03-23 10:53:57 +00:00
eItem localshardof(eLand l) {
return eItem(itFireShard + (l - laEFire));
}
2016-08-26 09:58:03 +00:00
int itemclass(eItem i) {
if(i == 0) return -1;
if(i < itKey || i == itFernFlower ||
i == itWine || i == itSilver || i == itEmerald || i == itRoyalJelly || i == itPower ||
i == itGrimoire || i == itPirate || i == itRedGem || i == itBombEgg ||
i == itCoast || i == itWhirlpool || i == itPalace || i == itFjord ||
2017-03-23 10:53:57 +00:00
i == itElemental || i == itZebra || i == itIvory ||
2016-08-26 09:58:03 +00:00
i == itBounty || i == itFulgurite || i == itMutant || i == itLotus || i == itMutant2 ||
i == itWindstone || i == itCoral || i == itRose ||
2017-03-23 10:53:57 +00:00
i == itBabyTortoise || i == itDragon || i == itApple ||
i == itKraken || i == itBarrow || i == itTrollEgg || i == itTreat ||
i == itSlime || i == itAmethyst || i == itDodeca ||
i == itGreenGrass || i == itBull)
2016-08-26 09:58:03 +00:00
return IC_TREASURE;
2017-03-23 10:53:57 +00:00
if(i == itSavedPrincess || i == itStrongWind || i == itWarning)
return IC_NAI;
2016-08-26 09:58:03 +00:00
if(i == itKey || i == itOrbYendor || i == itGreenStone || i == itHolyGrail || i == itCompass ||
2017-03-23 10:53:57 +00:00
isElementalShard(i) || i == itRevolver)
2016-08-26 09:58:03 +00:00
return IC_OTHER;
return IC_ORB;
}
bool isAlch(eWall w) {
return w == waFloorA || w == waFloorB;
}
bool isAlch(cell *c) { return isAlch(c->wall); }
bool isAlchAny(eWall w) {
return w == waFloorA || w == waFloorB || w == waFloorC || w == waFloorD;
}
bool isAlchAny(cell *c) { return isAlchAny(c->wall); }
bool realred(eWall w) {
return w == waRed1 || w == waRed2 || w == waRed3;
}
int snakelevel(eWall w) {
if(w == waRed1 || w == waDeadfloor2 || w == waRubble || w == waGargoyleFloor ||
2017-03-23 10:53:57 +00:00
w == waGargoyleBridge || w == waTempFloor || w == waTempBridge || w == waRoundTable)
2016-08-26 09:58:03 +00:00
return 1;
if(w == waRed2) return 2;
if(w == waRed3) return 3;
2017-03-23 10:53:57 +00:00
if(w == waTower) return 3;
2016-08-26 09:58:03 +00:00
return 0;
}
int snakelevel(cell *c) { return snakelevel(c->wall); }
bool isWall(cell *w) {
if(w->wall == waNone || isAlchAny(w) ||
w->wall == waCavefloor || w->wall == waFrozenLake || w->wall == waVineHalfA ||
w->wall == waVineHalfB || w->wall == waDeadfloor || w->wall == waDeadfloor2 ||
w->wall == waRubble || w->wall == waGargoyleFloor || w->wall == waGargoyleBridge ||
w->wall == waTempFloor || w->wall == waTempBridge ||
w->wall == waBoat || w->wall == waCIsland || w->wall == waCIsland2 ||
w->wall == waRed1 || w->wall == waRed2 || w->wall == waRed3 ||
w->wall == waMineUnknown || w->wall == waMineMine || w->wall == waMineOpen ||
w->wall == waStrandedBoat || w->wall == waOpenGate || w->wall == waClosePlate ||
w->wall == waOpenPlate || w->wall == waTrapdoor || w->wall == waGiantRug ||
w->wall == waLadder || w->wall == waTrunk || w->wall == waSolidBranch ||
2017-03-23 10:53:57 +00:00
w->wall == waWeakBranch || w->wall == waCanopy || w->wall == waTower ||
w->wall == waSmallBush || w->wall == waBigBush ||
w->wall == waReptile || w->wall == waReptileBridge)
2016-08-26 09:58:03 +00:00
return false;
if(isWatery(w) || isChasmy(w) || isFire(w)) return false;
return true;
}
bool isAngryBird(eMonster m) {
return m == moEagle || m == moAlbatross || m == moBomberbird || m == moGargoyle ||
2017-03-23 10:53:57 +00:00
m == moWindCrow || m == moSparrowhawk ||
m == moVampire || m == moBat || m == moButterfly || m == moGadfly;
2016-08-26 09:58:03 +00:00
}
bool isBird(eMonster m) {
2017-03-23 10:53:57 +00:00
return isAngryBird(m) || m == moTameBomberbird || m == moTameBomberbirdMoved;
}
bool slowMover(eMonster m) {
return
m == moLesser || m == moGreater || isMetalBeast(m) ||
m == moTortoise || m == moDraugr;
2016-08-26 09:58:03 +00:00
}
bool normalMover(eMonster m) {
return
m == moYeti || m == moRanger || m == moGoblin || m == moTroll || m == moDesertman ||
m == moMonkey || m == moZombie || m == moNecromancer || m == moCultist ||
2017-03-23 10:53:57 +00:00
m == moRunDog || m == moPyroCultist ||
2016-08-26 09:58:03 +00:00
m == moFireFairy || m == moCrystalSage || m == moHedge ||
m == moVineBeast || m == moLancer || m == moFlailer ||
m == moMiner || m == moDarkTroll ||
(playerInPower() && (
(isWitch(m) && m != moWitchGhost && m != moWitchWinter) || m == moEvilGolem
)) ||
m == moRedTroll ||
m == moPalace || m == moFatGuard || m == moSkeleton || m == moVizier ||
m == moFjordTroll || m == moStormTroll || m == moForestTroll ||
2017-03-23 10:53:57 +00:00
m == moFamiliar ||
m == moFireElemental || m == moOrangeDog ||
2016-08-26 09:58:03 +00:00
m == moOutlaw || m == moRedFox || m == moFalsePrincess || m == moRoseLady ||
m == moRoseBeauty || m == moWolf ||
2017-03-23 10:53:57 +00:00
m == moResearcher || m == moRagingBull ||
slowMover(m);
2016-08-26 09:58:03 +00:00
}
// from-to
bool isGhost(eMonster m) {
return m == moGhost || m == moTentacleGhost || m == moFriendlyGhost;
}
bool isGhostMover(eMonster m) {
return m == moGhost || m == moGreaterShark || m == moTentacleGhost ||
(playerInPower() && (m == moWitchGhost || m == moWitchWinter));
}
bool isShark(eMonster m) {
return m == moShark || m == moCShark || m == moGreaterShark;
}
bool isSlimeMover(eMonster m) {
return
2017-03-23 10:53:57 +00:00
m == moSlime || m == moSeep || m == moVineSpirit || m == moParrot;
2016-08-26 09:58:03 +00:00
}
2017-03-23 10:53:57 +00:00
bool isDragon(eMonster m) { return m == moDragonHead || m == moDragonTail; }
bool isKraken(eMonster m) { return m == moKrakenH || m == moKrakenT; }
2016-08-26 09:58:03 +00:00
bool isBlowableMonster(eMonster m) {
return m && !(
isWorm(m) || isIvy(m) || isMutantIvy(m) || isSlimeMover(m) ||
m == moGhost || m == moGreaterShark ||
2017-03-23 10:53:57 +00:00
m == moWaterElemental || m == moWitchGhost || isMimic(m) ||
isKraken(m)
2016-08-26 09:58:03 +00:00
);
}
bool isMultitile(eMonster m) {
2017-03-23 10:53:57 +00:00
return isWorm(m) || isIvy(m) || isMutantIvy(m) || isKraken(m);
2016-08-26 09:58:03 +00:00
}
bool isSlimeMover(cell *c) {
return isSlimeMover(c->monst);
}
int slimegroup(cell *c) {
if(c->wall == waCavewall || c->wall == waDeadwall)
return 1;
if(isWatery(c))
return 2;
if(c->wall == waFloorA)
return 3;
if(c->wall == waFloorB)
return 4;
if(c->wall == waVinePlant || cellHalfvine(c))
return 5;
if(c->wall == waCTree)
return 6;
return 0;
}
bool isLeader(eMonster m) {
return m == moPirate || m == moCultistLeader || m == moViking || m == moRatling || m == moRatlingAvenger;
}
bool isFlying(eMonster m) {
2017-03-23 10:53:57 +00:00
return isBird(m) || isGhost(m) || m == moAirElemental || isDragon(m) || checkOrb(m, itOrbAether);
2016-08-26 09:58:03 +00:00
}
bool survivesChasm(eMonster m) {
return isFlying(m);
}
bool ignoresPlates(eMonster m) {
return m == moMouse || isFlying(m);
}
bool itemBurns(eItem it) {
2017-03-23 10:53:57 +00:00
return it && it != itOrbDragon && it != itOrbFire && it != itDragon && it != itTreat;
2016-08-26 09:58:03 +00:00
}
bool attackThruVine(eMonster m) {
return m == moGhost || m == moVineSpirit || m == moFriendlyGhost || m == moTentacleGhost;
}
bool attackNonAdjacent(eMonster m) {
return m == moGhost || m == moFriendlyGhost || m == moTentacleGhost;
}
2017-03-23 10:53:57 +00:00
bool noHighlight(eMonster m) {
return
(m == moIvyWait || m == moIvyNext || m == moIvyDead);
}
2016-08-26 09:58:03 +00:00
bool isInactiveEnemy(cell *w, eMonster forwho) {
if(w->monst == moWormtail || w->monst == moWormwait || w->monst == moTentacletail || w->monst == moTentaclewait || w->monst == moHexSnakeTail)
return true;
if(w->monst == moLesserM || w->monst == moGreaterM)
return true;
if(w->monst == moIvyRoot || w->monst == moIvyWait || w->monst == moIvyNext || w->monst == moIvyDead)
return true;
if(w->monst && ((forwho == moPlayer) ? realstuntime(w) : realstuntime(w) > 1) && !isFriendly(w))
return true;
return false;
}
// forpc = true (for PC), false (for golems)
bool isActiveEnemy(cell *w, eMonster forwho) {
if(((forwho == moPlayer) ? realstuntime(w) : realstuntime(w) > 1))
return false;
if(w->monst == moNone) return false;
if(isFriendly(w)) return false;
if(isInactiveEnemy(w, forwho)) return false;
return true;
}
bool isUnarmed(eMonster m) {
return
m == moMouse || m == moMouseMoved || m == moPrincess || m == moPrincessMoved ||
2017-03-23 10:53:57 +00:00
m == moCrystalSage || m == moVampire || m == moBat;
2016-08-26 09:58:03 +00:00
}
bool isArmedEnemy(cell *w, eMonster forwho) {
return w->monst != moCrystalSage && isActiveEnemy(w, forwho);
}
bool isHive(eLand l) {
return l == laHive;
}
bool isIcyWall(cell *c) {
return c->wall == waNone || c->wall == waIcewall || c->wall == waFrozenLake || c->wall == waLake;
}
bool eternalFire(cell *c) {
return c->land == laDryForest || c->land == laPower || c->land == laMinefield ||
c->land == laEFire || c->land == laElementalWall;
}
bool isCyclic(eLand l) {
return
2017-03-23 10:53:57 +00:00
l == laWhirlpool || l == laTemple || l == laCamelot || l == laClearing ||
l == laMountain;
2016-08-26 09:58:03 +00:00
}
bool haveRangedOrb() {
return
items[itOrbPsi] || items[itOrbDragon] || items[itOrbTeleport] ||
2017-03-23 10:53:57 +00:00
items[itOrbIllusion] || items[itOrbSpace] || items[itOrbAir] ||
2016-08-26 09:58:03 +00:00
items[itOrbFrog] || items[itOrbSummon] || items[itOrbMatter] ||
items[itRevolver] || items[itOrbStunning] || items[itStrongWind] ||
2017-03-23 10:53:57 +00:00
items[itOrbDomination] || items[itOrbNature] || items[itOrbDash];
2016-08-26 09:58:03 +00:00
}
bool isOffensiveOrb(eItem it) {
return it == itOrbLightning || it == itOrbFlash || it == itOrbThorns ||
it == itOrbDragon || it == itOrbStunning ||
it == itOrbFreedom || it == itOrbPsi;
}
bool isRangedOrb(eItem i) {
return i == itOrbPsi || i == itOrbDragon || i == itOrbTeleport || i == itOrbIllusion ||
2017-03-23 10:53:57 +00:00
i == itOrbSpace || i == itOrbAir || i == itOrbFrog ||
2016-08-26 09:58:03 +00:00
i == itOrbSummon || i == itOrbMatter || i == itRevolver || i == itOrbStunning ||
2017-03-23 10:53:57 +00:00
i == itOrbDomination || i == itOrbNature || i == itOrbDash;
2016-08-26 09:58:03 +00:00
}
bool isProtectionOrb(eItem i) {
return i == itOrbWinter || i == itOrbShield || i == itOrbInvis || i == itOrbShell;
}
bool isEmpathyOrb(eItem i) {
return
i == itOrbFire || i == itOrbDigging || i == itOrbWinter ||
i == itOrbUndeath || i == itOrbSpeed || i == itOrbShield ||
2017-03-23 10:53:57 +00:00
i == itOrbAether || i == itOrbInvis || i == itOrbThorns ||
i == itOrbWater || i == itOrbStone;
2016-08-26 09:58:03 +00:00
}
bool isUtilityOrb(eItem i) {
return i == itOrbSpeed || i == itOrbDigging ||
2017-03-23 10:53:57 +00:00
i == itOrbSafety || i == itOrbTeleport || i == itOrbAether ||
i == itOrbTime || i == itOrbSpace ||
2016-08-26 09:58:03 +00:00
i == itOrbSummon || i == itOrbLuck || i == itOrbEnergy;
}
2017-03-23 10:53:57 +00:00
bool isDirectionalOrb(eItem i) {
return i == itOrbHorns || i == itOrbBull;
}
bool isRevivalOrb(eItem i) {
return i == itOrbLife || i == itOrbFriend || i == itOrbUndeath;
}
2016-08-26 09:58:03 +00:00
bool isFriendOrb(eItem i) {
return i == itOrbLife || i == itOrbFriend || i == itOrbDiscord || i == itOrbLove ||
i == itOrbEmpathy || i == itOrbUndeath;
}
bool isFriendlyGhost(eMonster m) {
2017-03-23 10:53:57 +00:00
return m == moFriendlyGhost || (markEmpathy(itOrbAether) && isFriendly(m));
2016-08-26 09:58:03 +00:00
}
bool survivesWater(eMonster m) {
return
m == moShark || m == moGreaterShark || m == moCShark ||
2017-03-23 10:53:57 +00:00
isGhost(m) || m == moWitchGhost || m == moShadow ||
2016-08-26 09:58:03 +00:00
isBird(m) || m == moWaterElemental || m == moAirElemental ||
2017-03-23 10:53:57 +00:00
isWorm(m) || isIvy(m) || isDragon(m) || isKraken(m) ||
m == moMutant || m == moFriendlyIvy ||
2016-08-26 09:58:03 +00:00
m == moTortoise; // Tortoises and Ivies survive, but don't go through water
}
2017-03-23 10:53:57 +00:00
// flying even if stunned
bool isPermanentFlying(eMonster m) {
return m == moAirElemental || isGhost(m);
}
2016-08-26 09:58:03 +00:00
bool survivesFire(eMonster m) {
return
isGhost(m) || m == moWitchWinter || m == moWitchGhost ||
m == moBomberbird || m == moTameBomberbird || m == moTameBomberbirdMoved ||
(isFriendly(m) && markOrb(itOrbWinter)) || isWorm(m) || m == moFireElemental ||
2017-03-23 10:53:57 +00:00
isDragon(m) || m == moShadow;
2016-08-26 09:58:03 +00:00
}
2017-03-23 10:53:57 +00:00
/* bool survivesMine(eMonster m) {
return ignoresPlates(m) || isFlying(m);
} */
2016-08-26 09:58:03 +00:00
bool survivesWall(eMonster m) {
return isGhost(m);
}
bool survivesThorns(eMonster m) {
2017-03-23 10:53:57 +00:00
return isGhost(m) || m == moSkeleton || m == moDraugr;
2016-08-26 09:58:03 +00:00
}
bool survivesFall(eMonster m) {
2017-03-23 10:53:57 +00:00
return isBird(m) || m == moAirElemental || m == moSkeleton || isDragon(m) || m == moShadow ||
isGhost(m);
2016-08-26 09:58:03 +00:00
}
bool isThorny(eWall w) { return w == waRose; }
bool checkOrb(eMonster m1, eItem orb) {
if(m1 == moPlayer) return markOrb(orb);
if(isFriendly(m1)) return markEmpathy(orb);
return false;
}
2017-03-23 10:53:57 +00:00
bool checkOrb2(eMonster m1, eItem orb) {
if(m1 == moPlayer) return markOrb2(orb);
if(isFriendly(m1)) return markEmpathy2(orb);
return false;
}
2016-08-26 09:58:03 +00:00
bool ignoresSmell(eMonster m) {
return
m == moHexSnake || isIvy(m) || isMutantIvy(m) || isGhostMover(m) || isSlimeMover(m) ||
2017-03-23 10:53:57 +00:00
m == moRoseLady || checkOrb(m, itOrbBeauty) || checkOrb(m, itOrbAether) || checkOrb(m, itOrbShield);
}
bool isTroll(eMonster m) {
return
m == moTroll || m == moRedTroll || m == moDarkTroll ||
m == moForestTroll || m == moStormTroll || m == moFjordTroll;
}
bool isGrave(eWall w) {
return w == waFreshGrave || w == waAncientGrave;
}
bool isTree(cell *c) {
return false; // c->wall == waBigTree || c->wall == waSmallTree;
}
bool highwall(cell *c) {
if(c->wall == waGlass) return false;
if(wmescher && wmspatial && c->wall == waBarrier && c->land == laOceanWall)
return false;
// if(wmspatial && isTree(c)) return false;
if(isGrave(c->wall)) return true;
return winf[c->wall].glyph == '#' || c->wall == waClosedGate;
}
int chasmgraph(cell *c) {
if(c->wall == waChasm) return 2;
if(isChasmy(c)) return 1;
if(isWateryOrBoat(c)) return 1;
if(wmescher && c->wall == waBarrier && c->land == laOceanWall) return 1;
if(c->wall == waReptileBridge) return 1;
return 0;
}
bool conegraph(cell *c) {
return wmescher && wmspatial && (c->wall == waDune || c->wall == waBigTree || c->wall == waSmallTree || c->wall == waCTree || (c->wall == waBarrier && c->land == laOceanWall));
}
bool isReptile(eWall w) {
return w == waReptile || w == waReptileBridge;
}
bool isBull(eMonster m) {
return m == moRagingBull || m == moHerdBull || m == moSleepBull;
}
bool hornStuns(cell *c) {
eMonster m = c->monst;
return
m == moRagingBull || m == moSleepBull || m == moHerdBull ||
m == moButterfly || m == moGreater || m == moGreaterM || m == moDraugr ||
m == moHedge || m == moFlailer || m == moVizier ||
attackJustStuns(c);
}
// generate all the world first in the quotient geometry
bool generateAll(eLand l) {
return
l == laIce || l == laDryForest || l == laCocytus || l == laLivefjord ||
l == laCaves || l == laCA;
2016-08-26 09:58:03 +00:00
}