From 06e265586bf3f81ecbaaf4095150520907405220 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Sat, 21 Oct 2023 10:25:39 +0200 Subject: [PATCH] Add initiative and ammo --- modules/dark-stars-actor-sheet.js | 6 + modules/dark-stars-actor.js | 36 ++++-- modules/dark-stars-combat.js | 39 ++++--- packs/armor/{000088.log => 000100.log} | 0 packs/armor/CURRENT | 2 +- packs/armor/LOG | 16 +-- packs/armor/LOG.old | 16 +-- packs/armor/MANIFEST-000086 | Bin 134 -> 0 bytes packs/armor/MANIFEST-000098 | Bin 0 -> 134 bytes packs/conditions/{000088.log => 000100.log} | 0 packs/conditions/CURRENT | 2 +- packs/conditions/LOG | 14 +-- packs/conditions/LOG.old | 14 +-- packs/conditions/MANIFEST-000086 | Bin 65 -> 0 bytes packs/conditions/MANIFEST-000098 | Bin 0 -> 65 bytes packs/currency/{000088.log => 000100.log} | 0 packs/currency/CURRENT | 2 +- packs/currency/LOG | 14 +-- packs/currency/LOG.old | 14 +-- packs/currency/MANIFEST-000086 | Bin 65 -> 0 bytes packs/currency/MANIFEST-000098 | Bin 0 -> 65 bytes packs/cybernetics/{000016.log => 000028.log} | 0 packs/cybernetics/CURRENT | 2 +- packs/cybernetics/LOG | 16 +-- packs/cybernetics/LOG.old | 16 +-- packs/cybernetics/MANIFEST-000014 | Bin 137 -> 0 bytes packs/cybernetics/MANIFEST-000026 | Bin 0 -> 137 bytes packs/equipment/{000088.log => 000100.log} | 0 packs/equipment/CURRENT | 2 +- packs/equipment/LOG | 14 +-- packs/equipment/LOG.old | 14 +-- packs/equipment/MANIFEST-000086 | Bin 65 -> 0 bytes packs/equipment/MANIFEST-000098 | Bin 0 -> 65 bytes packs/perks/{000088.log => 000100.log} | 0 packs/perks/CURRENT | 2 +- packs/perks/LOG | 16 +-- packs/perks/LOG.old | 16 +-- packs/perks/MANIFEST-000086 | Bin 135 -> 0 bytes packs/perks/MANIFEST-000098 | Bin 0 -> 135 bytes packs/shields/{000088.log => 000100.log} | 0 packs/shields/CURRENT | 2 +- packs/shields/LOG | 14 +-- packs/shields/LOG.old | 14 +-- packs/shields/MANIFEST-000086 | Bin 65 -> 0 bytes packs/shields/MANIFEST-000098 | Bin 0 -> 65 bytes packs/skills/{000088.log => 000100.log} | 0 packs/skills/CURRENT | 2 +- packs/skills/LOG | 16 +-- packs/skills/LOG.old | 16 +-- packs/skills/MANIFEST-000086 | Bin 134 -> 0 bytes packs/skills/MANIFEST-000098 | Bin 0 -> 134 bytes packs/weapons/{000089.log => 000101.log} | 0 packs/weapons/CURRENT | 2 +- packs/weapons/LOG | 16 +-- packs/weapons/LOG.old | 16 +-- .../{MANIFEST-000087 => MANIFEST-000099} | Bin 171 -> 171 bytes system.json | 4 +- template.json | 15 ++- templates/actors/actor-sheet.hbs | 109 +++++++++++++++--- templates/chat/chat-generic-result.hbs | 14 ++- templates/items/item-ammo-sheet.hbs | 56 +++++++++ templates/items/item-weapon-sheet.hbs | 36 +++--- 62 files changed, 398 insertions(+), 207 deletions(-) rename packs/armor/{000088.log => 000100.log} (100%) delete mode 100644 packs/armor/MANIFEST-000086 create mode 100644 packs/armor/MANIFEST-000098 rename packs/conditions/{000088.log => 000100.log} (100%) delete mode 100644 packs/conditions/MANIFEST-000086 create mode 100644 packs/conditions/MANIFEST-000098 rename packs/currency/{000088.log => 000100.log} (100%) delete mode 100644 packs/currency/MANIFEST-000086 create mode 100644 packs/currency/MANIFEST-000098 rename packs/cybernetics/{000016.log => 000028.log} (100%) delete mode 100644 packs/cybernetics/MANIFEST-000014 create mode 100644 packs/cybernetics/MANIFEST-000026 rename packs/equipment/{000088.log => 000100.log} (100%) delete mode 100644 packs/equipment/MANIFEST-000086 create mode 100644 packs/equipment/MANIFEST-000098 rename packs/perks/{000088.log => 000100.log} (100%) delete mode 100644 packs/perks/MANIFEST-000086 create mode 100644 packs/perks/MANIFEST-000098 rename packs/shields/{000088.log => 000100.log} (100%) delete mode 100644 packs/shields/MANIFEST-000086 create mode 100644 packs/shields/MANIFEST-000098 rename packs/skills/{000088.log => 000100.log} (100%) delete mode 100644 packs/skills/MANIFEST-000086 create mode 100644 packs/skills/MANIFEST-000098 rename packs/weapons/{000089.log => 000101.log} (100%) rename packs/weapons/{MANIFEST-000087 => MANIFEST-000099} (74%) create mode 100644 templates/items/item-ammo-sheet.hbs diff --git a/modules/dark-stars-actor-sheet.js b/modules/dark-stars-actor-sheet.js index 31b1399..c9a8724 100644 --- a/modules/dark-stars-actor-sheet.js +++ b/modules/dark-stars-actor-sheet.js @@ -40,6 +40,7 @@ export class DarkStarsActorSheet extends ActorSheet { skills: this.actor.getSkills( ), perks: this.actor.getPerks( ), weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ), + ammos: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getAmmos()) ), armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())), shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())), equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ), @@ -109,6 +110,11 @@ export class DarkStarsActorSheet extends ActorSheet { this.actor.delSubActor(actorId); }); + html.find('.edit-weapon-ammo').change(ev => { + const li = $(ev.currentTarget).parents(".item") + let weaponId = li.data("item-id") + this.actor.setWeaponAmmo( weaponId, ev.currentTarget.value ) + }) html.find('.skill-used-id').change(event => { const li = $(event.currentTarget).parents(".item"); this.actor.setSkillUsed( li.data("item-id"), event.currentTarget.checked ); diff --git a/modules/dark-stars-actor.js b/modules/dark-stars-actor.js index c7c46c2..f952b3b 100644 --- a/modules/dark-stars-actor.js +++ b/modules/dark-stars-actor.js @@ -158,6 +158,13 @@ export class DarkStarsActor extends Actor { } /* -------------------------------------------- */ checkAndPrepareEquipment(item) { + // Dynamic assign ammo for the weapon + if (item.type == "weapon" && item.system.needammo) { + let ammo = this.items.find(ammo => ammo.type == "ammo" && item.system.ammoid == ammo.id) + if (ammo) { + item.ammo = duplicate(ammo) + } + } } /* -------------------------------------------- */ @@ -177,6 +184,12 @@ export class DarkStarsActor extends Actor { /* -------------------------------------------- */ getWeapons() { let comp = duplicate(this.items.filter(item => item.type == 'weapon') || []); + DarkStarsUtility.sortArrayObjectsByName(comp) + return comp; + } + /* -------------------------------------------- */ + getAmmos() { + let comp = duplicate(this.items.filter(item => item.type == 'ammo') || []); DarkStarsUtility.sortArrayObjectsByName(comp) return comp; } @@ -188,7 +201,13 @@ export class DarkStarsActor extends Actor { } return item; } - + /* -------------------------------------------- */ + setWeaponAmmo(weaponId, ammoId) { + let weapon = this.items.get(weaponId) + if(weapon) { + this.updateEmbeddedDocuments('Item', [ {_id: weapon.id, 'system.ammoid': ammoId} ]) + } + } /* -------------------------------------------- */ setSkillUsed( skillId, checked) { let skill = this.items.get(skillId) @@ -391,12 +410,14 @@ export class DarkStarsActor extends Actor { } } /* -------------------------------------------- */ - getInitiativeScore(combatId, combatantId) { - if (this.type == 'character') { - this.rollMR(true, combatId, combatantId) - } - console.log("Init required !!!!") - return -1; + hasLastWord() { + return this.items.find(i => i.type == "perk" && i.name.toLowerCase() === "last word") + } + /* -------------------------------------------- */ + getInitiativeScore() { + let initFormula = (this.system.derivated.si.value + this.system.derivated.si.bonus) + "d6" + let initRoll = new Roll(initFormula).roll({ async: false }) + return initRoll.total } /* -------------------------------------------- */ @@ -622,6 +643,7 @@ export class DarkStarsActor extends Actor { rollData.mode = "weapon" rollData.skill = skill rollData.weapon = weapon + this.checkAndPrepareEquipment(weapon) rollData.img = weapon.img this.startRoll(rollData) } else { diff --git a/modules/dark-stars-combat.js b/modules/dark-stars-combat.js index e13d1d8..9444b9f 100644 --- a/modules/dark-stars-combat.js +++ b/modules/dark-stars-combat.js @@ -2,17 +2,29 @@ import { DarkStarsUtility } from "./dark-stars-utility.js"; /* -------------------------------------------- */ export class DarkStarsCombat extends Combat { - - /* -------------------------------------------- */ - async rollInitiative(ids, formula = undefined, messageOptions = {} ) { - ids = typeof ids === "string" ? [ids] : ids; - for (let cId = 0; cId < ids.length; cId++) { - const c = this.combatants.get(ids[cId]); - let id = c._id || c.id; - let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1; - await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]); - } + /* -------------------------------------------- */ + processOtherTurns(c, initScore) { + let toCreate = [] + let token = canvas.tokens.get(c.tokenId) + let hasLastWord = token.actor.hasLastWord() + while ( (initScore > 5) || (hasLastWord && initScore >= 5)) { + initScore -= 5; + toCreate.push({tokenId: c.tokenId, sceneId: c.sceneId, actorId: c.actorId, hidden: c.hidden, initiative: initScore, isDuplicated: true}); + } + this.createEmbeddedDocuments("Combatant", toCreate); + } + + /* -------------------------------------------- */ + async rollInitiative(ids, formula = undefined, messageOptions = {}) { + ids = typeof ids === "string" ? [ids] : ids; + for (let cId of ids) { + const c = this.combatants.get(cId); + let id = c._id || c.id; + let initScore = c.actor ? c.actor.getInitiativeScore(this.id, id) : -1; + await this.updateEmbeddedDocuments("Combatant", [{ _id: id, initiative: initScore }]); + setTimeout(() => this.processOtherTurns(c, initScore), 400) + } return this; } @@ -20,11 +32,4 @@ export class DarkStarsCombat extends Combat { _onUpdate(changed, options, userId) { } - /* -------------------------------------------- */ - static async checkTurnPosition() { - while (game.combat.turn > 0) { - await game.combat.previousTurn() - } - } - } diff --git a/packs/armor/000088.log b/packs/armor/000100.log similarity index 100% rename from packs/armor/000088.log rename to packs/armor/000100.log diff --git a/packs/armor/CURRENT b/packs/armor/CURRENT index a43fb19..95395b2 100644 --- a/packs/armor/CURRENT +++ b/packs/armor/CURRENT @@ -1 +1 @@ -MANIFEST-000086 +MANIFEST-000098 diff --git a/packs/armor/LOG b/packs/armor/LOG index 772fb08..148d235 100644 --- a/packs/armor/LOG +++ b/packs/armor/LOG @@ -1,8 +1,8 @@ -2023/10/19-14:23:17.464021 7f8105ffb6c0 Recovering log #84 -2023/10/19-14:23:17.473986 7f8105ffb6c0 Delete type=3 #82 -2023/10/19-14:23:17.474084 7f8105ffb6c0 Delete type=0 #84 -2023/10/19-14:23:44.289799 7f7e677006c0 Level-0 table #89: started -2023/10/19-14:23:44.289832 7f7e677006c0 Level-0 table #89: 0 bytes OK -2023/10/19-14:23:44.296197 7f7e677006c0 Delete type=0 #87 -2023/10/19-14:23:44.308133 7f7e677006c0 Manual compaction at level-0 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) -2023/10/19-14:23:44.315305 7f7e677006c0 Manual compaction at level-1 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) +2023/10/21-09:46:53.172622 7f8106ffd6c0 Recovering log #96 +2023/10/21-09:46:53.183332 7f8106ffd6c0 Delete type=3 #94 +2023/10/21-09:46:53.183472 7f8106ffd6c0 Delete type=0 #96 +2023/10/21-10:25:16.591050 7f7e677006c0 Level-0 table #101: started +2023/10/21-10:25:16.591087 7f7e677006c0 Level-0 table #101: 0 bytes OK +2023/10/21-10:25:16.597356 7f7e677006c0 Delete type=0 #99 +2023/10/21-10:25:16.608021 7f7e677006c0 Manual compaction at level-0 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) +2023/10/21-10:25:16.619288 7f7e677006c0 Manual compaction at level-1 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) diff --git a/packs/armor/LOG.old b/packs/armor/LOG.old index 459c681..e036603 100644 --- a/packs/armor/LOG.old +++ b/packs/armor/LOG.old @@ -1,8 +1,8 @@ -2023/10/19-14:21:21.592351 7f81067fc6c0 Recovering log #80 -2023/10/19-14:21:21.605971 7f81067fc6c0 Delete type=3 #78 -2023/10/19-14:21:21.606020 7f81067fc6c0 Delete type=0 #80 -2023/10/19-14:21:29.423091 7f7e677006c0 Level-0 table #85: started -2023/10/19-14:21:29.423116 7f7e677006c0 Level-0 table #85: 0 bytes OK -2023/10/19-14:21:29.429490 7f7e677006c0 Delete type=0 #83 -2023/10/19-14:21:29.429754 7f7e677006c0 Manual compaction at level-0 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) -2023/10/19-14:21:29.429781 7f7e677006c0 Manual compaction at level-1 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) +2023/10/21-09:05:36.542041 7f8105ffb6c0 Recovering log #92 +2023/10/21-09:05:36.602565 7f8105ffb6c0 Delete type=3 #90 +2023/10/21-09:05:36.602727 7f8105ffb6c0 Delete type=0 #92 +2023/10/21-09:46:38.900681 7f7e677006c0 Level-0 table #97: started +2023/10/21-09:46:38.900730 7f7e677006c0 Level-0 table #97: 0 bytes OK +2023/10/21-09:46:38.908919 7f7e677006c0 Delete type=0 #95 +2023/10/21-09:46:38.909203 7f7e677006c0 Manual compaction at level-0 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) +2023/10/21-09:46:38.909242 7f7e677006c0 Manual compaction at level-1 from '!items!3O3MjRkrmX4HeaPY' @ 72057594037927935 : 1 .. '!items!q9JGWL4y4udYrzvD' @ 0 : 0; will stop at (end) diff --git a/packs/armor/MANIFEST-000086 b/packs/armor/MANIFEST-000086 deleted file mode 100644 index 5c9f2be140d8d6a6e64784c71b6a120aaaf4c310..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134 zcmWeu=MYI`U}TiaNi9pwNlDUksw_z@&n!-L&d)7KEJ`fNFJfn6U8pOsm|2pVTdZj8 zZ|s{DlwFh?Vd9aR7!b+G$N&Z~`9e!C_i!JRN|Vx*$fBw;7e;=Fyw#MWwHyqLOyQgi U%n>a7EYyhUy@`{-yskz09 z23|Q~US;VOfq~(X7C8m}jEoFm0F$rEst7a5O?LGuPl^h)a4li{4v~+uZd2l9U}WOw WWMCFx`OawJ7+wY93jp~-Kt2E+Z6+K5 diff --git a/packs/cybernetics/MANIFEST-000026 b/packs/cybernetics/MANIFEST-000026 new file mode 100644 index 0000000000000000000000000000000000000000..a305beb326fecc46182eefcbdf3bf033ad3f598b GIT binary patch literal 137 zcmZoa`1)rO10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAei1tp>yhUy@`{-yskz09 z23|Q~US;VOfq~(X7C8m}jEoFm0F$rEst7a5O?LGuPl^h)a4li{4v{Z?EqjfVfssj? WlYv==tN9B9?W`{?X_&WPlSf(+CLF84Q{;%d>U}OsC VWMGb93A?p6v=hXQ0CJ;P!T@-^CTsuz diff --git a/packs/perks/MANIFEST-000098 b/packs/perks/MANIFEST-000098 new file mode 100644 index 0000000000000000000000000000000000000000..aeb78ae39004123bc9c3deba7612b28e04b26400 GIT binary patch literal 135 zcmaFg)p#w5fss)vC$%g!CnZVGsj?)sJhM2}IX|}`u_&=5zlfcQ_3U{jdBx0<)ZAi4 z10P58bYCZz{B(a)Gsh@zMn(oOfXP>tN9B9?W`{?X_&WPlSf(+CLFCOl-db@mFft`` VGBBsGgefUM{SV@%0J&)_VE|-zCBpy! literal 0 HcmV?d00001 diff --git a/packs/shields/000088.log b/packs/shields/000100.log similarity index 100% rename from packs/shields/000088.log rename to packs/shields/000100.log diff --git a/packs/shields/CURRENT b/packs/shields/CURRENT index a43fb19..95395b2 100644 --- a/packs/shields/CURRENT +++ b/packs/shields/CURRENT @@ -1 +1 @@ -MANIFEST-000086 +MANIFEST-000098 diff --git a/packs/shields/LOG b/packs/shields/LOG index a3446c4..643952a 100644 --- a/packs/shields/LOG +++ b/packs/shields/LOG @@ -1,7 +1,7 @@ -2023/10/19-14:23:17.488686 7f8106ffd6c0 Recovering log #84 -2023/10/19-14:23:17.499250 7f8106ffd6c0 Delete type=3 #82 -2023/10/19-14:23:17.499317 7f8106ffd6c0 Delete type=0 #84 -2023/10/19-14:23:44.315318 7f7e677006c0 Level-0 table #89: started -2023/10/19-14:23:44.315347 7f7e677006c0 Level-0 table #89: 0 bytes OK -2023/10/19-14:23:44.327312 7f7e677006c0 Delete type=0 #87 -2023/10/19-14:23:44.359651 7f7e677006c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) +2023/10/21-09:46:53.199962 7f81077fe6c0 Recovering log #96 +2023/10/21-09:46:53.211394 7f81077fe6c0 Delete type=3 #94 +2023/10/21-09:46:53.211491 7f81077fe6c0 Delete type=0 #96 +2023/10/21-10:25:16.626403 7f7e677006c0 Level-0 table #101: started +2023/10/21-10:25:16.626435 7f7e677006c0 Level-0 table #101: 0 bytes OK +2023/10/21-10:25:16.633066 7f7e677006c0 Delete type=0 #99 +2023/10/21-10:25:16.646322 7f7e677006c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) diff --git a/packs/shields/LOG.old b/packs/shields/LOG.old index 6b8cf7f..1e9b48f 100644 --- a/packs/shields/LOG.old +++ b/packs/shields/LOG.old @@ -1,7 +1,7 @@ -2023/10/19-14:21:21.623245 7f8106ffd6c0 Recovering log #80 -2023/10/19-14:21:21.634568 7f8106ffd6c0 Delete type=3 #78 -2023/10/19-14:21:21.634612 7f8106ffd6c0 Delete type=0 #80 -2023/10/19-14:21:29.436593 7f7e677006c0 Level-0 table #85: started -2023/10/19-14:21:29.436653 7f7e677006c0 Level-0 table #85: 0 bytes OK -2023/10/19-14:21:29.443853 7f7e677006c0 Delete type=0 #83 -2023/10/19-14:21:29.458132 7f7e677006c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) +2023/10/21-09:05:36.672950 7f8106ffd6c0 Recovering log #92 +2023/10/21-09:05:36.722365 7f8106ffd6c0 Delete type=3 #90 +2023/10/21-09:05:36.722463 7f8106ffd6c0 Delete type=0 #92 +2023/10/21-09:46:38.916263 7f7e677006c0 Level-0 table #97: started +2023/10/21-09:46:38.916316 7f7e677006c0 Level-0 table #97: 0 bytes OK +2023/10/21-09:46:38.923082 7f7e677006c0 Delete type=0 #95 +2023/10/21-09:46:38.938109 7f7e677006c0 Manual compaction at level-0 from 'undefined' @ 72057594037927935 : 1 .. 'undefined' @ 0 : 0; will stop at (end) diff --git a/packs/shields/MANIFEST-000086 b/packs/shields/MANIFEST-000086 deleted file mode 100644 index 6ddee8983c9b853d89dbbdaff63d1b30ac06b2b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmWIhx#Ncn10$nUPHI_dPD+xVQ)NkNd1i5{bAE0?Vo_pAevu4AuPX-wBU3mh19Jom R!y_?udk{AQ$cZ&zxxg9K->r*H;P3Z02qcO^8f$< diff --git a/packs/skills/MANIFEST-000098 b/packs/skills/MANIFEST-000098 new file mode 100644 index 0000000000000000000000000000000000000000..c7461d9838320b9c1c641ae5efa1161d921e863a GIT binary patch literal 134 zcmaErvd}S+fss)vC$%g!CnZVGsj?)sJhM2}IX|}`u_&=5zlfcQb+5C$VrEHdZn2_i zq*r*UdtzdGZl+;MdQur9BLf(~8zX#j7%w<49ux4(-^zYXg7iQsX%@@kPiUnl?l@T delta 39 qcmZ3@xSDZ7x5D97QolJF7?~nC8JHtkrZJk@#dd)BkwAVlkPiUgk_kBg diff --git a/system.json b/system.json index 51bb278..f7b1198 100644 --- a/system.json +++ b/system.json @@ -109,14 +109,14 @@ "styles": [ "styles/simple.css" ], - "version": "11.0.7", + "version": "11.0.8", "compatibility": { "minimum": "11", "verified": "11" }, "title": "Dark Stars RPG", "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-v11.0.7.zip", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-dark-stars/archive/fvtt-dark-stars-v11.0.8.zip", "url": "https://www.uberwald.me/gitea/uberwald/", "background": "images/ui/dark_stars_welcome_page.webp", "id": "fvtt-dark-stars" diff --git a/template.json b/template.json index 16232ab..96e46ad 100644 --- a/template.json +++ b/template.json @@ -278,7 +278,8 @@ "weapon", "money", "genetic", - "cyber" + "cyber", + "ammo" ], "skill": { "base": "", @@ -394,11 +395,23 @@ "quantity": 0, "description": "" }, + "ammo": { + "ava": "", + "damage": "", + "bulk": 0, + "br": 0, + "cost": 0, + "sp": 0, + "quantity": 0, + "properties": "" + }, "weapon": { "weapontype": "", "associatedskill": "", "penetrationmin": "", "penetrationmax": "", + "needammo": false, + "ammoid": "", "hashpdamage": true, "damage": "", "hasfatiguedamage": false, diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index 8f63c86..4a10031 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -153,12 +153,15 @@

- + + + + @@ -169,13 +172,28 @@ src="{{weapon.img}}" /> {{weapon.name}} - {{upperFirst weapon.system.weapontype}} - - {{weapon.system.skill}} - - {{weapon.system.damage}} - + {{upperFirst weapon.system.weapontype}} + {{upperFirst weapon.system.associatedskill}} + + {{#if weapon.system.needammo}} + + {{#if weapon.ammo}} + + {{else}} + + {{/if}} + {{else}} + + + {{/if}}
 
@@ -296,12 +314,20 @@

- + + - - + + + + + + + + +
 
@@ -311,8 +337,27 @@ {{weapon.name}} - - + + + + {{#if weapon.system.needammo}} + + {{#if weapon.ammo}} + + {{else}} + + {{/if}} + {{else}} + + + {{/if}}
 
@@ -324,15 +369,47 @@ {{/each}} +
    +
  • + +

    +
    + + + + + + +
     
    +
    + +
    +
  • + {{#each ammos as |ammo key|}} +
  • + + {{ammo.name}} + + + +
     
    +
    + +
    +
  • + {{/each}} +
+
  • - + - + @@ -346,8 +423,8 @@ {{armor.name}} - {{upper armor.system.armortype}} - {{armor.system.absorprionroll}} + {{upper armor.system.armortype}} + {{armor.system.absorprionroll}}
     
    diff --git a/templates/chat/chat-generic-result.hbs b/templates/chat/chat-generic-result.hbs index 000c582..30b6829 100644 --- a/templates/chat/chat-generic-result.hbs +++ b/templates/chat/chat-generic-result.hbs @@ -50,11 +50,15 @@ {{/if}} {{#if (and weapon isSuccess)}} - {{#if weapon.system.hashpdamage}} -
  • Roll HP Damage: [[/r {{weapon.system.damage}}]]
  • - {{/if}} - {{#if weapon.system.hasfatiguedamage}} -
  • Roll Fatigue Damage: [[/r {{weapon.system.fatiguedamage}}]]
  • + {{#if weapon.ammo}} +
  • Roll Ammo Damage ({{weapon.ammo.name}}): [[/r {{weapon.ammo.system.damage}}]]
  • + {{else}} + {{#if weapon.system.hashpdamage}} +
  • Roll HP Damage: [[/r {{weapon.system.damage}}]]
  • + {{/if}} + {{#if weapon.system.hasfatiguedamage}} +
  • Roll Fatigue Damage: [[/r {{weapon.system.fatiguedamage}}]]
  • + {{/if}} {{/if}} {{/if}} diff --git a/templates/items/item-ammo-sheet.hbs b/templates/items/item-ammo-sheet.hbs new file mode 100644 index 0000000..d783356 --- /dev/null +++ b/templates/items/item-ammo-sheet.hbs @@ -0,0 +1,56 @@ +
    +
    + +
    +

    +
    +
    + + {{> systems/fvtt-dark-stars/templates/partials/partial-item-nav.hbs}} + + + {{!-- Sheet Body --}} +
    + + {{> systems/fvtt-dark-stars/templates/partials/partial-item-description.hbs}} + +
    + +
    +
      + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    • + +
    +
    +
    + +
    +
    diff --git a/templates/items/item-weapon-sheet.hbs b/templates/items/item-weapon-sheet.hbs index 47ffd73..0dc6319 100644 --- a/templates/items/item-weapon-sheet.hbs +++ b/templates/items/item-weapon-sheet.hbs @@ -47,22 +47,30 @@ -
  • - +
  • +
  • - {{#if system.hashpdamage}} -
  • - -
  • - {{/if}} -
  • - -
  • - {{#if system.hasfatiguedamage}} -
  • - -
  • + {{#if system.needammo}} + + {{else}} +
  • + +
  • + {{#if system.hashpdamage}} +
  • + +
  • + {{/if}} + +
  • + +
  • + {{#if system.hasfatiguedamage}} +
  • + +
  • + {{/if}} {{/if}}