Orb of Vaulting and Dark Frogs can now jump over trees and explosive barrels

This commit is contained in:
Zeno Rogue 2020-03-01 00:19:56 +01:00
parent 3f5af1f5bd
commit 561ce1a141
3 changed files with 21 additions and 3 deletions

View File

@ -578,6 +578,8 @@ EX void moverefresh(bool turn IS(true)) {
else if(isFire(c)) {
if(c->monst == moSalamander) c->stuntime = max<int>(c->stuntime, 1);
else if(c->monst == moVaulter && c->mondir == JUMP)
c->mondir = NODIR;
else if(c->monst && !survivesFire(c->monst) && !isWorm(c->monst)) {
addMessage(XLAT("%The1 burns!", c->monst));
if(isBull(c->monst)) {

View File

@ -159,8 +159,12 @@ EX void moveMonster(const movei& mi) {
if(mi.d == JUMP && m == moVaulter) {
cell *cm = common_neighbor(cf, ct);
if(cm->wall == waShrub) cm->wall = waNone;
if(cm->wall == waSmallTree) cm->wall = waNone;
if(cm->wall == waBigTree) cm->wall = waSmallTree;
if(cm->wall == waExplosiveBarrel) explodeBarrel(cm);
if(cm->monst)
attackMonster(cm, AF_NORMAL | AF_MSG | AF_GETPLAYER, m);
ct->mondir = JUMP;
}
if(isLeader(m)) {

View File

@ -1127,13 +1127,14 @@ EX int check_vault(cell *cf, cell *ct, flagtype flags, cell*& jumpthru) {
}
jumpthru = c2;
if(!c2) return 0;
if(!c2->monst && c2->wall != waShrub) return 1;
bool cutwall = among(c2->wall, waShrub, waExplosiveBarrel, waSmallTree, waBigTree);
if(!c2->monst && !cutwall) return 1;
bool for_monster = !(flags & P_ISPLAYER);
if(for_monster && c2->monst && frog_power(c2->monst) && !items[itOrbDiscord]) return 1;
if(c3) return 2;
if(c2->wall != waShrub && !passable(c2, cwt.at, flags | P_JUMP1 | P_MONSTER)) return 3;
if(!cutwall && !passable(c2, cwt.at, flags | P_JUMP1 | P_MONSTER)) return 3;
if(!passable(ct, c2, flags | P_JUMP2)) return 4;
if(c2->wall != waShrub && !canAttack(cwt.at, moPlayer, c2, c2->monst, 0)) return 5;
if(!cutwall && !canAttack(cwt.at, moPlayer, c2, c2->monst, 0)) return 5;
return 6;
}
@ -1254,6 +1255,17 @@ EX eItem targetRangedOrb(cell *c, orbAction a) {
addMessage(XLAT("You chop down the shrub."));
jumpthru->wall = waNone;
}
if(jumpthru->wall == waSmallTree) {
addMessage(XLAT("You chop down the tree."));
jumpthru->wall = waNone;
}
if(jumpthru->wall == waBigTree) {
addMessage(XLAT("You start chopping down the tree."));
jumpthru->wall = waSmallTree;
}
if(jumpthru->wall == waExplosiveBarrel) {
explodeBarrel(jumpthru);
}
if(m)
attackMonster(jumpthru, AF_NORMAL | AF_MSG, moPlayer);
k = tkills() - k;