Skip to content

Commit 9de3733

Browse files
committed
Update to fix Defences in V10 where advanced math also adds on attribute modifiers
1 parent 25c7d2d commit 9de3733

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

CreatureExport/FoundryCreatureHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ Library Source
5151

5252
var halfLevel = inputCard.Level / 2;
5353

54-
result.defences.ac.value = inputCard.AC - halfLevel;
55-
result.defences.fort.value = inputCard.Fortitude - halfLevel;
56-
result.defences.refValue.value = inputCard.Reflex - halfLevel;
57-
result.defences.wil.value = inputCard.Will - halfLevel;
54+
result.defences.ac.value = inputCard.AC - halfLevel - Math.Max(input.Dexterity.Modifier, input.Intelligence.Modifier);
55+
result.defences.fort.value = inputCard.Fortitude - halfLevel - Math.Max(input.Strength.Modifier, input.Constitution.Modifier);
56+
result.defences.refValue.value = inputCard.Reflex - halfLevel - Math.Max(input.Dexterity.Modifier, input.Intelligence.Modifier);
57+
result.defences.wil.value = inputCard.Will - halfLevel - Math.Max(input.Wisdom.Modifier, input.Charisma.Modifier);
5858

5959
var details = result.details;
6060
details.bloodied = input.HP / 2;

CreatureExport/FoundryHelpers/FoundryPowerHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ private static Dictionary<string, string> BuildEffectLookup()
9696
return dict;
9797
}
9898

99+
private static readonly Random rnd = new Random();
99100
public static string newId(int length = 16) {
100101
StringBuilder builder = new StringBuilder();
101-
Random rnd = new Random();
102102
for (int i = 0; i < length; i++)
103103
{
104104
builder.Append(validIdChars[rnd.Next(validIdChars.Length)]);

0 commit comments

Comments
 (0)