mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-13 10:50:35 +00:00
Merge pull request #376 from jlmjlm/nows1
Remove trailing whitespace from system.cpp
This commit is contained in:
commit
126f45a714
302
system.cpp
302
system.cpp
@ -26,9 +26,9 @@ namespace rg {
|
|||||||
static constexpr char racing = 'R';
|
static constexpr char racing = 'R';
|
||||||
static constexpr char dualmode = 'U';
|
static constexpr char dualmode = 'U';
|
||||||
static constexpr char heptagons = '7';
|
static constexpr char heptagons = '7';
|
||||||
|
|
||||||
/** \brief wrongmode only -- marks 'global' achievements not related to the current mode */
|
/** \brief wrongmode only -- marks 'global' achievements not related to the current mode */
|
||||||
static constexpr char global = 'x';
|
static constexpr char global = 'x';
|
||||||
/** \brief wrongmode only -- change vid.scfg.players then restart_game(rg::nothing) instead */
|
/** \brief wrongmode only -- change vid.scfg.players then restart_game(rg::nothing) instead */
|
||||||
static constexpr char multi = 'm';
|
static constexpr char multi = 'm';
|
||||||
/** \brief wrongmode only -- mark achievements for special geometries/variations, this automatically marks the expected land_structure as lsSingle */
|
/** \brief wrongmode only -- mark achievements for special geometries/variations, this automatically marks the expected land_structure as lsSingle */
|
||||||
@ -66,7 +66,7 @@ EX eLand top_land;
|
|||||||
|
|
||||||
/** \brief a comparator for version number strings */
|
/** \brief a comparator for version number strings */
|
||||||
EX bool verless(string v, string cmp) {
|
EX bool verless(string v, string cmp) {
|
||||||
if(isdigit(v[0]) && isdigit(v[1]))
|
if(isdigit(v[0]) && isdigit(v[1]))
|
||||||
v = "A" + v;
|
v = "A" + v;
|
||||||
if(isdigit(cmp[0]) && isdigit(cmp[1]))
|
if(isdigit(cmp[0]) && isdigit(cmp[1]))
|
||||||
cmp = "A" + cmp;
|
cmp = "A" + cmp;
|
||||||
@ -169,17 +169,17 @@ EX int easy_specialland;
|
|||||||
/** \brief initialize the game */
|
/** \brief initialize the game */
|
||||||
EX void initgame() {
|
EX void initgame() {
|
||||||
DEBBI(DF_INIT, ("initGame"));
|
DEBBI(DF_INIT, ("initGame"));
|
||||||
callhooks(hooks_initgame);
|
callhooks(hooks_initgame);
|
||||||
|
|
||||||
if(!safety) fix_land_structure_choice();
|
if(!safety) fix_land_structure_choice();
|
||||||
|
|
||||||
if(multi::players < 1 || multi::players > MAXPLAYER)
|
if(multi::players < 1 || multi::players > MAXPLAYER)
|
||||||
multi::players = 1;
|
multi::players = 1;
|
||||||
multi::whereto[0].d = MD_UNDECIDED;
|
multi::whereto[0].d = MD_UNDECIDED;
|
||||||
multi::cpid = 0;
|
multi::cpid = 0;
|
||||||
|
|
||||||
yendor::init(1);
|
yendor::init(1);
|
||||||
|
|
||||||
if(safety && safetyseed) {
|
if(safety && safetyseed) {
|
||||||
shrand(safetyseed);
|
shrand(safetyseed);
|
||||||
firstland = safetyland;
|
firstland = safetyland;
|
||||||
@ -189,14 +189,14 @@ EX void initgame() {
|
|||||||
firstland = specialland;
|
firstland = specialland;
|
||||||
ineligible_starting_land = !landUnlockedIngame(specialland);
|
ineligible_starting_land = !landUnlockedIngame(specialland);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(firstland == laNone || firstland == laBarrier)
|
if(firstland == laNone || firstland == laBarrier)
|
||||||
firstland = laCrossroads;
|
firstland = laCrossroads;
|
||||||
|
|
||||||
easy_specialland = 0;
|
easy_specialland = 0;
|
||||||
|
|
||||||
if(firstland == laOceanWall) firstland = laOcean;
|
if(firstland == laOceanWall) firstland = laOcean;
|
||||||
if(firstland == laHauntedWall) firstland = laGraveyard;
|
if(firstland == laHauntedWall) firstland = laGraveyard;
|
||||||
if(firstland == laHauntedBorder) firstland = laGraveyard;
|
if(firstland == laHauntedBorder) firstland = laGraveyard;
|
||||||
if(firstland == laHaunted && !tactic::on) firstland = laGraveyard;
|
if(firstland == laHaunted && !tactic::on) firstland = laGraveyard;
|
||||||
if(firstland == laMercuryRiver) firstland = laTerracotta;
|
if(firstland == laMercuryRiver) firstland = laTerracotta;
|
||||||
@ -208,7 +208,7 @@ EX void initgame() {
|
|||||||
firstland = weirdhyperbolic ? laCrossroads4 : laCrossroads;
|
firstland = weirdhyperbolic ? laCrossroads4 : laCrossroads;
|
||||||
easy_specialland = 3;
|
easy_specialland = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_euland(firstland);
|
clear_euland(firstland);
|
||||||
|
|
||||||
cwt.at = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false;
|
cwt.at = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false;
|
||||||
@ -217,7 +217,7 @@ EX void initgame() {
|
|||||||
#if CAP_COMPLEX2
|
#if CAP_COMPLEX2
|
||||||
if(firstland == laBrownian) brownian::init(cwt.at);
|
if(firstland == laBrownian) brownian::init(cwt.at);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
chaosAchieved = false;
|
chaosAchieved = false;
|
||||||
|
|
||||||
clearing::direct = 0;
|
clearing::direct = 0;
|
||||||
@ -228,11 +228,11 @@ EX void initgame() {
|
|||||||
splitrocks = 0;
|
splitrocks = 0;
|
||||||
|
|
||||||
if(firstland == laElementalWall) cwt.at->land = randomElementalLand();
|
if(firstland == laElementalWall) cwt.at->land = randomElementalLand();
|
||||||
|
|
||||||
resetview();
|
resetview();
|
||||||
createMov(cwt.at, 0);
|
createMov(cwt.at, 0);
|
||||||
|
|
||||||
pregen();
|
pregen();
|
||||||
setdist(cwt.at, BARLEV, NULL);
|
setdist(cwt.at, BARLEV, NULL);
|
||||||
|
|
||||||
if(!disable_bigstuff)
|
if(!disable_bigstuff)
|
||||||
@ -242,11 +242,11 @@ EX void initgame() {
|
|||||||
#endif
|
#endif
|
||||||
cwt.at->move(0)->land = firstland;
|
cwt.at->move(0)->land = firstland;
|
||||||
if(firstland == laWhirlpool) cwt.at->move(0)->wall = waSea;
|
if(firstland == laWhirlpool) cwt.at->move(0)->wall = waSea;
|
||||||
|
|
||||||
setdist(cwt.at->move(0), BARLEV-1, cwt.at);
|
setdist(cwt.at->move(0), BARLEV-1, cwt.at);
|
||||||
|
|
||||||
if(horo_ok()) {
|
if(horo_ok()) {
|
||||||
if(specialland == laCamelot)
|
if(specialland == laCamelot)
|
||||||
start_camelot(cwt.at);
|
start_camelot(cwt.at);
|
||||||
else {
|
else {
|
||||||
heptagon *h = create_altmap(cwt.at, 2, hsA);
|
heptagon *h = create_altmap(cwt.at, 2, hsA);
|
||||||
@ -254,13 +254,13 @@ EX void initgame() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tactic::on && firstland == laPower) {
|
if(tactic::on && firstland == laPower) {
|
||||||
items[itOrbSpeed] = 30;
|
items[itOrbSpeed] = 30;
|
||||||
items[itOrbWinter] = 30;
|
items[itOrbWinter] = 30;
|
||||||
items[itOrbFlash] = 30;
|
items[itOrbFlash] = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(firstland == laCA)
|
if(firstland == laCA)
|
||||||
items[itOrbAether] = 2;
|
items[itOrbAether] = 2;
|
||||||
|
|
||||||
@ -269,19 +269,19 @@ EX void initgame() {
|
|||||||
if(hiitemsMax(itFernFlower) >= 25) items[itFernFlower] = min(hiitemsMax(itFernFlower), 50);
|
if(hiitemsMax(itFernFlower) >= 25) items[itFernFlower] = min(hiitemsMax(itFernFlower), 50);
|
||||||
if(hiitemsMax(itWine) >= 25) items[itWine] = min(hiitemsMax(itWine), 50);
|
if(hiitemsMax(itWine) >= 25) items[itWine] = min(hiitemsMax(itWine), 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
yendor::lastchallenge = yendor::challenge;
|
yendor::lastchallenge = yendor::challenge;
|
||||||
|
|
||||||
if(shmup::on) shmup::init();
|
if(shmup::on) shmup::init();
|
||||||
|
|
||||||
yendor::init(2);
|
yendor::init(2);
|
||||||
|
|
||||||
#if CAP_RACING
|
#if CAP_RACING
|
||||||
if(racing::on) racing::generate_track();
|
if(racing::on) racing::generate_track();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(gamegen_failure) return;
|
if(gamegen_failure) return;
|
||||||
|
|
||||||
if(euclid && specialland == laPrincessQuest) {
|
if(euclid && specialland == laPrincessQuest) {
|
||||||
cell *c = euc::at(princess::coords());
|
cell *c = euc::at(princess::coords());
|
||||||
princess::generating = true;
|
princess::generating = true;
|
||||||
@ -297,15 +297,15 @@ EX void initgame() {
|
|||||||
c->cmove(0)->landparam = 44;
|
c->cmove(0)->landparam = 44;
|
||||||
c->cmove(0)->land = laCrossroads2;
|
c->cmove(0)->land = laCrossroads2;
|
||||||
}
|
}
|
||||||
|
|
||||||
sword::determine_sword_angles();
|
sword::determine_sword_angles();
|
||||||
for(int i=0; i<numplayers(); i++)
|
for(int i=0; i<numplayers(); i++)
|
||||||
sword::dir[i] = sword::initial(cwt.at);
|
sword::dir[i] = sword::initial(cwt.at);
|
||||||
|
|
||||||
#if CAP_DAILY
|
#if CAP_DAILY
|
||||||
daily::split();
|
daily::split();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// extern int sightrange; sightrange = 9;
|
// extern int sightrange; sightrange = 9;
|
||||||
// cwt.at->land = laHell; items[itHell] = 10;
|
// cwt.at->land = laHell; items[itHell] = 10;
|
||||||
for(int i=BARLEV; i>=7 - getDistLimit() - genrange_bonus; i--) {
|
for(int i=BARLEV; i>=7 - getDistLimit() - genrange_bonus; i--) {
|
||||||
@ -313,7 +313,7 @@ EX void initgame() {
|
|||||||
|
|
||||||
currentmap->verify();
|
currentmap->verify();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doCross) {
|
if(doCross) {
|
||||||
for(int i=0; i<ittypes; i++) if(itemclass(eItem(i)) == IC_TREASURE) items[i] = 50;
|
for(int i=0; i<ittypes; i++) if(itemclass(eItem(i)) == IC_TREASURE) items[i] = 50;
|
||||||
for(int i=0; i<motypes; i++) kills[i] = 30;
|
for(int i=0; i<motypes; i++) kills[i] = 30;
|
||||||
@ -322,13 +322,13 @@ EX void initgame() {
|
|||||||
kills[moPrincessArmedMoved] = 0;
|
kills[moPrincessArmedMoved] = 0;
|
||||||
kills[moPlayer] = 0;
|
kills[moPlayer] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(quotient && generateAll(firstland)) {
|
if(quotient && generateAll(firstland)) {
|
||||||
for(int i=0; i<isize(currentmap->allcells()); i++)
|
for(int i=0; i<isize(currentmap->allcells()); i++)
|
||||||
setdist(currentmap->allcells()[i], 8, NULL);
|
setdist(currentmap->allcells()[i], 8, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(multi::players > 1 && !shmup::on) for(int i=0; i<numplayers(); i++) {
|
if(multi::players > 1 && !shmup::on) for(int i=0; i<numplayers(); i++) {
|
||||||
int idir = (3 * i) % cwt.at->type;
|
int idir = (3 * i) % cwt.at->type;
|
||||||
multi::player[i].at = cwt.at->move(idir);
|
multi::player[i].at = cwt.at->move(idir);
|
||||||
@ -342,15 +342,15 @@ EX void initgame() {
|
|||||||
multi::flipped[i] = true;
|
multi::flipped[i] = true;
|
||||||
multi::whereto[i].d = MD_UNDECIDED;
|
multi::whereto[i].d = MD_UNDECIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
yendor::init(3);
|
yendor::init(3);
|
||||||
peace::simon::init();
|
peace::simon::init();
|
||||||
|
|
||||||
multi::revive_queue.clear();
|
multi::revive_queue.clear();
|
||||||
#if CAP_TOUR
|
#if CAP_TOUR
|
||||||
if(tour::on) tour::presentation(tour::pmRestart);
|
if(tour::on) tour::presentation(tour::pmRestart);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(multi::players > 1 && !shmup::on) {
|
if(multi::players > 1 && !shmup::on) {
|
||||||
for(cell *pc: player_positions())
|
for(cell *pc: player_positions())
|
||||||
makeEmpty(pc);
|
makeEmpty(pc);
|
||||||
@ -358,7 +358,7 @@ EX void initgame() {
|
|||||||
else {
|
else {
|
||||||
makeEmpty(cwt.at);
|
makeEmpty(cwt.at);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(specialland == laMinefield && closed_or_bounded) {
|
if(specialland == laMinefield && closed_or_bounded) {
|
||||||
bfs();
|
bfs();
|
||||||
generate_mines();
|
generate_mines();
|
||||||
@ -370,10 +370,10 @@ EX void initgame() {
|
|||||||
if(in_lovasz()) {
|
if(in_lovasz()) {
|
||||||
cwt.at->item = itOrbInvis;
|
cwt.at->item = itOrbInvis;
|
||||||
}
|
}
|
||||||
|
|
||||||
princess::squeaked = false;
|
princess::squeaked = false;
|
||||||
clearing::current_root = NULL;
|
clearing::current_root = NULL;
|
||||||
|
|
||||||
if(!safety) {
|
if(!safety) {
|
||||||
usedSafety = false;
|
usedSafety = false;
|
||||||
timerstart = time(NULL); turncount = 0; rosewave = 0; rosephase = 0;
|
timerstart = time(NULL); turncount = 0; rosewave = 0; rosephase = 0;
|
||||||
@ -411,16 +411,16 @@ EX void initgame() {
|
|||||||
usedSafety = true;
|
usedSafety = true;
|
||||||
safety = false;
|
safety = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
havewhat = hadwhat = 0; rosemap.clear();
|
havewhat = hadwhat = 0; rosemap.clear();
|
||||||
|
|
||||||
elec::lightningfast = 0;
|
elec::lightningfast = 0;
|
||||||
|
|
||||||
lastsafety = gold();
|
lastsafety = gold();
|
||||||
bfs();
|
bfs();
|
||||||
checkmove();
|
checkmove();
|
||||||
playermoved = true;
|
playermoved = true;
|
||||||
|
|
||||||
if(quotient || sphere)
|
if(quotient || sphere)
|
||||||
for(cell *c: currentmap->allcells()) setdist(c, 8, NULL);
|
for(cell *c: currentmap->allcells()) setdist(c, 8, NULL);
|
||||||
|
|
||||||
@ -439,7 +439,7 @@ bool havesave = true;
|
|||||||
|
|
||||||
/** \brief A namespace for loading and saving scores and saved games (system.cpp), and for displaying these scores (scores.cpp).
|
/** \brief A namespace for loading and saving scores and saved games (system.cpp), and for displaying these scores (scores.cpp).
|
||||||
*
|
*
|
||||||
* Most ApplyBox functions are used both for saving savegames and scores to the logfile, loading savegames and scores from the logfile,
|
* Most ApplyBox functions are used both for saving savegames and scores to the logfile, loading savegames and scores from the logfile,
|
||||||
* and loading highscore information from the logfile. The flags saving, loading, and loadingHi specify what is actually done.
|
* and loading highscore information from the logfile. The flags saving, loading, and loadingHi specify what is actually done.
|
||||||
*/
|
*/
|
||||||
EX namespace scores {
|
EX namespace scores {
|
||||||
@ -529,7 +529,7 @@ void applyBoxI(eItem it, bool f = false) {
|
|||||||
boxname[boxid] = iinf[it].name;
|
boxname[boxid] = iinf[it].name;
|
||||||
fakebox[boxid] = f;
|
fakebox[boxid] = f;
|
||||||
monsbox[boxid] = false;
|
monsbox[boxid] = false;
|
||||||
if(loadingHi) {
|
if(loadingHi) {
|
||||||
updateHi_for_code(it, save.box[boxid++], saved_modecode);
|
updateHi_for_code(it, save.box[boxid++], saved_modecode);
|
||||||
}
|
}
|
||||||
else applyBox(items[it]);
|
else applyBox(items[it]);
|
||||||
@ -545,7 +545,7 @@ void addinv(eItem it) {
|
|||||||
void applyBoxOrb(eItem it) {
|
void applyBoxOrb(eItem it) {
|
||||||
applyBoxI(it, true);
|
applyBoxI(it, true);
|
||||||
invorb.push_back(it);
|
invorb.push_back(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief Handle the OSM information for all orbs that applyBoxOrb has been called for so far */
|
/** \brief Handle the OSM information for all orbs that applyBoxOrb has been called for so far */
|
||||||
void list_invorb() {
|
void list_invorb() {
|
||||||
@ -593,11 +593,11 @@ EX void applyBoxes() {
|
|||||||
applyBoxNum(cellcount, "cells generated");
|
applyBoxNum(cellcount, "cells generated");
|
||||||
|
|
||||||
if(loading) timerstart = time(NULL);
|
if(loading) timerstart = time(NULL);
|
||||||
|
|
||||||
for(int i=0; i<itOrbLightning; i++)
|
for(int i=0; i<itOrbLightning; i++)
|
||||||
if(i == 0) items[i] = 0, applyBoxI(itFernFlower);
|
if(i == 0) items[i] = 0, applyBoxI(itFernFlower);
|
||||||
else applyBoxI(eItem(i));
|
else applyBoxI(eItem(i));
|
||||||
|
|
||||||
for(int i=0; i<43; i++) {
|
for(int i=0; i<43; i++) {
|
||||||
if(loading) kills[i] = 0;
|
if(loading) kills[i] = 0;
|
||||||
if(i == moWormtail) applyBoxM(moCrystalSage);
|
if(i == moWormtail) applyBoxM(moCrystalSage);
|
||||||
@ -614,7 +614,7 @@ EX void applyBoxes() {
|
|||||||
else if(i == moNone) applyBoxNum(kills[i], "icewalls melted");
|
else if(i == moNone) applyBoxNum(kills[i], "icewalls melted");
|
||||||
else applyBoxM(eMonster(i));
|
else applyBoxM(eMonster(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(saving) {
|
if(saving) {
|
||||||
int totaltime = savetime;
|
int totaltime = savetime;
|
||||||
if(!timerstopped) totaltime += timer - timerstart;
|
if(!timerstopped) totaltime += timer - timerstart;
|
||||||
@ -622,19 +622,19 @@ EX void applyBoxes() {
|
|||||||
}
|
}
|
||||||
else if(loading) savetime = applyBoxLoad("time played");
|
else if(loading) savetime = applyBoxLoad("time played");
|
||||||
else boxname[boxid] = "time played", boxid++;
|
else boxname[boxid] = "time played", boxid++;
|
||||||
|
|
||||||
if(saving) savecount++;
|
if(saving) savecount++;
|
||||||
applyBoxNum(savecount, "number of saves");
|
applyBoxNum(savecount, "number of saves");
|
||||||
if(saving) savecount--;
|
if(saving) savecount--;
|
||||||
applyBoxNum(cheater, "number of cheats");
|
applyBoxNum(cheater, "number of cheats");
|
||||||
|
|
||||||
fakebox[boxid] = false;
|
fakebox[boxid] = false;
|
||||||
if(saving) applyBoxSave(items[itOrbSafety] ? safetyland : cwt.at->land, "@safetyland");
|
if(saving) applyBoxSave(items[itOrbSafety] ? safetyland : cwt.at->land, "@safetyland");
|
||||||
else if(loading) firstland = safetyland = eLand(applyBoxLoad("@safetyland"));
|
else if(loading) firstland = safetyland = eLand(applyBoxLoad("@safetyland"));
|
||||||
else lostin = eLand(save.box[boxid++]);
|
else lostin = eLand(save.box[boxid++]);
|
||||||
|
|
||||||
for(int i=itOrbLightning; i<25; i++) applyBoxOrb(eItem(i));
|
for(int i=itOrbLightning; i<25; i++) applyBoxOrb(eItem(i));
|
||||||
|
|
||||||
applyBoxI(itRoyalJelly);
|
applyBoxI(itRoyalJelly);
|
||||||
applyBoxI(itWine);
|
applyBoxI(itWine);
|
||||||
applyBoxI(itSilver);
|
applyBoxI(itSilver);
|
||||||
@ -664,18 +664,18 @@ EX void applyBoxes() {
|
|||||||
applyBoxI(itGrimoire);
|
applyBoxI(itGrimoire);
|
||||||
applyBoxM(moKnight);
|
applyBoxM(moKnight);
|
||||||
applyBoxM(moCultistLeader);
|
applyBoxM(moCultistLeader);
|
||||||
|
|
||||||
applyBoxM(moPirate);
|
applyBoxM(moPirate);
|
||||||
applyBoxM(moCShark);
|
applyBoxM(moCShark);
|
||||||
applyBoxM(moParrot);
|
applyBoxM(moParrot);
|
||||||
applyBoxI(itPirate);
|
applyBoxI(itPirate);
|
||||||
applyBoxOrb(itOrbTime);
|
applyBoxOrb(itOrbTime);
|
||||||
|
|
||||||
applyBoxM(moHexSnake);
|
applyBoxM(moHexSnake);
|
||||||
applyBoxM(moRedTroll);
|
applyBoxM(moRedTroll);
|
||||||
applyBoxI(itRedGem);
|
applyBoxI(itRedGem);
|
||||||
applyBoxOrb(itOrbSpace);
|
applyBoxOrb(itOrbSpace);
|
||||||
|
|
||||||
int geo = geometry;
|
int geo = geometry;
|
||||||
applyBoxNum(geo, "@geometry"); geometry = eGeometry(geo);
|
applyBoxNum(geo, "@geometry"); geometry = eGeometry(geo);
|
||||||
applyBoxBool(hardcore, "hardcore");
|
applyBoxBool(hardcore, "hardcore");
|
||||||
@ -684,7 +684,7 @@ EX void applyBoxes() {
|
|||||||
if(saving) applyBoxSave(specialland, "euclid land");
|
if(saving) applyBoxSave(specialland, "euclid land");
|
||||||
else if(loading) specialland = eLand(applyBoxLoad("euclid land"));
|
else if(loading) specialland = eLand(applyBoxLoad("euclid land"));
|
||||||
else fakebox[boxid++] = true;
|
else fakebox[boxid++] = true;
|
||||||
|
|
||||||
applyBoxI(itCoast);
|
applyBoxI(itCoast);
|
||||||
applyBoxI(itWhirlpool);
|
applyBoxI(itWhirlpool);
|
||||||
applyBoxI(itBombEgg);
|
applyBoxI(itBombEgg);
|
||||||
@ -694,7 +694,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxOrb(itOrbFriend);
|
applyBoxOrb(itOrbFriend);
|
||||||
applyBoxOrb(itOrbAir);
|
applyBoxOrb(itOrbAir);
|
||||||
applyBoxOrb(itOrbWater);
|
applyBoxOrb(itOrbWater);
|
||||||
|
|
||||||
applyBoxI(itPalace);
|
applyBoxI(itPalace);
|
||||||
applyBoxI(itFjord);
|
applyBoxI(itFjord);
|
||||||
applyBoxOrb(itOrbFrog);
|
applyBoxOrb(itOrbFrog);
|
||||||
@ -706,7 +706,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxM(moViking);
|
applyBoxM(moViking);
|
||||||
applyBoxM(moFjordTroll);
|
applyBoxM(moFjordTroll);
|
||||||
applyBoxM(moWaterElemental);
|
applyBoxM(moWaterElemental);
|
||||||
|
|
||||||
applyBoxI(itSavedPrincess);
|
applyBoxI(itSavedPrincess);
|
||||||
applyBoxOrb(itOrbLove);
|
applyBoxOrb(itOrbLove);
|
||||||
applyBoxM(moPrincess);
|
applyBoxM(moPrincess);
|
||||||
@ -715,7 +715,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxM(moMouse);
|
applyBoxM(moMouse);
|
||||||
applyBoxNum(princess::saveArmedHP, "@saveArmedHP");
|
applyBoxNum(princess::saveArmedHP, "@saveArmedHP");
|
||||||
applyBoxNum(princess::saveHP, "@saveHP");
|
applyBoxNum(princess::saveHP, "@saveHP");
|
||||||
|
|
||||||
applyBoxI(itIvory);
|
applyBoxI(itIvory);
|
||||||
applyBoxI(itElemental);
|
applyBoxI(itElemental);
|
||||||
applyBoxI(itZebra);
|
applyBoxI(itZebra);
|
||||||
@ -723,7 +723,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxI(itWaterShard);
|
applyBoxI(itWaterShard);
|
||||||
applyBoxI(itAirShard);
|
applyBoxI(itAirShard);
|
||||||
applyBoxI(itEarthShard);
|
applyBoxI(itEarthShard);
|
||||||
|
|
||||||
applyBoxM(moAirElemental);
|
applyBoxM(moAirElemental);
|
||||||
applyBoxM(moFireElemental);
|
applyBoxM(moFireElemental);
|
||||||
applyBoxM(moFamiliar);
|
applyBoxM(moFamiliar);
|
||||||
@ -743,10 +743,10 @@ EX void applyBoxes() {
|
|||||||
applyBoxI(itBounty);
|
applyBoxI(itBounty);
|
||||||
applyBoxOrb(itOrbLuck);
|
applyBoxOrb(itOrbLuck);
|
||||||
applyBoxOrb(itOrbStunning);
|
applyBoxOrb(itOrbStunning);
|
||||||
|
|
||||||
applyBoxBool(tactic::on, "@tactic");
|
applyBoxBool(tactic::on, "@tactic");
|
||||||
applyBoxNum(elec::lightningfast, "@lightningfast");
|
applyBoxNum(elec::lightningfast, "@lightningfast");
|
||||||
|
|
||||||
// if(save.box[boxid]) printf("lotus = %d (lost = %d)\n", save.box[boxid], isHaunted(lostin));
|
// if(save.box[boxid]) printf("lotus = %d (lost = %d)\n", save.box[boxid], isHaunted(lostin));
|
||||||
if(loadingHi && isHaunted(lostin)) boxid++;
|
if(loadingHi && isHaunted(lostin)) boxid++;
|
||||||
else applyBoxI(itLotus);
|
else applyBoxI(itLotus);
|
||||||
@ -760,7 +760,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxBool(survivalist, "@survivalist");
|
applyBoxBool(survivalist, "@survivalist");
|
||||||
if(loadingHi) applyBoxI(itLotus);
|
if(loadingHi) applyBoxI(itLotus);
|
||||||
else applyBoxNum(truelotus, "lotus/escape");
|
else applyBoxNum(truelotus, "lotus/escape");
|
||||||
|
|
||||||
applyBoxEnum(variation, "variation");
|
applyBoxEnum(variation, "variation");
|
||||||
applyBoxI(itRose);
|
applyBoxI(itRose);
|
||||||
applyBoxOrb(itOrbBeauty);
|
applyBoxOrb(itOrbBeauty);
|
||||||
@ -776,8 +776,8 @@ EX void applyBoxes() {
|
|||||||
if(multi::players < 1 || multi::players > MAXPLAYER)
|
if(multi::players < 1 || multi::players > MAXPLAYER)
|
||||||
multi::players = 1;
|
multi::players = 1;
|
||||||
applyBoxM(moRatlingAvenger);
|
applyBoxM(moRatlingAvenger);
|
||||||
// printf("applybox %d\n", shmup::players);
|
// printf("applybox %d\n", shmup::players);
|
||||||
|
|
||||||
applyBoxI(itApple);
|
applyBoxI(itApple);
|
||||||
applyBoxM(moSparrowhawk);
|
applyBoxM(moSparrowhawk);
|
||||||
applyBoxM(moResearcher);
|
applyBoxM(moResearcher);
|
||||||
@ -788,7 +788,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxNum(tortoise::seekbits, "@seekbits");
|
applyBoxNum(tortoise::seekbits, "@seekbits");
|
||||||
applyBoxM(moTortoise);
|
applyBoxM(moTortoise);
|
||||||
applyBoxOrb(itOrbShell);
|
applyBoxOrb(itOrbShell);
|
||||||
|
|
||||||
applyBoxNum(safetyseed, "@safetyseed");
|
applyBoxNum(safetyseed, "@safetyseed");
|
||||||
|
|
||||||
// (+18)
|
// (+18)
|
||||||
@ -808,22 +808,22 @@ EX void applyBoxes() {
|
|||||||
applyBoxOrb(itOrbSword2);
|
applyBoxOrb(itOrbSword2);
|
||||||
applyBoxI(itTrollEgg);
|
applyBoxI(itTrollEgg);
|
||||||
applyBoxOrb(itOrbStone);
|
applyBoxOrb(itOrbStone);
|
||||||
|
|
||||||
bool sph;
|
bool sph;
|
||||||
sph = false; applyBoxBool(sph, "sphere"); if(sph) geometry = gSphere;
|
sph = false; applyBoxBool(sph, "sphere"); if(sph) geometry = gSphere;
|
||||||
sph = false; applyBoxBool(sph, "elliptic"); if(sph) geometry = gElliptic;
|
sph = false; applyBoxBool(sph, "elliptic"); if(sph) geometry = gElliptic;
|
||||||
applyBoxNum(princess::reviveAt, "@reviveAt");
|
applyBoxNum(princess::reviveAt, "@reviveAt");
|
||||||
|
|
||||||
applyBoxI(itDodeca);
|
applyBoxI(itDodeca);
|
||||||
applyBoxI(itAmethyst);
|
applyBoxI(itAmethyst);
|
||||||
applyBoxI(itSlime);
|
applyBoxI(itSlime);
|
||||||
applyBoxOrb(itOrbNature);
|
applyBoxOrb(itOrbNature);
|
||||||
applyBoxOrb(itOrbDash);
|
applyBoxOrb(itOrbDash);
|
||||||
addinv(itOrbRecall);
|
addinv(itOrbRecall);
|
||||||
applyBoxM(moBat);
|
applyBoxM(moBat);
|
||||||
applyBoxM(moReptile);
|
applyBoxM(moReptile);
|
||||||
applyBoxM(moFriendlyIvy);
|
applyBoxM(moFriendlyIvy);
|
||||||
|
|
||||||
applyBoxI(itGreenGrass);
|
applyBoxI(itGreenGrass);
|
||||||
applyBoxI(itBull);
|
applyBoxI(itBull);
|
||||||
applyBoxOrb(itOrbHorns);
|
applyBoxOrb(itOrbHorns);
|
||||||
@ -863,7 +863,7 @@ EX void applyBoxes() {
|
|||||||
applyBoxM(moTerraWarrior);
|
applyBoxM(moTerraWarrior);
|
||||||
applyBoxM(moSalamander);
|
applyBoxM(moSalamander);
|
||||||
applyBoxM(moLavaWolf);
|
applyBoxM(moLavaWolf);
|
||||||
|
|
||||||
applyBoxOrb(itOrbSlaying);
|
applyBoxOrb(itOrbSlaying);
|
||||||
applyBoxOrb(itOrbMagnetism);
|
applyBoxOrb(itOrbMagnetism);
|
||||||
applyBoxOrb(itOrbPhasing);
|
applyBoxOrb(itOrbPhasing);
|
||||||
@ -881,19 +881,19 @@ EX void applyBoxes() {
|
|||||||
applyBoxM(moPair);
|
applyBoxM(moPair);
|
||||||
applyBoxM(moCrusher);
|
applyBoxM(moCrusher);
|
||||||
applyBoxM(moMonk);
|
applyBoxM(moMonk);
|
||||||
|
|
||||||
bool v2 = false;
|
bool v2 = false;
|
||||||
applyBoxBool(v2, "@variation"); if(loading && v2) variation = eVariation::goldberg;
|
applyBoxBool(v2, "@variation"); if(loading && v2) variation = eVariation::goldberg;
|
||||||
applyBoxNum(gp::param.first, "@gp-first");
|
applyBoxNum(gp::param.first, "@gp-first");
|
||||||
applyBoxNum(gp::param.second, "@gp-second");
|
applyBoxNum(gp::param.second, "@gp-second");
|
||||||
|
|
||||||
v2 = false; applyBoxBool(v2); if(loading && v2) variation = eVariation::irregular;
|
v2 = false; applyBoxBool(v2); if(loading && v2) variation = eVariation::irregular;
|
||||||
applyBoxNum(irr::cellcount, "@irr-cellcount");
|
applyBoxNum(irr::cellcount, "@irr-cellcount");
|
||||||
|
|
||||||
list_invorb();
|
list_invorb();
|
||||||
|
|
||||||
applyBoxNum(irr::bitruncations_performed, "@irr-bitruncations");
|
applyBoxNum(irr::bitruncations_performed, "@irr-bitruncations");
|
||||||
|
|
||||||
applyBoxI(itVarTreasure);
|
applyBoxI(itVarTreasure);
|
||||||
applyBoxI(itBrownian);
|
applyBoxI(itBrownian);
|
||||||
applyBoxI(itWest);
|
applyBoxI(itWest);
|
||||||
@ -906,13 +906,13 @@ EX void applyBoxes() {
|
|||||||
applyBoxOrb(itOrbChoice);
|
applyBoxOrb(itOrbChoice);
|
||||||
applyBoxOrb(itOrbGravity);
|
applyBoxOrb(itOrbGravity);
|
||||||
list_invorb();
|
list_invorb();
|
||||||
|
|
||||||
applyBoxM(moNarciss);
|
applyBoxM(moNarciss);
|
||||||
applyBoxM(moMirrorSpirit);
|
applyBoxM(moMirrorSpirit);
|
||||||
|
|
||||||
applyBoxNum(clearing::direct, "@clearing-direct");
|
applyBoxNum(clearing::direct, "@clearing-direct");
|
||||||
applyBoxBignum(clearing::imputed, "@clearing-imputed");
|
applyBoxBignum(clearing::imputed, "@clearing-imputed");
|
||||||
|
|
||||||
applyBoxOrb(itOrbImpact);
|
applyBoxOrb(itOrbImpact);
|
||||||
applyBoxOrb(itOrbChaos);
|
applyBoxOrb(itOrbChaos);
|
||||||
applyBoxOrb(itOrbPlague);
|
applyBoxOrb(itOrbPlague);
|
||||||
@ -928,10 +928,10 @@ EX void applyBoxes() {
|
|||||||
|
|
||||||
applyBoxNum(saved_modecode, "modecode");
|
applyBoxNum(saved_modecode, "modecode");
|
||||||
applyBoxBool(ineligible_starting_land, "ineligible_starting_land");
|
applyBoxBool(ineligible_starting_land, "ineligible_starting_land");
|
||||||
|
|
||||||
applyBoxNum(yasc_code, "YASC code");
|
applyBoxNum(yasc_code, "YASC code");
|
||||||
applyBoxBool(casual, "casual mode");
|
applyBoxBool(casual, "casual mode");
|
||||||
|
|
||||||
applyBoxI(itCursed);
|
applyBoxI(itCursed);
|
||||||
applyBoxI(itDice);
|
applyBoxI(itDice);
|
||||||
applyBoxOrb(itOrbPurity);
|
applyBoxOrb(itOrbPurity);
|
||||||
@ -998,7 +998,7 @@ modecode_t fill_modecode() {
|
|||||||
if(save.box[341]) variation = eVariation::goldberg;
|
if(save.box[341]) variation = eVariation::goldberg;
|
||||||
if(save.box[344]) variation = eVariation::irregular;
|
if(save.box[344]) variation = eVariation::irregular;
|
||||||
|
|
||||||
if(multi::players < 0 || multi::players > MAXPLAYER)
|
if(multi::players < 0 || multi::players > MAXPLAYER)
|
||||||
return 6;
|
return 6;
|
||||||
|
|
||||||
if(multi::players == 0)
|
if(multi::players == 0)
|
||||||
@ -1006,7 +1006,7 @@ modecode_t fill_modecode() {
|
|||||||
|
|
||||||
if(shmup::on && multi::players == 1 && boxid <= 258)
|
if(shmup::on && multi::players == 1 && boxid <= 258)
|
||||||
return 6; /* not sure why */
|
return 6; /* not sure why */
|
||||||
|
|
||||||
return modecode(2);
|
return modecode(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1045,7 +1045,7 @@ long long saveposition = -1;
|
|||||||
EX void remove_emergency_save() {
|
EX void remove_emergency_save() {
|
||||||
if(scorefile == "") return;
|
if(scorefile == "") return;
|
||||||
#if !ISWINDOWS
|
#if !ISWINDOWS
|
||||||
if(saveposition >= 0) {
|
if(saveposition >= 0) {
|
||||||
if(truncate(scorefile.c_str(), saveposition)) {}
|
if(truncate(scorefile.c_str(), saveposition)) {}
|
||||||
saveposition = -1;
|
saveposition = -1;
|
||||||
}
|
}
|
||||||
@ -1070,15 +1070,15 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
if(experimental) return;
|
if(experimental) return;
|
||||||
|
|
||||||
if(!gold() && !racing::on) return;
|
if(!gold() && !racing::on) return;
|
||||||
|
|
||||||
remove_emergency_save();
|
remove_emergency_save();
|
||||||
|
|
||||||
auto& xcode = scores::saved_modecode;
|
auto& xcode = scores::saved_modecode;
|
||||||
|
|
||||||
xcode = modecode();
|
xcode = modecode();
|
||||||
|
|
||||||
FILE *f = fopen(scorefile.c_str(), "at");
|
FILE *f = fopen(scorefile.c_str(), "at");
|
||||||
|
|
||||||
if(!f) {
|
if(!f) {
|
||||||
// printf("Could not open the score file '%s'!\n", scorefile);
|
// printf("Could not open the score file '%s'!\n", scorefile);
|
||||||
addMessage(XLAT("Could not open the score file: ") + scorefile);
|
addMessage(XLAT("Could not open the score file: ") + scorefile);
|
||||||
@ -1089,24 +1089,24 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
saveposition = ftell(f);
|
saveposition = ftell(f);
|
||||||
// if(!timerghost) addMessage(XLAT("Emergency save at ") + its(saveposition));
|
// if(!timerghost) addMessage(XLAT("Emergency save at ") + its(saveposition));
|
||||||
}
|
}
|
||||||
|
|
||||||
time_t timer;
|
time_t timer;
|
||||||
timer = time(NULL);
|
timer = time(NULL);
|
||||||
char sbuf[128]; strftime(sbuf, 128, "%c", localtime(&timerstart));
|
char sbuf[128]; strftime(sbuf, 128, "%c", localtime(&timerstart));
|
||||||
char buf[128]; strftime(buf, 128, "%c", localtime(&timer));
|
char buf[128]; strftime(buf, 128, "%c", localtime(&timer));
|
||||||
|
|
||||||
if((tactic::on || yendor::on) && !items[itOrbSafety] && !cheater) {
|
if((tactic::on || yendor::on) && !items[itOrbSafety] && !cheater) {
|
||||||
int t = (int) (timer - timerstart);
|
int t = (int) (timer - timerstart);
|
||||||
|
|
||||||
if(tactic::on) {
|
if(tactic::on) {
|
||||||
int score = items[treasureType(specialland)];
|
int score = items[treasureType(specialland)];
|
||||||
|
|
||||||
if(score) {
|
if(score) {
|
||||||
int c =
|
int c =
|
||||||
anticheat::certify(dnameof(specialland), turncount, t, (int) timerstart,
|
anticheat::certify(dnameof(specialland), turncount, t, (int) timerstart,
|
||||||
unsigned(xcode)*999 + tactic::id + 256 * score);
|
unsigned(xcode)*999 + tactic::id + 256 * score);
|
||||||
fprintf(f, "TACTICS %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
fprintf(f, "TACTICS %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
||||||
tactic::id, specialland, score, turncount, t, int(timerstart),
|
tactic::id, specialland, score, turncount, t, int(timerstart),
|
||||||
c, int(xcode), buf);
|
c, int(xcode), buf);
|
||||||
tactic::record(specialland, score);
|
tactic::record(specialland, score);
|
||||||
anticheat::nextid(tactic::id, VER, c);
|
anticheat::nextid(tactic::id, VER, c);
|
||||||
@ -1115,7 +1115,7 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
|
|
||||||
if(yendor::on)
|
if(yendor::on)
|
||||||
fprintf(f, "YENDOR %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
fprintf(f, "YENDOR %s %d %d %d %d %d %d %d %d date: %s\n", VER,
|
||||||
yendor::lastchallenge, items[itOrbYendor], yendor::won, turncount, t, int(timerstart),
|
yendor::lastchallenge, items[itOrbYendor], yendor::won, turncount, t, int(timerstart),
|
||||||
anticheat::certify(yendor::won ? "WON" : "LOST", turncount, t, (int) timerstart,
|
anticheat::certify(yendor::won ? "WON" : "LOST", turncount, t, (int) timerstart,
|
||||||
unsigned(xcode)*999 + yendor::lastchallenge + 256 * items[itOrbYendor]),
|
unsigned(xcode)*999 + yendor::lastchallenge + 256 * items[itOrbYendor]),
|
||||||
int(xcode),
|
int(xcode),
|
||||||
@ -1145,14 +1145,14 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
if(true) {
|
if(true) {
|
||||||
|
|
||||||
fprintf(f, VER);
|
fprintf(f, VER);
|
||||||
if(!shmup::on) items[itOrbLife] = countMyGolems(moGolem);
|
if(!shmup::on) items[itOrbLife] = countMyGolems(moGolem);
|
||||||
if(!shmup::on) items[itOrbFriend] = countMyGolems(moTameBomberbird);
|
if(!shmup::on) items[itOrbFriend] = countMyGolems(moTameBomberbird);
|
||||||
if(!shmup::on) kills[moPrincessMoved] = countMyGolems(moPrincess);
|
if(!shmup::on) kills[moPrincessMoved] = countMyGolems(moPrincess);
|
||||||
if(!shmup::on) kills[moPrincessArmedMoved] = countMyGolems(moPrincessArmed);
|
if(!shmup::on) kills[moPrincessArmedMoved] = countMyGolems(moPrincessArmed);
|
||||||
if(!shmup::on) princess::saveHP = countMyGolemsHP(moPrincess);
|
if(!shmup::on) princess::saveHP = countMyGolemsHP(moPrincess);
|
||||||
if(!shmup::on) princess::saveArmedHP = countMyGolemsHP(moPrincessArmed);
|
if(!shmup::on) princess::saveArmedHP = countMyGolemsHP(moPrincessArmed);
|
||||||
scores::saveBox();
|
scores::saveBox();
|
||||||
|
|
||||||
for(int i=0; i<scores::boxid; i++) fprintf(f, " %d", scores::save.box[i]);
|
for(int i=0; i<scores::boxid; i++) fprintf(f, " %d", scores::save.box[i]);
|
||||||
scorebox = scores::save;
|
scorebox = scores::save;
|
||||||
anticheat::save(f);
|
anticheat::save(f);
|
||||||
@ -1160,7 +1160,7 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
if(yasc_message != "") fprintf(f, "YASC %s\n", yasc_message.c_str());
|
if(yasc_message != "") fprintf(f, "YASC %s\n", yasc_message.c_str());
|
||||||
}
|
}
|
||||||
fprintf(f, "Played on: %s - %s (%d %s)\n", sbuf, buf, turncount,
|
fprintf(f, "Played on: %s - %s (%d %s)\n", sbuf, buf, turncount,
|
||||||
shmup::on ? "knives" : "turns");
|
shmup::on ? "knives" : "turns");
|
||||||
fprintf(f, "Total wealth: %d\n", gold());
|
fprintf(f, "Total wealth: %d\n", gold());
|
||||||
fprintf(f, "Total enemies killed: %d\n", tkills());
|
fprintf(f, "Total enemies killed: %d\n", tkills());
|
||||||
@ -1170,27 +1170,27 @@ EX void saveStats(bool emergency IS(false)) {
|
|||||||
|
|
||||||
if(!ls::nice_walls())
|
if(!ls::nice_walls())
|
||||||
fprintf(f, "land structure: %s\n", land_structure_name(true).c_str());
|
fprintf(f, "land structure: %s\n", land_structure_name(true).c_str());
|
||||||
|
|
||||||
if(shmup::on) fprintf(f, "Shoot-em up mode\n");
|
if(shmup::on) fprintf(f, "Shoot-em up mode\n");
|
||||||
if(inv::on) fprintf(f, "Inventory mode\n");
|
if(inv::on) fprintf(f, "Inventory mode\n");
|
||||||
if(multi::players > 1) fprintf(f, "Multi-player (%d players)\n", multi::players);
|
if(multi::players > 1) fprintf(f, "Multi-player (%d players)\n", multi::players);
|
||||||
fprintf(f, "Number of cells explored, by distance from the player:\n");
|
fprintf(f, "Number of cells explored, by distance from the player:\n");
|
||||||
{for(int i=0; i<10; i++) fprintf(f, " %d", explore[i]);} fprintf(f, "\n");
|
{for(int i=0; i<10; i++) fprintf(f, " %d", explore[i]);} fprintf(f, "\n");
|
||||||
if(kills[0]) fprintf(f, "walls melted: %d\n", kills[0]);
|
if(kills[0]) fprintf(f, "walls melted: %d\n", kills[0]);
|
||||||
fprintf(f, "cells travelled: %d\n", celldist(cwt.at));
|
fprintf(f, "cells travelled: %d\n", celldist(cwt.at));
|
||||||
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
for(int i=0; i<ittypes; i++) if(items[i])
|
for(int i=0; i<ittypes; i++) if(items[i])
|
||||||
fprintf(f, "%4dx %s\n", items[i], iinf[i].name);
|
fprintf(f, "%4dx %s\n", items[i], iinf[i].name);
|
||||||
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
for(int i=1; i<motypes; i++) if(kills[i])
|
for(int i=1; i<motypes; i++) if(kills[i])
|
||||||
fprintf(f, "%4dx %s\n", kills[i], minf[i].name);
|
fprintf(f, "%4dx %s\n", kills[i], minf[i].name);
|
||||||
|
|
||||||
fprintf(f, "\n\n\n");
|
fprintf(f, "\n\n\n");
|
||||||
|
|
||||||
#if !ISMOBILE
|
#if !ISMOBILE
|
||||||
DEBB(DF_INIT, ("Game statistics saved to ", scorefile));
|
DEBB(DF_INIT, ("Game statistics saved to ", scorefile));
|
||||||
addMessage(XLAT("Game statistics saved to %1", scorefile));
|
addMessage(XLAT("Game statistics saved to %1", scorefile));
|
||||||
@ -1237,13 +1237,13 @@ EX void loadsave() {
|
|||||||
for(int i=0; i<MAXBOX; i++) {
|
for(int i=0; i<MAXBOX; i++) {
|
||||||
if(fscanf(f, "%d", &sc.box[i]) <= 0) {
|
if(fscanf(f, "%d", &sc.box[i]) <= 0) {
|
||||||
scores::boxid = i;
|
scores::boxid = i;
|
||||||
|
|
||||||
tamper = anticheat::load(f, sc, sc.ver);
|
tamper = anticheat::load(f, sc, sc.ver);
|
||||||
|
|
||||||
using namespace scores;
|
using namespace scores;
|
||||||
for(int i=0; i<boxid; i++) save.box[i] = sc.box[i];
|
for(int i=0; i<boxid; i++) save.box[i] = sc.box[i];
|
||||||
for(int i=boxid; i<MAXBOX; i++) save.box[i] = 0, sc.box[i] = 0;
|
for(int i=boxid; i<MAXBOX; i++) save.box[i] = 0, sc.box[i] = 0;
|
||||||
|
|
||||||
if(boxid <= MODECODE_BOX) save.box[MODECODE_BOX] = sc.box[MODECODE_BOX] = fill_modecode();
|
if(boxid <= MODECODE_BOX) save.box[MODECODE_BOX] = sc.box[MODECODE_BOX] = fill_modecode();
|
||||||
|
|
||||||
if(save.box[258] >= 0 && save.box[258] < coh) {
|
if(save.box[258] >= 0 && save.box[258] < coh) {
|
||||||
@ -1271,17 +1271,17 @@ EX void loadsave() {
|
|||||||
int xc = -1;
|
int xc = -1;
|
||||||
sscanf(buf, "%70s%9s%d%d%d%d%d%d%d%d",
|
sscanf(buf, "%70s%9s%d%d%d%d%d%d%d%d",
|
||||||
buf1, ver, &tid, &land, &score, &tc, &t, &ts, &cert, &xc);
|
buf1, ver, &tid, &land, &score, &tc, &t, &ts, &cert, &xc);
|
||||||
|
|
||||||
eLand l2 = eLand(land);
|
eLand l2 = eLand(land);
|
||||||
if(land == laMirror && verless(ver, "10.0")) l2 = laMirrorOld;
|
if(land == laMirror && verless(ver, "10.0")) l2 = laMirrorOld;
|
||||||
|
|
||||||
if(xc == -1)
|
if(xc == -1)
|
||||||
for(xc=0; xc<32768; xc++)
|
for(xc=0; xc<32768; xc++)
|
||||||
if(anticheat::check(cert, ver, dnameof(l2), tc, t, ts, xc*999+unsigned(tid) + 256 * score))
|
if(anticheat::check(cert, ver, dnameof(l2), tc, t, ts, xc*999+unsigned(tid) + 256 * score))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(tid == tactic::id && (anticheat::check(cert, ver, dnameof(l2), tc, t, ts, xc*unsigned(999)+ unsigned(tid) + 256 * score))) {
|
if(tid == tactic::id && (anticheat::check(cert, ver, dnameof(l2), tc, t, ts, xc*unsigned(999)+ unsigned(tid) + 256 * score))) {
|
||||||
if(score != 0
|
if(score != 0
|
||||||
&& !(land == laOcean && verless(ver, "8.0f"))
|
&& !(land == laOcean && verless(ver, "8.0f"))
|
||||||
&& !(land == laTerracotta && verless(ver, "10.3e"))
|
&& !(land == laTerracotta && verless(ver, "10.3e"))
|
||||||
&& !(land == laWildWest && verless(ver, "11.3b") && !verless(ver, "11.3")))
|
&& !(land == laWildWest && verless(ver, "11.3b") && !verless(ver, "11.3")))
|
||||||
@ -1298,14 +1298,14 @@ EX void loadsave() {
|
|||||||
|
|
||||||
if(xc == -1)
|
if(xc == -1)
|
||||||
for(xc=0; xc<32768; xc++)
|
for(xc=0; xc<32768; xc++)
|
||||||
if(anticheat::check(cert, ver, won ? "WON" : "LOST", tc, t, ts, xc*999 + cid + 256 * oy))
|
if(anticheat::check(cert, ver, won ? "WON" : "LOST", tc, t, ts, xc*999 + cid + 256 * oy))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(won) if(anticheat::check(cert, ver, won ? "WON" : "LOST", tc, t, ts, xc*999 + cid + 256 * oy)) {
|
if(won) if(anticheat::check(cert, ver, won ? "WON" : "LOST", tc, t, ts, xc*999 + cid + 256 * oy)) {
|
||||||
if(xc == 19 && cid == 25) xc = 0;
|
if(xc == 19 && cid == 25) xc = 0;
|
||||||
if(cid > 0 && cid < YENDORLEVELS)
|
if(cid > 0 && cid < YENDORLEVELS)
|
||||||
if(!(verless(ver, "8.0f") && oy > 1 && cid == 15))
|
if(!(verless(ver, "8.0f") && oy > 1 && cid == 15))
|
||||||
if(!(verless(ver, "9.3b") && oy > 1 && (cid == 27 || cid == 28)))
|
if(!(verless(ver, "9.3b") && oy > 1 && (cid == 27 || cid == 28)))
|
||||||
{
|
{
|
||||||
yendor::bestscore[xc][cid] = max(yendor::bestscore[xc][cid], oy);
|
yendor::bestscore[xc][cid] = max(yendor::bestscore[xc][cid], oy);
|
||||||
}
|
}
|
||||||
@ -1329,7 +1329,7 @@ EX void loadsave() {
|
|||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
// this is the index of Orb of Safety
|
// this is the index of Orb of Safety
|
||||||
if(ok && sc.box[65 + 4 + itOrbSafety - itOrbLightning])
|
if(ok && sc.box[65 + 4 + itOrbSafety - itOrbLightning])
|
||||||
load_last_save();
|
load_last_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1393,11 +1393,11 @@ EX void stop_game() {
|
|||||||
for(int i=0; i<10; i++) for(int l=0; l<landtypes; l++)
|
for(int i=0; i<10; i++) for(int l=0; l<landtypes; l++)
|
||||||
exploreland[i][l] = 0;
|
exploreland[i][l] = 0;
|
||||||
|
|
||||||
for(int i: player_indices())
|
for(int i: player_indices())
|
||||||
multi::deaths[i]++;
|
multi::deaths[i]++;
|
||||||
|
|
||||||
#if CAP_SAVE
|
#if CAP_SAVE
|
||||||
anticheat::tampered = false;
|
anticheat::tampered = false;
|
||||||
#endif
|
#endif
|
||||||
achievementsReceived.clear();
|
achievementsReceived.clear();
|
||||||
princess::saved = false;
|
princess::saved = false;
|
||||||
@ -1444,7 +1444,7 @@ EX void set_geometry(eGeometry target) {
|
|||||||
hybrid::configure(target);
|
hybrid::configure(target);
|
||||||
}
|
}
|
||||||
geometry = target;
|
geometry = target;
|
||||||
|
|
||||||
#if CAP_IRR
|
#if CAP_IRR
|
||||||
if(IRREGULAR) variation = eVariation::bitruncated;
|
if(IRREGULAR) variation = eVariation::bitruncated;
|
||||||
#endif
|
#endif
|
||||||
@ -1467,14 +1467,14 @@ EX void set_geometry(eGeometry target) {
|
|||||||
if(ginf[target].default_variation == eVariation::pure && geometry != gArchimedean && !mhybrid)
|
if(ginf[target].default_variation == eVariation::pure && geometry != gArchimedean && !mhybrid)
|
||||||
variation = eVariation::pure;
|
variation = eVariation::pure;
|
||||||
geometry_settings(was_default);
|
geometry_settings(was_default);
|
||||||
|
|
||||||
if(geometry == gArbitrary) {
|
if(geometry == gArbitrary) {
|
||||||
arb::convert::base_geometry = geometry;
|
arb::convert::base_geometry = geometry;
|
||||||
arb::convert::base_variation = variation;
|
arb::convert::base_variation = variation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rotspace) {
|
if(rotspace) {
|
||||||
check_cgi(); cgi.require_basics();
|
check_cgi(); cgi.require_basics();
|
||||||
hybrid::csteps = cgi.psl_steps;
|
hybrid::csteps = cgi.psl_steps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1505,7 +1505,7 @@ EX void set_variation(eVariation target) {
|
|||||||
variation = target;
|
variation = target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void stop_tour() {
|
void stop_tour() {
|
||||||
while(gamestack::pushed()) {
|
while(gamestack::pushed()) {
|
||||||
gamestack::pop();
|
gamestack::pop();
|
||||||
@ -1518,12 +1518,12 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
switch(switchWhat) {
|
switch(switchWhat) {
|
||||||
case rg::peace:
|
case rg::peace:
|
||||||
peace::on = !peace::on;
|
peace::on = !peace::on;
|
||||||
tactic::on = yendor::on = princess::challenge =
|
tactic::on = yendor::on = princess::challenge =
|
||||||
randomPatternsMode = inv::on = false;
|
randomPatternsMode = inv::on = false;
|
||||||
racing::on = false;
|
racing::on = false;
|
||||||
bow::weapon = bow::wBlade;
|
bow::weapon = bow::wBlade;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::dualmode:
|
case rg::dualmode:
|
||||||
stop_tour(); tour::on = false;
|
stop_tour(); tour::on = false;
|
||||||
racing::on = false;
|
racing::on = false;
|
||||||
@ -1532,11 +1532,11 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
if(!dual::state) dual::enable();
|
if(!dual::state) dual::enable();
|
||||||
else dual::disable();
|
else dual::disable();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::inv:
|
case rg::inv:
|
||||||
inv::on = !inv::on;
|
inv::on = !inv::on;
|
||||||
if(tactic::on) firstland = specialland = laIce;
|
if(tactic::on) firstland = specialland = laIce;
|
||||||
tactic::on = yendor::on = princess::challenge =
|
tactic::on = yendor::on = princess::challenge =
|
||||||
peace::on = false;
|
peace::on = false;
|
||||||
racing::on = false;
|
racing::on = false;
|
||||||
break;
|
break;
|
||||||
@ -1580,7 +1580,7 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
dual::disable();
|
dual::disable();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if CAP_RACING
|
#if CAP_RACING
|
||||||
case rg::racing:
|
case rg::racing:
|
||||||
racing::on = !racing::on;
|
racing::on = !racing::on;
|
||||||
shmup::on = racing::on;
|
shmup::on = racing::on;
|
||||||
@ -1606,14 +1606,14 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
if(!tactic::on) firstland = laIce;
|
if(!tactic::on) firstland = laIce;
|
||||||
dual::disable();
|
dual::disable();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::shmup:
|
case rg::shmup:
|
||||||
shmup::on = !shmup::on;
|
shmup::on = !shmup::on;
|
||||||
princess::challenge = false;
|
princess::challenge = false;
|
||||||
if(!shmup::on) racing::on = false;
|
if(!shmup::on) racing::on = false;
|
||||||
if(!shmup::on && multi::players > 1) bow::weapon = bow::wBlade;
|
if(!shmup::on && multi::players > 1) bow::weapon = bow::wBlade;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::randpattern:
|
case rg::randpattern:
|
||||||
randomPatternsMode = !randomPatternsMode;
|
randomPatternsMode = !randomPatternsMode;
|
||||||
tactic::on = false;
|
tactic::on = false;
|
||||||
@ -1621,7 +1621,7 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
peace::on = false;
|
peace::on = false;
|
||||||
princess::challenge = false;
|
princess::challenge = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::princess:
|
case rg::princess:
|
||||||
princess::challenge = !princess::challenge;
|
princess::challenge = !princess::challenge;
|
||||||
firstland = specialland = princess::challenge ? laPalace : laIce;
|
firstland = specialland = princess::challenge ? laPalace : laIce;
|
||||||
@ -1634,12 +1634,12 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
use_custom_land_list = false;
|
use_custom_land_list = false;
|
||||||
dual::disable();
|
dual::disable();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if CAP_DAILY
|
#if CAP_DAILY
|
||||||
case rg::daily:
|
case rg::daily:
|
||||||
daily::setup();
|
daily::setup();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rg::daily_off:
|
case rg::daily_off:
|
||||||
daily::turnoff();
|
daily::turnoff();
|
||||||
break;
|
break;
|
||||||
@ -1650,7 +1650,7 @@ EX void switch_game_mode(char switchWhat) {
|
|||||||
EX void start_game() {
|
EX void start_game() {
|
||||||
if(game_active) return;
|
if(game_active) return;
|
||||||
DEBBI(DF_INIT, ("start_game"));
|
DEBBI(DF_INIT, ("start_game"));
|
||||||
if(dual::state == 1) dual::assign_landsides();
|
if(dual::state == 1) dual::assign_landsides();
|
||||||
if(dual::split(start_game)) return;
|
if(dual::split(start_game)) return;
|
||||||
restart:
|
restart:
|
||||||
game_active = true;
|
game_active = true;
|
||||||
@ -1694,7 +1694,7 @@ EX void start_game() {
|
|||||||
|
|
||||||
// popAllScreens + popAllGames + stop_game + switch_game_mode + start_game
|
// popAllScreens + popAllGames + stop_game + switch_game_mode + start_game
|
||||||
EX void restart_game(char switchWhat IS(rg::nothing)) {
|
EX void restart_game(char switchWhat IS(rg::nothing)) {
|
||||||
popScreenAll();
|
popScreenAll();
|
||||||
#if CAP_RACING
|
#if CAP_RACING
|
||||||
if(switchWhat == rg::nothing && racing::on) {
|
if(switchWhat == rg::nothing && racing::on) {
|
||||||
racing::restore_goals();
|
racing::restore_goals();
|
||||||
@ -1777,10 +1777,10 @@ EX void initAll() {
|
|||||||
achievement_init(); // not in ANDROID
|
achievement_init(); // not in ANDROID
|
||||||
|
|
||||||
firstland0 = firstland;
|
firstland0 = firstland;
|
||||||
|
|
||||||
// initlanguage();
|
// initlanguage();
|
||||||
initialize_all();
|
initialize_all();
|
||||||
|
|
||||||
#if CAP_SAVE
|
#if CAP_SAVE
|
||||||
select_savefile();
|
select_savefile();
|
||||||
loadsave();
|
loadsave();
|
||||||
@ -1788,7 +1788,7 @@ EX void initAll() {
|
|||||||
#endif
|
#endif
|
||||||
start_game();
|
start_game();
|
||||||
restore_all_golems();
|
restore_all_golems();
|
||||||
|
|
||||||
firstland = firstland0;
|
firstland = firstland0;
|
||||||
polygonal::solve();
|
polygonal::solve();
|
||||||
}
|
}
|
||||||
@ -1797,7 +1797,7 @@ EX purehookset hooks_final_cleanup;
|
|||||||
|
|
||||||
EX void finishAll() {
|
EX void finishAll() {
|
||||||
achievement_final(!items[itOrbSafety]);
|
achievement_final(!items[itOrbSafety]);
|
||||||
|
|
||||||
#if CAP_SAVE
|
#if CAP_SAVE
|
||||||
if(!casual)
|
if(!casual)
|
||||||
saveStats();
|
saveStats();
|
||||||
@ -1806,8 +1806,8 @@ EX void finishAll() {
|
|||||||
#if !ISMOBILE
|
#if !ISMOBILE
|
||||||
quit_all();
|
quit_all();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
achievement_close();
|
achievement_close();
|
||||||
callhooks(hooks_final_cleanup);
|
callhooks(hooks_final_cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1874,7 +1874,7 @@ auto cgm = addHook(hooks_clearmemory, 40, [] () {
|
|||||||
recallCell = NULL;
|
recallCell = NULL;
|
||||||
butterflies.clear();
|
butterflies.clear();
|
||||||
buggycells.clear();
|
buggycells.clear();
|
||||||
crush_next.clear();
|
crush_next.clear();
|
||||||
crush_now.clear();
|
crush_now.clear();
|
||||||
rosemap.clear();
|
rosemap.clear();
|
||||||
hv_land.clear();
|
hv_land.clear();
|
||||||
@ -1882,7 +1882,7 @@ auto cgm = addHook(hooks_clearmemory, 40, [] () {
|
|||||||
bow::clear_bowpath();
|
bow::clear_bowpath();
|
||||||
bow::fire_mode = false;
|
bow::fire_mode = false;
|
||||||
for(auto &am: adj_memo) am.clear();
|
for(auto &am: adj_memo) am.clear();
|
||||||
}) +
|
}) +
|
||||||
addHook(hooks_gamedata, 0, [] (gamedata* gd) {
|
addHook(hooks_gamedata, 0, [] (gamedata* gd) {
|
||||||
gd->store(pathq);
|
gd->store(pathq);
|
||||||
gd->store(dcal);
|
gd->store(dcal);
|
||||||
|
Loading…
Reference in New Issue
Block a user