Skip to content

Commit

Permalink
Implement HIDE_STATS for in-play minions
Browse files Browse the repository at this point in the history
Touches #128
  • Loading branch information
jleclanche committed Sep 4, 2016
1 parent 3fcce7b commit 2fff3c5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Binary file added assets/images/inplay_minion_hide_stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions ts/components/game/Minion.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import EntityInPlay from "./EntityInPlay";
import {EntityInPlayProps, CardData} from "../../interfaces";
import {MetaDataType} from "../../enums";
import {GameTag, MetaDataType} from "../../enums";
import InPlayCardArt from "./visuals/InPlayCardArt";
import Attack from "./stats/Attack";
import Health from "./stats/Health";
Expand Down Expand Up @@ -58,8 +58,10 @@ class Minion extends EntityInPlay<EntityInPlayProps> {
healing={healing}
/>,
<div key="stats" className="stats">
<Attack attack={entity.getAtk() } default={data.attack}/>
<Health health={entity.getHealth() } damage={entity.getDamage()} default={data.health}/>
{entity.getTag(GameTag.HIDE_STATS) == 0 ? [
<Attack attack={entity.getAtk() } default={data.attack}/>,
<Health health={entity.getHealth() } damage={entity.getDamage()} default={data.health}/>
] : null}
{damage != 0 ? <Damage damage={damage}/> : null}
{healing != 0 ? <Healing healing={healing}/> : null}
</div>
Expand Down
15 changes: 11 additions & 4 deletions ts/components/game/visuals/InPlayCardArt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,17 @@ class InPlayCardArt extends React.Component<EntityProps, {}> {
});
}

images.push({
image: "inplay_minion.png",
classes: ["inplay-base"]
});
if (entity.getTag(GameTag.HIDE_STATS)) {
images.push({
image: "inplay_minion_hide_stats.png",
classes: ["inplay-base"]
});
} else {
images.push({
image: "inplay_minion.png",
classes: ["inplay-base"]
});
}

if (entity.isLegendary()) {
images.push({
Expand Down

0 comments on commit 2fff3c5

Please sign in to comment.