mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	Orb of the Sword can now kill yourself through mirror or topology
This commit is contained in:
		| @@ -1202,6 +1202,8 @@ EX void killHardcorePlayer(int id, flagtype flags) { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | EX bool suicidal; | ||||||
|  |  | ||||||
| EX void killThePlayer(eMonster m, int id, flagtype flags) { | EX void killThePlayer(eMonster m, int id, flagtype flags) { | ||||||
|   if(markOrb(itOrbShield)) return; |   if(markOrb(itOrbShield)) return; | ||||||
|   if(shmup::on) { |   if(shmup::on) { | ||||||
| @@ -1231,6 +1233,7 @@ EX void killThePlayer(eMonster m, int id, flagtype flags) { | |||||||
|   else { |   else { | ||||||
| //  printf("confused!\n"); | //  printf("confused!\n"); | ||||||
|     addMessage(XLAT("%The1 is confused!", m)); |     addMessage(XLAT("%The1 is confused!", m)); | ||||||
|  |     changes.value_set(suicidal, true); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -1283,6 +1286,7 @@ EX void stabbingAttack(movei mi, eMonster who, int bonuskill IS(0)) { | |||||||
|      |      | ||||||
|     bool stabthere = false, away = true; |     bool stabthere = false, away = true; | ||||||
|     if(logical_adjacent(mt, who, c)) stabthere = true, away = false; |     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)) |     if(stabthere && c->wall == waExplosiveBarrel && markOrb(itOrbThorns)) | ||||||
|       explodeBarrel(c); |       explodeBarrel(c); | ||||||
|   | |||||||
| @@ -241,6 +241,10 @@ EX bool monstersnear_aux() { | |||||||
|  |  | ||||||
| /** like monstersnear but add the potential moves of other players into account */ | /** like monstersnear but add the potential moves of other players into account */ | ||||||
| EX bool monstersnear_add_pmi(player_move_info pmi0) { | EX bool monstersnear_add_pmi(player_move_info pmi0) { | ||||||
|  |   if(suicidal) { | ||||||
|  |     who_kills_me = moPlayer; | ||||||
|  |     return true; | ||||||
|  |     } | ||||||
|   pmi.push_back(pmi0); |   pmi.push_back(pmi0); | ||||||
|   bool b = monstersnear_aux(); |   bool b = monstersnear_aux(); | ||||||
|   pmi.pop_back(); |   pmi.pop_back(); | ||||||
|   | |||||||
| @@ -248,6 +248,7 @@ bool pcmove::movepcto() { | |||||||
|   mip.t = NULL; |   mip.t = NULL; | ||||||
|   switchplaces = false; |   switchplaces = false; | ||||||
|   warning_shown = false; |   warning_shown = false; | ||||||
|  |   suicidal = false; | ||||||
|  |  | ||||||
|   if(d == MD_USE_ORB)  |   if(d == MD_USE_ORB)  | ||||||
|     return targetRangedOrb(multi::whereto[multi::cpid].tgt, roMultiGo); |     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) |   if(c->wall == waExplosiveBarrel) | ||||||
|     explodeBarrel(c); |     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)) { |   if(!peace::on && canAttack(mt, who, c, m, AF_SWORD)) { | ||||||
|     changes.ccell(c); |     changes.ccell(c); | ||||||
|     markOrb(bb ? itOrbSword2: itOrbSword); |     markOrb(bb ? itOrbSword2: itOrbSword); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue