Review sheet and headers
This commit is contained in:
parent
e887828d53
commit
7974897c03
@ -84,10 +84,17 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollIDR( diceValue) {
|
||||
async rollIDR( itemId, diceValue) {
|
||||
let item = this.actor.data.items.get( itemId) ?? {name: "Unknown"}
|
||||
let myRoll = new Roll(diceValue+"x").roll({ async: false })
|
||||
//await PegasusUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
myRoll.toMessage()
|
||||
await PegasusUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
let chatData = {
|
||||
user: game.user.id,
|
||||
rollMode: game.settings.get("core", "rollMode"),
|
||||
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
|
||||
content: `${this.actor.name} has roll IDR for ${item.name} : ${myRoll.total}`
|
||||
}
|
||||
ChatMessage.create(chatData)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -191,12 +198,12 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
} );
|
||||
|
||||
html.find('.ammo-minus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
this.actor.incDecAmmo( li.data("item-id"), -1 );
|
||||
} );
|
||||
html.find('.ammo-plus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.incDecAmmo( li.data("item-id"), +1 );
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
this.actor.incDecAmmo( li.data("item-id"), +1 )
|
||||
} );
|
||||
|
||||
html.find('.momentum-minus').click(event => {
|
||||
@ -240,7 +247,8 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
});
|
||||
html.find('.roll-idr').click((event) => {
|
||||
const diceValue = $(event.currentTarget).data("dice-value")
|
||||
this.rollIDR( diceValue)
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
this.rollIDR( li.data("item-id"), diceValue)
|
||||
})
|
||||
|
||||
html.find('.roll-spec').click((event) => {
|
||||
|
@ -20,15 +20,19 @@ export class PegasusCombat extends Combat {
|
||||
_onUpdate(changed, options, userId) {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async checkTurnPosition() {
|
||||
while (game.combat.turn > 0) {
|
||||
await game.combat.previousTurn()
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async decInitBy10( combatantId, value) {
|
||||
const combatant = game.combat.combatants.get(combatantId)
|
||||
let initValue = combatant.initiative + value
|
||||
await game.combat.setInitiative(combatantId, initValue)
|
||||
while (game.combat.turn > 0) {
|
||||
await game.combat.previousTurn()
|
||||
}
|
||||
console.log("COMBAT", game.combat )
|
||||
setTimeout( this.checkTurnPosition, 400) // The setInitiative is no more blocking for unknown reason
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -499,20 +499,18 @@ export class PegasusUtility {
|
||||
diceFormulaTab.push(this.getFoundryDiceFromLevel(diceGroup.level))
|
||||
}
|
||||
let diceFormula = '{' + diceFormulaTab.join(', ') + '}kh';
|
||||
console.log(diceFormula);
|
||||
|
||||
// Performs roll
|
||||
let myRoll = rollData.roll;
|
||||
if (!myRoll) { // New rolls only of no rerolls
|
||||
myRoll = new Roll(diceFormula).roll({ async: false });
|
||||
console.log("ROLL : ", diceFormula);
|
||||
console.log("ROLL : ", diceFormula)
|
||||
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"));
|
||||
rollData.roll = myRoll
|
||||
}
|
||||
|
||||
// Final score and keep data
|
||||
rollData.finalScore = myRoll.total + dicePool[0].statmod;
|
||||
console.log("ROLLLL!!!!", rollData);
|
||||
|
||||
if (rollData.damages) {
|
||||
let dmgFormula = this.getFoundryDiceFromLevel(rollData.damages.value)
|
||||
|
@ -183,6 +183,6 @@
|
||||
"templateVersion": 87,
|
||||
"title": "Pegasus RPG",
|
||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||
"version": "0.5.5",
|
||||
"version": "0.5.6",
|
||||
"background" : "./images/ui/pegasus_welcome_page.webp"
|
||||
}
|
||||
|
@ -359,6 +359,9 @@
|
||||
<span class="item-field-label-short">
|
||||
<label class="short-label">Status</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Action</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">DMG Roll</label>
|
||||
</span>
|
||||
@ -391,6 +394,8 @@
|
||||
</label>
|
||||
</span>
|
||||
|
||||
<span class="item-field-label-medium">{{upperFirst power.data.action}}</span>
|
||||
|
||||
<span class="item-field-label-medium"><a class="power-dmg-roll">
|
||||
{{#if power.data.dmgroll}}
|
||||
{{upper power.data.dmgstatistic}}
|
||||
@ -475,7 +480,7 @@
|
||||
<label class="short-label">Weight</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Roll IDR</label>
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
</li>
|
||||
{{#each moneys as |money key|}}
|
||||
@ -531,7 +536,7 @@
|
||||
<label class="short-label">Weight</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Roll IDR</label>
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
</li>
|
||||
{{#each weapons as |weapon key|}}
|
||||
@ -541,9 +546,16 @@
|
||||
<span class="item-field-label-short"><label>{{upper weapon.data.statistic}}</label></span>
|
||||
<span class="item-field-label-short"><label>{{upper weapon.data.damagestatistic}}</label></span>
|
||||
<span class="item-field-label-short"><label>{{weapon.data.damageDice}}</label></span>
|
||||
<span class="item-field-label-medium"><label>{{weapon.data.ammocurrent}}/{{weapon.data.ammomax}}
|
||||
(<a class="ammo-minus plus-minus-button"> -</a>/<a class="ammo-plus plus-minus-button">+</a>)
|
||||
</label></span>
|
||||
|
||||
{{#if (gt weapon.data.ammomax 0)}}
|
||||
<span class="item-field-label-medium"><label>{{weapon.data.ammocurrent}}/{{weapon.data.ammomax}}
|
||||
(<a class="ammo-minus plus-minus-button"> -</a>/<a class="ammo-plus plus-minus-button">+</a>)
|
||||
</label></span>
|
||||
{{else}}
|
||||
<span class="item-field-label-medium"><label>-</label>
|
||||
</span>
|
||||
{{/if}}
|
||||
|
||||
<span class="item-field-label-medium">
|
||||
{{#if (count weapon.data.effects)}}
|
||||
{{#if weapon.data.activated}}
|
||||
@ -584,7 +596,7 @@
|
||||
<label class="short-label">Stat</label>
|
||||
</span>
|
||||
<span class="item-field-label-short">
|
||||
<label class="short-label">DMG</label>
|
||||
<label class="short-label">DMG RES</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Loc</label>
|
||||
@ -596,7 +608,7 @@
|
||||
<label class="short-label">Weight</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Roll IDR</label>
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
</li>
|
||||
{{#each armors as |armor key|}}
|
||||
@ -653,7 +665,7 @@
|
||||
<label class="short-label">Weight</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Roll IDR</label>
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
</li>
|
||||
{{#each shields as |shield key|}}
|
||||
@ -710,7 +722,7 @@
|
||||
<label class="short-label">Weight</label>
|
||||
</span>
|
||||
<span class="item-field-label-medium">
|
||||
<label class="short-label">Roll IDR</label>
|
||||
<label class="short-label">IDR</label>
|
||||
</span>
|
||||
</li>
|
||||
{{#each containersTree as |equip key|}}
|
||||
|
@ -97,11 +97,11 @@
|
||||
<input type="text" class="input-numeric-short padd-right" name="data.vehicledamagetypelevel" value="{{data.vehicledamagetypelevel}}" data-dtype="Number"/>
|
||||
</li>
|
||||
|
||||
<li class="flexrow"><label class="generic-label">Ammon - Current</label>
|
||||
<li class="flexrow"><label class="generic-label">Ammo - Current</label>
|
||||
<input type="text" class="input-numeric-short padd-right" name="data.ammocurrent" value="{{data.ammocurrent}}" data-dtype="Number"/>
|
||||
</li>
|
||||
|
||||
<li class="flexrow"><label class="generic-label">Ammon - Max</label>
|
||||
<li class="flexrow"><label class="generic-label">Ammo - Max</label>
|
||||
<input type="text" class="input-numeric-short padd-right" name="data.ammomax" value="{{data.ammomax}}" data-dtype="Number"/>
|
||||
</li>
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
<li class="item flexrow">
|
||||
<span class="stat-label status-small-label status-col-name"><label class="status-small-label"><strong>Status</strong></label></span>
|
||||
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Cur</label></span>
|
||||
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Max</label></span>
|
||||
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Mod</label></span>
|
||||
<span class="status-header-label status-small-label no-grow"><label class="status-small-label">Max</label></span>
|
||||
</li>
|
||||
{{#each data.secondary as |stat2 key|}}
|
||||
<li class="item flexrow " data-attr-key="{{key}}">
|
||||
@ -18,8 +18,8 @@
|
||||
</label>
|
||||
</span>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
||||
</li>
|
||||
{{/each}}
|
||||
<li class="item flexrow " data-key="nrg">
|
||||
@ -27,8 +27,9 @@
|
||||
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
|
||||
</span>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
||||
<input type="text" class="padd-right status-small-label no-grow" name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||
<span class="small-label status-small-label"> /{{data.nrg.absolutemax}}</span>
|
||||
</li>
|
||||
<li class="item flexrow " data-key="nrg">
|
||||
<span class="stat-label flexrow status-col-name" name="activated-nrg">
|
||||
|
Loading…
Reference in New Issue
Block a user