mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-26 10:24:49 +00:00
fixup to itOrbMorph
This commit is contained in:
13
orbs.cpp
13
orbs.cpp
@@ -1136,9 +1136,7 @@ void stun_attack(cell *dest) {
|
|||||||
checkmoveO();
|
checkmoveO();
|
||||||
}
|
}
|
||||||
|
|
||||||
void poly_attack(cell *dest) {
|
EX eMonster pick_poly_monster(eMonster orig) {
|
||||||
playSound(dest, "orb-ranged");
|
|
||||||
eMonster orig = dest->monst;
|
|
||||||
auto polymonsters = {
|
auto polymonsters = {
|
||||||
moYeti, moRunDog, moRanger,
|
moYeti, moRunDog, moRanger,
|
||||||
moMonkey, moCultist,
|
moMonkey, moCultist,
|
||||||
@@ -1149,11 +1147,18 @@ void poly_attack(cell *dest) {
|
|||||||
int ssf = 0;
|
int ssf = 0;
|
||||||
eMonster target = *(polymonsters.begin() + hrand(isize(polymonsters)));
|
eMonster target = *(polymonsters.begin() + hrand(isize(polymonsters)));
|
||||||
for(eMonster m: polymonsters)
|
for(eMonster m: polymonsters)
|
||||||
if(kills[m] && m != dest->monst) {
|
if(kills[m] && m != orig) {
|
||||||
ssf += kills[m];
|
ssf += kills[m];
|
||||||
if(hrand(ssf) < kills[m])
|
if(hrand(ssf) < kills[m])
|
||||||
target = 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));
|
addMessage(XLAT("You polymorph %the1 into %the2!", dest->monst, target));
|
||||||
dest->monst = target;
|
dest->monst = target;
|
||||||
if(!dest->stuntime) dest->stuntime = 1;
|
if(!dest->stuntime) dest->stuntime = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user