Module: Fools::Dice
- Includes:
- CARPS::Dice
- Included in:
- Rules::Combat, Rules::Drink, Rules::Resist, Rules::Sense
- Defined in:
- lib/fools/rules/drink/dice.rb,
lib/fools/rules/combat/dice.rb,
lib/fools/rules/romance/dice.rb
Overview
Fools dice
Instance Method Summary collapse
-
#combat(avim, awep, dvim) ⇒ Object
Engage in combat.
-
#drink(vim, resistance, quantity, target) ⇒ Object
How drunk will you get?.
-
#resist_romance(resistance, crust) ⇒ Object
Resist romance.
-
#talk_sense(resistance, crust, matter) ⇒ Object
Talk sense.
Instance Method Details
#combat(avim, awep, dvim) ⇒ Object
Engage in combat
The first parameter is the attacker’s vim The second is the weapon used The third is the defender’s vim
29 30 31 32 33 34 35 36 37 |
# File 'lib/fools/rules/combat/dice.rb', line 29 def combat avim, awep, dvim at = d 10 de = d 10 at + avim de + dvim at - de at * awep at end |
#drink(vim, resistance, quantity, target) ⇒ Object
How drunk will you get?
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fools/rules/drink/dice.rb', line 26 def drink vim, resistance, quantity, target quantity += resistance roll = d 10 roll + (vim + resistance) roll - target # Inspect result of roll and determine course of action roll.is :<=, -7, quantity - 3 roll.in_range -6..-4, quantity - 2 roll.in_range -3..-1, quantity - 1 roll.in_range 1..3, quantity + 1 roll.in_range 4..6, quantity + 2 roll.is :>=, 7, quantity + 3 roll end |
#resist_romance(resistance, crust) ⇒ Object
Resist romance
resistance is the Romantic Resistance of the ‘victim’.
crust is The Outer Crust of the possible object of love
Positive on success, negative on failure. Magnitude is meaningful.
32 33 34 35 36 |
# File 'lib/fools/rules/romance/dice.rb', line 32 def resist_romance resistance, crust resisted = d 10 resisted + (resistance - crust) resisted end |
#talk_sense(resistance, crust, matter) ⇒ Object
Talk sense
Can you talk someone out of their love?
resistance is the Romantic Resistance of the ‘victim’.
crust is The Outer Crust of the object of love
matter is The Old Grey Matter of the lovestruck drone’s sensible friend
Positive on success, negative on failure. Magnitude is meaningful.
50 51 52 53 54 55 56 57 58 |
# File 'lib/fools/rules/romance/dice.rb', line 50 def talk_sense resistance, crust, matter convince = d 10 convince + matter # Resist the advice... resist = d 10 resist + (crust - resistance) convince - resist convince end |