From 38834e8a7657e2744a3e0be5b1c85523a5a20817 Mon Sep 17 00:00:00 2001 From: HavelockV Date: Mon, 10 Aug 2020 20:26:51 +0200 Subject: [PATCH] release of 0.2.2 --- README.md | 28 ++++++++++++++++++++++ module/chat/rangecombat.js | 5 ++++ templates/chat/combat/range-initiator.html | 8 ++++++- 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b93354a7..84684420 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,34 @@ Compendium 'Weapons' contains a single test weapon. ## What is working +version 0.2.2 : + +* PDFoundry Integration. +* First implementation of range combat. + * Weapon sheet has been modified. + * select a target (or not) and in the combat tab click on a range weapon name. This will start the range combat flow and open a range combat chat-card. + * All bonus and penalties can be overridden by the keeper only. + * Range and difficulty are automatically calculated. + * Bonus for target size, speed are automatically applied. + * Bonus for shooting at point blank is automatically given. + * Calculation of bullets wasted when switching target in automatic fire mode. + * Penalty dice for multi/auto fire are applied. + * Difficulty automatically increased with mode than 2 penalty dice. + * If you don't have a target a fake 'dummy' target will be created. + * Supports auto-fire, burst, single shot, multi shots. + * Supports weapon malfunction. + * Damage rolls (armor is not taken in account). + * What is coming next: + * Implementation of shotgun type weapons and explosives. + * Distribution of damage to the targets and status applied. + * Attribution of malfunction to the corresponding weapons. + * Implementation of fast forwarding for range and melee combat. + * Implementation of bullets. + * Limitation on number of shot fired (depending on the weapon max shot per rounds and bullets in the magazine). +* Support for Japanese translation thanks to AdmiralNyar. +* Bugs correction + * Movement calculation. + version 0.2.1 : * Template and CSS correction. diff --git a/module/chat/rangecombat.js b/module/chat/rangecombat.js index 2e8a5d86..283b259f 100644 --- a/module/chat/rangecombat.js +++ b/module/chat/rangecombat.js @@ -22,6 +22,7 @@ export class CoC7RangeInitiator{ this.fullAuto = false; this.tokenKey = null; this.aimed = false; + this.totalBulletsFired= 0; this._targets = []; [...game.user.targets].forEach( t => { @@ -239,6 +240,7 @@ export class CoC7RangeInitiator{ if( previousShot.actorKey != this.activeTarget.actorKey){ const distance = chatHelper.getDistance( chatHelper.getTokenFromKey(previousShot.actorKey), chatHelper.getTokenFromKey(this.activeTarget.actorKey)); shot.transitBullets = Math.floor( chatHelper.toYards(distance)); + this.totalBulletsFired = parseInt(this.totalBulletsFired) + shot.transitBullets; shot.transit = true; } } @@ -247,6 +249,8 @@ export class CoC7RangeInitiator{ shot.bulletsShot = this.weapon.data.data.usesPerRound.burst; } + this.totalBulletsFired = parseInt(this.totalBulletsFired) + shot.bulletsShot; + if( this.aiming) { this.aiming = false; this.aimed = true; @@ -359,6 +363,7 @@ export class CoC7RangeInitiator{ check.diceModifier = shot.modifier; } else { this.calcTargetsDifficulty(); + this.totalBulletsFired = parseInt( this.totalBulletsFired) + 1; if( this.aiming){ this.aiming = false; this.aimed = true; diff --git a/templates/chat/combat/range-initiator.html b/templates/chat/combat/range-initiator.html index f77532bb..e58ffb01 100644 --- a/templates/chat/combat/range-initiator.html +++ b/templates/chat/combat/range-initiator.html @@ -16,7 +16,8 @@ data-aiming={{aiming}} data-is-GM="{{isGM}}" data-aimed="{{aimed}}" - data-damage-rolled={{damageRolled}}> + data-damage-rolled="{{damageRolled}}" + data-total-bullets-fired="{{totalBulletsFired}}">
@@ -32,8 +33,10 @@

+ {{#if rolled}}
+ Bullets fired : {{totalBulletsFired}} {{#if singleShot}} {{localize 'CoC7.rangeCombatCard.SingleShot'}}{{/if}} {{#if multipleShots}} {{localize 'CoC7.rangeCombatCard.MultipleShots'}}{{/if}} {{#if burst}} {{localize 'CoC7.rangeCombatCard.Burst'}}{{/if}} @@ -43,6 +46,9 @@

{{#if aimed}} {{localize 'CoC7.rangeCombatCard.aiming'}}{{/if}}

{{else}} +
+ Bullets fired : {{totalBulletsFired}} +
{{#if item.singleShot}}