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, {
|
const rollData = mergeObject(options, {
|
||||||
parts: parts,
|
parts: parts,
|
||||||
data: data,
|
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"),
|
halflingLucky: this.getFlag("sw5e", "halflingLucky"),
|
||||||
reliableTalent: reliableTalent,
|
reliableTalent: reliableTalent,
|
||||||
messageData: {"flags.sw5e.roll": {type: "skill", skillId }}
|
messageData: {"flags.sw5e.roll": {type: "skill", skillId }}
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default class ActorSheet5e extends ActorSheet {
|
||||||
cssClass: isOwner ? "editable" : "locked",
|
cssClass: isOwner ? "editable" : "locked",
|
||||||
isCharacter: this.entity.data.type === "character",
|
isCharacter: this.entity.data.type === "character",
|
||||||
isNPC: this.entity.data.type === "npc",
|
isNPC: this.entity.data.type === "npc",
|
||||||
isStarship: this.entity.data.type === "starship",
|
isStarship: this.entity.data.type === "starship",
|
||||||
isVehicle: this.entity.data.type === 'vehicle',
|
isVehicle: this.entity.data.type === 'vehicle',
|
||||||
config: CONFIG.SW5E,
|
config: CONFIG.SW5E,
|
||||||
};
|
};
|
||||||
|
@ -96,7 +96,11 @@ export default class ActorSheet5e extends ActorSheet {
|
||||||
skl.ability = CONFIG.SW5E.abilityAbbreviations[skl.ability];
|
skl.ability = CONFIG.SW5E.abilityAbbreviations[skl.ability];
|
||||||
skl.icon = this._getProficiencyIcon(skl.value);
|
skl.icon = this._getProficiencyIcon(skl.value);
|
||||||
skl.hover = CONFIG.SW5E.proficiencyLevels[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-create').click(this._onItemCreate.bind(this));
|
||||||
html.find('.item-edit').click(this._onItemEdit.bind(this));
|
html.find('.item-edit').click(this._onItemEdit.bind(this));
|
||||||
html.find('.item-delete').click(this._onItemDelete.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('.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('.slot-max-override').click(this._onPowerSlotOverride.bind(this));
|
||||||
html.find('.increment-class-level').click(this._onIncrementClassLevel.bind(this));
|
html.find('.increment-class-level').click(this._onIncrementClassLevel.bind(this));
|
||||||
html.find('.decrement-class-level').click(this._onDecrementClassLevel.bind(this));
|
html.find('.decrement-class-level').click(this._onDecrementClassLevel.bind(this));
|
||||||
|
|
||||||
// Active Effect management
|
// Active Effect management
|
||||||
html.find(".effect-control").click(ev => onManageActiveEffect(ev, this.entity));
|
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"} },
|
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"} },
|
passive: { label: game.i18n.localize("SW5E.Features"), items: [], dataset: {type: "feat"} },
|
||||||
equipment: { label: game.i18n.localize("SW5E.StarshipEquipment"), items: [], dataset: {type: "equipment"}},
|
equipment: { label: game.i18n.localize("SW5E.StarshipEquipment"), items: [], dataset: {type: "equipment"}},
|
||||||
starshipfeatures: { label: game.i18n.localize("SW5E.StarshipfeaturePl"), items: [], hasActions: true, dataset: {type: "starshipfeature"} },
|
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"} }
|
starshipmods: { label: game.i18n.localize("SW5E.StarshipmodPl"), items: [], hasActions: false, dataset: {type: "starshipmod"} }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Start by classifying items into groups for rendering
|
// Start by classifying items into groups for rendering
|
||||||
|
|
|
@ -65,6 +65,7 @@ export default class ActorSheet5e extends ActorSheet {
|
||||||
cssClass: isOwner ? "editable" : "locked",
|
cssClass: isOwner ? "editable" : "locked",
|
||||||
isCharacter: this.entity.data.type === "character",
|
isCharacter: this.entity.data.type === "character",
|
||||||
isNPC: this.entity.data.type === "npc",
|
isNPC: this.entity.data.type === "npc",
|
||||||
|
isStarship: this.entity.data.type === "starship",
|
||||||
isVehicle: this.entity.data.type === 'vehicle',
|
isVehicle: this.entity.data.type === 'vehicle',
|
||||||
config: CONFIG.SW5E,
|
config: CONFIG.SW5E,
|
||||||
};
|
};
|
||||||
|
|
4
sw5e.js
4
sw5e.js
|
@ -161,8 +161,8 @@ Hooks.once("setup", function() {
|
||||||
"armorProficiencies", "armorPropertiesTypes", "conditionTypes", "consumableTypes", "cover", "currencies", "damageResistanceTypes",
|
"armorProficiencies", "armorPropertiesTypes", "conditionTypes", "consumableTypes", "cover", "currencies", "damageResistanceTypes",
|
||||||
"damageTypes", "distanceUnits", "equipmentTypes", "healingTypes", "itemActionTypes", "languages",
|
"damageTypes", "distanceUnits", "equipmentTypes", "healingTypes", "itemActionTypes", "languages",
|
||||||
"limitedUsePeriods", "movementTypes", "movementUnits", "polymorphSettings", "proficiencyLevels", "senses", "skills",
|
"limitedUsePeriods", "movementTypes", "movementUnits", "polymorphSettings", "proficiencyLevels", "senses", "skills",
|
||||||
"powerComponents", "powerLevels", "powerPreparationModes", "powerScalingModes", "powerSchools", "targetTypes",
|
"starshipSkills", "powerComponents", "powerLevels", "powerPreparationModes", "powerScalingModes", "powerSchools", "targetTypes",
|
||||||
"timePeriods", "toolProficiencies", "weaponProficiencies", "weaponProperties", "weaponTypes"
|
"timePeriods", "toolProficiencies", "weaponProficiencies", "weaponProperties", "weaponTypes", "weaponSizes"
|
||||||
];
|
];
|
||||||
|
|
||||||
// Exclude some from sorting where the default order matters
|
// Exclude some from sorting where the default order matters
|
||||||
|
|
158
template.json
158
template.json
|
@ -404,86 +404,86 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"starship": {
|
"starship": {
|
||||||
"templates": ["common"],
|
"templates": ["common"],
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"hp": {
|
"hp": {
|
||||||
"value": 10,
|
"value": 10,
|
||||||
"max": 10,
|
"max": 10,
|
||||||
"formula": "",
|
"formula": "",
|
||||||
"temp": 0,
|
"temp": 0,
|
||||||
"tempmax": 0
|
"tempmax": 0
|
||||||
},
|
},
|
||||||
"sp": {
|
"sp": {
|
||||||
"formula": ""
|
"formula": ""
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"details": {
|
|
||||||
"tier": 0,
|
|
||||||
"role": "",
|
|
||||||
"source": ""
|
|
||||||
},
|
|
||||||
"skills": {
|
|
||||||
"ast": {
|
|
||||||
"value": 0,
|
|
||||||
"ability": "int"
|
|
||||||
},
|
|
||||||
"bst": {
|
|
||||||
"value": 0,
|
|
||||||
"ability": "str"
|
|
||||||
},
|
|
||||||
"dat": {
|
|
||||||
"value": 0,
|
|
||||||
"ability": "int"
|
|
||||||
},
|
},
|
||||||
"hid": {
|
"details": {
|
||||||
"value": 0,
|
"tier": 0,
|
||||||
"ability": "dex"
|
"role": "",
|
||||||
},
|
"source": ""
|
||||||
"imp": {
|
},
|
||||||
"value": 0,
|
"skills": {
|
||||||
"ability": "cha"
|
"ast": {
|
||||||
},
|
"value": 0,
|
||||||
"int": {
|
"ability": "int"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "cha"
|
"bst": {
|
||||||
},
|
"value": 0,
|
||||||
"man": {
|
"ability": "str"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "dex"
|
"dat": {
|
||||||
},
|
"value": 0,
|
||||||
"men": {
|
"ability": "int"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "cha"
|
"hid": {
|
||||||
},
|
"value": 0,
|
||||||
"pat": {
|
"ability": "dex"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "con"
|
"imp": {
|
||||||
},
|
"value": 0,
|
||||||
"prb": {
|
"ability": "cha"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "int"
|
"int": {
|
||||||
},
|
"value": 0,
|
||||||
"ram": {
|
"ability": "cha"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "str"
|
"man": {
|
||||||
},
|
"value": 0,
|
||||||
"reg": {
|
"ability": "dex"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "con"
|
"men": {
|
||||||
},
|
"value": 0,
|
||||||
"scn": {
|
"ability": "cha"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "wis"
|
"pat": {
|
||||||
},
|
"value": 0,
|
||||||
"swn": {
|
"ability": "con"
|
||||||
"value": 0,
|
},
|
||||||
"ability": "cha"
|
"prb": {
|
||||||
}
|
"value": 0,
|
||||||
},
|
"ability": "int"
|
||||||
"traits": {
|
},
|
||||||
"size": "med"
|
"ram": {
|
||||||
}
|
"value": 0,
|
||||||
},
|
"ability": "str"
|
||||||
|
},
|
||||||
|
"reg": {
|
||||||
|
"value": 0,
|
||||||
|
"ability": "con"
|
||||||
|
},
|
||||||
|
"scn": {
|
||||||
|
"value": 0,
|
||||||
|
"ability": "wis"
|
||||||
|
},
|
||||||
|
"swn": {
|
||||||
|
"value": 0,
|
||||||
|
"ability": "cha"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"traits": {
|
||||||
|
"size": "med"
|
||||||
|
}
|
||||||
|
},
|
||||||
"vehicle": {
|
"vehicle": {
|
||||||
"templates": ["common"],
|
"templates": ["common"],
|
||||||
"abilities": {
|
"abilities": {
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
<section class="skills">
|
<section class="skills">
|
||||||
<h1>{{localize "SW5E.Skills"}}</h1>
|
<h1>{{localize "SW5E.Skills"}}</h1>
|
||||||
<ol>
|
<ol>
|
||||||
{{#each CONFIG.starshipSkills as |skill s|}}
|
{{#each data.skills as |skill s|}}
|
||||||
<li class="skill {{#if skill.value}}proficient{{/if}}" data-skill="{{s}}">
|
<li class="skill {{#if skill.value}}proficient{{/if}}" data-skill="{{s}}">
|
||||||
<input type="hidden" name="data.skills.{{s}}.value" value="{{skill.value}}"
|
<input type="hidden" name="data.skills.{{s}}.value" value="{{skill.value}}"
|
||||||
data-dtype="Number" />
|
data-dtype="Number" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue