1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-27 02:20:36 +00:00

YASC messages in shmup

This commit is contained in:
Zeno Rogue 2024-02-23 01:09:22 +01:00
parent de5ddc3034
commit bf512e39ce

View File

@ -263,6 +263,7 @@ void killMonster(monster* m, eMonster who_kills, flagtype flags = 0) {
if(m->dead) return; if(m->dead) return;
m->dead = true; m->dead = true;
if(isPlayer(m) && m->fragoff < curtime) { if(isPlayer(m) && m->fragoff < curtime) {
yasc_message = XLAT("killed by %the1", who_kills);
if(multi::cpid == m->pid) if(multi::cpid == m->pid)
multi::suicides[multi::cpid]++; multi::suicides[multi::cpid]++;
else if(multi::cpid >= 0) else if(multi::cpid >= 0)
@ -439,9 +440,11 @@ void shootBullet(monster *m) {
} }
EX void killThePlayer(eMonster m) { EX void killThePlayer(eMonster m) {
if(cpid >= 0 && cpid < MAXPLAYER && pc[cpid]) if(cpid >= 0 && cpid < MAXPLAYER && pc[cpid]) {
yasc_message = XLAT("killed by %the1", m);
pc[cpid]->dead = true; pc[cpid]->dead = true;
} }
}
monster *playerCrash(monster *who, shiftpoint where) { monster *playerCrash(monster *who, shiftpoint where) {
if(who->isVirtual) return NULL; if(who->isVirtual) return NULL;
@ -1238,6 +1241,7 @@ void movePlayer(monster *m, int delta) {
if(c2->wall == waMineMine && !markOrb(itOrbAether) && !markOrb(itOrbWinter)) { if(c2->wall == waMineMine && !markOrb(itOrbAether) && !markOrb(itOrbWinter)) {
items[itOrbLife] = 0; items[itOrbLife] = 0;
if(!m->dead) yasc_message = XLAT("stepped on a mine");
m->dead = true; m->dead = true;
} }
#if CAP_COMPLEX2 #if CAP_COMPLEX2
@ -1283,16 +1287,27 @@ void movePlayer(monster *m, int delta) {
} }
if(!markOrb(itOrbAether)) { if(!markOrb(itOrbAether)) {
if(m->base->wall == waChasm || m->base->wall == waClosedGate) if(m->base->wall == waChasm) {
if(!m->dead) yasc_message = XLAT("fell into %the1", m->base->wall);
m->dead = true; m->dead = true;
}
if(isWatery(m->base) && !m->inBoat && !markOrb(itOrbFish)) if(m->base->wall == waClosedGate) {
if(!m->dead) yasc_message = XLAT("killed by %the1", m->base->wall);
m->dead = true; m->dead = true;
}
if(isFireOrMagma(m->base) && !markOrb(itOrbWinter)) if(isWatery(m->base) && !m->inBoat && !markOrb(itOrbFish)) {
if(!m->dead) yasc_message = XLAT("drowned in %the1", m->base->wall);
m->dead = true; m->dead = true;
} }
if(isFireOrMagma(m->base) && !markOrb(itOrbWinter)) {
if(!m->dead) yasc_message = XLAT("burnt in %the1", m->base->wall);
m->dead = true;
}
}
landvisited[m->base->land] = true; landvisited[m->base->land] = true;
playerfire[cpid] = false; playerfire[cpid] = false;
@ -2250,8 +2265,10 @@ void moveMonster(monster *m, int delta) {
if(!peace::on) if(!peace::on)
for(int i=0; i<players; i++) for(int i=0; i<players; i++)
if(crashintomon == pc[i]) if(crashintomon == pc[i]) {
yasc_message = XLAT("killed by %the1", m->type);
pc[i]->dead = true; pc[i]->dead = true;
}
if(peace::on) ; if(peace::on) ;