mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-22 22:10:20 +00:00
refactored to use isDie if applicable
This commit is contained in:
parent
b63a70f279
commit
be5194958e
@ -105,7 +105,7 @@ EX bool canAttack(cell *c1, eMonster m1, cell *c2, eMonster m2, flagtype flags)
|
||||
|
||||
if(m1 == moArrowTrap && arrow_stuns(m2)) return true;
|
||||
|
||||
if(among(m2, moAnimatedDie, moAngryDie) && !(flags & (AF_MAGIC | AF_CRUSH))) return false;
|
||||
if(isDie(m2) && !(flags & (AF_MAGIC | AF_CRUSH))) return false;
|
||||
|
||||
if(among(m2, moAltDemon, moHexDemon, moPair, moCrusher, moNorthPole, moSouthPole, moMonk) && !(flags & (AF_EAT | AF_MAGIC | AF_BULL | AF_CRUSH)))
|
||||
return false;
|
||||
|
@ -1601,7 +1601,7 @@ void celldrawer::draw_features() {
|
||||
poly_outline = OUTLINE_DEFAULT;
|
||||
}
|
||||
|
||||
else if(among(c->wall, waRichDie, waHappyDie)) {
|
||||
else if(isDie(c->wall)) {
|
||||
color_t col = darkena(winf[c->wall].color, 0, 0xFF);
|
||||
|
||||
ld footphase;
|
||||
|
@ -1120,7 +1120,7 @@ EX namespace dice {
|
||||
}
|
||||
|
||||
EX bool on(cell *c) {
|
||||
return among(c->wall, waRichDie, waHappyDie) || among(c->monst, moAnimatedDie, moAngryDie);
|
||||
return isDie(c->wall) || isDie(c->monst);
|
||||
}
|
||||
|
||||
EX void roll(movei mi) {
|
||||
|
2
game.cpp
2
game.cpp
@ -379,7 +379,7 @@ EX void pushThumper(const movei& mi) {
|
||||
cto->wall = waCrateOnTarget;
|
||||
th->wall = waCrateTarget;
|
||||
}
|
||||
else if(among(w, waRichDie, waHappyDie)) {
|
||||
else if(isDie(w)) {
|
||||
th->wall = waNone;
|
||||
cto->wall = w;
|
||||
dice::roll(mi);
|
||||
|
@ -2886,7 +2886,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
|
||||
// golems, knights, and hyperbugs don't face the player (mondir-controlled)
|
||||
// also whatever in the lineview mode, and whatever in the quotient geometry
|
||||
|
||||
else if(among(c->monst, moAnimatedDie, moAngryDie)) {
|
||||
else if(isDie(c->monst)) {
|
||||
transmatrix U = inverse_shift(Vparam, Vs);
|
||||
U = rgpushxto0(tC0(U));
|
||||
die_target = Vparam;
|
||||
|
@ -103,7 +103,7 @@ EX void moveEffect(const movei& mi, eMonster m) {
|
||||
tortoise::move_baby(cf, ct);
|
||||
}
|
||||
|
||||
if(among(m, moAnimatedDie, moAngryDie) && mi.proper())
|
||||
if(isDie(m) && mi.proper())
|
||||
dice::roll(mi);
|
||||
}
|
||||
|
||||
@ -1157,7 +1157,7 @@ EX void groupmove2(const movei& mi, eMonster movtype, flagtype mf) {
|
||||
|
||||
onpath(from, 0);
|
||||
|
||||
if(among(mi.t->monst, moAnimatedDie, moAngryDie)) {
|
||||
if(isDie(mi.t->monst)) {
|
||||
/* other dice will not pathfind through the original cell */
|
||||
/* this makes it easier for the player to roll dice correctly */
|
||||
onpath(c, 0);
|
||||
|
@ -544,7 +544,7 @@ EX bool passable_for(eMonster m, cell *w, cell *from, flagtype extra) {
|
||||
if(extra & P_ONPLAYER) {
|
||||
if(isPlayerOn(w)) return true;
|
||||
}
|
||||
if(from && among(from->monst, moAnimatedDie, moAngryDie)) {
|
||||
if(from && isDie(from->monst)) {
|
||||
bool ok = false;
|
||||
for(int i=0; i<from->type; i++) {
|
||||
if(from->move(i) != w) continue;
|
||||
|
@ -2462,7 +2462,7 @@ void activateMonstersAt(cell *c) {
|
||||
}
|
||||
if(c->monst && isMimic(c->monst)) c->monst = moNone;
|
||||
// mimics are awakened by awakenMimics
|
||||
if(c->monst && !isIvy(c) && !isWorm(c) && !isMutantIvy(c) && !isKraken(c->monst) && c->monst != moPrincess && c->monst != moHunterGuard && !among(c->monst, moAnimatedDie, moAngryDie)) {
|
||||
if(c->monst && !isIvy(c) && !isWorm(c) && !isMutantIvy(c) && !isKraken(c->monst) && c->monst != moPrincess && c->monst != moHunterGuard && !isDie(c->monst)) {
|
||||
// awaken as a monster
|
||||
monster *enemy = new monster;
|
||||
enemy->at = Id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user