1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-20 03:54:47 +00:00

Orb of the Sword can now kill yourself through mirror or topology

This commit is contained in:
Zeno Rogue 2022-06-17 10:40:26 +02:00
parent 7a7a982b33
commit c6369ac832
3 changed files with 12 additions and 1 deletions

View File

@ -1202,6 +1202,8 @@ EX void killHardcorePlayer(int id, flagtype flags) {
}
}
EX bool suicidal;
EX void killThePlayer(eMonster m, int id, flagtype flags) {
if(markOrb(itOrbShield)) return;
if(shmup::on) {
@ -1231,6 +1233,7 @@ EX void killThePlayer(eMonster m, int id, flagtype flags) {
else {
// printf("confused!\n");
addMessage(XLAT("%The1 is confused!", m));
changes.value_set(suicidal, true);
}
}
@ -1283,7 +1286,8 @@ EX void stabbingAttack(movei mi, eMonster who, int bonuskill IS(0)) {
bool stabthere = false, away = true;
if(logical_adjacent(mt, who, c)) stabthere = true, away = false;
if(inmirror(c)) c = mirror::reflect(c).at;
if(stabthere && c->wall == waExplosiveBarrel && markOrb(itOrbThorns))
explodeBarrel(c);

View File

@ -241,6 +241,10 @@ EX bool monstersnear_aux() {
/** like monstersnear but add the potential moves of other players into account */
EX bool monstersnear_add_pmi(player_move_info pmi0) {
if(suicidal) {
who_kills_me = moPlayer;
return true;
}
pmi.push_back(pmi0);
bool b = monstersnear_aux();
pmi.pop_back();

View File

@ -248,6 +248,7 @@ bool pcmove::movepcto() {
mip.t = NULL;
switchplaces = false;
warning_shown = false;
suicidal = false;
if(d == MD_USE_ORB)
return targetRangedOrb(multi::whereto[multi::cpid].tgt, roMultiGo);
@ -1495,6 +1496,8 @@ EX bool swordAttack(cell *mt, eMonster who, cell *c, int bb) {
}
if(c->wall == waExplosiveBarrel)
explodeBarrel(c);
if(!peace::on && isPlayerOn(c) && whichPlayerOn(c) != multi::cpid && !markOrb(itOrbEmpathy)) killThePlayer(moPlayer, whichPlayerOn(mt), 0);
if(!peace::on && mt == c && !markOrb(itOrbEmpathy)) killThePlayer(moPlayer, multi::cpid, 0);
if(!peace::on && canAttack(mt, who, c, m, AF_SWORD)) {
changes.ccell(c);
markOrb(bb ? itOrbSword2: itOrbSword);