Skip to content

Commit

Permalink
Merge pull request FreezingMoon#2516 from IsThatRay/2155-lead-players…
Browse files Browse the repository at this point in the history
…-to-own-materializable-

Lead players to own materializable, fixes FreezingMoon#2155
  • Loading branch information
DreadKnight authored Oct 23, 2023
2 parents 4180e88 + 2c2910c commit 13e03b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export default class Game {
dash: {
materializeOverload: 'Overload! Maximum number of units controlled',
selectUnit: 'Please select an available unit from the left grid',
wrongPlayer: 'Please select an available unit from own unit grid',
lowPlasma: 'Low Plasma! Cannot materialize the selected unit',
// plasmaCost : String : plasma cost of the unit to materialize
materializeUnit: (plasmaCost: string) => {
Expand Down
19 changes: 19 additions & 0 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,25 @@ export class UI {

if (activeCreature.player.getNbrOfCreatures() > game.creaLimitNbr) {
$j('#materialize_button p').text(game.msg.ui.dash.materializeOverload);
}
// Check if the player is viewing the wrong tab
else if (
activeCreature.player.id !== player &&
activeCreature.isDarkPriest() &&
activeCreature.abilities[3].testRequirements() &&
activeCreature.abilities[3].used === false
) {
$j('#materialize_button p').text(game.msg.ui.dash.wrongPlayer);

// Switch to turn player's dark priest
this.materializeButton.click = () => {
this.showCreature("--", activeCreature.player.id);
};

$j('#card .sideA').on('click', this.materializeButton.click);
$j('#card .sideA').removeClass('disabled');
this.materializeButton.changeState(ButtonStateEnum.glowing);
$j('#materialize_button').show();
} else if (
!summonedOrDead &&
activeCreature.player.id === player &&
Expand Down

0 comments on commit 13e03b8

Please sign in to comment.