fix ko cryps requiring a skill

This commit is contained in:
ntr
2018-11-25 21:31:12 +11:00
parent c677e90f42
commit af1c06289d
4 changed files with 106 additions and 4 deletions
+5
View File
@@ -54,6 +54,7 @@ class CrypImage extends Phaser.GameObjects.Image {
class CrypSkill extends Phaser.GameObjects.Text {
constructor(scene, row, iter, team, skill, cryp) {
console.log(skill, cryp);
// Avatar will be a property of cryp
const {
CRYP_MARGIN, TEXT_MARGIN, TEAM_MARGIN, X_PADDING, Y_PADDING,
@@ -151,6 +152,10 @@ function renderSkills(scene, group, cryp, game, team, iter) {
});
} else if (game.phase === 'Target') {
const blockSkill = game.stack.find(skill => skill.source_cryp_id === cryp.id);
// cryp not casting this turn
if (!blockSkill) return false;
group.add(scene.add.existing(new CrypSkill(scene, 1, iter, team, blockSkill, cryp)));
}
}