Skip to content

Add random dangerosity level#22

Merged
ptitmorceaux merged 2 commits intomainfrom
addRandomDangerosityLevel
Nov 13, 2025
Merged

Add random dangerosity level#22
ptitmorceaux merged 2 commits intomainfrom
addRandomDangerosityLevel

Conversation

@ptitmorceaux
Copy link
Owner

This pull request introduces a new mechanism for determining the dangerosity level of monster encounters and updates the configuration of creature groups to better reflect different dangerosity levels. The main changes include the addition of a function to randomly select dangerosity levels for encounters, updates to how dangerosity is set in the game logic, and improvements to the configuration file for creature groups.

Gameplay logic improvements:

  • Added a new function getRandomDangerosityLevel() that selects a dangerosity level based on weighted probabilities (1: 40%, 2: 30%, 3: 20%, 4: 10%) (creatures.c, creatures.h). [1] [2]
  • Updated the monster zone logic to use getRandomDangerosityLevel() instead of a fixed value, making encounters more dynamic (jeu.c).
  • Clarified that boss zones always use dangerosity level 5 in the code (jeu.c).

Configuration updates:

  • Revised groupes.conf to uncomment and adjust groups for dangerosity levels 1, 4, and 5, providing more accurate and varied group definitions for each level (groupes.conf). [1] [2]

@ptitmorceaux ptitmorceaux merged commit d9faf25 into main Nov 13, 2025
5 checks passed
@ptitmorceaux ptitmorceaux deleted the addRandomDangerosityLevel branch November 13, 2025 20:39
ptitmorceaux added a commit that referenced this pull request Nov 22, 2025
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.

1 participant