Skip to content

Commit

Permalink
Dice fix, Weapon Value 0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Futil committed Nov 23, 2020
1 parent b938b72 commit b624577
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
28 changes: 19 additions & 9 deletions module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ export class MothershipActor extends Actor {
this.updateEmbeddedEntity('OwnedItem', item);
}
else {
let actor = this;
let speaker = ChatMessage.getSpeaker({ actor });
ChatMessage.create({
speaker,
content: item.data.ammo > 0 ? `I need to reload my ` + item.name + "!" : "I'm out of ammo!",
type: CHAT_MESSAGE_TYPES.EMOTE
},
{ chatBubble: true });
// let actor = this;
// let speaker = ChatMessage.getSpeaker({ actor });
// ChatMessage.create({
// speaker,
// content: item.data.ammo > 0 ? `I need to reload my ` + item.name + "!" : "I'm out of ammo!",
// type: CHAT_MESSAGE_TYPES.EMOTE
// },
// { chatBubble: true });
return;
}
}
Expand Down Expand Up @@ -231,7 +231,7 @@ export class MothershipActor extends Actor {
console.log("Got here baybee");

// Roll
let diceformular = "1d100-1";
let diceformular = "1d100";

console.log(attribute);

Expand All @@ -247,6 +247,16 @@ export class MothershipActor extends Actor {
let a = new Roll(diceformular, {});
a.roll();

if(a._total == 100){
r.results[0] = 0;
r._total = 0;
}

if(a._total == 100){
r.results[0] = 0;
a._total = 0;
}

let damageRoll = 0;
if (item.type == "weapon") {
damageRoll = new Roll(item.data.damage);
Expand Down
10 changes: 0 additions & 10 deletions module/actor/ship-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,6 @@ export class MothershipShipSheet extends ActorSheet {
}

this.actor.updateEmbeddedEntity('OwnedItem', item);

let actor = this.actor;
let speaker = ChatMessage.getSpeaker({ actor });
ChatMessage.create({
speaker,
content: `Reloading ` + item.name + "...",
type: CHAT_MESSAGE_TYPES.EMOTE
},
{ chatBubble: true });

});

// Rollable Item/Anything with a description that we want to click on.
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mosh",
"title": "Mothership",
"description": "The unofficial Mothership system for FoundryVTT",
"version": "0.0.8",
"version": "0.0.9",
"minimumCoreVersion": "0.5.5",
"compatibleCoreVersion": "0.5.5",
"templateVersion": 2,
Expand Down
15 changes: 15 additions & 0 deletions templates/item/item-weapon-sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ <h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeh
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="ranges">Ranges</a>
<a class="item" data-tab="item">Item</a>
</nav>

{{!-- Sheet Body --}}
Expand Down Expand Up @@ -80,5 +81,19 @@ <h1 class="charname"><input name="name" type="text" value="{{item.name}}" placeh
</div>
</div>
</div>

{{!-- Item Tab --}}
<div class="tab ranges" data-group="primary" data-tab="item">
<div class="grid grid-3col">
<div class="resource">
<label class="resource-label">Value</label>
<input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number" />
</div>
<div class="resource">
<label class="resource-label">Weight</label>
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number" />
</div>
</div>
</div>
</section>
</form>

0 comments on commit b624577

Please sign in to comment.