1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-09 23:49:53 +00:00

parser:: lands_at function

This commit is contained in:
Zeno Rogue 2024-07-27 18:40:41 +02:00
parent 063dc65e3c
commit 2ffda6da75
2 changed files with 12 additions and 2 deletions

View File

@ -284,7 +284,7 @@ EX bool required_for_hyperstones(eItem ttype) {
return true; return true;
} }
EX void countHyperstoneQuest(int& i1, int& i2) { EX void count_at_level(int& i1, int& i2, int level) {
i1 = 0; i2 = 0; i1 = 0; i2 = 0;
generateLandList(isLandIngame); generateLandList(isLandIngame);
for(eLand l: landlist) { for(eLand l: landlist) {
@ -294,10 +294,14 @@ EX void countHyperstoneQuest(int& i1, int& i2) {
if(l == laMirrorOld && isLandIngame(laMirror)) continue; if(l == laMirrorOld && isLandIngame(laMirror)) continue;
eItem ttype = treasureType(l); eItem ttype = treasureType(l);
if(!required_for_hyperstones(ttype)) continue; if(!required_for_hyperstones(ttype)) continue;
i2++; if(items[ttype] >= R10) i1++; i2++; if(items[ttype] >= level) i1++;
} }
} }
EX void countHyperstoneQuest(int& i1, int& i2) {
count_at_level(i1, i2, R10);
}
EX bool hyperstonesUnlocked() { EX bool hyperstonesUnlocked() {
int i1, i2; int i1, i2;
if(ls::single() && isCrossroads(specialland)) return true; if(ls::single() && isCrossroads(specialland)) return true;

View File

@ -367,6 +367,12 @@ cld exp_parser::parse(int prio) {
res = texture::get_txp(real(val), imag(val), int(real(extra_params["p"]) + .5)-1); res = texture::get_txp(real(val), imag(val), int(real(extra_params["p"]) + .5)-1);
} }
#endif #endif
else if(eat("lands_at(")) {
int score = iparse(0);
force_eat(")");
int i1, i2; count_at_level(i1, i2, score);
return i1;
}
else if(next() == '(') at++, res = parsepar(); else if(next() == '(') at++, res = parsepar();
else { else {
string number = next_token(); string number = next_token();