Start 0.8 support

This commit is contained in:
2021-05-23 00:03:37 +02:00
parent 3d23807820
commit b93a29f7fc
16 changed files with 63 additions and 46 deletions

View File

@ -55,10 +55,10 @@ export class SoSActorSheet extends ActorSheet {
if ( a.name > b.name ) return 1;
return -1;
});
formData.gears = this.actor.data.items.filter( item => item.type == 'gear').concat( this.actor.data.items.filter( item => item.type == 'container') );
formData.gears = this.actor.data.items.filter( item => item.type == 'gear').concat( this.actor.data.items.filter( item => item.type == 'container') );
// Build the gear tree
formData.gearsRoot = formData.gears.filter(item => item.data.containerid == "");
formData.gearsRoot = formData.gears.filter(item => item.data.data.containerid == "");
for ( let container of formData.gearsRoot) {
if ( container.type == 'container') {
container.data.contains = []
@ -134,12 +134,12 @@ export class SoSActorSheet extends ActorSheet {
});
html.find('.skill-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const skill = this.actor.getOwnedItem(li.data("item-id"));
const skill = this.actor.get.items(li.data("item-id"));
this.actor.rollSkill(skill);
});
html.find('.weapon-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weapon = this.actor.getOwnedItem(li.data("item-id"));
const weapon = this.actor.get.items(li.data("item-id"));
this.actor.rollWeapon(weapon);
});
html.find('.skill-value').change((event) => {

View File

@ -38,7 +38,7 @@ export class SoSCardDeck {
this.cleanCardList();
// Randomize deck
while (this.data.deck.length != NB_POKER_CARD) {
let idx = new Roll("1d54").roll().total;
let idx = new Roll("1d54").roll( {async:false} ).total;
if (!this.data.cardState[idx - 1]) {
if (idx == 53) { // Red Joker
this.data.deck.push( { cardName: 'jr' } );