Merge pull request #4 from Cynicide/add-skill-designations

Add skill designations
This commit is contained in:
Cynicide 2022-09-14 20:01:17 +10:00 committed by GitHub
commit cfc645d888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 191 additions and 143 deletions

View File

@ -9,18 +9,30 @@ Small
DONE - Skills and Skill Categories are now seperate checks for Drag and Drop as some share names
Spells ?
5. Fix New Ranks Clickboxes - https://discord.com/channels/170995199584108546/670336275496042502/1018530650980102195
6. Fix Favorites Clickboxes on Actor Page
https://github.com/megastruktur/foundryvtt-blades-in-the-dark/blob/master/templates/actor-sheet.html#L97
https://github.com/megastruktur/foundryvtt-blades-in-the-dark/blob/00bed1cb1d222eab3ece62960941c54f3c272aac/module/blades.js#L69
6. DONE - Fix Favorites Clickboxes on Actor Page
DONE - Better Icon
DONE - Make Clickable
7. Create Default Values for Character sheet
Medium
4. Inventory sorted by types
1. Inventory sorted by types
i. Drag and drop should increment an item if it already exists.
ii. Equipables
iii. Favorites
5. Creature Sheet
6. Finish Character Sheet
2. Creature Sheet
3. Finish Character Sheet
Inventory
Spells
Status Record (Possibly large)
XP
4. Button to add all Skill Categories
5. Revisit Skill and Skill Category Progression (Pg 33)
6. DONE - Add occupational, everyman, and restricted skill categories
Large
6. Dice Roller
7. Initiative System
1. Dice Roller
2. Initiative System

View File

@ -50,4 +50,11 @@ rmss.stats = {
fullname: "Strength",
shortname: "St"
}
}
};
rmss.skill_designations = {
none: "None",
occupational: "Occupational",
everyman: "Everyman",
restricted: "Restricted"
};

View File

@ -49,10 +49,10 @@ export default class RMSSPlayerSheet extends ActorSheet {
console.log(owneditems);
var owneditemslist = Object.values(owneditems);
var ownedskillcatlist = Object.values(owneditems);
// Check if the dragged item is not in the array and not owned
if (!owneditemslist.includes(itemData.name)) {
if (!ownedskillcatlist.includes(itemData.name)) {
console.log("Not Owned!");
super._onDropItem(event, data);
}
@ -62,10 +62,10 @@ export default class RMSSPlayerSheet extends ActorSheet {
console.log(owneditems);
var owneditemslist = Object.values(owneditems);
var ownedskilllist = Object.values(owneditems);
// Check if the dragged item is not in the array and not owned
if (!owneditemslist.includes(itemData.name)) {
if (!ownedskilllist.includes(itemData.name)) {
console.log("Not Owned!");
super._onDropItem(event, data);
}
@ -155,6 +155,21 @@ export default class RMSSPlayerSheet extends ActorSheet {
//console.log(ev.currentTarget.getAttribute("data-item-id"));
item.delete();
});
// Check/Uncheck Favorite
html.find('.skill-favorite').click(ev => {
const item = this.actor.items.get(ev.currentTarget.getAttribute("data-item-id"));
console.log(item);
console.log("Before change: " + item.system.favorite);
if (item.system.favorite === true) {
console.log("Setting False");
item.update({system: {"favorite": false}});
} else {
console.log("Setting True");
item.update({system: {"favorite": true}});
}
console.log("After change: " + item.system.favorite);
});
}
async _onItemCreate(event) {

View File

@ -22,6 +22,9 @@ export default class RMSSSkillSheet extends ItemSheet {
var enrichedDescription = await TextEditor.enrichHTML(this.item.system.description, {async: true});
// Get a list of stats that can be used as applicable stats
var designations = this.getSkillDesignations(CONFIG);
// Get a list of the parent item's skill categories for the dropdown
var owned_skillcats = this.prepareSkillCategoryValues();
@ -38,7 +41,8 @@ export default class RMSSSkillSheet extends ItemSheet {
config: CONFIG.rmss,
owned_skillcats: owned_skillcats,
enrichedDescription: enrichedDescription,
selected_skillcat: selected_skillcat
selected_skillcat: selected_skillcat,
designations: designations
};
return sheetData;
@ -58,6 +62,16 @@ export default class RMSSSkillSheet extends ItemSheet {
}
}
getSkillDesignations(CONFIG) {
var designations = {};
// Get a list of designations from the config
for (const item in CONFIG.rmss.skill_designations) {
designations[CONFIG.rmss.skill_designations[item]] = CONFIG.rmss.skill_designations[item];
}
return designations;
}
// Determine which Stat is selected and test that it is in the current list of categories.
prepareSelectedSkillCategory(ownedskillcats, selected_category) {

View File

@ -35,8 +35,8 @@ async function preloadHandlebarsTemplates() {
"systems/rmss/templates/sheets/actors/parts/actor-fav-skills.html",
"systems/rmss/templates/sheets/actors/parts/actor-items.html",
"systems/rmss/templates/sheets/actors/parts/actor-money.html",
"systems/rmss/templates/sheets/actors/parts/actor-skill-categories-grid.html",
"systems/rmss/templates/sheets/actors/parts/actor-skills-grid.html"
"systems/rmss/templates/sheets/actors/parts/actor-skill-categories.html",
"systems/rmss/templates/sheets/actors/parts/actor-skills.html"
];
return loadTemplates(templatePaths);
}

View File

@ -81,92 +81,92 @@
"stats": {
"agility": {
"shortname": "Ag",
"temp": 1,
"potential": 2,
"basic_bonus": 3,
"racial_bonus": 4,
"special_bonus": 5,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"constitution": {
"shortname": "Co",
"temp": 6,
"potential": 7,
"basic_bonus": 8,
"racial_bonus": 9,
"special_bonus": 10,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"memory": {
"shortname": "Me",
"temp": 11,
"potential": 12,
"basic_bonus": 13,
"racial_bonus": 14,
"special_bonus": 15,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"reasoning": {
"shortname": "Re",
"temp": 16,
"potential": 17,
"basic_bonus": 18,
"racial_bonus": 19,
"special_bonus": 20,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"self_discipline": {
"shortname": "SD",
"temp": 21,
"potential": 22,
"basic_bonus": 23,
"racial_bonus": 24,
"special_bonus": 25,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"empathy": {
"shortname": "Em",
"temp": 26,
"potential": 27,
"basic_bonus": 28,
"racial_bonus": 29,
"special_bonus": 30,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"intuition": {
"shortname": "In",
"temp": 31,
"potential": 32,
"basic_bonus": 33,
"racial_bonus": 34,
"special_bonus": 35,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"presence": {
"shortname": "Pr",
"temp": 36,
"potential": 37,
"basic_bonus": 38,
"racial_bonus": 39,
"special_bonus": 40,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"quickness": {
"shortname": "Qu",
"temp": 41,
"potential": 42,
"basic_bonus": 43,
"racial_bonus": 44,
"special_bonus": 45,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
},
"strength": {
"shortname": "St",
"temp": 46,
"potential": 47,
"basic_bonus": 48,
"racial_bonus": 49,
"special_bonus": 50,
"temp": 0,
"potential": 0,
"basic_bonus": 0,
"racial_bonus": 0,
"special_bonus": 0,
"stat_bonus": 0
}
}
@ -266,24 +266,25 @@
"category" : "",
"ranks": 0,
"new_ranks": 0,
"rank_bonus": 0,
"rank_bonus": -15,
"category_bonus": 0,
"item_bonus": 0,
"special_bonus_1": 0,
"special_bonus_2": 0,
"total_bonus": 0,
"favorite": false
"favorite": false,
"designation": "None"
},
"skill_category": {
"templates": ["base"],
"applicable_stats": "St/Ag/St",
"applicable_stats": "None",
"app_stat_1": "None",
"app_stat_2": "None",
"app_stat_3": "None",
"development_cost": "0",
"ranks": 0,
"new_ranks": 0,
"rank_bonus": 0,
"rank_bonus": -15,
"stat_bonus": 0,
"prof_bonus": 0,
"special_bonus_1": 0,

View File

@ -1,35 +1,33 @@
<table>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.skillcat_name" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.applicable_stats" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.dev_cost" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.ranks" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.new_ranks" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.rank_bonus" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.stat_bonus" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.prof_bonus" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.special_bonus" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.special_bonus" }}</div></th>
<th><div class="table-font table-bold table-center">{{ localize "rmss.pc_sheet_skill_categories.total_bonus" }}</div></th>
<th><div class="table-controls">
<a class="item-create" title="Create Skill Category" data-type="skill_category"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_skill_categories.add_skillcat" }}</a>
</div></th>
<div class="skillcat-grid-container">
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.skillcat_name" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.applicable_stats" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.dev_cost" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.ranks" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.new_ranks" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.rank_bonus" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.stat_bonus" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.prof_bonus" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.special_bonus" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.special_bonus" }}</div>
<div class="skillcat-grid-heading">{{ localize "rmss.pc_sheet_skill_categories.total_bonus" }}</div>
<div class="skillcat-grid-heading">
<!-- <a class="item-create" title="Create Skill Category" data-type="skill_category"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_skill_categories.add_skillcat" }}</a>-->
</div>
{{#each skillcat as |skill_category id|}}
<tr class="item" data-item-id="{{skill_category._id}}">
<td><div class="table-font table-bold">{{skill_category.name}}</div></td>
<td><div class="table-font">{{skill_category.system.applicable_stats}}</div></td>
<td><div class="table-font">{{skill_category.system.development_cost}}</div></td>
<td><div class="table-font">{{skill_category.system.ranks}}</div></td>
<td><div class="table-font">{{skill_category.system.new_ranks}}</div></td>
<td><div class="table-font">{{skill_category.system.rank_bonus}}</div></td>
<td><div class="table-font">{{skill_category.system.stat_bonus}}</div></td>
<td><div class="table-font">{{skill_category.system.prof_bonus}}</div></td>
<td><div class="table-font">{{skill_category.system.special_bonus_1}}</div></td>
<td><div class="table-font">{{skill_category.system.special_bonus_2}}</div></td>
<td><div class="table-font">{{skill_category.system.total_bonus}}</div></td>
<td><div class="table-controls">
<a class="item-edit" title="Edit Category"><i class="fas fa-edit"></i></a>
<a class="item-delete" title="Delete Category"><i class="fas fa-trash"></i></a>
</div></td>
</tr>
<div>{{skill_category.name}}</div>
<div>{{skill_category.system.applicable_stats}}</div>
<div>{{skill_category.system.development_cost}}</div>
<div>{{skill_category.system.ranks}}</div>
<div>{{skill_category.system.new_ranks}}</div>
<div>{{skill_category.system.rank_bonus}}</div>
<div>{{skill_category.system.stat_bonus}}</div>
<div>{{skill_category.system.prof_bonus}}</div>
<div>{{skill_category.system.special_bonus_1}}</div>
<div>{{skill_category.system.special_bonus_2}}</div>
<div>{{skill_category.system.total_bonus}}</div>
<div>
<a class="item-edit" title="Edit Category" data-item-id="{{skill_category._id}}"><i class="fas fa-edit"></i></a>
<a class="item-delete item" title="Delete Category" data-item-id="{{skill_category._id}}"><i class="fas fa-trash"></i></a>
</div>
{{/each}}
</table>
</div>

View File

@ -1,35 +1,36 @@
<table>
<th><div class="skill-name skill-headeritem">{{ localize "rmss.pc_sheet_skills.favorite" }}</div></th>
<th><div class="skill-name skill-headeritem">{{ localize "rmss.pc_sheet_skills.skill_name" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.ranks" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.new_ranks" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.rank_bonus" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.category_bonus" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.item_bonus" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.special_bonus" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.special_bonus" }}</div></th>
<th><div class="skill-entry skill-headeritem">{{ localize "rmss.pc_sheet_skills.total_bonus" }}</div></th>
<th><div class="skill-controls">
<a class="skill-control item-create" title="Create Skill" data-type="skill"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_skills.add_skill" }}</a>
</div></th>
<div class="skills-grid-container">
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.favorite" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.skill_name" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.ranks" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.new_ranks" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.rank_bonus" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.category_bonus" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.item_bonus" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.special_bonus" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.special_bonus" }}</div>
<div class="skills-grid-heading">{{ localize "rmss.pc_sheet_skills.total_bonus" }}</div>
<div class="skills-grid-heading">
<!--<a class="item-create" title="Create Skill" data-type="skill"><i class="fas fa-plus"></i>{{ localize "rmss.pc_sheet_skills.add_skill" }}</a>-->
</div>
{{#each playerskill as |skill id|}}
<tr class="item" data-item-id="{{skill._id}}">
<td><div class="skill-entry item-prop"><input type="checkbox" name="system.favorite" {{checked skill.system.favorite}}/></div></td>
<td><div class="skill-name">
<h4>{{skill.name}}</h4>
</div></td>
<td><div class="skill-entry item-prop">{{skill.system.ranks}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.new_ranks}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.rank_bonus}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.category_bonus}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.item_bonus}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.special_bonus_1}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.special_bonus_2}}</div></td>
<td><div class="skill-entry item-prop">{{skill.system.total_bonus}}</div></td>
<td><div class="skill-controls">
<a class="skill-control item-edit" title="Edit Skill"><i class="fas fa-edit"></i></a>
<a class="skill-control item-delete" title="Delete Skill"><i class="fas fa-trash"></i></a>
</div></td>
</tr>
{{#if skill.system.favorite}}
<div><a class="skill-favorite" data-item-id="{{skill._id}}"><i class="fa-regular fa-square-check"></i></a></div>
{{else}}
<div><a class="skill-favorite" data-item-id="{{skill._id}}"><i class="fa-regular fa-square"></i></a></div>
{{/if}}
<!--<div><input type="checkbox" name="system.favorite" {{checked skill.system.favorite}}/></div>-->
<div>{{skill.name}}</div>
<div>{{skill.system.ranks}}</div>
<div>{{skill.system.new_ranks}}</div>
<div>{{skill.system.rank_bonus}}</div>
<div>{{skill.system.category_bonus}}</div>
<div>{{skill.system.item_bonus}}</div>
<div>{{skill.system.special_bonus_1}}</div>
<div>{{skill.system.special_bonus_2}}</div>
<div>{{skill.system.total_bonus}}</div>
<div>
<a class="item-edit" title="Edit Skill" data-item-id="{{skill._id}}"><i class="fas fa-edit"></i></a>
<a class="item-delete" title="Delete Skill" data-item-id="{{skill._id}}"><i class="fas fa-trash"></i></a>
</div>
{{/each}}
</table>
</div>

View File

@ -86,11 +86,11 @@
</div>
<div class="tab skill_categories" data-group="primary" data-tab="SkillCategory">
{{> "systems/rmss/templates/sheets/actors/parts/actor-skill-categories-grid.html" }}
{{> "systems/rmss/templates/sheets/actors/parts/actor-skill-categories.html" }}
</div>
<div class="tab skills" data-group="primary" data-tab="Skills">
{{> "systems/rmss/templates/sheets/actors/parts/actor-skills-grid.html" }}
{{> "systems/rmss/templates/sheets/actors/parts/actor-skills.html" }}
</div>
<div class="tab equipment" data-group="primary" data-tab="Equipment">

View File

@ -1,13 +1,7 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img src="{{item.img}}" data-edit="img" title="{{item.name}}" height="64" width="64"/>
{{#if item.isOwned}}
<h1>{{item.name}}</h1>
{{else}}
<h1><input name="name" type="text" value="{{item.name}}" placeholder="{{ localize 'Name' }}"/></h1>
{{/if}}
</header>
<div class="sheet-content">
<div class="applicable-stats-grid-container">

View File

@ -10,6 +10,12 @@
{{selectOptions owned_skillcats selected=selected_skillcat }}
</select>
</div>
<div>
Skill Designation
<select name="system.designation" class="app-stat-selector" value="{{system.designation}}" itemid="{{ item._id }}">
{{selectOptions designations selected=system.designation}}
</select>
</div>
<div>
<table>
<tr>