click to change curShots
This commit is contained in:
@@ -358,6 +358,24 @@ export class MothershipActorSheet extends ActorSheet {
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//increase shots
|
||||
html.on('mousedown', '.weapon-shots', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
const item = duplicate(this.actor.getEmbeddedDocument("Item", li.dataset.itemId))
|
||||
if (event.button == 0) {
|
||||
if (item.system.curShots >= 0 && item.system.curShots < item.system.shots && item.system.ammo > 0) {
|
||||
item.system.curShots = Number(item.system.curShots) + 1;
|
||||
item.system.ammo = Number(item.system.ammo) - 1;
|
||||
}
|
||||
} else if (event.button == 2) {
|
||||
if (item.system.curShots > 0) {
|
||||
item.system.curShots = Number(item.system.curShots) - 1;
|
||||
item.system.ammo = Number(item.system.ammo) + 1;
|
||||
}
|
||||
}
|
||||
this.actor.updateEmbeddedDocuments('Item', [item]);
|
||||
});
|
||||
|
||||
//Reload Shots
|
||||
html.on('mousedown', '.weapon-reload', ev => {
|
||||
const li = ev.currentTarget.closest(".item");
|
||||
|
||||
@@ -1734,6 +1734,8 @@ export class MothershipActor extends Actor {
|
||||
}
|
||||
//log what was done
|
||||
console.log(`Rolled on table ID: ${tableId}, with: rollString:${rollString}, aimFor:${aimFor}, zeroBased:${zeroBased}, checkCrit:${checkCrit}, rollAgainst:${rollAgainst}, comparison:${comparison}`);
|
||||
//return messageData
|
||||
return [messageData];
|
||||
}
|
||||
|
||||
//central adding addribute function | TAKES '1d10','low' | RETURNS player selected attribute. If parameters are null, it asks the player.
|
||||
@@ -2236,8 +2238,8 @@ export class MothershipActor extends Actor {
|
||||
});
|
||||
//log what was done
|
||||
console.log(`Rolled damage on:${weapon.name}`);
|
||||
//exit
|
||||
return;
|
||||
//return messageData
|
||||
return [messageData];
|
||||
}
|
||||
//rest save
|
||||
if (attribute === 'restSave') {
|
||||
@@ -2734,13 +2736,15 @@ export class MothershipActor extends Actor {
|
||||
speaker: {actor: this.id, token: this.token, alias: this.name},
|
||||
content: messageContent
|
||||
},{keepId:true});
|
||||
|
||||
//is DSN active?
|
||||
if(game.modules.get("dice-so-nice").active){
|
||||
//wait for dice
|
||||
await game.dice3d.waitFor3DAnimationByMessageID(chatId);
|
||||
}
|
||||
//log what was done
|
||||
console.log(`Rolled a check on: ${attribute}, with: rollString:${rollString}, aimFor:${aimFor}, skill:${skill}, skillValue:${skillValue}, weapon:${weapon.name}`);
|
||||
//return messageData
|
||||
return [messageData];
|
||||
}
|
||||
|
||||
//central function to modify actors | TAKES 'system.other.stress.value',-1,'-1d5',true | RETURNS change details, and optional chat message
|
||||
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
"id": "mosh",
|
||||
"title": "MoSh - Unofficial Mothership",
|
||||
"description": "The unofficial Mothership system for FoundryVTT.",
|
||||
"version": "0.5.15",
|
||||
"version": "0.5.17",
|
||||
"esmodules": [
|
||||
"module/mosh.js"
|
||||
],
|
||||
@@ -132,8 +132,8 @@
|
||||
"primaryTokenAttribute": "health",
|
||||
"secondaryTokenAttribute": "other.stress",
|
||||
"url": "https://github.com/Futil/foundry-mothership",
|
||||
"manifest": "https://raw.githubusercontent.com/Futil/foundry-mothership/0.5.15/system.json",
|
||||
"download": "https://github.com/Futil/foundry-mothership/releases/download/0.5.15/foundry-mothership.zip",
|
||||
"manifest": "https://raw.githubusercontent.com/Futil/foundry-mothership/0.5.17/system.json",
|
||||
"download": "https://github.com/Futil/foundry-mothership/releases/download/0.5.17/foundry-mothership.zip",
|
||||
"license": "LICENSE.txt",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
@@ -610,10 +610,14 @@
|
||||
{{/if}}
|
||||
{{#if weapon.system.useAmmo}}
|
||||
{{#if (compare 'int' weapon.system.curShots '===' weapon.system.shots)}}
|
||||
<div class="skill-stat">{{weapon.system.curShots}}/{{weapon.system.shots}}</div>
|
||||
<div class="skill-stat">
|
||||
<a class="weapon-shots list-roll" title="Edit Weapon">{{weapon.system.curShots}}/{{weapon.system.shots}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="skill-stat">{{weapon.system.curShots}}/{{weapon.system.shots}} <i
|
||||
class="fas fa-sync weapon-reload list-roll"></i></div>
|
||||
<div class="skill-stat">
|
||||
<a class="weapon-shots list-roll">{{weapon.system.curShots}}/{{weapon.system.shots}}</a>
|
||||
<a class="weapon-reload list-roll"><i class="fas fa-sync"></i></a>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<div class="skill-stat">N/A</div>
|
||||
|
||||
Reference in New Issue
Block a user