Actor sheet v1.1

This commit is contained in:
LeRatierBretonnien 2022-12-31 10:22:49 +01:00
parent 580b044c77
commit 7ceada98fb
7 changed files with 35 additions and 34 deletions

View File

@ -93,17 +93,6 @@ export class DarkStarsActorSheet extends ActorSheet {
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true }) this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
}) })
html.find('.equip-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipActivate( itemId)
});
html.find('.equip-deactivate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipDeactivate( itemId)
});
html.find('.subactor-edit').click(ev => { html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id"); let actorId = li.data("actor-id");
@ -116,6 +105,12 @@ export class DarkStarsActorSheet extends ActorSheet {
let actorId = li.data("actor-id"); let actorId = li.data("actor-id");
this.actor.delSubActor(actorId); this.actor.delSubActor(actorId);
}); });
html.find('.skill-used-id').change(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.setSkillUsed( li.data("item-id"), event.currentTarget.checked );
} );
html.find('.quantity-minus').click(event => { html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 ); this.actor.incDecQuantity( li.data("item-id"), -1 );
@ -134,10 +129,6 @@ export class DarkStarsActorSheet extends ActorSheet {
this.actor.incDecAmmo( li.data("item-id"), +1 ) this.actor.incDecAmmo( li.data("item-id"), +1 )
} ); } );
html.find('.roll-ability').click((event) => {
const abilityKey = $(event.currentTarget).data("ability-key");
this.actor.rollAbility(abilityKey);
});
html.find('.roll-skill').click((event) => { html.find('.roll-skill').click((event) => {
const li = $(event.currentTarget).parents(".item") const li = $(event.currentTarget).parents(".item")
const skillId = li.data("item-id") const skillId = li.data("item-id")
@ -149,20 +140,6 @@ export class DarkStarsActorSheet extends ActorSheet {
const skillId = li.data("item-id") const skillId = li.data("item-id")
this.actor.rollWeapon(skillId) this.actor.rollWeapon(skillId)
}); });
html.find('.roll-armor-die').click((event) => {
this.actor.rollArmorDie()
});
html.find('.roll-shield-die').click((event) => {
this.actor.rollShieldDie()
});
html.find('.roll-target-die').click((event) => {
this.actor.rollDefenseRanged()
});
html.find('.roll-save').click((event) => {
const saveKey = $(event.currentTarget).data("save-key")
this.actor.rollSave(saveKey)
});
html.find('.lock-unlock-sheet').click((event) => { html.find('.lock-unlock-sheet').click((event) => {

View File

@ -98,7 +98,6 @@ export class DarkStarsActor extends Actor {
this.computeDerivated() this.computeDerivated()
this.buildContainerTree() this.buildContainerTree()
this.computeHitPoints() this.computeHitPoints()
this.computeEffortPoints()
} }
super.prepareDerivedData(); super.prepareDerivedData();
@ -179,10 +178,18 @@ export class DarkStarsActor extends Actor {
return item; return item;
} }
/* -------------------------------------------- */
setSkillUsed( skillId, checked) {
let skill = this.items.get(skillId)
if(skill) {
this.updateEmbeddedDocuments('Item', [ {_id: skill.id, 'system.used': checked} ])
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
updateSkill(skill) { updateSkill(skill) {
skill.derivated = duplicate(this.system.derivated[skill.system.base]) skill.derivated = duplicate(this.system.derivated[skill.system.base])
skill.total = skill.derivated.value + skill.system.bonus skill.total = skill.system.value + skill.derivated.value + skill.system.bonus
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -100,7 +100,7 @@
"styles": [ "styles": [
"styles/simple.css" "styles/simple.css"
], ],
"version": "10.0.12", "version": "10.0.13",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "10", "verified": "10",
@ -108,7 +108,7 @@
}, },
"title": "Dark Stars RPG", "title": "Dark Stars RPG",
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-dark-stars/raw/branch/main/system.json", "manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-dark-stars/raw/branch/main/system.json",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-dark-stars/archive/fvtt-dark-stars-v10.0.12.zip", "download": "https://www.uberwald.me/gitea/uberwald/fvtt-dark-stars/archive/fvtt-dark-stars-v10.0.13.zip",
"url": "https://www.uberwald.me/gitea/uberwald/", "url": "https://www.uberwald.me/gitea/uberwald/",
"background": "images/ui/dark_stars_welcome_page.webp", "background": "images/ui/dark_stars_welcome_page.webp",
"id": "fvtt-dark-stars" "id": "fvtt-dark-stars"

View File

@ -277,6 +277,7 @@
], ],
"skill": { "skill": {
"base": "", "base": "",
"value": 0,
"bonus": 0, "bonus": 0,
"used": false, "used": false,
"description": "" "description": ""

View File

@ -74,6 +74,9 @@
<span class="item-name-label-header-long2"> <span class="item-name-label-header-long2">
<h3><label class="items-title-text">Skills</label></h3> <h3><label class="items-title-text">Skills</label></h3>
</span> </span>
<span class="item-field-label-medium">
<label class="short-label">Base</label>
</span>
<span class="item-field-label-long"> <span class="item-field-label-long">
<label class="short-label">Derivated</label> <label class="short-label">Derivated</label>
</span> </span>
@ -83,6 +86,9 @@
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">Total</label> <label class="short-label">Total</label>
</span> </span>
<span class="item-field-label-medium">
<label class="short-label">Used?</label>
</span>
<span class="item-field-label-medium"> <span class="item-field-label-medium">
<label class="short-label">&nbsp;</label> <label class="short-label">&nbsp;</label>
</span> </span>
@ -92,9 +98,11 @@
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{skill.img}}" /> <a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{skill.img}}" />
</a> </a>
<span class="item-field-label-vlong2"><a class="roll-skill">{{skill.name}}</a></span> <span class="item-field-label-vlong2"><a class="roll-skill">{{skill.name}}</a></span>
<span class="item-field-label-medium">{{skill.system.value}}</span>
<span class="item-field-label-long">{{skill.derivated.label}} ({{skill.derivated.value}})</span> <span class="item-field-label-long">{{skill.derivated.label}} ({{skill.derivated.value}})</span>
<span class="item-field-label-medium">{{skill.system.bonus}}</span> <span class="item-field-label-medium">{{skill.system.bonus}}</span>
<span class="item-field-label-medium">{{skill.total}}</span> <span class="item-field-label-medium">{{skill.total}}%</span>
<label class="attribute-value checkbox"><input type="checkbox" class="skill-used-id" {{checked skill.system.used}}/></label>
<div class="item-controls item-controls-fixed"> <div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a> <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div> </div>

View File

@ -26,6 +26,10 @@
<span class="roll-dialog-label">Bonus/Malus : </span> <span class="roll-dialog-label">Bonus/Malus : </span>
<select class="status-small-label color-class-common" type="text" id="bonusMalus" value="{{bonusMalus}}" data-dtype="Number" > <select class="status-small-label color-class-common" type="text" id="bonusMalus" value="{{bonusMalus}}" data-dtype="Number" >
{{#select bonusMalus}} {{#select bonusMalus}}
<option value="-80">-80%</option>
<option value="-70">-70%</option>
<option value="-60">-60%</option>
<option value="-50">-50%</option>
<option value="-40">-40%</option> <option value="-40">-40%</option>
<option value="-30">-30%</option> <option value="-30">-30%</option>
<option value="-20">-20%</option> <option value="-20">-20%</option>

View File

@ -25,6 +25,10 @@
</select> </select>
</li> </li>
<li class="flexrow"><label class="item-field-label-long">Starting skill value</label>
<input type="text" class="item-field-label-long" name="system.value" value="{{system.value}}" data-dtype="Number"/>
</li>
<li class="flexrow"><label class="item-field-label-long">Bonus</label> <li class="flexrow"><label class="item-field-label-long">Bonus</label>
<input type="text" class="item-field-label-long" name="system.bonus" value="{{system.bonus}}" data-dtype="Number"/> <input type="text" class="item-field-label-long" name="system.bonus" value="{{system.bonus}}" data-dtype="Number"/>
</li> </li>