Skip to content

Commit 4f7065a

Browse files
committed
GameEngine v1.6: Fix stance survival factor bug
- Apply stance survival factor in isLethalDamage function - Defensive stance now provides 25% better survival chance - Offensive stance now has 25% worse survival chance - Fixes tactical balance where stance choice affects lethality
1 parent dee79a3 commit 4f7065a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/game/engine/GameEngine.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ contract GameEngine is IGameEngine {
1616
error InvalidResults();
1717
error InvalidEquipment();
1818

19-
uint16 public constant version = 261; // v1.5: Unified armor stamina system
19+
uint16 public constant version = 262; // v1.6: Fixed stance survival factor bug
2020

2121
struct CalculatedStats {
2222
uint16 maxHealth;
@@ -2058,7 +2058,7 @@ contract GameEngine is IGameEngine {
20582058
uint16 defenderMaxHealth,
20592059
CalculatedStats memory defenderStats,
20602060
WeaponStats memory weapon,
2061-
StanceMultiplier memory, /* defenderStance */
2061+
StanceMultiplier memory defenderStance,
20622062
uint256 seed,
20632063
uint16 lethalityFactor
20642064
) private pure returns (bool died) {
@@ -2086,6 +2086,9 @@ contract GameEngine is IGameEngine {
20862086
// Apply weapon survival factor safely
20872087
survivalChance = (survivalChance * uint256(weapon.survivalFactor)) / 100;
20882088

2089+
// Apply stance survival factor safely
2090+
survivalChance = (survivalChance * uint256(defenderStance.survivalFactor)) / 100;
2091+
20892092
// Cap between min and max
20902093
if (survivalChance < MINIMUM_SURVIVAL_CHANCE) {
20912094
survivalChance = MINIMUM_SURVIVAL_CHANCE;

0 commit comments

Comments
 (0)