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

Add chat damage breakdown, absorb hp/mp actions #212

Merged
merged 20 commits into from
Feb 2, 2025

Conversation

Azurelol
Copy link
Collaborator

@Azurelol Azurelol commented Jan 30, 2025

  • 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

image

@Azurelol Azurelol marked this pull request as ready for review January 31, 2025 18:04
@Azurelol Azurelol marked this pull request as draft January 31, 2025 18:50
@Azurelol Azurelol force-pushed the add/chat_damage_breakdown branch from acb2840 to d71f0a2 Compare January 31, 2025 19:53
@Azurelol Azurelol marked this pull request as ready for review January 31, 2025 19:53
@Element-Re
Copy link

As requested, here's the latest css styles shown in the following example:
image

Note that this currently expects a container element with the .project-fu class, and especially that is uses style variables from pfu-theme -- these would probably need to be updated for general system use.

.project-fu table {
	
	border-top: 1px solid var(--pfu-color-app-control-border);
	border-bottom: 1px solid var(--pfu-color-app-control-border);

	
	& thead {
		background: var(--pfu-color-app-control-fill);
		color: var(--pfu-color-app-control-content);
		border-bottom: 1px solid var(--pfu-color-app-control-border);
	}
	& caption {
		caption-side: top;
		font-weight: bold;
		color: inherit;
	}
	
	& th:first-child {
		text-align: right;
	}
	
	& th, td {
		text-align: left;
	}

}

@Azurelol Azurelol requested a review from Shourn February 1, 2025 10:28
@Azurelol Azurelol linked an issue Feb 1, 2025 that may be closed by this pull request
*/
recordStep(step, effect, total) {
this.breakdown.push({
step: InlineHelper.nicifyString(step),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use localization.

Copy link
Collaborator Author

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.

@@ -164,11 +185,22 @@ function capitalize(word) {
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
}

function nicifyString(str) {
Copy link
Collaborator

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

Copy link
Collaborator Author

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`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use localization.

<section id="breakdown" class="hidden">
<div class='projectfu'>
<table>
<caption>Breakdown</caption>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires localization

<caption>Breakdown</caption>
<thead>
<tr>
<th>Step</th>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires localization

<thead>
<tr>
<th>Step</th>
<th>Effect</th>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires localization

<tr>
<th>Step</th>
<th>Effect</th>
<th>Total</th>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires localization

@Azurelol Azurelol requested a review from Shourn February 1, 2025 15:54
Azurelol and others added 4 commits February 2, 2025 11:50
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
@Azurelol Azurelol merged commit 4bbaf01 into dev Feb 2, 2025
@Azurelol Azurelol deleted the add/chat_damage_breakdown branch February 2, 2025 11:33
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.

Values calculated in stepByLevel/&step()
3 participants