Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roll data #177

Merged
merged 11 commits into from
Feb 14, 2022
Merged

Roll data #177

merged 11 commits into from
Feb 14, 2022

Conversation

draconas1
Copy link
Collaborator

This was a rabbit hole I did not expect to fall down, but I did anyway....

It started as Fixes to #172

Updated the getChatData() method of actor.js such that modifiers exist and can be used in effects. This is important, as they are truncated so don't have an awkward 0.5 when the ability score is an odd number.

2 parts to this:

  1. a small refactor to prepareData() to move the calculations of derived data for abilities into their own method. More things might join them in future.
  2. getChatData() references the new method to calculate the ability modifers.
  3. getChatData() and helper.commonReplace have gained several new variables based on tier, that return 1 when matched and 0 when not. @heroic, @paragon, @Epic all return only in their respective tier and @heroicOrParagon and @paragonOrEpic return when either of their 2 tiers match. That should work for all crazy power enhancement maths.

Went through and fixed the example classes and races following this change:

  • All classes now use @Conmod for their surge bonus, no more half a surge for characters with con 15! Stupid javascript type system.
  • All classes now set their HP formula to override, because HP auto-calc fields are saved in the actor and the effects directly edit them, having effects that add to them is hilarious and bumps them every time you view that screen and triggered a save.
  • It should be noted this is still a risk with hp-auto calc and the bonus field.
  • Dragonborn racial fixed to modify surge value, not number of surges. Closes Dragonborn Racial applies wrong effect #166
  • Elves kneecapped. Previously Elves added 7 to their speed and so went zipping along at speed 13. Set to override.
  • Human racial flange of +1 to all defences added to their racial package. I know humans suck, but not giving them their racial defence bonus was really mean. Think of all the poor humans who have died for the lack of +1 ref!

Updated Basic Melee and Ranged attacks to use a base damage formula of 1 + @Epic so their damage scales automatically
Poked the @powmax variable in formula helper so it will handle formula in the power base damage multiplier the same as @powbase does.
Fixed an issue in highlighted rolls because foundry modifies the formula of dice rolls (a few spaces appear and dissappear)

Resurrected @wepDice() to use with high crit weapons
All SRD high crit weapons have their bonus crit damage put in the bonus crit damage formula and done as @wepDice(@tier) so it just gives them the right number based on their base damage and tier.

when I entered SRD weapons I somehow missed the 2 handed property. 2 handed wepaons now correctly have the 2H weapon property set so work with the example fighter weapon talent.

EndlesNights and others added 11 commits February 12, 2022 13:33
Steve has gained an implement and an AoE fire power that uses the implement.

An example ritual and an example NPC (Badgers are not in 4E as creatures, so do not have to worry about OGL issues) (Ritual costs are tricky to grab as the attribute dropdown gets cleared as soon as it's off a character)

Feat that adds to fire attack and damage powers (to show on steves new fire power).

Updated fighter weapon talents to have an effect to boost that attack. This can be done automatically for 2 Handed Weapons, alas 1 handed weapons need a custom variable, but at least we get a custom variable demo!
When adding equipment to token action HUD integration I was reminded that in order to get it working I had to poke some quite internal and knarly methods in 4E.

Basically things that we would change, that would then break token hud, and we would have no idea why.

So I refactored them all into the hooks.js object, which gives Token HUD a single place for when it needs to call any method on one of our objects.  Especially as a lot of them the logic is actually in the sheet.  This means they will at least show up in a usages search in VSCode/Webstorm etc... so we know if we change them to also update the calling method.

Method signatures were made to be as standardised as possible with all relevant information, so hopefully if we ever change an implementation there is no need to change api.
Actor ChatData for Effects
SRD Compendium fixes
Example Compendium fixes
I feel down a formula hole and couldn't get out
Actor ChatData for Effects
SRD Compendium fixes
Example Compendium fixes
I feel down a formula hole and couldn't get out
@EndlesNights EndlesNights changed the base branch from main to dev February 14, 2022 22:06
@EndlesNights
Copy link
Owner

EndlesNights commented Feb 14, 2022

I wonder what those folks whos gitHub user IDs happen to align with our @Calls must think when they see these pings.
Anyway super useful stuff. 👍

@EndlesNights EndlesNights merged commit 882fd57 into EndlesNights:dev Feb 14, 2022
@draconas1
Copy link
Collaborator Author

draconas1 commented Feb 14, 2022 via email

@draconas1 draconas1 deleted the rollData branch February 18, 2022 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dragonborn Racial applies wrong effect
2 participants