Module: GamesAndRpgParadise::Gamebook::LoneWolf

Defined in:
lib/games_and_rpg_paradise/gamebooks/lone_wolf/character.rb,
lib/games_and_rpg_paradise/gamebooks/lone_wolf/lone_wolf.rb,
lib/games_and_rpg_paradise/gamebooks/lone_wolf/statistics.rb,
lib/games_and_rpg_paradise/gamebooks/lone_wolf/combat_ratio.rb,
lib/games_and_rpg_paradise/gamebooks/lone_wolf/map_number_to_remote_URL.rb

Overview

GamesAndRpgParadise::Gamebook::LoneWolf

Defined Under Namespace

Modules: Statistics Classes: Character

Constant Summary collapse

K =
#

K

#
'Killed'

Class Method Summary collapse

Class Method Details

.basic_kai_disciplines?Boolean

#

GamesAndRpgParadise::Gamebook::LoneWolf.basic_kai_disciplines?

This is basically a wrapper method.

#

Returns:

  • (Boolean)


34
35
36
37
38
39
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/lone_wolf.rb', line 34

def self.basic_kai_disciplines?
  unless ::GamesAndRpgParadise::Gamebook::LoneWolf.const_defined? :Character
    require 'games_and_rpg_paradise/gamebooks/lone_wolf/character.rb'
  end
  ::GamesAndRpgParadise::Gamebook::LoneWolf::Character.available_kai_disciplines?
end

.combat_ratio(i = -1) ⇒ Object

#

GamesAndRpgParadise::Gamebook::LoneWolf.combat_ratio

This method will return an Array, if the input is correct and registered.

K means killed.

The first number refers to the enemy; second number to the lone wolf (aka the actor).

The number given to this method should be the combat ratio difference, so if the CS value of the main actor is 20, and the CS value of the opponent is 30, then i must be -10.

#


34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/combat_ratio.rb', line 34

