-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for godbound damage chart
This commit adds support for rolling damage against godbounds damage chart. Thanks to csheepy for putting the legwork in here before the slash command update
- Loading branch information
1 parent
8663c80
commit 64101e7
Showing
6 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
# godbound roll logic | ||
|
||
def godbound_damage_total(results) | ||
results.reduce(0) do |sum, n| | ||
sum + godbound_damage_conversion(n) | ||
end | ||
end | ||
|
||
def godbound_damage_conversion(raw_number) | ||
case [raw_number, 10].min | ||
when 10 | ||
4 | ||
when 6..9 | ||
2 | ||
when 2..5 | ||
1 | ||
when 1 | ||
0 | ||
end | ||
end |