This commit is contained in:
2025-08-04 10:36:35 +02:00
parent 43ff4270ec
commit 1409ef1733
8 changed files with 66 additions and 4 deletions

View File

@@ -5,7 +5,8 @@
"LevelShort": "LvL", "LevelShort": "LvL",
"ExperienceShort": "EXP", "ExperienceShort": "EXP",
"ArmorClass": "AC", "ArmorClass": "AC",
"Speed": "Speed" "Speed": "Speed",
"Attack": "Attack"
} }
} }
} }

View File

@@ -416,4 +416,18 @@
top: 186px; top: 186px;
border-top-left-radius: 101px 60px; border-top-left-radius: 101px 60px;
} }
.statsBox {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-items: space-evenly;
}
.categorySelectBox {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-items: space-evenly;
}
} }

View File

@@ -63,11 +63,20 @@ export default class pokemonCharacterSheet extends api.HandlebarsApplicationMixi
effects: baseData.document.effects effects: baseData.document.effects
}; };
context = this.calculateDerivated(context)
this.sheetContext = context; this.sheetContext = context;
return context; return context;
} }
calculateDerivated(context) {
context.system.armorClass = 10+context.system.stats.defense
context.system.speed = 30+5*context.system.stats.speed
return context
}
/** @override */ /** @override */
_onRender(context, options) { _onRender(context, options) {

View File

@@ -349,3 +349,15 @@
top: 186px; top: 186px;
border-top-left-radius: 101px 60px; border-top-left-radius: 101px 60px;
} }
.pokemon.sheet.characterSheet .statsBox {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-items: space-evenly;
}
.pokemon.sheet.characterSheet .categorySelectBox {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-items: space-evenly;
}

Binary file not shown.

View File

@@ -17,9 +17,11 @@
"stats": { "stats": {
"attack": 0, "attack": 0,
"defense": 0, "defense": 0,
"move": 0, "speed": 0,
"hp": 0 "hp": 0
}, },
"attackCategory": 0,
"defenseCategory": 0,
"speed": 0, "speed": 0,
"hp": { "hp": {
"max": 0, "max": 0,

View File

@@ -1,2 +1,26 @@
<div class="charSheetBox"> <div class="statsBox">
<div class="row">
<div class="charHex"><span class="charHexHead">Attack</span></br><input class="charHexValue invisibleInput" type="number" name="system.stats.attack" value="{{system.stats.attack}}"></div>
<div class="categorySelectBox">
<select name="system.attackCategory">
<option value=0>Physical</option>
<option value=1>Special</option>
</select>
</div>
</div>
<div class="row">
<div class="charHex"><span class="charHexHead">Defense</span></br><input class="charHexValue invisibleInput" type="number" name="system.stats.defense" value="{{system.stats.defense}}"></div>
<div class="categorySelectBox">
<select name="system.defenseCategory">
<option value=0>Physical</option>
<option value=1>Special</option>
</select>
</div>
</div>
<div class="row">
<div class="charHex"><span class="charHexHead">Speed</span></br><input class="charHexValue invisibleInput" type="number" name="system.stats.speed" value="{{system.stats.speed}}"></div>
</div>
<div class="row">
<div class="charHex"><span class="charHexHead">HP</span></br><input class="charHexValue invisibleInput" type="number" name="system.stats.hp" value="{{system.stats.hp}}"></div>
</div>
</div> </div>

View File

@@ -17,7 +17,7 @@
<div class="calcStatBox"> <div class="calcStatBox">
<div class="hitPointBox"> <div class="hitPointBox">
<div class="charHex charHPCurrent"><span class="charHexHead">HP</span></br><input class="charHexValue hpValue invisibleInput" type="number" name="system.hp.current" value="{{system.hp.current}}"></div> <div class="charHex charHPCurrent"><span class="charHexHead">HP</span></br><input class="charHexValue hpValue invisibleInput" type="number" name="system.hp.current" value="{{system.hp.current}}"></div>
<div class="charHex charHPMax"><span class="charHexHead">Max</span></br><span class="charHexValue hpMaxValue">{{system.hp.max}}</span></div> <div class="charHex charHPMax"><span class="charHexHead">Max</span></br><input class="charHexValue hpMaxValue invisibleinput" type="number" name="system.hp.max" value="{{system.hp.max}}"></div>
</div> </div>
<div class="row"> <div class="row">
<div class="charHex"><span class="charHexHead">{{localize "POKEMON.System.ArmorClass"}}</span></br><span class="charHexValue">{{system.armorClass}}</span></div> <div class="charHex"><span class="charHexHead">{{localize "POKEMON.System.ArmorClass"}}</span></br><span class="charHexValue">{{system.armorClass}}</span></div>