The first iteration of the game had a basic weapon-firing system. Each weapon had a specific amount of damage it could cause an enemy.
As in:
enemy_hp -= wpn_damage
But having played a lot of interesting games over the years, I decided that I would instead implement something I found more interesting
I have introduced damage range, different weapon type,s and critical damage
So the update to the formula becomes
var net_damage = wpn1_damage + wpn2_damage + wpn3_damage
if randf_range(0,1) <= critcal_chance:
enemy_hp -= net_damage + critical_damage
else:
enemy_hp -= net_damage
The explanation:
The first iteration of the game had weapons that each maintained their weapon count.
But I have since implemented ammo types that different weapons share.
Each weapon has a value for how much ammo it consumes from specific ammo types and how much damage it causes from each specific ammo type.
so if a weapon happens to use more than one ammo type, then it inflicts two types of damage on the enemy. So it stacks.
Hope that part made sense.
With damage range, a weapon can inflict damage based on the ammo type. But that damage is a range between a min and max value that is randomly calculated every single time a shot is fired.
Then lastly is the critical damage and critical chance. when every shot lands on an enemy, the chance for the weapon fired to inflict critical damage is calculated. If it passes, then a critical damage amount is calculated by adding a percentage of the net_damage to the net_damage. Kinda like how Value Added Tax works :P
So.... why all of this
This will help me solve two problems. The first is that I can create a much wider variety of perks and upgrades based on just weapons alone.
Second is that it allows me to "leave no weapon behind". Because upgrades and perks can make weak level 1 weapons (or starting-out weapons) better suited for the late game as well. And with the other weapons stats like rate-of-fire, accuracy, ammo_consumption, and so on... I can implement a tighter risk-reward scheme with the more powerful late-game weapons.
Lastly. Something that is related. Player and enemies now have a defense percentage value for each weapon ammo type. So some enemies will be weak or strong against certain weapons.
I like brutally tough games. Expect one shots (from both players and enemies). 🤣🤣🤣
I want to work a bit more on the enemy and their drops before moving on to room clearing mechanics.
0 comments