This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
damage_logic [2025/04/22 13:43] – justin | damage_logic [2025/04/22 13:45] (current) – justin | ||
---|---|---|---|
Line 3: | Line 3: | ||
In RPG in a Box, any time one [[character]] attacks another, a calculation is done to determine how much damage is done to the [[character]] being attacked. If you'd like to customize this logic for your game, you can do so by creating a [[script]] named " | In RPG in a Box, any time one [[character]] attacks another, a calculation is done to determine how much damage is done to the [[character]] being attacked. If you'd like to customize this logic for your game, you can do so by creating a [[script]] named " | ||
- | Below is the Bauxite code for the default damage logic. You can take this and customize it as desired | + | Below is the Bauxite code for the default damage logic. You can take this and customize it as desired, or create your own logic from scratch! The only requirement is that the [[script]] returns a [[number|numeric value]]. |
<code bauxite> | <code bauxite> | ||
$diff = $attacker.stat[" | $diff = $attacker.stat[" |