Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
13 stars 5 forks source link

Implement melee skill #215

Closed snipercup closed 4 months ago

snipercup commented 5 months ago

Fixes #196

The suggestions from the issue are implemented. I changed the base hit chance from 25% to 65% since melee was pretty useless at 25% hit chance. We can change it to be lower again when we have feedback mechanics for the player so he knows when he misses. We also need better ways to control the hit chance. Probably something per-weapon, like the to_hit property in CDDA melee weapons.

Hit Chance Calculation: The perform_melee_attack function calculates the hit chance based on the skill level. The player has a 65% hit chance at level 1 and a 100% hit chance at level 100.

Attack Cooldown Timer: The setup_melee_weapon_properties function adjusts the attack_cooldown_timer based on the melee skill level. The cooldown time decreases from 1.5 seconds at level 0 to 0.5 seconds at level 100.

After killing 3 mobs I have this amount of cutting skill: image