Skip to content

Commit

Permalink
release of 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
HavlockV committed Aug 10, 2020
1 parent 4d5e8bb commit 38834e8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions module/chat/rangecombat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
{
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion templates/chat/combat/range-initiator.html
Original file line number Diff line number Diff line change
Expand Up @@ -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}}">

<header class="card-header flexcol">
<div class="flexrow">
Expand All @@ -32,8 +33,10 @@ <h3 style="text-align: center;font-weight: bolder;"class="item-name card-title">
</div>
</div>


{{#if rolled}}
<div class="shooter-modifier flex0">
<span class='tag'>Bullets fired : {{totalBulletsFired}}</span>
{{#if singleShot}} <span class="tag" title="Single shot">{{localize 'CoC7.rangeCombatCard.SingleShot'}}</span>{{/if}}
{{#if multipleShots}} <span class="tag" title="Multiple Shots (Penalty die)">{{localize 'CoC7.rangeCombatCard.MultipleShots'}}</span>{{/if}}
{{#if burst}} <span class="tag" title="Bursts">{{localize 'CoC7.rangeCombatCard.Burst'}}</span>{{/if}}
Expand All @@ -43,6 +46,9 @@ <h3 style="text-align: center;font-weight: bolder;"class="item-name card-title">
{{#if aimed}} <span class="tag" title="Add 1 bonus die for the first shot">{{localize 'CoC7.rangeCombatCard.aiming'}}</span>{{/if}}
</div>
{{else}}
<div class='total-bullets'>
<span class='tag'>Bullets fired : {{totalBulletsFired}}</span>
</div>
<div class="flexrow range-selection">
{{#if item.singleShot}}
<span class="flex1 toggle-switch singleShot {{#unless rolled}}simple-flag{{/unless}} {{#if singleShot}}switched-on{{/if}}"
Expand Down

0 comments on commit 38834e8

Please sign in to comment.