Module: Fools::Sheet

Defined in:
lib/fools/sheet/alter.rb,
lib/fools/sheet/schema.rb,
lib/fools/sheet/semantics.rb

Defined Under Namespace

Classes: Semantics

Class Method Summary collapse

Class Method Details

.alter(sheet, attr, by) ⇒ Object

Safely alter an attribute in a character sheet

This is safe as long as the stat’s minimum value is -10, and maximum is 10 (see Sheet::Semantics)



25
26
27
28
29
30
31
# File 'lib/fools/sheet/alter.rb', line 25

def Sheet::alter sheet, attr, by
   curr = sheet[attr]
   result = curr + by
   if result >= -10 and result <= 10
      sheet[attr] = result
   end
end

.schemaObject

Character sheet schema for The Fools



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
54
55
# File 'lib/fools/sheet/schema.rb', line 27

def Sheet::schema
   CARPS::Sheet::Schema.new YAML.load <<-END
Name: Text
Biography: Optional Text
Character Points: Integer
The Readies: Integer
The Old Grey Matter: Integer
The Outer Crust: Integer
Vim & Vigour: Integer
Luck: Integer
Chances: Integer
Romantic Resistance: Integer
Tolerance for Alcohol: Integer
Conscience: Integer
Etiquette: Integer
Pounds: Integer
Shillings: Integer
Pence: Integer
Intoxication: Integer
Discomfiture: Integer
Student of the Turf: Boolean
Gentleman's Gentleman: Optional Choice Good Superior
Sports Car: Optional Choice Basic Flashy
Specialist Interest: Optional Text
Connections: Optional Text
Difficult Relation: Optional Text
Good Sportsman: Optional Text
END
end