-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add chat damage breakdown, absorb hp/mp actions #212
Conversation
Azurelol
commented
Jan 30, 2025
•
edited
Loading
edited
- Overhauls the damage breakdown on chat to be toggled on a click of the info button
- Adds 2 actions for absorbing half of damage dealt as HP or MP as context menu options
- Adds a helper for registering context menu items
- Add revert for resource gain chat messages
…th/mind leech on damage taken.
acb2840
to
d71f0a2
Compare
module/pipelines/damage-pipeline.mjs
Outdated
*/ | ||
recordStep(step, effect, total) { | ||
this.breakdown.push({ | ||
step: InlineHelper.nicifyString(step), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use localization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the other message, I would like to handle localization for this in the near future.
module/helpers/inline-helper.mjs
Outdated
@@ -164,11 +185,22 @@ function capitalize(word) { | |||
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); | |||
} | |||
|
|||
function nicifyString(str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using proper localization makes this obsolete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to consider how to localize the different data model properties at another time.
const attributeKey = dataset.key; | ||
const updates = []; | ||
updates.push(actor.modifyTokenAttribute(attributeKey, -amount, true)); | ||
actor.showFloatyText(`${amount} ${dataset.resource.toUpperCase()}`, `red`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use localization.
templates/chat/chat-apply-damage.hbs
Outdated
<section id="breakdown" class="hidden"> | ||
<div class='projectfu'> | ||
<table> | ||
<caption>Breakdown</caption> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires localization
templates/chat/chat-apply-damage.hbs
Outdated
<caption>Breakdown</caption> | ||
<thead> | ||
<tr> | ||
<th>Step</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires localization
templates/chat/chat-apply-damage.hbs
Outdated
<thead> | ||
<tr> | ||
<th>Step</th> | ||
<th>Effect</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires localization
templates/chat/chat-apply-damage.hbs
Outdated
<tr> | ||
<th>Step</th> | ||
<th>Effect</th> | ||
<th>Total</th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requires localization
As it does not scale the MP cost but handles multi-targeting
- add localization to calculation steps - remove outgoing damage, its already factored into the initial damage
…add/chat_damage_breakdown