Skip to content

Commit

Permalink
Merge pull request #2509 from athe-cpu/show-priest-athe
Browse files Browse the repository at this point in the history
visibility of the dark priest cards, fixes #2156
  • Loading branch information
DreadKnight authored Oct 16, 2023
2 parents b9e6121 + 8cc5b67 commit 920f3d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/abilities/Dark-Priest.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default (G) => {

// Ask the creature to summon
G.UI.materializeToggled = true;
G.UI.toggleDash('randomize');
G.UI.toggleDash(true);
},

fnOnSelect: function (hex, args) {
Expand Down
7 changes: 4 additions & 3 deletions src/ui/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,7 @@ export class UI {
$j('#materialize_button p').text(game.msg.ui.dash.selectUnit);
// Bind button for random unit selection
this.materializeButton.click = () => {
const creatureId = this.showRandomCreature();
this.lastViewedCreature = creatureId;
this.lastViewedCreature = this.showRandomCreature();
};
// Apply the changes
$j('#card .sideA').on('click', this.materializeButton.click);
Expand Down Expand Up @@ -1470,7 +1469,9 @@ export class UI {
if (randomize && !this.lastViewedCreature) {
// Optional: select a random creature from the grid
this.showRandomCreature();
} else if (this.lastViewedCreature) {
} else if (!randomize) {
this.showCreature('--', game.activeCreature.team, '');
} else if (this.lastViewedCreature) {
this.showCreature(this.lastViewedCreature, game.activeCreature.team, '');
} else {
this.showCreature(game.activeCreature.type, game.activeCreature.team, '');
Expand Down
13 changes: 2 additions & 11 deletions src/utility/hexgrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1052,17 +1052,8 @@ export class HexGrid {
game.UI.showCreature(hex.creature.type, hex.creature.player.id, 'grid');
} else {
if (game.activeCreature.isDarkPriest()) {
// If ability used, default to Dark Priest and say materialize has been used
if (game.activeCreature.abilities[3].used) {
game.UI.showCreature(
game.activeCreature.type,
game.activeCreature.player.id,
'emptyHex',
);
} else if (game.UI.lastViewedCreature) {
game.UI.showCreature(game.UI.lastViewedCreature, game.UI.selectedPlayer, 'emptyHex');
} else if (game.UI.selectedCreatureObj) {
game.UI.toggleDash(true);
if (game.UI.selectedCreatureObj) {
game.UI.toggleDash(false);
} else {
game.UI.showCreature(
game.activeCreature.type,
Expand Down

1 comment on commit 920f3d6

@vercel
Copy link

@vercel vercel bot commented on 920f3d6 Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.