mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-08 01:14:07 +00:00
Orb of Air/Dice interaction
This commit is contained in:
parent
f2ebcc93ea
commit
6f18ef8cf9
15
orbs.cpp
15
orbs.cpp
@ -1078,6 +1078,7 @@ void placeIllusion(cell *c) {
|
|||||||
void blowoff(const movei& mi) {
|
void blowoff(const movei& mi) {
|
||||||
auto& cf = mi.s;
|
auto& cf = mi.s;
|
||||||
auto& ct = mi.t;
|
auto& ct = mi.t;
|
||||||
|
bool die = cf->wall == waRichDie;
|
||||||
playSound(ct, "orb-ranged");
|
playSound(ct, "orb-ranged");
|
||||||
if(cf->monst)
|
if(cf->monst)
|
||||||
addMessage(XLAT("You blow %the1 away!", cf->monst));
|
addMessage(XLAT("You blow %the1 away!", cf->monst));
|
||||||
@ -1099,6 +1100,19 @@ void blowoff(const movei& mi) {
|
|||||||
if(ct->item) ct->item = itNone;
|
if(ct->item) ct->item = itNone;
|
||||||
moveItem(cf, ct, true);
|
moveItem(cf, ct, true);
|
||||||
}
|
}
|
||||||
|
if(ct->monst == moAnimatedDie && dice::data[ct].happy() > 0) {
|
||||||
|
ct->monst = moNone;
|
||||||
|
ct->wall = waBlandDie;
|
||||||
|
if(ct->land == laDice && cf->land == laDice) {
|
||||||
|
cf->item = itDice;
|
||||||
|
addMessage(XLAT("The die is now happy, and you are rewarded!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(die && ct->wall == waBlandDie) {
|
||||||
|
/* pushMonster already awarded us -- place the reward on cf instead */
|
||||||
|
cf->item = itDice;
|
||||||
|
items[itDice]--;
|
||||||
|
}
|
||||||
items[itOrbAir]--;
|
items[itOrbAir]--;
|
||||||
createNoise(2);
|
createNoise(2);
|
||||||
bfs();
|
bfs();
|
||||||
@ -1133,6 +1147,7 @@ EX movei blowoff_destination(cell *c, int& di) {
|
|||||||
if(d<c->type) for(int e=d; e<d+c->type; e++) {
|
if(d<c->type) for(int e=d; e<d+c->type; e++) {
|
||||||
int di = e % c->type;
|
int di = e % c->type;
|
||||||
cell *c2 = c->move(di);
|
cell *c2 = c->move(di);
|
||||||
|
if((c->monst == moAnimatedDie || c->wall == waBlandDie || c->wall == waRichDie) && ctof(c2)) continue;
|
||||||
if(c2 && c2->cpdist > c->cpdist && passable(c2, c, P_BLOW)) return movei(c, c2, di);
|
if(c2 && c2->cpdist > c->cpdist && passable(c2, c, P_BLOW)) return movei(c, c2, di);
|
||||||
}
|
}
|
||||||
return movei(c, c, NO_SPACE);
|
return movei(c, c, NO_SPACE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user