Add dmg roll for powers

This commit is contained in:
sladecraven 2022-02-25 14:53:19 +01:00
parent 7ff89c34b8
commit 1ea1b3b1a8
11 changed files with 59 additions and 61 deletions

BIN
images/ui/pc_sheet_bg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 KiB

View File

@ -138,11 +138,19 @@ export class PegasusActorSheet extends ActorSheet {
let itemId = li.data("item-id"); let itemId = li.data("item-id");
this.actor.updatePerkStatus( itemId, ev.currentTarget.value) this.actor.updatePerkStatus( itemId, ev.currentTarget.value)
}); });
html.find('.power-cost-spent').change(ev => { html.find('.power-cost-spent').change(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id"); let itemId = li.data("item-id");
this.actor.updatePowerSpentCost( itemId, ev.currentTarget.value) this.actor.updatePowerSpentCost( itemId, ev.currentTarget.value)
}); });
html.find('.power-dmg-roll').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.powerDmgRoll( itemId )
})
html.find('.perk-used').change(ev => { html.find('.perk-used').change(ev => {
const li = $(ev.currentTarget).parents(".item") const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id") let itemId = li.data("item-id")

View File

@ -982,9 +982,18 @@ export class PegasusActor extends Actor {
} }
/* -------------------------------------------- */
powerDmgRoll( itemId) {
let power = this.data.items.get(itemId)
if (power ) {
power = duplicate(power)
this.rollPool( power.data.dmgstatistic )
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
rollPool(statKey, useShield = false) { rollPool(statKey, useShield = false) {
let stat = this.getStat(statKey); let stat = this.getStat(statKey)
if (stat) { if (stat) {
let rollData = this.getCommonRollData(statKey, useShield) let rollData = this.getCommonRollData(statKey, useShield)
rollData.mode = "stat" rollData.mode = "stat"
@ -998,7 +1007,7 @@ export class PegasusActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
rollUnarmedAttack() { rollUnarmedAttack() {
let stat = this.getStat('com'); let stat = this.getStat('com')
if (stat) { if (stat) {
let rollData = this.getCommonRollData(statKey) let rollData = this.getCommonRollData(statKey)
rollData.mode = "stat" rollData.mode = "stat"

View File

@ -386,7 +386,8 @@ export class PegasusItemSheet extends ItemSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
async _onDrop(event) { async _onDrop(event) {
if (this.object.type == 'weapon' || this.object.type == 'shield' || this.object.type == 'armor' || this.object.type == 'shield') { if (this.object.type == 'weapon' || this.object.type == 'armor' || this.object.type == 'shield'
|| this.object.type == 'equipment') {
let data = event.dataTransfer.getData('text/plain'); let data = event.dataTransfer.getData('text/plain');
if (data) { if (data) {
let dataItem = JSON.parse(data); let dataItem = JSON.parse(data);

View File

@ -5,7 +5,7 @@ export class PegasusRollDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async create(actor, rollData ) { static async create(actor, rollData ) {
let options = { classes: ["WotGdialog"], width: 620, height: 380, 'z-index': 99999 }; let options = { classes: ["PegasusDialog"], width: 620, height: 380, 'z-index': 99999 };
let html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-generic.html', rollData); let html = await renderTemplate('systems/fvtt-pegasus-rpg/templates/roll-dialog-generic.html', rollData);
return new PegasusRollDialog(actor, rollData, html, options ); return new PegasusRollDialog(actor, rollData, html, options );

View File

@ -320,6 +320,7 @@ table {border: 1px solid #7a7971;}
height: 40px; height: 40px;
border-top: 1px solid #AAA; border-top: 1px solid #AAA;
border-bottom: 1px solid #AAA; border-bottom: 1px solid #AAA;
color: #000000;
} }
.fvtt-pegasus-rpg .tabs .item { .fvtt-pegasus-rpg .tabs .item {
@ -376,9 +377,10 @@ table {border: 1px solid #7a7971;}
/* ======================================== */ /* ======================================== */
/* Sheet */ /* Sheet */
.window-app.sheet .window-content .sheet-header{ .window-app.sheet .window-content .sheet-header{
color: rgba(168, 139, 139, 0.5); background: url("../images/ui/pc_sheet_bg.webp")
} }
/* background: #011d33 url("../images/ui/fond1.webp") repeat left top;*/ /* background: #011d33 url("../images/ui/fond1.webp") repeat left top;*/
/*color: rgba(168, 139, 139, 0.5);*/
.window-app.sheet .window-content .sheet-header input[type="text"], .window-app.sheet .window-content .sheet-header input[type="number"], .window-app.sheet .window-content .sheet-header input[type="password"], .window-app.sheet .window-content .sheet-header input[type="date"], .window-app.sheet .window-content .sheet-header input[type="time"] { .window-app.sheet .window-content .sheet-header input[type="text"], .window-app.sheet .window-content .sheet-header input[type="number"], .window-app.sheet .window-content .sheet-header input[type="password"], .window-app.sheet .window-content .sheet-header input[type="date"], .window-app.sheet .window-content .sheet-header input[type="time"] {
color: rgba(36, 37, 37, 0.75); color: rgba(36, 37, 37, 0.75);
@ -389,6 +391,7 @@ table {border: 1px solid #7a7971;}
.window-app .window-content, .window-app.sheet .window-content .sheet-body{ .window-app .window-content, .window-app.sheet .window-content .sheet-body{
font-size: 0.8rem; font-size: 0.8rem;
background: url("../images/ui/pc_sheet_bg.webp") repeat left top;
} }
/* background: rgba(245,245,240,0.6) url("../images/ui/sheet_background.webp") left top;*/ /* background: rgba(245,245,240,0.6) url("../images/ui/sheet_background.webp") left top;*/
@ -414,7 +417,8 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
line-height: 1.5rem; line-height: 1.5rem;
border-top: 0 none; border-top: 0 none;
border-bottom: 0 none; border-bottom: 0 none;
color: rgba(52, 52, 52, 0.95); background-color:black;
color:beige;
} }
/* background: rgb(245,245,240) url("../images/ui/fond4.webp") repeat left top;*/ /* background: rgb(245,245,240) url("../images/ui/fond4.webp") repeat left top;*/
@ -453,18 +457,6 @@ section.sheet-body:after {
width: 50px; width: 50px;
} }
#vie-plus, #vie-moins, #endurance-plus, #endurance-moins, #fatigue-plus, #fatigue-moins, #ptreve-actuel-plus, #ptreve-actuel-moins, .monnaie-plus, .monnaie-moins {
display: inline-block;
width: 1.25rem;
background: rgba(30, 25, 20, 1);
text-align: center;
border: 1px solid rgba(72, 46, 28, 1);
border-radius: 0.25rem;
line-height: 1.25rem;
color: rgba(255, 255, 255, 0.5);
}
.window-app.sheet .window-content .tooltip:hover .tooltiptext { .window-app.sheet .window-content .tooltip:hover .tooltiptext {
top: 2rem; top: 2rem;
left: 2rem; left: 2rem;
@ -1224,44 +1216,3 @@ ul, li {
height: 54px; height: 54px;
position:relative; position:relative;
} }
.dice-river-list-river {
position:relative;
}
.dice-river-list .dice,
.dice-formula .dice,
.dice-total .dice {
margin: 2px;
display: inline-flex;
width: 50px;
height: 50px;
}
.dice-river-list .dice label,
.dice-formula .dice label,
.dice-total .dice label {
font-weight: bold;
color: white;
position:absolute;
text-align: center;
margin-top: 10px;
margin-left: 20px;
z-index: 1;
}
.dice-river-list .dice img,
.dice-formula .dice img,
.dice-total .dice img {
position: relative;
width: 48px;
height: 48px;
border: none;
}
.dice-river-list .modifier,
.dice-formula .modifier,
.dice-total .modifier {
margin: 2px;
display: inline-flex;
}

View File

@ -180,9 +180,9 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"templateVersion": 80, "templateVersion": 81,
"title": "Pegasus RPG", "title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "0.4.18", "version": "0.4.19",
"background" : "./images/ui/pegasus_welcome_page.webp" "background" : "./images/ui/pegasus_welcome_page.webp"
} }

View File

@ -329,6 +329,8 @@
"activated": false, "activated": false,
"purchasedeffects": "", "purchasedeffects": "",
"effectsgained": [], "effectsgained": [],
"dmgroll": false,
"dmgstatistic": "",
"description": "" "description": ""
}, },
"armor": { "armor": {

View File

@ -7,6 +7,11 @@
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" /> <img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol"> <div class="flexcol">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1> <h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexcol">
<div class="flexrow">
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -337,11 +342,19 @@
{{/if}} {{/if}}
</span> </span>
<span class="stat-label outfit-label">{{power.data.type}}</span> <span class="stat-label outfit-label">{{power.data.type}}</span>
{{#if power.data.activated}} {{#if power.data.activated}}
<span class="stat-label outfit-label">Activated</span> <span class="stat-label outfit-label">Activated</span>
{{else}} {{else}}
<span class="stat-label outfit-label">&nbsp;</span> <span class="stat-label outfit-label">&nbsp;</span>
{{/if}} {{/if}}
{{#if power.data.dmgroll}}
<span class="stat-label outfit-label"><a class="power-dmg-roll">DMG Roll</a></span>
{{else}}
<span class="stat-label outfit-label">&nbsp;</span>
{{/if}}
<span class="stat-label outfit-label">{{power.data.cost}}</span> <span class="stat-label outfit-label">{{power.data.cost}}</span>
<span class="stat-label outfit-label">Spent: <span class="stat-label outfit-label">Spent:
<input type="text" class="padd-right power-cost-spent" value="{{power.data.costspent}}" data-dtype="Number"/> <input type="text" class="padd-right power-cost-spent" value="{{power.data.costspent}}" data-dtype="Number"/>

View File

@ -77,6 +77,20 @@
<input type="text" class="padd-right" name="data.powersource" value="{{data.powersource}}" data-dtype="String"/> <input type="text" class="padd-right" name="data.powersource" value="{{data.powersource}}" data-dtype="String"/>
</li> </li>
<li class="flexrow">
<label class="generic-label">DMG Roll Needed ? </label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.dmgroll" {{checked data.dmgroll}}/></label>
</li>
{{#if data.dmgroll}}
<li class="flexrow"><label class="generic-label">Related DMG Statistic </label>
<select class="competence-base flexrow" type="text" name="data.dmgstatistic" value="{{data.dmgstatistic}}" data-dtype="String">
{{#select data.dmgstatistic}}
{{> systems/fvtt-pegasus-rpg/templates/partial-options-statistics.html}}
{{/select}}
</select>
</li>
{{/if}}
<li class="flexrow"><label class="generic-label">Effects Gained</label> <li class="flexrow"><label class="generic-label">Effects Gained</label>
</li> </li>
<li> <li>