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.
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:
Configurable items in dedicated_server.txt are:
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.