Skip to content

Commit 2b48078

Browse files
committed
ADD - Spell & Psi power damage & shield inputs
1 parent 302f80c commit 2b48078

13 files changed

Lines changed: 110 additions & 34 deletions

File tree

src/lang/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@
327327
"anima.ui.mystic.spell.grade.intermediate.title": "Intermediate",
328328
"anima.ui.mystic.spell.grade.maintenanceCost.title": "Maint.",
329329
"anima.ui.mystic.spell.grade.zeon.title": "Zeon",
330+
"anima.ui.mystic.spell.grade.damage.title": "Damage",
331+
"anima.ui.mystic.spell.grade.shieldPoints.title": "shield",
330332
"anima.ui.mystic.spell.hasDailyMaintenance.title": "Daily Mant.?",
331333
"anima.ui.mystic.spell.visible.title": "Visible",
332334
"anima.ui.mystic.spell.level.title": "Level",
@@ -874,5 +876,6 @@
874876
"anima.ui.effects.effectsList.edit.title": "Edit",
875877
"anima.ui.effects.effectsList.delete.title": "Delete",
876878
"anima.effects.newEffect": "New effect"
879+
877880

878881
}

src/lang/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@
329329
"anima.ui.mystic.spell.grade.intermediate.title": "Intermedio",
330330
"anima.ui.mystic.spell.grade.maintenanceCost.title": "Mant.",
331331
"anima.ui.mystic.spell.grade.zeon.title": "Zeón",
332+
"anima.ui.mystic.spell.grade.damage.title": "Daño",
333+
"anima.ui.mystic.spell.grade.shieldPoints.title": "Escudo",
332334
"anima.ui.mystic.spell.hasDailyMaintenance.title": "¿Mant. Diario?",
333335
"anima.ui.mystic.spell.visible.title": "Visible",
334336
"anima.ui.mystic.spell.level.title": "Nivel",
@@ -875,4 +877,5 @@
875877
"anima.ui.effects.effectsList.edit.title": "Editar",
876878
"anima.ui.effects.effectsList.delete.title": "Eliminar",
877879
"anima.effects.newEffect": "Nuevo efecto"
880+
878881
}

src/lang/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@
316316
"anima.ui.mystic.spell.grade.intermediate.title": "Intermédiaire",
317317
"anima.ui.mystic.spell.grade.maintenanceCost.title": "Maint.",
318318
"anima.ui.mystic.spell.grade.zeon.title": "Zéon",
319+
"anima.ui.mystic.spell.grade.damage.title": "Damage",
320+
"anima.ui.mystic.spell.grade.shieldPoints.title": "shield",
319321
"anima.ui.mystic.spell.hasDailyMaintenance.title": "Maint. quotidien ?",
320322
"anima.ui.mystic.spell.level.title": "Niveau",
321323
"anima.ui.mystic.spell.spellType.animatic.title": "Animique",
@@ -760,4 +762,5 @@
760762
"anima.ui.effects.effectsList.edit.title": "Edit",
761763
"anima.ui.effects.effectsList.delete.title": "Delete",
762764
"anima.effects.newEffect": "New effect"
765+
763766
}

