Evenening ladies and gentleman,
I have encountered some bemusing issues when trying to create a combat system for my own choice game that being 2 things:
- Damage can be avoided through a block function. Currently the code goes “*set damage - block” So the amount of damage taken is reduced based on the blocking value. Problem: When the block role is higher than the damage role it creates a negative damage number and the palyer ends up GAINING extra HP. I more or less accidently created a regenaration function it seems. While this hasnt caused severe issues in testing it can result into fights never ending if both the player and the opponent fight defensefly.
- The Second point was discovered due to issue number one: The Player can heal past his max HP. Meaning you can literally have more HP than what the max was supposed to be through blocking.
Since this is my very first project im very inexperienced in coding.
However since its a medieval action adventure (cause im very creative like that) I view some form of combat as neccesary to keep things intresting so im refusing to abondan the idea entirely.
I am however open to suggestion of alternative systems.
*if wounded = "False"
*set HP max_HP
*if wounded = "Wounded"
*set HP max_HP /2
*label your_turn
*if opponent_HP <1
*set fight "won"
*return
*if HP <1
*set fight "lost"
*return
${opponent}
*line_break
${opponent_HP} / ${opponent_maxHP}
${name}
*line_break
${HP} /${max_HP}
*choice
#Defensive
*rand damage 1 3
*set damage + Strength
*set opponent_hp - damage
*rand block 5 8
*set block + Dexterity
You Strike ${opponent} dealing ${damage} points worth of damage
*goto opponents_turn
#Neutral
*rand damage 3 6
*set damage + Strength
*set opponent_hp - damage
*rand block 3 6
*set block + Dexterity
You Strike ${opponent} dealing ${damage} points worth of damage
*goto opponents_turn
#Offensive
*rand damage 5 8
*set damage + Strength
*set opponent_hp - damage
*rand block 1 3
*set block + Dexterity
You Strike ${opponent} dealing ${damage} points worth of damage
*goto opponents_turn
*label opponents_turn
*rand damage 1 8
*set damage + opponent_Strength
*set damage - block
*set HP - damage
${opponent} strikes you, dealing ${damage} points worth of damage
*goto your_turn
