Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Qaw committed Nov 20, 2021
2 parents 5ed0e7f + f7bc8ab commit c8caa55
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 8 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Modules disponibles :
* Lancer votre partie en cliquant sur le bouton "Launch World" de votre monde. Vous êtes prêts à jouer.
---
## Changelog
### Version 0.8.9.6
CORRECTIFS
- Affichage du nombre de mains dans l'onglet Combat
- La désélection des propriétés d'un objet entraine la désélection des propriétés liées
- Corrige checkbox DR cachée si option non activée

### Version 0.8.9.5
FONCTIONNALITES
- Dé explosif des DM désactivable par une option
Expand Down
116 changes: 114 additions & 2 deletions module/items/item-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export class CoCItemSheet extends ItemSheet {
activateListeners(html) {
super.activateListeners(html);

// html.find('.editor-content[data-edit]').each((i, div) => this._activateEditor(div));

html.find('.droppable').on("dragover", function(event) {
event.preventDefault();
event.stopPropagation();
Expand Down Expand Up @@ -121,6 +119,7 @@ export class CoCItemSheet extends ItemSheet {
}
});

html.find('.checkbox').click(this._onVerifyCheckboxes.bind(this));
}

/** @override */
Expand Down Expand Up @@ -291,4 +290,117 @@ export class CoCItemSheet extends ItemSheet {
}
return props.filter(p => !!p);
}

/**
*
* @param {*} event
* @returns
*/
_onVerifyCheckboxes(event){
const input = $(event.currentTarget).find("input");
const name = input.attr('name');
const checked = input.prop('checked')
if (name === "data.properties.equipment" && !checked) {
let data = duplicate(this.item.data);
data.data.properties.equipable = false;
data.data.slot = "";
data.data.properties.stackable = false;
data.data.qty = 1;
data.data.stacksize = null;
data.data.properties.unique = false;
data.data.properties.consumable = false;
data.data.properties.tailored = false;
data.data.properties["2H"] = false;
data.data.price = 0;
data.data.value = 0;
data.data.rarity = "";
return this.item.update(data);
}
if (name === "data.properties.equipable" && !checked) {
let data = duplicate(this.item.data);
data.data.slot = "";
return this.item.update(data);
}
if (name === "data.properties.stackable" && !checked) {
let data = duplicate(this.item.data);
data.data.qty = 1;
data.data.stacksize = null;
return this.item.update(data);
}
if (name === "data.properties.weapon" && !checked) {
let data = duplicate(this.item.data);
data.data.skill = "@attacks.melee.mod";
data.data.skillBonus = 0;
data.data.dmgBase = 0;
data.data.dmgStat = "";
data.data.dmgBonus = 0;
data.data.critrange = "20"
data.data.properties.bashing = false;
data.data.properties["13strmin"] = false;
return this.item.update(data);
}
if (name === "data.properties.protection" && !checked) {
let data = duplicate(this.item.data);
data.data.defBase = 0;
data.data.defBonus = 0;
data.data.properties.dr = false;
data.data.dr = 0;
return this.item.update(data);
}
if (name === "data.properties.dr" && !checked) {
let data = duplicate(this.item.data);
data.data.dr = 0;
return this.item.update(data);
}
if (name === "data.properties.ranged" && !checked) {
let data = duplicate(this.item.data);
data.data.range = 0;
data.data.properties.reloadable = false;
data.data.properties.salve = false;
data.data.properties.proneshot = false;
data.data.properties.explosive = false;
data.data.reload = "";
return this.item.update(data);
}
if (name === "data.properties.reloadable" && !checked) {
let data = duplicate(this.item.data);
data.data.reload = "";
return this.item.update(data);
}
if (name === "data.properties.effects" && !checked) {
let data = duplicate(this.item.data);
data.data.properties.heal = false;
data.data.properties.buff = false;
data.data.properties.temporary = false;
data.data.properties.persistent = false;
data.data.properties.spell = false;
data.data.effects.heal.formula = null;
data.data.effects.buff.formula = null;
data.data.properties.duration.formula = null;
data.data.properties.duration.units = "";
data.data.properties.activable = false;
return this.item.update(data);
}
if (name === "data.properties.heal" && !checked) {
let data = duplicate(this.item.data);
data.data.effects.heal.formula = null;
return this.item.update(data);
}
if (name === "data.properties.buff" && !checked) {
let data = duplicate(this.item.data);
data.data.effects.buff.formula = null;
return this.item.update(data);
}
if (name === "data.properties.temporary" && !checked) {
let data = duplicate(this.item.data);
data.data.properties.duration.formula = null;
data.data.properties.duration.units = "";
return this.item.update(data);
}
if (name === "data.properties.spell" && !checked) {
let data = duplicate(this.item.data);
data.data.properties.activable = false;
return this.item.update(data);
}
}
}
5 changes: 4 additions & 1 deletion module/system/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ export default function registerHooks() {
else {
html.find(".apply-dmg").each((i, btn) => {
btn.style.display = "none"
});
});
html.find(".dr-checkbox").each((i, btn) => {
btn.style.display = "none"
});
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "coc",
"title": "Chroniques Oubliées Contemporain",
"description": "<p>Système Foundry VTT pour <a href='https://www.black-book-editions.fr/catalogue.php?id=477'>Chroniques Oubliées Contemporain</a>.</p><p> *** Rejoignez la communauté Discord FR :<a href='https://discord.gg/pPSDNJk'>https://discord.gg/pPSDNJk</a></p>",
"version": "0.8.9.5",
"version": "0.8.9.6",
"minimumCoreVersion": "0.8.6",
"compatibleCoreVersion": "0.8.9",
"templateVersion": 2,
Expand Down Expand Up @@ -91,6 +91,6 @@
"secondaryTokenAttribute": null,
"url": "https://github.com/ZigmundKreud/coc",
"manifest": "https://raw.githubusercontent.com/ZigmundKreud/coc/master/system.json",
"download": "https://github.com/ZigmundKreud/coc/archive/refs/tags/0.8.9.5.zip",
"download": "https://github.com/ZigmundKreud/coc/archive/refs/tags/0.8.9.6.zip",
"license": "LICENCE"
}
1 change: 0 additions & 1 deletion templates/actors/parts/combat/character-combat-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<div class="item-detail">
{{#if data.properties.ranged}}{{data.range}}{{/if}}
</div>
{{log 'properties.2H' data.properties.2H}}
<div class="item-detail">
{{#if (equals data.slot "hand")}}
{{#if data.properties.2H}}
Expand Down
4 changes: 2 additions & 2 deletions templates/chat/dmg-roll-card.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<h3><strong>{{label}}</strong></h3>
</div>
<div class="flex1 right no-wrap">
<label for="dr">{{localize "COC.ui.dr.abbrev"}}</label>
<input type="checkbox" id="dr" name="dr">
<label for="dr" class="dr-checkbox">{{localize "COC.ui.dr.abbrev"}}</label>
<input type="checkbox" id="dr" name="dr" class="dr-checkbox">
<a class="btn apply-dmg" data-apply="full">
<i class="fas fa-user-minus" title="{{localize "COC.ui.applyDamage"}}"></i>
</a>
Expand Down

0 comments on commit c8caa55

Please sign in to comment.