fools 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/COPYING +674 -0
- data/History.txt +4 -0
- data/Manifest.txt +65 -0
- data/PostInstall.txt +31 -0
- data/README.rdoc +73 -0
- data/Rakefile +24 -0
- data/bin/carps_fools +27 -0
- data/bin/register_carps_fools +35 -0
- data/features/character_sheet.feature +35 -0
- data/features/dice.feature +28 -0
- data/features/dm_interface.feature +19 -0
- data/features/launch_dm.feature +10 -0
- data/features/launch_player.feature +9 -0
- data/features/player_interface.feature +19 -0
- data/features/rules.feature +66 -0
- data/features/step_definitions/common_steps.rb +168 -0
- data/features/steps/character_sheet.rb +152 -0
- data/features/steps/dice.rb +19 -0
- data/features/steps/dm_interface.rb +21 -0
- data/features/steps/dm_mod.rb +6 -0
- data/features/steps/dm_test_mailer.rb +23 -0
- data/features/steps/general.rb +7 -0
- data/features/steps/interface.rb +10 -0
- data/features/steps/launch_dm.rb +12 -0
- data/features/steps/launch_player.rb +6 -0
- data/features/steps/player_interface.rb +45 -0
- data/features/steps/player_mod.rb +6 -0
- data/features/steps/player_test_mailer.rb +27 -0
- data/features/steps/resource.rb +5 -0
- data/features/steps/rules.rb +144 -0
- data/features/support/common.rb +29 -0
- data/features/support/env.rb +4 -0
- data/features/support/matchers.rb +11 -0
- data/lib/fools/dm/interface.rb +97 -0
- data/lib/fools/dm/launch.rb +40 -0
- data/lib/fools/dm/mod.rb +120 -0
- data/lib/fools/dm.rb +20 -0
- data/lib/fools/interface.rb +32 -0
- data/lib/fools/mod.rb +74 -0
- data/lib/fools/player/interface.rb +66 -0
- data/lib/fools/player/launch.rb +37 -0
- data/lib/fools/player/mod.rb +105 -0
- data/lib/fools/player.rb +20 -0
- data/lib/fools/rules/combat/dice.rb +41 -0
- data/lib/fools/rules/combat/rule.rb +130 -0
- data/lib/fools/rules/drink/dice.rb +43 -0
- data/lib/fools/rules/drink/rule.rb +130 -0
- data/lib/fools/rules/romance/dice.rb +62 -0
- data/lib/fools/rules/romance/rule.rb +143 -0
- data/lib/fools/rules.rb +23 -0
- data/lib/fools/sheet/alter.rb +35 -0
- data/lib/fools/sheet/schema.rb +59 -0
- data/lib/fools/sheet/semantics.rb +129 -0
- data/lib/fools/sheet.rb +20 -0
- data/lib/fools/util/error.rb +28 -0
- data/lib/fools/util.rb +18 -0
- data/lib/fools.rb +33 -0
- data/permission +16 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/tasks/readme_site.rake +28 -0
- data/test/test_fools.rb +11 -0
- data/test/test_helper.rb +3 -0
- data/website/index.html +103 -0
- metadata +213 -0
@@ -0,0 +1,130 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "carps/mod"
|
19
|
+
require "fools/rules/drink/dice"
|
20
|
+
|
21
|
+
require "fools/sheet"
|
22
|
+
|
23
|
+
module Fools
|
24
|
+
|
25
|
+
module Rules
|
26
|
+
|
27
|
+
# A drinking action
|
28
|
+
class DrinkAction < CARPS::Action
|
29
|
+
|
30
|
+
protected
|
31
|
+
|
32
|
+
# Make the person drunk
|
33
|
+
def execute result, sh, *params
|
34
|
+
pending = sh["Intoxication"] + result
|
35
|
+
if pending < -9
|
36
|
+
pending = -9
|
37
|
+
elsif pending > 0
|
38
|
+
pending = 0
|
39
|
+
end
|
40
|
+
sh["Intoxication"] = pending
|
41
|
+
if result < 0
|
42
|
+
Sheet::alter sh, "Vim & Vigour", result
|
43
|
+
Sheet::alter sh, "The Outer Crust", result
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
# You are cold sober, ie no change from before.
|
50
|
+
class ColdSober < DrinkAction
|
51
|
+
|
52
|
+
def summary
|
53
|
+
"Cold sober"
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
# You have drunk enough to be happy
|
59
|
+
class Happy < DrinkAction
|
60
|
+
|
61
|
+
def summary
|
62
|
+
"Become happy."
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
# You are tipsy
|
68
|
+
class Tipsy < DrinkAction
|
69
|
+
|
70
|
+
def summary
|
71
|
+
"A little tipsy"
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
# You are DRUNK
|
77
|
+
class Drunk < DrinkAction
|
78
|
+
|
79
|
+
def summary
|
80
|
+
"Enough to get drunk."
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
# VERY DRUNK
|
86
|
+
class VeryDrunk < DrinkAction
|
87
|
+
|
88
|
+
def summary
|
89
|
+
"VERY DRUNK."
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
# Paralytic
|
95
|
+
class Paralytic < DrinkAction
|
96
|
+
|
97
|
+
def summary
|
98
|
+
"Paralytic."
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
# Rule which performs drinking
|
104
|
+
class Drink < CARPS::Rule
|
105
|
+
|
106
|
+
include Fools::Dice
|
107
|
+
|
108
|
+
# Add the actions
|
109
|
+
def initialize
|
110
|
+
super
|
111
|
+
add_action :>=, 0, ColdSober
|
112
|
+
add_action :==, -1, Happy
|
113
|
+
add_action (-3..-2), Tipsy
|
114
|
+
add_action (-5..-4), Drunk
|
115
|
+
add_action (-8..-6), VeryDrunk
|
116
|
+
add_action :<=, -9, Paralytic
|
117
|
+
end
|
118
|
+
|
119
|
+
protected
|
120
|
+
|
121
|
+
# Drinking dice
|
122
|
+
def dice sheet, quantity, target
|
123
|
+
vim = sheet["Vim & Vigour"]
|
124
|
+
resistance = sheet["Tolerance for Alcohol"]
|
125
|
+
drink vim, resistance, quantity, target
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "carps/mod"
|
19
|
+
|
20
|
+
module Fools
|
21
|
+
|
22
|
+
module Dice
|
23
|
+
|
24
|
+
# Resist romance
|
25
|
+
#
|
26
|
+
# resistance is the Romantic Resistance of the 'victim'.
|
27
|
+
#
|
28
|
+
# crust is The Outer Crust of the possible object of love
|
29
|
+
#
|
30
|
+
# Positive on success, negative on failure. Magnitude is
|
31
|
+
# meaningful.
|
32
|
+
def resist_romance resistance, crust
|
33
|
+
resisted = d 10
|
34
|
+
resisted + (resistance - crust)
|
35
|
+
resisted
|
36
|
+
end
|
37
|
+
|
38
|
+
# Talk sense
|
39
|
+
#
|
40
|
+
# Can you talk someone out of their love?
|
41
|
+
#
|
42
|
+
# resistance is the Romantic Resistance of the 'victim'.
|
43
|
+
#
|
44
|
+
# crust is The Outer Crust of the object of love
|
45
|
+
#
|
46
|
+
# matter is The Old Grey Matter of the lovestruck drone's sensible friend
|
47
|
+
#
|
48
|
+
# Positive on success, negative on failure. Magnitude is
|
49
|
+
# meaningful.
|
50
|
+
def talk_sense resistance, crust, matter
|
51
|
+
convince = d 10
|
52
|
+
convince + matter
|
53
|
+
# Resist the advice...
|
54
|
+
resist = d 10
|
55
|
+
resist + (crust - resistance)
|
56
|
+
convince - resist
|
57
|
+
convince
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,143 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
module Fools
|
19
|
+
|
20
|
+
module Rules
|
21
|
+
|
22
|
+
# Resisted being attracted to a young lady
|
23
|
+
class ResistedRomance < CARPS::Action
|
24
|
+
|
25
|
+
def summary
|
26
|
+
"Kept cool."
|
27
|
+
end
|
28
|
+
|
29
|
+
protected
|
30
|
+
|
31
|
+
# Nothing actually happens. They just roleplay this.
|
32
|
+
#
|
33
|
+
# TODO: extend character sheet?
|
34
|
+
def execute *params
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
# Besotted
|
40
|
+
class Smitten < CARPS::Action
|
41
|
+
|
42
|
+
def summary
|
43
|
+
"Became a poor, besotted drooling sort of fellow."
|
44
|
+
end
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
48
|
+
# No change
|
49
|
+
def execute *forget
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
# Rule which performs romantic resistance
|
55
|
+
class Resist < CARPS::Rule
|
56
|
+
|
57
|
+
include Fools::Dice
|
58
|
+
|
59
|
+
# Add the actions
|
60
|
+
def initialize
|
61
|
+
super
|
62
|
+
add_action :>=, 0, ResistedRomance
|
63
|
+
add_action :<, 0, Smitten
|
64
|
+
end
|
65
|
+
|
66
|
+
protected
|
67
|
+
|
68
|
+
# Resistance dice
|
69
|
+
#
|
70
|
+
# The first is the sheet of the 'victim'
|
71
|
+
#
|
72
|
+
# The second of the young lady in question
|
73
|
+
def dice drone, lady
|
74
|
+
resist = drone["Romantic Resistance"]
|
75
|
+
crust = lady["The Outer Crust"]
|
76
|
+
resist_romance resist, crust
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
# Class for successfully talking a man out of a relationship
|
82
|
+
class SensePrevails < CARPS::Action
|
83
|
+
|
84
|
+
def summary
|
85
|
+
"Sense pravails. The sap is de-sopped."
|
86
|
+
end
|
87
|
+
|
88
|
+
protected
|
89
|
+
|
90
|
+
# Nothing really happens. Roleplayed.
|
91
|
+
def execute *forget
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
# Class for failing to talk a man out of a relationship
|
97
|
+
class SenseUseless < CARPS::Action
|
98
|
+
|
99
|
+
def summary
|
100
|
+
"Logic has no effect."
|
101
|
+
end
|
102
|
+
|
103
|
+
protected
|
104
|
+
|
105
|
+
# Nothing happens
|
106
|
+
def execute *forget
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
|
111
|
+
# A rule which handles talking sense into a soppy fool
|
112
|
+
class Sense < CARPS::Rule
|
113
|
+
|
114
|
+
include Fools::Dice
|
115
|
+
|
116
|
+
# Add the actions
|
117
|
+
def initialize
|
118
|
+
super
|
119
|
+
add_action :>=, 0, SensePrevails
|
120
|
+
add_action :<, 0, SenseUseless
|
121
|
+
end
|
122
|
+
|
123
|
+
protected
|
124
|
+
|
125
|
+
# Sense talking dice
|
126
|
+
#
|
127
|
+
# The first is the sheet of the 'victim'
|
128
|
+
#
|
129
|
+
# The second of the young lady in question
|
130
|
+
#
|
131
|
+
# The third of the first's sensible friend
|
132
|
+
def dice sap, lady, friend
|
133
|
+
resistance = sap["Romantic Resistance"]
|
134
|
+
crust = lady["The Outer Crust"]
|
135
|
+
matter = friend["The Old Grey Matter"]
|
136
|
+
talk_sense resistance, crust, matter
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
data/lib/fools/rules.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "fools/rules/drink/dice"
|
19
|
+
require "fools/rules/drink/rule"
|
20
|
+
require "fools/rules/combat/dice"
|
21
|
+
require "fools/rules/combat/rule"
|
22
|
+
require "fools/rules/romance/dice"
|
23
|
+
require "fools/rules/romance/rule"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
module Fools
|
19
|
+
|
20
|
+
module Sheet
|
21
|
+
|
22
|
+
# Safely alter an attribute in a character sheet
|
23
|
+
#
|
24
|
+
# This is safe as long as the stat's minimum value is -10, and maximum is 10 (see Sheet::Semantics)
|
25
|
+
def Sheet::alter sheet, attr, by
|
26
|
+
curr = sheet[attr]
|
27
|
+
result = curr + by
|
28
|
+
if result >= -10 and result <= 10
|
29
|
+
sheet[attr] = result
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "carps/mod"
|
19
|
+
|
20
|
+
require "yaml"
|
21
|
+
|
22
|
+
module Fools
|
23
|
+
|
24
|
+
module Sheet
|
25
|
+
|
26
|
+
# Character sheet schema for The Fools
|
27
|
+
def Sheet::schema
|
28
|
+
CARPS::Sheet::Schema.new YAML.load <<-END
|
29
|
+
Name: Text
|
30
|
+
Biography: Optional Text
|
31
|
+
Character Points: Integer
|
32
|
+
The Readies: Integer
|
33
|
+
The Old Grey Matter: Integer
|
34
|
+
The Outer Crust: Integer
|
35
|
+
Vim & Vigour: Integer
|
36
|
+
Luck: Integer
|
37
|
+
Chances: Integer
|
38
|
+
Romantic Resistance: Integer
|
39
|
+
Tolerance for Alcohol: Integer
|
40
|
+
Conscience: Integer
|
41
|
+
Etiquette: Integer
|
42
|
+
Pounds: Integer
|
43
|
+
Shillings: Integer
|
44
|
+
Pence: Integer
|
45
|
+
Intoxication: Integer
|
46
|
+
Discomfiture: Integer
|
47
|
+
Student of the Turf: Boolean
|
48
|
+
Gentleman's Gentleman: Optional Choice Good Superior
|
49
|
+
Sports Car: Optional Choice Basic Flashy
|
50
|
+
Specialist Interest: Optional Text
|
51
|
+
Connections: Optional Text
|
52
|
+
Difficult Relation: Optional Text
|
53
|
+
Good Sportsman: Optional Text
|
54
|
+
END
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "carps/ui"
|
19
|
+
|
20
|
+
require "carps/mod/sheet/verifier"
|
21
|
+
|
22
|
+
module Fools
|
23
|
+
|
24
|
+
module Sheet
|
25
|
+
|
26
|
+
# Semantic verifier for Fools character sheets
|
27
|
+
class Semantics < CARPS::Sheet::UserVerifier
|
28
|
+
|
29
|
+
# Verify a sheet, produce errors if they occur
|
30
|
+
def produce_errors sheet
|
31
|
+
|
32
|
+
errors = []
|
33
|
+
lims = field_limits
|
34
|
+
# Verify all values are within bounds
|
35
|
+
lims.each do |key, valid|
|
36
|
+
attr = sheet[key]
|
37
|
+
if attr
|
38
|
+
if not valid.include? attr
|
39
|
+
errors.push "Damnit man, #{key} must be between #{valid.min} and #{valid.max}!"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Verify that no more than the limited number of character points has been spent
|
45
|
+
total = 0
|
46
|
+
advts = [
|
47
|
+
"The Readies",
|
48
|
+
"The Old Grey Matter",
|
49
|
+
"The Outer Crust",
|
50
|
+
"Vim & Vigour",
|
51
|
+
"Tolerance for Alcohol",
|
52
|
+
"Luck",
|
53
|
+
"Conscience"
|
54
|
+
]
|
55
|
+
advts.each do |key|
|
56
|
+
val = sheet[key]
|
57
|
+
if val
|
58
|
+
gain = cost(val.abs)
|
59
|
+
if val < 0
|
60
|
+
gain = -gain
|
61
|
+
end
|
62
|
+
total += gain
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
car = sheet["Sports Car"]
|
67
|
+
if car == "Basic"
|
68
|
+
total += 1
|
69
|
+
elsif car == "Flashy"
|
70
|
+
total += 3
|
71
|
+
end
|
72
|
+
|
73
|
+
valet = sheet["Gentleman's Gentleman"]
|
74
|
+
if valet == "Good"
|
75
|
+
total += 1
|
76
|
+
elsif valet == "Superior"
|
77
|
+
total += 3
|
78
|
+
end
|
79
|
+
|
80
|
+
limit = sheet["Character Points"]
|
81
|
+
if total > limit
|
82
|
+
errors.push "Don't you know that you used #{total} character points, yet you only had #{limit}?"
|
83
|
+
elsif total < limit
|
84
|
+
CARPS::UI::highlight "Chin up old bean, you still have #{limit - total} points to spend."
|
85
|
+
end
|
86
|
+
if errors.empty?
|
87
|
+
nil
|
88
|
+
else
|
89
|
+
errors
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
private
|
94
|
+
|
95
|
+
# Points cost per level
|
96
|
+
#
|
97
|
+
# (Triangular number n)
|
98
|
+
def cost n
|
99
|
+
(n ** 2 + n) / 2
|
100
|
+
end
|
101
|
+
|
102
|
+
# Hard limits on each schema field
|
103
|
+
def field_limits
|
104
|
+
{
|
105
|
+
"The Readies" => -10..10,
|
106
|
+
"The Old Grey Matter" => -10..10,
|
107
|
+
"The Outer Crust" => -10..10,
|
108
|
+
"Vim & Vigour" => -10..10,
|
109
|
+
"Romantic Resistance" => -3..3,
|
110
|
+
"Tolerance for Alcohol" => -3..3,
|
111
|
+
"Luck" => -10..10,
|
112
|
+
"Chances" => -30..30,
|
113
|
+
"Etiquette" => -1..1,
|
114
|
+
"Conscience" => -1..1,
|
115
|
+
"Intoxication" => -9..0,
|
116
|
+
"Discomfiture" => -9..0,
|
117
|
+
# The upper limits here are somewhat arbitrary
|
118
|
+
"Pounds" => 0..1000000,
|
119
|
+
"Shillings" => 0..10000,
|
120
|
+
"Pence" => 0..10000
|
121
|
+
|
122
|
+
}
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
data/lib/fools/sheet.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "fools/sheet/schema"
|
19
|
+
require "fools/sheet/semantics"
|
20
|
+
require "fools/sheet/alter"
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "carps/util/error"
|
19
|
+
|
20
|
+
module Fools
|
21
|
+
|
22
|
+
def Fools::fatal msg
|
23
|
+
put_error "FATAL ERROR"
|
24
|
+
put_error msg
|
25
|
+
CARPS::enter_quit 1
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
data/lib/fools/util.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
require "fools/util/error"
|
data/lib/fools.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Copyright 2010 John Morrice
|
2
|
+
|
3
|
+
# This file is part of The Fools.
|
4
|
+
|
5
|
+
# The Fools is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU General Public License as published by
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
8
|
+
# (at your option) any later version.
|
9
|
+
|
10
|
+
# The Fools is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13
|
+
# GNU General Public License for more details.
|
14
|
+
|
15
|
+
# You should have received a copy of the GNU General Public License
|
16
|
+
# along with The Fools. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
19
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
20
|
+
|
21
|
+
require "carps"
|
22
|
+
|
23
|
+
require "fools/interface"
|
24
|
+
require "fools/mod"
|
25
|
+
require "fools/util"
|
26
|
+
require "fools/player"
|
27
|
+
require "fools/dm"
|
28
|
+
require "fools/rules"
|
29
|
+
require "fools/sheet"
|
30
|
+
|
31
|
+
module Fools
|
32
|
+
VERSION = '0.0.4'
|
33
|
+
end
|