1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-26 02:14:48 +00:00

fixup to itOrbMorph

This commit is contained in:
Zeno Rogue
2025-10-10 13:02:25 +02:00
parent 6b68756a0e
commit c4a39a4715

View File

@@ -1136,9 +1136,7 @@ void stun_attack(cell *dest) {
checkmoveO();
}
void poly_attack(cell *dest) {
playSound(dest, "orb-ranged");
eMonster orig = dest->monst;
EX eMonster pick_poly_monster(eMonster orig) {
auto polymonsters = {
moYeti, moRunDog, moRanger,
moMonkey, moCultist,
@@ -1149,11 +1147,18 @@ void poly_attack(cell *dest) {
int ssf = 0;
eMonster target = *(polymonsters.begin() + hrand(isize(polymonsters)));
for(eMonster m: polymonsters)
if(kills[m] && m != dest->monst) {
if(kills[m] && m != orig) {
ssf += kills[m];
if(hrand(ssf) < kills[m])
target = m;
}
return target;
}
void poly_attack(cell *dest) {
playSound(dest, "orb-ranged");
eMonster orig = dest->monst;
eMonster target = pick_poly_monster(orig);
addMessage(XLAT("You polymorph %the1 into %the2!", dest->monst, target));
dest->monst = target;
if(!dest->stuntime) dest->stuntime = 1;