hugosaintemarie / magic-maze

Online version of board game "Magic Maze"
https://magicmaze.herokuapp.com
MIT License
20 stars 11 forks source link

Vortex implementation is incorrect and forces the hero to be on an existing vortex #45

Closed rcjsuen closed 3 years ago

rcjsuen commented 3 years ago

According to the rules...

The player with the Use a Vortex action (and only this player) can move any Hero pawn from wherever it is to any Vortex space of its colour. This is a very quick way to travel long distances.

At the moment, the player with the vortex role can only move a hero from one vortex to another which is incorrect. The player should always be able to move an orange hero to an orange vortex irregardless of where the orange hero currently is.

hugosaintemarie commented 3 years ago

Wow, I was doubting this at first but you're absolutely right! A friend of mine who taught me the game 4 years ago must have been wrong and I never checked again (and taught it wrong to many friends ahah). This means I've always played a harder variant 🙃

However, scenario 13 says this:

In order to distract the guards, the four Hero pawns can never be in the same dimension all at the same time. A Hero pawn can only travel between the dimensions with the Use a Vortex action, moving from a Vortex space of its colour in the dimension where it is to a Vortex space of its colour in the other dimension. This is the only valid way to use a vortex during this scenario.

So I guess we shouldn't entirely remove the condition (hero is already standing on a vortex his color) but add another condition: "are we playing scenario 13?". What do you think?

hugosaintemarie commented 3 years ago

I think the condition is this whole line right here

https://github.com/ashugeo/magic-maze/blob/a50502eb0865af78cf67523036e1449d47cff8f3/src/client/play/js/hero.js#L66

It would need to be matched (&&) with game.isScenario(13) I guess.

So that would probably be

if (!game.isScenario(13) || (game.isScenario(13) && item && item.type === 'vortex' && item.color === this.color)) { }

am I right?

rcjsuen commented 3 years ago

So I guess we shouldn't entirely remove the condition (hero is already standing on a vortex his color) but add another condition: "are we playing scenario 13?". What do you think?

Good call about scenario 13...and it seems that we would also need to take scenario 16 into consideration.

The entire Vortex system is out of service during the whole game. Therefore, you can never use the Use a Vortex action.

However...we currently only support scenarios 1 to 7.

https://github.com/ashugeo/magic-maze/blob/e8e8dbbae709e84db3ec7341dae2629620a1fe16/src/client/play/js/user.js#L49

https://github.com/ashugeo/magic-maze/blob/e8e8dbbae709e84db3ec7341dae2629620a1fe16/src/client/play/data/scenarios.json#L1-L24

So I would almost say to skip the addition of the isScenario(13) checks until proper support is implemented for it. What do you think?

hugosaintemarie commented 3 years ago

So I would almost say to skip the addition of the isScenario(13) checks until proper support is implemented for it. What do you think?

Absolutely 👌