YumemoireFramework 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/lib/YumemoireFramework/version.rb +1 -1
- data/lib/YumemoireFramework.rb +1593 -1527
- metadata +2 -2
data/lib/YumemoireFramework.rb
CHANGED
|
@@ -6,6 +6,7 @@ module YumemoireFramework
|
|
|
6
6
|
class Error < StandardError; end
|
|
7
7
|
|
|
8
8
|
class Title
|
|
9
|
+
|
|
9
10
|
def self.main
|
|
10
11
|
puts "\e[38;2;187;127;118m \e[8;42;107t"
|
|
11
12
|
|
|
@@ -19,35 +20,21 @@ module YumemoireFramework
|
|
|
19
20
|
print "What would you like to do? [ Play / Language / Quit ] >> "; option = gets.chomp
|
|
20
21
|
|
|
21
22
|
if option == "Play"
|
|
22
|
-
|
|
23
|
+
YumemoireStats::GlobalStats.assign_metrics
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
#elsif option == "Beastiary"
|
|
26
|
-
#system("cd lib/beastiary; ruby beastiary.rb")
|
|
25
|
+
YumemoireHumanMode::HumanMode.parser
|
|
27
26
|
elsif option == "Language"
|
|
28
27
|
print ">> Glossary or translation? >> "; lang_choice = gets.chomp
|
|
29
28
|
|
|
30
29
|
if lang_choice == "Glossary"
|
|
31
|
-
|
|
30
|
+
YumemoireEncyclopedia::Encyclopedia.study
|
|
32
31
|
elsif lang_choice == "Translate"
|
|
33
|
-
|
|
32
|
+
YumemoireEncyclopedia::Encyclopedia.translate
|
|
34
33
|
elsif lang_choice == "Detect Poison"
|
|
35
|
-
|
|
34
|
+
YumemoireEncyclopedia::Encyclopedia.detect_poison
|
|
36
35
|
else
|
|
37
36
|
puts ">> This language option does not exist."
|
|
38
37
|
end
|
|
39
|
-
#elsif option == "Laboratory"
|
|
40
|
-
#print "What type of color synthesis? >> "; synthesis_type = gets.chomp
|
|
41
|
-
|
|
42
|
-
#if synthesis_type == "Real"
|
|
43
|
-
#system("cd lib/laboratory/AutomixREAL; ./routine.sh")
|
|
44
|
-
#elsif synthesis_type == "Synthetic"
|
|
45
|
-
#system("cd lib/laboratory/AutomixSYNTH; ./routine.sh")
|
|
46
|
-
#else
|
|
47
|
-
#puts ">> There is no such laboratory..."
|
|
48
|
-
|
|
49
|
-
#abort
|
|
50
|
-
#end
|
|
51
38
|
elsif option == "Quit"
|
|
52
39
|
system("clear")
|
|
53
40
|
|
|
@@ -59,8 +46,12 @@ module YumemoireFramework
|
|
|
59
46
|
end
|
|
60
47
|
end
|
|
61
48
|
end
|
|
49
|
+
|
|
62
50
|
end
|
|
63
51
|
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
module YumemoireStats
|
|
64
55
|
class GlobalStats
|
|
65
56
|
def self.assign_metrics
|
|
66
57
|
##########################################################################################
|
|
@@ -72,7 +63,7 @@ module YumemoireFramework
|
|
|
72
63
|
$enemy_struck = 0 # Keeps track of how many times enemy hit the player.
|
|
73
64
|
|
|
74
65
|
# Current Lunar Phase
|
|
75
|
-
$current_phase = File.read("lib/data/lunar_calender/current_phase.txt").strip.to_i # 0
|
|
66
|
+
$current_phase = 0 # File.read("lib/data/lunar_calender/current_phase.txt").strip.to_i # 0
|
|
76
67
|
|
|
77
68
|
## Amount of days in a year.
|
|
78
69
|
$current_day = 0
|
|
@@ -83,12 +74,12 @@ module YumemoireFramework
|
|
|
83
74
|
$reset_hp = File.read("lib/player_stats/reset_hp.txt").strip.to_i
|
|
84
75
|
|
|
85
76
|
# Standard base stats
|
|
86
|
-
$personal_demon_metric = File.read("lib/data/user/personal_demon_metric.txt").strip.to_i
|
|
87
|
-
$player_healing_rate = File.read("lib/player_stats/player_healing_rate.txt").strip.to_i
|
|
77
|
+
$personal_demon_metric = 0 # File.read("lib/data/user/personal_demon_metric.txt").strip.to_i
|
|
78
|
+
$player_healing_rate = 4 # File.read("lib/player_stats/player_healing_rate.txt").strip.to_i
|
|
88
79
|
|
|
89
|
-
$player_hp = File.read("lib/player_stats/player_hp.txt").strip.to_i
|
|
90
|
-
$player_atk = File.read("lib/player_stats/player_atk.txt").strip.to_i
|
|
91
|
-
$player_heal = $player_healing_rate
|
|
80
|
+
$player_hp = 10 # File.read("lib/player_stats/player_hp.txt").strip.to_i
|
|
81
|
+
$player_atk = 4 # File.read("lib/player_stats/player_atk.txt").strip.to_i
|
|
82
|
+
$player_heal = 2 # $player_healing_rate
|
|
92
83
|
|
|
93
84
|
$enemy_hp = 10
|
|
94
85
|
$enemy_atk = 2
|
|
@@ -99,12 +90,14 @@ module YumemoireFramework
|
|
|
99
90
|
$reset_hp = 10
|
|
100
91
|
end
|
|
101
92
|
end
|
|
93
|
+
end
|
|
102
94
|
|
|
95
|
+
module YumemoireEnvironmental
|
|
103
96
|
class LunarCalender
|
|
104
97
|
##########################################################################################
|
|
105
98
|
# Lunar Phase #
|
|
106
99
|
##########################################################################################
|
|
107
|
-
def lunar_cycle
|
|
100
|
+
def self.lunar_cycle
|
|
108
101
|
lunar_phases = [0, 1, 2, 3, 4, 5, 6, 7]
|
|
109
102
|
|
|
110
103
|
# The current lunar phase mod 7
|
|
@@ -209,6 +202,7 @@ module YumemoireFramework
|
|
|
209
202
|
end
|
|
210
203
|
end
|
|
211
204
|
|
|
205
|
+
module YumemoireVillager
|
|
212
206
|
class Marketplace
|
|
213
207
|
#######################################################################################
|
|
214
208
|
# Inn Mechanics #
|
|
@@ -247,7 +241,9 @@ module YumemoireFramework
|
|
|
247
241
|
def visit_armoury
|
|
248
242
|
end
|
|
249
243
|
end
|
|
244
|
+
end
|
|
250
245
|
|
|
246
|
+
module YumemoireDialogue
|
|
251
247
|
class DialogueScript
|
|
252
248
|
#######################################################################################
|
|
253
249
|
# Dialogue Script #
|
|
@@ -332,913 +328,1112 @@ module YumemoireFramework
|
|
|
332
328
|
end
|
|
333
329
|
|
|
334
330
|
def self.procedural_euphemisms
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
#
|
|
338
|
-
#
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
331
|
+
# Te Ta Tos
|
|
332
|
+
# Te Te,Te Te,Ta Te,Tos
|
|
333
|
+
# Ta Ta,Te Ta,Ta Ta,Tos
|
|
334
|
+
# Tos Tos,Te Tos,Ta Tos,Tos
|
|
335
|
+
|
|
336
|
+
7.times do
|
|
337
|
+
|
|
338
|
+
hybrid_genders = [
|
|
339
|
+
[["Te", "Te"], ["Te", "Ta"], ["Te", "Tos"]],
|
|
340
|
+
[["Ta" , "Te"], ["Ta", "Ta"], ["Ta", "Tos"]],
|
|
341
|
+
[["Tos", "Te"], ["Tos", "Ta"], ["Tos", "Tos"]],
|
|
342
|
+
]
|
|
343
|
+
|
|
344
|
+
gender_row_options = [0, 1, 2]
|
|
345
|
+
gender_col_options = [0, 1, 2]
|
|
346
|
+
gender_arr_options = [0, 1]
|
|
347
|
+
|
|
348
|
+
gender_cur_row = gender_row_options.sample
|
|
349
|
+
gender_cur_col = gender_col_options.sample
|
|
350
|
+
gender_cur_arr = gender_arr_options.sample
|
|
351
|
+
|
|
352
|
+
h_gender = hybrid_genders[gender_cur_row][gender_cur_col][gender_cur_arr]
|
|
353
|
+
|
|
354
|
+
# ie shado gareji ribingurumu roka daidakoro shinku aisubokkusu uindo basurumu shinshitsu
|
|
355
|
+
# ie i,i i,s1 i,g i,r1 i,r2 i,d i,s2 i,a i,u i.b i,s3 # House
|
|
356
|
+
# shado s1,i s1,s1 s1,g s1,r1 s1,r2 s1,d s1,s2 s1,a s1,u s1.b s1,s3 # Slope
|
|
357
|
+
# gareji g,i g,s1 g,g g,r1 g,r2 g,d g,s2 g,a g,u g.b g,s3 # Garage
|
|
358
|
+
# ribingurumu r1,i r1,s1 r1,g r1,r1 r1,r2 r1,d r1,s2 r1,a r1,u r1.b r1,s3 # Living Room
|
|
359
|
+
# roka g,i g,s1 g,g g,r1 g,r2 g,d g,s g,a g,u g.b g,s3 # Fridge
|
|
360
|
+
# daidakoro d,i d,s1 d,g d,r1 d,r2 d,d d,s d,a d,u d.b d,s3 # The first time
|
|
361
|
+
# shinku s2,i s2,s1 s2,g s2,r1 s2,r2 s2,d s2,s s2,a s2,u s2.b s2,s3 # Sink
|
|
362
|
+
# aisubokkusu a,i a,s1 a,g a,r1 a,r2 a,d a,s a,a a,u a.b a,s2 # Ice Box
|
|
363
|
+
# uindo u,i u,s1 u,g u,r1 u,r2 u,d u,s u,a u,u u.b u,s2 # Window
|
|
364
|
+
# basurumu b,i b,s1 b,g b,r1 b,r2 b,d b,s b,a b,u b.b b,s2 # Bathroom
|
|
365
|
+
# shinshitsu s3,i s3,s1 s3,g s3,r1 s3,r2 s3,d s3,s s3,a s3,u s3.b s3,s2 # Bedroom
|
|
366
|
+
|
|
367
|
+
locations = [
|
|
368
|
+
[["Ie", "Ie"], ["Ie", "Shado"], ["Ie", "Gareji"], ["Ie", "Ribingurumu"], ["Ie", "Roka"], ["Ie", "Daidakoro"], ["Ie", "Shinku"], ["Ie", "Aisubokkusu"], ["Ie", "Uindo"], ["Ie", "Basurumu"], ["Ie", "Shinshitsu"]],
|
|
369
|
+
[["Shadi" , "Ie"], ["Shado", "Shado"], ["Shado", "Gareji"], ["Shado", "Ribingurumu"], ["Shado" , "Roka"], ["Shado", "Daidakoro"], ["Shado", "Shinku"], ["Shado", "Aisubokkusu"], ["Shado", "Uindo"], ["Shado", "Basurumu"], ["Shado", "Shinshitsu"]],
|
|
370
|
+
[["Gareji", "Ie"], ["Gareji", "Shado"], ["Gareji", "Gareji"], ["Gareji", "Ribingurumu"], ["Gareji", "Roka"], ["Gareji", "Daidakoro"], ["Gareji", "Shinku"], ["Gareji", "Aisubokkusu"], ["Garehi", "Uindo"], ["Gareji", "Basurumu"], ["Shadow", "Shinshitsu"]],
|
|
371
|
+
[["Ribingurumu", "Ie"], ["Ribingurumu", "Shado"], ["Ribingurumu", "Gareji"], ["Ribingurumu", "Ribingurumu"], ["Ribingurumu", "Roka"], ["Ribingurumu", "Daidakoro"], ["Ribingurumu", "Shinku"], ["Ribingurumu", "Aisubokkusu"], ["Ribingurumu", "Uindo"], ["Ribingurumu", "Basurumu"], ["Ribingurumu", "Shinshitsu"]],
|
|
372
|
+
[["Roka", "Ie"], ["Roka", "Shado"], ["Roka", "Gareji"], ["Roka", "Ribingurumu"], ["Roka", "Roka"], ["Roka", "Daidakoro"], ["Roka", "Shinku"], ["Roka", "Aisubokkusu"], ["Roka", "Uindo"], ["Roka", "Basurumu"], ["Roka", "Shinshitsu"]],
|
|
373
|
+
[["Daidakoro", "Ie"], ["Daidakoro", "Shado"], ["Daidakoro", "Gareji"], ["Daidakoro", "Ribingurumu"], ["Daidakoro", "Roka"], ["Daidakoro", "Daidakoro"], ["Daidakoro", "Shinku"], ["Daidakoro", "Aisubokkusu"], ["Daidakoro", "Uindo"], ["Daidakoro", "Basurumu"], ["Daidakoro", "Shinshitsu"]],
|
|
374
|
+
[["Shinku", "Ie"], ["Shinku", "Shado"], ["Shinku", "Gareji"], ["Shinku", "Ribingurumu"], ["Shinku", "Roka"], ["Shinku", "Daidakoro"], ["Shinku", "Shinku"], ["Shinku", "Aisubokkusu"], ["Shinku", "Uindo"], ["Shinku", "Basurumu"], ["Shinku", "Shinshitsu"]],
|
|
375
|
+
[["aisubokkusu", "Ie"], ["Aisubokkusu", "Shado"], ["Aisubokkusu", "Gareji"], ["Aisubokkusu", "Ribingurumu"], ["Aisubokkusu", "Roka"], ["Aisubokkusu", "Daidakoro"], ["Aisubokkusu", "Shinku"], ["Aisubokkusu", "Aisubokkusu"], ["Aisubokkusu", "Uindo"], ["Aisubokkusu", "Basurumu"], ["Aisubokkusu", "Shinshitsu"]],
|
|
376
|
+
[["Uindo", "Ie"], ["Uindo", "Shado"], ["Uindo", "Gareji"], ["Uindo" , "Ribingurumu"], ["Uindo", "Roka"], ["Uindo", "Daidakoro"], ["Uindo", "Shinku"], ["Uindo", "Aisubokkusu"], ["Uindo", "Uindo"], ["Uindo", "Basurumu"], ["Uindo", "Shinshitsu"]],
|
|
377
|
+
[["Basurumu", "Ie"], ["Basurumu", "Shado"], ["Basurumu", "Gareji"], ["Basurumu", "Ribingurumu"], ["Basurumu", "Roka"], ["Basurumu", "Daidakoro"], ["Basurumu", "Shinku"], ["Basurumu", "Aisubokkusu"], ["Basurumu", "Uindo"], ["Basurumu", "Basurumu"], ["Basurumu", "Shinshitsu"]],
|
|
378
|
+
[["Shinshitsu", "Ie"], ["Shinsitsu", "Shado"], ["Shinsitsu", "Gareji"], ["Shinshitsu", "Ribingurumu"], ["Shinshitsu", "Roka"], ["Shinshitsu", "Daidakoro"], ["Shinshitsu", "Shinku"], ["Shinshitsu", "Aisubokkusu"], ["Shinshitsu", "Uindo"], ["Shinshitsu", "Basurumu"], ["Shinshitsu", "Shinshitsu"]],
|
|
379
|
+
]
|
|
380
|
+
|
|
381
|
+
location_row_options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
382
|
+
location_col_options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
383
|
+
location_arr_options = [0, 1]
|
|
384
|
+
|
|
385
|
+
l_cur_row = location_row_options.sample
|
|
386
|
+
l_cur_col = location_col_options.sample
|
|
387
|
+
l_cur_arr = location_arr_options.sample
|
|
388
|
+
|
|
389
|
+
cur_location = locations[l_cur_row][l_cur_col][l_cur_arr]
|
|
390
|
+
|
|
391
|
+
# guache entre sortie porte canape pratiquer manger lave merde dorm mur
|
|
392
|
+
# guache g,g g,e g,s g,p g,c g,p g,m1 g,l g,m2 g,d g,m3 # Gouache paint
|
|
393
|
+
# entre e,g e,e e,s e,p e,c e,p e,m1 e,l e,m2 e,d e,m3 # Between
|
|
394
|
+
# sortie s,g s,e s,s s,p s,c s,p s,m1 s,l s,m2 s,d s,m3 # Exit
|
|
395
|
+
# porte p,g p,e p,s p,p p,c p,p p,m1 p,l p,m2 p,d p,m3 # Door
|
|
396
|
+
# canape c,g c,e c,s c,p c,c c,p c,m1 c,l c,m2 c,d c,m3 # Couch
|
|
397
|
+
# pratiquer p,g p,e p,s p,p p,c p,p p,m1 p,l p,m2 p,d p,m3 # Practice
|
|
398
|
+
# manger m1,g m1,e m1,s m1,p m1,c m1,p m1,m1 m1,l m1,m2 m1,d m1,m3 # To Eat
|
|
399
|
+
# lave l,g l,e l,s l,p l,c l,p l,m1 l,l l,m2 l,d l,m3 # Washed / Wash
|
|
400
|
+
# merde m2,g m2,e m2,s m2,p m2,c m2,p m2,m1 m2,l m2,m2 m2,d m2,m3 # Shit / Poo ( informal )
|
|
401
|
+
# dorm d,g d,e d,s d,p d,c d,p d,m1 d,l d,m2 d,d d,m3 # Sleep
|
|
402
|
+
# mur m3,g m3,e m3,s m3,p m3,c m3,p m3,m1 m3,l m3,m m3,d m3,m2 # Wall
|
|
403
|
+
|
|
404
|
+
#begin
|
|
405
|
+
|
|
406
|
+
verbs = [
|
|
407
|
+
[["gouache", "gouache"], ["gouache", "entre"], ["gouache", "sortie"], ["gouache", "porte"], ["gouache", "canape"], ["gouache", "pratiquer"], ["gouache", "manger"], ["gouache", "laver"], ["gouache", "merde"], ["gouache", "dorm"], ["gouache", "mur"]],
|
|
408
|
+
[["entre", "gouache"], ["entre", "entre"], ["entre", "sortie"], ["entre", "porte"], ["entre", "canape"], ["entre", "pratiquer"], ["entre", "manger"], ["entre", "laver"], ["entre", "merde"], ["entre", "dorm"], ["entre", "mur"]],
|
|
409
|
+
[["sortie", "gouache"], ["sortie", "entre"], ["sortie", "sortie"], ["sortie", "porte"], ["sortie", "canape"], ["sortie", "pratiquer"], ["sortie", "manger"], ["sortie", "laver"], ["sortie", "merde"], ["sortie", "dorm"], ["sortie", "mur"]],
|
|
410
|
+
[["porte", "gouache"], ["porte", "entre"], ["porte", "sortie"], ["porte", "porte"], ["porte", "canape"], ["porte", "pratiquer"], ["porte", "manger"], ["porte", "laver"], ["porte", "merde"], ["porte", "dorm"], ["prte", "mur"]],
|
|
411
|
+
[["canape", "gouache"], ["canape", "entre"], ["canape", "sortie"], ["canape", "porte"], ["canape", "canape"], ["canape", "pratiquer"], ["canape", "manger"], ["canape", "laver"], ["canape", "merde"], ["canape", "dorm"], ["canape", "mur"]],
|
|
412
|
+
[["pratiquer", "gouache"], ["pratiquer", "entre"], ["pratiquer", "sortie"], ["pratiquer", "porte"], ["pratiquer", "canape"], ["pratiquer", "pratiquer"], ["pratiquer", "manger"], ["pratiquer", "laver"], ["pratiquer", "merde"], ["pratiquer", "dorm"], ["pratiquer", "mur"]],
|
|
413
|
+
[["manger", "gouache"], ["manger", "entre"], ["manger", "sortie"], ["manger", "porte"], ["manger", "canape"], ["manger", "pratiquer"], ["manger", "manger"], ["manger", "laver"], ["manger", "merde"], ["manger", "dorm"], ["manger", "mur"]],
|
|
414
|
+
[["laver", "gouache"], ["laver", "entre"], ["laver", "sortie"], ["laver", "porte"], ["laver", "canape"], ["laver", "pratiquer"], ["laver", "manger"], ["laver", "laver"], ["laver", "merde"], ["laver", "dorm"], ["laver", "mur"]],
|
|
415
|
+
[["merde", "gouache"], ["merde", "entre"], ["merde" , "sortie"], ["merde", "porte"], ["merde", "canape"], ["merde", "pratiquer"], ["merde", "manger"], ["merde", "laver"], ["merde", "merde"], ["merde", "dorm"], ["merde", "mur"]],
|
|
416
|
+
[["dorm", "gouache"], ["dorm", "entre"], ["dorm", "sortie"], ["dorm", "porte"], ["dorm", "canape"], ["dorm", "pratiquer"], ["dorm", "manger"], ["dorm", "laver"], ["dorm", "merde"], ["dorm", "dorm"], ["dorm", "mur"]],
|
|
417
|
+
[["mur", "gouache"], ["mur", "entre"], ["mur", "sortie"], ["mur", "porte"], ["mur", "canape"], ["mur", "pratiquer"], ["mur", "manger"], ["mur", "laver"], ["mur", "merde"], ["mur", "dorm"], ["mur", "mur"]],
|
|
418
|
+
]
|
|
419
|
+
|
|
420
|
+
verb_row_options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
421
|
+
verb_col_options = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
|
422
|
+
verb_arr_options = [0, 1]
|
|
423
|
+
|
|
424
|
+
v_cur_row = verb_row_options.sample
|
|
425
|
+
v_cur_col = verb_row_options.sample
|
|
426
|
+
v_cur_arr = verb_arr_options.sample
|
|
427
|
+
|
|
428
|
+
cur_verb = verbs[v_cur_row][v_cur_col][v_cur_arr]
|
|
429
|
+
|
|
430
|
+
#rescue
|
|
431
|
+
#puts "No such verb on #{v_cur_row} #{v_cur_col} #{v_cur_arr}"
|
|
432
|
+
#end
|
|
378
433
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
434
|
+
## Create word
|
|
435
|
+
current_word = "#{h_gender} #{cur_location}#{cur_verb}"
|
|
436
|
+
#current_word = "#{cur_verb}"
|
|
382
437
|
|
|
383
|
-
|
|
384
|
-
|
|
438
|
+
#training_data = " => portmanteau.train(:formal, '#{current_word}', 'word')\n"
|
|
439
|
+
|
|
440
|
+
File.open("_input/portmanteau.txt", "a") { |f|
|
|
441
|
+
f.puts current_word
|
|
442
|
+
}
|
|
443
|
+
#puts training_data
|
|
444
|
+
end
|
|
445
|
+
end
|
|
385
446
|
end
|
|
386
447
|
end
|
|
387
448
|
end
|
|
449
|
+
end
|
|
388
450
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
451
|
+
module YumemoireDamage
|
|
452
|
+
class DamageFormulas
|
|
453
|
+
########################################################################################
|
|
454
|
+
# Damage Formulas For Players And Enemies #
|
|
455
|
+
########################################################################################
|
|
456
|
+
def player_damage_rate
|
|
457
|
+
#set_player_stats
|
|
458
|
+
#set_enemy_stats
|
|
394
459
|
|
|
395
|
-
|
|
396
|
-
end
|
|
460
|
+
def_dice = [ 'full_damage', 'half_damage', 'missed', 'critical' ]
|
|
397
461
|
|
|
398
|
-
|
|
399
|
-
possible_adjectives = File.readlines("monsternames/gendered_adverb.txt")
|
|
462
|
+
roll_dice = def_dice.sample
|
|
400
463
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
end
|
|
464
|
+
if roll_dice == 'full_damage'
|
|
465
|
+
damage = $player_atk
|
|
404
466
|
|
|
405
|
-
|
|
406
|
-
YumemoireFramework::Encyclopedia.monster_name.adjectives
|
|
467
|
+
$enemy_hp = $enemy_hp - damage
|
|
407
468
|
|
|
408
|
-
|
|
469
|
+
puts "\e[38;2;187;127;118mSister Chaos has attacked Sister Order for full damage.\e[0m"
|
|
409
470
|
|
|
410
|
-
|
|
411
|
-
|
|
471
|
+
sleep(1.5)
|
|
472
|
+
elsif roll_dice == 'critical'
|
|
473
|
+
damage = $player_atk * 2
|
|
412
474
|
|
|
413
|
-
|
|
414
|
-
system("clear")
|
|
475
|
+
$enemy_hp = $enemy_hp - damage
|
|
415
476
|
|
|
416
|
-
|
|
477
|
+
puts "\e[38;2;187;127;118mSister Chaos has attacked Sister Order for double damage.\e[0m"
|
|
417
478
|
|
|
418
|
-
|
|
479
|
+
sleep(1.5)
|
|
480
|
+
elsif roll_dice == 'half_damage'
|
|
481
|
+
damage = $player_atk / 2
|
|
419
482
|
|
|
420
|
-
|
|
421
|
-
"[Cochonbuta]", "[Ursinehomme]",
|
|
422
|
-
"[Ursinepiros]", "[Kumabatto]",
|
|
423
|
-
"[The Quantumcrusafied]",
|
|
424
|
-
]
|
|
483
|
+
$enemy_hp = $enemy_hp - damage
|
|
425
484
|
|
|
426
|
-
|
|
485
|
+
puts "\e[38;2;187;127;118mSister Chaos has attacked Sister Order for half damage.\e[0m"
|
|
427
486
|
|
|
428
|
-
|
|
429
|
-
elsif
|
|
430
|
-
|
|
431
|
-
elsif do_beast == "Kumabatto"; print available_beasts[3]; puts " A condensed version of 'Le Kumabatto De Les Ghoules', is the king of the bear-bat ghouls."
|
|
432
|
-
elsif do_beast == "The Quantumcrusafied"; print available_beasts[4]; puts " The wandering spirits of men punished for quantum treason by quantum crusafiction."
|
|
433
|
-
else
|
|
434
|
-
puts ">> Not such beast exists on land or sea..."
|
|
435
|
-
end
|
|
487
|
+
sleep(1.5)
|
|
488
|
+
elsif roll_dice == 'missed'
|
|
489
|
+
puts "\e[38;2;187;127;118mSister Chaos has missed Sister Order.\e[0m"
|
|
436
490
|
|
|
437
|
-
|
|
491
|
+
sleep(1.5)
|
|
492
|
+
end
|
|
438
493
|
end
|
|
439
494
|
|
|
440
|
-
def
|
|
441
|
-
|
|
495
|
+
def enemy_damage_rate
|
|
496
|
+
#set_player_stats
|
|
497
|
+
#set_enemy_stats
|
|
442
498
|
|
|
443
|
-
|
|
499
|
+
def_dice = [ 'full_damage', 'half_damage', 'missed', 'critical' ]
|
|
444
500
|
|
|
445
|
-
|
|
501
|
+
roll_dice = def_dice.sample
|
|
446
502
|
|
|
447
|
-
|
|
503
|
+
if roll_dice == 'full_damage'
|
|
504
|
+
damage = $enemy_atk
|
|
448
505
|
|
|
449
|
-
|
|
450
|
-
puts "BOB >> This is the largest form of in game currency, and is not used in ordinary game mechanics. It is mainly used for giving offerings to the lunar goddess, or paying the fair for dimension hopping that will come in the tiles version."
|
|
506
|
+
$player_hp = $player_hp - damage
|
|
451
507
|
|
|
452
|
-
|
|
453
|
-
elsif research == "Yen"
|
|
454
|
-
puts "BOB >> The smallest form of in game currency, this is mainly used for smaller fair items."
|
|
508
|
+
puts "\e[38;2;187;127;118mSister Order has attacked Sister Chaos for full damage.\e[0m"
|
|
455
509
|
|
|
456
|
-
|
|
510
|
+
sleep(1.5)
|
|
511
|
+
elsif roll_dice == 'critical'
|
|
512
|
+
damage = $enemy_atk * 2
|
|
457
513
|
|
|
458
|
-
|
|
459
|
-
puts "BOB >> This is the largest form of in game currency within the scope of standard in game use. Once the tiles version of released, Lunario exists as travel currency."
|
|
514
|
+
$player_hp = $player_hp - damage
|
|
460
515
|
|
|
461
|
-
|
|
462
|
-
elsif research == "RPS"
|
|
463
|
-
puts "BOB >> RPS ia the ancronym for a form of games based on the mechanics of rock, paper, and scissors."
|
|
516
|
+
puts "\e[38;2;187;127;118mSister Order has attacked Sister Chaos for double damage.\e[0m"
|
|
464
517
|
|
|
465
|
-
|
|
466
|
-
elsif
|
|
467
|
-
|
|
468
|
-
|
|
518
|
+
sleep(1.5)
|
|
519
|
+
elsif roll_dice == 'half_damage'
|
|
520
|
+
damage = $enemy_atk / 2
|
|
521
|
+
|
|
522
|
+
$player_hp = $player_hp - damage
|
|
523
|
+
|
|
524
|
+
puts "\e[38;2;187;127;118mSister Order has attacked Sister Chaos for half damage.\e[0m"
|
|
525
|
+
|
|
526
|
+
sleep(1.5)
|
|
527
|
+
elsif roll_dice == 'missed'
|
|
528
|
+
puts "\e[38;2;187;127;118mSister Order has missed the Sister Chaos.\e[0m"
|
|
529
|
+
|
|
530
|
+
sleep(1.5)
|
|
469
531
|
end
|
|
470
532
|
end
|
|
533
|
+
end
|
|
534
|
+
end
|
|
471
535
|
|
|
472
|
-
|
|
473
|
-
|
|
536
|
+
#module YumemoireGribatomaton
|
|
537
|
+
# class Gribatomaton
|
|
538
|
+
# ###################################################################################
|
|
539
|
+
# # Upgrades For Pet Spider #
|
|
540
|
+
# ###################################################################################
|
|
541
|
+
# def self.level_one_spider
|
|
542
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
543
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
544
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
545
|
+
# end
|
|
546
|
+
#
|
|
547
|
+
# def self.level_two_spider
|
|
548
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
549
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
550
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
551
|
+
#
|
|
552
|
+
# File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
553
|
+
# $spider_hp = $spider_hp + 3
|
|
554
|
+
#
|
|
555
|
+
# f.puts $spider_hp
|
|
556
|
+
# }
|
|
557
|
+
#
|
|
558
|
+
# File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
559
|
+
# $spider_atk = $spider_atk + 3
|
|
560
|
+
#
|
|
561
|
+
# f.puts $spider_atk
|
|
562
|
+
# }
|
|
563
|
+
#
|
|
564
|
+
# File.open("pet_stats/spider_heal.txt", "w") { |f|
|
|
565
|
+
# $spider_heal = $spider_heal + 3
|
|
566
|
+
#
|
|
567
|
+
# f.puts $spider_heal
|
|
568
|
+
# }
|
|
569
|
+
# end
|
|
570
|
+
#
|
|
571
|
+
# def self.level_three_spider
|
|
572
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
573
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
574
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
575
|
+
#
|
|
576
|
+
# File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
577
|
+
# $spider_hp = $spider_hp + 5
|
|
578
|
+
#
|
|
579
|
+
# f.puts $spider_hp
|
|
580
|
+
# }
|
|
581
|
+
#
|
|
582
|
+
# File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
583
|
+
# $spider_atk = $spider_atk + 5
|
|
584
|
+
#
|
|
585
|
+
# f.puts $spider_atk
|
|
586
|
+
# }
|
|
587
|
+
#
|
|
588
|
+
# File.open("pet_stats/spider_heal.txt", "w") { |f|
|
|
589
|
+
# $spider_heal = $spider_heal + 5
|
|
590
|
+
#
|
|
591
|
+
# f.puts $spider_heal
|
|
592
|
+
# }
|
|
593
|
+
# end
|
|
594
|
+
#
|
|
595
|
+
# def self.level_four_spider
|
|
596
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
597
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
598
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
599
|
+
#
|
|
600
|
+
# File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
601
|
+
# $spider_hp = $spider_hp + 7
|
|
602
|
+
#
|
|
603
|
+
# f.puts $spider_hp
|
|
604
|
+
# }
|
|
605
|
+
#
|
|
606
|
+
# File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
607
|
+
# $spider_atk = $spider_atk + 7
|
|
608
|
+
#
|
|
609
|
+
# f.puts $spider_atk
|
|
610
|
+
# }
|
|
611
|
+
#
|
|
612
|
+
# File.open("pet_stats/spider_heal.txt", "w") { |f|
|
|
613
|
+
# $spider_heal = $spider_heal + 7
|
|
614
|
+
#
|
|
615
|
+
# f.puts $spider_heal
|
|
616
|
+
# }
|
|
617
|
+
# end
|
|
618
|
+
#
|
|
619
|
+
# def self.level_five_spider
|
|
620
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
621
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
622
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
623
|
+
#
|
|
624
|
+
# File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
625
|
+
# $spider_hp = $spider_hp + 9
|
|
626
|
+
#
|
|
627
|
+
# f.puts $spider_hp
|
|
628
|
+
# }
|
|
629
|
+
#
|
|
630
|
+
# File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
631
|
+
# $spider_atk = $spider_atk + 9
|
|
632
|
+
#
|
|
633
|
+
# f.puts $spider_atk
|
|
634
|
+
# }
|
|
635
|
+
#
|
|
636
|
+
# File.open("pet_stats/spider_heal.txt", "w") { |f|
|
|
637
|
+
# $spider_heal = $spider_heal + 9
|
|
638
|
+
#
|
|
639
|
+
# f.puts $spider_heal
|
|
640
|
+
# }
|
|
641
|
+
# end
|
|
642
|
+
#
|
|
643
|
+
# def self.level_six_spider
|
|
644
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
645
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
646
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
647
|
+
#
|
|
648
|
+
# File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
649
|
+
# $spider_hp = $spider_hp + 11
|
|
650
|
+
#
|
|
651
|
+
# f.puts $spider_hp
|
|
652
|
+
# }
|
|
653
|
+
#
|
|
654
|
+
# File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
655
|
+
# $spider_atk = $spider_atk + 11
|
|
656
|
+
#
|
|
657
|
+
# f.puts $spider_atk
|
|
658
|
+
# }
|
|
659
|
+
#
|
|
660
|
+
# File.open("pet_stats/spider_heal.txt", "w") { |f|
|
|
661
|
+
# $spider_heal = $spider_heal + 11
|
|
662
|
+
#
|
|
663
|
+
# f.puts $spider_heal
|
|
664
|
+
# }
|
|
665
|
+
# end
|
|
666
|
+
#
|
|
667
|
+
# def self.level_seven_spider
|
|
668
|
+
# $spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
669
|
+
# $spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
670
|
+
# $spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
671
|
+
#
|
|
672
|
+
# File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
673
|
+
# $spider_hp = $spider_hp + 13
|
|
674
|
+
#
|
|
675
|
+
# f.puts $spider_hp
|
|
676
|
+
# }
|
|
677
|
+
#
|
|
678
|
+
# File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
679
|
+
# $spider_atk = $spider_atk + 13
|
|
680
|
+
#
|
|
681
|
+
# f.puts $spider_atk
|
|
682
|
+
# }
|
|
683
|
+
#
|
|
684
|
+
# File.open("pet_stats/spider_heal.txt", "w") { |f|
|
|
685
|
+
# $spider_heal = $spider_heal + 13
|
|
686
|
+
#
|
|
687
|
+
# f.puts $spider_heal
|
|
688
|
+
# }
|
|
689
|
+
# end
|
|
690
|
+
#
|
|
691
|
+
# #####################################################################################################
|
|
692
|
+
# # Main Pet Spider Functionality #
|
|
693
|
+
# #####################################################################################################
|
|
694
|
+
# def self.enemy_spotted
|
|
695
|
+
# # Determines if your pet spider pig has seen the enemy.
|
|
696
|
+
# enemy_event = File.readlines("enemies/enemies_spotted/spot_enemy.txt")
|
|
697
|
+
# enemy_event_toggle = File.read("enemies/enemies_toggle/toggle_enemies.txt").strip.to_i
|
|
698
|
+
# enemy_spotted = enemy_event[enemy_event_toggle]
|
|
699
|
+
#
|
|
700
|
+
# if enemy_spotted == true
|
|
701
|
+
# $enemy_hp = $enemy_hp - $spider_atk
|
|
702
|
+
#
|
|
703
|
+
# puts ">> Your pet spider pig spotted #{enemy_spotted}, and was attacked by your pet spider pig..."
|
|
704
|
+
# else
|
|
705
|
+
# puts ">> Your pet spider pig hasn't spotted the enemy..."
|
|
706
|
+
# end
|
|
707
|
+
# end
|
|
708
|
+
#
|
|
709
|
+
# # A list of all possible nevigations, behaviours, and noises.
|
|
710
|
+
# #def self.navigation
|
|
711
|
+
# # navigation_x = File.readlines("lifeform/aspects/navigation_x.txt")
|
|
712
|
+
# # navigation_y = File.readlines("lifeform/aspects/navigation_y.txt")
|
|
713
|
+
# #
|
|
714
|
+
# # navigational_ai = File.read("ainput/navigation/input.txt")
|
|
715
|
+
# #
|
|
716
|
+
# # if navigation_x[navigational_ai_x] == player_x and navigation_y[navigational_ai_y] == player_y
|
|
717
|
+
# # puts ">> Your pet spider pig moved in the direction of your player for ear scratches."
|
|
718
|
+
# #
|
|
719
|
+
# # enemy_spotted
|
|
720
|
+
# # else
|
|
721
|
+
# # puts ">> Your pet spider pig stays where its at sitting on its eight legs..."
|
|
722
|
+
# # end
|
|
723
|
+
# #end
|
|
724
|
+
#
|
|
725
|
+
# def self.behaviours
|
|
726
|
+
# behaviours = File.readlines("lifeform/aspects/behaviours.txt")
|
|
727
|
+
# behaviours_ai = File.read("ainput/behaviours/input.txt").strip.to_i
|
|
728
|
+
#
|
|
729
|
+
# current_behavours = behaviours[behaviours_ai]
|
|
730
|
+
#
|
|
731
|
+
# if current_behaviours == "Spins spidersilk..."
|
|
732
|
+
# puts ">> Your pet spider pig spins some spidersilk..."
|
|
733
|
+
# elsif current_behaviours == "Bites the player..."
|
|
734
|
+
# puts ">> Your pet spider bites the player affectionately..."
|
|
735
|
+
#
|
|
736
|
+
# sleep(1.5)
|
|
737
|
+
#
|
|
738
|
+
# system("ruby rockpaperzombie.rb")
|
|
739
|
+
# end
|
|
740
|
+
# end
|
|
741
|
+
#
|
|
742
|
+
# def self.pet_noises
|
|
743
|
+
# noises = File.readlines("lifeform/aspects/noises.txt")
|
|
744
|
+
# noises_ai = File.read("ainput/noises/input.txt").strip.to_i
|
|
745
|
+
# current_noises = noises[noises_ai]
|
|
746
|
+
#
|
|
747
|
+
# elsif current_noises == "Hisses like a spider..."
|
|
748
|
+
# puts ">> Your pet spider pig hisses like a spider..."
|
|
749
|
+
# elsif current_noises == "Oinks like a baby pig..."
|
|
750
|
+
# puts ">> Your pet spider pig oinks like a baby pig..."
|
|
751
|
+
# end
|
|
752
|
+
# end
|
|
753
|
+
#
|
|
754
|
+
# def self.spider_damage_formula
|
|
755
|
+
# #Switch to routine determine damage rate.
|
|
756
|
+
# healing_accuracy = {
|
|
757
|
+
# "enemy" => "gribatomaton",
|
|
758
|
+
# "gribatomaton" => "player",
|
|
759
|
+
# "player" => "enemy",
|
|
760
|
+
# }
|
|
761
|
+
#
|
|
762
|
+
# @cchoice_healing_options = [ "enemy", "gribatomaton", "player" ]
|
|
763
|
+
#
|
|
764
|
+
# @landed_choice = @cchoice_healing_options.sample
|
|
765
|
+
#
|
|
766
|
+
# if @cchoice_chosen_healing == "enemy"; # Enemy damages the spider.
|
|
767
|
+
# # Enemy launches its counter attack.
|
|
768
|
+
# elsif @cchoice_chosen_healing == "gribatomaton"; # Spider damages the enemy.
|
|
769
|
+
# # Spider successfully damages the enemy.
|
|
770
|
+
# elsif @cchoice_chosen_healing == "player"; # Enemy damages the plauer.
|
|
771
|
+
# # Player counter attacks the enemy.
|
|
772
|
+
# end
|
|
773
|
+
# end
|
|
774
|
+
#
|
|
775
|
+
# def self.enemy_damage_formula
|
|
776
|
+
# #Switch to routine determine damage rate.
|
|
777
|
+
#
|
|
778
|
+
# @cchoice_healing_options = [ "enemy", "gribatomaton", "player" ]
|
|
779
|
+
#
|
|
780
|
+
# @landed_choice = @cchoice_healing_options.sample
|
|
781
|
+
#
|
|
782
|
+
# if @cchoice_chosen_healing == "enemy"; # Enemy is damaged by the spider.
|
|
783
|
+
# # Counterattack for spider.
|
|
784
|
+
# elsif @cchoice_chosen_healing == "gribatomaton"; # Spider is damaged the enemy.
|
|
785
|
+
# # Enemey successfully damages the spider.
|
|
786
|
+
# elsif @cchoice_chosen_healing == "player"; # Enemy is damaged by the player...
|
|
787
|
+
# # Counterattack by the player.
|
|
788
|
+
# end
|
|
789
|
+
# end
|
|
790
|
+
#
|
|
791
|
+
# def self.spider_pig_farmer
|
|
792
|
+
# monster_form = {
|
|
793
|
+
# "spider" => "pig",
|
|
794
|
+
# "pig" => "farmer",
|
|
795
|
+
# "farmer" => "spider",
|
|
796
|
+
# }
|
|
797
|
+
#
|
|
798
|
+
# print "[ Spider, Pig, Farmer ] >> "
|
|
799
|
+
# @spider_choices = ["spider", "pig", "farmer"]
|
|
800
|
+
# @choice = @spider_choices.sample
|
|
801
|
+
#
|
|
802
|
+
# @cchoices = ["spider", "pig", "farmer"]
|
|
803
|
+
# @cchoice = @cchoices.sample
|
|
804
|
+
#
|
|
805
|
+
# if monster_form[@cchoice] == @choice
|
|
806
|
+
# puts "Spider managed to prevent enemy from harming the player."
|
|
807
|
+
#
|
|
808
|
+
# spider_damage_formula
|
|
809
|
+
# elsif monster_form[@choice] == @choice # Spider prevents attacking of player altogether.
|
|
810
|
+
# puts "Spider managed to prevent enemy from harming the player."
|
|
811
|
+
#
|
|
812
|
+
# sleep(1.5)
|
|
813
|
+
# elsif @choice == @cchoice
|
|
814
|
+
# enemy_damage_formula
|
|
815
|
+
# else
|
|
816
|
+
# puts "Process was not understood..."
|
|
817
|
+
# end
|
|
818
|
+
# end
|
|
819
|
+
# end
|
|
820
|
+
#end
|
|
474
821
|
|
|
475
|
-
|
|
476
|
-
|
|
822
|
+
module YumemoireSpatialRelationships
|
|
823
|
+
class Error < StandardError; end
|
|
477
824
|
|
|
478
|
-
|
|
479
|
-
## Word Classes
|
|
825
|
+
class Static_Perimeters
|
|
480
826
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
827
|
+
# The objects within the space.
|
|
828
|
+
def self.positive_perimeters
|
|
829
|
+
# Base radius of static objects.
|
|
830
|
+
base_radius = 2500
|
|
831
|
+
|
|
832
|
+
# Specfic multipliers for Earth index based objects.
|
|
833
|
+
base_two = 2
|
|
834
|
+
base_fro = 4
|
|
835
|
+
base_six = 6
|
|
836
|
+
base_eit = 8
|
|
837
|
+
|
|
838
|
+
# Size of specific objects.
|
|
839
|
+
size_of_planets = base_radius ** base_fro
|
|
840
|
+
size_of_moons = base_radius ** base_two
|
|
841
|
+
size_of_stars = base_radius ** base_six
|
|
842
|
+
size_of_blackholes = base_radius ** base_eit
|
|
843
|
+
|
|
844
|
+
# Total output sizes of specific objects.
|
|
845
|
+
puts "The size of the planets is #{size_of_planets} radius."; sleep(3)
|
|
846
|
+
puts "The size of the moons is #{size_of_moons} radius."; sleep(3)
|
|
847
|
+
puts "The size of the stars is #{size_of_stars} radius."; sleep(3)
|
|
848
|
+
puts "The size of a blackhole is #{size_of_blackholes} radius."; sleep(3)
|
|
849
|
+
end
|
|
850
|
+
|
|
851
|
+
# Space between the objects.
|
|
852
|
+
def self.negative_perimeters
|
|
853
|
+
# Base distance between objects.
|
|
854
|
+
base_distance = 1_000_000_000
|
|
855
|
+
|
|
856
|
+
# Estimated divider between specific objects to base distance.
|
|
857
|
+
space_between_planets = 43.8
|
|
858
|
+
space_between_moons = 14.6
|
|
859
|
+
space_between_stars = 876
|
|
860
|
+
space_between_blackholes = 2628
|
|
861
|
+
|
|
862
|
+
# Minimum distance between objects.
|
|
863
|
+
planet_distance = base_distance / space_between_planets
|
|
864
|
+
moon_distance = base_distance / space_between_moons
|
|
865
|
+
star_distance = base_distance / space_between_stars
|
|
866
|
+
blackhole_distance = base_distance / space_between_blackholes
|
|
867
|
+
|
|
868
|
+
# Actual distance between objects
|
|
869
|
+
actual_planets = planet_distance * 10
|
|
870
|
+
actual_moons = moon_distance * 10
|
|
871
|
+
actual_stars = star_distance * 10
|
|
872
|
+
actual_blackholes = blackhole_distance * 10
|
|
873
|
+
|
|
874
|
+
# The output results of distance between objects.
|
|
875
|
+
puts "The distance between planets is #{actual_planets} miles."; sleep(3)
|
|
876
|
+
puts "The distance between moons is #{actual_moons} miles."; sleep(3)
|
|
877
|
+
puts "The distance between stars is #{actual_stars} miles."; sleep(3)
|
|
878
|
+
puts "The distance between blackholes is #{actual_blackholes} miles."; sleep(3)
|
|
879
|
+
end
|
|
880
|
+
|
|
881
|
+
end
|
|
488
882
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
"Ana" => "The ( Feminine ) [ Pseudo-Japonic ]",
|
|
492
|
-
"Anos" => "The ( Plural ) [ Pseudo-Japonic ]",
|
|
493
|
-
"Tu" => "A [ Pseudo-Japonic ]",
|
|
494
|
-
"Ta" => "An [ Pseudo-Japonic ]",
|
|
495
|
-
"Tos" => "Some [ Pseudo-Japaonic ]",
|
|
883
|
+
# Changing perimeters
|
|
884
|
+
class Dynamic_Perimeters
|
|
496
885
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
886
|
+
# The objects within the space.
|
|
887
|
+
def self.positive_perimeters
|
|
888
|
+
spaceship = File.read("_data/dynamic/positive_perimeters/spaceship_size.txt").strip.to_i
|
|
889
|
+
space_station = spaceship * 200
|
|
890
|
+
satalite = space_station / 10
|
|
891
|
+
|
|
892
|
+
puts "The total size of the space shuttle is #{spaceship} feet."; sleep(3)
|
|
893
|
+
puts "The total size of the space station is #{space_station} feet."; sleep(3)
|
|
894
|
+
puts "The total size of the satalite is #{satalite} feet."; sleep(3)
|
|
895
|
+
end
|
|
896
|
+
|
|
897
|
+
# Space between the objects.
|
|
898
|
+
def self.negative_perimeters
|
|
899
|
+
base_multiplier = 10
|
|
900
|
+
|
|
901
|
+
# Minimum space between objects.
|
|
902
|
+
space_between_spaceships = File.read("_data/dynamic/negative_perimeters/space_between_spaceships.txt").strip.to_i
|
|
903
|
+
space_between_station = File.read("_data/dynamic/negative_perimeters/space_between_station.txt").strip.to_i
|
|
904
|
+
space_between_satalite = File.read("_data/dynamic/negative_perimeters/space_between_satalite.txt").strip.to_i
|
|
905
|
+
|
|
906
|
+
# Actual space between objects
|
|
907
|
+
actual_spaceship_distance = space_between_spaceships * base_multiplier
|
|
908
|
+
actual_station_distance = space_between_station * base_multiplier
|
|
909
|
+
actual_satalite_distance = space_between_satalite * base_multiplier
|
|
910
|
+
|
|
911
|
+
puts "The minimum space between shuttles is #{actual_spaceship_distance} feet."; sleep(3)
|
|
912
|
+
puts "The minimum space between stations is #{actual_station_distance} feet."; sleep(3)
|
|
913
|
+
puts "The minimum space between satalites is #{actual_satalite_distance} feet."; sleep(3)
|
|
914
|
+
end
|
|
503
915
|
|
|
504
|
-
|
|
505
|
-
"Lanu" => "The ( masculine ) [ Ahusacos Specific ]",
|
|
506
|
-
"Lana" => "The ( feminine ) [ Ahusacos Specific ]",
|
|
507
|
-
"Lanos" => "The ( plural ) [ Ahusacos Specific ]",
|
|
508
|
-
"Tun" => "A [ Ahusacos Specific ]",
|
|
509
|
-
"Tan" => "An [ Ahusacos Specific ]",
|
|
510
|
-
"Deso" => "It / Some [ Ahusacos Specific ]",
|
|
916
|
+
end
|
|
511
917
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
"Nix " => "Not [ Hybrid ]",
|
|
516
|
-
"Nein" => "Not [ Germanic ]",
|
|
918
|
+
class SpatialEvaluator
|
|
919
|
+
def self.evaluate_body
|
|
920
|
+
require "naive_bayes"
|
|
517
921
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
922
|
+
spatial = NaiveBayes.new(:planet_radius,
|
|
923
|
+
:moon_radius,
|
|
924
|
+
:star_radius,
|
|
925
|
+
:blackhole_radius,
|
|
926
|
+
:distance_between_planets,
|
|
927
|
+
:distance_between_moons,
|
|
928
|
+
:distance_between_stars,
|
|
929
|
+
:distance_between_blackholes,
|
|
930
|
+
:spaceshuttle_size,
|
|
931
|
+
:spacestation_size,
|
|
932
|
+
:size_of_satalight,
|
|
933
|
+
:minimum_space_between_shuttles,
|
|
934
|
+
:minimum_space_between_stations,
|
|
935
|
+
:minimum_space_between_satalights,
|
|
936
|
+
)
|
|
937
|
+
|
|
938
|
+
spatial.train(:planet_radius, "The size of the planets is 39062500000000 radius.", "word")
|
|
939
|
+
spatial.train(:moon_radius, "The size of the moons is 6250000 radius.", "word")
|
|
940
|
+
spatial.train(:star_radius, "The size of the stars is 244140625000000000000 radius.", "word")
|
|
941
|
+
spatial.train(:blackhole_radius, "The size of a blackhole is 1525878906250000000000000000 radius.", "word")
|
|
942
|
+
spatial.train(:distance_between_planets, "The distance between planets is 228310502.28310502 miles.", "word")
|
|
943
|
+
spatial.train(:distance_between_moons, "The distance between moons is 684931506.849315 miles.", "word")
|
|
944
|
+
spatial.train(:distance_between_stars, "The distance between stars is 11415520 miles.", "word")
|
|
945
|
+
spatial.train(:distance_between_blackholes, "The distance between blackholes is 3805170 miles.", "word")
|
|
946
|
+
spatial.train(:spaceshuttle_size, "The total size of the space shuttle is 5 feet.", "word")
|
|
947
|
+
spatial.train(:spacestation_size, "The total size of the space station is 1000 feet.", "word")
|
|
948
|
+
spatial.train(:size_of_satalight, "The total size of the satalite is 100 feet.", "word")
|
|
949
|
+
spatial.train(:minimum_space_between_shuttles, "The minimum space between shuttles is 50 feet.", "word")
|
|
950
|
+
spatial.train(:minimum_space_between_stations, "The minimum space between stations is 50 feet.", "word")
|
|
951
|
+
spatial.train(:minimum_space_between_satalights, "The minimum space between satalites is 50 feet.", "word")
|
|
952
|
+
|
|
953
|
+
spatial_relationships = File.readlines("_input/relationships.txt")
|
|
536
954
|
|
|
537
|
-
|
|
538
|
-
## In practice, right-wing factions use the wrong plural pronoun to misgender entire units
|
|
539
|
-
## as a way to lower moral of left-wing factions. Because of this, after the Franco-Japanese
|
|
540
|
-
## Wars, they stopped being used widely.
|
|
955
|
+
size_limit = spatial_relationships.size.to_i
|
|
541
956
|
|
|
542
|
-
|
|
543
|
-
"Nousil" => "He plural",
|
|
544
|
-
"Nousils" => "Him plural",
|
|
545
|
-
"Nouselle" => "She plural",
|
|
546
|
-
"Nouselles" => "Her plural",
|
|
957
|
+
index = 0
|
|
547
958
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
959
|
+
size_limit.times do
|
|
960
|
+
classification = spatial.classify(spatial_relationships[index].strip.to_s)
|
|
961
|
+
|
|
962
|
+
print classification
|
|
963
|
+
puts " "
|
|
553
964
|
|
|
554
|
-
|
|
965
|
+
index = index + 1
|
|
966
|
+
end
|
|
967
|
+
end
|
|
555
968
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
"Mere" => "Mother",
|
|
559
|
-
"Frere" => "Brother",
|
|
560
|
-
"Soeur" => "Sister",
|
|
561
|
-
"Cousifrere" => "Male Cousin",
|
|
562
|
-
"Cousisoeur" => "Female Cousin",
|
|
563
|
-
"Cousiles" => "Both Cousins",
|
|
564
|
-
"Tante" => "Aunt",
|
|
565
|
-
"Oncle" => "Uncle",
|
|
969
|
+
end
|
|
970
|
+
end
|
|
566
971
|
|
|
567
|
-
|
|
568
|
-
# These colors are for a system that rates colors based on their acidity or alkalinity.
|
|
972
|
+
module YumemoireBezerkerMode
|
|
569
973
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
974
|
+
class BezerkerMode
|
|
975
|
+
###############################################################################################
|
|
976
|
+
# AI Decision Making #
|
|
977
|
+
###############################################################################################
|
|
978
|
+
def self.ai_decision
|
|
979
|
+
cchoice = @choice
|
|
574
980
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
"PH8WE1" => "Japanese Bistre",
|
|
981
|
+
## Determining user data and user choice.
|
|
982
|
+
value = File.read("lib/input/user/user_choice.txt").to_s.to_i
|
|
578
983
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
"PH5DR2" => "Khaki",
|
|
582
|
-
"PH6DR3" => "Bland",
|
|
984
|
+
user_data = File.readlines("lib/data/user/candidates.txt")
|
|
985
|
+
user_choice = user_data[value]
|
|
583
986
|
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
"PH8WE2" => "Kelly Green",
|
|
987
|
+
## Processing AI focused data
|
|
988
|
+
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
989
|
+
ai_initial_candidate = user_data[ai_choice]
|
|
990
|
+
ai_search_limit = user_data.size.to_i
|
|
589
991
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
"PH8WE3" => "Dark Sapphire",
|
|
595
|
-
"PH7NU3" => "Grey Blue",
|
|
992
|
+
## Create AI data from user data.
|
|
993
|
+
ai_search_limit.times do
|
|
994
|
+
if ai_choice == user_choice
|
|
995
|
+
#puts "\e[38;2;187;127;118m The specific candidate was found. Terminating selection..."
|
|
596
996
|
|
|
597
|
-
|
|
598
|
-
"PH9WE1" => "Dull Purple",
|
|
599
|
-
"PH5DR3" => "Light Mauve",
|
|
997
|
+
ai_data = user_data.slice!(ai_choice)
|
|
600
998
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
999
|
+
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
1000
|
+
f.puts ai_data
|
|
1001
|
+
}
|
|
1002
|
+
else
|
|
1003
|
+
puts "\e[38;2;187;127;118mL'ennemi découvre que vous n'avez pas fait ce choix...\e[0m"
|
|
1004
|
+
end
|
|
605
1005
|
|
|
606
|
-
|
|
607
|
-
|
|
1006
|
+
sleep(1.5)
|
|
1007
|
+
end
|
|
608
1008
|
|
|
609
|
-
|
|
610
|
-
|
|
1009
|
+
## AI processing data.
|
|
1010
|
+
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
1011
|
+
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
1012
|
+
ai_search_limit = ai_data.size.to_i
|
|
1013
|
+
ai_next_candidate = ai_data[ai_choice]
|
|
611
1014
|
|
|
612
|
-
|
|
613
|
-
|
|
1015
|
+
ai_search_limit.times do
|
|
1016
|
+
if ai_next_candidate == user_choice
|
|
1017
|
+
ai_final_candidate = ai_next_candidate
|
|
1018
|
+
|
|
1019
|
+
puts "\e[38;2;187;127;118mCandidate found, processing input...\e[0m"; sleep(1)
|
|
614
1020
|
|
|
615
|
-
|
|
616
|
-
"#A9A8AD" => "Faded Carolina Blue", # Pale Lime, Salmon Pink, Bland, Grey Blue [ Hypothesis Acidic Blue ]
|
|
617
|
-
"#A0A5B9" => "Manilla Lavender", # Salmon, Pale Salmon, Grey Blue, Grey Blue [ Hypothesis Slightly Alkaline Grey Blue ]
|
|
618
|
-
"#8cc874" => "Asparagus", # Pale Lime, Maize, Light Mauve, Medium Green [ Hypothesis Alkaline Green ]
|
|
619
|
-
"#a0b36c" => "Tan Green", # Pale Salmon, Kelly Green, Bland, Khaki [ Hypothesis Slightly Tan Green ]
|
|
620
|
-
"#5673A9" => "Dusky Blue", # Grey Blue, Light Mauve, Khaki, Sapphire [ Hypothesis Highly Alkaline Blue ]
|
|
621
|
-
"#A59C94" => "Warm Grey", # Vibrant Green, Salmon, Sapphire Dark, Bland [ Hypothesis Slightly Acidic Grey ]
|
|
1021
|
+
# Breaks the loop if an appropriate candidate is found.
|
|
622
1022
|
|
|
623
|
-
|
|
624
|
-
"#788a9a" => "Steel", # Faded Carolina Blue, Tan Green, Warm Grey, Dusky Blue [ Hypothesis Slightly Alkaline Medium Chromatic Blue ]
|
|
625
|
-
"#415588" => "Dusky Blue Medium" # Genetically related to standard Dusky blue. Faded Carolina Blue, Tan Green, Warm Grey, Dusky Blue [ Hypothesis More Shaded Alkaline Blue ]
|
|
626
|
-
}
|
|
1023
|
+
sleep(1.5)
|
|
627
1024
|
|
|
628
|
-
|
|
629
|
-
print "#{translate} => #{dictionary[translate]}"
|
|
630
|
-
puts " "
|
|
1025
|
+
conditions = ["Sword", "Stone", "Tarp"]
|
|
631
1026
|
|
|
632
|
-
|
|
633
|
-
end
|
|
1027
|
+
decision_made = conditions.sample
|
|
634
1028
|
|
|
635
|
-
|
|
636
|
-
color_data = File.read("translation/input.txt").strip.to_s
|
|
1029
|
+
puts "\e[38;2;187;127;118mBy process of elimination, the bot chose: #{ai_data}\e[0m"
|
|
637
1030
|
|
|
638
|
-
|
|
639
|
-
if color_data == "Salmon"; sleep(1.5); system("./salmonbasic.sh")
|
|
640
|
-
elsif color_data == "Pale Salmon"; sleep(1.5); system("./palesalmon.sh")
|
|
641
|
-
elsif color_data == "Salmon Pink"; sleep(1.5); system("./salmonpink.sh")
|
|
642
|
-
elsif color_data == "Copper"; sleep(1.5); system("./cooper.sh")
|
|
643
|
-
elsif color_data == "Japanese Bistre"; sleep(1.5); system("./japanesebistre.sh")
|
|
644
|
-
elsif color_data == "Maize"; sleep(1.5); system("./maize.sh")
|
|
645
|
-
elsif color_data == "Khaki"; sleep(1.5); system("./khaki.sh")
|
|
646
|
-
elsif color_data == "Bland"; sleep(1.5); system("./bland.sh")
|
|
647
|
-
elsif color_data == "Pale Lime"; sleep(1.5); system("./palelime.sh")
|
|
648
|
-
elsif color_data == "Vibrant Green"; sleep(1.5); system("./vibrantgreen.sh")
|
|
649
|
-
elsif color_data == "Medium Green"; sleep(1.5); system("./mediuemgreen.sh")
|
|
650
|
-
elsif color_data == "Kelly Green"; sleep(1.5); system("./kellygreen.sh")
|
|
651
|
-
elsif color_data == "Viridian"; sleep(1.5); system("./viridian.sh")
|
|
652
|
-
elsif color_data == "Ultramarine"; sleep(1.5); system("./ultramarine.sh")
|
|
653
|
-
elsif color_data == "Muted Sapphire"; sleep(1.5); system("./mutedsapphire.sh")
|
|
654
|
-
elsif color_data == "Dark Sapphire"; sleep(1.5); system("./darksapphire.sh")
|
|
655
|
-
elsif color_data == "Grey Blue"; sleep(1.5); system("./greyblue.sh")
|
|
656
|
-
elsif color_data == "Dull Purple"; sleep(1.5); system("./dullpurple.sh")
|
|
657
|
-
elsif color_data == "Light Mauve"; sleep(1.5); system("./lightmauve.sh")
|
|
658
|
-
elsif color_data == "Dark Lavender"; sleep(1.5); system("./darklavender.sh")
|
|
659
|
-
elsif color_data == "Atomic Hazel"; sleep(1.5); system("./atomichazel.sh")
|
|
1031
|
+
@cchoice = "#{ai_data}"
|
|
660
1032
|
|
|
661
|
-
|
|
662
|
-
elsif color_data == "Faded Carolina Blue"; sleep(1.5); system("./fadedcarolinablue.sh")
|
|
663
|
-
elsif color_data == "Dusky Blue"; sleep(1.5); system("./duskyblue.sh")
|
|
1033
|
+
puts $cchoice
|
|
664
1034
|
|
|
665
|
-
|
|
1035
|
+
break
|
|
1036
|
+
else
|
|
1037
|
+
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
1038
|
+
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
1039
|
+
ai_search_limit = ai_data.size.to_i
|
|
1040
|
+
ai_next_candidate = ai_data[ai_choice]
|
|
666
1041
|
|
|
667
|
-
|
|
668
|
-
sleep(1.5)
|
|
1042
|
+
ai_data = user_data.slice!(ai_choice).strip
|
|
669
1043
|
|
|
670
|
-
|
|
671
|
-
end
|
|
672
|
-
end
|
|
673
|
-
end
|
|
1044
|
+
puts "\e[38;2;187;127;118mEnemy found the option #{ai_data}\e[0m"
|
|
674
1045
|
|
|
675
|
-
|
|
676
|
-
########################################################################################
|
|
677
|
-
# Damage Formulas For Players And Enemies #
|
|
678
|
-
########################################################################################
|
|
679
|
-
def player_damage_rate
|
|
680
|
-
#set_player_stats
|
|
681
|
-
#set_enemy_stats
|
|
1046
|
+
enemy_decision = ["choose", "skip"]
|
|
682
1047
|
|
|
683
|
-
|
|
1048
|
+
decision_made = enemy_decision.sample
|
|
684
1049
|
|
|
685
|
-
|
|
1050
|
+
if decision_made == "choose"
|
|
1051
|
+
puts "\e[38;2;187;127;118mThe enemy chose: #{ai_data}, but found it causes a stalemate. Makes a new decision\e[0m"
|
|
686
1052
|
|
|
687
|
-
|
|
688
|
-
damage = $player_atk
|
|
1053
|
+
@cchoice = "#{ai_data}"
|
|
689
1054
|
|
|
690
|
-
|
|
1055
|
+
enemy_decision = ["Epee", "Ishi", "Bache"]
|
|
691
1056
|
|
|
692
|
-
|
|
1057
|
+
decision_made = enemy_decision.sample
|
|
693
1058
|
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
1059
|
+
if decision_made == "Sword"
|
|
1060
|
+
@cchoice = "Epee"
|
|
1061
|
+
elsif decision_made == "Stone"
|
|
1062
|
+
@cchoice = "Ishi"
|
|
1063
|
+
elsif decision_made == "Tarp"
|
|
1064
|
+
@cchoice = "Bache"
|
|
1065
|
+
end
|
|
697
1066
|
|
|
698
|
-
|
|
1067
|
+
break
|
|
1068
|
+
else
|
|
1069
|
+
puts "\e[38;2;187;127;118mEnemy weighed the option of choosing #{ai_data}, but decided to skip its turn.\e[0m"
|
|
699
1070
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
sleep(1.5)
|
|
703
|
-
elsif roll_dice == 'half_damage'
|
|
704
|
-
damage = $player_atk / 2
|
|
705
|
-
|
|
706
|
-
$enemy_hp = $enemy_hp - damage
|
|
707
|
-
|
|
708
|
-
puts "\e[38;2;187;127;118mSister Chaos has attacked Sister Order for half damage.\e[0m"
|
|
709
|
-
|
|
710
|
-
sleep(1.5)
|
|
711
|
-
elsif roll_dice == 'missed'
|
|
712
|
-
puts "\e[38;2;187;127;118mSister Chaos has missed Sister Order.\e[0m"
|
|
1071
|
+
break
|
|
1072
|
+
end
|
|
713
1073
|
|
|
714
|
-
|
|
1074
|
+
sleep(1.5)
|
|
1075
|
+
|
|
1076
|
+
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
1077
|
+
f.puts ai_data
|
|
1078
|
+
}
|
|
1079
|
+
end
|
|
715
1080
|
end
|
|
716
1081
|
end
|
|
717
1082
|
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
roll_dice = def_dice.sample
|
|
1083
|
+
#############################################################################################
|
|
1084
|
+
# Standard methods for player autonomy in the game. #
|
|
1085
|
+
#############################################################################################
|
|
1086
|
+
def self.full_player_control
|
|
1087
|
+
#player_heal = $healing_rate
|
|
725
1088
|
|
|
726
|
-
|
|
727
|
-
damage = $enemy_atk
|
|
1089
|
+
# Loop for full player control
|
|
728
1090
|
|
|
729
|
-
|
|
1091
|
+
# Least damaging, yet most efficient healing and other maintence.
|
|
730
1092
|
|
|
731
|
-
|
|
1093
|
+
conditions = {
|
|
1094
|
+
"Epee" => "Ishi",
|
|
1095
|
+
"Ishi" => "Bache",
|
|
1096
|
+
"Bache" => "Epee",
|
|
1097
|
+
}
|
|
732
1098
|
|
|
733
|
-
|
|
734
|
-
elsif roll_dice == 'critical'
|
|
735
|
-
damage = $enemy_atk * 2
|
|
1099
|
+
bezerker_chance = ["autonomy", "autonomy", "autonomy", "autonomy"]
|
|
736
1100
|
|
|
737
|
-
|
|
1101
|
+
chance_of_bezerker = bezerker_chance.sample
|
|
738
1102
|
|
|
739
|
-
|
|
1103
|
+
if chance_of_bezerker == "autonomy"
|
|
1104
|
+
print "Player Choice >> "; @choice = gets.chomp
|
|
1105
|
+
else
|
|
1106
|
+
puts "Player lost control of the MC..."
|
|
740
1107
|
|
|
741
1108
|
sleep(1.5)
|
|
742
|
-
elsif roll_dice == 'half_damage'
|
|
743
|
-
damage = $enemy_atk / 2
|
|
744
1109
|
|
|
745
|
-
|
|
1110
|
+
@choice = File.readlines("lib/data/ai/player_patterns/observed_player_actions.txt").sample.strip.to_s
|
|
1111
|
+
end
|
|
746
1112
|
|
|
747
|
-
|
|
1113
|
+
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
748
1114
|
|
|
749
|
-
|
|
750
|
-
elsif roll_dice == 'missed'
|
|
751
|
-
puts "\e[38;2;187;127;118mSister Order has missed the Sister Chaos.\e[0m"
|
|
1115
|
+
puts "The enemy chose: #{@cchoice}"
|
|
752
1116
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
1117
|
+
if @choice == "Epee"
|
|
1118
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1119
|
+
f.puts "0"
|
|
1120
|
+
}
|
|
757
1121
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
def self.ai_decision
|
|
763
|
-
cchoice = @choice
|
|
1122
|
+
# Records a history of player actions.
|
|
1123
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1124
|
+
f.puts "0"
|
|
1125
|
+
}
|
|
764
1126
|
|
|
765
|
-
|
|
766
|
-
|
|
1127
|
+
# Allows enemey to learn about player patterns.
|
|
1128
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1129
|
+
f.puts "Epee"
|
|
1130
|
+
}
|
|
1131
|
+
elsif @choice == "Ishi"
|
|
1132
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1133
|
+
f.puts "1"
|
|
1134
|
+
}
|
|
767
1135
|
|
|
768
|
-
|
|
769
|
-
|
|
1136
|
+
# Records a history of player actions.
|
|
1137
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1138
|
+
f.puts "1"
|
|
1139
|
+
}
|
|
770
1140
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
1141
|
+
# Allows enemey to learn about player patterns.
|
|
1142
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1143
|
+
f.puts "Ishi"
|
|
1144
|
+
}
|
|
1145
|
+
elsif @choice == "Bache"
|
|
1146
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1147
|
+
f.puts "2"
|
|
1148
|
+
}
|
|
775
1149
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
1150
|
+
# Records a history of player actions.
|
|
1151
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1152
|
+
f.puts "2"
|
|
1153
|
+
}
|
|
780
1154
|
|
|
781
|
-
|
|
1155
|
+
# Allows enemey to learn about player patterns.
|
|
1156
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1157
|
+
f.puts "Bache"
|
|
1158
|
+
}
|
|
1159
|
+
elsif @choice == "Sleep"
|
|
1160
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1161
|
+
f.puts "2"
|
|
1162
|
+
}
|
|
782
1163
|
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
puts "\e[38;2;187;127;118mL'ennemi découvre que vous n'avez pas fait ce choix...\e[0m"
|
|
788
|
-
end
|
|
1164
|
+
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
1165
|
+
open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1166
|
+
f.puts "2"
|
|
1167
|
+
}
|
|
789
1168
|
|
|
790
|
-
|
|
1169
|
+
# Allows enemey to learn about player patterns.
|
|
1170
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1171
|
+
f.puts "Bache"
|
|
1172
|
+
}
|
|
791
1173
|
end
|
|
792
1174
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
796
|
-
ai_search_limit = ai_data.size.to_i
|
|
797
|
-
ai_next_candidate = ai_data[ai_choice]
|
|
1175
|
+
puts " "
|
|
1176
|
+
sleep(1.5)
|
|
798
1177
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
ai_final_candidate = ai_next_candidate
|
|
802
|
-
|
|
803
|
-
puts "\e[38;2;187;127;118mCandidate found, processing input...\e[0m"; sleep(1)
|
|
1178
|
+
# Experiment with using an enemy that learns from player's decisions.'
|
|
1179
|
+
YumemoireFramework::BezerkerMode.ai_decision
|
|
804
1180
|
|
|
805
|
-
|
|
1181
|
+
if conditions[@choice] == @cchoice
|
|
1182
|
+
puts "You were struck by the enemy!"
|
|
806
1183
|
|
|
807
|
-
|
|
1184
|
+
$player_struck = $player_struck + 1
|
|
808
1185
|
|
|
809
|
-
|
|
1186
|
+
# The amount of damage player gets is based on the enemies attack power.
|
|
1187
|
+
#$player_hp = $player_hp - $enemy_atk
|
|
1188
|
+
enemy_damage_rate
|
|
1189
|
+
elsif @cchoice == @choice
|
|
1190
|
+
puts "You reach a stalemate."
|
|
810
1191
|
|
|
811
|
-
|
|
1192
|
+
$stalemates = $stalemates + 1
|
|
1193
|
+
elsif conditions[@cchoice] == @choice
|
|
1194
|
+
puts "You struck the enemy!"
|
|
812
1195
|
|
|
813
|
-
|
|
1196
|
+
$enemy_struck = $enemy_struck + 1
|
|
814
1197
|
|
|
815
|
-
|
|
1198
|
+
# The amount of damage enemy recieves is based on the player's attack power.
|
|
1199
|
+
#$enemy_hp = $enemy_hp - $player_atk
|
|
1200
|
+
player_damage_rate
|
|
1201
|
+
elsif @choice == "Sleep"
|
|
1202
|
+
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
816
1203
|
|
|
817
|
-
|
|
1204
|
+
sleep(1.5)
|
|
818
1205
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
ai_search_limit = ai_data.size.to_i
|
|
824
|
-
ai_next_candidate = ai_data[ai_choice]
|
|
1206
|
+
stay_at_inn
|
|
1207
|
+
else
|
|
1208
|
+
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
1209
|
+
end
|
|
825
1210
|
|
|
826
|
-
|
|
1211
|
+
observe_enemy
|
|
1212
|
+
observe_player
|
|
827
1213
|
|
|
828
|
-
|
|
1214
|
+
sleep(1.5)
|
|
829
1215
|
|
|
830
|
-
|
|
1216
|
+
$current_day = $current_day + 1
|
|
1217
|
+
end
|
|
831
1218
|
|
|
832
|
-
|
|
1219
|
+
def self.mostly_player_control
|
|
1220
|
+
#player_heal = $healing_rate
|
|
833
1221
|
|
|
834
|
-
|
|
835
|
-
puts "\e[38;2;187;127;118mThe enemy chose: #{ai_data}, but found it causes a stalemate. Makes a new decision\e[0m"
|
|
1222
|
+
# Loop for mostly player control
|
|
836
1223
|
|
|
837
|
-
|
|
1224
|
+
# More powerful than full player control, but less efficient maintanence tasks.
|
|
838
1225
|
|
|
839
|
-
|
|
1226
|
+
conditions = {
|
|
1227
|
+
"Epee" => "Ishi",
|
|
1228
|
+
"Ishi" => "Bache",
|
|
1229
|
+
"Bache" => "Epee",
|
|
1230
|
+
}
|
|
840
1231
|
|
|
841
|
-
|
|
1232
|
+
bezerker_chance = ["autonomy", "autonomy", "autonomy", "bezerker"]
|
|
842
1233
|
|
|
843
|
-
|
|
844
|
-
@cchoice = "Epee"
|
|
845
|
-
elsif decision_made == "Stone"
|
|
846
|
-
@cchoice = "Ishi"
|
|
847
|
-
elsif decision_made == "Tarp"
|
|
848
|
-
@cchoice = "Bache"
|
|
849
|
-
end
|
|
1234
|
+
chance_of_bezerker = bezerker_chance.sample
|
|
850
1235
|
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
1236
|
+
if chance_of_bezerker == "autonomy"
|
|
1237
|
+
print "Player Choice >> "; @choice = gets.chomp
|
|
1238
|
+
else
|
|
1239
|
+
puts "Player lost control of the MC..."
|
|
854
1240
|
|
|
855
|
-
|
|
856
|
-
end
|
|
1241
|
+
sleep(1.5)
|
|
857
1242
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
861
|
-
f.puts ai_data
|
|
862
|
-
}
|
|
863
|
-
end
|
|
1243
|
+
@choice = File.readlines("lib/data/ai/player_patterns/observed_player_actions.txt").sample.strip.to_s
|
|
864
1244
|
end
|
|
865
1245
|
|
|
866
|
-
|
|
867
|
-
loop do
|
|
868
|
-
system("clear")
|
|
869
|
-
|
|
870
|
-
if $current_day < $lunar_ticks
|
|
871
|
-
this_day = 29
|
|
1246
|
+
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
872
1247
|
|
|
873
|
-
|
|
874
|
-
else
|
|
875
|
-
lunar_cycle
|
|
1248
|
+
puts "The enemy chose: #{@cchoice}"
|
|
876
1249
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
puts "\e[38;2;187;127;118m[ Currency is #{$player_franc} Francs And #{$player_yen} Yen ]\e[0m"
|
|
882
|
-
|
|
883
|
-
puts "\e[38;2;187;127;118m\n[ Stalemates: #{$stalemates} ] [ Player Strikes: #{$player_struck} ] [ Enemy Strikes: #{$enemy_struck} ]\e[0m"
|
|
884
|
-
puts "\e[38;2;187;127;118m [ #{$player_lunario} Lunario ( You wont need this for most game functions. ) ]"
|
|
885
|
-
|
|
886
|
-
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
887
|
-
puts "\e[38;2;187;127;118mSouer De Chaos ( Ana Nuveyatusuki ) HP: #{$player_hp} \e[0m"
|
|
888
|
-
puts "\e[38;2;187;127;118mSouer De Commande ( Ana Nuveyatusuki ) HP: #{$enemy_hp}\e[0m"
|
|
889
|
-
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
890
|
-
|
|
891
|
-
if $player_hp > 0
|
|
892
|
-
system("clear")
|
|
893
|
-
|
|
894
|
-
puts "\e[38;2;187;127;118mYou've been zombiefied!\e[0m"
|
|
895
|
-
|
|
896
|
-
sleep(1.5)
|
|
1250
|
+
if @choice == "Epee"
|
|
1251
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1252
|
+
f.puts "0"
|
|
1253
|
+
}
|
|
897
1254
|
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1255
|
+
# Records a history of player actions.
|
|
1256
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1257
|
+
f.puts "0"
|
|
1258
|
+
}
|
|
901
1259
|
|
|
902
|
-
|
|
1260
|
+
# Allows enemey to learn about player patterns.
|
|
1261
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1262
|
+
f.puts "Epee"
|
|
1263
|
+
}
|
|
1264
|
+
elsif @choice == "Ishi"
|
|
1265
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1266
|
+
f.puts "1"
|
|
1267
|
+
}
|
|
903
1268
|
|
|
904
|
-
|
|
905
|
-
|
|
1269
|
+
# Records a history of player actions.
|
|
1270
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1271
|
+
f.puts "1"
|
|
1272
|
+
}
|
|
906
1273
|
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
1274
|
+
# Allows enemey to learn about player patterns.
|
|
1275
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1276
|
+
f.puts "Ishi"
|
|
1277
|
+
}
|
|
1278
|
+
elsif @choice == "Bache"
|
|
1279
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1280
|
+
f.puts "2"
|
|
1281
|
+
}
|
|
912
1282
|
|
|
913
|
-
|
|
1283
|
+
# Records a history of player actions.
|
|
1284
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1285
|
+
f.puts "2"
|
|
1286
|
+
}
|
|
914
1287
|
|
|
915
|
-
|
|
916
|
-
|
|
1288
|
+
# Allows enemey to learn about player patterns.
|
|
1289
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1290
|
+
f.puts "Bache"
|
|
1291
|
+
}
|
|
1292
|
+
elsif @choice == "Sleep"
|
|
1293
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1294
|
+
f.puts "2"
|
|
1295
|
+
}
|
|
917
1296
|
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
elsif @choice == "Ishi"
|
|
923
|
-
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
924
|
-
f.puts "1"
|
|
925
|
-
}
|
|
926
|
-
elsif @choice == "Bache"
|
|
927
|
-
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
928
|
-
f.puts "2"
|
|
929
|
-
}
|
|
930
|
-
elsif @choice == "Chomp"
|
|
931
|
-
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
932
|
-
f.puts "2"
|
|
933
|
-
}
|
|
934
|
-
end
|
|
1297
|
+
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
1298
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1299
|
+
f.puts "2"
|
|
1300
|
+
}
|
|
935
1301
|
|
|
936
|
-
|
|
937
|
-
|
|
1302
|
+
# Allows enemey to learn about player patterns.
|
|
1303
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1304
|
+
f.puts "Bache"
|
|
1305
|
+
}
|
|
1306
|
+
end
|
|
938
1307
|
|
|
939
|
-
|
|
940
|
-
|
|
1308
|
+
puts " "
|
|
1309
|
+
sleep(1.5)
|
|
941
1310
|
|
|
942
|
-
|
|
943
|
-
|
|
1311
|
+
# Experiment with using an enemy that learns from player's decisions.'
|
|
1312
|
+
YumemoireFramework::BezerkerMode.ai_decision
|
|
944
1313
|
|
|
945
|
-
|
|
1314
|
+
if conditions[@choice] == @cchoice
|
|
1315
|
+
puts "You were struck by the enemy!"
|
|
946
1316
|
|
|
947
|
-
|
|
948
|
-
#$player_hp = $player_hp - $enemy_atk
|
|
949
|
-
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
950
|
-
elsif @cchoice == @choice
|
|
951
|
-
puts "\e[38;2;187;127;118mYou reach a stalemate.\e[0m"
|
|
1317
|
+
$player_struck = $player_struck + 1
|
|
952
1318
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1319
|
+
# The amount of damage player gets is based on the enemies attack power.
|
|
1320
|
+
#$player_hp = $player_hp - $enemy_atk
|
|
1321
|
+
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
1322
|
+
elsif @cchoice == @choice
|
|
1323
|
+
puts "You reach a stalemate."
|
|
956
1324
|
|
|
957
|
-
|
|
1325
|
+
$stalemates = $stalemates + 1
|
|
1326
|
+
elsif conditions[@cchoice] == @choice
|
|
1327
|
+
puts "You struck the enemy!"
|
|
958
1328
|
|
|
959
|
-
|
|
960
|
-
#$enemy_hp = $enemy_hp - $player_atk
|
|
961
|
-
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
962
|
-
elsif @choice == "Chomp"
|
|
963
|
-
puts "\e[38;2;187;127;118mYou tried staying at an inn, but hotels don't take the undead...'\e[0m"
|
|
1329
|
+
$enemy_struck = $enemy_struck + 1
|
|
964
1330
|
|
|
965
|
-
|
|
1331
|
+
# The amount of damage enemy recieves is based on the player's attack power.
|
|
1332
|
+
#$enemy_hp = $enemy_hp - $player_atk
|
|
1333
|
+
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
1334
|
+
elsif @choice == "Sleep"
|
|
1335
|
+
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
966
1336
|
|
|
967
|
-
|
|
968
|
-
else
|
|
969
|
-
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
970
|
-
end
|
|
1337
|
+
sleep(1.5)
|
|
971
1338
|
|
|
972
|
-
|
|
973
|
-
|
|
1339
|
+
stay_at_inn
|
|
1340
|
+
else
|
|
1341
|
+
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
974
1342
|
end
|
|
975
|
-
end
|
|
976
1343
|
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
###############################################################################################
|
|
980
|
-
#$true_reset_hp = File.read("lib/player_stats/true_reset_hp.txt").strip.to_i
|
|
981
|
-
$reset_hp = File.read("lib/player_stats/reset_hp.txt").strip.to_i
|
|
982
|
-
$player_hp = File.read("lib/player_stats/zombie_player_hp.txt").strip.to_i
|
|
1344
|
+
observe_enemy
|
|
1345
|
+
observe_player
|
|
983
1346
|
|
|
984
|
-
|
|
985
|
-
puts "The curse of being a zombie has been lifted. You can not die like any other mortal."
|
|
1347
|
+
sleep(1.5)
|
|
986
1348
|
|
|
987
|
-
$
|
|
1349
|
+
$current_day = $current_day + 1
|
|
988
1350
|
end
|
|
989
1351
|
|
|
990
|
-
|
|
991
|
-
|
|
1352
|
+
### This section flips between automatic player and player autonomy.
|
|
1353
|
+
def self.mostly_automated_player
|
|
1354
|
+
#player_heal = $healing_rate
|
|
992
1355
|
|
|
993
|
-
|
|
1356
|
+
# Loop for mostly automated player.
|
|
994
1357
|
|
|
995
|
-
|
|
1358
|
+
# The most powerful attacks for player character, but least efficient maintance tasks.
|
|
996
1359
|
|
|
997
|
-
|
|
1360
|
+
conditions = {
|
|
1361
|
+
"Epee" => "Ishi",
|
|
1362
|
+
"Ishi" => "Bache",
|
|
1363
|
+
"Bache" => "Epee",
|
|
1364
|
+
}
|
|
998
1365
|
|
|
999
|
-
|
|
1366
|
+
bezerker_chance = ["autonomy", "bezerker", "bezerker", "bezerker"]
|
|
1000
1367
|
|
|
1001
|
-
|
|
1002
|
-
end
|
|
1368
|
+
chance_of_bezerker = bezerker_chance.sample
|
|
1003
1369
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1370
|
+
if chance_of_bezerker == "autonomy"
|
|
1371
|
+
print "Player Choice >> "; @choice = gets.chomp
|
|
1372
|
+
else
|
|
1373
|
+
puts "Player lost control of the MC..."
|
|
1006
1374
|
|
|
1007
|
-
|
|
1375
|
+
sleep(1.5)
|
|
1008
1376
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1377
|
+
@choice = File.readlines("lib/data/ai/player_patterns/observed_player_actions.txt").sample.strip.to_s
|
|
1378
|
+
end
|
|
1011
1379
|
|
|
1012
|
-
|
|
1380
|
+
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
1013
1381
|
|
|
1014
|
-
puts "
|
|
1382
|
+
puts "The enemy chose: #{@cchoice}"
|
|
1015
1383
|
|
|
1016
|
-
|
|
1017
|
-
|
|
1384
|
+
if @choice == "Epee"
|
|
1385
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1386
|
+
f.puts "0"
|
|
1387
|
+
}
|
|
1018
1388
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1389
|
+
# Records a history of player actions.
|
|
1390
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1391
|
+
f.puts "0"
|
|
1392
|
+
}
|
|
1021
1393
|
|
|
1022
|
-
|
|
1023
|
-
|
|
1394
|
+
# Allows enemey to learn about player patterns.
|
|
1395
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1396
|
+
f.puts "Epee"
|
|
1397
|
+
}
|
|
1398
|
+
elsif @choice == "Ishi"
|
|
1399
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1400
|
+
f.puts "1"
|
|
1401
|
+
}
|
|
1024
1402
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1403
|
+
# Records a history of player actions.
|
|
1404
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1405
|
+
f.puts "1"
|
|
1406
|
+
}
|
|
1027
1407
|
|
|
1028
|
-
|
|
1029
|
-
|
|
1408
|
+
# Allows enemey to learn about player patterns.
|
|
1409
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1410
|
+
f.puts "Ishi"
|
|
1411
|
+
}
|
|
1412
|
+
elsif @choice == "Bache"
|
|
1413
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1414
|
+
f.puts "2"
|
|
1415
|
+
}
|
|
1030
1416
|
|
|
1031
|
-
|
|
1032
|
-
|
|
1417
|
+
# Records a history of player actions.
|
|
1418
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1419
|
+
f.puts "2"
|
|
1420
|
+
}
|
|
1033
1421
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
elsif
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
end
|
|
1043
|
-
end
|
|
1044
|
-
end
|
|
1045
|
-
|
|
1046
|
-
class BezerkerMode
|
|
1047
|
-
###############################################################################################
|
|
1048
|
-
# AI Decision Making #
|
|
1049
|
-
###############################################################################################
|
|
1050
|
-
def self.ai_decision
|
|
1051
|
-
cchoice = @choice
|
|
1052
|
-
|
|
1053
|
-
## Determining user data and user choice.
|
|
1054
|
-
value = File.read("lib/input/user/user_choice.txt").to_s.to_i
|
|
1055
|
-
|
|
1056
|
-
user_data = File.readlines("lib/data/user/candidates.txt")
|
|
1057
|
-
user_choice = user_data[value]
|
|
1058
|
-
|
|
1059
|
-
## Processing AI focused data
|
|
1060
|
-
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
1061
|
-
ai_initial_candidate = user_data[ai_choice]
|
|
1062
|
-
ai_search_limit = user_data.size.to_i
|
|
1063
|
-
|
|
1064
|
-
## Create AI data from user data.
|
|
1065
|
-
ai_search_limit.times do
|
|
1066
|
-
if ai_choice == user_choice
|
|
1067
|
-
#puts "\e[38;2;187;127;118m The specific candidate was found. Terminating selection..."
|
|
1068
|
-
|
|
1069
|
-
ai_data = user_data.slice!(ai_choice)
|
|
1070
|
-
|
|
1071
|
-
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
1072
|
-
f.puts ai_data
|
|
1073
|
-
}
|
|
1074
|
-
else
|
|
1075
|
-
puts "\e[38;2;187;127;118mL'ennemi découvre que vous n'avez pas fait ce choix...\e[0m"
|
|
1076
|
-
end
|
|
1077
|
-
|
|
1078
|
-
sleep(1.5)
|
|
1079
|
-
end
|
|
1080
|
-
|
|
1081
|
-
## AI processing data.
|
|
1082
|
-
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
1083
|
-
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
1084
|
-
ai_search_limit = ai_data.size.to_i
|
|
1085
|
-
ai_next_candidate = ai_data[ai_choice]
|
|
1086
|
-
|
|
1087
|
-
ai_search_limit.times do
|
|
1088
|
-
if ai_next_candidate == user_choice
|
|
1089
|
-
ai_final_candidate = ai_next_candidate
|
|
1090
|
-
|
|
1091
|
-
puts "\e[38;2;187;127;118mCandidate found, processing input...\e[0m"; sleep(1)
|
|
1092
|
-
|
|
1093
|
-
# Breaks the loop if an appropriate candidate is found.
|
|
1094
|
-
|
|
1095
|
-
sleep(1.5)
|
|
1096
|
-
|
|
1097
|
-
conditions = ["Sword", "Stone", "Tarp"]
|
|
1098
|
-
|
|
1099
|
-
decision_made = conditions.sample
|
|
1100
|
-
|
|
1101
|
-
puts "\e[38;2;187;127;118mBy process of elimination, the bot chose: #{ai_data}\e[0m"
|
|
1102
|
-
|
|
1103
|
-
@cchoice = "#{ai_data}"
|
|
1104
|
-
|
|
1105
|
-
puts $cchoice
|
|
1106
|
-
|
|
1107
|
-
break
|
|
1108
|
-
else
|
|
1109
|
-
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
1110
|
-
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
1111
|
-
ai_search_limit = ai_data.size.to_i
|
|
1112
|
-
ai_next_candidate = ai_data[ai_choice]
|
|
1113
|
-
|
|
1114
|
-
ai_data = user_data.slice!(ai_choice).strip
|
|
1115
|
-
|
|
1116
|
-
puts "\e[38;2;187;127;118mEnemy found the option #{ai_data}\e[0m"
|
|
1117
|
-
|
|
1118
|
-
enemy_decision = ["choose", "skip"]
|
|
1119
|
-
|
|
1120
|
-
decision_made = enemy_decision.sample
|
|
1121
|
-
|
|
1122
|
-
if decision_made == "choose"
|
|
1123
|
-
puts "\e[38;2;187;127;118mThe enemy chose: #{ai_data}, but found it causes a stalemate. Makes a new decision\e[0m"
|
|
1124
|
-
|
|
1125
|
-
@cchoice = "#{ai_data}"
|
|
1126
|
-
|
|
1127
|
-
enemy_decision = ["Epee", "Ishi", "Bache"]
|
|
1128
|
-
|
|
1129
|
-
decision_made = enemy_decision.sample
|
|
1130
|
-
|
|
1131
|
-
if decision_made == "Sword"
|
|
1132
|
-
@cchoice = "Epee"
|
|
1133
|
-
elsif decision_made == "Stone"
|
|
1134
|
-
@cchoice = "Ishi"
|
|
1135
|
-
elsif decision_made == "Tarp"
|
|
1136
|
-
@cchoice = "Bache"
|
|
1137
|
-
end
|
|
1138
|
-
|
|
1139
|
-
break
|
|
1140
|
-
else
|
|
1141
|
-
puts "\e[38;2;187;127;118mEnemy weighed the option of choosing #{ai_data}, but decided to skip its turn.\e[0m"
|
|
1142
|
-
|
|
1143
|
-
break
|
|
1144
|
-
end
|
|
1145
|
-
|
|
1146
|
-
sleep(1.5)
|
|
1147
|
-
|
|
1148
|
-
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
1149
|
-
f.puts ai_data
|
|
1150
|
-
}
|
|
1151
|
-
end
|
|
1152
|
-
end
|
|
1153
|
-
end
|
|
1154
|
-
|
|
1155
|
-
#############################################################################################
|
|
1156
|
-
# Standard methods for player autonomy in the game. #
|
|
1157
|
-
#############################################################################################
|
|
1158
|
-
def self.full_player_control
|
|
1159
|
-
#player_heal = $healing_rate
|
|
1160
|
-
|
|
1161
|
-
# Loop for full player control
|
|
1162
|
-
|
|
1163
|
-
# Least damaging, yet most efficient healing and other maintence.
|
|
1164
|
-
|
|
1165
|
-
conditions = {
|
|
1166
|
-
"Epee" => "Ishi",
|
|
1167
|
-
"Ishi" => "Bache",
|
|
1168
|
-
"Bache" => "Epee",
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
bezerker_chance = ["autonomy", "autonomy", "autonomy", "autonomy"]
|
|
1172
|
-
|
|
1173
|
-
chance_of_bezerker = bezerker_chance.sample
|
|
1174
|
-
|
|
1175
|
-
if chance_of_bezerker == "autonomy"
|
|
1176
|
-
print "Player Choice >> "; @choice = gets.chomp
|
|
1177
|
-
else
|
|
1178
|
-
puts "Player lost control of the MC..."
|
|
1179
|
-
|
|
1180
|
-
sleep(1.5)
|
|
1181
|
-
|
|
1182
|
-
@choice = File.readlines("lib/data/ai/player_patterns/observed_player_actions.txt").sample.strip.to_s
|
|
1183
|
-
end
|
|
1184
|
-
|
|
1185
|
-
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
1186
|
-
|
|
1187
|
-
puts "The enemy chose: #{@cchoice}"
|
|
1188
|
-
|
|
1189
|
-
if @choice == "Epee"
|
|
1190
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1191
|
-
f.puts "0"
|
|
1192
|
-
}
|
|
1193
|
-
|
|
1194
|
-
# Records a history of player actions.
|
|
1195
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1196
|
-
f.puts "0"
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
# Allows enemey to learn about player patterns.
|
|
1200
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1201
|
-
f.puts "Epee"
|
|
1202
|
-
}
|
|
1203
|
-
elsif @choice == "Ishi"
|
|
1204
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1205
|
-
f.puts "1"
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
# Records a history of player actions.
|
|
1209
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1210
|
-
f.puts "1"
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
# Allows enemey to learn about player patterns.
|
|
1214
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1215
|
-
f.puts "Ishi"
|
|
1216
|
-
}
|
|
1217
|
-
elsif @choice == "Bache"
|
|
1218
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1219
|
-
f.puts "2"
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
# Records a history of player actions.
|
|
1223
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1224
|
-
f.puts "2"
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
# Allows enemey to learn about player patterns.
|
|
1228
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1229
|
-
f.puts "Bache"
|
|
1230
|
-
}
|
|
1231
|
-
elsif @choice == "Sleep"
|
|
1232
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1233
|
-
f.puts "2"
|
|
1234
|
-
}
|
|
1422
|
+
# Allows enemey to learn about player patterns.
|
|
1423
|
+
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1424
|
+
f.puts "Bache"
|
|
1425
|
+
}
|
|
1426
|
+
elsif @choice == "Sleep"
|
|
1427
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1428
|
+
f.puts "2"
|
|
1429
|
+
}
|
|
1235
1430
|
|
|
1236
1431
|
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
1237
|
-
open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1432
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1238
1433
|
f.puts "2"
|
|
1239
1434
|
}
|
|
1240
1435
|
|
|
1241
|
-
# Allows
|
|
1436
|
+
# Allows enemy to learn about player patterns.
|
|
1242
1437
|
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1243
1438
|
f.puts "Bache"
|
|
1244
1439
|
}
|
|
@@ -1257,7 +1452,7 @@ module YumemoireFramework
|
|
|
1257
1452
|
|
|
1258
1453
|
# The amount of damage player gets is based on the enemies attack power.
|
|
1259
1454
|
#$player_hp = $player_hp - $enemy_atk
|
|
1260
|
-
enemy_damage_rate
|
|
1455
|
+
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
1261
1456
|
elsif @cchoice == @choice
|
|
1262
1457
|
puts "You reach a stalemate."
|
|
1263
1458
|
|
|
@@ -1269,7 +1464,7 @@ module YumemoireFramework
|
|
|
1269
1464
|
|
|
1270
1465
|
# The amount of damage enemy recieves is based on the player's attack power.
|
|
1271
1466
|
#$enemy_hp = $enemy_hp - $player_atk
|
|
1272
|
-
player_damage_rate
|
|
1467
|
+
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
1273
1468
|
elsif @choice == "Sleep"
|
|
1274
1469
|
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
1275
1470
|
|
|
@@ -1288,12 +1483,13 @@ module YumemoireFramework
|
|
|
1288
1483
|
$current_day = $current_day + 1
|
|
1289
1484
|
end
|
|
1290
1485
|
|
|
1291
|
-
def self.
|
|
1292
|
-
#
|
|
1486
|
+
def self.fully_automated_player
|
|
1487
|
+
# Loop for fully automated player characters.
|
|
1293
1488
|
|
|
1294
|
-
#
|
|
1489
|
+
# Your attacks are more powerful, but you're not as efficient at maintanence.
|
|
1295
1490
|
|
|
1296
|
-
|
|
1491
|
+
guess_player_movement
|
|
1492
|
+
guess_enemy_movement
|
|
1297
1493
|
|
|
1298
1494
|
conditions = {
|
|
1299
1495
|
"Epee" => "Ishi",
|
|
@@ -1301,11 +1497,11 @@ module YumemoireFramework
|
|
|
1301
1497
|
"Bache" => "Epee",
|
|
1302
1498
|
}
|
|
1303
1499
|
|
|
1304
|
-
bezerker_chance = ["
|
|
1500
|
+
bezerker_chance = ["bezerker", "bezerker", "bezerker", "bezerker"]
|
|
1305
1501
|
|
|
1306
1502
|
chance_of_bezerker = bezerker_chance.sample
|
|
1307
1503
|
|
|
1308
|
-
if
|
|
1504
|
+
if chance_of_bazerker == "autonomy"
|
|
1309
1505
|
print "Player Choice >> "; @choice = gets.chomp
|
|
1310
1506
|
else
|
|
1311
1507
|
puts "Player lost control of the MC..."
|
|
@@ -1317,7 +1513,7 @@ module YumemoireFramework
|
|
|
1317
1513
|
|
|
1318
1514
|
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
1319
1515
|
|
|
1320
|
-
puts "The enemy chose: #{@
|
|
1516
|
+
puts "The enemy chose: #{@choice}"
|
|
1321
1517
|
|
|
1322
1518
|
if @choice == "Epee"
|
|
1323
1519
|
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
@@ -1328,11 +1524,6 @@ module YumemoireFramework
|
|
|
1328
1524
|
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1329
1525
|
f.puts "0"
|
|
1330
1526
|
}
|
|
1331
|
-
|
|
1332
|
-
# Allows enemey to learn about player patterns.
|
|
1333
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1334
|
-
f.puts "Epee"
|
|
1335
|
-
}
|
|
1336
1527
|
elsif @choice == "Ishi"
|
|
1337
1528
|
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1338
1529
|
f.puts "1"
|
|
@@ -1342,11 +1533,6 @@ module YumemoireFramework
|
|
|
1342
1533
|
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1343
1534
|
f.puts "1"
|
|
1344
1535
|
}
|
|
1345
|
-
|
|
1346
|
-
# Allows enemey to learn about player patterns.
|
|
1347
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1348
|
-
f.puts "Ishi"
|
|
1349
|
-
}
|
|
1350
1536
|
elsif @choice == "Bache"
|
|
1351
1537
|
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1352
1538
|
f.puts "2"
|
|
@@ -1356,11 +1542,6 @@ module YumemoireFramework
|
|
|
1356
1542
|
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1357
1543
|
f.puts "2"
|
|
1358
1544
|
}
|
|
1359
|
-
|
|
1360
|
-
# Allows enemey to learn about player patterns.
|
|
1361
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1362
|
-
f.puts "Bache"
|
|
1363
|
-
}
|
|
1364
1545
|
elsif @choice == "Sleep"
|
|
1365
1546
|
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1366
1547
|
f.puts "2"
|
|
@@ -1370,11 +1551,6 @@ module YumemoireFramework
|
|
|
1370
1551
|
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1371
1552
|
f.puts "2"
|
|
1372
1553
|
}
|
|
1373
|
-
|
|
1374
|
-
# Allows enemey to learn about player patterns.
|
|
1375
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1376
|
-
f.puts "Bache"
|
|
1377
|
-
}
|
|
1378
1554
|
end
|
|
1379
1555
|
|
|
1380
1556
|
puts " "
|
|
@@ -1413,268 +1589,20 @@ module YumemoireFramework
|
|
|
1413
1589
|
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
1414
1590
|
end
|
|
1415
1591
|
|
|
1416
|
-
|
|
1417
|
-
observe_player
|
|
1592
|
+
#$current_day = $current_day + 1
|
|
1418
1593
|
|
|
1419
1594
|
sleep(1.5)
|
|
1420
1595
|
|
|
1421
1596
|
$current_day = $current_day + 1
|
|
1422
1597
|
end
|
|
1423
1598
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
#
|
|
1427
|
-
|
|
1428
|
-
|
|
1599
|
+
def self.pdm_metric
|
|
1600
|
+
####################################################################################################
|
|
1601
|
+
# Game Loop Chooser Coming Soon #
|
|
1602
|
+
####################################################################################################
|
|
1603
|
+
pdm = $personal_demon_metric # File.read("lib/data/user/personal_demon_metric.txt").strip.to_i
|
|
1429
1604
|
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
conditions = {
|
|
1433
|
-
"Epee" => "Ishi",
|
|
1434
|
-
"Ishi" => "Bache",
|
|
1435
|
-
"Bache" => "Epee",
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
bezerker_chance = ["autonomy", "bezerker", "bezerker", "bezerker"]
|
|
1439
|
-
|
|
1440
|
-
chance_of_bezerker = bezerker_chance.sample
|
|
1441
|
-
|
|
1442
|
-
if chance_of_bezerker == "autonomy"
|
|
1443
|
-
print "Player Choice >> "; @choice = gets.chomp
|
|
1444
|
-
else
|
|
1445
|
-
puts "Player lost control of the MC..."
|
|
1446
|
-
|
|
1447
|
-
sleep(1.5)
|
|
1448
|
-
|
|
1449
|
-
@choice = File.readlines("lib/data/ai/player_patterns/observed_player_actions.txt").sample.strip.to_s
|
|
1450
|
-
end
|
|
1451
|
-
|
|
1452
|
-
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
1453
|
-
|
|
1454
|
-
puts "The enemy chose: #{@cchoice}"
|
|
1455
|
-
|
|
1456
|
-
if @choice == "Epee"
|
|
1457
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1458
|
-
f.puts "0"
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
# Records a history of player actions.
|
|
1462
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1463
|
-
f.puts "0"
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
# Allows enemey to learn about player patterns.
|
|
1467
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1468
|
-
f.puts "Epee"
|
|
1469
|
-
}
|
|
1470
|
-
elsif @choice == "Ishi"
|
|
1471
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1472
|
-
f.puts "1"
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
# Records a history of player actions.
|
|
1476
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1477
|
-
f.puts "1"
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
# Allows enemey to learn about player patterns.
|
|
1481
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1482
|
-
f.puts "Ishi"
|
|
1483
|
-
}
|
|
1484
|
-
elsif @choice == "Bache"
|
|
1485
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1486
|
-
f.puts "2"
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
# Records a history of player actions.
|
|
1490
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1491
|
-
f.puts "2"
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
# Allows enemey to learn about player patterns.
|
|
1495
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1496
|
-
f.puts "Bache"
|
|
1497
|
-
}
|
|
1498
|
-
elsif @choice == "Sleep"
|
|
1499
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1500
|
-
f.puts "2"
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
1504
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1505
|
-
f.puts "2"
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
# Allows enemy to learn about player patterns.
|
|
1509
|
-
File.open("lib/data/ai/player_patterns/observed_player_actions.txt", "a") { |f|
|
|
1510
|
-
f.puts "Bache"
|
|
1511
|
-
}
|
|
1512
|
-
end
|
|
1513
|
-
|
|
1514
|
-
puts " "
|
|
1515
|
-
sleep(1.5)
|
|
1516
|
-
|
|
1517
|
-
# Experiment with using an enemy that learns from player's decisions.'
|
|
1518
|
-
YumemoireFramework::BezerkerMode.ai_decision
|
|
1519
|
-
|
|
1520
|
-
if conditions[@choice] == @cchoice
|
|
1521
|
-
puts "You were struck by the enemy!"
|
|
1522
|
-
|
|
1523
|
-
$player_struck = $player_struck + 1
|
|
1524
|
-
|
|
1525
|
-
# The amount of damage player gets is based on the enemies attack power.
|
|
1526
|
-
#$player_hp = $player_hp - $enemy_atk
|
|
1527
|
-
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
1528
|
-
elsif @cchoice == @choice
|
|
1529
|
-
puts "You reach a stalemate."
|
|
1530
|
-
|
|
1531
|
-
$stalemates = $stalemates + 1
|
|
1532
|
-
elsif conditions[@cchoice] == @choice
|
|
1533
|
-
puts "You struck the enemy!"
|
|
1534
|
-
|
|
1535
|
-
$enemy_struck = $enemy_struck + 1
|
|
1536
|
-
|
|
1537
|
-
# The amount of damage enemy recieves is based on the player's attack power.
|
|
1538
|
-
#$enemy_hp = $enemy_hp - $player_atk
|
|
1539
|
-
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
1540
|
-
elsif @choice == "Sleep"
|
|
1541
|
-
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
1542
|
-
|
|
1543
|
-
sleep(1.5)
|
|
1544
|
-
|
|
1545
|
-
stay_at_inn
|
|
1546
|
-
else
|
|
1547
|
-
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
1548
|
-
end
|
|
1549
|
-
|
|
1550
|
-
observe_enemy
|
|
1551
|
-
observe_player
|
|
1552
|
-
|
|
1553
|
-
sleep(1.5)
|
|
1554
|
-
|
|
1555
|
-
$current_day = $current_day + 1
|
|
1556
|
-
end
|
|
1557
|
-
|
|
1558
|
-
def self.fully_automated_player
|
|
1559
|
-
# Loop for fully automated player characters.
|
|
1560
|
-
|
|
1561
|
-
# Your attacks are more powerful, but you're not as efficient at maintanence.
|
|
1562
|
-
|
|
1563
|
-
guess_player_movement
|
|
1564
|
-
guess_enemy_movement
|
|
1565
|
-
|
|
1566
|
-
conditions = {
|
|
1567
|
-
"Epee" => "Ishi",
|
|
1568
|
-
"Ishi" => "Bache",
|
|
1569
|
-
"Bache" => "Epee",
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
bezerker_chance = ["bezerker", "bezerker", "bezerker", "bezerker"]
|
|
1573
|
-
|
|
1574
|
-
chance_of_bezerker = bezerker_chance.sample
|
|
1575
|
-
|
|
1576
|
-
if chance_of_bazerker == "autonomy"
|
|
1577
|
-
print "Player Choice >> "; @choice = gets.chomp
|
|
1578
|
-
else
|
|
1579
|
-
puts "Player lost control of the MC..."
|
|
1580
|
-
|
|
1581
|
-
sleep(1.5)
|
|
1582
|
-
|
|
1583
|
-
@choice = File.readlines("lib/data/ai/player_patterns/observed_player_actions.txt").sample.strip.to_s
|
|
1584
|
-
end
|
|
1585
|
-
|
|
1586
|
-
@cchoice = File.readlines("lib/data/ai/enemy_patterns/observed_enemy_actions.txt").sample.strip.to_s
|
|
1587
|
-
|
|
1588
|
-
puts "The enemy chose: #{@choice}"
|
|
1589
|
-
|
|
1590
|
-
if @choice == "Epee"
|
|
1591
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1592
|
-
f.puts "0"
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
# Records a history of player actions.
|
|
1596
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1597
|
-
f.puts "0"
|
|
1598
|
-
}
|
|
1599
|
-
elsif @choice == "Ishi"
|
|
1600
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1601
|
-
f.puts "1"
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
# Records a history of player actions.
|
|
1605
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1606
|
-
f.puts "1"
|
|
1607
|
-
}
|
|
1608
|
-
elsif @choice == "Bache"
|
|
1609
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1610
|
-
f.puts "2"
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
# Records a history of player actions.
|
|
1614
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1615
|
-
f.puts "2"
|
|
1616
|
-
}
|
|
1617
|
-
elsif @choice == "Sleep"
|
|
1618
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1619
|
-
f.puts "2"
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
1623
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1624
|
-
f.puts "2"
|
|
1625
|
-
}
|
|
1626
|
-
end
|
|
1627
|
-
|
|
1628
|
-
puts " "
|
|
1629
|
-
sleep(1.5)
|
|
1630
|
-
|
|
1631
|
-
# Experiment with using an enemy that learns from player's decisions.'
|
|
1632
|
-
YumemoireFramework::BezerkerMode.ai_decision
|
|
1633
|
-
|
|
1634
|
-
if conditions[@choice] == @cchoice
|
|
1635
|
-
puts "You were struck by the enemy!"
|
|
1636
|
-
|
|
1637
|
-
$player_struck = $player_struck + 1
|
|
1638
|
-
|
|
1639
|
-
# The amount of damage player gets is based on the enemies attack power.
|
|
1640
|
-
#$player_hp = $player_hp - $enemy_atk
|
|
1641
|
-
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
1642
|
-
elsif @cchoice == @choice
|
|
1643
|
-
puts "You reach a stalemate."
|
|
1644
|
-
|
|
1645
|
-
$stalemates = $stalemates + 1
|
|
1646
|
-
elsif conditions[@cchoice] == @choice
|
|
1647
|
-
puts "You struck the enemy!"
|
|
1648
|
-
|
|
1649
|
-
$enemy_struck = $enemy_struck + 1
|
|
1650
|
-
|
|
1651
|
-
# The amount of damage enemy recieves is based on the player's attack power.
|
|
1652
|
-
#$enemy_hp = $enemy_hp - $player_atk
|
|
1653
|
-
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
1654
|
-
elsif @choice == "Sleep"
|
|
1655
|
-
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
1656
|
-
|
|
1657
|
-
sleep(1.5)
|
|
1658
|
-
|
|
1659
|
-
stay_at_inn
|
|
1660
|
-
else
|
|
1661
|
-
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
1662
|
-
end
|
|
1663
|
-
|
|
1664
|
-
#$current_day = $current_day + 1
|
|
1665
|
-
|
|
1666
|
-
sleep(1.5)
|
|
1667
|
-
|
|
1668
|
-
$current_day = $current_day + 1
|
|
1669
|
-
end
|
|
1670
|
-
|
|
1671
|
-
def self.pdm_metric
|
|
1672
|
-
####################################################################################################
|
|
1673
|
-
# Game Loop Chooser Coming Soon #
|
|
1674
|
-
####################################################################################################
|
|
1675
|
-
pdm = $personal_demon_metric # File.read("lib/data/user/personal_demon_metric.txt").strip.to_i
|
|
1676
|
-
|
|
1677
|
-
gets.chomp
|
|
1605
|
+
gets.chomp
|
|
1678
1606
|
|
|
1679
1607
|
loop do
|
|
1680
1608
|
if pdm > 100
|
|
@@ -1765,8 +1693,11 @@ module YumemoireFramework
|
|
|
1765
1693
|
end
|
|
1766
1694
|
end
|
|
1767
1695
|
end
|
|
1768
|
-
|
|
1769
|
-
|
|
1696
|
+
|
|
1697
|
+
end
|
|
1698
|
+
|
|
1699
|
+
module YumemoireZombieMode
|
|
1700
|
+
class ZombieMode
|
|
1770
1701
|
###############################################################################################
|
|
1771
1702
|
# AI Decision Making #
|
|
1772
1703
|
###############################################################################################
|
|
@@ -1873,595 +1804,730 @@ module YumemoireFramework
|
|
|
1873
1804
|
}
|
|
1874
1805
|
end
|
|
1875
1806
|
end
|
|
1876
|
-
end
|
|
1877
1807
|
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
system("clear")
|
|
1882
|
-
|
|
1883
|
-
if $current_day < $lunar_ticks
|
|
1884
|
-
this_day = 29
|
|
1885
|
-
|
|
1886
|
-
puts "\e[38;2;187;127;118mLa prochaine phase lunaire est en cours: #{this_day - $current_day} days...\e[0m"
|
|
1887
|
-
else
|
|
1888
|
-
lunar_cycle
|
|
1889
|
-
|
|
1890
|
-
# Reset lunar ticks to twenty days away.
|
|
1891
|
-
$current_day = 1
|
|
1892
|
-
end
|
|
1893
|
-
|
|
1894
|
-
menu = File.read("lib/images/menus/main.txt")
|
|
1895
|
-
|
|
1896
|
-
puts menu
|
|
1897
|
-
|
|
1898
|
-
puts "\e[38;2;187;127;118m[ Currency is #{$player_franc} Francs And #{$player_yen} Yen ]\e[0m"
|
|
1899
|
-
|
|
1900
|
-
puts "\e[38;2;187;127;118m\n[ Stalemates: #{$stalemates} ] [ Player Strikes: #{$player_struck} ] [ Enemy Strikes: #{$enemy_struck} ]\e[0m"
|
|
1901
|
-
puts "\e[38;2;187;127;118m [ #{$player_lunario} Lunario ( You wont need this for most game functions. ) ]"
|
|
1902
|
-
|
|
1903
|
-
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
1904
|
-
puts "\e[38;2;187;127;118mSouer De Chaos ( Ana Nuveyatusuki ) HP: #{$player_hp} \e[0m"
|
|
1905
|
-
puts "\e[38;2;187;127;118m#{$current_monster_name} HP: #{$enemy_hp}\e[0m"
|
|
1906
|
-
#puts "\e[38;2;187;127;118mSouer De Commande ( Ana Nuveyatusuki ) HP: #{$enemy_hp}\e[0m"
|
|
1907
|
-
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
1908
|
-
|
|
1909
|
-
if $player_hp <= 0
|
|
1808
|
+
def self.parser
|
|
1809
|
+
loop do
|
|
1910
1810
|
system("clear")
|
|
1911
1811
|
|
|
1912
|
-
|
|
1812
|
+
if $current_day < $lunar_ticks
|
|
1813
|
+
this_day = 29
|
|
1913
1814
|
|
|
1914
|
-
|
|
1815
|
+
puts "\e[38;2;187;127;118mLa prochaine phase lunaire est en cours: #{this_day - $current_day} days...\e[0m"
|
|
1816
|
+
else
|
|
1817
|
+
lunar_cycle
|
|
1915
1818
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1819
|
+
# Reset lunar ticks to twenty days away.
|
|
1820
|
+
$current_day = 1
|
|
1821
|
+
end
|
|
1919
1822
|
|
|
1920
|
-
|
|
1823
|
+
puts "\e[38;2;187;127;118m[ Currency is #{$player_franc} Francs And #{$player_yen} Yen ]\e[0m"
|
|
1921
1824
|
|
|
1922
|
-
|
|
1923
|
-
|
|
1825
|
+
puts "\e[38;2;187;127;118m\n[ Stalemates: #{$stalemates} ] [ Player Strikes: #{$player_struck} ] [ Enemy Strikes: #{$enemy_struck} ]\e[0m"
|
|
1826
|
+
puts "\e[38;2;187;127;118m [ #{$player_lunario} Lunario ( You wont need this for most game functions. ) ]"
|
|
1924
1827
|
|
|
1925
|
-
|
|
1926
|
-
"
|
|
1927
|
-
"
|
|
1928
|
-
|
|
1929
|
-
}
|
|
1828
|
+
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
1829
|
+
puts "\e[38;2;187;127;118mSouer De Chaos ( Ana Nuveyatusuki ) HP: #{$player_hp} \e[0m"
|
|
1830
|
+
puts "\e[38;2;187;127;118mSouer De Commande ( Ana Nuveyatusuki ) HP: #{$enemy_hp}\e[0m"
|
|
1831
|
+
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
1930
1832
|
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
else
|
|
1934
|
-
puts "\e[38;2;187;127;118mTo heal the player, type: Sleep\e[0m"
|
|
1935
|
-
end
|
|
1833
|
+
if $player_hp > 0
|
|
1834
|
+
system("clear")
|
|
1936
1835
|
|
|
1937
|
-
|
|
1938
|
-
@choice = gets.chomp.capitalize
|
|
1836
|
+
puts "\e[38;2;187;127;118mYou've been zombiefied!\e[0m"
|
|
1939
1837
|
|
|
1940
|
-
|
|
1941
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1942
|
-
f.puts "0"
|
|
1943
|
-
}
|
|
1838
|
+
sleep(1.5)
|
|
1944
1839
|
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
}
|
|
1949
|
-
elsif @choice == "Ishi"
|
|
1950
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1951
|
-
f.puts "1"
|
|
1952
|
-
}
|
|
1840
|
+
system("ruby rockpaper.rb")
|
|
1841
|
+
elsif $enemy_hp <= 0
|
|
1842
|
+
puts "\e[38;2;187;127;118mYou won\e[0m"
|
|
1953
1843
|
|
|
1954
|
-
|
|
1955
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1956
|
-
f.puts "1"
|
|
1957
|
-
}
|
|
1958
|
-
elsif @choice == "Bache"
|
|
1959
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1960
|
-
f.puts "2"
|
|
1961
|
-
}
|
|
1844
|
+
gets.chomp
|
|
1962
1845
|
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
f.puts "2"
|
|
1966
|
-
}
|
|
1967
|
-
elsif @choice == "Sleep"
|
|
1968
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1969
|
-
f.puts "2"
|
|
1970
|
-
}
|
|
1846
|
+
abort
|
|
1847
|
+
end
|
|
1971
1848
|
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
elsif @choice == "Heal"
|
|
1977
|
-
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1978
|
-
f.puts "2"
|
|
1849
|
+
conditions = {
|
|
1850
|
+
"Epee" => "Ishi",
|
|
1851
|
+
"Ishi" => "Bache",
|
|
1852
|
+
"Bache" => "Epee",
|
|
1979
1853
|
}
|
|
1980
1854
|
|
|
1981
|
-
|
|
1982
|
-
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
1983
|
-
f.puts "2"
|
|
1984
|
-
}
|
|
1985
|
-
end
|
|
1855
|
+
puts "\e[38;2;187;127;118mTo heal the player, type: Chomp\e[0m"
|
|
1986
1856
|
|
|
1987
|
-
|
|
1988
|
-
|
|
1857
|
+
print "\e[38;2;164;145;91m\nEpee, Ishi, or Bache >> \e[0m"
|
|
1858
|
+
@choice = gets.chomp.capitalize
|
|
1989
1859
|
|
|
1990
|
-
|
|
1991
|
-
|
|
1860
|
+
if @choice == "Epee"
|
|
1861
|
+
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1862
|
+
f.puts "0"
|
|
1863
|
+
}
|
|
1864
|
+
elsif @choice == "Ishi"
|
|
1865
|
+
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1866
|
+
f.puts "1"
|
|
1867
|
+
}
|
|
1868
|
+
elsif @choice == "Bache"
|
|
1869
|
+
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1870
|
+
f.puts "2"
|
|
1871
|
+
}
|
|
1872
|
+
elsif @choice == "Chomp"
|
|
1873
|
+
open("lib/input/user/user_choice.txt", "w") { |f|
|
|
1874
|
+
f.puts "2"
|
|
1875
|
+
}
|
|
1876
|
+
end
|
|
1992
1877
|
|
|
1993
|
-
|
|
1994
|
-
|
|
1878
|
+
puts " "
|
|
1879
|
+
sleep(1.5)
|
|
1995
1880
|
|
|
1996
|
-
|
|
1881
|
+
# Experiment with using an enemy that learns from player's decisions.'
|
|
1882
|
+
YumemoireFramework::ZombieMode.ai_decision
|
|
1997
1883
|
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
2001
|
-
elsif @cchoice == @choice
|
|
2002
|
-
puts "\e[38;2;187;127;118mYou reach a stalemate.\e[0m"
|
|
1884
|
+
if conditions[@choice] == @cchoice
|
|
1885
|
+
#puts "\e[38;2;187;127;118m You were struck by the enemy!"
|
|
2003
1886
|
|
|
2004
|
-
|
|
2005
|
-
elsif conditions[@cchoice] == @choice
|
|
2006
|
-
#puts "\e[38;2;187;127;118m You struck the enemy!"
|
|
1887
|
+
$enemy_struck = $enemy_struck + 1
|
|
2007
1888
|
|
|
2008
|
-
|
|
1889
|
+
# The amount of damage player gets is based on the enemies attack power.
|
|
1890
|
+
#$player_hp = $player_hp - $enemy_atk
|
|
1891
|
+
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
1892
|
+
elsif @cchoice == @choice
|
|
1893
|
+
puts "\e[38;2;187;127;118mYou reach a stalemate.\e[0m"
|
|
2009
1894
|
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
elsif @choice == "Sleep"
|
|
2014
|
-
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
1895
|
+
$stalemates = $stalemates + 1
|
|
1896
|
+
elsif conditions[@cchoice] == @choice
|
|
1897
|
+
#puts "\e[38;2;187;127;118m You struck the enemy!"
|
|
2015
1898
|
|
|
2016
|
-
|
|
1899
|
+
$player_struck = $player_struck + 1
|
|
2017
1900
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
1901
|
+
# The amount of damage enemy recieves is based on the player's attack power.
|
|
1902
|
+
#$enemy_hp = $enemy_hp - $player_atk
|
|
1903
|
+
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
1904
|
+
elsif @choice == "Chomp"
|
|
1905
|
+
puts "\e[38;2;187;127;118mYou tried staying at an inn, but hotels don't take the undead...'\e[0m"
|
|
2021
1906
|
|
|
2022
|
-
|
|
1907
|
+
sleep(1.5)
|
|
2023
1908
|
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1909
|
+
YumemoireFramework::ZombieMode.consumption
|
|
1910
|
+
else
|
|
1911
|
+
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
1912
|
+
end
|
|
2028
1913
|
|
|
2029
|
-
|
|
1914
|
+
$current_day = $current_day + 1
|
|
1915
|
+
end
|
|
2030
1916
|
end
|
|
2031
1917
|
end
|
|
2032
|
-
end
|
|
2033
|
-
|
|
2034
|
-
class Gribatomaton
|
|
2035
|
-
###################################################################################
|
|
2036
|
-
# Upgrades For Pet Spider #
|
|
2037
|
-
###################################################################################
|
|
2038
|
-
def self.level_one_spider
|
|
2039
|
-
$spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
2040
|
-
$spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
2041
|
-
$spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
2042
|
-
end
|
|
2043
|
-
|
|
2044
|
-
def self.level_two_spider
|
|
2045
|
-
$spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
2046
|
-
$spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
2047
|
-
$spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
2048
|
-
|
|
2049
|
-
File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
2050
|
-
$spider_hp = $spider_hp + 3
|
|
2051
|
-
|
|
2052
|
-
f.puts $spider_hp
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
2056
|
-
$spider_atk = $spider_atk + 3
|
|
2057
1918
|
|
|
2058
|
-
|
|
2059
|
-
|
|
1919
|
+
###############################################################################################
|
|
1920
|
+
# Zombie State Minigame #
|
|
1921
|
+
###############################################################################################
|
|
1922
|
+
#$true_reset_hp = File.read("lib/player_stats/true_reset_hp.txt").strip.to_i
|
|
1923
|
+
$reset_hp = File.read("lib/player_stats/reset_hp.txt").strip.to_i
|
|
1924
|
+
$player_hp = File.read("lib/player_stats/zombie_player_hp.txt").strip.to_i
|
|
2060
1925
|
|
|
2061
|
-
|
|
2062
|
-
|
|
1926
|
+
def self.reset_standard_hp_restoration
|
|
1927
|
+
puts "The curse of being a zombie has been lifted. You can not die like any other mortal."
|
|
2063
1928
|
|
|
2064
|
-
|
|
2065
|
-
}
|
|
1929
|
+
$reset_hp = $true_reset_hp
|
|
2066
1930
|
end
|
|
2067
1931
|
|
|
2068
|
-
def self.
|
|
2069
|
-
|
|
2070
|
-
$spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
2071
|
-
$spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
2072
|
-
|
|
2073
|
-
File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
2074
|
-
$spider_hp = $spider_hp + 5
|
|
1932
|
+
def self.cremation
|
|
1933
|
+
puts "You've self cremated."
|
|
2075
1934
|
|
|
2076
|
-
|
|
2077
|
-
}
|
|
1935
|
+
sleep(1.5)
|
|
2078
1936
|
|
|
2079
|
-
|
|
2080
|
-
$spider_atk = $spider_atk + 5
|
|
1937
|
+
puts "You've opted to self cremate. Restarting the map."
|
|
2081
1938
|
|
|
2082
|
-
|
|
2083
|
-
}
|
|
1939
|
+
$player_hp = $reset_hp
|
|
2084
1940
|
|
|
2085
|
-
|
|
2086
|
-
$spider_heal = $spider_heal + 5
|
|
1941
|
+
puts "Now returning to human form..."
|
|
2087
1942
|
|
|
2088
|
-
|
|
2089
|
-
}
|
|
1943
|
+
system("ruby rockpaper.rb")
|
|
2090
1944
|
end
|
|
2091
1945
|
|
|
2092
|
-
def self.
|
|
2093
|
-
|
|
2094
|
-
$spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
2095
|
-
$spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
2096
|
-
|
|
2097
|
-
File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
2098
|
-
$spider_hp = $spider_hp + 7
|
|
2099
|
-
|
|
2100
|
-
f.puts $spider_hp
|
|
2101
|
-
}
|
|
2102
|
-
|
|
2103
|
-
File.open("pet_stats/spider_atk.txt", "w") { |f|
|
|
2104
|
-
$spider_atk = $spider_atk + 7
|
|
1946
|
+
def self.consumption
|
|
1947
|
+
puts "You've eaten parts of your own corpse."
|
|
2105
1948
|
|
|
2106
|
-
|
|
2107
|
-
}
|
|
1949
|
+
sleep(1.5)
|
|
2108
1950
|
|
|
2109
|
-
|
|
2110
|
-
|
|
1951
|
+
$reset_hp = $reset_hp - 1
|
|
1952
|
+
$player_hp = $reset_hp
|
|
2111
1953
|
|
|
2112
|
-
|
|
2113
|
-
}
|
|
2114
|
-
end
|
|
1954
|
+
print "Your HP was replinished but "
|
|
2115
1955
|
|
|
2116
|
-
|
|
2117
|
-
$spider_hp = File.read("pet_stats/spider_hp.txt").strip.to_s
|
|
2118
|
-
$spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
2119
|
-
$spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
1956
|
+
puts " you lost 3 hit points from consuming your own body."
|
|
2120
1957
|
|
|
2121
|
-
File.open("
|
|
2122
|
-
$
|
|
1958
|
+
File.open("lib/player_stats/zombie_player_hp.txt", "w") { |f|
|
|
1959
|
+
$player_hp = $player_hp + 3
|
|
2123
1960
|
|
|
2124
|
-
f.puts $
|
|
1961
|
+
f.puts $player_hp -20
|
|
2125
1962
|
}
|
|
2126
1963
|
|
|
2127
|
-
File.open("
|
|
2128
|
-
$
|
|
1964
|
+
File.open("lib/player_stats/reset_hp.txt", "w") { |f|
|
|
1965
|
+
$reset_hp = $reset_hp - 3
|
|
2129
1966
|
|
|
2130
|
-
f.puts $
|
|
1967
|
+
f.puts $reset_hp
|
|
2131
1968
|
}
|
|
2132
1969
|
|
|
2133
|
-
|
|
2134
|
-
$spider_heal = $spider_heal + 9
|
|
2135
|
-
|
|
2136
|
-
f.puts $spider_heal
|
|
2137
|
-
}
|
|
1970
|
+
system("ruby rock_paper_zombie.rb")
|
|
2138
1971
|
end
|
|
2139
1972
|
|
|
2140
|
-
def self.
|
|
2141
|
-
|
|
2142
|
-
$spider_atk = File.read("pet_stats/spider_atk.txt").strip.to_s
|
|
2143
|
-
$spider_heal = File.read("pet_stats/spider_heal.txt").strip.to_s
|
|
2144
|
-
|
|
2145
|
-
File.open("pet_stats/spider_hp.txt", "w") { |f|
|
|
2146
|
-
$spider_hp = $spider_hp + 11
|
|
1973
|
+
def self.final_wishes
|
|
1974
|
+
print "Do you wish to self-cremate or continue this battle? ( cremate / consumption ) << "
|
|
2147
1975
|
|
|
2148
|
-
|
|
2149
|
-
}
|
|
1976
|
+
choose_your_fate = gets.chomp
|
|
2150
1977
|
|
|
2151
|
-
|
|
2152
|
-
|
|
1978
|
+
if choose_your_fate == "cremate"
|
|
1979
|
+
YumemoreFramework::ZombieMode.cremation
|
|
1980
|
+
elsif choose_your_fate == "consumption"
|
|
1981
|
+
YumemoreFramework::ZombieMode.consumption
|
|
1982
|
+
else
|
|
1983
|
+
puts ">> Last wishes not understoood, defaulting to self-cremation."
|
|
1984
|
+
end
|
|
1985
|
+
end
|
|
1986
|
+
end
|
|
1987
|
+
end
|
|
2153
1988
|
|
|
2154
|
-
|
|
2155
|
-
|
|
1989
|
+
module YumemoireHumanMode
|
|
1990
|
+
class HumanMode
|
|
1991
|
+
###############################################################################################
|
|
1992
|
+
# AI Decision Making #
|
|
1993
|
+
###############################################################################################
|
|
1994
|
+
def self.ai_decision
|
|
1995
|
+
cchoice = @choice
|
|
2156
1996
|
|
|
2157
|
-
|
|
2158
|
-
|
|
1997
|
+
## Determining user data and user choice.
|
|
1998
|
+
value = File.read("lib/input/user/user_choice.txt").to_s.to_i
|
|
2159
1999
|
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
end
|
|
2000
|
+
user_data = File.readlines("lib/data/user/candidates.txt")
|
|
2001
|
+
user_choice = user_data[value]
|
|
2163
2002
|
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2003
|
+
## Processing AI focused data
|
|
2004
|
+
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
2005
|
+
ai_initial_candidate = user_data[ai_choice]
|
|
2006
|
+
ai_search_limit = user_data.size.to_i
|
|
2168
2007
|
|
|
2169
|
-
|
|
2170
|
-
|
|
2008
|
+
## Create AI data from user data.
|
|
2009
|
+
ai_search_limit.times do
|
|
2010
|
+
if ai_choice == user_choice
|
|
2011
|
+
#puts "\e[38;2;187;127;118m The specific candidate was found. Terminating selection..."
|
|
2171
2012
|
|
|
2172
|
-
|
|
2173
|
-
}
|
|
2013
|
+
ai_data = user_data.slice!(ai_choice)
|
|
2174
2014
|
|
|
2175
|
-
|
|
2176
|
-
|
|
2015
|
+
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
2016
|
+
f.puts ai_data
|
|
2017
|
+
}
|
|
2018
|
+
else
|
|
2019
|
+
puts "\e[38;2;187;127;118mL'ennemi découvre que vous n'avez pas fait ce choix...\e[0m"
|
|
2020
|
+
end
|
|
2177
2021
|
|
|
2178
|
-
|
|
2179
|
-
|
|
2022
|
+
sleep(1.5)
|
|
2023
|
+
end
|
|
2180
2024
|
|
|
2181
|
-
|
|
2182
|
-
|
|
2025
|
+
## AI processing data.
|
|
2026
|
+
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
2027
|
+
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
2028
|
+
ai_search_limit = ai_data.size.to_i
|
|
2029
|
+
ai_next_candidate = ai_data[ai_choice]
|
|
2183
2030
|
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2031
|
+
ai_search_limit.times do
|
|
2032
|
+
if ai_next_candidate == user_choice
|
|
2033
|
+
ai_final_candidate = ai_next_candidate
|
|
2034
|
+
|
|
2035
|
+
puts "\e[38;2;187;127;118mCandidate found, processing input...\e[0m"; sleep(1)
|
|
2187
2036
|
|
|
2188
|
-
|
|
2189
|
-
# Main Pet Spider Functionality #
|
|
2190
|
-
#####################################################################################################
|
|
2191
|
-
def self.enemy_spotted
|
|
2192
|
-
# Determines if your pet spider pig has seen the enemy.
|
|
2193
|
-
enemy_event = File.readlines("enemies/enemies_spotted/spot_enemy.txt")
|
|
2194
|
-
enemy_event_toggle = File.read("enemies/enemies_toggle/toggle_enemies.txt").strip.to_i
|
|
2195
|
-
enemy_spotted = enemy_event[enemy_event_toggle]
|
|
2037
|
+
# Breaks the loop if an appropriate candidate is found.
|
|
2196
2038
|
|
|
2197
|
-
|
|
2198
|
-
$enemy_hp = $enemy_hp - $spider_atk
|
|
2039
|
+
sleep(1.5)
|
|
2199
2040
|
|
|
2200
|
-
|
|
2201
|
-
else
|
|
2202
|
-
puts ">> Your pet spider pig hasn't spotted the enemy..."
|
|
2203
|
-
end
|
|
2204
|
-
end
|
|
2041
|
+
conditions = ["Sword", "Stone", "Tarp"]
|
|
2205
2042
|
|
|
2206
|
-
|
|
2207
|
-
#def self.navigation
|
|
2208
|
-
# navigation_x = File.readlines("lifeform/aspects/navigation_x.txt")
|
|
2209
|
-
# navigation_y = File.readlines("lifeform/aspects/navigation_y.txt")
|
|
2210
|
-
#
|
|
2211
|
-
# navigational_ai = File.read("ainput/navigation/input.txt")
|
|
2212
|
-
#
|
|
2213
|
-
# if navigation_x[navigational_ai_x] == player_x and navigation_y[navigational_ai_y] == player_y
|
|
2214
|
-
# puts ">> Your pet spider pig moved in the direction of your player for ear scratches."
|
|
2215
|
-
#
|
|
2216
|
-
# enemy_spotted
|
|
2217
|
-
# else
|
|
2218
|
-
# puts ">> Your pet spider pig stays where its at sitting on its eight legs..."
|
|
2219
|
-
# end
|
|
2220
|
-
#end
|
|
2221
|
-
|
|
2222
|
-
def self.behaviours
|
|
2223
|
-
behaviours = File.readlines("lifeform/aspects/behaviours.txt")
|
|
2224
|
-
behaviours_ai = File.read("ainput/behaviours/input.txt").strip.to_i
|
|
2225
|
-
|
|
2226
|
-
current_behavours = behaviours[behaviours_ai]
|
|
2227
|
-
|
|
2228
|
-
if current_behaviours == "Spins spidersilk..."
|
|
2229
|
-
puts ">> Your pet spider pig spins some spidersilk..."
|
|
2230
|
-
elsif current_behaviours == "Bites the player..."
|
|
2231
|
-
puts ">> Your pet spider bites the player affectionately..."
|
|
2043
|
+
decision_made = conditions.sample
|
|
2232
2044
|
|
|
2233
|
-
|
|
2045
|
+
puts "\e[38;2;187;127;118mBy process of elimination, the bot chose: #{ai_data}\e[0m"
|
|
2234
2046
|
|
|
2235
|
-
|
|
2236
|
-
end
|
|
2237
|
-
end
|
|
2047
|
+
@cchoice = "#{ai_data}"
|
|
2238
2048
|
|
|
2239
|
-
|
|
2240
|
-
noises = File.readlines("lifeform/aspects/noises.txt")
|
|
2241
|
-
noises_ai = File.read("ainput/noises/input.txt").strip.to_i
|
|
2242
|
-
current_noises = noises[noises_ai]
|
|
2049
|
+
puts $cchoice
|
|
2243
2050
|
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2051
|
+
break
|
|
2052
|
+
else
|
|
2053
|
+
ai_choice = File.read("lib/data/ai/ai_choice.txt").to_s.to_i
|
|
2054
|
+
ai_data = File.readlines("lib/data/ai/candidates.txt")
|
|
2055
|
+
ai_search_limit = ai_data.size.to_i
|
|
2056
|
+
ai_next_candidate = ai_data[ai_choice]
|
|
2250
2057
|
|
|
2251
|
-
|
|
2252
|
-
#Switch to routine determine damage rate.
|
|
2253
|
-
healing_accuracy = {
|
|
2254
|
-
"enemy" => "gribatomaton",
|
|
2255
|
-
"gribatomaton" => "player",
|
|
2256
|
-
"player" => "enemy",
|
|
2257
|
-
}
|
|
2058
|
+
ai_data = user_data.slice!(ai_choice).strip
|
|
2258
2059
|
|
|
2259
|
-
|
|
2060
|
+
puts "\e[38;2;187;127;118mEnemy found the option #{ai_data}\e[0m"
|
|
2260
2061
|
|
|
2261
|
-
|
|
2062
|
+
enemy_decision = ["choose", "skip"]
|
|
2262
2063
|
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2064
|
+
decision_made = enemy_decision.sample
|
|
2065
|
+
|
|
2066
|
+
if decision_made == "choose"
|
|
2067
|
+
puts "\e[38;2;187;127;118mThe enemy chose: #{ai_data}, but found it causes a stalemate. Makes a new decision\e[0m"
|
|
2068
|
+
|
|
2069
|
+
@cchoice = "#{ai_data}"
|
|
2070
|
+
|
|
2071
|
+
enemy_decision = ["Epee", "Ishi", "Bache"]
|
|
2072
|
+
|
|
2073
|
+
decision_made = enemy_decision.sample
|
|
2271
2074
|
|
|
2272
|
-
|
|
2273
|
-
|
|
2075
|
+
if decision_made == "Sword"
|
|
2076
|
+
@cchoice = "Epee"
|
|
2077
|
+
elsif decision_made == "Stone"
|
|
2078
|
+
@cchoice = "Ishi"
|
|
2079
|
+
elsif decision_made == "Tarp"
|
|
2080
|
+
@cchoice = "Bache"
|
|
2081
|
+
end
|
|
2274
2082
|
|
|
2275
|
-
|
|
2083
|
+
break
|
|
2084
|
+
else
|
|
2085
|
+
puts "\e[38;2;187;127;118mEnemy weighed the option of choosing #{ai_data}, but decided to skip its turn.\e[0m"
|
|
2276
2086
|
|
|
2277
|
-
|
|
2087
|
+
break
|
|
2088
|
+
end
|
|
2278
2089
|
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2090
|
+
sleep(1.5)
|
|
2091
|
+
|
|
2092
|
+
open("lib/data/ai/candidates.txt", "w") { |f|
|
|
2093
|
+
f.puts ai_data
|
|
2094
|
+
}
|
|
2095
|
+
end
|
|
2285
2096
|
end
|
|
2286
2097
|
end
|
|
2287
2098
|
|
|
2288
|
-
def self.
|
|
2289
|
-
|
|
2290
|
-
"
|
|
2291
|
-
"pig" => "farmer",
|
|
2292
|
-
"farmer" => "spider",
|
|
2293
|
-
}
|
|
2099
|
+
def self.parser
|
|
2100
|
+
loop do
|
|
2101
|
+
system("clear")
|
|
2294
2102
|
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
@choice = @spider_choices.sample
|
|
2103
|
+
if $current_day < $lunar_ticks
|
|
2104
|
+
this_day = 29
|
|
2298
2105
|
|
|
2299
|
-
|
|
2300
|
-
|
|
2106
|
+
puts "\e[38;2;187;127;118mLa prochaine phase lunaire est en cours: #{this_day - $current_day} days...\e[0m"
|
|
2107
|
+
else
|
|
2108
|
+
lunar_cycle
|
|
2301
2109
|
|
|
2302
|
-
|
|
2303
|
-
|
|
2110
|
+
# Reset lunar ticks to twenty days away.
|
|
2111
|
+
$current_day = 1
|
|
2112
|
+
end
|
|
2304
2113
|
|
|
2305
|
-
|
|
2306
|
-
elsif monster_form[@choice] == @choice # Spider prevents attacking of player altogether.
|
|
2307
|
-
puts "Spider managed to prevent enemy from harming the player."
|
|
2114
|
+
menu = File.read("lib/images/menus/main.txt")
|
|
2308
2115
|
|
|
2309
|
-
|
|
2310
|
-
elsif @choice == @cchoice
|
|
2311
|
-
enemy_damage_formula
|
|
2312
|
-
else
|
|
2313
|
-
puts "Process was not understood..."
|
|
2314
|
-
end
|
|
2315
|
-
end
|
|
2316
|
-
end
|
|
2317
|
-
end
|
|
2116
|
+
puts menu
|
|
2318
2117
|
|
|
2319
|
-
|
|
2320
|
-
class Error < StandardError; end
|
|
2118
|
+
puts "\e[38;2;187;127;118m[ Currency is #{$player_franc} Francs And #{$player_yen} Yen ]\e[0m"
|
|
2321
2119
|
|
|
2322
|
-
|
|
2120
|
+
puts "\e[38;2;187;127;118m\n[ Stalemates: #{$stalemates} ] [ Player Strikes: #{$player_struck} ] [ Enemy Strikes: #{$enemy_struck} ]\e[0m"
|
|
2121
|
+
puts "\e[38;2;187;127;118m [ #{$player_lunario} Lunario ( You wont need this for most game functions. ) ]"
|
|
2323
2122
|
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
# Specfic multipliers for Earth index based objects.
|
|
2330
|
-
base_two = 2
|
|
2331
|
-
base_fro = 4
|
|
2332
|
-
base_six = 6
|
|
2333
|
-
base_eit = 8
|
|
2334
|
-
|
|
2335
|
-
# Size of specific objects.
|
|
2336
|
-
size_of_planets = base_radius ** base_fro
|
|
2337
|
-
size_of_moons = base_radius ** base_two
|
|
2338
|
-
size_of_stars = base_radius ** base_six
|
|
2339
|
-
size_of_blackholes = base_radius ** base_eit
|
|
2340
|
-
|
|
2341
|
-
# Total output sizes of specific objects.
|
|
2342
|
-
puts "The size of the planets is #{size_of_planets} radius."; sleep(3)
|
|
2343
|
-
puts "The size of the moons is #{size_of_moons} radius."; sleep(3)
|
|
2344
|
-
puts "The size of the stars is #{size_of_stars} radius."; sleep(3)
|
|
2345
|
-
puts "The size of a blackhole is #{size_of_blackholes} radius."; sleep(3)
|
|
2346
|
-
end
|
|
2347
|
-
|
|
2348
|
-
# Space between the objects.
|
|
2349
|
-
def self.negative_perimeters
|
|
2350
|
-
# Base distance between objects.
|
|
2351
|
-
base_distance = 1_000_000_000
|
|
2352
|
-
|
|
2353
|
-
# Estimated divider between specific objects to base distance.
|
|
2354
|
-
space_between_planets = 43.8
|
|
2355
|
-
space_between_moons = 14.6
|
|
2356
|
-
space_between_stars = 876
|
|
2357
|
-
space_between_blackholes = 2628
|
|
2358
|
-
|
|
2359
|
-
# Minimum distance between objects.
|
|
2360
|
-
planet_distance = base_distance / space_between_planets
|
|
2361
|
-
moon_distance = base_distance / space_between_moons
|
|
2362
|
-
star_distance = base_distance / space_between_stars
|
|
2363
|
-
blackhole_distance = base_distance / space_between_blackholes
|
|
2364
|
-
|
|
2365
|
-
# Actual distance between objects
|
|
2366
|
-
actual_planets = planet_distance * 10
|
|
2367
|
-
actual_moons = moon_distance * 10
|
|
2368
|
-
actual_stars = star_distance * 10
|
|
2369
|
-
actual_blackholes = blackhole_distance * 10
|
|
2370
|
-
|
|
2371
|
-
# The output results of distance between objects.
|
|
2372
|
-
puts "The distance between planets is #{actual_planets} miles."; sleep(3)
|
|
2373
|
-
puts "The distance between moons is #{actual_moons} miles."; sleep(3)
|
|
2374
|
-
puts "The distance between stars is #{actual_stars} miles."; sleep(3)
|
|
2375
|
-
puts "The distance between blackholes is #{actual_blackholes} miles."; sleep(3)
|
|
2376
|
-
end
|
|
2377
|
-
|
|
2378
|
-
end
|
|
2123
|
+
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
2124
|
+
puts "\e[38;2;187;127;118mSouer De Chaos ( Ana Nuveyatusuki ) HP: #{$player_hp} \e[0m"
|
|
2125
|
+
puts "\e[38;2;187;127;118m#{$current_monster_name} HP: #{$enemy_hp}\e[0m"
|
|
2126
|
+
#puts "\e[38;2;187;127;118mSouer De Commande ( Ana Nuveyatusuki ) HP: #{$enemy_hp}\e[0m"
|
|
2127
|
+
puts "\e[38;2;187;127;118m\n\e[0m"
|
|
2379
2128
|
|
|
2380
|
-
|
|
2381
|
-
|
|
2129
|
+
if $player_hp <= 0
|
|
2130
|
+
system("clear")
|
|
2382
2131
|
|
|
2383
|
-
|
|
2384
|
-
def self.positive_perimeters
|
|
2385
|
-
spaceship = File.read("_data/dynamic/positive_perimeters/spaceship_size.txt").strip.to_i
|
|
2386
|
-
space_station = spaceship * 200
|
|
2387
|
-
satalite = space_station / 10
|
|
2388
|
-
|
|
2389
|
-
puts "The total size of the space shuttle is #{spaceship} feet."; sleep(3)
|
|
2390
|
-
puts "The total size of the space station is #{space_station} feet."; sleep(3)
|
|
2391
|
-
puts "The total size of the satalite is #{satalite} feet."; sleep(3)
|
|
2392
|
-
end
|
|
2393
|
-
|
|
2394
|
-
# Space between the objects.
|
|
2395
|
-
def self.negative_perimeters
|
|
2396
|
-
base_multiplier = 10
|
|
2397
|
-
|
|
2398
|
-
# Minimum space between objects.
|
|
2399
|
-
space_between_spaceships = File.read("_data/dynamic/negative_perimeters/space_between_spaceships.txt").strip.to_i
|
|
2400
|
-
space_between_station = File.read("_data/dynamic/negative_perimeters/space_between_station.txt").strip.to_i
|
|
2401
|
-
space_between_satalite = File.read("_data/dynamic/negative_perimeters/space_between_satalite.txt").strip.to_i
|
|
2402
|
-
|
|
2403
|
-
# Actual space between objects
|
|
2404
|
-
actual_spaceship_distance = space_between_spaceships * base_multiplier
|
|
2405
|
-
actual_station_distance = space_between_station * base_multiplier
|
|
2406
|
-
actual_satalite_distance = space_between_satalite * base_multiplier
|
|
2407
|
-
|
|
2408
|
-
puts "The minimum space between shuttles is #{actual_spaceship_distance} feet."; sleep(3)
|
|
2409
|
-
puts "The minimum space between stations is #{actual_station_distance} feet."; sleep(3)
|
|
2410
|
-
puts "The minimum space between satalites is #{actual_satalite_distance} feet."; sleep(3)
|
|
2411
|
-
end
|
|
2132
|
+
puts "\e[38;2;187;127;118mYou've been zombiefied!\e[0m"
|
|
2412
2133
|
|
|
2413
|
-
|
|
2134
|
+
sleep(1.5)
|
|
2414
2135
|
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2136
|
+
YumemoireZombieMode::ZombieMode.parser
|
|
2137
|
+
elsif $enemy_hp <= 0
|
|
2138
|
+
puts "\e[38;2;187;127;118mYou won\e[0m"
|
|
2418
2139
|
|
|
2419
|
-
|
|
2420
|
-
:moon_radius,
|
|
2421
|
-
:star_radius,
|
|
2422
|
-
:blackhole_radius,
|
|
2423
|
-
:distance_between_planets,
|
|
2424
|
-
:distance_between_moons,
|
|
2425
|
-
:distance_between_stars,
|
|
2426
|
-
:distance_between_blackholes,
|
|
2427
|
-
:spaceshuttle_size,
|
|
2428
|
-
:spacestation_size,
|
|
2429
|
-
:size_of_satalight,
|
|
2430
|
-
:minimum_space_between_shuttles,
|
|
2431
|
-
:minimum_space_between_stations,
|
|
2432
|
-
:minimum_space_between_satalights,
|
|
2433
|
-
)
|
|
2434
|
-
|
|
2435
|
-
spatial.train(:planet_radius, "The size of the planets is 39062500000000 radius.", "word")
|
|
2436
|
-
spatial.train(:moon_radius, "The size of the moons is 6250000 radius.", "word")
|
|
2437
|
-
spatial.train(:star_radius, "The size of the stars is 244140625000000000000 radius.", "word")
|
|
2438
|
-
spatial.train(:blackhole_radius, "The size of a blackhole is 1525878906250000000000000000 radius.", "word")
|
|
2439
|
-
spatial.train(:distance_between_planets, "The distance between planets is 228310502.28310502 miles.", "word")
|
|
2440
|
-
spatial.train(:distance_between_moons, "The distance between moons is 684931506.849315 miles.", "word")
|
|
2441
|
-
spatial.train(:distance_between_stars, "The distance between stars is 11415520 miles.", "word")
|
|
2442
|
-
spatial.train(:distance_between_blackholes, "The distance between blackholes is 3805170 miles.", "word")
|
|
2443
|
-
spatial.train(:spaceshuttle_size, "The total size of the space shuttle is 5 feet.", "word")
|
|
2444
|
-
spatial.train(:spacestation_size, "The total size of the space station is 1000 feet.", "word")
|
|
2445
|
-
spatial.train(:size_of_satalight, "The total size of the satalite is 100 feet.", "word")
|
|
2446
|
-
spatial.train(:minimum_space_between_shuttles, "The minimum space between shuttles is 50 feet.", "word")
|
|
2447
|
-
spatial.train(:minimum_space_between_stations, "The minimum space between stations is 50 feet.", "word")
|
|
2448
|
-
spatial.train(:minimum_space_between_satalights, "The minimum space between satalites is 50 feet.", "word")
|
|
2449
|
-
|
|
2450
|
-
spatial_relationships = File.readlines("_input/relationships.txt")
|
|
2140
|
+
gets.chomp
|
|
2451
2141
|
|
|
2452
|
-
|
|
2142
|
+
abort
|
|
2143
|
+
end
|
|
2453
2144
|
|
|
2454
|
-
|
|
2145
|
+
conditions = {
|
|
2146
|
+
"Epee" => "Ishi",
|
|
2147
|
+
"Ishi" => "Bache",
|
|
2148
|
+
"Bache" => "Epee",
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
if $has_spider == true
|
|
2152
|
+
puts "\e[38;2;187;127;118mTo heal the player, type: Heal\e[0m"
|
|
2153
|
+
else
|
|
2154
|
+
puts "\e[38;2;187;127;118mTo heal the player, type: Sleep\e[0m"
|
|
2155
|
+
end
|
|
2156
|
+
|
|
2157
|
+
print "\e[38;2;164;145;91m\nEpee, Ishi, or Bache >> \e[0m"
|
|
2158
|
+
@choice = gets.chomp.capitalize
|
|
2159
|
+
|
|
2160
|
+
if @choice == "Epee"
|
|
2161
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
2162
|
+
f.puts "0"
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
# Records a history of player actions.
|
|
2166
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
2167
|
+
f.puts "0"
|
|
2168
|
+
}
|
|
2169
|
+
elsif @choice == "Ishi"
|
|
2170
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
2171
|
+
f.puts "1"
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
# Records a history of player actions.
|
|
2175
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
2176
|
+
f.puts "1"
|
|
2177
|
+
}
|
|
2178
|
+
elsif @choice == "Bache"
|
|
2179
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
2180
|
+
f.puts "2"
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
# Records a history of player actions.
|
|
2184
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
2185
|
+
f.puts "2"
|
|
2186
|
+
}
|
|
2187
|
+
elsif @choice == "Sleep"
|
|
2188
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
2189
|
+
f.puts "2"
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
2193
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
2194
|
+
f.puts "2"
|
|
2195
|
+
}
|
|
2196
|
+
elsif @choice == "Heal"
|
|
2197
|
+
File.open("lib/input/user/user_choice.txt", "w") { |f|
|
|
2198
|
+
f.puts "2"
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
# Records a history of player actions. This one defaults to bache even though its a distinct action.
|
|
2202
|
+
File.open("lib/data/user/chosen_action.txt", "a") { |f|
|
|
2203
|
+
f.puts "2"
|
|
2204
|
+
}
|
|
2205
|
+
end
|
|
2455
2206
|
|
|
2456
|
-
size_limit.times do
|
|
2457
|
-
classification = spatial.classify(spatial_relationships[index].strip.to_s)
|
|
2458
|
-
|
|
2459
|
-
print classification
|
|
2460
2207
|
puts " "
|
|
2208
|
+
sleep(1.5)
|
|
2461
2209
|
|
|
2462
|
-
|
|
2210
|
+
# Experiment with using an enemy that learns from player's decisions.'
|
|
2211
|
+
YumemoireHumanMode::HumanMode.ai_decision
|
|
2212
|
+
|
|
2213
|
+
if conditions[@choice] == @cchoice
|
|
2214
|
+
#puts "\e[38;2;187;127;118m You were struck by the enemy!"
|
|
2215
|
+
|
|
2216
|
+
$enemy_struck = $enemy_struck + 1
|
|
2217
|
+
|
|
2218
|
+
# The amount of damage player gets is based on the enemies attack power.
|
|
2219
|
+
#$player_hp = $player_hp - $enemy_atk
|
|
2220
|
+
YumemoireFramework::DamageFormulas.enemy_damage_rate
|
|
2221
|
+
elsif @cchoice == @choice
|
|
2222
|
+
puts "\e[38;2;187;127;118mYou reach a stalemate.\e[0m"
|
|
2223
|
+
|
|
2224
|
+
$stalemates = $stalemates + 1
|
|
2225
|
+
elsif conditions[@cchoice] == @choice
|
|
2226
|
+
#puts "\e[38;2;187;127;118m You struck the enemy!"
|
|
2227
|
+
|
|
2228
|
+
$player_struck = $player_struck + 1
|
|
2229
|
+
|
|
2230
|
+
# The amount of damage enemy recieves is based on the player's attack power.
|
|
2231
|
+
#$enemy_hp = $enemy_hp - $player_atk
|
|
2232
|
+
YumemoireFramework::DamageFormulas.player_damage_rate
|
|
2233
|
+
elsif @choice == "Sleep"
|
|
2234
|
+
puts "\e[38;2;187;127;118mYou've opted to stay at an inn...'\e[0m"
|
|
2235
|
+
|
|
2236
|
+
sleep(1.5)
|
|
2237
|
+
|
|
2238
|
+
stay_at_inn
|
|
2239
|
+
elsif @choice == "Heal"
|
|
2240
|
+
puts "\e[38;2;187;127;118mThink quickly or you wont be able to heal properly....'\e[0m"
|
|
2241
|
+
|
|
2242
|
+
sleep(1.5)
|
|
2243
|
+
|
|
2244
|
+
spider_pig_farmer
|
|
2245
|
+
else
|
|
2246
|
+
puts "\e[38;2;187;127;118m#{@choice} is not a valid option\e[0m"
|
|
2247
|
+
end
|
|
2248
|
+
|
|
2249
|
+
$current_day = $current_day + 1
|
|
2463
2250
|
end
|
|
2464
2251
|
end
|
|
2252
|
+
end
|
|
2253
|
+
end
|
|
2254
|
+
|
|
2255
|
+
module YumemoireEncyclopedia
|
|
2256
|
+
class Encyclopedia
|
|
2257
|
+
|
|
2258
|
+
def self.monsternames
|
|
2259
|
+
possible_elements = File.readlines("monsternames/elements.txt")
|
|
2260
|
+
|
|
2261
|
+
$chosen_element = possible_elements.sample.strip.to_s
|
|
2262
|
+
|
|
2263
|
+
possible_adjectives = File.readlines("monsternames/gendered_adverb.txt")
|
|
2264
|
+
|
|
2265
|
+
$chosen_adjective = possible_adjectives.sample.strip.to_s
|
|
2266
|
+
|
|
2267
|
+
$current_monster_name = $chosen_element + " " + $chosen_adjective
|
|
2268
|
+
|
|
2269
|
+
puts "Created monster name: #{$current_monster_name}"
|
|
2270
|
+
end
|
|
2271
|
+
|
|
2272
|
+
def self.beastiary
|
|
2273
|
+
system("clear")
|
|
2274
|
+
|
|
2275
|
+
beasts = File.read("beasts/beasts.txt")
|
|
2276
|
+
|
|
2277
|
+
puts beasts
|
|
2278
|
+
|
|
2279
|
+
available_beasts = [
|
|
2280
|
+
"[Cochonbuta]", "[Ursinehomme]",
|
|
2281
|
+
"[Ursinepiros]", "[Kumabatto]",
|
|
2282
|
+
"[The Quantumcrusafied]",
|
|
2283
|
+
]
|
|
2284
|
+
|
|
2285
|
+
print "\nWhat kind of beast? ( Cochonbuta / Ursinehomme / Ursinepiros / Kumabatto / The Quantumcrusafied ) << "; do_beast = gets.chomp
|
|
2286
|
+
|
|
2287
|
+
if do_beast == "Cochonbuta"; print available_beasts[0]; puts " Combines a lobster and a boar, related to the spider pig."
|
|
2288
|
+
elsif do_beast == "Ursinehomme"; print available_beasts[1]; puts " Literally translates to bear-man, is the male version of wearbears. Ursinefemme is the female version."
|
|
2289
|
+
elsif do_beast == "Ursinepiros"; print available_beasts[2]; puts " Literally translates to vampire-bear, is the human version of wearbears that feeds on human's blood."
|
|
2290
|
+
elsif do_beast == "Kumabatto"; print available_beasts[3]; puts " A condensed version of 'Le Kumabatto De Les Ghoules', is the king of the bear-bat ghouls."
|
|
2291
|
+
elsif do_beast == "The Quantumcrusafied"; print available_beasts[4]; puts " The wandering spirits of men punished for quantum treason by quantum crusafiction."
|
|
2292
|
+
else
|
|
2293
|
+
puts ">> Not such beast exists on land or sea..."
|
|
2294
|
+
end
|
|
2295
|
+
|
|
2296
|
+
gets.chomp
|
|
2297
|
+
end
|
|
2298
|
+
|
|
2299
|
+
def self.study
|
|
2300
|
+
system("clear")
|
|
2301
|
+
|
|
2302
|
+
word_index = File.read("lib/encyclopedia/encyclopedia/glossary.txt")
|
|
2303
|
+
|
|
2304
|
+
puts word_index
|
|
2305
|
+
|
|
2306
|
+
print "\nWhat word would you like to look up? >> "; research = gets.chomp
|
|
2307
|
+
|
|
2308
|
+
if research == "Lunario"
|
|
2309
|
+
puts "BOB >> This is the largest form of in game currency, and is not used in ordinary game mechanics. It is mainly used for giving offerings to the lunar goddess, or paying the fair for dimension hopping that will come in the tiles version."
|
|
2310
|
+
|
|
2311
|
+
gets.chomp
|
|
2312
|
+
elsif research == "Yen"
|
|
2313
|
+
puts "BOB >> The smallest form of in game currency, this is mainly used for smaller fair items."
|
|
2314
|
+
|
|
2315
|
+
gets.chomp
|
|
2316
|
+
|
|
2317
|
+
elsif research == "Franc"
|
|
2318
|
+
puts "BOB >> This is the largest form of in game currency within the scope of standard in game use. Once the tiles version of released, Lunario exists as travel currency."
|
|
2319
|
+
|
|
2320
|
+
gets.chomp
|
|
2321
|
+
elsif research == "RPS"
|
|
2322
|
+
puts "BOB >> RPS ia the ancronym for a form of games based on the mechanics of rock, paper, and scissors."
|
|
2323
|
+
|
|
2324
|
+
gets.chomp
|
|
2325
|
+
elsif research == "exit"
|
|
2326
|
+
abort
|
|
2327
|
+
else
|
|
2328
|
+
end
|
|
2329
|
+
end
|
|
2330
|
+
|
|
2331
|
+
def self.translate
|
|
2332
|
+
print "What word would you like to translate? >> "; translate = gets.chomp
|
|
2465
2333
|
|
|
2334
|
+
# Get the word count based on how many words are in a sentence.
|
|
2335
|
+
#word_count = translate.split(" ").to_i
|
|
2336
|
+
|
|
2337
|
+
dictionary = {
|
|
2338
|
+
## Word Classes
|
|
2339
|
+
|
|
2340
|
+
## Francophonic
|
|
2341
|
+
"Le" => "The ( Masculine ) [ Francophonic ]",
|
|
2342
|
+
"La" => "The ( Feminine ) [ Francophonic ]",
|
|
2343
|
+
"Les" => "The ( Plural ) [ Francophonic ]",
|
|
2344
|
+
"Un" => "A [ Francophonic ]",
|
|
2345
|
+
"Une" => "An [ Francophonic ]",
|
|
2346
|
+
"Des" => "Some [ Francophonic ]",
|
|
2347
|
+
|
|
2348
|
+
## Japonic
|
|
2349
|
+
"Anu" => "The ( Masculine ) [ Pseudo-Japonic ]",
|
|
2350
|
+
"Ana" => "The ( Feminine ) [ Pseudo-Japonic ]",
|
|
2351
|
+
"Anos" => "The ( Plural ) [ Pseudo-Japonic ]",
|
|
2352
|
+
"Tu" => "A [ Pseudo-Japonic ]",
|
|
2353
|
+
"Ta" => "An [ Pseudo-Japonic ]",
|
|
2354
|
+
"Tos" => "Some [ Pseudo-Japaonic ]",
|
|
2355
|
+
|
|
2356
|
+
## German By Route Of Alsatian
|
|
2357
|
+
"Der" => "The ( Masculine ) [ Germanic ]",
|
|
2358
|
+
"Die" => "The ( Feminine ) [ Germanic ]",
|
|
2359
|
+
"Das" => "The ( Plural ) [ Germanic ]",
|
|
2360
|
+
"A" => "A [ Germanic ]",
|
|
2361
|
+
"Ein" => "An [ Germanic ]",
|
|
2362
|
+
|
|
2363
|
+
## Compound Word Specific Word Classes
|
|
2364
|
+
"Lanu" => "The ( masculine ) [ Ahusacos Specific ]",
|
|
2365
|
+
"Lana" => "The ( feminine ) [ Ahusacos Specific ]",
|
|
2366
|
+
"Lanos" => "The ( plural ) [ Ahusacos Specific ]",
|
|
2367
|
+
"Tun" => "A [ Ahusacos Specific ]",
|
|
2368
|
+
"Tan" => "An [ Ahusacos Specific ]",
|
|
2369
|
+
"Deso" => "It / Some [ Ahusacos Specific ]",
|
|
2370
|
+
|
|
2371
|
+
## Negation Clauses
|
|
2372
|
+
"Ne" => "Not [ Francophonic ]",
|
|
2373
|
+
"Na" => "Not [ Japonic ]",
|
|
2374
|
+
"Nix " => "Not [ Hybrid ]",
|
|
2375
|
+
"Nein" => "Not [ Germanic ]",
|
|
2376
|
+
|
|
2377
|
+
## Personal Pronouns
|
|
2378
|
+
"Je" => "I",
|
|
2379
|
+
"Vous" => "You all",
|
|
2380
|
+
"Toi" => "You",
|
|
2381
|
+
"Nous" => "We",
|
|
2382
|
+
"Il" => "He",
|
|
2383
|
+
"Ils" => "Him",
|
|
2384
|
+
"Elle" => "She",
|
|
2385
|
+
"Elles" => "Her",
|
|
2386
|
+
|
|
2387
|
+
## Common Posessives
|
|
2388
|
+
"mien" => "mine",
|
|
2389
|
+
"votre" => "your",
|
|
2390
|
+
"tien" => "yours",
|
|
2391
|
+
"notre" => "our",
|
|
2392
|
+
"notres" => "ours",
|
|
2393
|
+
"sien" => "his",
|
|
2394
|
+
"sienne" => "hers",
|
|
2395
|
+
|
|
2396
|
+
## Not used outside of context of military context, used to refer to groups of units.
|
|
2397
|
+
## In practice, right-wing factions use the wrong plural pronoun to misgender entire units
|
|
2398
|
+
## as a way to lower moral of left-wing factions. Because of this, after the Franco-Japanese
|
|
2399
|
+
## Wars, they stopped being used widely.
|
|
2400
|
+
|
|
2401
|
+
## War Plurals
|
|
2402
|
+
"Nousil" => "He plural",
|
|
2403
|
+
"Nousils" => "Him plural",
|
|
2404
|
+
"Nouselle" => "She plural",
|
|
2405
|
+
"Nouselles" => "Her plural",
|
|
2406
|
+
|
|
2407
|
+
## Plural Posessives
|
|
2408
|
+
"sienotre" => "our men",
|
|
2409
|
+
"sienenotre" => "our women",
|
|
2410
|
+
"sienotres" => "our men's",
|
|
2411
|
+
"sienenotres" => "our women's",
|
|
2412
|
+
|
|
2413
|
+
## Famille / Family
|
|
2414
|
+
|
|
2415
|
+
### Francophonic
|
|
2416
|
+
"Pere" => "Father",
|
|
2417
|
+
"Mere" => "Mother",
|
|
2418
|
+
"Frere" => "Brother",
|
|
2419
|
+
"Soeur" => "Sister",
|
|
2420
|
+
"Cousifrere" => "Male Cousin",
|
|
2421
|
+
"Cousisoeur" => "Female Cousin",
|
|
2422
|
+
"Cousiles" => "Both Cousins",
|
|
2423
|
+
"Tante" => "Aunt",
|
|
2424
|
+
"Oncle" => "Uncle",
|
|
2425
|
+
|
|
2426
|
+
### Color Acidity Framework
|
|
2427
|
+
# These colors are for a system that rates colors based on their acidity or alkalinity.
|
|
2428
|
+
|
|
2429
|
+
##### Reds
|
|
2430
|
+
"PH4DR1" => "Salmon",
|
|
2431
|
+
"PH5DR1" => "Pale Salmon",
|
|
2432
|
+
"PH4DR3" => "Salmon Pink",
|
|
2433
|
+
|
|
2434
|
+
##### Oranges
|
|
2435
|
+
"PH4DR2" => "Copper",
|
|
2436
|
+
"PH8WE1" => "Japanese Bistre",
|
|
2437
|
+
|
|
2438
|
+
##### Yellow
|
|
2439
|
+
"PH6DR1" => "Maize",
|
|
2440
|
+
"PH5DR2" => "Khaki",
|
|
2441
|
+
"PH6DR3" => "Bland",
|
|
2442
|
+
|
|
2443
|
+
##### Green
|
|
2444
|
+
"PH6DR2" => "Pale Lime",
|
|
2445
|
+
"PH7NU1" => "Vibrant Green",
|
|
2446
|
+
"PH7NU2" => "Medium Green",
|
|
2447
|
+
"PH8WE2" => "Kelly Green",
|
|
2448
|
+
|
|
2449
|
+
##### Blue
|
|
2450
|
+
"PH9WE2" => "Viridian",
|
|
2451
|
+
"PHAWE3" => "Ultramarine",
|
|
2452
|
+
"PH9WE3" => "Muted Sapphire",
|
|
2453
|
+
"PH8WE3" => "Dark Sapphire",
|
|
2454
|
+
"PH7NU3" => "Grey Blue",
|
|
2455
|
+
|
|
2456
|
+
##### Purple
|
|
2457
|
+
"PH9WE1" => "Dull Purple",
|
|
2458
|
+
"PH5DR3" => "Light Mauve",
|
|
2459
|
+
|
|
2460
|
+
##### Unusual Or Rare Color
|
|
2461
|
+
"PH1WE3CH1" => "Dark Lavender", # A theoretical compound that blends Salmon with Sapphire blue.
|
|
2462
|
+
"PH4WE2CH2" => "Atomic Hazel", # A highly toxic combination of copper and arsenic.
|
|
2463
|
+
"Atomic Hazel" => "#6D6C46", # Hex code for atomic hazel.
|
|
2464
|
+
|
|
2465
|
+
### Chomatic Shades
|
|
2466
|
+
### Arsenic Scale
|
|
2467
|
+
|
|
2468
|
+
### Unknown Origin
|
|
2469
|
+
"PHAWE1" => "Bordeaux", # I don't know how I got this color.'
|
|
2470
|
+
|
|
2471
|
+
### Hand Mixed Colors
|
|
2472
|
+
"#83b281" => "Dusty Green",
|
|
2473
|
+
|
|
2474
|
+
### Synthesized From Real Colors
|
|
2475
|
+
"#A9A8AD" => "Faded Carolina Blue", # Pale Lime, Salmon Pink, Bland, Grey Blue [ Hypothesis Acidic Blue ]
|
|
2476
|
+
"#A0A5B9" => "Manilla Lavender", # Salmon, Pale Salmon, Grey Blue, Grey Blue [ Hypothesis Slightly Alkaline Grey Blue ]
|
|
2477
|
+
"#8cc874" => "Asparagus", # Pale Lime, Maize, Light Mauve, Medium Green [ Hypothesis Alkaline Green ]
|
|
2478
|
+
"#a0b36c" => "Tan Green", # Pale Salmon, Kelly Green, Bland, Khaki [ Hypothesis Slightly Tan Green ]
|
|
2479
|
+
"#5673A9" => "Dusky Blue", # Grey Blue, Light Mauve, Khaki, Sapphire [ Hypothesis Highly Alkaline Blue ]
|
|
2480
|
+
"#A59C94" => "Warm Grey", # Vibrant Green, Salmon, Sapphire Dark, Bland [ Hypothesis Slightly Acidic Grey ]
|
|
2481
|
+
|
|
2482
|
+
### Synthesized From Synthetic Colors
|
|
2483
|
+
"#788a9a" => "Steel", # Faded Carolina Blue, Tan Green, Warm Grey, Dusky Blue [ Hypothesis Slightly Alkaline Medium Chromatic Blue ]
|
|
2484
|
+
"#415588" => "Dusky Blue Medium" # Genetically related to standard Dusky blue. Faded Carolina Blue, Tan Green, Warm Grey, Dusky Blue [ Hypothesis More Shaded Alkaline Blue ]
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
print "Your translation: "
|
|
2488
|
+
print "#{translate} => #{dictionary[translate]}"
|
|
2489
|
+
puts " "
|
|
2490
|
+
|
|
2491
|
+
gets.chomp
|
|
2492
|
+
end
|
|
2493
|
+
|
|
2494
|
+
def self.detect_poison
|
|
2495
|
+
color_data = File.read("translation/input.txt").strip.to_s
|
|
2496
|
+
|
|
2497
|
+
## Natural colors
|
|
2498
|
+
if color_data == "Salmon"; sleep(1.5); system("./salmonbasic.sh")
|
|
2499
|
+
elsif color_data == "Pale Salmon"; sleep(1.5); system("./palesalmon.sh")
|
|
2500
|
+
elsif color_data == "Salmon Pink"; sleep(1.5); system("./salmonpink.sh")
|
|
2501
|
+
elsif color_data == "Copper"; sleep(1.5); system("./cooper.sh")
|
|
2502
|
+
elsif color_data == "Japanese Bistre"; sleep(1.5); system("./japanesebistre.sh")
|
|
2503
|
+
elsif color_data == "Maize"; sleep(1.5); system("./maize.sh")
|
|
2504
|
+
elsif color_data == "Khaki"; sleep(1.5); system("./khaki.sh")
|
|
2505
|
+
elsif color_data == "Bland"; sleep(1.5); system("./bland.sh")
|
|
2506
|
+
elsif color_data == "Pale Lime"; sleep(1.5); system("./palelime.sh")
|
|
2507
|
+
elsif color_data == "Vibrant Green"; sleep(1.5); system("./vibrantgreen.sh")
|
|
2508
|
+
elsif color_data == "Medium Green"; sleep(1.5); system("./mediuemgreen.sh")
|
|
2509
|
+
elsif color_data == "Kelly Green"; sleep(1.5); system("./kellygreen.sh")
|
|
2510
|
+
elsif color_data == "Viridian"; sleep(1.5); system("./viridian.sh")
|
|
2511
|
+
elsif color_data == "Ultramarine"; sleep(1.5); system("./ultramarine.sh")
|
|
2512
|
+
elsif color_data == "Muted Sapphire"; sleep(1.5); system("./mutedsapphire.sh")
|
|
2513
|
+
elsif color_data == "Dark Sapphire"; sleep(1.5); system("./darksapphire.sh")
|
|
2514
|
+
elsif color_data == "Grey Blue"; sleep(1.5); system("./greyblue.sh")
|
|
2515
|
+
elsif color_data == "Dull Purple"; sleep(1.5); system("./dullpurple.sh")
|
|
2516
|
+
elsif color_data == "Light Mauve"; sleep(1.5); system("./lightmauve.sh")
|
|
2517
|
+
elsif color_data == "Dark Lavender"; sleep(1.5); system("./darklavender.sh")
|
|
2518
|
+
elsif color_data == "Atomic Hazel"; sleep(1.5); system("./atomichazel.sh")
|
|
2519
|
+
|
|
2520
|
+
## Synthesized Colors
|
|
2521
|
+
elsif color_data == "Faded Carolina Blue"; sleep(1.5); system("./fadedcarolinablue.sh")
|
|
2522
|
+
elsif color_data == "Dusky Blue"; sleep(1.5); system("./duskyblue.sh")
|
|
2523
|
+
|
|
2524
|
+
## Double Processed Synthesized Colors
|
|
2525
|
+
|
|
2526
|
+
else
|
|
2527
|
+
sleep(1.5)
|
|
2528
|
+
|
|
2529
|
+
puts ">> Either that's not a color, or no color information has yet been found."
|
|
2530
|
+
end
|
|
2531
|
+
end
|
|
2466
2532
|
end
|
|
2467
2533
|
end
|