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 critical hits to multiplayer #283

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

GooberRF
Copy link
Contributor

@GooberRF GooberRF commented Oct 8, 2024

This PR adds critical hits to Dash servers optionally (default is off). This logic is inspired by Team Fortress 2, though it works a little differently. I wrote this feature in order to add a fun twist to the gameplay in the FactionFiles DM pub and it's generally been well received, so I thought I might as well PR it over so other server operators can try it out too if they wish.

Here's an explanation of the logic with default values:

  • When you deal damage to an opponent, you have a 10% chance of it being a critical hit.
  • Critical hits deal 4x damage AND grant you a damage amp for 1.5 seconds.
  • Your chance of getting a critical hit goes up based on the amount of damage you've dealt since your last death. The bonus chance is +10% if you've dealt at least 1200 damage since your last death, which boosts your chance of a critical hit to 20%.
  • When you've dealt 0 - 1200 damage since your last death, the bonus scales based on that standard. For example, if you've dealt 600 damage, your chance of a critical hit is 15%. If you've dealt 300, it's 12.5%, etc.

Configurable items in dedicated_server.txt are:

    // Enable critical hits
    $DF Critical Hits: false
        // Sound used for hit notification
        +Sound ID: 35
        // Max sound packets per second - keep it low to save bandwidth
        +Rate Limit: 10
        // Duration of damage amp reward on a critical hit
        +Reward Duration: 1500
        // Percentage chance of a critical hit
        +Base Chance Percent: 0.1
        // Enable dynamic chance bonus based on damage dealt in current life
        +Use Dynamic Chance Bonus: true
        // Amount of damage to deal in current life for the max dynamic chance bonus (+ 0.1)
        +Dynamic Chance Damage Ceiling: 1200

Note: This PR does use the same RNG code as #271, but it is identical, so there should be no conflict in merging both of them.

@GooberRF GooberRF changed the title Add critical hit to multiplayer Add critical hits to multiplayer Oct 8, 2024
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.

1 participant