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

Fix Chasca bugs in A4 and C2 #2581

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Fix Chasca bugs in A4 and C2 #2581

merged 1 commit into from
Dec 17, 2024

Conversation

nguyentvan7
Copy link
Collaborator

@nguyentvan7 nguyentvan7 commented Dec 17, 2024

Describe your changes

  • Fix Chasca A4 not using proper multiplier
  • Fix Chasca C2 not increasing A1 dmg bonus

Issue or discord link

Testing/validation

image

image
image

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

  • I have commented my code in hard-to understand areas.
  • I have made corresponding changes to README or wiki.
  • For front-end changes, I have updated the corresponding English translations.
  • I have run yarn run mini-ci locally to validate format and lint.
  • If I have added a new library or app, I have updated the deployment scripts to ignore changes as needed

Summary by CodeRabbit

  • New Features

    • Enhanced damage calculations for the character Chasca, including updated formulas for skills and passives.
    • Implemented new conditions for determining maximum values related to character abilities.
  • Bug Fixes

    • Corrected logic for damage output calculations, ensuring accurate representation of character abilities.

@nguyentvan7 nguyentvan7 requested a review from frzyc December 17, 2024 22:57
Copy link

coderabbitai bot commented Dec 17, 2024

Walkthrough

The pull request modifies the Chasca character implementation in the Genshin Optimizer project. The changes primarily focus on refining damage calculation logic by adjusting how phecElements are computed and updating the dmgFormulas object. The modifications include switching from a sum to a min function for element calculations and adding a percentage modifier for the shiningShellDmg passive damage calculation.

Changes

File Change Summary
libs/gi/sheets/src/Characters/Chasca/index.tsx - Replaced sum with min for phecElements calculation
- Added constellation-level condition to phecElements
- Updated dmgFormulas.passive2 with percentage modifier for shiningShellDmg

Possibly related PRs

Poem

🐰 In Genshin's realm of elemental might,
Chasca's numbers now shine so bright!
Min and max, a delicate dance,
Damage formulas get their chance
To sparkle with computational glee! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66413c0 and 7321876.

📒 Files selected for processing (1)
  • libs/gi/sheets/src/Characters/Chasca/index.tsx (3 hunks)
🔇 Additional comments (4)
libs/gi/sheets/src/Characters/Chasca/index.tsx (4)

9-9: LGTM: Import addition is necessary for the new implementation

The addition of the min import is required for the updated phecElements calculation.


102-107: LGTM: Improved phecElements calculation with proper capping

The changes correctly implement a maximum cap of 3 elements while properly accounting for:

  • Element absorption checks
  • Constellation 2 bonus
  • Maximum limit enforcement

This fixes the A4 ability bug by preventing element stacks from exceeding the game's intended limit.


216-216: LGTM: Fixed C2 ability interaction with damage bonus

The addition of percent(dm.passive2.dmg) correctly implements the damage multiplier, fixing the C2 ability's interaction with the A1 damage bonus.


102-107: Verify the impact of these changes

Please ensure:

  1. The phecElements capping doesn't break any other character abilities or constellations
  2. The damage calculations match the expected values from the game

Let's check for any other references to phecElements or similar damage calculations:

Also applies to: 216-216

✅ Verification successful

The first search will show us how phecElements is used in the damage calculations. The second search will provide context on how similar mechanics are implemented in other characters. The third search will help identify any cross-character dependencies.


Changes are safe to implement

The verification shows that:

  1. phecElements is self-contained within Chasca's implementation and not referenced by other characters
  2. The capping mechanism (using min) is consistent with similar element-counting patterns seen in other characters like YunJin and Nilou
  3. The damage calculation follows established patterns, where each character has their own isolated implementation
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar element counting patterns in other character implementations
rg -l "greaterEq.*tally" "libs/gi/sheets/src/Characters/"

# Search for similar damage calculation patterns
rg -l "percent.*passive2\.dmg" "libs/gi/sheets/src/Characters/"

Length of output: 878


Script:

#!/bin/bash
# Let's examine the specific implementation in Chasca's file
rg -A 10 "phecElements" "libs/gi/sheets/src/Characters/Chasca/index.tsx"

# Check how other characters use greaterEq with tally for context
rg -A 5 "greaterEq.*tally" "libs/gi/sheets/src/Characters/Yelan/index.tsx" "libs/gi/sheets/src/Characters/YunJin/index.tsx" "libs/gi/sheets/src/Characters/Nilou/index.tsx"

# Look for any direct references to Chasca's mechanics in other files
rg "Chasca" "libs/gi/sheets/src/"

Length of output: 2734


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Dec 17, 2024

[frontend] [Tue Dec 17 23:01:52 UTC 2024] - Deployed 1db8cda to https://genshin-optimizer-prs.github.io/pr/2581/frontend (Takes 3-5 minutes after this completes to be available)

[Tue Dec 17 23:52:23 UTC 2024] - Deleted deployment

@nguyentvan7 nguyentvan7 merged commit 6d74cb6 into master Dec 17, 2024
9 checks passed
@nguyentvan7 nguyentvan7 deleted the van/go/chascaFix branch December 17, 2024 23:51
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.

2 participants