BibliothecaDAO / realms-contracts

Realms Monorepo for Ethereum contracts and Starknet contracts.
https://bibliothecadao.xyz/
MIT License
86 stars 33 forks source link

Apply elemental bonus to raw attack HP #369

Closed loothero closed 1 year ago

loothero commented 1 year ago

Currently the elemental bonus is applied to the difference between attack HP and defense HP. In the case where an adventurer is attacking a higher level beast, defense HP will be greater than attack HP, which results in the current code using the minimum damage of 3

The 3 is then used for the elemental bonus resulting in effectively no difference between effective and ineffective attacks.

To prevent elemental from being useless in this common situation, we should apply the elemental bonus to the raw attack HP (6 - item_tier) * greatness and then add it to the net damage (attack HP - defense HP). In the case where defense HP > attack HP, this would preserve the value of elemental bonus