src/module/actor/utils/buttonCallbacks/castPsychicPower.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export async function castPsychicPower(sheet, event) {
163163

164164
// ---------- DEFENSE: create shield ----------
165165
if (combatType === 'defense') {
166-
const shieldPoints = Number(shieldValueCheck(effectText) ?? 0) || 0;
166+
const shieldPoints = Number(shieldValueCheck(effectData?.shieldPoints) ?? 0) || 0;
167167

168168
const defaultAbilityFormula =
169169
'@psychic.psychicProjection.imbalance.defensive.base.value';
@@ -246,7 +246,7 @@ export async function castPsychicPowerDifficulty(sheet, event) {
246246
const combatType = power.system?.combatType?.value ?? 'attack';
247247

248248
if (combatType === 'defense') {
249-
const shieldPoints = Number(shieldValueCheck(effectText) ?? 0) || 0;
249+
const shieldPoints = Number(shieldValueCheck(effectData?.shieldPoints) ?? 0) || 0;
250250
const defaultAbilityFormula =
251251
'@psychic.psychicProjection.imbalance.defensive.base.value';
252252

src/module/actor/utils/prepareActor/calculations/actor/domine/mutateDomineData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const mutateDomineData = async data => {
1+
export const mutateDomineData = data => {
22
const allActionsPenalty = data.general.modifiers.allActions.final.value;
33

44
const { domine } = data;

src/module/actor/utils/prepareActor/calculations/actor/mystic/mutateMysticData.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ export const mutateMysticData = data => {
1616
if (mystic.act.via.length !== 0) {
1717
for (const actVia of mystic.act.via) {
1818
actVia.system.final.value = Math.max(
19-
actVia.system.base.value + Math.min(0, -roundTo5Multiples(-allActionsPenalty / 2)),
19+
actVia.system.base.value +
20+
Math.min(0, -roundTo5Multiples(-allActionsPenalty / 2)),
2021
0
2122
);
2223
}
@@ -40,38 +41,31 @@ export const mutateMysticData = data => {
4041
0
4142
);
4243
mystic.magicProjection.imbalance.offensive.final.value = Math.max(
43-
mystic.magicProjection.imbalance.offensive.base.value +
44-
allActionsPenalty,
44+
mystic.magicProjection.imbalance.offensive.base.value + allActionsPenalty,
4545
0
4646
);
4747

4848
mystic.magicProjection.imbalance.defensive.final.value = Math.max(
49-
mystic.magicProjection.imbalance.defensive.base.value +
50-
allActionsPenalty,
49+
mystic.magicProjection.imbalance.defensive.base.value + allActionsPenalty,
5150
0
5251
);
5352

5453
const dailyZeon = mystic.spellMaintenances.reduce(
55-
(acc, currentValue) =>
56-
acc + (Number(currentValue.system.cost.value) || 0),
54+
(acc, currentValue) => acc + (Number(currentValue.system.cost.value) || 0),
5755
0
5856
);
59-
57+
6058
const perTurnZeon = mystic.selectedSpells.reduce(
61-
(acc, currentValue) =>
62-
acc + (Number(currentValue.system.cost.value) || 0),
59+
(acc, currentValue) => acc + (Number(currentValue.system.cost.value) || 0),
6360
0
6461
);
6562

6663
mystic.spellsMaintenanceCost = perTurnZeon;
6764

6865
const manualMaintained = Number(mystic.zeonMaintained?.max) || 0;
6966
mystic.zeonMaintained.value = perTurnZeon + manualMaintained;
70-
71-
mystic.zeonRegeneration.final.value = Math.max(
72-
mystic.zeonRegeneration.base.value - dailyZeon,
73-
0
74-
);
67+
68+
mystic.zeonRegeneration.final.value = mystic.zeonRegeneration.base.value - dailyZeon;
7569

7670
mystic.summoning.summon.final.value =
7771
mystic.summoning.summon.base.value + Math.min(allActionsPenalty, 0);

src/module/actor/utils/prepareActor/calculations/items/weapon/calculations/calculateWeaponArmorReduction.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { WeaponSizeProportion } from '../../../../../../../types/combat/WeaponIt
33
/**
44
* @param {import('../../../../../../../types/Items').WeaponDataSource} weapon
55
*/
6-
export const calculateWeaponArmorReduction = (weapon) => {
7-
let reducedArmor = weapon.system.reducedArmor.base.value + weapon.system.reducedArmor.special.value;
8-
6+
export const calculateWeaponArmorReduction = weapon => {
7+
let reducedArmor = Math.max(
8+
weapon.system.reducedArmor.base.value + weapon.system.reducedArmor.special.value,
9+
0
10+
);
911

1012
return reducedArmor;
11-
};
13+
};

src/scss/actor/parts/psychic.scss

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,22 +154,22 @@
154154
}
155155

156156
.effect-row {
157-
display: flex;
157+
display: grid;
158+
grid-template-columns: 3rem 3rem 1fr; // dificultad | daño/escudo | descripción
159+
column-gap: 0.5rem;
160+
align-items: center;
158161

159162
margin-top: 0.5rem;
160163

161-
.difficulty {
162-
margin-right: 0.5rem;
163-
width: 3rem;
164-
}
164+
.difficulty { width: 3rem; }
165+
.damage, .shield-points { width: 100%; }
166+
.description { width: 100%; }
165167

166-
.description {
167-
width: 100%;
168-
}
168+
.damage-title, .shield-points-title { grid-column: 2; margin: 0; font-weight: bold; text-align: center;}
169+
.description-title { grid-column: 3; margin: 0; font-weight: bold; }text-align: center;
169170

170171
.input {
171172
@include input;
172-
173173
text-align: center;
174174
height: 1.25rem;
175175
line-height: 1.25rem;
@@ -184,6 +184,7 @@
184184
}
185185
}
186186

187+
187188
.psychic-power-header {
188189
padding-right: 0.5rem;
189190
padding-left: 0.5rem;

src/templates/actor/parts/combat/parts/supernatural-shields.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{{#> "systems/animabf/templates/common/ui/group.hbs"
22
class="supernatural-shields"
33
}}
4-
{{>
4+
{{!-- {{>
55
"systems/animabf/templates/common/ui/group-header.hbs"
66
title=(localize "anima.ui.combat.supernaturalShields.title")
77
addRowButtonData="add-supernatural-shield"
8+
}} --}}
9+
{{>
10+
"systems/animabf/templates/common/ui/group-header.hbs"
11+
title=(localize "anima.ui.combat.supernaturalShields.title")
812
}}
913
{{#> "systems/animabf/templates/common/ui/group-body.hbs"
1014
class="supernatural-shields"

src/templates/actor/parts/mystic/parts/spells/grade/grade.hbs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@
3333
inputName=this.maintenanceCostInputName
3434
inputValue=this.grade.maintenanceCost.value
3535
}}
36+
{{#if (is 'eq' this.spellCombatType 'attack')}}
37+
{{>
38+
"systems/animabf/templates/common/ui/vertical-titled-input.hbs"
39+
class="damage"
40+
hideTitle=this.hideTitle
41+
title=(localize "anima.ui.mystic.spell.grade.damage.title")
42+
inputName=this.damageInputName
43+
inputValue=this.grade.damage.value
44+
}}
45+
{{/if}}
46+
{{#if (is 'eq' this.spellCombatType 'defense')}}
47+
{{>
48+
"systems/animabf/templates/common/ui/vertical-titled-input.hbs"
49+
class="shield-points"
50+
hideTitle=this.hideTitle
51+
title=(localize "anima.ui.mystic.spell.grade.shieldPoints.title")
52+
inputName=this.shieldPointsInputName
53+
inputValue=this.grade.shieldPoints.value
54+
}}
55+
{{/if}}
3656
{{>
3757
"systems/animabf/templates/common/ui/vertical-titled-input.hbs"
3858
class="description"

0 commit comments

Comments
 (0)