def self.combat_ratio(
    i = -1
  )
  if i > 11
    i = 11 # Sanitize towards 11.
  end
  if i < -11
    i = -11 # Sanitize towards -11.
  end
  case i
  # ======================================================================= #
  # === -11
  # ======================================================================= #
  when -11
    [
       1 => [0, K],
       2 => [0, K],
       3 => [0, 8],
       4 => [0, 8],
       5 => [1, 7],
       6 => [2, 6],
       7 => [3, 5],
       8 => [4, 4],
       9 => [5, 3],
      10 => [6, 0],
    ]
  # ======================================================================= #
  # === -10
  # ======================================================================= #
  when -10, -9
    [
       1 => [0, K],
       2 => [0, 8],
       3 => [0, 7],
       4 => [1, 7],
       5 => [2, 6],
       6 => [3, 6],
       7 => [4, 5],
       8 => [5, 4],
       9 => [6, 3],
      10 => [7, 0],
    ]
  # ======================================================================= #
  # === -8, -7
  # ======================================================================= #
  when -8, -7
    [
       1 => [0, 8],
       2 => [0, 7],
       3 => [1, 6],
       4 => [2, 6],
       5 => [3, 5],
       6 => [4, 5],
       7 => [5, 4],
       8 => [6, 3],
       9 => [7, 2],
      10 => [8, 0],
    ]
  # ======================================================================= #
  # === -6, -5
  # ======================================================================= #
  when -6, -5
    [
       1 => [0, 6],
       2 => [1, 6],
       3 => [2, 5],
       4 => [3, 5],
       5 => [4, 4],
       6 => [5, 4],
       7 => [6, 3],
       8 => [7, 2],
       9 => [8, 0],
      10 => [9, 0],
    ]
  # ======================================================================= #
  # === -4, -3
  # ======================================================================= #
  when -4, -3
    [
       1 => [ 1, 6],
       2 => [ 2, 5],
       3 => [ 3, 5],
       4 => [ 4, 4],
       5 => [ 5, 4],
       6 => [ 6, 3],
       7 => [ 7, 2],
       8 => [ 8, 1],
       9 => [ 9, 0],
      10 => [10, 0],
    ]
  # ======================================================================= #
  # === -2, -1
  # ======================================================================= #
  when -2, -1
    [
       1 => [ 2, 5],
       2 => [ 3, 5],
       3 => [ 4, 4],
       4 => [ 5, 4],
       5 => [ 6, 3],
       6 => [ 7, 2],
       7 => [ 8, 2],
       8 => [ 9, 1],
       9 => [10, 0],
      10 => [11, 0],
    ]
  # ======================================================================= #
  # === 0
  # ======================================================================= #
  when 0
    [
       1 => [ 3, 5],
       2 => [ 4, 4],
       3 => [ 5, 4],
       4 => [ 6, 3],
       5 => [ 7, 2],
       6 => [ 8, 2],
       7 => [ 9, 1],
       8 => [10, 0],
       9 => [11, 0],
      10 => [12, 0],
    ]
  # ======================================================================= #
  # === 1,2
  # ======================================================================= #
  when 1,2
    [
       1 => [ 4, 5],
       2 => [ 5, 4],
       3 => [ 6, 3],
       4 => [ 7, 3],
       5 => [ 8, 2],
       6 => [ 9, 2],
       7 => [10, 1],
       8 => [11, 0],
       9 => [12, 0],
      10 => [14, 0],
    ]
  # ======================================================================= #
  # === 3,4
  # ======================================================================= #
  when 3,4
    [
       1 => [ 5, 4],
       2 => [ 6, 3],
       3 => [ 7, 3],
       4 => [ 8, 2],
       5 => [ 9, 2],
       6 => [10, 2],
       7 => [11, 1],
       8 => [12, 0],
       9 => [14, 0],
      10 => [16, 0],
    ]
  # ======================================================================= #
  # === 5,6
  # ======================================================================= #
  when 5,6
    [
       1 => [ 6, 4],
       2 => [ 7, 3],
       3 => [ 8, 3],
       4 => [ 9, 2],
       5 => [10, 2],
       6 => [11, 1],
       7 => [12, 0],
       8 => [14, 0],
       9 => [16, 0],
      10 => [18, 0],
    ]
  # ======================================================================= #
  # === 7,8
  # ======================================================================= #
  when 7,8
    [
       1 => [ 7, 4],
       2 => [ 8, 3],
       3 => [ 9, 2],
       4 => [10, 2],
       5 => [11, 2],
       6 => [12, 1],
       7 => [14, 0],
       8 => [16, 0],
       9 => [18, 0],
      10 => [ K, 0],
    ]
  # ======================================================================= #
  # === 9,10
  # ======================================================================= #
  when 9,10
    [
       1 => [ 8, 3],
       2 => [ 9, 3],
       3 => [10, 2],
       4 => [11, 2],
       5 => [12, 2],
       6 => [14, 1],
       7 => [16, 0],
       8 => [18, 0],
       9 => [ K, 0],
      10 => [ K, 0],
    ]
  # ======================================================================= #
  # === 11
  # ======================================================================= #
  when 11
    [
       1 => [ 9, 3],
       2 => [10, 2],
       3 => [11, 2],
       4 => [12, 2],
       5 => [14, 1],
       6 => [16, 1],
       7 => [18, 0],
       8 => [ K, 0],
       9 => [ K, 0],
      10 => [ K, 0],
    ]
  else
    puts 'Undefined for '+i.to_s
  end
end

.map_number_to_remote_URL(i = 1) ⇒ Object

#

GamesAndRpgParadise::Gamebook::LoneWolf.map_number_to_remote_URL

This method shall provide a simple number-to-remote-URL mapper. So, if the input to this method is 1, then we want to obtain the remote URL to the first lone-wolf book. If it is 2 then the second book’s URL should be returned, and so forth.

These can be found at:

https://www.projectaon.org/en/Main/Books

Usage example:

x = GamesAndRpgParadise::Gamebook::LoneWolf.map_number_to_remote_URL(2)
#


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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/games_and_rpg_paradise/gamebooks/lone_wolf/map_number_to_remote_URL.rb', line 31

