YASC codes work better if killed on a 10+ tile

This commit is contained in:
Zeno Rogue 2024-03-21 22:49:50 +01:00
parent fdf83820f2
commit a650fe7faf
2 changed files with 18 additions and 2 deletions

View File

@ -399,6 +399,11 @@ EX void create_yasc_message() {
println(hlog, "YASC_MESSAGE: ", yasc_message);
}
int yasc_recode(int x) {
if(cwt.at->type < 10 || x == 0) return x;
return yasc_recode(x / 10) * 100 + (x % 10);
};
EX void checkmove() {
if(dual::state == 2) return;
@ -443,7 +448,7 @@ EX void checkmove() {
yasc_code = 0;
for(int i=0; i<cwt.at->type; i++)
yasc_code += move_issues[i].type;
yasc_code += yasc_recode(move_issues[i].type);
if(!canmove && bow::crossbow_mode() && !items[itCrossbow]) canmove = bow::have_bow_target();

View File

@ -32,6 +32,17 @@ EX string getgametime_s(int timespent IS(getgametime())) {
EX bool display_yasc_codes;
string formatted_yasc_code() {
if(yasc_code < 100000) return its(yasc_code);
int y = yasc_code;
string out;
while(y >= 100) {
out = "-" + its(y%100) + out;
y /= 100;
}
return its(y) + out;
}
string timeline() {
string s;
if(shmup::on)
@ -39,7 +50,7 @@ string timeline() {
else {
s = XLAT("%1 turns (%2)", its(turncount), getgametime_s());
if(display_yasc_codes)
s+= XLAT(" YASC code: ") + its(yasc_code);
s+= XLAT(" YASC code: ") + formatted_yasc_code();
}
return s;
}