Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
0.90.1 - Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rughalt committed Mar 6, 2021
1 parent 1342f0c commit f8d4476
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 43 deletions.
4 changes: 4 additions & 0 deletions changelogs/changelog.0.90.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### All changes
- Fix saving fields on Saving Throw and Defense Dialogs
- Fix (@range) in Saving Throw and Defense Dialogs
- Minor UI and Translation fixes
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@
"D35E.RangeSliderAbout": "Range Slider can be used as (@range) in Combat Changes.",
"D35E.AmmoRecovered": "Ammo recovered",
"D35E.NotAddingAbilityWithStarUIDRace": "Racial ability {0} was not automatically added to actor because its UID ends with *. Make a copy of this ability and change its uid to use with Race.",
"D35E.CMBOptional": "Grapple (Optional)",

"SETTINGS.D35EShowPartyHudN": "Party HUD type",
"SETTINGS.D35EShowPartyHudL": "How to display party HUD",
Expand Down
18 changes: 7 additions & 11 deletions module/actor/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -4231,7 +4231,7 @@ export class ActorPF extends Actor {
rollModifiers.push(`${i.name}`)
}
if (i.hasCombatChange(attackType+'Optional',rollData) && optionalFeatIds.indexOf(i._id) !== -1) {
allCombatChanges = allCombatChanges.concat(i.getPossibleCombatChanges(attackType+'Optional', rollData))
allCombatChanges = allCombatChanges.concat(i.getPossibleCombatChanges(attackType+'Optional', rollData, optionalFeatRanges.get(i._id)))
if (optionalFeatRanges.get(i._id))
rollModifiers.push(`${i.name} (${optionalFeatRanges.get(i._id)})`)
else
Expand Down Expand Up @@ -4331,6 +4331,7 @@ export class ActorPF extends Actor {
let dialogData = {
data: rollData,
savingThrow: savingThrow,
id: `${this.id}-${_savingThrow}`,
rollMode: game.settings.get("core", "rollMode"),
rollModes: CONFIG.Dice.rollModes,
stFeats: this.items.filter(o => (o.type === "feat" || (o.type ==="buff" && o.data.data.active)) && o.hasCombatChange('savingThrow',rollData)),
Expand Down Expand Up @@ -4403,7 +4404,7 @@ export class ActorPF extends Actor {
rollModifiers.push(`${i.name}`)
}
if (i.hasCombatChange(attackType+'Optional',rollData) && optionalFeatIds.indexOf(i._id) !== -1) {
allCombatChanges = allCombatChanges.concat(i.getPossibleCombatChanges(attackType+'Optional', rollData))
allCombatChanges = allCombatChanges.concat(i.getPossibleCombatChanges(attackType+'Optional', rollData, optionalFeatRanges.get(i._id)))

if (optionalFeatRanges.get(i._id))
rollModifiers.push(`${i.name} (${optionalFeatRanges.get(i._id)})`)
Expand Down Expand Up @@ -4927,7 +4928,7 @@ export class ActorPF extends Actor {
rollModifiers.push(`${i.name}`)
}
if (i.hasCombatChange(attackType+'Optional',rollData) && optionalFeatIds.indexOf(i._id) !== -1) {
allCombatChanges = allCombatChanges.concat(i.getPossibleCombatChanges(attackType+'Optional', rollData))
allCombatChanges = allCombatChanges.concat(i.getPossibleCombatChanges(attackType+'Optional', rollData, optionalFeatRanges.get(i._id)))
i.addCharges(-1);
if (optionalFeatRanges.get(i._id))
rollModifiers.push(`${i.name} (${optionalFeatRanges.get(i._id)})`)
Expand All @@ -4938,15 +4939,9 @@ export class ActorPF extends Actor {



for (const change of allCombatChanges) {
console.log('D35E | Change', change[4])
if (change[3].indexOf('$') !== -1 && change[3].indexOf('&') !== -1) {
setProperty(rollData,change[3].substr(1), ItemPF._fillTemplate(change[4],rollData))
} else {
setProperty(rollData,change[3],(getProperty(rollData,change[3]) || 0) + (change[4] || 0))
}

}
this._addCombatChangesToRollData(allCombatChanges, rollData);

ac += rollData.featAC || 0;

console.log('D35E | Final roll AC', ac)
Expand All @@ -4958,6 +4953,7 @@ export class ActorPF extends Actor {
let dialogData = {
data: rollData,
item: this.data.data,
id: `${this.id}-defensedialog`,
rollMode: "gmroll",
rollModes: CONFIG.Dice.rollModes,
defenseFeats: this.items.filter(o => (o.type === "feat" || (o.type ==="buff" && o.data.data.active)) && o.hasCombatChange('defense',rollData)),
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "D35E",
"title": "3.5e SRD",
"description": "Implementation of 3.5 edition System Reference Document for Foundry VTT. Aiming to provide 100% SRD coverage.",
"version": "0.90",
"version": "0.90.1",
"author": "Rughalt",
"templateVersion": 2,
"scripts": [],
Expand Down
2 changes: 1 addition & 1 deletion templates/actors/parts/actor-inventory.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>
{{ localize 'D35E.AddItem' }}
</a><a
class="btn point-buy-button blue-button group-inventory tooltip" style="flex: 0 40px" data-pack="inline:items:weapon,equipment,consumable,loot:-:{{ localize 'D35E.Items'}}" onkeydown="e.preventDefault();">
<i class="fas fa-broom" style="color: white !important;"></i><span class="tooltipcontent">{{localize "D35E.SortInventory"}}</span>
<i class="fas fa-broom" style="color: white !important;"></i><span class="tooltipcontent" style="z-index: 1000">{{localize "D35E.SortInventory"}}</span>
</a></div>
{{!-- Inventory Navigation --}}
<!--<nav class="sheet-navigation tabs subtabs inventory" data-group="inventory">-->
Expand Down
64 changes: 38 additions & 26 deletions templates/apps/defense-roll-dialog.html
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
<form>
<div class="form-group">
<label>{{localize "D35E.ACBonus"}}</label>
<input type="text" name="ac-bonus" value="" placeholder="e.g. +1d4"/>
<label>{{localize "D35E.ACBonus"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<input type="text" name="ac-bonus" value="" class="auto-save" placeholder="e.g. +1d4"/>
</div>
<div class="form-group stacked">
<label class="block-header">{{localize "D35E.CombatStatus"}}</label>
</div>
<div class="flexrow">
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="conceal"/>
<input type="checkbox" class="stylized auto-save" name="conceal"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.Concealment"}} (20%)</label>
<label>{{localize "D35E.Concealment"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="fullconceal"/>
<input type="checkbox" class="stylized auto-save" name="fullconceal"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.FullConcealment"}} (50%)</label>
<label>{{localize "D35E.FullConcealment"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
</div>
<div class="flexrow">
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="charged"/>
<input type="checkbox" class="stylized auto-save" name="charged"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.Charged"}} (-2)</label>
<label>{{localize "D35E.Charged"}} (-2) <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="covered"/>
<input type="checkbox" class="stylized auto-save" name="covered"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.BehindCover"}} (+4)</label>
<label>{{localize "D35E.BehindCover"}} (+4) <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
</div>
<div class="flexrow">
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="squeezing"/>
<input type="checkbox" class="stylized auto-save" name="squeezing"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.Squeezing"}} (-4)</label>
<label>{{localize "D35E.Squeezing"}} (-4) <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="prone"/>
<input type="checkbox" class="stylized auto-save" name="prone"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.Prone"}} (-4/+4)</label>
<label>{{localize "D35E.Prone"}} (-4/+4) <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
</div>

<div class="flexrow">
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="totaldefense"/>
<input type="checkbox" class="stylized auto-save" name="totaldefense"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.TotalDefense"}} (+4)</label>
<label>{{localize "D35E.TotalDefense"}} (+4) <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
<div class="form-group">
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="defense"/>
<input type="checkbox" class="stylized auto-save" name="defense"/>
<span class="checkmark"></span>
</label>
<label>{{localize "D35E.DefensiveFighting"}} (+2)</label>
<label>{{localize "D35E.DefensiveFighting"}} (+2) <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
</div>
</div>
<div class="form-group stacked">
Expand Down Expand Up @@ -101,37 +101,49 @@
</div>

<div class="form-group">
<label>{{localize "D35E.ACDialogHalfDamage"}}</label>
<label>{{localize "D35E.ACDialogHalfDamage"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="applyHalf"
<input type="checkbox" class="stylized auto-save" name="applyHalf"
data-type="optional"/>
<span class="checkmark"></span>
</label>
</div>
<div class="form-group">
<label>{{localize "D35E.ACDialogNoCritical"}}</label>
<label>{{localize "D35E.ACDialogNoCritical"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="noCritical"
<input type="checkbox" class="stylized auto-save" name="noCritical"
data-type="optional"/>
<span class="checkmark"></span>
</label>
</div>
<div class="form-group">
<label>{{localize "D35E.ACApplyPrecision"}}</label>
<label>{{localize "D35E.ACApplyPrecision"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<label class="checkbox" style="flex: 0 16px; margin-right: 8px; position: relative">
<input type="checkbox" class="stylized" name="applyPrecision"
<input type="checkbox" class="stylized auto-save" name="applyPrecision"
data-type="optional"/>
<span class="checkmark"></span>
</label>
</div>
<div class="form-group">
<label>{{localize "D35E.RollMode"}}</label>
<select name="rollMode">
<label>{{localize "D35E.RollMode"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<select name="rollMode" class="auto-save">
{{#select rollMode}}
{{#each rollModes as |label mode|}}
<option value="{{mode}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select>
</div>

<script>
if (game.settings.get("D35E", "saveAttackWindow")) {
$('.auto-save').savy('load',function(){
console.log("All fields from save are loaded");
$('.attack-form input').trigger('change')
},'{{id}}');
}
else {
$('.fa-history').hide()
}
</script>
</form>
20 changes: 16 additions & 4 deletions templates/apps/saving-throw-roll-dialog.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<form>
<div class="form-group">
<label>{{localize "D35E.STBonus"}}</label>
<input type="text" name="st-bonus" value="" placeholder="e.g. +1d4"/>
<label>{{localize "D35E.STBonus"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<input type="text" name="st-bonus" class="auto-save" value="" placeholder="e.g. +1d4"/>
</div>
<div class="form-group stacked">
<label class="block-header">{{localize "D35E.STDialogModifiers"}}</label>
Expand Down Expand Up @@ -29,14 +29,26 @@
</div>
{{/each}}


<div class="form-group">
<label>{{localize "D35E.RollMode"}}</label>
<select name="rollMode">
<label>{{localize "D35E.RollMode"}} <i class="fas fa-history tooltip" style="color: lightgray;"><span class="tooltipcontent">{{localize "D35E.ValuePersisted"}}</span></i></label>
<select name="rollMode" class="auto-save">
{{#select rollMode}}
{{#each rollModes as |label mode|}}
<option value="{{mode}}">{{localize label}}</option>
{{/each}}
{{/select}}
</select>
</div>
<script>
if (game.settings.get("D35E", "saveAttackWindow")) {
$('.auto-save').savy('load',function(){
console.log("All fields from save are loaded");
$('.attack-form input').trigger('change')
},'{{id}}');
}
else {
$('.fa-history').hide()
}
</script>
</form>

0 comments on commit f8d4476

Please sign in to comment.