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 "Name: Text\nBiography: Optional Text\nCharacter Points: Integer\nThe Readies: Integer\nThe Old Grey Matter: Integer\nThe Outer Crust: Integer\nVim & Vigour: Integer\nLuck: Integer\nChances: Integer\nRomantic Resistance: Integer\nTolerance for Alcohol: Integer\nConscience: Integer\nEtiquette: Integer\nPounds: Integer\nShillings: Integer\nPence: Integer\nIntoxication: Integer\nDiscomfiture: Integer\nStudent of the Turf: Boolean\nGentleman's Gentleman: Optional Choice Good Superior\nSports Car: Optional Choice Basic Flashy\nSpecialist Interest: Optional Text\nConnections: Optional Text\nDifficult Relation: Optional Text\nGood Sportsman: Optional Text\n"
end