mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-10-21 17:07:40 +00:00
Updated the source files to 9.4c
This commit is contained in:
604
hyper.h
604
hyper.h
@@ -7,6 +7,9 @@
|
||||
|
||||
#define GL
|
||||
|
||||
#define PSEUDOKEY_WHEELDOWN 2501
|
||||
#define PSEUDOKEY_WHEELUP 2502
|
||||
|
||||
#ifdef NOGFX
|
||||
#undef GFX
|
||||
#endif
|
||||
@@ -18,9 +21,10 @@
|
||||
// scale the Euclidean
|
||||
#define EUCSCALE 2.3
|
||||
|
||||
// disable this if you have no access to SDL_mixer
|
||||
#ifndef MOBILE
|
||||
#define AUDIO
|
||||
#ifndef NOAUDIO
|
||||
#define SDLAUDIO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define NUMWITCH 7
|
||||
@@ -29,7 +33,7 @@
|
||||
|
||||
#define LB_YENDOR_CHALLENGE 40
|
||||
#define LB_PURE_TACTICS 41
|
||||
#define NUMLEADER 57
|
||||
#define NUMLEADER 69
|
||||
#define LB_PURE_TACTICS_SHMUP 49
|
||||
#define LB_PURE_TACTICS_COOP 50
|
||||
|
||||
@@ -75,6 +79,7 @@ void achievement_pump();
|
||||
vector<string> achievementsReceived;
|
||||
|
||||
// game forward declarations
|
||||
typedef int flagtype;
|
||||
|
||||
bool mirrorkill(cell *c);
|
||||
bool isNeighbor(cell *c1, cell *c2);
|
||||
@@ -82,7 +87,7 @@ void checkTide(cell *c);
|
||||
namespace anticheat { extern bool tampered; }
|
||||
int numplayers();
|
||||
void removeIvy(cell *c);
|
||||
bool cellEdgeUnstable(cell *c);
|
||||
bool cellEdgeUnstable(cell *c, flagtype flags = 0);
|
||||
int coastvalEdge(cell *c);
|
||||
typedef int cellfunction(cell*);
|
||||
int towerval(cell *c, cellfunction* cf = &coastvalEdge);
|
||||
@@ -94,13 +99,13 @@ eItem treasureType(eLand l);
|
||||
void buildBarrier(cell *c, int d, eLand l = laNone);
|
||||
void extendBarrier(cell *c);
|
||||
bool buildBarrier4(cell *c, int d, int mode, eLand ll, eLand lr);
|
||||
void makeEmpty(cell *c);
|
||||
bool makeEmpty(cell *c);
|
||||
bool isCrossroads(eLand l);
|
||||
enum orbAction { roMouse, roKeyboard, roCheck, roMouseForce };
|
||||
enum orbAction { roMouse, roKeyboard, roCheck, roMouseForce, roMultiCheck, roMultiGo };
|
||||
void moveItem (cell *from, cell *to, bool activateYendor);
|
||||
void uncoverMines(cell *c, int lev);
|
||||
void uncoverMines(cell *c, int lev, int dist);
|
||||
bool survivesMine(eMonster m);
|
||||
void killMonster(cell *c);
|
||||
void killMonster(cell *c, eMonster who_killed, flagtype flags = 0);
|
||||
void toggleGates(cell *ct, eWall type, int rad);
|
||||
bool destroyHalfvine(cell *c, eWall newwall = waNone, int tval = 6);
|
||||
void buildCrossroads2(cell *c);
|
||||
@@ -109,12 +114,12 @@ heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special=0)
|
||||
void generateAlts(heptagon *h);
|
||||
void setdist(cell *c, int d, cell *from);
|
||||
void checkOnYendorPath();
|
||||
void killThePlayerAt(eMonster m, cell *c, int flags);
|
||||
void killThePlayerAt(eMonster m, cell *c, flagtype flags);
|
||||
bool notDippingFor(eItem i);
|
||||
bool collectItem(cell *c2, bool telekinesis = false);
|
||||
void castLightningBolt(struct cellwalker lig);
|
||||
bool movepcto(int d, int subdir = 1, bool checkonly = false);
|
||||
void stabbingAttack(cell *mf, cell *mt, eMonster who);
|
||||
void stabbingAttack(cell *mf, cell *mt, eMonster who, int bonuskill = 0);
|
||||
bool earthMove(cell *from, int dir);
|
||||
void messageKill(eMonster killer, eMonster victim);
|
||||
void moveMonster(cell *ct, cell *cf);
|
||||
@@ -122,6 +127,7 @@ int palaceHP();
|
||||
void placeLocalOrbs(cell *c);
|
||||
int elementalKills();
|
||||
bool elementalUnlocked();
|
||||
bool trollUnlocked();
|
||||
bool isMultitile(eMonster m);
|
||||
void checkFreedom(cell *cf);
|
||||
int rosedist(cell *c);
|
||||
@@ -137,7 +143,16 @@ namespace mirror {
|
||||
|
||||
int neighborId(cell *c1, cell *c2);
|
||||
|
||||
struct movedir { int d; int subdir; };
|
||||
struct movedir {
|
||||
int d; // 0 to 6, or one of the following -- warning: not used consistently
|
||||
#define MD_WAIT (-1)
|
||||
#define MD_DROP (-2)
|
||||
#define MD_UNDECIDED (-3)
|
||||
#define MD_USE_ORB (-4)
|
||||
int subdir; // for normal movement (0-6): turn left or right
|
||||
cell *tgt; // for MD_USE_ORB: target cell
|
||||
};
|
||||
|
||||
inline bool movepcto(const movedir& md) { return movepcto(md.d, md.subdir); }
|
||||
|
||||
void activateActiv(cell *c, bool msg);
|
||||
@@ -145,19 +160,65 @@ void activateActiv(cell *c, bool msg);
|
||||
// shmup
|
||||
|
||||
struct charstyle {
|
||||
int charid, skincolor, haircolor, dresscolor, swordcolor, dresscolor2;
|
||||
int charid, skincolor, haircolor, dresscolor, swordcolor, dresscolor2, uicolor;
|
||||
};
|
||||
|
||||
string csname(charstyle& cs);
|
||||
void initcs(charstyle& cs);
|
||||
void savecs(FILE *f, charstyle& cs);
|
||||
void loadcs(FILE *f, charstyle& cs);
|
||||
void savecs(FILE *f, charstyle& cs, int vernum);
|
||||
void loadcs(FILE *f, charstyle& cs, int vernum);
|
||||
|
||||
#define MAXPLAYER 7
|
||||
#define MAXJOY 8
|
||||
|
||||
#define MAXBUTTON 64
|
||||
#define MAXAXE 16
|
||||
#define MAXHAT 4
|
||||
|
||||
namespace multi {
|
||||
|
||||
void recall();
|
||||
extern cell *origpos[MAXPLAYER], *origtarget[MAXPLAYER];
|
||||
extern int players;
|
||||
extern cellwalker player[MAXPLAYER];
|
||||
extern bool flipped[MAXPLAYER];
|
||||
cell *mplayerpos(int i);
|
||||
|
||||
extern vector<int> revive_queue; // queue for revival
|
||||
|
||||
extern movedir whereto[MAXPLAYER]; // player's target cell
|
||||
|
||||
extern int cpid; // player id -- an extra parameter for player-related functions
|
||||
extern int cpid_edit; // cpid currently being edited
|
||||
|
||||
// treasure collection, kill, and death statistics
|
||||
extern int treasures[MAXPLAYER], kills[MAXPLAYER], deaths[MAXPLAYER];
|
||||
|
||||
struct config {
|
||||
int players;
|
||||
int subconfig;
|
||||
int setwhat;
|
||||
char keyaction[512];
|
||||
char joyaction[MAXJOY][MAXBUTTON];
|
||||
char axeaction[MAXJOY][MAXAXE];
|
||||
char hataction[MAXJOY][MAXHAT][4];
|
||||
int deadzoneval[MAXJOY][MAXAXE];
|
||||
};
|
||||
|
||||
charstyle scs[MAXPLAYER];
|
||||
|
||||
bool playerActive(int p);
|
||||
int activePlayers();
|
||||
cell *multiPlayerTarget(int i);
|
||||
void checklastmove();
|
||||
void leaveGame(int i);
|
||||
}
|
||||
|
||||
namespace shmup {
|
||||
void recall();
|
||||
extern bool on;
|
||||
extern bool safety;
|
||||
extern int curtime;
|
||||
extern int players, cpid;
|
||||
void clearMemory();
|
||||
void init();
|
||||
void teleported();
|
||||
@@ -175,22 +236,8 @@ namespace shmup {
|
||||
cell *playerpos(int i);
|
||||
|
||||
bool playerInBoat(int i);
|
||||
|
||||
#define MAXBUTTON 64
|
||||
#define MAXAXE 16
|
||||
#define MAXHAT 4
|
||||
|
||||
struct config {
|
||||
int players;
|
||||
int subconfig;
|
||||
int setwhat;
|
||||
char keyaction[512];
|
||||
char joyaction[8][MAXBUTTON];
|
||||
char axeaction[8][MAXAXE];
|
||||
char hataction[8][MAXHAT][4];
|
||||
};
|
||||
|
||||
charstyle scs[4];
|
||||
void destroyBoats(cell *c);
|
||||
bool boatAt(cell *c);
|
||||
}
|
||||
|
||||
// graph
|
||||
@@ -206,6 +253,10 @@ void cleargraphmemory();
|
||||
|
||||
void drawFlash(cell* c);
|
||||
void drawBigFlash(cell* c);
|
||||
void drawParticle(cell *c, int col, int maxspeed = 100);
|
||||
void drawParticles(cell *c, int col, int qty, int maxspeed = 100);
|
||||
void drawFireParticles(cell *c, int qty, int maxspeed = 100);
|
||||
int firecolor(int phase);
|
||||
|
||||
void drawLightning();
|
||||
void drawSafety();
|
||||
@@ -214,8 +265,6 @@ void movepckeydir(int);
|
||||
|
||||
void centerpc(ld aspd);
|
||||
|
||||
void displayStatHelp(int y, string name);
|
||||
void displayStat(int y, const string& name, const string& val, char mkey);
|
||||
void displayButton(int x, int y, const string& name, int key, int align, int rad = 0);
|
||||
void displayColorButton(int x, int y, const string& name, int key, int align, int rad, int color, int color2 = 0);
|
||||
inline string ONOFF(bool b) { return XLAT(b ? "ON" : "OFF"); }
|
||||
@@ -223,17 +272,15 @@ int darkened(int c);
|
||||
extern int getcstat;
|
||||
bool displaychr(int x, int y, int shift, int size, char chr, int col);
|
||||
bool displayfr(int x, int y, int b, int size, const string &s, int color, int align);
|
||||
void saveHighQualityShot();
|
||||
void saveHighQualityShot(const char *fname = NULL);
|
||||
|
||||
bool outofmap(hyperpoint h);
|
||||
void getcoord(const hyperpoint& H, int& x, int& y, int &shift);
|
||||
void drawline(const hyperpoint& H1, int x1, int y1, int s1, const hyperpoint& H2, int x2, int y2, int col);
|
||||
void drawline(const hyperpoint& H1, const hyperpoint& H2, int col);
|
||||
void applymodel(hyperpoint H, hyperpoint& Hscr);
|
||||
void drawCircle(int x, int y, int size, int color);
|
||||
void fixcolor(int& col);
|
||||
int displaydir(cell *c, int d);
|
||||
hyperpoint gethyper(ld x, ld y);
|
||||
void resetview(); extern cell *lcenterover; extern heptspin viewctr;
|
||||
void resetview(); extern heptspin viewctr; extern cell *centerover;
|
||||
#ifndef MOBILE
|
||||
int& qpixel(SDL_Surface *surf, int x, int y);
|
||||
#endif
|
||||
@@ -245,31 +292,30 @@ extern int darken;
|
||||
void setvideomode();
|
||||
void calcparam();
|
||||
|
||||
string ifMousing(string key, string s);
|
||||
|
||||
#ifndef NOCONFIG
|
||||
void saveConfig();
|
||||
#endif
|
||||
|
||||
extern hyperpoint mouseh;
|
||||
|
||||
extern int webdisplay;
|
||||
|
||||
extern bool GL_initialized;
|
||||
extern hyperpoint ccenter;
|
||||
extern ld crad;
|
||||
|
||||
extern bool mousepressed, anyshiftclick;
|
||||
extern string help;
|
||||
|
||||
extern int lalpha;
|
||||
|
||||
struct videopar {
|
||||
ld scale, eye, alpha, aspeed;
|
||||
ld scale, eye, alpha, sspeed, mspeed, yshift, camera_angle;
|
||||
ld ballangle, ballproj;
|
||||
int mobilecompasssize;
|
||||
|
||||
bool full;
|
||||
bool goteyes; // for rendering
|
||||
bool goteyes2; // for choosing colors
|
||||
bool quick;
|
||||
bool darkhepta;
|
||||
bool shifttarget;
|
||||
int shifttarget;
|
||||
|
||||
int xres, yres, framelimit;
|
||||
|
||||
@@ -280,6 +326,9 @@ struct videopar {
|
||||
int radius;
|
||||
ld alphax, beta;
|
||||
|
||||
bool grid;
|
||||
int particles;
|
||||
|
||||
int fsize;
|
||||
int flashtime;
|
||||
|
||||
@@ -292,7 +341,7 @@ struct videopar {
|
||||
bool usingAA;
|
||||
|
||||
int joyvalue, joyvalue2, joypanthreshold;
|
||||
float joypanspeed;
|
||||
ld joypanspeed;
|
||||
|
||||
charstyle cs;
|
||||
|
||||
@@ -301,9 +350,10 @@ struct videopar {
|
||||
|
||||
int killreduction, itemreduction, portreduction;
|
||||
|
||||
shmup::config scfg;
|
||||
multi::config scfg;
|
||||
|
||||
bool steamscore;
|
||||
int steamscore;
|
||||
bool drawmousecircle; // draw the circle around the mouse
|
||||
};
|
||||
|
||||
extern videopar vid;
|
||||
@@ -322,7 +372,10 @@ enum emtype {emNormal, emHelp,
|
||||
emYendor, emTactic, emRugConfig,
|
||||
emConformal,
|
||||
emProgress,
|
||||
emCheatMenu
|
||||
emCheatMenu, emLeader,
|
||||
emJoyConfig,
|
||||
emColor, emNumber,
|
||||
em3D, emRogueviz
|
||||
};
|
||||
|
||||
extern emtype cmode, lastmode;
|
||||
@@ -338,14 +391,18 @@ extern struct SDL_Surface *s;
|
||||
namespace mapeditor {
|
||||
extern bool drawplayer;
|
||||
extern char whichPattern, whichShape;
|
||||
extern char whichCanvas;
|
||||
extern int displaycodes;
|
||||
int generateCanvas(cell *c);
|
||||
void clearModelCells();
|
||||
void applyModelcell(cell *c);
|
||||
int realpattern(cell *c);
|
||||
int patterndir(cell *c, char w = whichPattern);
|
||||
int subpattern(cell *c);
|
||||
extern cell *drawcell;
|
||||
}
|
||||
|
||||
#ifndef NORUG
|
||||
namespace rug {
|
||||
extern bool rugged;
|
||||
void init();
|
||||
@@ -353,6 +410,7 @@ namespace rug {
|
||||
void actDraw();
|
||||
void buildVertexInfo(cell *c, transmatrix V);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define HASLINEVIEW
|
||||
namespace conformal {
|
||||
@@ -372,9 +430,8 @@ namespace conformal {
|
||||
|
||||
namespace polygonal {
|
||||
extern int SI;
|
||||
extern double STAR;
|
||||
extern ld STAR;
|
||||
void solve();
|
||||
typedef long double ld;
|
||||
pair<ld, ld> compute(ld x, ld y);
|
||||
}
|
||||
|
||||
@@ -422,8 +479,9 @@ extern bool localKill(shmup::monster *m);
|
||||
#define P_ROSE (1<<28) // rose smell
|
||||
#define P_CLIMBUP (1<<29) // allow climbing up
|
||||
#define P_CLIMBDOWN (1<<30) // allow climbing down
|
||||
#define P_REPTILE (1<<31) // is reptile
|
||||
|
||||
bool passable(cell *w, cell *from, int flags);
|
||||
bool passable(cell *w, cell *from, flagtype flags);
|
||||
|
||||
bool isElemental(eLand l);
|
||||
int coastval(cell *c, eLand base);
|
||||
@@ -450,13 +508,15 @@ extern bool safety;
|
||||
|
||||
#define SAGEMELT .1
|
||||
#define TEMPLE_EACH 6
|
||||
#define PT(x, y) (tactic::on ? (y) : (x))
|
||||
#define PT(x, y) ((tactic::on || quotient == 2) ? (y) : (x))
|
||||
#define ROCKSNAKELENGTH 50
|
||||
#define WORMLENGTH 15
|
||||
#define PUREHARDCORE_LEVEL 10
|
||||
#define PRIZEMUL 7
|
||||
|
||||
#define INF 9999
|
||||
#define INFD 20
|
||||
#define PINFD 125
|
||||
#define BARLEV ((ISANDROID||ISIOS||purehepta)?9:10)
|
||||
#define BUGLEV 15
|
||||
// #define BARLEV 9
|
||||
@@ -469,7 +529,7 @@ bool isAlchAny(eWall w);
|
||||
bool isAlchAny(cell *c);
|
||||
|
||||
#define YDIST 101
|
||||
#define MODECODES 38
|
||||
#define MODECODES 254
|
||||
|
||||
extern cellwalker cwt; // player character position
|
||||
extern int sval;
|
||||
@@ -494,10 +554,14 @@ bool hellUnlocked();
|
||||
|
||||
bool markOrb(eItem it); // mark the orb as 'used', return true if exists
|
||||
bool markEmpathy(eItem it); // mark both the given orb and Empathy as 'used', return true if exists
|
||||
bool markEmpathy2(eItem it); // as above, but next turn
|
||||
|
||||
bool isMimic(eMonster m);
|
||||
bool isMimic(cell *c);
|
||||
void killWithMessage(cell *c, bool orStun = false, eMonster killer = moNone);
|
||||
|
||||
void fallMonster(cell *c, flagtype flags = 0); // kill monster due to terrain
|
||||
|
||||
bool attackMonster(cell *c, flagtype flags, eMonster killer);
|
||||
|
||||
bool isWorm(eMonster m);
|
||||
bool isWorm(cell *c);
|
||||
@@ -507,10 +571,11 @@ bool isIvy(cell *c);
|
||||
|
||||
#define GUNRANGE 3
|
||||
|
||||
// 0 = basic treasure, 1 = something else, 2 = power orb
|
||||
// 0 = basic treasure, 1 = other item, 2 = power orb, 3 = not an item
|
||||
#define IC_TREASURE 0
|
||||
#define IC_OTHER 1
|
||||
#define IC_ORB 2
|
||||
#define IC_NAI 3
|
||||
|
||||
bool playerInPower();
|
||||
void activateFlash();
|
||||
@@ -528,7 +593,7 @@ int realstuntime(cell *c);
|
||||
|
||||
extern bool invismove, invisfish;
|
||||
bool attackingForbidden(cell *c, cell *c2);
|
||||
void killOrStunMonster(cell *c2);
|
||||
void killOrStunMonster(cell *c2, eMonster who_killed);
|
||||
|
||||
extern vector<cell*> offscreen; // offscreen cells to take care off
|
||||
|
||||
@@ -538,6 +603,8 @@ cell *playerpos(int i);
|
||||
bool makeflame(cell *c, int timeout, bool checkonly);
|
||||
void bfs();
|
||||
bool isPlayerInBoatOn(cell *c);
|
||||
bool isPlayerInBoatOn(cell *c, int i);
|
||||
void destroyBoats(cell *c, cell *cf, bool strandedToo);
|
||||
extern bool showoff;
|
||||
extern int lastexplore;
|
||||
extern int truelotus;
|
||||
@@ -583,7 +650,18 @@ bool withRose(cell *cfrom, cell *cto);
|
||||
#define MF_MOUNT (1<<18) // don't do
|
||||
#define MF_NOFRIEND (1<<19) // don't do it for friends
|
||||
|
||||
bool canAttack(cell *c1, eMonster m1, cell *c2, eMonster m2, int flags);
|
||||
#define AF_SWORD (1<<20) // big sword
|
||||
#define AF_SWORD_INTO (1<<21) // moving into big sword
|
||||
#define AF_MSG (1<<22) // produce a message
|
||||
#define AF_ORSTUN (1<<23) // attackMonster: allow stunning
|
||||
#define AF_NEXTTURN (1<<24) // next turn -- don't count shield at power 1
|
||||
#define AF_FALL (1<<25) // death by falling
|
||||
#define MF_STUNNED (1<<26) // edgeunstable: ignore ladders (as stunned monsters do)
|
||||
#define MF_IVY (1<<27) // edgeunstable: ignore ivy (ivy cannot climb ivy)
|
||||
#define AF_HORNS (1<<28) // spear attack (always has APPROACH too)
|
||||
#define AF_BULL (1<<29) // bull attack
|
||||
|
||||
bool canAttack(cell *c1, eMonster m1, cell *c2, eMonster m2, flagtype flags);
|
||||
|
||||
extern bool chaosmode;
|
||||
extern bool chaosUnlocked;
|
||||
@@ -594,22 +672,6 @@ int getGhostcount();
|
||||
void raiseBuggyGeneration(cell *c, const char *s);
|
||||
void verifyMutantAround(cell *c);
|
||||
|
||||
extern FILE *debugfile;
|
||||
extern int debugflags;
|
||||
extern bool offline;
|
||||
|
||||
#ifdef ANDROID
|
||||
#define DEBB(r,x)
|
||||
#else
|
||||
#define DEBB(r,x) { if(debugfile && (!(r) || (debugflags & (r)))) { fprintf x; fflush(debugfile); } }
|
||||
#endif
|
||||
|
||||
#define DF_INIT 0 // always display these
|
||||
#define DF_MSG 0 // always display these
|
||||
#define DF_STEAM 1
|
||||
#define DF_GRAPH 2
|
||||
#define DF_TURN 4
|
||||
|
||||
#ifdef MOBILE
|
||||
#define NOPNG
|
||||
#endif
|
||||
@@ -633,7 +695,8 @@ void buildAirmap();
|
||||
// currently works for worms only
|
||||
bool sameMonster(cell *c1, cell *c2);
|
||||
cell *wormhead(cell *c);
|
||||
eMonster getMount();
|
||||
eMonster getMount(int player_id);
|
||||
eMonster haveMount();
|
||||
|
||||
bool isDragon(eMonster m);
|
||||
|
||||
@@ -647,6 +710,8 @@ extern bool autocheat;
|
||||
extern bool inHighQual;
|
||||
|
||||
void mountmove(cell *c, int spin, bool fp);
|
||||
void mountmove(cell *c, int spin, bool fp, cell *ppos);
|
||||
void mountswap(cell *c1, int spin1, bool fp1, cell *c2, int spin2, bool fp2);
|
||||
|
||||
template<class T> struct dynamicval {
|
||||
T& where;
|
||||
@@ -655,18 +720,403 @@ template<class T> struct dynamicval {
|
||||
~dynamicval() { where = backup; }
|
||||
};
|
||||
|
||||
namespace stalemate {
|
||||
struct stalemate1 {
|
||||
eMonster who;
|
||||
cell *moveto;
|
||||
cell *killed;
|
||||
cell *pushto;
|
||||
cell *comefrom;
|
||||
cell *swordlast[2], *swordtransit[2], *swordnext[2];
|
||||
bool isKilled(cell *c);
|
||||
stalemate1(eMonster w, cell *mt, cell *ki, cell *pt, cell *cf) : who(w), moveto(mt), killed(ki), pushto(pt), comefrom(cf) {}
|
||||
};
|
||||
|
||||
namespace stalemate {
|
||||
vector<stalemate1> moves;
|
||||
bool nextturn;
|
||||
|
||||
bool isKilled(cell *c);
|
||||
|
||||
bool anyKilled();
|
||||
bool isMoveto(cell *c);
|
||||
bool isKilledDirectlyAt(cell *c);
|
||||
bool isPushto(cell *c);
|
||||
};
|
||||
|
||||
extern int turncount;
|
||||
|
||||
bool reduceOrbPower(eItem it, int cap);
|
||||
bool checkOrb(eMonster m1, eItem orb);
|
||||
|
||||
movedir vectodir(const hyperpoint& P);
|
||||
|
||||
namespace sword {
|
||||
|
||||
extern int angle[MAXPLAYER];
|
||||
|
||||
cell *pos(cell *c, int s);
|
||||
cell *pos(int id);
|
||||
bool at(cell *where, bool noplayer = false);
|
||||
int shift(cell *c1, cell *c2);
|
||||
}
|
||||
|
||||
void killThePlayer(eMonster m, int id, flagtype flags);
|
||||
bool attackJustStuns(cell *c2);
|
||||
|
||||
bool isTargetOrAdjacent(cell *c);
|
||||
bool warningprotection();
|
||||
bool mineMarked(cell *c);
|
||||
bool minesafe();
|
||||
bool hasSafeOrb(cell *c);
|
||||
void placeWater(cell *c, cell *c2);
|
||||
bool againstCurrent(cell *w, cell *from);
|
||||
|
||||
#define DEFAULTCONTROL (multi::players == 1 && !shmup::on && !multi::alwaysuse)
|
||||
|
||||
extern bool timerghost;
|
||||
|
||||
#ifdef PANDORA
|
||||
#define MENU_SCALING
|
||||
#endif
|
||||
|
||||
#ifdef MOBILE
|
||||
#define MENU_SCALING
|
||||
#endif
|
||||
|
||||
#ifdef MENU_SCALING
|
||||
#define displayfrZ dialog::displayzoom
|
||||
#else
|
||||
#define displayfrZ displayfr
|
||||
#endif
|
||||
|
||||
namespace dialog {
|
||||
|
||||
enum tDialogItem {diTitle, diItem, diBreak, diHelp, diInfo, diSlider};
|
||||
|
||||
struct item {
|
||||
tDialogItem type;
|
||||
string body;
|
||||
string value;
|
||||
string keycaption;
|
||||
int key;
|
||||
int color, colorv, colork, colors, colorc;
|
||||
int scale;
|
||||
double param;
|
||||
};
|
||||
|
||||
item& lastItem();
|
||||
|
||||
void addSelItem(string body, string value, int key);
|
||||
void addBoolItem(string body, bool value, int key);
|
||||
void addColorItem(string body, int value, int key);
|
||||
void addHelp(string body);
|
||||
void addInfo(string body, int color = 0xC0C0C0);
|
||||
void addItem(string body, int key);
|
||||
void addBreak(int val);
|
||||
void addTitle(string body, int color, int scale);
|
||||
|
||||
void init();
|
||||
void init(string title, int color = 0xE8E8E8, int scale = 150, int brk = 60);
|
||||
void display();
|
||||
|
||||
void drawColorDialog(int color);
|
||||
int handleKeyColor(int sym, int uni, int& color);
|
||||
|
||||
void editNumber(ld& x, ld vmin, ld vmax, ld step, ld dft, string title, string help);
|
||||
void editNumber(int& x, int vmin, int vmax, int step, int dft, string title, string help);
|
||||
void scaleLog();
|
||||
void scaleSinh();
|
||||
void handleNavigation(int &sym, int &uni);
|
||||
bool displayzoom(int x, int y, int b, int size, const string &s, int color, int align);
|
||||
bool editingDetail();
|
||||
|
||||
int handlePage(int& nl, int& nlm, int perpage);
|
||||
void displayPageButtons(int i, bool pages);
|
||||
bool handlePageButtons(int uni);
|
||||
}
|
||||
|
||||
void checkStunKill(cell *dest);
|
||||
|
||||
void clearMessages();
|
||||
|
||||
void resetGeometry();
|
||||
|
||||
namespace svg {
|
||||
void circle(int x, int y, int size, int col);
|
||||
void polygon(int *polyx, int *polyy, int polyi, int col, int outline);
|
||||
void text(int x, int y, int size, const string& str, bool frame, int col, int align);
|
||||
extern bool in;
|
||||
extern string *info;
|
||||
void render(const char *fname = NULL);
|
||||
}
|
||||
|
||||
extern int sightrange;
|
||||
|
||||
namespace halloween {
|
||||
void getTreat(cell *where);
|
||||
}
|
||||
|
||||
// just in case if I change my mind about when Orbs lose their power
|
||||
#define ORBBASE 0
|
||||
|
||||
transmatrix mscale(const transmatrix& t, double fac);
|
||||
transmatrix mzscale(const transmatrix& t, double fac);
|
||||
extern bool ivoryz;
|
||||
#define mmscale(V, x) (mmspatial ? (ivoryz ? mzscale(V,x) : mscale(V, x)) : (V))
|
||||
|
||||
#define SHADOW_WALL 0x60
|
||||
#define SHADOW_SL 0x18
|
||||
#define SHADOW_MON 0x30
|
||||
|
||||
bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, int col, double footphase);
|
||||
void drawPlayerEffects(const transmatrix& V, cell *c, bool onPlayer);
|
||||
|
||||
// monster movement animations
|
||||
|
||||
struct animation {
|
||||
int ltick;
|
||||
double footphase;
|
||||
transmatrix wherenow;
|
||||
};
|
||||
|
||||
// we need separate animation layers for Orb of Domination and Tentacle+Ghost,
|
||||
// and also to mark Boats
|
||||
#define ANIMLAYERS 3
|
||||
#define LAYER_BIG 0 // for worms and krakens
|
||||
#define LAYER_SMALL 1 // for others
|
||||
#define LAYER_BOAT 2 // mark that a boat has moved
|
||||
|
||||
extern map<cell*, animation> animations[ANIMLAYERS];
|
||||
extern unordered_map<cell*, transmatrix> gmatrix, gmatrix0;
|
||||
|
||||
void animateMovement(cell *src, cell *tgt, int layer);
|
||||
|
||||
// for animations which might use the same locations,
|
||||
// such as replacements or multi-tile monsters
|
||||
void indAnimateMovement(cell *src, cell *tgt, int layer);
|
||||
void commitAnimations(int layer);
|
||||
|
||||
void animateReplacement(cell *a, cell *b, int layer);
|
||||
void fallingFloorAnimation(cell *c, eWall w = waNone, eMonster m = moNone);
|
||||
void fallingMonsterAnimation(cell *c, eMonster m);
|
||||
|
||||
// ranks:
|
||||
enum PPR {
|
||||
PPR_ZERO, PPR_OUTCIRCLE, PPR_MOVESTAR,
|
||||
PPR_MINUSINF,
|
||||
PPR_BELOWBOTTOMm,
|
||||
PPR_BELOWBOTTOM,
|
||||
PPR_BELOWBOTTOMp,
|
||||
PPR_LAKEBOTTOM, PPR_HELLSPIKE,
|
||||
PPR_INLAKEWALLm, PPR_INLAKEWALL, PPR_INLAKEWALLp,
|
||||
PPR_SUBLAKELEV, PPR_LAKELEV, PPR_BOATLEV, PPR_BOATLEV2, PPR_BOATLEV3,
|
||||
PPR_LAKEWALLm, PPR_LAKEWALL, PPR_LAKEWALLp,
|
||||
PPR_FLOOR_TOWER,
|
||||
PPR_FLOOR,
|
||||
PPR_FLOOR_DRAGON,
|
||||
PPR_FLOORa, PPR_FLOORb, PPR_FLOORc, PPR_FLOORd,
|
||||
PPR_LIZEYE,
|
||||
PPR_BFLOOR,
|
||||
PPR_GFLOORa, PPR_GFLOORb, PPR_GFLOORc,
|
||||
PPR_WALLSHADOW,
|
||||
PPR_STRUCT0, PPR_STRUCT1, PPR_STRUCT2, PPR_STRUCT3,
|
||||
PPR_THORNS, PPR_WALL,
|
||||
PPR_REDWALLm, PPR_REDWALLs, PPR_REDWALLp, PPR_REDWALL,
|
||||
PPR_REDWALLm2, PPR_REDWALLs2, PPR_REDWALLp2, PPR_REDWALLt2,
|
||||
PPR_REDWALLm3, PPR_REDWALLs3, PPR_REDWALLp3, PPR_REDWALLt3,
|
||||
PPR_HEPTAMARK,
|
||||
PPR_ITEM, PPR_ITEMa, PPR_ITEMb,
|
||||
PPR_BIGSTATUE,
|
||||
PPR_GLASSm, PPR_GLASSs, PPR_GLASSp, PPR_GLASS,
|
||||
PPR_WALL3m, PPR_WALL3s, PPR_WALL3p, PPR_WALL3, PPR_WALL3A,
|
||||
PPR_HIDDEN, PPR_GIANTSHADOW,
|
||||
PPR_TENTACLE0, PPR_TENTACLE1,
|
||||
PPR_ONTENTACLE, PPR_ONTENTACLE_EYES, PPR_ONTENTACLE_EYES2,
|
||||
PPR_MONSTER_SHADOW,
|
||||
PPR_MONSTER_FOOT, PPR_MONSTER_LEG, PPR_MONSTER_GROIN,
|
||||
PPR_MONSTER_BODY, PPR_MONSTER_SUBWPN, PPR_MONSTER_WPN, PPR_MONSTER_ARMOR0, PPR_MONSTER_ARMOR1,
|
||||
PPR_MONSTER_CLOAK, PPR_MONSTER_NECK,
|
||||
PPR_MONSTER_HEAD, PPR_MONSTER_FACE, PPR_MONSTER_EYE0, PPR_MONSTER_EYE1,
|
||||
PPR_MONSTER_HAIR, PPR_MONSTER_HAT0, PPR_MONSTER_HAT1,
|
||||
PPR_MONSTER_HOODCLOAK1, PPR_MONSTER_HOODCLOAK2,
|
||||
PPR_STUNSTARS,
|
||||
PPR_CARRIED, PPR_CARRIEDa, PPR_CARRIEDb,
|
||||
PPR_PARTICLE, PPR_SWORDMARK, PPR_MAGICSWORD, PPR_MISSILE,
|
||||
PPR_MINEMARK, PPR_ARROW,
|
||||
PPR_LINE, PPR_TEXT, PPR_CIRCLE,
|
||||
PPR_MAX
|
||||
};
|
||||
|
||||
void ShadowV(const transmatrix& V, const struct hpcshape& bp, int prio = PPR_MONSTER_SHADOW);
|
||||
|
||||
#define OUTLINE_NONE 0x000000FF
|
||||
#define OUTLINE_FRIEND 0x00FF00FF
|
||||
#define OUTLINE_ENEMY 0xFF0000FF
|
||||
#define OUTLINE_TREASURE 0xFFFF00FF
|
||||
#define OUTLINE_ORB 0xFF8000FF
|
||||
#define OUTLINE_OTHER 0xFFFFFFFF
|
||||
#define OUTLINE_DEAD 0x800000FF
|
||||
#define OUTLINE_TRANS 0
|
||||
|
||||
extern bool audio;
|
||||
extern string musiclicense;
|
||||
extern string musfname[landtypes];
|
||||
extern int musicvolume, effvolume;
|
||||
void initAudio();
|
||||
bool loadMusicInfo();
|
||||
void handlemusic();
|
||||
void playSeenSound(cell *c);
|
||||
void playSound(cell *c, const string& fname, int vol = 100);
|
||||
|
||||
inline string pick123() { return cts('1' + rand() % 3); }
|
||||
inline string pick12() { return cts('1' + rand() % 2); }
|
||||
|
||||
bool playerInBoat(int i);
|
||||
|
||||
extern int lowfar;
|
||||
extern bool wmspatial, wmescher, wmplain, wmblack, wmascii;
|
||||
extern bool mmspatial, mmhigh, mmmon, mmitem;
|
||||
extern int maxreclevel, reclevel;
|
||||
|
||||
string explain3D(ld *param);
|
||||
|
||||
extern int detaillevel;
|
||||
extern bool quitmainloop;
|
||||
|
||||
enum eGlyphsortorder {
|
||||
gsoFirstTop, gsoFirstBottom,
|
||||
gsoLastTop, gsoLastBottom,
|
||||
gsoLand, gsoValue,
|
||||
gsoMAX
|
||||
};
|
||||
|
||||
extern eGlyphsortorder glyphsortorder;
|
||||
|
||||
#ifdef ROGUEVIZ
|
||||
namespace rogueviz {
|
||||
extern bool on;
|
||||
string describe(shmup::monster *m);
|
||||
void activate(shmup::monster *m);
|
||||
void drawVertex(const transmatrix &V, cell *c, shmup::monster *m);
|
||||
bool virt(shmup::monster *m);
|
||||
void turn(int delta);
|
||||
void drawExtra();
|
||||
void fixparam();
|
||||
int readArgs();
|
||||
void close();
|
||||
}
|
||||
#endif
|
||||
|
||||
void explodeMine(cell *c);
|
||||
bool mayExplodeMine(cell *c, eMonster who);
|
||||
|
||||
int gravityLevel(cell *c);
|
||||
void fullcenter();
|
||||
void movecost(cell* from, cell *to);
|
||||
void checkmove();
|
||||
|
||||
transmatrix eumove(int x, int y);
|
||||
|
||||
#ifndef NOSAVE
|
||||
void loadScores();
|
||||
#endif
|
||||
|
||||
int reptilemax();
|
||||
|
||||
extern bool mousing;
|
||||
#define IFM(x) (mousing?"":x)
|
||||
|
||||
extern cell *recallCell;
|
||||
|
||||
extern eLand cheatdest;
|
||||
void cheatMoveTo(eLand l);
|
||||
|
||||
extern int backcolor;
|
||||
|
||||
extern bool overgenerate;
|
||||
void doOvergenerate();
|
||||
|
||||
void collectMessage(cell *c2, eItem which);
|
||||
|
||||
namespace quotientspace {
|
||||
void build();
|
||||
void clear();
|
||||
extern vector<int> connections;
|
||||
}
|
||||
|
||||
void killFriendlyIvy();
|
||||
|
||||
void pushdown(cell *c, int& q, const transmatrix &V, double down, bool rezoom, bool repriority);
|
||||
|
||||
extern bool viewdists;
|
||||
|
||||
void preventbarriers(cell *c);
|
||||
|
||||
bool passable_for(eMonster m, cell *w, cell *from, flagtype extra);
|
||||
|
||||
void beastcrash(cell *c, cell *beast);
|
||||
|
||||
int angledist(int t, int d1, int d2);
|
||||
int angledist(cell *c, int d1, int d2);
|
||||
|
||||
void setcameraangle(bool b);
|
||||
|
||||
enum eModel {
|
||||
mdDisk, mdHalfplane, mdBand, mdPolygonal, mdPolynomial,
|
||||
mdEquidistant, mdEquiarea, mdBall, mdHyperboloid, mdGUARD, mdUnchanged };
|
||||
|
||||
#define MODELCOUNT ((int) mdGUARD)
|
||||
|
||||
void drawShape(pair<ld,ld>* coords, int qty, int color);
|
||||
|
||||
extern eModel pmodel;
|
||||
|
||||
int darkena(int c, int lev, int a);
|
||||
|
||||
#define SHSIZE 16
|
||||
|
||||
extern cell *shpos[MAXPLAYER][SHSIZE];
|
||||
extern int cshpos;
|
||||
|
||||
|
||||
namespace arg {
|
||||
#ifdef USE_COMMANDLINE
|
||||
extern int argc; extern char **argv;
|
||||
|
||||
inline void lshift() {
|
||||
argc--; argv++;
|
||||
}
|
||||
|
||||
inline void shift() {
|
||||
lshift(); if(!argc) { printf("Missing parameter\n"); exit(1); }
|
||||
}
|
||||
|
||||
inline char* args() { return *argv; }
|
||||
inline int argi() { return atoi(*argv); }
|
||||
inline ld argf() { return atof(*argv); }
|
||||
inline bool argis(const char *s) { return strcmp(*argv, s) == 0; }
|
||||
|
||||
inline void init(int _argc, char **_argv) { argc=_argc-1; argv=_argv+1; }
|
||||
|
||||
int curphase;
|
||||
|
||||
inline void phaseerror(int x) {
|
||||
printf("Command line error: cannot read command '%s' from phase %d in phase %d\n", args(), x, curphase);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// returned values: 0 = ok, 1 = not recognized, 2 = shift phase
|
||||
int readCommon();
|
||||
int readLocal();
|
||||
|
||||
// an useful macro
|
||||
#define PHASE(x) { if(arg::curphase > x) phaseerror(x); else if(arg::curphase < x) return 2; }
|
||||
|
||||
void read(int phase);
|
||||
|
||||
#else
|
||||
inline void read(int phase) { }
|
||||
#endif
|
||||
}
|
||||
|
||||
extern bool generatingEquidistant;
|
||||
|
Reference in New Issue
Block a user