I've been playing about with (4) for a little bit, since it's the easiest of the three to implement (and is still consistent with characters moving as they normally would *before* their sword smashes things). Looks to require the following code changes:
To allow Mimics to bump things if Beethro bumps something at the same time (which is what I assume the room that Doom referred to uses, since without this it'd allow Beethro to smash a mirror while a Mimic doesn't move at all), you'd add this near the start of the Mimic's Process subroutine:
if (this->pCurrentGame->IsPlayerAt(this->pCurrentGame->swordsman.wPrevX,
this->pCurrentGame->swordsman.wPrevY))
{
dx=dy=0;
this->wPrevX = this->wX;
this->wPrevY = this->wY;
this->wSwordMovement = CSwordsman::GetSwordMovement(nLastCommand, this->wO);
if (nLastCommand != CMD_C && nLastCommand != CMD_CC && this->wSwordMovement != this->wO)
this->wSwordMovement = NO_ORIENTATION;
} else {
In order to get Mimics to smash mirrors when a full move is made, you'd need this at the end of the Process subroutine (assuming the Mimic didn't move during this turn):
} else {
this->wPrevX = this->wX;
this->wPrevY = this->wY;
this->wSwordMovement = CSwordsman::GetSwordMovement(nLastCommand, this->wO);
if (nLastCommand != CMD_C && nLastCommand != CMD_CC && this->wSwordMovement != this->wO)
this->wSwordMovement = NO_ORIENTATION;
}
}
//Light any fuse stood on.
room.LightFuse(CueEvents, this->wX, this->wY, true);
I can look into the other possibilities as well, but they're a lot trickier to deal with given how the code's currently laid out.
===
By the way, with regards to Doom's example, here's how both fixes together listed in this post would affect it:
1) If the Mimic is on the asterisk with its sword facing NW, then if Beethro moves in any direction but NW, things will happen as they currently do now.
2) If Beethro moves NW but bumps something, the Mimic will 'mimic' the bump and smash the mirror as a result. If Beethro bumps a Master Wall, then of course the turn just won't happen.
3) If Beethro moves NW and successfully moves, the Mimic will move N and will thus not smash the mirror.
4) If the Mimic is just east of the mirror instead with its sword facing W, then the mirror will be smashed if Beethro moves W, no matter whether it was via a bump or a successful move.
This should be consistent with how both Mimics already naturally move and how swords interact with mirrors during a move. (2) is the natural consequence of the first fix listed (based around the mechanic Doom mentioned), and (3) is the consequence of the second fix listed. How does that sound?
===
EDIT: Recently realised something. First, Mimics don't always have to have swords to bump things. So if Mimics are being allowed to bump things when they have their swords, they should probably turn to face the direction they bumped if they don't have a sword.
The code to do this should be:
const UINT wMovementO = nGetO(dx, dy);
if (this->bFrozen) //frozen by aumtlich gaze?
dx = dy = 0;
CDbRoom& room = *(this->pCurrentGame->pRoom);
// Did the nLastCommand successfully move the swordsman.
// If not, then set dx/dy to zero so mimics don't move
if (this->pCurrentGame->IsPlayerAt(this->pCurrentGame->swordsman.wPrevX,
this->pCurrentGame->swordsman.wPrevY))
{
dx=dy=0;
this->wPrevX = this->wX;
this->wPrevY = this->wY;
this->wSwordMovement = CSwordsman::GetSwordMovement(nLastCommand, this->wO);
if (nLastCommand != CMD_C && nLastCommand != CMD_CC && this->wSwordMovement != this->wO)
this->wSwordMovement = NO_ORIENTATION;
if (!HasSword() && wMovementO != NO_ORIENTATION)
this->wO = wMovementO;
} else {
And then we can use the same HasSword and wMovementO check at the end for testing when Beethro *does* move but the Mimic can't.
===
While I'm thinking about it, it seems strange that you can bump things whilst being frozen by an Aumtlich's gaze. I mean, turning is one thing, but bumping shouldn't be possible. I mean, you can't even trigger the "
Player Bumps Obstacle"
event when frozen by an Aumtlich. Could be worth looking into.
EDIT: Actually, given you can break mirrors through Force Arrows using this, it's possibly not so bad. So Aumtlich would be consistent with Force Arrow use.
[Last edited by TFMurphy at 10-25-2007 02:35 PM]