Skip to content

Commit

Permalink
v0.2.5 (#12)
Browse files Browse the repository at this point in the history
* Fixed some GWMWG weapons according to Rat Catchers Guild update, thanks to hamofficer
* Added support for retrieving arrows out of combat
* removed unnecessary logging
  • Loading branch information
Forien authored Jun 10, 2020
1 parent 0bce30b commit bce6904
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 32 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# FoundryVTT - Forien's Armoury
**[Current version]**: v0.2.4
**[Current version]**: v0.2.5
**[Compatibility]**: *FoundryVTT* 0.6.0+, *WFRP4e* 1.5.5+
**[Optional modules]**: *Babele* 1.19+ (required for translations)

Expand All @@ -21,6 +21,7 @@ This module is a collection of custom trappings and features for Warhammer Fanta
* Prepared groundwork for translation using Babele to any language
* Started translating Forien's Armoury compendium to Polish (all names and most descriptions done)
* Added notification when combat ends about all recovered ammunition. Only owner and GM see it.
* Restored support for retrieving ammunition out of combat


## Installation
Expand Down Expand Up @@ -56,7 +57,6 @@ Module contains single Compendium pack containing at the moment 34 items.
## Future plans

### Features
* fix out-of-encounter bug with arrow reclamation
* add checkboxes in weapon test dialog that would allow to override arrow recovery system

### Content
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## v0.X.X
### v0.2.X

#### v0.2.5
* Fixed some GWMWG weapons according to Rat Catchers Guild update, thanks to hamofficer
* Added support for retrieving arrows out of combat
* removed unnecessary logging

#### v0.2.4
* Added notification when combat ends about all recovered ammunition. Only owner and GM see it.
* fixed Unbreakable
Expand Down
Binary file added icons/mace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
}
],
"system": "wfrp4e",
"version": "0.2.4",
"version": "0.2.5",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.2",
"url": "https://github.com/Forien/foundryvtt-forien-armoury",
"manifest": "https://raw.githubusercontent.com/Forien/foundryvtt-forien-armoury/v0.2.4/module.json",
"download": "https://github.com/Forien/foundryvtt-forien-armoury/archive/v0.2.4.zip",
"readme": "https://github.com/Forien/foundryvtt-forien-armoury/blob/v0.2.4/README.md",
"changelog": "https://github.com/Forien/foundryvtt-forien-armoury/blob/v0.2.4/changelog.md",
"manifest": "https://raw.githubusercontent.com/Forien/foundryvtt-forien-armoury/v0.2.5/module.json",
"download": "https://github.com/Forien/foundryvtt-forien-armoury/archive/v0.2.5.zip",
"readme": "https://github.com/Forien/foundryvtt-forien-armoury/blob/v0.2.5/README.md",
"changelog": "https://github.com/Forien/foundryvtt-forien-armoury/blob/v0.2.5/changelog.md",
"bugs": "https://github.com/Forien/foundryvtt-forien-armoury/issues",
"packs": [
{
Expand Down
14 changes: 7 additions & 7 deletions packs/armoury.db

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packs/pl/forien-armoury.forien-armoury.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
"id": "Morgenstern",
"name": "Morgensztern",
"description": "<p>Knightly Weapon</p>",
"qualities": "Pierce,Pummel",
"qualities": "Penetrating, Pummel",
"flaws": "",
"special": ""
},
Expand Down
2 changes: 1 addition & 1 deletion packs/templates/forien-armoury.forien-armoury.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@
"id": "Morgenstern",
"name": "Morgenstern",
"description": "<p>Knightly Weapon</p>",
"qualities": "Pierce,Pummel",
"qualities": "Penetrating, Pummel",
"flaws": "",
"special": ""
},
Expand Down
34 changes: 19 additions & 15 deletions scripts/arrows-reclamation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ ForienArmoury.ArrowReclamation = class ArrowReclamation {
ammoReplenish[actorId] = actorData;

// set (overwrite) flag with updated data
game.combat.setFlag('forien-armoury', 'ammoReplenish', ammoReplenish);
game.combat.unsetFlag('forien-armoury', 'ammoReplenish').then(() => {
game.combat.setFlag('forien-armoury', 'ammoReplenish', ammoReplenish);
});
}

/**
Expand All @@ -40,15 +42,18 @@ ForienArmoury.ArrowReclamation = class ArrowReclamation {
* @param userId
* @param bulk
*/
static replenishAmmo(actorId, ammoId, quantity, userId, bulk = false) {
let actor = game.actors.find(a => a._id === actorId);
let ammoEntity = duplicate(actor.getEmbeddedEntity("OwnedItem", ammoId));

ammoEntity.data.quantity.value += quantity;
actor.updateEmbeddedEntity("OwnedItem", {_id: ammoId, "data.quantity.value": ammoEntity.data.quantity.value});

if (bulk)
this.notifyAmmoReturned(actor, ammoEntity, userId, quantity);
static replenishAmmo(actorId, ammoId, quantity, userId, bulk = false, ) {
let timeout = bulk ? 0 : 300;
setTimeout(() => {
let actor = game.actors.find(a => a._id === actorId);
let ammoEntity = duplicate(actor.getEmbeddedEntity("OwnedItem", ammoId));

ammoEntity.data.quantity.value += quantity;
actor.updateEmbeddedEntity("OwnedItem", {_id: ammoId, "data.quantity.value": ammoEntity.data.quantity.value});

if (bulk)
this.notifyAmmoReturned(actor, ammoEntity, userId, quantity);
}, timeout);
}

/**
Expand Down Expand Up @@ -130,7 +135,7 @@ ForienArmoury.ArrowReclamation = class ArrowReclamation {

// define chat messages
type = game.i18n.localize("FArmoury." + type);
// let messageNow = game.i18n.format("FArmoury.recovered", {type});
let messageNow = game.i18n.format("FArmoury.recovered", {type});
let messageFuture = game.i18n.format("FArmoury.recoveredFuture", {type});


Expand All @@ -148,9 +153,9 @@ ForienArmoury.ArrowReclamation = class ArrowReclamation {

if (recovered === true) {
if (game.combat == null) {
return; // broken at the moment
// message = messageNow;
// ForienArmoury.ArrowReclamation.replenishAmmo(actorId, ammoId, 1);
// return; // broken at the moment
message = messageNow;
ForienArmoury.ArrowReclamation.replenishAmmo(actorId, ammoId, 1);
} else {
message = messageFuture;
if (game.user.isGM) {
Expand Down Expand Up @@ -307,7 +312,6 @@ ForienArmoury.ArrowReclamation = class ArrowReclamation {
if (data.winner === "defender")
return;

console.log(data);
let target = canvas.tokens.get(data.speakerDefend.token);
let armor = target.actor.prepareItems().AP;
let hitLocation = data.hitloc.value;
Expand Down
1 change: 0 additions & 1 deletion scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ForienArmoury.Utils = class {
else
objData = {...arrData};

console.log(arrData, objData);
return game.i18n.format(stringId, objData);
});
}
Expand Down

0 comments on commit bce6904

Please sign in to comment.