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

Implement Some Energy-related Stuff #1029

Merged
10 commits merged into from
May 22, 2022
Merged

Implement Some Energy-related Stuff #1029

10 commits merged into from
May 22, 2022

Conversation

GanyusLeftHorn
Copy link
Contributor

Description

This PR implements and fixes some energy-related things. In particular:

  • Energy particles created by elemental skills now are of the correct elemental type (were elementless before).
  • Picking up energy particles or orbs now gives the correct amount of energy depending on character element, and also now honors the character's energy recharge stat.
  • Using an elemental burst now depletes energy. Since by far not all energy-related features are implemented yet, this is configurable via a new server.game.game.gameOptions.energyUsage settings in config.json, which default to false, preserving the current behavior of bursts always being full as the default.
  • Fixes the traveller not being able to gain energy (issue Main characters elemental bursts doesn't work. #994).

Known issues and energy stuff that is still missing (not necessarily an exhaustive list):

  • Some character skills don't generate the correct amount of particles. As far as I can tell, this is caused by ClientAbilityInitFinishNotify not having the correct number of ABILITY_ACTION_GENERATE_ELEM_BALL entries. I don't know yet what is causing this to be the case for some, but not all, skills.
  • Some energy generation by weapon passives, like that of the Favonius weapons, does not work correctly.
  • We don't generate energy for NAs/CAs yet.
  • Enemies don't drop energy particles/orbs yet.

Issues fixed by this PR

#994

Type of changes

  • Bug fix
  • New feature
  • Enhancement
  • Documentation

Checklist:

  • My code follows the style guidelines of this project
  • My pull request is unique and no other pull requests have been opened for these changes
  • I have read the Contributing note and Code of conduct
  • I am responsible for any copyright issues with my code if it occurs in the future.

// Try to fetch the avatar from the player's party and determine their element.
// ToDo: Does this work in co-op?
int avatarId = getCastingAvatarIdForElemBall(invoke.getEntityId());
Optional<EntityAvatar> avatarEntity = player.getTeamManager().getActiveTeam()
Copy link

Choose a reason for hiding this comment

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

It is reccomended to use TeamManager::getCurrentAvatarEntity()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that only gives me the currently active avatar, doesn't it? The character generating the particle doesn't have to be active (think for example Zhongli's pillar generating a particle while he is off field).

@ghost ghost merged commit 4cd6b79 into Grasscutters:development May 22, 2022
@GanyusLeftHorn GanyusLeftHorn deleted the energy branch May 27, 2022 14:42
This pull request was closed.
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.

None yet

1 participant