From 3916fc643f599639abe247339dc2f9f24b7e5d46 Mon Sep 17 00:00:00 2001 From: Patrick Wieth Date: Wed, 8 Nov 2023 12:27:36 +0100 Subject: [PATCH] fixes empty abilities --- src/views/CardCreatorPage.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/views/CardCreatorPage.vue b/src/views/CardCreatorPage.vue index 0e41c99e..9509dea3 100644 --- a/src/views/CardCreatorPage.vue +++ b/src/views/CardCreatorPage.vue @@ -1185,6 +1185,21 @@ export default { } } + // if an ability was created, but it has no effect, then this should be fixed + if (newModel.Abilities.length > 0) { + let effectsList = R.flatten(R.map( + x => R.values(R.pluck("Effects", x)), + newModel.Abilities)) + + if (R.any(y => y === undefined, effectsList)) { + this.notifyFail( + "Useless Ability", + "Card has an Ability, which does not do anything. Please add an Effect to the Ability." + ); + return; + } + } + // check if the old Keywords and RulesTexts should be restored let checkZeroAmount = () => { return (this.model.AdditionalCost.SacrificeCost && this.model.AdditionalCost.SacrificeCost.Amount == 0) || @@ -1211,6 +1226,7 @@ export default { newModel.image = this.model.image newModel.balanceAnchor = this.model.balanceAnchor + // many characters will not make it into the blockchain, so here we check if all is valid ASCII let checkASCII = (string, origin) => { string.split('').forEach(char => { if (!isASCII(char)) {