Fix suppression pelerinage/fermeture-cites

et suppression du pèlerinage lorsqu'on est arrivé
This commit is contained in:
Vincent Vandemeulebrouck 2021-02-12 18:31:49 +01:00
parent 4f35b28aa1
commit 6708e3eb71
3 changed files with 21 additions and 22 deletions

View File

@ -13,7 +13,7 @@
version="1.1"
id="svg878"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
sodipodi:docname="pelerin2.svg">
sodipodi:docname="pelerin.svg">
<defs
id="defs872">
<clipPath
@ -123,74 +123,74 @@
</metadata>
<g
id="g1510"
style="fill:#d38d5f;stroke:#502d16;image-rendering:auto"
style="fill:#784421;stroke:#ffffff;image-rendering:auto"
transform="translate(-1.0583648,-3.7366014)">
<g
inkscape:label="Clip"
id="g1726"
style="fill:#d38d5f;stroke:#502d16">
style="fill:#784421;stroke:#ffffff">
<g
id="g3257"
transform="matrix(0.28980934,0,0,0.21909426,120.56466,-12.741092)"
style="display:inline;fill:#d38d5f;stroke:#502d16;stroke-width:2.16856">
style="display:inline;fill:#784421;stroke:#ffffff;stroke-width:2.16856">
<path
sodipodi:nodetypes="cccccc"
id="rect3250"
d="m -174.5565,130.97253 h 15.40856 v 508.4827 l -7.70428,24 -7.70428,-24 z"
style="fill:#d38d5f;stroke:#502d16;stroke-width:2.16856" />
style="fill:#784421;stroke:#ffffff;stroke-width:2.16856" />
<path
transform="matrix(1.001146,0,0,0.893038,2.193524,15.82179)"
style="fill:#d38d5f;stroke:#502d16;stroke-width:2.29344"
style="fill:#784421;stroke:#ffffff;stroke-width:2.29344"
d="m -145.09735,123.91028 c 0,13.11269 -10.64218,17.6523 -23.75487,17.6523 -13.11269,0 -23.75487,-4.53961 -23.75487,-17.6523 0,-13.11269 10.64218,-23.75487 23.75487,-23.75487 13.11269,0 23.75487,10.64218 23.75487,23.75487 z"
id="path3252"
sodipodi:nodetypes="csssc" />
<path
style="fill:#d38d5f;stroke:#502d16;stroke-width:2.16856"
style="fill:#784421;stroke:#ffffff;stroke-width:2.16856"
d="m -146.94948,221.199 c 0,8.50553 -8.91642,12.68366 -19.90273,12.68366 -10.98631,0 -19.90273,-4.17813 -19.90273,-12.68366 0,-8.50553 8.91642,-9.95873 19.90273,-9.95873 10.98631,0 19.90273,1.4532 19.90273,9.95873 z"
id="path3254"
sodipodi:nodetypes="csssc" />
</g>
<g
style="display:inline;fill:#d38d5f;stroke:#502d16"
style="display:inline;fill:#784421;stroke:#ffffff"
id="g2066"
transform="matrix(0.20847315,-0.03662954,0.03662954,0.20847315,-0.34176516,-0.20270665)">
<g
inkscape:label="Fond écu"
id="g2068"
style="fill:#d38d5f;stroke:#502d16" />
style="fill:#784421;stroke:#ffffff" />
<g
style="opacity:1;fill:#d38d5f;stroke:#502d16"
style="opacity:1;fill:#784421;stroke:#ffffff"
inkscape:label="Meubles"
id="g2070">
<g
id="g4219"
transform="matrix(0.714908,0,0,0.756557,137.7704,128.4719)"
style="display:inline;fill:#d38d5f;fill-opacity:1;stroke:#502d16;stroke-width:2.71947;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
style="display:inline;fill:#784421;fill-opacity:1;stroke:#ffffff;stroke-width:2.71947;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
sodipodi:nodetypes="ccccc"
id="path4221"
d="m 160.08787,143.23938 39.92645,57.31251 39.53535,-57.31251 h -40.3837 z"
style="fill:#d38d5f;fill-opacity:1;fill-rule:evenodd;stroke:#502d16;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="fill:#784421;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccccccccccccccccc"
id="path4223"
d="m 193.20453,145.31745 c -24.41443,20.15923 -49.98749,37.33861 -73.2768,58.5917 -6.37089,11.43876 -4.50952,20.09512 9.2768,25.68955 14.75917,-16.92275 18.76874,-17.90421 41.38418,-46.03566 -22.42258,29.55858 -41.45116,42.84434 -41.29043,46.09816 5.38114,19.66042 0.98803,22.70493 25.28125,31.0625 2.90109,-14.41044 25.62687,-63.19056 32.51802,-70.81345 -6.73696,8.18151 -29.75646,56.59527 -32.58052,71.37595 18.94602,17.92 18.75832,19.45149 44.6875,14.03125 l 0.375,-80.91001 0.375,80.91001 c 21.42445,5.42024 29.31401,4.7897 44.65625,-14.03125 -3.59166,-13.24549 -25.62533,-59.96461 -31.64832,-69.57405 4.75359,7.7904 26.43091,52.99484 31.61707,69.01155 18.88754,-8.35757 21.70202,-8.69924 25.28125,-31.0625 -1.0235,-6.998 -18.88266,-18.38043 -42.22262,-45.81545 23.11839,25.66768 42.65103,40.10972 42.31637,45.75295 15.18653,-6.16263 15.88219,-19.26899 8.92398,-28.52504 -25.17844,-18.14393 -47.18822,-37.47898 -72.36824,-56.58981 0,0 -4.64225,-4.09784 -6.93074,-3.0414 z"
style="fill:#d38d5f;fill-opacity:1;fill-rule:evenodd;stroke:#502d16;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="fill:#784421;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="cc"
id="path4225"
d="m 168.24779,168.92114 c 23.13397,11.51861 44.28729,9.17267 64.46537,0"
style="fill:#d38d5f;fill-opacity:1;fill-rule:evenodd;stroke:#502d16;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
style="fill:#784421;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.71947;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
<g
inkscape:label="Reflet final"
id="g2076"
style="fill:#d38d5f;stroke:#502d16" />
style="fill:#784421;stroke:#ffffff" />
<g
inkscape:label="Contour final"
id="g2078"
style="fill:#d38d5f;stroke:#502d16" />
style="fill:#784421;stroke:#ffffff" />
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -11,7 +11,7 @@ export class FermetureCites extends Draconique {
type() { return 'souffle' }
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('fermeture des cites'); }
manualMessage() { return false }
async onActorCreateOwned(actor, item) { await this._fermerLesCites(actor); }
async onActorCreateOwned(actor, souffle) { await this._fermerLesCites(actor, souffle); }
code() { return 'fermeture' }
tooltip(linkData) { return `La ${this.tmrLabel(linkData)} est fermée` }
@ -28,11 +28,11 @@ export class FermetureCites extends Draconique {
});
}
async _fermerLesCites(actor) {
async _fermerLesCites(actor, souffle) {
let existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
let ouvertes = TMRUtility.filterTMR(it => it.type == 'cite' && !existants.includes(it.coord));
for (let tmr of ouvertes) {
await this.createCaseTmr(actor, 'Fermeture: ' + tmr.label, tmr);
await this.createCaseTmr(actor, 'Fermeture: ' + tmr.label, tmr, souffle._id);
}
}

View File

@ -14,7 +14,7 @@ export class Pelerinage extends Draconique {
async onActorCreateOwned(actor, queue) {
let tmr = TMRUtility.getTMRAleatoire();
await this.createCaseTmr(actor, 'Pèlerinage: ' + tmr.label, tmr);
await this.createCaseTmr(actor, 'Pèlerinage: ' + tmr.label, tmr, queue._id);
}
@ -34,8 +34,7 @@ export class Pelerinage extends Draconique {
async onFinPelerinage(actor, tmr, onRemoveToken) {
const pelerinages = actor.data.items.filter(it => this.isCase(it, tmr.coord));
for (let p of pelerinages){
await actor.deleteOwnedItem(p._id);
await actor.deleteOwnedItem(p.data.sourceId);
await actor.deleteOwnedItem(p.data.sourceid);
onRemoveToken(tmr, p);
}
}