forked from GitHub-Mirrors/foundry-sw5e
Add Skills to Starships
Added skills to the starship sheets and made them rollable. Sorry about the direct commit to Develop, but I forgot to branch it off...
This commit is contained in:
parent
a28cbc5a8a
commit
fa7b03109f
7 changed files with 95 additions and 90 deletions
|
@ -860,7 +860,7 @@ export default class Actor5e extends Actor {
|
|||
const rollData = mergeObject(options, {
|
||||
parts: parts,
|
||||
data: data,
|
||||
title: game.i18n.format("SW5E.SkillPromptTitle", {skill: CONFIG.SW5E.skills[skillId]}),
|
||||
title: game.i18n.format("SW5E.SkillPromptTitle", {skill: CONFIG.SW5E.skills[skillId] || CONFIG.SW5E.starshipSkills[skillId]}),
|
||||
halflingLucky: this.getFlag("sw5e", "halflingLucky"),
|
||||
reliableTalent: reliableTalent,
|
||||
messageData: {"flags.sw5e.roll": {type: "skill", skillId }}
|
||||
|
|
|
@ -67,7 +67,7 @@ export default class ActorSheet5e extends ActorSheet {
|
|||
cssClass: isOwner ? "editable" : "locked",
|
||||
isCharacter: this.entity.data.type === "character",
|
||||
isNPC: this.entity.data.type === "npc",
|
||||
isStarship: this.entity.data.type === "starship",
|
||||
isStarship: this.entity.data.type === "starship",
|
||||
isVehicle: this.entity.data.type === 'vehicle',
|
||||
config: CONFIG.SW5E,
|
||||
};
|
||||
|
@ -96,7 +96,11 @@ export default class ActorSheet5e extends ActorSheet {
|
|||
skl.ability = CONFIG.SW5E.abilityAbbreviations[skl.ability];
|
||||
skl.icon = this._getProficiencyIcon(skl.value);
|
||||
skl.hover = CONFIG.SW5E.proficiencyLevels[skl.value];
|
||||
skl.label = CONFIG.SW5E.skills[s];
|
||||
if (data.actor.type === "starship") {
|
||||
skl.label = CONFIG.SW5E.starshipSkills[s];
|
||||
}else{
|
||||
skl.label = CONFIG.SW5E.skills[s];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -409,11 +413,11 @@ export default class ActorSheet5e extends ActorSheet {
|
|||
html.find('.item-create').click(this._onItemCreate.bind(this));
|
||||
html.find('.item-edit').click(this._onItemEdit.bind(this));
|
||||
html.find('.item-delete').click(this._onItemDelete.bind(this));
|
||||
html.find('.item-collapse').click(this._onItemCollapse.bind(this));
|
||||
html.find('.item-collapse').click(this._onItemCollapse.bind(this));
|
||||
html.find('.item-uses input').click(ev => ev.target.select()).change(this._onUsesChange.bind(this));
|
||||
html.find('.slot-max-override').click(this._onPowerSlotOverride.bind(this));
|
||||
html.find('.increment-class-level').click(this._onIncrementClassLevel.bind(this));
|
||||
html.find('.decrement-class-level').click(this._onDecrementClassLevel.bind(this));
|
||||
html.find('.increment-class-level').click(this._onIncrementClassLevel.bind(this));
|
||||
html.find('.decrement-class-level').click(this._onDecrementClassLevel.bind(this));
|
||||
|
||||
// Active Effect management
|
||||
html.find(".effect-control").click(ev => onManageActiveEffect(ev, this.entity));
|
||||
|
|
|
@ -38,8 +38,8 @@ export default class ActorSheet5eStarship extends ActorSheet5e {
|
|||
weapons: { label: game.i18n.localize("SW5E.ItemTypeWeaponPl"), items: [], hasActions: true, dataset: {type: "weapon", "weapon-type": "natural"} },
|
||||
passive: { label: game.i18n.localize("SW5E.Features"), items: [], dataset: {type: "feat"} },
|
||||
equipment: { label: game.i18n.localize("SW5E.StarshipEquipment"), items: [], dataset: {type: "equipment"}},
|
||||
starshipfeatures: { label: game.i18n.localize("SW5E.StarshipfeaturePl"), items: [], hasActions: true, dataset: {type: "starshipfeature"} },
|
||||
starshipmods: { label: game.i18n.localize("SW5E.StarshipmodPl"), items: [], hasActions: false, dataset: {type: "starshipmod"} }
|
||||
starshipfeatures: { label: game.i18n.localize("SW5E.StarshipfeaturePl"), items: [], hasActions: true, dataset: {type: "starshipfeature"} },
|
||||
starshipmods: { label: game.i18n.localize("SW5E.StarshipmodPl"), items: [], hasActions: false, dataset: {type: "starshipmod"} }
|
||||
};
|
||||
|
||||
// Start by classifying items into groups for rendering
|
||||
|
|
|
@ -65,6 +65,7 @@ export default class ActorSheet5e extends ActorSheet {
|
|||
cssClass: isOwner ? "editable" : "locked",
|
||||
isCharacter: this.entity.data.type === "character",
|
||||
isNPC: this.entity.data.type === "npc",
|
||||
isStarship: this.entity.data.type === "starship",
|
||||
isVehicle: this.entity.data.type === 'vehicle',
|
||||
config: CONFIG.SW5E,
|
||||
};
|
||||
|
|
4
sw5e.js
4
sw5e.js
|
@ -161,8 +161,8 @@ Hooks.once("setup", function() {
|
|||
"armorProficiencies", "armorPropertiesTypes", "conditionTypes", "consumableTypes", "cover", "currencies", "damageResistanceTypes",
|
||||
"damageTypes", "distanceUnits", "equipmentTypes", "healingTypes", "itemActionTypes", "languages",
|
||||
"limitedUsePeriods", "movementTypes", "movementUnits", "polymorphSettings", "proficiencyLevels", "senses", "skills",
|
||||
"powerComponents", "powerLevels", "powerPreparationModes", "powerScalingModes", "powerSchools", "targetTypes",
|
||||
"timePeriods", "toolProficiencies", "weaponProficiencies", "weaponProperties", "weaponTypes"
|
||||
"starshipSkills", "powerComponents", "powerLevels", "powerPreparationModes", "powerScalingModes", "powerSchools", "targetTypes",
|
||||
"timePeriods", "toolProficiencies", "weaponProficiencies", "weaponProperties", "weaponTypes", "weaponSizes"
|
||||
];
|
||||
|
||||
// Exclude some from sorting where the default order matters
|
||||
|
|
158
template.json
158
template.json
|
@ -404,86 +404,86 @@
|
|||
}
|
||||
},
|
||||
"starship": {
|
||||
"templates": ["common"],
|
||||
"attributes": {
|
||||
"hp": {
|
||||
"value": 10,
|
||||
"max": 10,
|
||||
"formula": "",
|
||||
"temp": 0,
|
||||
"tempmax": 0
|
||||
},
|
||||
"sp": {
|
||||
"formula": ""
|
||||
}
|
||||
},
|
||||
"details": {
|
||||
"tier": 0,
|
||||
"role": "",
|
||||
"source": ""
|
||||
},
|
||||
"skills": {
|
||||
"ast": {
|
||||
"value": 0,
|
||||
"ability": "int"
|
||||
},
|
||||
"bst": {
|
||||
"value": 0,
|
||||
"ability": "str"
|
||||
},
|
||||
"dat": {
|
||||
"value": 0,
|
||||
"ability": "int"
|
||||
"templates": ["common"],
|
||||
"attributes": {
|
||||
"hp": {
|
||||
"value": 10,
|
||||
"max": 10,
|
||||
"formula": "",
|
||||
"temp": 0,
|
||||
"tempmax": 0
|
||||
},
|
||||
"sp": {
|
||||
"formula": ""
|
||||
}
|
||||
},
|
||||
"hid": {
|
||||
"value": 0,
|
||||
"ability": "dex"
|
||||
},
|
||||
"imp": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
},
|
||||
"int": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
},
|
||||
"man": {
|
||||
"value": 0,
|
||||
"ability": "dex"
|
||||
},
|
||||
"men": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
},
|
||||
"pat": {
|
||||
"value": 0,
|
||||
"ability": "con"
|
||||
},
|
||||
"prb": {
|
||||
"value": 0,
|
||||
"ability": "int"
|
||||
},
|
||||
"ram": {
|
||||
"value": 0,
|
||||
"ability": "str"
|
||||
},
|
||||
"reg": {
|
||||
"value": 0,
|
||||
"ability": "con"
|
||||
},
|
||||
"scn": {
|
||||
"value": 0,
|
||||
"ability": "wis"
|
||||
},
|
||||
"swn": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"size": "med"
|
||||
}
|
||||
},
|
||||
"details": {
|
||||
"tier": 0,
|
||||
"role": "",
|
||||
"source": ""
|
||||
},
|
||||
"skills": {
|
||||
"ast": {
|
||||
"value": 0,
|
||||
"ability": "int"
|
||||
},
|
||||
"bst": {
|
||||
"value": 0,
|
||||
"ability": "str"
|
||||
},
|
||||
"dat": {
|
||||
"value": 0,
|
||||
"ability": "int"
|
||||
},
|
||||
"hid": {
|
||||
"value": 0,
|
||||
"ability": "dex"
|
||||
},
|
||||
"imp": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
},
|
||||
"int": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
},
|
||||
"man": {
|
||||
"value": 0,
|
||||
"ability": "dex"
|
||||
},
|
||||
"men": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
},
|
||||
"pat": {
|
||||
"value": 0,
|
||||
"ability": "con"
|
||||
},
|
||||
"prb": {
|
||||
"value": 0,
|
||||
"ability": "int"
|
||||
},
|
||||
"ram": {
|
||||
"value": 0,
|
||||
"ability": "str"
|
||||
},
|
||||
"reg": {
|
||||
"value": 0,
|
||||
"ability": "con"
|
||||
},
|
||||
"scn": {
|
||||
"value": 0,
|
||||
"ability": "wis"
|
||||
},
|
||||
"swn": {
|
||||
"value": 0,
|
||||
"ability": "cha"
|
||||
}
|
||||
},
|
||||
"traits": {
|
||||
"size": "med"
|
||||
}
|
||||
},
|
||||
"vehicle": {
|
||||
"templates": ["common"],
|
||||
"abilities": {
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
<section class="skills">
|
||||
<h1>{{localize "SW5E.Skills"}}</h1>
|
||||
<ol>
|
||||
{{#each CONFIG.starshipSkills as |skill s|}}
|
||||
{{#each data.skills as |skill s|}}
|
||||
<li class="skill {{#if skill.value}}proficient{{/if}}" data-skill="{{s}}">
|
||||
<input type="hidden" name="data.skills.{{s}}.value" value="{{skill.value}}"
|
||||
data-dtype="Number" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue