GH-11 Crew Reputation

- Closes #11
- Changes the crew_feature to crew_reputation
- Adds crew_reputation items
- Adds concept of "distinct" item types
- Removes some unnecessary logs
This commit is contained in:
Peter Varaksin 2020-05-04 19:28:55 +03:00
parent cfce05a32b
commit 7b33126768
9 changed files with 30 additions and 19 deletions

View file

@ -8,9 +8,13 @@ export class BladesHelpers {
*/
static removeDuplicatedItemType(item_data, actor) {
let distinct_types = ["crew_reputation", "class", "vice", "background", "heritage"];
let should_be_distinct = distinct_types.includes(item_data.type);
// If the Item has the exact same name - remove it from list.
// Remove Duplicate items from the array.
actor.items.forEach(i => {
if (i.data.name === item_data.name) {
let has_double = (item_data.type === i.data.type);
if (i.data.name === item_data.name || (should_be_distinct && has_double)) {
actor.deleteOwnedItem(i.id);
}
});

View file

@ -19,7 +19,7 @@ export class BladesItemSheet extends ItemSheet {
/** @override */
get template() {
const path = "systems/blades-in-the-dark/templates/items";
let simple_item_types = ["background", "heritage", "vice", "crew_feature"];
let simple_item_types = ["background", "heritage", "vice", "crew_reputation"];
let template_name = `${this.item.data.type}`;
if (simple_item_types.indexOf(this.item.data.type) >= 0) {

View file

@ -11,7 +11,6 @@ export class BladesItem extends Item {
const item_data = this.data;
const data = item_data.data;
console.log("prepare item " + item_data.type);
if (item_data.type === "cohort") {

View file

@ -1,8 +0,0 @@
{"name":"Monstrous","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":500001,"flags":{},"_id":"87ZgRSEjFh5Dxcne"}
{"name":"Serene","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":800001,"flags":{},"_id":"9SxjN70BavgAwmRT"}
{"name":"Transcendent","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":900001,"flags":{},"_id":"CYb3q09KmQlpq9cZ"}
{"name":"Radiant","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":600001,"flags":{},"_id":"ES5PAowUQOaUVC95"}
{"name":"Ferocious","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":400001,"flags":{},"_id":"HgQ1oTvoWwaVMmFi"}
{"name":"Alluring","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":200001,"flags":{},"_id":"RxKQBii0463Ow5Tt"}
{"name":"Cruel","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":300001,"flags":{},"_id":"TBDvFVgXDLeLkPmB"}
{"name":"Sinister","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":700001,"flags":{},"_id":"u0Dpn1VcDO7OJBRy"}

16
packs/crew_reputation.db Normal file
View file

@ -0,0 +1,16 @@
{"name":"Ambitious","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":500001,"flags":{},"_id":"87ZgRSEjFh5Dxcne"}
{"name":"Brutal","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":800001,"flags":{},"_id":"9SxjN70BavgAwmRT"}
{"name":"Daring","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":900001,"flags":{},"_id":"CYb3q09KmQlpq9cZ"}
{"name":"Honorable","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":600001,"flags":{},"_id":"ES5PAowUQOaUVC95"}
{"name":"Professional","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":400001,"flags":{},"_id":"HgQ1oTvoWwaVMmFi"}
{"name":"Savvy","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":200001,"flags":{},"_id":"RxKQBii0463Ow5Tt"}
{"name":"Subtle","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":300001,"flags":{},"_id":"TBDvFVgXDLeLkPmB"}
{"name":"Strange","permission":{"default":0},"type":"crew_reputation","data":{"description":""},"folder":null,"sort":700001,"flags":{},"_id":"u0Dpn1VcDO7OJBRy"}
{"name":"Monstrous","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":500001,"flags":{},"_id":"87ZgRSEjFh5Dxcne"}
{"name":"Serene","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":800001,"flags":{},"_id":"9SxjN70BavgAwmRT"}
{"name":"Transcendent","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":900001,"flags":{},"_id":"CYb3q09KmQlpq9cZ"}
{"name":"Radiant","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":600001,"flags":{},"_id":"ES5PAowUQOaUVC95"}
{"name":"Ferocious","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":400001,"flags":{},"_id":"HgQ1oTvoWwaVMmFi"}
{"name":"Alluring","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":200001,"flags":{},"_id":"RxKQBii0463Ow5Tt"}
{"name":"Cruel","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":300001,"flags":{},"_id":"TBDvFVgXDLeLkPmB"}
{"name":"Sinister","permission":{"default":0},"type":"crew_feature","data":{"description":""},"folder":null,"sort":700001,"flags":{},"_id":"u0Dpn1VcDO7OJBRy"}

View file

@ -3,4 +3,4 @@
{"_id":"TiL4AssY9Ryty6f9","name":"The Dagger Isles","permission":{"default":0},"type":"heritage","data":{"description":"If you want to be a rootless wanderer you could be from the Dagger Isles. People there often grow up on ships and travel a lot before settling down. Theyre known as corsairs and merchants who live without lightning barriers - dealing with spirits in other ways."},"sort":200000,"flags":{}}
{"_id":"Tk61Y7K84GgQpqPz","name":"Skovlan","permission":{"default":0},"type":"heritage","data":{"description":"If you want to be from a marginalized people, you could be from Skovlan, the island kingdom just across the sea from Doskvol. Skovlan was last to be brought under Imperial rule, over the course of the 36-year Unity War (which ended only a few years ago). Many Skovlander refugees who lost their homes and jobs in the destruction of the war have come to Doskvol seeking new opportunities."},"sort":500000,"flags":{}}
{"_id":"WRzLNozCfzFLg0d6","name":"Tycheros","permission":{"default":0},"type":"heritage","data":{"description":"If you want to be weird, you can be from Tycheros. Its a semi-mythical place, far away beyond the northern Void Sea. Everyone says that the people there are part-demon. If you choose Tycherosi heritage, also create a demonic telltale(like black shark eyes, feathers instead of hair, etc.) that marks your character."},"sort":600000,"flags":{}}
{"_id":"fKEJOkqoAwinyzrm","name":"Akoros","permission":{"default":0},"type":"heritage","data":{"description":"Akoros is the largest and most industrialized land in the Imperium, and is home to the capitol city as well as Duskwall itself. Theyre known as a diverse conglomeration of cultures that have grown together in close proximity for centuries, somewhat like Europe."},"sort":100000,"flags":{}}
{"_id":"fKEJOkqoAwinyzrm","name":"Akoros","permission":{"default":0},"type":"heritage","data":{"description":"Akoros is the largest and most industrialized land in the Imperium, and is home to the capitol city as well as Duskwall itself. Theyre known as a diverse conglomeration of cultures that have grown together in close proximity for centuries, somewhat like Europe."},"sort":100000,"flags":{}}

View file

@ -58,10 +58,10 @@
"entity": "Item"
},
{
"name": "Crew Features",
"label": "Crew Features",
"name": "Crew Reputation",
"label": "Crew Reputation",
"system": "blades-in-the-dark",
"path": "./packs/crew_features.db",
"path": "./packs/crew_reputation.db",
"entity": "Item"
},
{

View file

@ -243,7 +243,7 @@
},
"armor": false
},
"crew_feature": {
"crew_reputation": {
"templates": ["default"]
},
"crew_upgrade": {

View file

@ -8,10 +8,10 @@
<input type="text" id="crew-name" name="name" value="{{actor.name}}">
</div>
<div id="crew-features">
<div class="item-class-label">Crew Features (add 2)</div>
<div id="crew-reputation">
<div class="item-class-label">Crew Reputation</div>
{{#each actor.items as |item id|}}
{{#eq item.type "crew_feature"}}
{{#eq item.type "crew_reputation"}}
<div class="item flex-horizontal" data-item-id="{{item._id}}">
<div class="item-body item-sheet-open flex-horizontal">
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24"/>