Skip to content

Add race-specific mechanics and combat balance adjustments - #29

Merged
phaax merged 2 commits into
mainfrom
claude/identify-missing-features-1jFLs
Apr 17, 2026
Merged

Add race-specific mechanics and combat balance adjustments#29
phaax merged 2 commits into
mainfrom
claude/identify-missing-features-1jFLs

Conversation

@phaax

@phaax phaax commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

This PR introduces race-specific gameplay mechanics and rebalances combat systems. It adds unique traits for different races (Dwarf, Halfling, Human), implements the Fortitude skill for status effect resistance, adds monster status effect processing, and adjusts shop pricing and inn costs.

Key Changes

Race-Specific Mechanics:

  • Dwarf: Reduced enemy melee damage by 1 and increased healing item effectiveness by 25%
  • Halfling: Reduced melee damage output by 1, and improved shop prices (10% discount on purchases, 10% bonus on sales)
  • Human: Gain +1 to a random stat each level up (adaptability trait)

Combat System Improvements:

  • Added _secondWindUsed flag to combat state for tracking ability usage
  • Implemented monster attack bonus tracking for abilities like battle_cry with duration management
  • Added Fortitude skill that provides 25% chance to resist status effects (poison, trip, corruption)
  • Implemented processMonsterStatus() function to handle poison damage on monsters and status effect expiration
  • Monster poison effects now damage and expire properly during combat

Economy Adjustments:

  • Refactored shop pricing logic for better readability and race-specific discounts
  • Added Healing skill discount to inn rest costs (25% reduction)
  • Improved sell price calculation to properly apply multiple modifiers

Implementation Details

  • Status effect resistance is checked before applying debuffs, with appropriate log messages
  • Monster status effects are filtered and removed when duration expires
  • Race-specific bonuses stack with existing skill bonuses (e.g., Dwarf healing bonus applies after Healing skill multiplier)
  • Human stat growth uses the combat RNG for consistency with other random rolls

https://claude.ai/code/session_01NF9zwaPjgXsPTJaQpZ9Wq2

claude added 2 commits March 31, 2026 20:05
- Fix processMonsterStatus stub: monsters now take poison damage each turn
  with proper turn decay and expiry messages
- Fix battle_cry attack bonus: monster._atkBonus is now applied in monsterAttack()
  and decrements each turn until it expires
- Fix _secondWindUsed flag: now initialized in initCombat so second_wind
  resets correctly between combats
- Add Fortitude statusResist: 25% chance to resist poison/trip/corruption
  when player has the Fortitude skill
- Add Dwarf brew_master trait: potions heal 25% more for Dwarf players
- Add Halfling small_size trait: Halflings deal 1 less melee damage
  (balanced by their existing dodge and lucky reroll bonuses)
- Add Human adaptable trait: +1 to a random stat on each level up
- Add Halfling social trait: 10% buy discount / 5% sell bonus in shops
- Add Healing Arts innHealBonus: inn rest costs 25% less for players
  with the Healing Arts skill

https://claude.ai/code/session_01NF9zwaPjgXsPTJaQpZ9Wq2
- Use combat.rng instead of Math.random() for human adaptable stat
  selection so level-up stat gains are seeded and reproducible
- Make halfling social discount stack multiplicatively with bargaining:
  both bonuses now apply together rather than being mutually exclusive

https://claude.ai/code/session_01NF9zwaPjgXsPTJaQpZ9Wq2
@phaax
phaax merged commit 6f53533 into main Apr 17, 2026
2 checks passed
@phaax
phaax deleted the claude/identify-missing-features-1jFLs branch April 17, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants