Created
May 4, 2015 17:00
-
-
Save intinig/4bb28cc7a7d3c9e99435 to your computer and use it in GitHub Desktop.
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
BLOW = 0 | |
ROLL = 1 | |
PARRY = 2 | |
HAND = 3 | |
KI = 4 | |
class Die | |
def self.faces | |
[[],[],[],[],[],[]] | |
end | |
def self.roll | |
faces.sample | |
end | |
end | |
class Giovanni < Die | |
def self.faces | |
[ | |
[BLOW], | |
[BLOW], | |
[BLOW], | |
[BLOW], | |
[BLOW], | |
[BLOW] | |
] | |
end | |
end | |
class GreenDie < Die | |
def self.faces | |
[ | |
[BLOW, BLOW], | |
[BLOW, BLOW, ROLL], | |
[ROLL], | |
[ROLL], | |
[ROLL, PARRY], | |
[HAND] | |
] | |
end | |
end | |
class GreyDie < Die | |
def self.faces | |
[ | |
[BLOW], | |
[BLOW], | |
[BLOW, HAND], | |
[PARRY, HAND], | |
[HAND, HAND, PARRY], | |
[HAND, HAND] | |
] | |
end | |
end | |
class BlueDie < Die | |
def self.faces | |
[ | |
[BLOW], | |
[BLOW, PARRY], | |
[PARRY], | |
[PARRY, PARRY], | |
[PARRY, PARRY], | |
[ROLL] | |
] | |
end | |
end | |
class RedDie < Die | |
def self.faces | |
[ | |
[BLOW], | |
[BLOW], | |
[BLOW], | |
[BLOW], | |
[HAND, PARRY], | |
[HAND, ROLL] | |
] | |
end | |
end | |
DICE = [GreenDie, GreyDie, BlueDie, RedDie, Giovanni] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment