Add crafting skills
This commit is contained in:
parent
57dc0505cc
commit
00c8ae8f85
@ -134,8 +134,11 @@ export class Avd12ActorSheet extends ActorSheet {
|
|||||||
const li = $(event.currentTarget).parents(".item");
|
const li = $(event.currentTarget).parents(".item");
|
||||||
this.actor.rollCrafting( li.data("item-id") )
|
this.actor.rollCrafting( li.data("item-id") )
|
||||||
});
|
});
|
||||||
|
html.find('.roll-universal').click((event) => {
|
||||||
|
let skillKey = $(event.currentTarget).data("skill-key")
|
||||||
|
this.actor.rollUniversal(skillKey)
|
||||||
|
});
|
||||||
|
|
||||||
html.find('.roll-weapon').click((event) => {
|
html.find('.roll-weapon').click((event) => {
|
||||||
const li = $(event.currentTarget).parents(".item");
|
const li = $(event.currentTarget).parents(".item");
|
||||||
const weponId = li.data("item-id")
|
const weponId = li.data("item-id")
|
||||||
|
@ -494,12 +494,21 @@ export class Avd12Actor extends Actor {
|
|||||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
clearInitiative(){
|
||||||
|
this.getFlag("world", "initiative", -1)
|
||||||
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getInitiativeScore(combatId, combatantId) {
|
getInitiativeScore(combatId, combatantId) {
|
||||||
if (this.type == 'character') {
|
if (this.type == 'character') {
|
||||||
this.rollMR(true, combatId, combatantId)
|
let init = this.getFlag("world", "initiative" )
|
||||||
|
console.log("INIT", init)
|
||||||
|
if (!init || init == -1) {
|
||||||
|
ChatMessage.create( { content: "Roll your initiative for this combat"} )
|
||||||
|
}
|
||||||
|
return init
|
||||||
}
|
}
|
||||||
console.log("Init required !!!!")
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,13 +676,30 @@ export class Avd12Actor extends Actor {
|
|||||||
skill.attr = duplicate(attr)
|
skill.attr = duplicate(attr)
|
||||||
let rollData = this.getCommonRollData()
|
let rollData = this.getCommonRollData()
|
||||||
rollData.mode = "skill"
|
rollData.mode = "skill"
|
||||||
|
rollMode.skillKey = skillKey
|
||||||
rollData.skill = skill
|
rollData.skill = skill
|
||||||
rollData.title = "Roll Skill " + skill.name
|
rollData.title = "Roll Skill " + skill.name
|
||||||
rollData.img = skill.img
|
rollData.img = skill.img
|
||||||
this.startRoll(rollData)
|
this.startRoll(rollData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
rollUniversal(skillKey) {
|
||||||
|
let skill = this.system.universal.skills[skillKey]
|
||||||
|
if (skill) {
|
||||||
|
skill = duplicate(skill)
|
||||||
|
skill.name = Avd12Utility.upperFirst(skillKey)
|
||||||
|
let rollData = this.getCommonRollData()
|
||||||
|
rollData.mode = "universal"
|
||||||
|
rollData.skillKey = skillKey
|
||||||
|
rollData.skill = skill
|
||||||
|
rollData.title = "Roll Skill " + skill.name
|
||||||
|
rollData.img = skill.img
|
||||||
|
this.startRoll(rollData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollSpell(spellId) {
|
async rollSpell(spellId) {
|
||||||
let spell = this.items.get(spellId)
|
let spell = this.items.get(spellId)
|
||||||
|
@ -27,4 +27,14 @@ export class Avd12Combat extends Combat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
_onDelete() {
|
||||||
|
let combatants = this.combatants.contents
|
||||||
|
for (let c of combatants) {
|
||||||
|
let actor = game.actors.get(c.actorId)
|
||||||
|
actor.clearInitiative()
|
||||||
|
}
|
||||||
|
super._onDelete()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -568,6 +568,10 @@ export class Avd12Utility {
|
|||||||
content: await renderTemplate(`systems/fvtt-avd12/templates/chat/chat-generic-result.hbs`, rollData)
|
content: await renderTemplate(`systems/fvtt-avd12/templates/chat/chat-generic-result.hbs`, rollData)
|
||||||
})
|
})
|
||||||
msg.setFlag("world", "rolldata", rollData)
|
msg.setFlag("world", "rolldata", rollData)
|
||||||
|
if (rollData.skillKey == "initiative") {
|
||||||
|
console.log("REGISTERED")
|
||||||
|
actor.setFlag("world", "initiative", myRoll.total)
|
||||||
|
}
|
||||||
|
|
||||||
console.log("Rolldata result", rollData)
|
console.log("Rolldata result", rollData)
|
||||||
}
|
}
|
||||||
|
@ -1320,7 +1320,16 @@ ul, li {
|
|||||||
min-width:2rem;
|
min-width:2rem;
|
||||||
max-width: 2rem;
|
max-width: 2rem;
|
||||||
}
|
}
|
||||||
|
.attribute-label {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.flexrow-no-expand {
|
||||||
|
flex-grow: 0;
|
||||||
|
}
|
||||||
|
.item-input-small {
|
||||||
|
max-width: 16px;
|
||||||
|
max-height: 12px;
|
||||||
|
}
|
||||||
.drop-module-step {
|
.drop-module-step {
|
||||||
background: linear-gradient(to bottom, #6c95b9fc 5%, #105177ab 100%);
|
background: linear-gradient(to bottom, #6c95b9fc 5%, #105177ab 100%);
|
||||||
background-color: #7d5d3b00;
|
background-color: #7d5d3b00;
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
],
|
],
|
||||||
"title": "AnyVenture D12 RPG",
|
"title": "AnyVenture D12 RPG",
|
||||||
"url": "https://www.uberwald.me/gitea/public/fvtt-avd12",
|
"url": "https://www.uberwald.me/gitea/public/fvtt-avd12",
|
||||||
"version": "10.0.23",
|
"version": "10.0.24",
|
||||||
"download": "https://www.uberwald.me/gitea/public/fvtt-avd12/archive/fvtt-avd12-v10.0.23.zip",
|
"download": "https://www.uberwald.me/gitea/public/fvtt-avd12/archive/fvtt-avd12-v10.0.24.zip",
|
||||||
"background": "systems/fvtt-avd12/images/ui/avd12_welcome_page.webp"
|
"background": "systems/fvtt-avd12/images/ui/avd12_welcome_page.webp"
|
||||||
}
|
}
|
@ -164,11 +164,13 @@
|
|||||||
"universal": {
|
"universal": {
|
||||||
"skills": {
|
"skills": {
|
||||||
"search": {
|
"search": {
|
||||||
|
"label": "Search",
|
||||||
"modifier": 0,
|
"modifier": 0,
|
||||||
"finalvalue": 0,
|
"finalvalue": 0,
|
||||||
"good": false
|
"good": false
|
||||||
},
|
},
|
||||||
"initiative": {
|
"initiative": {
|
||||||
|
"label": "Initiative",
|
||||||
"modifier": 0,
|
"modifier": 0,
|
||||||
"finalvalue": 0,
|
"finalvalue": 0,
|
||||||
"good": false
|
"good": false
|
||||||
|
@ -11,26 +11,45 @@
|
|||||||
<div class="flexrow">
|
<div class="flexrow">
|
||||||
{{#each system.attributes as |attr attrKey|}}
|
{{#each system.attributes as |attr attrKey|}}
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<div class="flerow">
|
<div class="flexrow flexrow-no-expand">
|
||||||
<span>{{attr.label}}</span>
|
<span class="attribute-label">{{attr.label}}</span>
|
||||||
<input type="text" class="item-field-label-short" name="system.attributes.{{attrKey}}.value" value="{{attr.value}}" data-dtype="Number"/>
|
<input type="text" class="item-field-label-short" name="system.attributes.{{attrKey}}.value" value="{{attr.value}}" data-dtype="Number"/>
|
||||||
</div>
|
</div>
|
||||||
{{#each attr.skills as |skill skillKey|}}
|
{{#each attr.skills as |skill skillKey|}}
|
||||||
<div class="flexrow">
|
<div class="flexrow flexrow-no-expand">
|
||||||
<span class="item-field-skill skill-label"><a class="roll-skill" data-attr-key="{{attrKey}}" data-skill-key="{{skillKey}}"><i class="fa-solid fa-dice-d12"></i> {{upperFirst skillKey}} {{skill.finalvalue}}</a></span>
|
<span class="item-field-skill skill-label">
|
||||||
<input type="checkbox" class="skill-good-checkbox" name="system.attributes.{{attrKey}}.skills.{{skillKey}}.good" {{checked skill.good}} />
|
<a class="roll-skill" data-attr-key="{{attrKey}}" data-skill-key="{{skillKey}}">
|
||||||
|
<i class="fa-solid fa-dice-d12"></i> {{upperFirst skillKey}} {{skill.finalvalue}}</a>
|
||||||
|
</span>
|
||||||
|
<input type="checkbox" class="skill-good-checkbox" name="system.attributes.{{attrKey}}.skills.{{skillKey}}.good" {{checked skill.good}} />
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
<div class="flexrow flexrow-no-expand">
|
||||||
|
<span class="attribute-label"> </span>
|
||||||
|
</div>
|
||||||
|
{{#if (eq attrKey "might")}}
|
||||||
|
<div class="flexrow flexrow-no-expand">
|
||||||
|
<span class="attribute-label">Universal</span>
|
||||||
|
</div>
|
||||||
|
{{#each @root.system.universal.skills as |skill skillKey|}}
|
||||||
|
<div class="flexrow flexrow-no-expand">
|
||||||
|
<span class="item-field-skill skill-label">
|
||||||
|
<a class="roll-universal" data-skill-key="{{skillKey}}">
|
||||||
|
<i class="fa-solid fa-dice-d12"></i> {{upperFirst skillKey}}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
<input type="text" class="item-input-small" name="system.universal.skills.{{skillKey}}.finalvalue" value="{{skill.finalvalue}}" data-dtype="Number"/>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
{{else}}
|
||||||
|
<div class="flexrow">
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ability-item">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ability-item status-block">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,22 +61,26 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if (or spell weapon)}}
|
{{#if (eq skillKey "initiative") }}
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="flexrow">
|
{{#if (or spell weapon)}}
|
||||||
<span class="roll-dialog-label">Target check : </span>
|
|
||||||
<select id="targetCheck" name="targetCheck">
|
{{else}}
|
||||||
{{#select targetCheck}}
|
<div class="flexrow">
|
||||||
<option value="none">None</option>
|
<span class="roll-dialog-label">Target check : </span>
|
||||||
<option value="5">5 (Trivial)</option>
|
<select id="targetCheck" name="targetCheck">
|
||||||
<option value="7">7 (Easy)</option>
|
{{#select targetCheck}}
|
||||||
<option value="10">10 (Regular)</option>
|
<option value="none">None</option>
|
||||||
<option value="14">14 (Difficult)</option>
|
<option value="5">5 (Trivial)</option>
|
||||||
<option value="20">20 (Heroic)</option>
|
<option value="7">7 (Easy)</option>
|
||||||
{{/select}}
|
<option value="10">10 (Regular)</option>
|
||||||
</select>
|
<option value="14">14 (Difficult)</option>
|
||||||
</div>
|
<option value="20">20 (Heroic)</option>
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user