Skip to content

Commit

Permalink
Add Held items to Pokemon
Browse files Browse the repository at this point in the history
Resolves #539
  • Loading branch information
Ashe committed Nov 11, 2023
1 parent e0236e2 commit 5065a16
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/module/actor/pokemon/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class PTUPokemonActor extends PTUActor {
}

get allowedItemTypes() {
return ["species", "pokeedge", "move", "contestmove", "ability", "capability", "effect", "condition", "spiritaction"]
return ["species", "pokeedge", "move", "contestmove", "ability", "capability", "effect", "condition", "spiritaction", "item"]
}

get nature() {
Expand Down
5 changes: 5 additions & 0 deletions src/module/actor/pokemon/sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export class PTUPokemonSheet extends PTUActorSheet {
// Initialize containers.
const abilities = [];
const capabilities = [];
const items = [];
const edges = [];
const effects = [];
const conditions = this.actor.conditions;
Expand Down Expand Up @@ -139,6 +140,9 @@ export class PTUPokemonSheet extends PTUActorSheet {
case 'spiritaction':
spiritactions.push(i);
break;
case 'item':
items.push(i);
break;
}
}

Expand All @@ -150,6 +154,7 @@ export class PTUPokemonSheet extends PTUActorSheet {
sheetData.conditions = conditions;
sheetData.contestmoves = contestmoves;
sheetData.spiritactions = spiritactions;
sheetData.items = items;

sheetData.actions = await (async () => {
const moves = [];
Expand Down
3 changes: 2 additions & 1 deletion static/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"pokemonEd": "Pokémon Education",
"techEd": "Technology Education"
},
"Title": "Pokémon Tabletop United",
"Title": "Pokémon Tabletop Reunited",

"TabsSkills": "Skills",
"TabsInventory": "Inventory",
Expand Down Expand Up @@ -237,6 +237,7 @@
"SaveCheckAction": "Make Save",

"ItemEffect": "Item Effect",
"HeldItems": "Held Items",
"FoodBuff": "Food Buff",
"HpGuidelines": "HP Guidelines",
"16th": "1/16th",
Expand Down
12 changes: 12 additions & 0 deletions static/templates/actor/pokemon-sheet-compact.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,18 @@
</div>
{{/if}}
</div>

<!-- Items -->
<div class="swsh-box mb-2 w-100">
<div
class="swsh-header ball-themes {{ballStyle}} highlight pt-2 pb-2 center-text justify-content-center">
<b>{{localize "PTU.HeldItems"}}</b>
</div>
<div class="swsh-body w-100" style="display: block;">
{{> "systems/ptu/static/templates/partials/item-display-partial.hbs" title=(localize
"ITEM.TypeItemPlural") type="item" items=items ballStyle=ballStyle}}
</div>
</div>
</div>
</div>

Expand Down

0 comments on commit 5065a16

Please sign in to comment.