mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
all save boxes are now named (fakeboxes start with @)
This commit is contained in:
parent
14cb26b986
commit
db4be83091
@ -689,7 +689,7 @@ EX namespace inv {
|
||||
|
||||
#if CAP_SAVE
|
||||
EX void applyBox(eItem it) {
|
||||
scores::applyBoxNum(inv::usedup[it]);
|
||||
scores::applyBoxNum(inv::usedup[it], "@inv-" + dnameof(it));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
54
system.cpp
54
system.cpp
@ -439,19 +439,19 @@ void applyBox(int& t) {
|
||||
}
|
||||
|
||||
/** \brief the next box should contain tb */
|
||||
void applyBoxBignum(bignum& tb) {
|
||||
void applyBoxBignum(bignum& tb, string name) {
|
||||
float tf;
|
||||
int ti;
|
||||
if(saving) tf = tb.approx_ld();
|
||||
if(saving) memcpy(&ti, &tf, 4);
|
||||
applyBox(ti);
|
||||
applyBoxNum(ti, name);
|
||||
if(loading) memcpy(&tf, &ti, 4);
|
||||
if(loading) tb = bignum(tf);
|
||||
}
|
||||
|
||||
/** \brief the next box should contain i, and possibly be named name */
|
||||
EX void applyBoxNum(int& i, string name IS("")) {
|
||||
fakebox[boxid] = (name == "");
|
||||
fakebox[boxid] = (name == "" || name[0] == '@');
|
||||
boxname[boxid] = name;
|
||||
monsbox[boxid] = false;
|
||||
applyBox(i);
|
||||
@ -575,8 +575,8 @@ EX void applyBoxes() {
|
||||
applyBoxNum(cheater, "number of cheats");
|
||||
|
||||
fakebox[boxid] = true;
|
||||
if(saving) applyBoxSave(items[itOrbSafety] ? safetyland : cwt.at->land, "");
|
||||
else if(loading) firstland = safetyland = eLand(applyBoxLoad());
|
||||
if(saving) applyBoxSave(items[itOrbSafety] ? safetyland : cwt.at->land, "@safetyland");
|
||||
else if(loading) firstland = safetyland = eLand(applyBoxLoad("@safetyland"));
|
||||
else lostin = eLand(save.box[boxid++]);
|
||||
|
||||
for(int i=itOrbLightning; i<25; i++) applyBoxOrb(eItem(i));
|
||||
@ -623,9 +623,9 @@ EX void applyBoxes() {
|
||||
applyBoxOrb(itOrbSpace);
|
||||
|
||||
int geo = geometry;
|
||||
applyBoxNum(geo, ""); geometry = eGeometry(geo);
|
||||
applyBoxNum(geo, "@geometry"); geometry = eGeometry(geo);
|
||||
applyBoxBool(hardcore, "hardcore");
|
||||
applyBoxNum(hardcoreAt, "");
|
||||
applyBoxNum(hardcoreAt, "@hardcoreAt");
|
||||
applyBoxBool(shmup::on, "shmup");
|
||||
if(saving) applyBoxSave(specialland, "euclid land");
|
||||
else if(loading) specialland = eLand(applyBoxLoad("euclid land"));
|
||||
@ -659,8 +659,8 @@ EX void applyBoxes() {
|
||||
applyBoxM(moPrincessMoved, false); // live Princess for Safety
|
||||
applyBoxM(moPrincessArmedMoved, false); // live Princess for Safety
|
||||
applyBoxM(moMouse);
|
||||
applyBoxNum(princess::saveArmedHP, "");
|
||||
applyBoxNum(princess::saveHP, "");
|
||||
applyBoxNum(princess::saveArmedHP, "@saveArmedHP");
|
||||
applyBoxNum(princess::saveHP, "@saveHP");
|
||||
|
||||
applyBoxI(itIvory);
|
||||
applyBoxI(itElemental);
|
||||
@ -690,8 +690,8 @@ EX void applyBoxes() {
|
||||
applyBoxOrb(itOrbLuck);
|
||||
applyBoxOrb(itOrbStunning);
|
||||
|
||||
applyBoxBool(tactic::on, "");
|
||||
applyBoxNum(elec::lightningfast, "");
|
||||
applyBoxBool(tactic::on, "@tactic");
|
||||
applyBoxNum(elec::lightningfast, "@lightningfast");
|
||||
|
||||
// if(save.box[boxid]) printf("lotus = %d (lost = %d)\n", save.box[boxid], isHaunted(lostin));
|
||||
if(loadingHi && isHaunted(lostin)) boxid++;
|
||||
@ -703,7 +703,7 @@ EX void applyBoxes() {
|
||||
applyBoxOrb(itMutant2);
|
||||
applyBoxOrb(itOrbFreedom);
|
||||
applyBoxM(moRedFox);
|
||||
applyBoxBool(survivalist);
|
||||
applyBoxBool(survivalist, "@survivalist");
|
||||
if(loadingHi) applyBoxI(itLotus);
|
||||
else applyBoxNum(truelotus, "lotus/escape");
|
||||
|
||||
@ -733,17 +733,17 @@ EX void applyBoxes() {
|
||||
applyBoxM(moDragonHead);
|
||||
applyBoxOrb(itOrbDomination);
|
||||
applyBoxI(itBabyTortoise);
|
||||
applyBoxNum(tortoise::seekbits, "");
|
||||
applyBoxNum(tortoise::seekbits, "@seekbits");
|
||||
applyBoxM(moTortoise);
|
||||
applyBoxOrb(itOrbShell);
|
||||
|
||||
applyBoxNum(safetyseed);
|
||||
applyBoxNum(safetyseed, "@safetyseed");
|
||||
|
||||
// (+18)
|
||||
for(int i=0; i<6; i++) {
|
||||
applyBoxNum(multi::treasures[i]);
|
||||
applyBoxNum(multi::kills[i]);
|
||||
applyBoxNum(multi::deaths[i]);
|
||||
applyBoxNum(multi::treasures[i], "@multi-treasures" + its(i));
|
||||
applyBoxNum(multi::kills[i], "@multi-kills" + its(i));
|
||||
applyBoxNum(multi::deaths[i], "@multi-deaths" + its(i));
|
||||
}
|
||||
// (+8)
|
||||
applyBoxM(moDragonTail);
|
||||
@ -760,7 +760,7 @@ EX void applyBoxes() {
|
||||
bool sph;
|
||||
sph = false; applyBoxBool(sph, "sphere"); if(sph) geometry = gSphere;
|
||||
sph = false; applyBoxBool(sph, "elliptic"); if(sph) geometry = gElliptic;
|
||||
applyBox(princess::reviveAt);
|
||||
applyBoxNum(princess::reviveAt, "@reviveAt");
|
||||
|
||||
applyBoxI(itDodeca);
|
||||
applyBoxI(itAmethyst);
|
||||
@ -783,13 +783,13 @@ EX void applyBoxes() {
|
||||
applyBoxM(moGadfly);
|
||||
|
||||
// 10.0:
|
||||
applyBoxNum(hinttoshow); // 258
|
||||
applyBoxNum(hinttoshow, "@hinttoshow"); // 258
|
||||
addinv(itOrbMirror);
|
||||
addinv(itGreenStone);
|
||||
list_invorb();
|
||||
applyBoxBool(inv::on, "inventory"); // 306
|
||||
#if CAP_INV
|
||||
applyBoxNum(inv::rseed);
|
||||
applyBoxNum(inv::rseed, "@inv-rseed");
|
||||
#else
|
||||
{ int u; applyBoxNum(u); }
|
||||
#endif
|
||||
@ -831,16 +831,16 @@ EX void applyBoxes() {
|
||||
applyBoxM(moMonk);
|
||||
|
||||
bool v2 = false;
|
||||
applyBoxBool(v2); if(loading && v2) variation = eVariation::goldberg;
|
||||
applyBox(gp::param.first);
|
||||
applyBox(gp::param.second);
|
||||
applyBoxBool(v2, "@variation"); if(loading && v2) variation = eVariation::goldberg;
|
||||
applyBoxNum(gp::param.first, "@gp-first");
|
||||
applyBoxNum(gp::param.second, "@gp-second");
|
||||
|
||||
v2 = false; applyBoxBool(v2); if(loading && v2) variation = eVariation::irregular;
|
||||
applyBox(irr::cellcount);
|
||||
applyBoxNum(irr::cellcount, "@irr-cellcount");
|
||||
|
||||
list_invorb();
|
||||
|
||||
applyBox(irr::bitruncations_performed);
|
||||
applyBoxNum(irr::bitruncations_performed, "@irr-bitruncations");
|
||||
|
||||
applyBoxI(itVarTreasure);
|
||||
applyBoxI(itBrownian);
|
||||
@ -858,8 +858,8 @@ EX void applyBoxes() {
|
||||
applyBoxM(moNarciss);
|
||||
applyBoxM(moMirrorSpirit);
|
||||
|
||||
applyBox(clearing::direct);
|
||||
applyBoxBignum(clearing::imputed);
|
||||
applyBoxNum(clearing::direct, "@clearing-direct");
|
||||
applyBoxBignum(clearing::imputed, "@clearing-imputed");
|
||||
|
||||
applyBoxOrb(itOrbImpact);
|
||||
applyBoxOrb(itOrbChaos);
|
||||
|
Loading…
Reference in New Issue
Block a user