mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
changed some achievement_gain to achievement_gain_once (this also fixes achievements awarded too soon)
This commit is contained in:
parent
a1053d7eea
commit
97fc244ba9
12
attack.cpp
12
attack.cpp
@ -324,7 +324,7 @@ EX void degradeDemons() {
|
|||||||
cell *c = dcal[i];
|
cell *c = dcal[i];
|
||||||
if(c->monst == moGreaterM || c->monst == moGreater) {
|
if(c->monst == moGreaterM || c->monst == moGreater) {
|
||||||
changes.ccell(c);
|
changes.ccell(c);
|
||||||
achievement_gain("DEMONSLAYER");
|
achievement_gain_once("DEMONSLAYER");
|
||||||
if(c->monst == moGreaterM) c->monst = moLesserM;
|
if(c->monst == moGreaterM) c->monst = moLesserM;
|
||||||
if(c->monst == moGreater) c->monst = moLesser;
|
if(c->monst == moGreater) c->monst = moLesser;
|
||||||
}
|
}
|
||||||
@ -846,7 +846,7 @@ EX void fightmessage(eMonster victim, eMonster attacker, bool stun, flagtype fla
|
|||||||
playSound(NULL, "hit-axe"+pick123());
|
playSound(NULL, "hit-axe"+pick123());
|
||||||
addMessage(XLAT("You slash %the1.", victim));
|
addMessage(XLAT("You slash %the1.", victim));
|
||||||
if(victim == moGoblin)
|
if(victim == moGoblin)
|
||||||
achievement_gain("GOBLINSWORD");
|
achievement_gain_once("GOBLINSWORD");
|
||||||
}
|
}
|
||||||
else if(victim == moKrakenT || victim == moDragonTail || victim == moDragonHead) {
|
else if(victim == moKrakenT || victim == moDragonTail || victim == moDragonHead) {
|
||||||
playSound(NULL, "hit-sword"+pick123());
|
playSound(NULL, "hit-sword"+pick123());
|
||||||
@ -991,7 +991,7 @@ EX bool attackMonster(cell *c, flagtype flags, eMonster killer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(m == moIvyRoot && ntk>tk)
|
if(m == moIvyRoot && ntk>tk)
|
||||||
achievement_gain("IVYSLAYER");
|
achievement_gain_once("IVYSLAYER");
|
||||||
|
|
||||||
return ntk > tk;
|
return ntk > tk;
|
||||||
}
|
}
|
||||||
@ -1237,7 +1237,7 @@ EX void stabbingAttack(cell *mf, cell *mt, eMonster who, int bonuskill IS(0)) {
|
|||||||
addMessage(XLAT("You trick %the1.", c->monst));
|
addMessage(XLAT("You trick %the1.", c->monst));
|
||||||
}
|
}
|
||||||
if(c->monst == moFlailer && isPrincess(who) && isUnarmed(who))
|
if(c->monst == moFlailer && isPrincess(who) && isUnarmed(who))
|
||||||
achievement_gain("PRINCESS_PACIFIST");
|
achievement_gain_once("PRINCESS_PACIFIST");
|
||||||
|
|
||||||
if(attackMonster(c, 0, who)) {
|
if(attackMonster(c, 0, who)) {
|
||||||
numflail++;
|
numflail++;
|
||||||
@ -1264,9 +1264,9 @@ EX void stabbingAttack(cell *mf, cell *mt, eMonster who, int bonuskill IS(0)) {
|
|||||||
if(who == moPlayer) {
|
if(who == moPlayer) {
|
||||||
if(numsh) achievement_count("STAB", numsh, 0);
|
if(numsh) achievement_count("STAB", numsh, 0);
|
||||||
|
|
||||||
if(numlance && numflail && numsh) achievement_gain("MELEE3");
|
if(numlance && numflail && numsh) achievement_gain_once("MELEE3");
|
||||||
|
|
||||||
if(numlance + numflail + numsh + numslash + bonuskill >= 5) achievement_gain("MELEE5");
|
if(numlance + numflail + numsh + numslash + bonuskill >= 5) achievement_gain_once("MELEE5");
|
||||||
|
|
||||||
if(numsh == 2) {
|
if(numsh == 2) {
|
||||||
if(lastdouble == turncount-1) achievement_count("STAB", 4, 0);
|
if(lastdouble == turncount-1) achievement_count("STAB", 4, 0);
|
||||||
|
16
complex.cpp
16
complex.cpp
@ -630,7 +630,7 @@ struct info {
|
|||||||
#if CAP_INV
|
#if CAP_INV
|
||||||
if(!inv::on || !inv::usedForbidden)
|
if(!inv::on || !inv::usedForbidden)
|
||||||
#endif
|
#endif
|
||||||
achievement_gain("PRINCESS1");
|
achievement_gain_once("PRINCESS1");
|
||||||
princess::saved = true;
|
princess::saved = true;
|
||||||
princess::everSaved = true;
|
princess::everSaved = true;
|
||||||
if(inv::on && !princess::reviveAt)
|
if(inv::on && !princess::reviveAt)
|
||||||
@ -639,9 +639,9 @@ struct info {
|
|||||||
}
|
}
|
||||||
if(newdist == OUT_OF_PRISON && princess::challenge) {
|
if(newdist == OUT_OF_PRISON && princess::challenge) {
|
||||||
addMessage(XLAT("Congratulations! Your score is %1.", its(i->value)));
|
addMessage(XLAT("Congratulations! Your score is %1.", its(i->value)));
|
||||||
achievement_gain("PRINCESS2");
|
achievement_gain_once("PRINCESS2");
|
||||||
if(!cheater) achievement_score(36, i->value);
|
if(!cheater) achievement_score(36, i->value);
|
||||||
showMissionScreen();
|
LATE( showMissionScreen(); )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i->princess->land == laDungeon && !saved && !nodungeon) {
|
if(i->princess->land == laDungeon && !saved && !nodungeon) {
|
||||||
@ -2318,8 +2318,6 @@ EX }
|
|||||||
|
|
||||||
bool gardener = false;
|
bool gardener = false;
|
||||||
|
|
||||||
bool lifebrought = false; // was Life brought to the Dead Caves?
|
|
||||||
|
|
||||||
EX void livecaves() {
|
EX void livecaves() {
|
||||||
vector<cell*>& allcells = currentmap->allcells();
|
vector<cell*>& allcells = currentmap->allcells();
|
||||||
int dcs = isize(allcells);
|
int dcs = isize(allcells);
|
||||||
@ -2449,7 +2447,7 @@ EX void livecaves() {
|
|||||||
c->wall = waCavewall;
|
c->wall = waCavewall;
|
||||||
if(c->land != laCaves && c->land != laDeadCaves && c->land != laEmerald && !gardener) {
|
if(c->land != laCaves && c->land != laDeadCaves && c->land != laEmerald && !gardener) {
|
||||||
gardener = true;
|
gardener = true;
|
||||||
achievement_gain("GARDENER");
|
achievement_gain_once("GARDENER");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2467,10 +2465,8 @@ EX void livecaves() {
|
|||||||
|
|
||||||
for(int i=0; i<isize(bringlife); i++) {
|
for(int i=0; i<isize(bringlife); i++) {
|
||||||
cell *c = bringlife[i];
|
cell *c = bringlife[i];
|
||||||
if(c->land == laDeadCaves && !lifebrought) {
|
if(c->land == laDeadCaves)
|
||||||
lifebrought = true;
|
achievement_gain_once("LIFEBRINGER");
|
||||||
achievement_gain("LIFEBRINGER");
|
|
||||||
}
|
|
||||||
if(c->wall == waDeadfloor) c->wall = waCavefloor;
|
if(c->wall == waDeadfloor) c->wall = waCavefloor;
|
||||||
if(c->wall == waDeadfloor2) c->wall = waCavewall;
|
if(c->wall == waDeadfloor2) c->wall = waCavewall;
|
||||||
if(c->wall == waDeadwall) c->wall = waCavewall;
|
if(c->wall == waDeadwall) c->wall = waCavewall;
|
||||||
|
@ -557,7 +557,7 @@ EX void moverefresh(bool turn IS(true)) {
|
|||||||
|
|
||||||
if(c->monst && !survivesChasm(c->monst) && c->monst != moReptile && normal_gravity_at(c)) {
|
if(c->monst && !survivesChasm(c->monst) && c->monst != moReptile && normal_gravity_at(c)) {
|
||||||
if(c->monst != moRunDog && c->land == laMotion)
|
if(c->monst != moRunDog && c->land == laMotion)
|
||||||
achievement_gain("FALLDEATH1");
|
achievement_gain_once("FALLDEATH1");
|
||||||
addMessage(XLAT("%The1 falls!", c->monst));
|
addMessage(XLAT("%The1 falls!", c->monst));
|
||||||
fallMonster(c, AF_FALL);
|
fallMonster(c, AF_FALL);
|
||||||
}
|
}
|
||||||
|
@ -464,10 +464,8 @@ EX void gainItem(eItem it) {
|
|||||||
if(it == itHyperstone && items[itHyperstone] == 10)
|
if(it == itHyperstone && items[itHyperstone] == 10)
|
||||||
achievement_victory(true);
|
achievement_victory(true);
|
||||||
|
|
||||||
if(chaosmode && gold() >= 300 && !chaosAchieved) {
|
if(chaosmode && gold() >= 300)
|
||||||
achievement_gain("CHAOS", rg::chaos);
|
achievement_gain_once("CHAOS", rg::chaos);
|
||||||
chaosAchieved = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if ISMOBILE==1
|
#if ISMOBILE==1
|
||||||
if(g < lastsafety + R30*3/2 && g2 >= lastsafety + R30*3/2)
|
if(g < lastsafety + R30*3/2 && g2 >= lastsafety + R30*3/2)
|
||||||
|
@ -116,7 +116,7 @@ EX void moveMonster(const movei& mi) {
|
|||||||
moveEffect(mi, m);
|
moveEffect(mi, m);
|
||||||
if(ct->wall == waCamelotMoat &&
|
if(ct->wall == waCamelotMoat &&
|
||||||
(m == moShark || m == moCShark || m == moGreaterShark))
|
(m == moShark || m == moCShark || m == moGreaterShark))
|
||||||
achievement_gain("MOATSHARK");
|
achievement_gain_once("MOATSHARK");
|
||||||
if(m == moTentacleGhost) {
|
if(m == moTentacleGhost) {
|
||||||
cf->monst = moTentacletail;
|
cf->monst = moTentacletail;
|
||||||
m = moGhost;
|
m = moGhost;
|
||||||
@ -313,7 +313,7 @@ EX void moveMonster(const movei& mi) {
|
|||||||
}
|
}
|
||||||
if(sword::at(ct) && canAttack(NULL, moPlayer, ct, m, AF_SWORD_INTO)) {
|
if(sword::at(ct) && canAttack(NULL, moPlayer, ct, m, AF_SWORD_INTO)) {
|
||||||
attackMonster(ct, AF_SWORD_INTO | AF_MSG, moPlayer);
|
attackMonster(ct, AF_SWORD_INTO | AF_MSG, moPlayer);
|
||||||
achievement_gain("GOSWORD");
|
achievement_gain_once("GOSWORD");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,7 +858,7 @@ EX void moveWorm(cell *c) {
|
|||||||
addMessage(XLAT("The sandworm explodes!"));
|
addMessage(XLAT("The sandworm explodes!"));
|
||||||
playSound(NULL, "explosion");
|
playSound(NULL, "explosion");
|
||||||
if(geometry == gZebraQuotient)
|
if(geometry == gZebraQuotient)
|
||||||
achievement_gain("ZEBRAWORM", rg::special_geometry);
|
achievement_gain_once("ZEBRAWORM", rg::special_geometry);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
14
pcmove.cpp
14
pcmove.cpp
@ -1433,7 +1433,7 @@ EX void sideAttack(cell *mf, int dir, eMonster who, int bonuskill) {
|
|||||||
|
|
||||||
if(who == moPlayer) {
|
if(who == moPlayer) {
|
||||||
int kills = tkills() - k + bonuskill;
|
int kills = tkills() - k + bonuskill;
|
||||||
if(kills >= 5) achievement_gain("MELEE5");
|
if(kills >= 5) achievement_gain_once("MELEE5");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1504,22 +1504,22 @@ EX void movecost(cell* from, cell *to, int phase) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(to->land ==laCrossroads4 && !got_crossroads && !geometry && (phase & 2) && !cheater) {
|
if(to->land ==laCrossroads4 && !got_crossroads && !geometry && (phase & 2) && !cheater) {
|
||||||
achievement_gain("CR4");
|
achievement_gain_once("CR4");
|
||||||
got_crossroads = true;
|
got_crossroads = true;
|
||||||
chaosUnlocked = true;
|
chaosUnlocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isHaunted(from->land) && !isHaunted(to->land) && (phase & 2)) {
|
if(isHaunted(from->land) && !isHaunted(to->land) && (phase & 2)) {
|
||||||
updateHi(itLotus, truelotus = items[itLotus]);
|
updateHi(itLotus, truelotus = items[itLotus]);
|
||||||
if(items[itLotus] >= 1) achievement_gain("LOTUS1");
|
if(items[itLotus] >= 1) achievement_gain_once("LOTUS1");
|
||||||
if(items[itLotus] >= (big_unlock ? 25 : 10)) achievement_gain("LOTUS2");
|
if(items[itLotus] >= (big_unlock ? 25 : 10)) achievement_gain_once("LOTUS2");
|
||||||
if(items[itLotus] >= (big_unlock ? 50 : 25)) achievement_gain("LOTUS3");
|
if(items[itLotus] >= (big_unlock ? 50 : 25)) achievement_gain_once("LOTUS3");
|
||||||
if(items[itLotus] >= 50 && !big_unlock) achievement_gain("LOTUS4");
|
if(items[itLotus] >= 50 && !big_unlock) achievement_gain_once("LOTUS4");
|
||||||
achievement_final(false);
|
achievement_final(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(geometry == gNormal && celldist(to) == 0 && !usedSafety && gold() >= 100 && (phase & 2))
|
if(geometry == gNormal && celldist(to) == 0 && !usedSafety && gold() >= 100 && (phase & 2))
|
||||||
achievement_gain("COMEBACK");
|
achievement_gain_once("COMEBACK");
|
||||||
|
|
||||||
bool tortoiseOK =
|
bool tortoiseOK =
|
||||||
to->land == from->land || to->land == laTortoise ||
|
to->land == from->land || to->land == laTortoise ||
|
||||||
|
@ -500,7 +500,7 @@ EX namespace yendor {
|
|||||||
addMessage(XLAT("You feel that these directions are %1 turns old.", yi[byi].age.get_str(100)));
|
addMessage(XLAT("You feel that these directions are %1 turns old.", yi[byi].age.get_str(100)));
|
||||||
if(yii != byi) {
|
if(yii != byi) {
|
||||||
yii = byi;
|
yii = byi;
|
||||||
achievement_gain("YENDOR1");
|
achievement_gain_once("YENDOR1");
|
||||||
playSound(yendor, "pickup-yendor");
|
playSound(yendor, "pickup-yendor");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user