-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsw_test.rb
55 lines (44 loc) · 988 Bytes
/
sw_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require "savageworlds"
require "savageworlds_core_weapons"
include SavageWorlds
ch = Character.new("Geoffryn", true,
{
:strength => :d6,
:agility => :d6,
:smarts => :d4,
:spirit => :d8,
:vigor => :d10
},
{
:fighting => :d8,
:survival => :d6,
:shooting => :d6
},
{
:edges => ["Toughness"],
:hindrances => ["Loyal"]
}
)
ch.add_edge("Battle Bunny")
ch.add_edge("Unmoveable")
ch.add_hindrance("Brain Damage")
puts ch
tr = ch.trait_roll(:strength)
puts "Strength Check for #{ch.name}:"
puts "%-10s: %s" % [ch.strength, tr.trait.total]
puts "%-10s: %s" % ["Wild Die", tr.wild_die.total]
puts ""
puts "Parry: #{ch.parry}"
puts "Toughness: #{ch.toughness}"
sword = MeleeWeapons[:long_sword]
bow = RangeWeapons[:bow]
puts ""
puts sword
puts ""
dmg = sword.roll_damage(ch.get_trait(:strength)).total
puts "%s: %s" % ["Damage Roll", dmg]
puts ""
puts bow
puts ""
dmg = bow.roll_damage.total
puts "%s: %s" % ["Damage Roll", dmg]