Skip to content

Commit

Permalink
Merge pull request #83 from napolitanod/1.6.12.6
Browse files Browse the repository at this point in the history
1.6.12.6
  • Loading branch information
napolitanod committed Dec 16, 2022
2 parents 490f55f + 424a0b7 commit bb00e9b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions module.json
Expand Up @@ -34,8 +34,8 @@
"styles/danger-zone.css"
],
"title": "Danger Zone",
"version": "1.6.12.5",
"version": "1.6.12.6",
"url": "https://github.com/napolitanod/Danger-Zone",
"manifest": "https://raw.githubusercontent.com/napolitanod/Danger-Zone/master/module.json",
"download": "https://github.com/napolitanod/Danger-Zone/releases/download/1.6.12.5/module.zip"
"download": "https://github.com/napolitanod/Danger-Zone/releases/download/1.6.12.6/module.zip"
}
13 changes: 5 additions & 8 deletions scripts/apps/workflow.js
Expand Up @@ -1047,7 +1047,7 @@ class executable {
}

get targets(){
return zone.sourceTreatment(this.source, (this.save ? (this.save > 1 ? this.data.save.failed : this.data.save.succeeded) : this.data.targets), this.data.sources);
return this.data.zone.sourceTreatment(this.source, (this.save ? (this.save > 1 ? this.data.save.failed : this.data.save.succeeded) : this.data.targets), this.data.sources);
}

async check(){
Expand Down Expand Up @@ -1156,10 +1156,6 @@ class activeEffect extends executable {
get limit(){
return this.flag.limit ? this.flag.limit : false
}

get source(){
return this.flag.source ? this.flag.source : ''
}

get save(){
return this.data.danger.save.ae ? parseInt(this.data.danger.save.ae) : 0
Expand All @@ -1169,6 +1165,7 @@ class activeEffect extends executable {
await super.play()
if(this._cancel) return
for (const token of this.targets) {
if(!token.actor) continue
if(this.limit && token.actor && token.actor.effects.find(e => e.flags[dangerZone.ID]?.origin === this.data.danger.id)){
continue;
}
Expand Down Expand Up @@ -1544,7 +1541,7 @@ class damageToken extends executable{
}

get targets(){
return zone.sourceTreatment(this.source, this.data.targets, this.data.sources);
return this.data.zone.sourceTreatment(this.source, this.data.targets, this.data.sources);
}

get targetNames(){
Expand Down Expand Up @@ -1808,6 +1805,7 @@ class item extends executable {
return
}
for (const token of this.targets) {
if(!token.actor) continue
let crtdItms = []
if(this.action === 'A'){
crtdItms = await token.actor.createEmbeddedDocuments('Item', this.items)
Expand Down Expand Up @@ -2759,14 +2757,13 @@ class tokenEffect extends executableWithFile {
}

get duration(){
return this._part.duration
return this._part.duration ?? 0
}

get save(){
return this.data.danger.save.te ? parseInt(this.data.danger.save.te) : super.save
}


async play(){
await super.play()
if(this._cancel) return
Expand Down
2 changes: 1 addition & 1 deletion scripts/danger-zone.js
Expand Up @@ -513,7 +513,7 @@ export class zone {
return sources.length ? sources.filter(s => s.id === token.id).length > 0 : token.actor?.id === this.source.actor
}

static sourceTreatment(treatment, tokens, sources = []){
sourceTreatment(treatment, tokens, sources = []){
if(!treatment || !sources.length) return tokens
switch(treatment){
case "I":
Expand Down
2 changes: 1 addition & 1 deletion templates/danger-form-weather.hbs
Expand Up @@ -15,7 +15,7 @@
<div class="form-group">
<label for="duration">{{localize "DANGERZONE.type-form.weather.duration.label"}}</label>
<div class="form-fields">
<input type="number" data-dtype="Number" name="duration" placeholder="{{localize "DANGERZONE.ms"}}" min="0" step="1" value={{data.duration}}>
<input type="number" data-dtype="Number" name="duration" placeholder="{{localize "DANGERZONE.ms"}}" min="0" step="1" value={{#if data.duration}}{{data.duration}}{{else}}0{{/if}}>
</div>
</div>
<div class="form-group">
Expand Down

0 comments on commit bb00e9b

Please sign in to comment.