def self.map_number_to_remote_URL(i = 1)
  case i.to_i # We only want Numbers here.
  when  1 # This is for "Flight from the Dark".
    'https://www.projectaon.org/en/xhtml/lw/01fftd/title.htm'
  when  2 # This is for "Fire on the Water".
    'https://www.projectaon.org/en/xhtml/lw/02fotw/title.htm' #=> "https://www.projectaon.org/en/xhtml/lw/02fotw/title.htm"
  when  3 # This is for "The Caverns of Kalte".
    'https://www.projectaon.org/en/xhtml/lw/03tcok/title.htm'
  when  4 # This is for "The Chasm of Doom".
    'https://www.projectaon.org/en/xhtml/lw/04tcod/title.htm'
  when  5 # This is for "Shadow on the Sand".
    'https://www.projectaon.org/en/xhtml/lw/05sots/title.htm'
  when  6 # This is for "The Kingdoms of Terror".
    'https://www.projectaon.org/en/xhtml/lw/06tkot/title.htm'
  when  7 # This is for "Castle Death".
    'https://www.projectaon.org/en/xhtml/lw/07cd/title.htm'
  when  8 # This is for "The Jungle of Horrors".
    'https://www.projectaon.org/en/xhtml/lw/08tjoh/title.htm'
  when  9 # This is for "The Cauldron of Fear".
    'https://www.projectaon.org/en/xhtml/lw/09tcof/title.htm'
  when 10 # This is for "The Dungeons of Torgar".
    'https://www.projectaon.org/en/xhtml/lw/10tdot/title.htm'
  when 11 # This is for "The Prisoners of Time".
    'https://www.projectaon.org/en/xhtml/lw/11tpot/title.htm'
  when 12 # This is for "The Masters of Darkness".
    'https://www.projectaon.org/en/xhtml/lw/12tmod/title.htm'
  when 13 # This is for "The Plague Lords of Ruel".
    'https://www.projectaon.org/en/xhtml/lw/13tplor/title.htm'
  when 14 # This is for "The Captives of Kaag".
    'https://www.projectaon.org/en/xhtml/lw/14tcok/title.htm'
  when 15 # This is for "The Darke Crusade".
    'https://www.projectaon.org/en/xhtml/lw/15tdc/title.htm'
  when 16 # This is for "The Legacy of Vashna".
    'https://www.projectaon.org/en/xhtml/lw/16tlov/title.htm'
  when 17 # This is for "The Deathlord of Ixia".
    'https://www.projectaon.org/en/xhtml/lw/17tdoi/title.htm'
  when 18 # This is for "Dawn of the Dragons".
    'https://www.projectaon.org/en/xhtml/lw/18dotd/title.htm'
  when 19 # This is for "Wolf's Bane".
    'https://www.projectaon.org/en/xhtml/lw/19wb/title.htm'
  when 20 # This is for "The Curse of Naar".
    'https://www.projectaon.org/en/xhtml/lw/20tcon/title.htm'
  when 21 # This is for "Voyage of the Moonstone".
    'https://www.projectaon.org/en/xhtml/lw/21votm/title.htm'
  when 22 # This is for "The Buccaneers of Shadaki".
    'https://www.projectaon.org/en/xhtml/lw/22tbos/title.htm'
  when 23 # This is for "Mydnight's Hero".
    'https://www.projectaon.org/en/xhtml/lw/23mh/title.htm'
  when 24 # This is for "Rune War".
    'https://www.projectaon.org/en/xhtml/lw/24rw/title.htm'
  when 25 # This is for "Trail of the Wolf".
    'https://www.projectaon.org/en/xhtml/lw/25totw/title.htm'
  when 26 # This is for "The Fall of Blood Mountain".
    'https://www.projectaon.org/en/xhtml/lw/26tfobm/title.htm'
  when 27 # This is for "Vampirium".
    'https://www.projectaon.org/en/xhtml/lw/27v/title.htm'
  when 28 # This is for "The Hunger of Sejanoz".
    'https://www.projectaon.org/en/xhtml/lw/28thos/tssf.htm'
  when 29 # This is for "The Storms of Chai".
    'https://www.projectaon.org/en/xhtml/lw/29tsoc/title.htm'
  else
    'not registered! This should never happen, though.' # This should never happen really.
  end
end