mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-26 17:06:59 +00:00
item/monster/wall/land types done with X-macros; flags given too
This commit is contained in:
parent
f3e0ae4904
commit
02a174b3ca
1254
classes.cpp
1254
classes.cpp
File diff suppressed because it is too large
Load Diff
277
classes.h
277
classes.h
@ -10,72 +10,68 @@ static inline void set_flag(flagtype& f, flagtype which, bool b) {
|
|||||||
else f &= ~which;
|
else f &= ~which;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const int motypes = 167;
|
static const flagtype MF_NOGHOST = Flag(0);
|
||||||
|
static const flagtype MF_RAIDER = Flag(1);
|
||||||
|
static const flagtype MF_PRINCESS = Flag(2);
|
||||||
|
static const flagtype MF_MIMIC = Flag(3);
|
||||||
|
static const flagtype MF_GOK = Flag(4);
|
||||||
|
static const flagtype MF_NONLIVING = Flag(5);
|
||||||
|
static const flagtype MF_METAL = Flag(6);
|
||||||
|
static const flagtype MF_STUNNABLE = Flag(7);
|
||||||
|
static const flagtype MF_HP = Flag(8);
|
||||||
|
static const flagtype MF_MOUNTABLE = Flag(9);
|
||||||
|
static const flagtype MF_FRIENDLY = Flag(10);
|
||||||
|
static const flagtype MF_PLAYER = Flag(11);
|
||||||
|
static const flagtype MF_BUG = Flag(12);
|
||||||
|
static const flagtype MF_IVY = Flag(13);
|
||||||
|
static const flagtype MF_PART = Flag(14);
|
||||||
|
static const flagtype MF_MUTANTIVY = Flag(15);
|
||||||
|
static const flagtype MF_ANYIVY = Flag(16);
|
||||||
|
static const flagtype MF_BULLET = Flag(17);
|
||||||
|
static const flagtype MF_DEMON = Flag(18);
|
||||||
|
static const flagtype MF_WORM = Flag(19);
|
||||||
|
static const flagtype MF_WITCH = Flag(20);
|
||||||
|
static const flagtype MF_BIRD = Flag(21);
|
||||||
|
static const flagtype MF_SLOWMOVER = Flag(22);
|
||||||
|
static const flagtype MF_MAGNETIC = Flag(23);
|
||||||
|
static const flagtype MF_SWITCH = Flag(24);
|
||||||
|
static const flagtype MF_GHOST = Flag(25);
|
||||||
|
static const flagtype MF_SHARK = Flag(26);
|
||||||
|
static const flagtype MF_SLIME = Flag(27);
|
||||||
|
static const flagtype MF_DRAGON = Flag(28);
|
||||||
|
static const flagtype MF_KRAKEN = Flag(29);
|
||||||
|
static const flagtype MF_NOBLOW = Flag(30);
|
||||||
|
static const flagtype MF_MULTITILE = Flag(31);
|
||||||
|
static const flagtype MF_LEADER = Flag(32);
|
||||||
|
static const flagtype MF_FLYING = Flag(33);
|
||||||
|
static const flagtype MF_ATTACK_THRU_VINE = Flag(34);
|
||||||
|
static const flagtype MF_ATTACK_NONADJACENT = Flag(35);
|
||||||
|
static const flagtype MF_NOHIGHLIGHT = Flag(36);
|
||||||
|
static const flagtype MF_INACTIVE = Flag(37);
|
||||||
|
static const flagtype MF_UNARMED = Flag(38);
|
||||||
|
static const flagtype MF_IGNORE_PLATE = Flag(39);
|
||||||
|
static const flagtype MF_BULL = Flag(40);
|
||||||
|
static const flagtype MF_TROLL = Flag(41);
|
||||||
|
static const flagtype MF_IGNORE_SMELL = Flag(42);
|
||||||
|
static const flagtype MF_RATLING = Flag(43);
|
||||||
|
static const flagtype MF_POWER = Flag(44);
|
||||||
|
static const flagtype MF_GHOSTMOVER = Flag(45);
|
||||||
|
|
||||||
|
enum eMonster {
|
||||||
|
#define MONSTER(a,b,c,d,e,f,g,h) d,
|
||||||
|
#include "content.cpp"
|
||||||
|
motypes
|
||||||
|
};
|
||||||
|
|
||||||
struct monstertype {
|
struct monstertype {
|
||||||
char glyph;
|
char glyph;
|
||||||
color_t color;
|
color_t color;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
flagtype flags;
|
||||||
|
enum eMonster mgroup;
|
||||||
const char *help;
|
const char *help;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eMonster {
|
|
||||||
moNone,
|
|
||||||
moYeti, moWolf, moWolfMoved,
|
|
||||||
moRanger,
|
|
||||||
moTroll, moGoblin,
|
|
||||||
moWorm, moWormtail, moWormwait, moHedge,
|
|
||||||
moDesertman,
|
|
||||||
moIvyRoot, moIvyHead, moIvyBranch, moIvyWait, moIvyNext, moIvyDead,
|
|
||||||
moMonkey,
|
|
||||||
moSlime,
|
|
||||||
moMimic, moREMOVED, moGolem, moGolemMoved,
|
|
||||||
moEagle, moSeep,
|
|
||||||
moZombie, moGhost, moNecromancer, moShadow,
|
|
||||||
moTentacle, moTentacletail, moTentaclewait, moTentacleEscaping,
|
|
||||||
moCultist, moPyroCultist,
|
|
||||||
moGreater, moGreaterM, moLesser, moLesserM,
|
|
||||||
moShark, moRunDog, moGreaterShark, moFireFairy,
|
|
||||||
moCrystalSage, moLancer, moFlailer, moMiner,
|
|
||||||
moVineBeast, moVineSpirit, moDarkTroll, moEarthElemental,
|
|
||||||
moBug0, moBug1, moBug2,
|
|
||||||
moWitch, moWitchSpeed, moWitchFlash, moWitchFire, moWitchWinter, moWitchGhost,
|
|
||||||
moEvilGolem, moKnight, moCultistLeader, moSlimeNextTurn, moKnightMoved,
|
|
||||||
moIllusion,
|
|
||||||
moPirate, moCShark, moParrot,
|
|
||||||
moHexSnake, moHexSnakeTail, moRedTroll, moBomberbird, moAlbatross,
|
|
||||||
moTameBomberbird, moTameBomberbirdMoved,
|
|
||||||
moPalace, moFatGuard, moSkeleton, moVizier,
|
|
||||||
moViking, moFjordTroll, moWaterElemental,
|
|
||||||
moMouse, moMouseMoved,
|
|
||||||
moPrincess, moPrincessMoved,
|
|
||||||
moPrincessArmed, moPrincessArmedMoved,
|
|
||||||
moFamiliar, moGargoyle, moFireElemental, moAirElemental,
|
|
||||||
moOrangeDog, moTentacleGhost,
|
|
||||||
moMetalBeast, moMetalBeast2, moOutlaw, moMutant,
|
|
||||||
moStormTroll, moForestTroll,
|
|
||||||
moRedFox, moWindCrow, moFriendlyGhost, moRatling, moFalsePrincess, moRoseLady,
|
|
||||||
moRoseBeauty, moRatlingAvenger,
|
|
||||||
moTortoise, moDragonHead, moDragonTail,
|
|
||||||
moGadfly, moResearcher, moSparrowhawk,
|
|
||||||
moKrakenH, moKrakenT, moDraugr, moFriendlyIvy,
|
|
||||||
moVampire, moBat, moReptile,
|
|
||||||
moHerdBull, moRagingBull, moSleepBull,
|
|
||||||
moButterfly, moNarciss, moMirrorSpirit,
|
|
||||||
moHunterDog, moTerraWarrior, moJiangshi, moVoidBeast, moLavaWolf, moHunterGuard,
|
|
||||||
moIceGolem, moSandBird, moSalamander, moHunterChanging,
|
|
||||||
moNorthPole, moSouthPole,
|
|
||||||
moPair, moHexDemon, moAltDemon, moMonk, moCrusher,
|
|
||||||
moSwitch1, moSwitch2,
|
|
||||||
moBrownBug, moAcidBird, moVariantWarrior,
|
|
||||||
moFallingDog, moWestHawk,
|
|
||||||
// shmup specials
|
|
||||||
moPlayer, moBullet, moFlailBullet, moFireball, moTongue, moAirball, moCrushball,
|
|
||||||
// temporary
|
|
||||||
moDeadBug, moLightningBolt, moDeadBird, moEnergySword, moWarning, moArrowTrap,
|
|
||||||
moRogueviz
|
|
||||||
};
|
|
||||||
|
|
||||||
struct genderswitch_t {
|
struct genderswitch_t {
|
||||||
int gender;
|
int gender;
|
||||||
eMonster m;
|
eMonster m;
|
||||||
@ -85,130 +81,103 @@ struct genderswitch_t {
|
|||||||
|
|
||||||
#define NUM_GS 6
|
#define NUM_GS 6
|
||||||
|
|
||||||
static const int ittypes = 136;
|
enum eOrbshape { osNone, osLove, osRanged, osOffensive, osFriend, osUtility, osDirectional, osWarping };
|
||||||
|
|
||||||
|
static const flagtype ZERO = 0;
|
||||||
|
|
||||||
|
static const flagtype IF_SHARD = Flag(0);
|
||||||
|
static const flagtype IF_FIREPROOF = Flag(1);
|
||||||
|
static const flagtype IF_PROTECTION = Flag(2);
|
||||||
|
static const flagtype IF_EMPATHY = Flag(3);
|
||||||
|
static const flagtype IF_RANGED = Flag(4);
|
||||||
|
static const flagtype IF_SHMUPLIFE = Flag(5);
|
||||||
|
|
||||||
struct itemtype {
|
struct itemtype {
|
||||||
char glyph;
|
char glyph;
|
||||||
color_t color;
|
color_t color;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
int itemclass;
|
||||||
|
flagtype flags;
|
||||||
|
eOrbshape orbshape;
|
||||||
const char *help;
|
const char *help;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eItem {
|
enum eItem {
|
||||||
itNone, itDiamond, itGold, itSpice, itRuby, itElixir, itShard, itBone, itHell, itStatue,
|
#define ITEM(a,b,c,d,e,f,g,h,i) d,
|
||||||
itFeather, itSapphire, itHyperstone, itKey,
|
#include "content.cpp"
|
||||||
itGreenStone, itOrbYendor,
|
ittypes
|
||||||
itOrbLightning, itOrbFlash, itOrbWinter, itOrbSpeed, itOrbLife, itOrbShield, itOrbDigging,
|
|
||||||
itOrbTeleport, itOrbSafety,
|
|
||||||
itOrbThorns, itFernFlower,
|
|
||||||
itWine, itOrbAether, itSilver, itOrbPsi,
|
|
||||||
itRoyalJelly, itEmerald, itOrbInvis, itPower, itOrbFire,
|
|
||||||
itHolyGrail, itGrimoire,
|
|
||||||
itOrbDragon, itOrbIllusion,
|
|
||||||
itPirate, itCompass,
|
|
||||||
itRedGem, itOrbTime, itOrbSpace,
|
|
||||||
itBombEgg, itCoast, itWhirlpool,
|
|
||||||
itOrbFriend, itOrbWater, itOrbAir,
|
|
||||||
itPalace, itOrbFrog,
|
|
||||||
itFjord, itOrbFish,
|
|
||||||
itOrbDiscord,
|
|
||||||
itSavedPrincess, itOrbLove,
|
|
||||||
itIvory, itZebra,
|
|
||||||
itFireShard, itAirShard, itEarthShard, itWaterShard,
|
|
||||||
itElemental, itOrbSummon, itOrbMatter,
|
|
||||||
itBounty, itRevolver, itFulgurite, itMutant,
|
|
||||||
itOrbStunning, itOrbLuck,
|
|
||||||
itMutant2, itOrbFreedom, itLotus, itOrbUndeath,
|
|
||||||
itWindstone, itOrbEmpathy, itStrongWind, itBuggy, itBuggy2,
|
|
||||||
itRose, itCoral, itOrbBeauty, itOrb37, itOrbEnergy,
|
|
||||||
itBabyTortoise, itOrbShell, itApple, itDragon, itOrbDomination,
|
|
||||||
itOrbSword, itKraken, itOrbSword2, itBarrow,
|
|
||||||
itTrollEgg, itWarning, itOrbStone, itOrbNature, itTreat,
|
|
||||||
itSlime, itAmethyst, itOrbRecall, itDodeca, itOrbDash, itGreenGrass, itOrbHorns,
|
|
||||||
itOrbBull, itBull, itOrbMirror,
|
|
||||||
itInventory,
|
|
||||||
itLavaLily, itHunting, itBlizzard, itTerra,
|
|
||||||
itOrbSide1, itOrbSide2, itOrbSide3,
|
|
||||||
itOrbLava, itOrbMorph, itGlowCrystal, itSnake,
|
|
||||||
itDock, itRuins, itMagnet, itSwitch,
|
|
||||||
itOrbPhasing, itOrbMagnetism, itOrbSlaying,
|
|
||||||
itBrownian, itWest, itVarTreasure,
|
|
||||||
itOrbIntensity, itOrbGravity, itOrbChoice
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int walltypes = 112;
|
enum eSlimegroup { sgNone, sgCave, sgWater, sgFloorA, sgFloorB, sgVine, sgTree };
|
||||||
|
|
||||||
|
static const flagtype WF_WATER = Flag(0);
|
||||||
|
static const flagtype WF_BOAT = Flag(1);
|
||||||
|
static const flagtype WF_CHASM = Flag(2);
|
||||||
|
static const flagtype WF_NOFLIGHT = Flag(3);
|
||||||
|
static const flagtype WF_FIRE = Flag(4);
|
||||||
|
static const flagtype WF_THUMPER = Flag(5);
|
||||||
|
static const flagtype WF_ACTIVABLE = Flag(6);
|
||||||
|
static const flagtype WF_ALCHEMY = Flag(7);
|
||||||
|
static const flagtype WF_RED = Flag(8);
|
||||||
|
static const flagtype WF_WALL = Flag(9);
|
||||||
|
static const flagtype WF_PUSHABLE = Flag(10);
|
||||||
|
static const flagtype WF_CONE = Flag(11);
|
||||||
|
static const flagtype WF_STDTREE = Flag(12);
|
||||||
|
static const flagtype WF_GRAVE = Flag(13);
|
||||||
|
static const flagtype WF_REPTILE = Flag(14);
|
||||||
|
static const flagtype WF_HEATCOLOR = Flag(15);
|
||||||
|
static const flagtype WF_HIGHWALL = Flag(16);
|
||||||
|
static const flagtype WF_THORNY = Flag(17);
|
||||||
|
static const flagtype WF_TIMEOUT = Flag(18);
|
||||||
|
static const flagtype WF_CISLAND = Flag(19);
|
||||||
|
static const flagtype WF_SULPHURIC = Flag(20);
|
||||||
|
static const flagtype WF_HALFVINE = Flag(21);
|
||||||
|
|
||||||
struct walltype {
|
struct walltype {
|
||||||
char glyph;
|
char glyph;
|
||||||
color_t color;
|
color_t color;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
flagtype flags;
|
||||||
|
int snakelevel;
|
||||||
|
eSlimegroup sg;
|
||||||
const char *help;
|
const char *help;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCavefloor, waDeadTroll, waDune,
|
enum eWall {
|
||||||
waMirror, waCloud, waThumperOff, waFire, waAncientGrave, waFreshGrave, waColumn, waSulphurC, waSulphur,
|
#define WALL(a,b,c,d,e,f,g,h,i) d,
|
||||||
waLake, waFrozenLake, waChasm, waChasmD, waBigTree, waSmallTree,
|
#include "content.cpp"
|
||||||
waVinePlant, waVineHalfA, waVineHalfB, waPartialFire,
|
walltypes
|
||||||
waDeadwall, waDeadfloor, waDeadfloor2, waWaxWall, waGlass, waCamelot, waRoundTable,
|
|
||||||
waCamelotMoat,
|
|
||||||
waBigStatue,
|
|
||||||
waSea, waBoat, waCIsland, waCIsland2, waCTree,
|
|
||||||
waRed1, waRed2, waRed3,
|
|
||||||
waMineUnknown, waMineMine, waMineOpen,
|
|
||||||
waStrandedBoat,
|
|
||||||
waPalace, waClosedGate, waOpenGate, waClosePlate, waOpenPlate, waTrapdoor,
|
|
||||||
waGiantRug,
|
|
||||||
waPlatform, waGargoyle, waGargoyleFloor, waRubble, waLadder, waStone,
|
|
||||||
waBonfireOff, waThumperOn, waEternalFire,
|
|
||||||
waGargoyleBridge,
|
|
||||||
waTempWall, waTempFloor, waTempBridge,
|
|
||||||
waCharged, waGrounded, waSandstone, waSaloon, waMetal,
|
|
||||||
waDeadTroll2, waFan,
|
|
||||||
waTemporary, waEarthD, waElementalTmp, waElementalD,
|
|
||||||
waSlime1, waSlime2, waRose, waWarpGate,
|
|
||||||
waTrunk, waSolidBranch, waWeakBranch, waCanopy,
|
|
||||||
waBarrowWall, waBarrowDig,
|
|
||||||
waPetrified, waTower,
|
|
||||||
waBigBush, waSmallBush,
|
|
||||||
waReptile, waReptileBridge,
|
|
||||||
waInvisibleFloor,
|
|
||||||
waMirrorWall,
|
|
||||||
waPetrifiedBridge,
|
|
||||||
waTempBridgeBlocked,
|
|
||||||
waTerraWarrior, waBubble,
|
|
||||||
waArrowTrap, waMercury, waMagma,
|
|
||||||
waDock, waBurningDock, waRuinWall, waBrownian,
|
|
||||||
waFireTrap, waExplosiveBarrel, waEditStatue
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int landtypes = 87;
|
static const flagtype LF_GENERATE_ALL = Flag(0);
|
||||||
|
static const flagtype LF_ICY = Flag(1);
|
||||||
|
static const flagtype LF_GRAVITY = Flag(2);
|
||||||
|
static const flagtype LF_EQUI = Flag(3);
|
||||||
|
static const flagtype LF_WARPED = Flag(4);
|
||||||
|
static const flagtype LF_CYCLIC = Flag(5);
|
||||||
|
static const flagtype LF_TECHNICAL = Flag(6);
|
||||||
|
static const flagtype LF_MIRROR = Flag(7);
|
||||||
|
static const flagtype LF_SEA = Flag(8);
|
||||||
|
static const flagtype LF_COASTAL = Flag(9);
|
||||||
|
static const flagtype LF_PURESEA = Flag(10);
|
||||||
|
static const flagtype LF_ELEMENTAL = Flag(11);
|
||||||
|
static const flagtype LF_HAUNTED = Flag(12);
|
||||||
|
static const flagtype LF_TROLL = Flag(13);
|
||||||
|
static const flagtype LF_INMIRROR = Flag(14);
|
||||||
|
static const flagtype LF_INMIRRORORWALL = Flag(15);
|
||||||
|
|
||||||
struct landtype {
|
struct landtype {
|
||||||
color_t color;
|
color_t color;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
flagtype flags;
|
||||||
|
eItem treasure;
|
||||||
const char *help;
|
const char *help;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle, laAlchemist, laMirror, laGraveyard,
|
enum eLand {
|
||||||
laRlyeh, laHell, laCocytus, laMotion, laDryForest, laEmerald, laWineyard, laDeadCaves,
|
#define LAND(a,b,c,d,e,f,g) c,
|
||||||
laHive, laPower, laCamelot, laTemple,
|
#include "content.cpp"
|
||||||
laCrossroads2, laCaribbean, laRedRock, laMinefield, laOcean, laWhirlpool,
|
landtypes
|
||||||
laPalace, laLivefjord,
|
|
||||||
laIvoryTower, laZebra, laEFire, laEAir, laEEarth, laEWater, laCrossroads3,
|
|
||||||
laOceanWall, laElementalWall,
|
|
||||||
laCanvas, laPrincessQuest,
|
|
||||||
laWildWest, laStorms, laOvergrown, laClearing,
|
|
||||||
laHaunted, laHauntedWall, laHauntedBorder,
|
|
||||||
laWhirlwind, laRose, laWarpCoast, laWarpSea, laCrossroads4,
|
|
||||||
laEndorian, laTortoise, laDragon,
|
|
||||||
laKraken, laBurial, laTrollheim,
|
|
||||||
laHalloween, laDungeon, laMountain, laReptile,
|
|
||||||
laPrairie, laBull, laCrossroads5, laCA,
|
|
||||||
laMirrorWall, laMirrored, laMirrorWall2, laMirrored2,
|
|
||||||
laMirrorOld,
|
|
||||||
laVolcano, laBlizzard, laHunting, laTerracotta, laMercuryRiver,
|
|
||||||
laDual, laSnakeNest, laDocks, laRuins, laMagnetic,
|
|
||||||
laSwitch, laMemory, laBrownian, laWestWall, laVariant
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eGeometry {
|
enum eGeometry {
|
||||||
|
669
flags.cpp
669
flags.cpp
@ -3,147 +3,150 @@
|
|||||||
|
|
||||||
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
|
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
rewritten
|
||||||
|
*/
|
||||||
|
|
||||||
|
// itemclass
|
||||||
|
// slimegroup (wall)
|
||||||
|
|
||||||
|
/*
|
||||||
|
it == itOrbLove ? shLoveRing :
|
||||||
|
isRangedOrb(it) ? shTargetRing :
|
||||||
|
isOffensiveOrb(it) ? shSawRing :
|
||||||
|
isFriendOrb(it) ? shPeaceRing :
|
||||||
|
isUtilityOrb(it) ? shGearRing :
|
||||||
|
isDirectionalOrb(it) ? shSpearRing :
|
||||||
|
among(it, itOrb37, itOrbGravity) ? shHeptaRing :
|
||||||
|
shRing;
|
||||||
|
*/
|
||||||
|
|
||||||
namespace hr {
|
namespace hr {
|
||||||
|
|
||||||
bool isIcyLand(eLand l) {
|
const flagtype& classflag(eItem it) { return iinf[it].flags; }
|
||||||
return l == laIce || l == laCocytus || l == laBlizzard;
|
const flagtype& classflag(eWall w) { return winf[w].flags; }
|
||||||
}
|
const flagtype& classflag(eMonster m) { return minf[m].flags; }
|
||||||
|
const flagtype& classflag(eLand l) { return linf[l].flags; }
|
||||||
|
|
||||||
bool isIcyLand(cell *c) {
|
#define ANYFLAGCHECK(name, cond, field, enum) bool name(enum w) { flagtype flag = classflag(w); return cond; } bool name(cell *c) { return name(c->field); }
|
||||||
return isIcyLand(c->land);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isGravityLand(eLand l) {
|
#define MONFLAGCHECK(name, cond) ANYFLAGCHECK(name, cond, monst, eMonster)
|
||||||
return among(l, laIvoryTower, laEndorian, laMountain, laDungeon, laWestWall);
|
#define WALLFLAGCHECK(name, cond) ANYFLAGCHECK(name, cond, wall, eWall)
|
||||||
}
|
#define ITEMFLAGCHECK(name, cond) ANYFLAGCHECK(name, cond, item, eItem)
|
||||||
|
#define LANDFLAGCHECK(name, cond) ANYFLAGCHECK(name, cond, land, eLand)
|
||||||
|
|
||||||
bool isEquidLand(eLand l) {
|
WALLFLAGCHECK(isWatery, flag & WF_WATER)
|
||||||
return isHaunted(l) || among(l, laIvoryTower, laEndorian, laDungeon, laOcean, laWestWall);
|
WALLFLAGCHECK(isBoat, flag & WF_BOAT)
|
||||||
}
|
WALLFLAGCHECK(isChasmy, flag & WF_CHASM)
|
||||||
|
WALLFLAGCHECK(isWateryOrBoat, flag & (WF_WATER | WF_BOAT))
|
||||||
|
WALLFLAGCHECK(isNoFlight, flag & WF_NOFLIGHT)
|
||||||
|
WALLFLAGCHECK(isFire, flag & WF_FIRE)
|
||||||
|
WALLFLAGCHECK(isThumper, flag & WF_THUMPER)
|
||||||
|
WALLFLAGCHECK(isActivable, flag & WF_ACTIVABLE)
|
||||||
|
WALLFLAGCHECK(hasTimeout, flag & WF_TIMEOUT)
|
||||||
|
WALLFLAGCHECK(isOnCIsland, flag & WF_CISLAND)
|
||||||
|
WALLFLAGCHECK(cellHalfvine, flag & WF_HALFVINE)
|
||||||
|
WALLFLAGCHECK(isAlch, flag & WF_ALCHEMY)
|
||||||
|
WALLFLAGCHECK(isAlchAny, flag & WF_ALCHEMY)
|
||||||
|
WALLFLAGCHECK(realred, flag & WF_RED)
|
||||||
|
WALLFLAGCHECK(isWall, flag & WF_WALL)
|
||||||
|
WALLFLAGCHECK(isPushable, flag & WF_PUSHABLE)
|
||||||
|
WALLFLAGCHECK(conegraphtype, flag & WF_CONE)
|
||||||
|
WALLFLAGCHECK(isStandardTree, flag & WF_STDTREE)
|
||||||
|
WALLFLAGCHECK(isGrave, flag & WF_GRAVE)
|
||||||
|
WALLFLAGCHECK(isReptile, flag & WF_REPTILE)
|
||||||
|
WALLFLAGCHECK(useHeatColoring, flag & WF_HEATCOLOR)
|
||||||
|
|
||||||
|
LANDFLAGCHECK(generateAll, flag & LF_GENERATE_ALL)
|
||||||
|
LANDFLAGCHECK(isIcyLand, flag & LF_ICY)
|
||||||
|
LANDFLAGCHECK(isGravityLand, flag & LF_GRAVITY)
|
||||||
|
LANDFLAGCHECK(isEquidLand, flag & LF_EQUI)
|
||||||
|
LANDFLAGCHECK(isWarped, flag & LF_WARPED)
|
||||||
|
LANDFLAGCHECK(isCyclic, flag & LF_CYCLIC)
|
||||||
|
LANDFLAGCHECK(isTechnicalLand, flag & LF_TECHNICAL)
|
||||||
|
LANDFLAGCHECK(is_mirrorland, flag & LF_MIRROR)
|
||||||
|
LANDFLAGCHECK(isSealand, flag & LF_SEA)
|
||||||
|
LANDFLAGCHECK(isCoastal, flag & LF_COASTAL)
|
||||||
|
LANDFLAGCHECK(isPureSealand, flag & LF_PURESEA)
|
||||||
|
LANDFLAGCHECK(isElemental, flag & LF_ELEMENTAL)
|
||||||
|
LANDFLAGCHECK(isHaunted, flag & LF_HAUNTED)
|
||||||
|
LANDFLAGCHECK(isTrollLand, flag & LF_TROLL)
|
||||||
|
LANDFLAGCHECK(inmirror, flag & LF_INMIRROR)
|
||||||
|
LANDFLAGCHECK(inmirrororwall, flag & LF_INMIRRORORWALL)
|
||||||
|
|
||||||
|
MONFLAGCHECK(isGhostable, !(flag & MF_NOGHOST))
|
||||||
|
MONFLAGCHECK(isRaider, flag & MF_RAIDER)
|
||||||
|
MONFLAGCHECK(isMimic, flag & MF_MIMIC)
|
||||||
|
MONFLAGCHECK(isPrincess, flag & MF_PRINCESS)
|
||||||
|
MONFLAGCHECK(isGolemOrKnight, flag & MF_GOK)
|
||||||
|
MONFLAGCHECK(isNonliving, flag & MF_NONLIVING)
|
||||||
|
MONFLAGCHECK(isMetalBeast, flag & MF_METAL)
|
||||||
|
MONFLAGCHECK(isStunnable, flag & MF_STUNNABLE)
|
||||||
|
MONFLAGCHECK(hasHitpoints, flag & MF_HP)
|
||||||
|
MONFLAGCHECK(isMountable, flag & MF_MOUNTABLE)
|
||||||
|
MONFLAGCHECK(isFriendlyType, flag & MF_FRIENDLY)
|
||||||
|
MONFLAGCHECK(isFriendlyOrPlayer, flag & (MF_FRIENDLY | MF_PLAYER))
|
||||||
|
MONFLAGCHECK(isBug, flag & MF_BUG)
|
||||||
|
MONFLAGCHECK(isIvy, flag & MF_IVY)
|
||||||
|
MONFLAGCHECK(isMonsterPart, flag & MF_PART)
|
||||||
|
MONFLAGCHECK(isMutantIvy, flag & MF_MUTANTIVY)
|
||||||
|
MONFLAGCHECK(isAnyIvy, flag & MF_ANYIVY)
|
||||||
|
MONFLAGCHECK(isBulletType, flag & MF_BULLET)
|
||||||
|
MONFLAGCHECK(isDemon, flag & MF_DEMON)
|
||||||
|
MONFLAGCHECK(isWorm, flag & MF_WORM)
|
||||||
|
MONFLAGCHECK(isWitch, flag & MF_WITCH)
|
||||||
|
MONFLAGCHECK(isAngryBird, (flag & MF_BIRD) && !(flag & MF_FRIENDLY))
|
||||||
|
MONFLAGCHECK(isBird, flag & MF_BIRD)
|
||||||
|
MONFLAGCHECK(slowMover, flag & MF_SLOWMOVER)
|
||||||
|
MONFLAGCHECK(isMagneticPole, flag & MF_MAGNETIC)
|
||||||
|
MONFLAGCHECK(isSwitch, flag & MF_SWITCH)
|
||||||
|
MONFLAGCHECK(isGhost, flag & MF_GHOST)
|
||||||
|
MONFLAGCHECK(isShark, flag & MF_SHARK)
|
||||||
|
MONFLAGCHECK(isSlimeMover, flag & MF_SLIME)
|
||||||
|
MONFLAGCHECK(isDragon, flag & MF_DRAGON)
|
||||||
|
MONFLAGCHECK(isKraken, flag & MF_KRAKEN)
|
||||||
|
MONFLAGCHECK(isBlowableMonster, !(flag & MF_NOBLOW))
|
||||||
|
MONFLAGCHECK(isMultitile, flag & MF_MULTITILE)
|
||||||
|
MONFLAGCHECK(isLeader, flag & MF_LEADER)
|
||||||
|
MONFLAGCHECK(isFlyingType, flag & MF_FLYING)
|
||||||
|
MONFLAGCHECK(attackThruVine, flag & MF_ATTACK_THRU_VINE)
|
||||||
|
MONFLAGCHECK(attackNonAdjacent, flag & MF_ATTACK_NONADJACENT)
|
||||||
|
MONFLAGCHECK(noHighlight, flag & MF_NOHIGHLIGHT)
|
||||||
|
MONFLAGCHECK(isInactiveEnemyType, flag & MF_INACTIVE)
|
||||||
|
MONFLAGCHECK(isUnarmed, flag & MF_UNARMED)
|
||||||
|
MONFLAGCHECK(ignoresPlatesType, flag & MF_IGNORE_PLATE)
|
||||||
|
MONFLAGCHECK(isBull, flag & MF_BULL)
|
||||||
|
MONFLAGCHECK(isTroll, flag & MF_TROLL)
|
||||||
|
MONFLAGCHECK(ignoresSmellType, flag & MF_IGNORE_SMELL)
|
||||||
|
MONFLAGCHECK(isRatling, flag & MF_RATLING)
|
||||||
|
MONFLAGCHECK(isGhostMover, flag & MF_GHOSTMOVER)
|
||||||
|
MONFLAGCHECK(isPowerMonster, flag & MF_POWER)
|
||||||
|
|
||||||
|
ITEMFLAGCHECK(isElementalShard, flag & IF_SHARD)
|
||||||
|
ITEMFLAGCHECK(itemBurns, !(flag & IF_FIREPROOF))
|
||||||
|
ITEMFLAGCHECK(isProtectionOrb, flag & IF_PROTECTION)
|
||||||
|
ITEMFLAGCHECK(isEmpathyOrb, flag & IF_EMPATHY)
|
||||||
|
ITEMFLAGCHECK(isRangedOrb, flag & IF_RANGED)
|
||||||
|
|
||||||
|
eMonster movegroup(eMonster m);
|
||||||
|
|
||||||
// watery
|
// watery
|
||||||
|
|
||||||
bool isWatery(cell *c) {
|
|
||||||
return c->wall == waCamelotMoat || c->wall == waSea || c->wall == waLake;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isBoat(cell *c) {
|
|
||||||
return among(c->wall, waBoat, waStrandedBoat);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isChasmy(cell *c) {
|
|
||||||
return c->wall == waChasm || c->wall == waSulphur || c->wall == waSulphurC || c->wall == waBubble ||
|
|
||||||
c->wall == waMercury;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isWateryOrBoat(cell *c) {
|
|
||||||
return isWatery(c) || c->wall == waBoat;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isNoFlight(cell *c) {
|
|
||||||
return
|
|
||||||
c->wall == waBoat || c->wall == waVineHalfA || c->wall == waVineHalfB ||
|
|
||||||
c->wall == waStrandedBoat || c->wall == waTrunk ||
|
|
||||||
c->wall == waBigBush || c->wall == waSmallBush;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool boatStrandable(cell *c) {
|
bool boatStrandable(cell *c) {
|
||||||
return c->wall == waNone && (c->land == laLivefjord || c->land == laOcean);
|
return c->wall == waNone && (c->land == laLivefjord || c->land == laOcean);
|
||||||
}
|
}
|
||||||
|
|
||||||
// monster/wall types
|
// monster/wall types
|
||||||
|
|
||||||
bool isFire(cell *w) {
|
|
||||||
return w->wall == waFire || w->wall == waPartialFire || w->wall == waEternalFire || w->wall == waBurningDock;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFireOrMagma(cell *w) {
|
bool isFireOrMagma(cell *w) {
|
||||||
return isFire(w) || w->wall == waMagma;
|
return isFire(w) || w->wall == waMagma;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ||
|
|
||||||
c->wall == waTempBridgeBlocked || c->wall == waBurningDock;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMimic(eMonster m) {
|
|
||||||
return m == moMimic;
|
|
||||||
}
|
|
||||||
|
|
||||||
int mirrorcolor(bool mirrored) {
|
int mirrorcolor(bool mirrored) {
|
||||||
return winf[mirrored ? waMirror : waCloud].color;
|
return winf[mirrored ? waMirror : waCloud].color;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 == moMimic || m == moGolem || m == moGolemMoved ||
|
|
||||||
m == moZombie || m == moGhost || m == moShadow || m == moSkeleton ||
|
|
||||||
m == moEvilGolem || m == moIllusion || m == moEarthElemental ||
|
|
||||||
m == moWaterElemental || m == moDraugr || m == moTerraWarrior ||
|
|
||||||
m == moIceGolem || m == moVoidBeast || m == moJiangshi;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMetalBeast(eMonster m) {
|
|
||||||
return m == moMetalBeast || m == moMetalBeast2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isStunnable(eMonster m) {
|
|
||||||
return
|
|
||||||
isMetalBeast(m) || isDragon(m) || isPrincess(m) ||
|
|
||||||
among(m, moPalace, moFatGuard, moSkeleton, moTortoise, moReptile, moTerraWarrior, moSalamander, moVizier, moBrownBug);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool hasHitpoints(eMonster m) {
|
|
||||||
return m == moPalace || m == moFatGuard || m == moVizier || isPrincess(m) || m == moTerraWarrior;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMountable(eMonster m) {
|
|
||||||
return isWorm(m) && m != moTentacleGhost;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFriendly(eMonster m) {
|
|
||||||
return isMimic(m) || isGolemOrKnight(m) || m == moIllusion || m == moFriendlyIvy;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFriendlyOrPlayer(eMonster m) {
|
|
||||||
return isFriendly(m) || m == moPlayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMounted(cell *c) {
|
bool isMounted(cell *c) {
|
||||||
if(c && c->monst && c->monst != moTentacleGhost && isMountable(c->monst)) {
|
if(c && c->monst && c->monst != moTentacleGhost && isMountable(c->monst)) {
|
||||||
for(int i=0; i<numplayers(); i++) {
|
for(int i=0; i<numplayers(); i++) {
|
||||||
@ -156,87 +159,20 @@ bool isMounted(cell *c) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int itemclass(eItem it) { return iinf[it].itemclass; }
|
||||||
|
|
||||||
|
bool isFriendly(eMonster m) { return isFriendlyType(m); }
|
||||||
|
|
||||||
bool isFriendly(cell *c) {
|
bool isFriendly(cell *c) {
|
||||||
return isMounted(c) || isFriendly(c->monst);
|
return isMounted(c) || 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!
|
bool isFriendlyOrBug(cell *c) { // or killable discord!
|
||||||
// do not attack the stunned Princess
|
// do not attack the stunned Princess
|
||||||
if(isPrincess(c->monst) && c->stuntime) return false;
|
if(isPrincess(c->monst) && c->stuntime) return false;
|
||||||
return isFriendly(c) || isBug(c) || (c->monst && markOrb(itOrbDiscord) && !c->stuntime);
|
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) {
|
|
||||||
return m == moMutant || (isIvy(m) && m != moIvyRoot) ||
|
|
||||||
m == moDragonTail || m == moKrakenT;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMutantIvy(eMonster m) {
|
|
||||||
return m == moMutant;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isAnyIvy(eMonster m) {
|
|
||||||
return isIvy(m) || isMutantIvy(m) || m == moFriendlyIvy;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isBulletType(eMonster m) {
|
|
||||||
return
|
|
||||||
m == moBullet || m == moFlailBullet || m == moFireball ||
|
|
||||||
m == moTongue || m == moAirball || m == moArrowTrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 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) {
|
bool cellUnstable(cell *c) {
|
||||||
return (c->land == laMotion && c->wall == waNone) || c->wall == waTrapdoor;
|
return (c->land == laMotion && c->wall == waNone) || c->wall == waTrapdoor;
|
||||||
}
|
}
|
||||||
@ -247,19 +183,6 @@ bool cellUnstableOrChasm(cell *c) {
|
|||||||
c->wall == waChasm || c->wall == waTrapdoor;
|
c->wall == waChasm || c->wall == waTrapdoor;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cellHalfvine(cell *c) {
|
|
||||||
return c->wall == waVineHalfA || c->wall == waVineHalfB;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isWarped(eLand l) {
|
|
||||||
return l == laWarpCoast || l == laWarpSea;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isElementalShard(eItem i) {
|
|
||||||
return
|
|
||||||
i == itFireShard || i == itAirShard || i == itEarthShard || i == itWaterShard;
|
|
||||||
}
|
|
||||||
|
|
||||||
eMonster elementalOf(eLand l) {
|
eMonster elementalOf(eLand l) {
|
||||||
if(l == laEFire) return moFireElemental;
|
if(l == laEFire) return moFireElemental;
|
||||||
if(l == laEWater) return moWaterElemental;
|
if(l == laEWater) return moWaterElemental;
|
||||||
@ -272,219 +195,21 @@ eItem localshardof(eLand l) {
|
|||||||
return eItem(itFireShard + (l - laEFire));
|
return eItem(itFireShard + (l - laEFire));
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ||
|
|
||||||
i == itElemental || i == itZebra || i == itIvory ||
|
|
||||||
i == itBounty || i == itFulgurite || i == itMutant || i == itLotus || i == itMutant2 ||
|
|
||||||
i == itWindstone || i == itCoral || i == itRose ||
|
|
||||||
i == itBabyTortoise || i == itDragon || i == itApple ||
|
|
||||||
i == itKraken || i == itBarrow || i == itTrollEgg || i == itTreat ||
|
|
||||||
i == itSlime || i == itAmethyst || i == itDodeca ||
|
|
||||||
i == itGreenGrass || i == itBull ||
|
|
||||||
i == itLavaLily || i == itHunting ||
|
|
||||||
i == itBlizzard || i == itTerra || i == itGlowCrystal || i == itSnake ||
|
|
||||||
i == itDock || i == itRuins || i == itSwitch || i == itMagnet ||
|
|
||||||
among(i, itWest, itVarTreasure, itBrownian)
|
|
||||||
)
|
|
||||||
return IC_TREASURE;
|
|
||||||
if(i == itSavedPrincess || i == itStrongWind || i == itWarning || i == itBuggy || i == itBuggy2)
|
|
||||||
return IC_NAI;
|
|
||||||
if(i == itKey || i == itOrbYendor || i == itGreenStone || i == itHolyGrail || i == itCompass ||
|
|
||||||
isElementalShard(i) || i == itRevolver || i == itInventory)
|
|
||||||
return IC_OTHER;
|
|
||||||
return IC_ORB;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isAlch(eWall w) {
|
|
||||||
return w == waFloorA || w == waFloorB;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* bool isAlch2(eWall w, bool bubbletoo) {
|
|
||||||
return w == waSlime1 || w == waSlime2 || (bubbletoo && w == waBubble);
|
|
||||||
} */
|
|
||||||
|
|
||||||
/* bool isAlch2(cell *c, bool bubbletoo) {
|
|
||||||
return isAlch2(c->wall, bubbletoo);
|
|
||||||
} */
|
|
||||||
|
|
||||||
bool isAlch(cell *c) { return isAlch(c->wall); }
|
|
||||||
|
|
||||||
bool isAlchAny(eWall w) {
|
|
||||||
return w == waFloorA || w == waFloorB;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 ||
|
|
||||||
w == waGargoyleBridge || w == waTempFloor || w == waTempBridge || w == waRoundTable ||
|
|
||||||
w == waPetrifiedBridge || w == waMagma)
|
|
||||||
return 1;
|
|
||||||
if(w == waRed2) return 2;
|
|
||||||
if(w == waRed3) return 3;
|
|
||||||
if(w == waTower) return 3;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int snakelevel(cell *c) {
|
int snakelevel(cell *c) {
|
||||||
#if CAP_COMPLEX2
|
#if CAP_COMPLEX2
|
||||||
if(c->land == laBrownian && among(c->wall, waNone, waMineMine, waFire)) return min(c->landparam / brownian::level, 3);
|
if(c->land == laBrownian && among(c->wall, waNone, waMineMine, waFire)) return min(c->landparam / brownian::level, 3);
|
||||||
#endif
|
#endif
|
||||||
return snakelevel(c->wall);
|
return winf[c->wall].snakelevel;
|
||||||
}
|
|
||||||
|
|
||||||
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 == waPetrifiedBridge ||
|
|
||||||
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 ||
|
|
||||||
w->wall == waWeakBranch || w->wall == waCanopy || w->wall == waTower ||
|
|
||||||
w->wall == waSmallBush || w->wall == waBigBush ||
|
|
||||||
w->wall == waReptile || w->wall == waReptileBridge || w->wall == waInvisibleFloor ||
|
|
||||||
w->wall == waSlime1 || w->wall == waSlime2 || w->wall == waArrowTrap || w->wall == waMagma ||
|
|
||||||
w->wall == waDock || w->wall == waFireTrap)
|
|
||||||
return false;
|
|
||||||
if(isWatery(w) || isChasmy(w) || isFire(w)) return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isPushable(eWall w) {
|
|
||||||
return w == waThumperOn || w == waExplosiveBarrel;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isAngryBird(eMonster m) {
|
|
||||||
return m == moEagle || m == moAlbatross || m == moBomberbird || m == moGargoyle ||
|
|
||||||
m == moWindCrow || m == moSparrowhawk ||
|
|
||||||
m == moVampire || m == moBat || m == moButterfly || m == moGadfly ||
|
|
||||||
m == moAcidBird || m == moWestHawk;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isBird(eMonster m) {
|
|
||||||
return isAngryBird(m) || m == moTameBomberbird || m == moTameBomberbirdMoved;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool slowMover(eMonster m) {
|
|
||||||
return
|
|
||||||
m == moLesser || m == moGreater || isMetalBeast(m) ||
|
|
||||||
m == moTortoise || m == moDraugr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMagneticPole(eMonster m) {
|
|
||||||
return m == moNorthPole || m == moSouthPole;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool normalMover(eMonster m) {
|
|
||||||
return
|
|
||||||
m == moYeti || m == moRanger || m == moGoblin || m == moTroll || m == moDesertman ||
|
|
||||||
m == moMonkey || m == moZombie || m == moNecromancer || m == moCultist ||
|
|
||||||
m == moRunDog || m == moPyroCultist ||
|
|
||||||
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 ||
|
|
||||||
m == moFamiliar ||
|
|
||||||
m == moFireElemental || m == moOrangeDog ||
|
|
||||||
m == moOutlaw || m == moRedFox || m == moFalsePrincess || m == moRoseLady ||
|
|
||||||
m == moRoseBeauty || m == moWolf ||
|
|
||||||
m == moResearcher || m == moRagingBull ||
|
|
||||||
m == moNarciss || m == moMirrorSpirit ||
|
|
||||||
m == moHunterDog || m == moTerraWarrior || m == moJiangshi ||
|
|
||||||
m == moLavaWolf || m == moSalamander ||
|
|
||||||
m == moHunterGuard || m == moHunterChanging ||
|
|
||||||
m == moIceGolem ||
|
|
||||||
m == moSwitch1 || m == moSwitch2 || m == moCrusher || m == moPair ||
|
|
||||||
m == moBrownBug || m == moVariantWarrior || m == moFallingDog ||
|
|
||||||
isMagneticPole(m) ||
|
|
||||||
slowMover(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isSwitch(eMonster m) {
|
|
||||||
return m == moSwitch1 || m == moSwitch2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// from-to
|
// from-to
|
||||||
|
|
||||||
bool isGhost(eMonster m) {
|
eSlimegroup slimegroup(cell *c) {
|
||||||
return m == moGhost || m == moTentacleGhost || m == moFriendlyGhost;
|
return winf[c->wall].sg;
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
m == moSlime || m == moSeep || m == moVineSpirit || m == moParrot;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isDragon(eMonster m) { return m == moDragonHead || m == moDragonTail; }
|
|
||||||
|
|
||||||
bool isKraken(eMonster m) { return m == moKrakenH || m == moKrakenT; }
|
|
||||||
|
|
||||||
bool isBlowableMonster(eMonster m) {
|
|
||||||
return m && !(
|
|
||||||
isWorm(m) || isIvy(m) || isMutantIvy(m) || isSlimeMover(m) ||
|
|
||||||
m == moGhost || m == moGreaterShark ||
|
|
||||||
m == moWaterElemental || m == moWitchGhost || isMimic(m) ||
|
|
||||||
isKraken(m)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMultitile(eMonster m) {
|
|
||||||
return isWorm(m) || isIvy(m) || isMutantIvy(m) || isKraken(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
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) {
|
bool isFlying(eMonster m) {
|
||||||
return isBird(m) || isGhost(m) || m == moAirElemental || isDragon(m) || checkOrb(m, itOrbAether);
|
return isFlyingType(m) || checkOrb(m, itOrbAether);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool survivesChasm(eMonster m) {
|
bool survivesChasm(eMonster m) {
|
||||||
@ -492,33 +217,11 @@ bool survivesChasm(eMonster m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ignoresPlates(eMonster m) {
|
bool ignoresPlates(eMonster m) {
|
||||||
return m == moMouse || isFlying(m) || m == moIllusion;
|
return ignoresPlatesType(m) || isFlying(m);
|
||||||
}
|
|
||||||
|
|
||||||
bool itemBurns(eItem it) {
|
|
||||||
return it && it != itOrbDragon && it != itOrbFire && it != itDragon && it != itOrbWinter && it != itOrbLava && it != itTreat && it != itLavaLily;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool attackThruVine(eMonster m) {
|
|
||||||
return m == moGhost || m == moVineSpirit || m == moFriendlyGhost || m == moTentacleGhost;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool attackNonAdjacent(eMonster m) {
|
|
||||||
return m == moGhost || m == moFriendlyGhost || m == moTentacleGhost;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool noHighlight(eMonster m) {
|
|
||||||
return
|
|
||||||
(m == moIvyWait || m == moIvyNext || m == moIvyDead);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isInactiveEnemy(cell *w, eMonster forwho) {
|
bool isInactiveEnemy(cell *w, eMonster forwho) {
|
||||||
if(w->monst == moWormtail || w->monst == moWormwait || w->monst == moTentacletail || w->monst == moTentaclewait || w->monst == moHexSnakeTail)
|
if(isInactiveEnemyType(w->monst)) return true;
|
||||||
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))
|
if(w->monst && ((forwho == moPlayer) ? realstuntime(w) : realstuntime(w) > 1) && !isFriendly(w))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@ -535,12 +238,6 @@ bool isActiveEnemy(cell *w, eMonster forwho) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isUnarmed(eMonster m) {
|
|
||||||
return
|
|
||||||
m == moMouse || m == moMouseMoved || m == moPrincess || m == moPrincessMoved ||
|
|
||||||
m == moCrystalSage || m == moVampire || m == moBat;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isArmedEnemy(cell *w, eMonster forwho) {
|
bool isArmedEnemy(cell *w, eMonster forwho) {
|
||||||
return w->monst != moCrystalSage && w->monst != moCrusher && isActiveEnemy(w, forwho);
|
return w->monst != moCrystalSage && w->monst != moCrusher && isActiveEnemy(w, forwho);
|
||||||
}
|
}
|
||||||
@ -549,21 +246,11 @@ bool isHive(eLand l) {
|
|||||||
return l == laHive;
|
return l == laHive;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isIcyWall(cell *c) {
|
|
||||||
return c->wall == waNone || c->wall == waIcewall || c->wall == waFrozenLake || c->wall == waLake;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool eternalFire(cell *c) {
|
bool eternalFire(cell *c) {
|
||||||
return c->land == laDryForest || (c->land == laPower && !smallbounded) || c->land == laMinefield ||
|
return c->land == laDryForest || (c->land == laPower && !smallbounded) || c->land == laMinefield ||
|
||||||
c->land == laEFire || c->land == laElementalWall;
|
c->land == laEFire || c->land == laElementalWall;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isCyclic(eLand l) {
|
|
||||||
return
|
|
||||||
l == laWhirlpool || l == laTemple || l == laCamelot || l == laClearing ||
|
|
||||||
l == laMountain;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool haveRangedOrb() {
|
bool haveRangedOrb() {
|
||||||
return
|
return
|
||||||
items[itOrbPsi] || items[itOrbDragon] || items[itOrbTeleport] ||
|
items[itOrbPsi] || items[itOrbDragon] || items[itOrbTeleport] ||
|
||||||
@ -574,56 +261,10 @@ bool haveRangedOrb() {
|
|||||||
items[itOrbMorph] || items[itOrbPhasing];
|
items[itOrbMorph] || items[itOrbPhasing];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isOffensiveOrb(eItem it) {
|
|
||||||
return it == itOrbLightning || it == itOrbFlash || it == itOrbThorns ||
|
|
||||||
it == itOrbDragon || it == itOrbStunning ||
|
|
||||||
it == itOrbFreedom || it == itOrbPsi ||
|
|
||||||
it == itOrbSide1 || it == itOrbSide2 || it == itOrbSide3 ||
|
|
||||||
it == itOrbSlaying;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isRangedOrb(eItem i) {
|
|
||||||
return i == itOrbPsi || i == itOrbDragon || i == itOrbTeleport || i == itOrbIllusion ||
|
|
||||||
i == itOrbSpace || i == itOrbAir || i == itOrbFrog ||
|
|
||||||
i == itOrbSummon || i == itOrbMatter || i == itRevolver || i == itOrbStunning ||
|
|
||||||
i == itOrbDomination || i == itOrbNature || i == itOrbDash || i == itOrbMorph;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 ||
|
|
||||||
i == itOrbAether || i == itOrbInvis || i == itOrbThorns ||
|
|
||||||
i == itOrbWater || i == itOrbStone ||
|
|
||||||
i == itOrbSide1 || i == itOrbSide2 || i == itOrbSide3 ||
|
|
||||||
i == itOrbSlaying || i == itOrbFish;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isUtilityOrb(eItem i) {
|
|
||||||
return i == itOrbSpeed || i == itOrbDigging ||
|
|
||||||
i == itOrbSafety || i == itOrbTeleport || i == itOrbAether ||
|
|
||||||
i == itOrbTime || i == itOrbSpace ||
|
|
||||||
i == itOrbSummon || i == itOrbLuck || i == itOrbEnergy ||
|
|
||||||
i == itOrbLava;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isDirectionalOrb(eItem i) {
|
|
||||||
return i == itOrbHorns || i == itOrbBull || i == itOrbSword || i == itOrbSword2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isRevivalOrb(eItem i) {
|
bool isRevivalOrb(eItem i) {
|
||||||
return i == itOrbLife || i == itOrbFriend || i == itOrbUndeath;
|
return i == itOrbLife || i == itOrbFriend || i == itOrbUndeath;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isFriendOrb(eItem i) {
|
|
||||||
return i == itOrbLife || i == itOrbFriend || i == itOrbDiscord || i == itOrbLove ||
|
|
||||||
i == itOrbEmpathy || i == itOrbUndeath;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isFriendlyGhost(eMonster m) {
|
bool isFriendlyGhost(eMonster m) {
|
||||||
return m == moFriendlyGhost || (markEmpathy(itOrbAether) && isFriendly(m));
|
return m == moFriendlyGhost || (markEmpathy(itOrbAether) && isFriendly(m));
|
||||||
}
|
}
|
||||||
@ -691,20 +332,6 @@ bool ignoresSmell(eMonster m) {
|
|||||||
m == moRoseLady || checkOrb(m, itOrbBeauty) || checkOrb(m, itOrbAether) || checkOrb(m, itOrbShield);
|
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 isStandardTree(cell *c) {
|
|
||||||
return c->wall == waBigTree || c->wall == waSmallTree;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool highwall(cell *c) {
|
bool highwall(cell *c) {
|
||||||
if(c->wall == waGlass) return false;
|
if(c->wall == waGlass) return false;
|
||||||
if(wmescher && wmspatial && c->wall == waBarrier && c->land == laOceanWall)
|
if(wmescher && wmspatial && c->wall == waBarrier && c->land == laOceanWall)
|
||||||
@ -726,15 +353,8 @@ int chasmgraph(cell *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool conegraph(cell *c) {
|
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));
|
return wmescher && wmspatial && conegraphtype(c);
|
||||||
}
|
(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) {
|
bool hornStuns(cell *c) {
|
||||||
@ -747,26 +367,5 @@ bool hornStuns(cell *c) {
|
|||||||
attackJustStuns(c, AF_NORMAL, moNone);
|
attackJustStuns(c, AF_NORMAL, moNone);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isRaider(eMonster m) {
|
|
||||||
return m == moPair || m == moMonk || m == moCrusher || m == moAltDemon || m == moHexDemon;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isTechnicalLand(eLand l) {
|
|
||||||
return l == laNone || l == laOceanWall || l == laBarrier || l == laCanvas ||
|
|
||||||
l == laHauntedWall || l == laHauntedBorder || l == laCA ||
|
|
||||||
l == laMirrorWall || l == laMirrored || l == laMirrored2 ||
|
|
||||||
l == laMirrorWall2 || l == laMercuryRiver || l == laMemory;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_mirrorland(cell *c) {
|
|
||||||
return among(c->land, laMirror, laMirrorOld);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
47
game.cpp
47
game.cpp
@ -456,10 +456,6 @@ eGravity get_move_gravity(cell *c, cell *c2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isWarped(cell *c) {
|
|
||||||
return isWarped(c->land) || (!inmirrororwall(c->land) && (items[itOrb37] && c->cpdist <= 4));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool nonAdjacent(cell *c, cell *c2) {
|
bool nonAdjacent(cell *c, cell *c2) {
|
||||||
if(isWarped(c) && isWarped(c2) && warptype(c) == warptype(c2)) {
|
if(isWarped(c) && isWarped(c2) && warptype(c) == warptype(c2)) {
|
||||||
/* int i = neighborId(c, c2);
|
/* int i = neighborId(c, c2);
|
||||||
@ -892,7 +888,7 @@ bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) {
|
|||||||
if(m == moPair)
|
if(m == moPair)
|
||||||
return !(w && from && againstPair(from, w, m)) && passable(w, from, extra);
|
return !(w && from && againstPair(from, w, m)) && passable(w, from, extra);
|
||||||
if(m == passive_switch) return false;
|
if(m == passive_switch) return false;
|
||||||
if(normalMover(m) || isBug(m) || isDemon(m) || m == moHerdBull || m == moMimic) {
|
if(minf[m].mgroup == moYeti || isBug(m) || isDemon(m) || m == moHerdBull || m == moMimic) {
|
||||||
if((isWitch(m) || m == moEvilGolem) && w->land != laPower && w->land != laHalloween)
|
if((isWitch(m) || m == moEvilGolem) && w->land != laPower && w->land != laHalloween)
|
||||||
return false;
|
return false;
|
||||||
return passable(w, from, extra);
|
return passable(w, from, extra);
|
||||||
@ -972,37 +968,7 @@ bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
eMonster movegroup(eMonster m) {
|
eMonster movegroup(eMonster m) { return minf[m].mgroup; }
|
||||||
if(isWitch(m) || m == moEvilGolem) {
|
|
||||||
if(m == moWitchGhost) return moWitchGhost;
|
|
||||||
if(m == moWitchWinter) return moWitchWinter;
|
|
||||||
return moWitch;
|
|
||||||
}
|
|
||||||
// if(isMagneticPole(m)) return m;
|
|
||||||
if(normalMover(m)) return moYeti;
|
|
||||||
if(m == moShark || m == moCShark) return moShark;
|
|
||||||
if(isSlimeMover(m)) return moSlime;
|
|
||||||
if(m == moEarthElemental) return moEarthElemental;
|
|
||||||
if(isLeader(m)) return moPirate;
|
|
||||||
if(m == moButterfly) return moButterfly;
|
|
||||||
if(isAngryBird(m)) return moEagle;
|
|
||||||
if(isBird(m)) return moTameBomberbird;
|
|
||||||
if(m == moReptile) return moReptile;
|
|
||||||
if(m == moGhost) return moGhost;
|
|
||||||
if(m == moFriendlyGhost) return moFriendlyGhost;
|
|
||||||
if(m == moGreaterShark) return moGreaterShark;
|
|
||||||
if(m == moWolf) return moWolf;
|
|
||||||
if(isDemon(m)) return moLesser;
|
|
||||||
if(isDragon(m)) return moDragonHead;
|
|
||||||
if(isBug(m)) return m;
|
|
||||||
if(m == moWaterElemental) return moWaterElemental;
|
|
||||||
if(m == moAirElemental) return moAirElemental;
|
|
||||||
if(isBull(m)) return moRagingBull;
|
|
||||||
if(m == moVoidBeast) return moVoidBeast;
|
|
||||||
if(m == moAltDemon || m == moHexDemon || m == moMonk)
|
|
||||||
return m;
|
|
||||||
return moNone;
|
|
||||||
}
|
|
||||||
|
|
||||||
void useup(cell *c) {
|
void useup(cell *c) {
|
||||||
c->wparam--;
|
c->wparam--;
|
||||||
@ -2078,10 +2044,6 @@ void minerEffect(cell *c) {
|
|||||||
if(c->wall != ow && ow) drawParticles(c, winf[ow].color, 16);
|
if(c->wall != ow && ow) drawParticles(c, winf[ow].color, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isRatling(eMonster m) {
|
|
||||||
return m == moRatling || m == moRatlingAvenger;
|
|
||||||
}
|
|
||||||
|
|
||||||
void killMutantIvy(cell *c, eMonster who) {
|
void killMutantIvy(cell *c, eMonster who) {
|
||||||
if(checkOrb(who, itOrbStone)) petrify(c, waPetrified, moMutant);
|
if(checkOrb(who, itOrbStone)) petrify(c, waPetrified, moMutant);
|
||||||
removeIvy(c);
|
removeIvy(c);
|
||||||
@ -4248,6 +4210,7 @@ bool quantum;
|
|||||||
|
|
||||||
cell *moveNormal(cell *c, flagtype mf) {
|
cell *moveNormal(cell *c, flagtype mf) {
|
||||||
eMonster m = c->monst;
|
eMonster m = c->monst;
|
||||||
|
if(isPowerMonster(m) && !playerInPower()) return NULL;
|
||||||
|
|
||||||
int d;
|
int d;
|
||||||
|
|
||||||
@ -6034,7 +5997,7 @@ void moverefresh(bool turn = true) {
|
|||||||
void consMove(cell *c, eMonster param) {
|
void consMove(cell *c, eMonster param) {
|
||||||
eMonster m = c->monst;
|
eMonster m = c->monst;
|
||||||
|
|
||||||
if(!normalMover(m)) return;
|
if(movegroup(m) != moYeti) return;
|
||||||
|
|
||||||
if(m == moWitchSpeed) havewhat |= HF_FAST;
|
if(m == moWitchSpeed) havewhat |= HF_FAST;
|
||||||
bool slow = slowMover(m);
|
bool slow = slowMover(m);
|
||||||
@ -6073,7 +6036,7 @@ void moveNormals(eMonster param) {
|
|||||||
|
|
||||||
for(int d=0; d<=MAX_EDGE; d++) for(int i=0; i<isize(movesofgood[d]); i++) {
|
for(int d=0; d<=MAX_EDGE; d++) for(int i=0; i<isize(movesofgood[d]); i++) {
|
||||||
cell *c = movesofgood[d][i];
|
cell *c = movesofgood[d][i];
|
||||||
if(normalMover(c->monst)) {
|
if(minf[c->monst].mgroup == moYeti) {
|
||||||
moveNormal(c, MF_PATHDIST);
|
moveNormal(c, MF_PATHDIST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
32
graph.cpp
32
graph.cpp
@ -665,6 +665,24 @@ color_t kind_outline(eItem it) {
|
|||||||
return OUTLINE_OTHER;
|
return OUTLINE_OTHER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transmatrix face_the_player(transmatrix V) {
|
||||||
|
if(DIM == 2) return V;
|
||||||
|
return rgpushxto0(tC0(V));
|
||||||
|
}
|
||||||
|
|
||||||
|
hpcshape& orbshape(eOrbshape s) {
|
||||||
|
switch(s) {
|
||||||
|
case osLove: return shLoveRing;
|
||||||
|
case osRanged: return shTargetRing;
|
||||||
|
case osOffensive: return shSawRing;
|
||||||
|
case osFriend: return shPeaceRing;
|
||||||
|
case osUtility: return shGearRing;
|
||||||
|
case osDirectional: return shSpearRing;
|
||||||
|
case osWarping: return shHeptaRing;
|
||||||
|
default: return shRing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int pticks, bool hidden) {
|
bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int pticks, bool hidden) {
|
||||||
#if !CAP_SHAPES
|
#if !CAP_SHAPES
|
||||||
return it;
|
return it;
|
||||||
@ -847,16 +865,8 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int pti
|
|||||||
queuepolyat(Vit * spinptick(1500), shFishTail, col, PPR::ITEM_BELOW);
|
queuepolyat(Vit * spinptick(1500), shFishTail, col, PPR::ITEM_BELOW);
|
||||||
|
|
||||||
queuepolyat(Vit, shDisk, darkena(icol1, 0, inice ? 0x80 : hidden ? 0x20 : 0xC0), prio);
|
queuepolyat(Vit, shDisk, darkena(icol1, 0, inice ? 0x80 : hidden ? 0x20 : 0xC0), prio);
|
||||||
hpcshape& sh =
|
|
||||||
it == itOrbLove ? shLoveRing :
|
queuepolyat(Vit * spinptick(1500), orbshape(iinf[it].orbshape), col, prio);
|
||||||
isRangedOrb(it) ? shTargetRing :
|
|
||||||
isOffensiveOrb(it) ? shSawRing :
|
|
||||||
isFriendOrb(it) ? shPeaceRing :
|
|
||||||
isUtilityOrb(it) ? shGearRing :
|
|
||||||
isDirectionalOrb(it) ? shSpearRing :
|
|
||||||
among(it, itOrb37, itOrbGravity) ? shHeptaRing :
|
|
||||||
shRing;
|
|
||||||
queuepolyat(Vit * spinptick(1500), sh, col, prio);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(it) return true;
|
else if(it) return true;
|
||||||
@ -3213,7 +3223,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case laIce: case laCocytus: case laBlizzard:
|
case laIce: case laCocytus: case laBlizzard:
|
||||||
if(isIcyWall(c)) {
|
if(useHeatColoring(c)) {
|
||||||
float h = HEAT(c);
|
float h = HEAT(c);
|
||||||
eLand l = c->land;
|
eLand l = c->land;
|
||||||
|
|
||||||
|
@ -2376,6 +2376,8 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
|||||||
#endif
|
#endif
|
||||||
c->monst = moGhost;
|
c->monst = moGhost;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case landtypes: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
149
landlock.cpp
149
landlock.cpp
@ -236,114 +236,13 @@ int isNative(eLand l, eMonster m) {
|
|||||||
|
|
||||||
case laMagnetic:
|
case laMagnetic:
|
||||||
return isMagneticPole(m) ? 2 : 0;
|
return isMagneticPole(m) ? 2 : 0;
|
||||||
|
|
||||||
|
case landtypes: return 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
eItem treasureType(eLand l) {
|
eItem treasureType(eLand l) { return linf[l].treasure; }
|
||||||
switch(l) {
|
|
||||||
case laBrownian:
|
|
||||||
return itBrownian;
|
|
||||||
|
|
||||||
case laIce: return itDiamond;
|
|
||||||
case laJungle: return itRuby;
|
|
||||||
case laCaves: return itGold;
|
|
||||||
case laDesert: return itSpice;
|
|
||||||
|
|
||||||
case laAlchemist: return itElixir;
|
|
||||||
|
|
||||||
case laMirror: case laMirrored: case laMirrorWall: case laMirrorWall2: case laMirrored2:
|
|
||||||
case laMirrorOld:
|
|
||||||
return itShard;
|
|
||||||
|
|
||||||
case laMotion: return itFeather;
|
|
||||||
|
|
||||||
case laGraveyard: return itBone;
|
|
||||||
case laRlyeh: return itStatue;
|
|
||||||
case laDryForest: return itFernFlower;
|
|
||||||
|
|
||||||
case laHell: return itHell;
|
|
||||||
case laCocytus: return itSapphire;
|
|
||||||
case laCrossroads: return itHyperstone;
|
|
||||||
case laCrossroads2: return itHyperstone;
|
|
||||||
case laCrossroads3: return itHyperstone;
|
|
||||||
case laCrossroads4: return itHyperstone;
|
|
||||||
case laCrossroads5: return itHyperstone;
|
|
||||||
|
|
||||||
case laNone: return itNone;
|
|
||||||
case laBarrier: return itNone;
|
|
||||||
case laOceanWall: return itNone;
|
|
||||||
case laCanvas: return itNone;
|
|
||||||
case laMemory: return itNone;
|
|
||||||
|
|
||||||
case laEmerald: return itEmerald;
|
|
||||||
case laWineyard: return itWine;
|
|
||||||
case laHive: return itRoyalJelly;
|
|
||||||
case laDeadCaves: return itSilver;
|
|
||||||
case laPower: return itPower;
|
|
||||||
case laCamelot: return itHolyGrail;
|
|
||||||
case laTemple: return itGrimoire;
|
|
||||||
|
|
||||||
case laCaribbean: return itPirate;
|
|
||||||
case laRedRock: return itRedGem;
|
|
||||||
|
|
||||||
case laMinefield: return itBombEgg;
|
|
||||||
case laOcean: return itCoast;
|
|
||||||
case laWhirlpool: return itWhirlpool;
|
|
||||||
case laPalace: return itPalace;
|
|
||||||
case laLivefjord: return itFjord;
|
|
||||||
|
|
||||||
case laIvoryTower: return itIvory;
|
|
||||||
case laZebra: return itZebra;
|
|
||||||
|
|
||||||
case laEAir: case laEEarth: case laEWater: case laEFire:
|
|
||||||
case laElementalWall: return itElemental;
|
|
||||||
|
|
||||||
case laPrincessQuest: return itSavedPrincess;
|
|
||||||
|
|
||||||
case laStorms: return itFulgurite;
|
|
||||||
case laOvergrown: return itMutant;
|
|
||||||
case laWildWest: return itBounty;
|
|
||||||
case laHalloween: return itTreat;
|
|
||||||
case laClearing: return itMutant2;
|
|
||||||
case laHaunted: case laHauntedWall: case laHauntedBorder: return itLotus;
|
|
||||||
case laWhirlwind: return itWindstone;
|
|
||||||
|
|
||||||
case laRose: return itRose;
|
|
||||||
case laWarpCoast: case laWarpSea: return itCoral;
|
|
||||||
|
|
||||||
case laDragon: return itDragon;
|
|
||||||
case laEndorian: return itApple;
|
|
||||||
case laTortoise: return itBabyTortoise;
|
|
||||||
|
|
||||||
case laTrollheim: return itTrollEgg;
|
|
||||||
case laKraken: return itKraken;
|
|
||||||
case laBurial: return itBarrow;
|
|
||||||
|
|
||||||
case laDungeon: return itSlime;
|
|
||||||
case laMountain: return itAmethyst;
|
|
||||||
case laReptile: return itDodeca;
|
|
||||||
|
|
||||||
case laBull: return itBull;
|
|
||||||
case laPrairie: return itGreenGrass;
|
|
||||||
|
|
||||||
case laVolcano: return itLavaLily;
|
|
||||||
case laTerracotta: case laMercuryRiver: return itTerra;
|
|
||||||
case laBlizzard: return itBlizzard;
|
|
||||||
case laHunting: return itHunting;
|
|
||||||
case laDual: return itGlowCrystal;
|
|
||||||
case laSnakeNest: return itSnake;
|
|
||||||
case laDocks: return itDock;
|
|
||||||
case laRuins: return itRuins;
|
|
||||||
case laSwitch: return itSwitch;
|
|
||||||
case laMagnetic: return itMagnet;
|
|
||||||
case laVariant: return itVarTreasure;
|
|
||||||
case laWestWall: return itWest;
|
|
||||||
|
|
||||||
case laCA: return itNone;
|
|
||||||
}
|
|
||||||
return itNone;
|
|
||||||
}
|
|
||||||
|
|
||||||
eItem treasureTypeUnlock(eLand l, eItem u) {
|
eItem treasureTypeUnlock(eLand l, eItem u) {
|
||||||
if(u != itOrbLove && l == laPrincessQuest)
|
if(u != itOrbLove && l == laPrincessQuest)
|
||||||
@ -356,38 +255,11 @@ eLand landof(eItem it) {
|
|||||||
return laNone;
|
return laNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSealand(eLand l) {
|
|
||||||
return l == laOcean || l == laCaribbean || l == laWhirlpool || l == laLivefjord ||
|
|
||||||
l == laOceanWall || l == laWarpSea || l == laKraken || l == laDocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isCoastal(eLand l) {
|
|
||||||
return l == laWarpSea || l == laWarpCoast || l == laLivefjord || l == laOcean;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isPureSealand(eLand l) {
|
|
||||||
return l == laCaribbean || l == laKraken || l == laBrownian;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isElemental(eLand l) {
|
|
||||||
return l == laEAir || l == laEWater || l == laEEarth || l == laEFire ||
|
|
||||||
l == laElementalWall;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isHaunted(eLand l) {
|
|
||||||
return l == laHaunted || l == laHauntedBorder || l == laHauntedWall;
|
|
||||||
}
|
|
||||||
|
|
||||||
int landMultiplier(eLand l) {
|
int landMultiplier(eLand l) {
|
||||||
if(l == laCamelot || l == laPrincessQuest) return 10;
|
if(l == laCamelot || l == laPrincessQuest) return 10;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isTrollLand(eLand l) {
|
|
||||||
return l == laCaves || l == laStorms || l == laOvergrown ||
|
|
||||||
l == laDeadCaves || l == laLivefjord || l == laRedRock;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isCrossroads(eLand l) {
|
bool isCrossroads(eLand l) {
|
||||||
return l == laCrossroads || l == laCrossroads2 || l == laCrossroads3 ||
|
return l == laCrossroads || l == laCrossroads2 || l == laCrossroads3 ||
|
||||||
l == laCrossroads4 || l == laCrossroads5;
|
l == laCrossroads4 || l == laCrossroads5;
|
||||||
@ -397,18 +269,6 @@ bool bearsCamelot(eLand l) {
|
|||||||
return isCrossroads(l) && l != laCrossroads2 && l != laCrossroads5;
|
return isCrossroads(l) && l != laCrossroads2 && l != laCrossroads5;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool inmirror(eLand l) {
|
|
||||||
return l == laMirrored || l == laMirrorWall2 || l == laMirrored2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool inmirrororwall(eLand l) {
|
|
||||||
return l == laMirrored || l == laMirrorWall2 || l == laMirrored2 || l == laMirrorWall;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool inmirror(cell *c) {
|
|
||||||
return inmirror(c->land);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool inmirror(const cellwalker& cw) {
|
bool inmirror(const cellwalker& cw) {
|
||||||
return inmirror(cw.at->land);
|
return inmirror(cw.at->land);
|
||||||
}
|
}
|
||||||
@ -601,6 +461,9 @@ bool landUnlocked(eLand l) {
|
|||||||
|
|
||||||
case laMagnetic:
|
case laMagnetic:
|
||||||
return false; // not implemented
|
return false; // not implemented
|
||||||
|
|
||||||
|
case landtypes:
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user