Created
June 5, 2020 00:48
-
-
Save J-Moravec/a52beb76db671eb9e763f86bfe77a5c8 to your computer and use it in GitHub Desktop.
Effect of reinvigoration on number of spell cast in battle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
turn_of_casting = function(spell_fatigue, reinvigoration, turn_max=100){ | |
tcast = c() | |
fatigue = 0 | |
for(turn in seq_len(turn_max)){ | |
if(fatigue < 100){ | |
# cast spell | |
fatigue = fatigue + spell_fatigue | |
tcast = c(tcast, turn) | |
} else { | |
# nap | |
fatigue = fatigue - 5 | |
} | |
# reinvigoration always applies | |
fatigue = fatigue - reinvigoration | |
} | |
tcast | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment