Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes empty abilities #229

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/views/CardCreatorPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand All @@ -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)) {
Expand Down