aro 0.1.8 → 0.1.9
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/bin/aos +5 -0
- data/bin/aro +5 -2
- data/checksums/aro-0.1.9.gem.sha512 +1 -0
- data/db/migrate/1763374647_create_decks.rb +2 -2
- data/listen.rb +1 -1
- data/locale/en.aos.yml +5 -1
- data/locale/en.cngelog.yml +1 -1
- data/locale/en.dom.yml +42 -0
- data/locale/en.usage.yml +14 -3
- data/locale/en.yml +9 -15
- data/sys/aos/aos.rb +183 -100
- data/sys/aos/db.rb +4 -5
- data/sys/aos/views/base.rb +34 -18
- data/sys/aos/views/dom.rb +1 -10
- data/sys/aos/views/games/game.rb +90 -0
- data/sys/aos/views/setup/settings.rb +3 -16
- data/sys/aos/you.rb +4 -0
- data/sys/aro/db.rb +4 -5
- data/sys/aro/mancy.rb +16 -9
- data/sys/aro/p.rb +2 -2
- data/sys/cli/config.rb +92 -35
- data/sys/cli/constants.rb +3 -3
- data/sys/cli/deck.rb +13 -8
- data/sys/cli/dom.rb +11 -4
- data/sys/dom/d.rb +24 -14
- data/sys/dom/dom.rb +37 -26
- data/sys/dom/p.rb +1 -1
- data/sys/models/deck.rb +11 -7
- data/sys/reiquire.rb +1 -0
- data/sys/shr/prompt.rb +4 -0
- data/sys/shr/t.rb +12 -10
- data/sys/shr/version.rb +4 -2
- metadata +5 -3
- data/sys/aos/views/games/deck.rb +0 -95
data/sys/cli/deck.rb
CHANGED
|
@@ -13,11 +13,11 @@ module CLI
|
|
|
13
13
|
def self.deck
|
|
14
14
|
action = CLI::ARGV1&.to_sym
|
|
15
15
|
|
|
16
|
-
if CLI::FLAGS[:HELP].include?(
|
|
16
|
+
if CLI::FLAGS[:HELP].include?(action.to_s)
|
|
17
17
|
# todo: breakout usage into subcommand-specific verbiage
|
|
18
18
|
CLI.usage::usage
|
|
19
19
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
20
|
-
elsif
|
|
20
|
+
elsif action.nil? || action == :aos
|
|
21
21
|
# no args, open deck menu
|
|
22
22
|
Aro::Db.new
|
|
23
23
|
Aro::Deck.display_selection_menu
|
|
@@ -51,7 +51,7 @@ module CLI
|
|
|
51
51
|
Aro::P.say(I18n.t("cli.messages.replacing_drawn", name: Aro::Mancy.game.name))
|
|
52
52
|
Aro::Mancy.game.replace
|
|
53
53
|
when CLI::CMDS[:DECK][:RESET]
|
|
54
|
-
if Aro::Mancy::YES.to_s != Aro::P.p.ask(I18n.t("cli.messages.confirmation_prompt", name: Aro::Mancy.game.name))
|
|
54
|
+
if Aro::Mancy::YES.to_s != Aro::P.p.ask("#{Aro::Mancy::PS1}#{I18n.t("cli.messages.confirmation_prompt", name: Aro::Mancy.game.name)}")
|
|
55
55
|
Aro::P.say(I18n.t("cli.messages.understood", name: Aro::Mancy.game.name))
|
|
56
56
|
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
57
57
|
end
|
|
@@ -60,6 +60,11 @@ module CLI
|
|
|
60
60
|
Aro::Mancy.game.reset
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
+
if ARGV.include?(:aos.to_s)
|
|
64
|
+
# run silent
|
|
65
|
+
exit(CLI::EXIT_CODES[:SUCCESS])
|
|
66
|
+
end
|
|
67
|
+
|
|
63
68
|
Aro::Mancy.game.show(**CLI::shoptions)
|
|
64
69
|
end
|
|
65
70
|
end
|
|
@@ -70,23 +75,23 @@ module CLI
|
|
|
70
75
|
show_options_count = Aro::Mancy::S
|
|
71
76
|
show_options_order = Aro::Log::ORDERING[:DESC]
|
|
72
77
|
|
|
73
|
-
# Aro::
|
|
78
|
+
# Aro::D.say("ARGV.map{|a| a.to_sym} => #{ARGV.map{|a| a.to_sym}}")
|
|
74
79
|
|
|
75
80
|
count_option_flags = ARGV.map{|a| a.to_sym} & CLI::FLAGS[:SHOW_COUNT]
|
|
76
|
-
# Aro::
|
|
81
|
+
# Aro::D.say("count_option_flags: #{count_option_flags}")
|
|
77
82
|
if count_option_flags.any?
|
|
78
83
|
# get the ARGV index element after flag index
|
|
79
84
|
show_options_count = ARGV[ARGV.index(count_option_flags.first.to_s) + 1]
|
|
80
85
|
show_options_count = show_options_count.to_i unless [0, nil].include?(show_options_count&.to_i)
|
|
81
|
-
# Aro::
|
|
86
|
+
# Aro::D.say("show_options_count: #{show_options_count}")
|
|
82
87
|
end
|
|
83
88
|
|
|
84
89
|
order_option_flags = ARGV.map{|a| a.to_sym} & CLI::FLAGS[:SHOW_ORDER]
|
|
85
|
-
# Aro::
|
|
90
|
+
# Aro::D.say("count_option_flags: #{order_option_flags}")
|
|
86
91
|
if order_option_flags.any?
|
|
87
92
|
# get the ARGV index element after flag index
|
|
88
93
|
show_options_order = ARGV[ARGV.index(order_option_flags.first.to_s) + 1].to_sym
|
|
89
|
-
Aro::
|
|
94
|
+
# Aro::D.say("show_options_order: #{show_options_order}")
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
{
|
data/sys/cli/dom.rb
CHANGED
|
@@ -22,13 +22,20 @@ module CLI
|
|
|
22
22
|
|
|
23
23
|
case action
|
|
24
24
|
when CLI::CMDS[:DOM][:INIT]
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
if Aro::Dom.is_initialized?
|
|
26
|
+
Aro::P.say(I18n.t("dom.errors.failed_already_initialized"))
|
|
27
|
+
elsif Aro::Dom.in_arodom? && !Aro::Dom.is_initialized?
|
|
28
|
+
arodome = Aro::Dom.new
|
|
29
|
+
arodome.generate
|
|
30
|
+
else
|
|
31
|
+
CLI::Nterface.exit_error_invalid_usage!
|
|
32
|
+
end
|
|
27
33
|
when CLI::CMDS[:DOM][:NEW]
|
|
28
34
|
CLI::Nterface.exit_error_missing_args! if CLI::ARGV2.nil?
|
|
29
35
|
if Aro::Dom.in_arodom?
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
Aro::P.say(I18n.t("dom.errors.failed_already_in_arodom"))
|
|
37
|
+
elsif Aro::Mancy.in_aro?
|
|
38
|
+
Aro::P.say(I18n.t("dom.errors.failed_in_aro_space"))
|
|
32
39
|
else
|
|
33
40
|
Aro::Dom.create(CLI::ARGV2.to_s)
|
|
34
41
|
end
|
data/sys/dom/d.rb
CHANGED
|
@@ -12,50 +12,60 @@ require_relative :dom.to_s
|
|
|
12
12
|
|
|
13
13
|
module Aro
|
|
14
14
|
class Dom::D
|
|
15
|
-
|
|
15
|
+
def self.reserved_words
|
|
16
|
+
reserved = []
|
|
17
|
+
Aro::Dom::D::LAYOUT.values.each{|wing|
|
|
18
|
+
reserved << wing[:name].to_s
|
|
19
|
+
wing[:rooms].each{|room| reserved << room[:name].to_s}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
reserved.sort
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# definition of rooms in each layout wing
|
|
16
26
|
WINGS = {
|
|
17
27
|
WELCOME: {
|
|
18
28
|
WAITE: {
|
|
19
29
|
name: Aro::Dom::WAITE,
|
|
20
|
-
description: "
|
|
30
|
+
description: I18n.t("dom.rooms.waite.description"),
|
|
21
31
|
},
|
|
22
32
|
WINNER: {
|
|
23
33
|
name: Aro::Dom::WINNER,
|
|
24
|
-
description: "
|
|
34
|
+
description: I18n.t("dom.rooms.winner.description"),
|
|
25
35
|
},
|
|
26
36
|
},
|
|
27
37
|
GAMES: {
|
|
28
38
|
ABPPS: {
|
|
29
39
|
name: Aro::Dom::ABPPS,
|
|
30
|
-
description: "
|
|
40
|
+
description: I18n.t("dom.rooms.abpps.description"),
|
|
31
41
|
},
|
|
32
42
|
HBPPS: {
|
|
33
43
|
name: Aro::Dom::HBPPS,
|
|
34
|
-
description: "
|
|
44
|
+
description: I18n.t("dom.rooms.hbpps.description"),
|
|
35
45
|
},
|
|
36
46
|
SHPPS: {
|
|
37
47
|
name: Aro::Dom::SHPPS,
|
|
38
|
-
description: "
|
|
48
|
+
description: I18n.t("dom.rooms.shpps.description"),
|
|
39
49
|
},
|
|
40
50
|
VIPPS: {
|
|
41
51
|
name: Aro::Dom::VIPPS,
|
|
42
|
-
description: "
|
|
52
|
+
description: I18n.t("dom.rooms.vipps.description"),
|
|
43
53
|
},
|
|
44
54
|
},
|
|
45
55
|
KNOW: {
|
|
46
56
|
LIBRARY: {
|
|
47
57
|
name: Aro::Dom::LIBRARY,
|
|
48
|
-
description: "
|
|
58
|
+
description: I18n.t("dom.rooms.library.description"),
|
|
49
59
|
},
|
|
50
60
|
TEMPLE: {
|
|
51
61
|
name: Aro::Dom::TEMPLE,
|
|
52
|
-
description: "
|
|
62
|
+
description: I18n.t("dom.rooms.temple.description"),
|
|
53
63
|
},
|
|
54
64
|
},
|
|
55
65
|
SETUP: {
|
|
56
66
|
SETTINGS: {
|
|
57
67
|
name: Aro::Dom::SETTINGS,
|
|
58
|
-
description: "
|
|
68
|
+
description: I18n.t("dom.rooms.settings.description"),
|
|
59
69
|
},
|
|
60
70
|
},
|
|
61
71
|
}
|
|
@@ -64,7 +74,7 @@ module Aro
|
|
|
64
74
|
LAYOUT = {
|
|
65
75
|
WELCOME: {
|
|
66
76
|
name: Aro::Dom::WELCOME,
|
|
67
|
-
description: "
|
|
77
|
+
description: I18n.t("dom.wings.welcome.description"),
|
|
68
78
|
rooms: [
|
|
69
79
|
Aro::Dom::D::WINGS[:WELCOME][:WAITE],
|
|
70
80
|
Aro::Dom::D::WINGS[:WELCOME][:WINNER],
|
|
@@ -72,7 +82,7 @@ module Aro
|
|
|
72
82
|
},
|
|
73
83
|
GAMES: {
|
|
74
84
|
name: Aro::Dom::GAMES,
|
|
75
|
-
description: "
|
|
85
|
+
description: I18n.t("dom.wings.games.description"),
|
|
76
86
|
rooms: [
|
|
77
87
|
Aro::Dom::D::WINGS[:GAMES][:ABPPS],
|
|
78
88
|
Aro::Dom::D::WINGS[:GAMES][:HBPPS],
|
|
@@ -82,7 +92,7 @@ module Aro
|
|
|
82
92
|
},
|
|
83
93
|
KNOW: {
|
|
84
94
|
name: Aro::Dom::KNOW,
|
|
85
|
-
description: "
|
|
95
|
+
description: I18n.t("dom.wings.know.description"),
|
|
86
96
|
rooms: [
|
|
87
97
|
Aro::Dom::D::WINGS[:KNOW][:LIBRARY],
|
|
88
98
|
Aro::Dom::D::WINGS[:KNOW][:TEMPLE]
|
|
@@ -90,7 +100,7 @@ module Aro
|
|
|
90
100
|
},
|
|
91
101
|
SETUP: {
|
|
92
102
|
name: Aro::Dom::SETUP,
|
|
93
|
-
description: "
|
|
103
|
+
description: I18n.t("dom.wings.setup.description"),
|
|
94
104
|
rooms: [
|
|
95
105
|
Aro::Dom::D::WINGS[:SETUP][:SETTINGS]
|
|
96
106
|
],
|
data/sys/dom/dom.rb
CHANGED
|
@@ -12,48 +12,47 @@ require_relative :"../aos/s".to_s
|
|
|
12
12
|
|
|
13
13
|
module Aro
|
|
14
14
|
class Dom
|
|
15
|
-
PS1 = Aro::Dom.name
|
|
15
|
+
PS1 = :">[#{Aro::Dom.name}]>: "
|
|
16
16
|
DOT = :"."
|
|
17
17
|
DOTT = :"#{DOT}#{DOT}"
|
|
18
18
|
ETHERGEIST = :ethergeist
|
|
19
19
|
ETHER_FILE = :".#{Aro::Dom::ETHERGEIST}"
|
|
20
20
|
|
|
21
|
-
# < root
|
|
21
|
+
# < root space
|
|
22
22
|
ARODOME = :arodome
|
|
23
23
|
|
|
24
|
-
# < user
|
|
24
|
+
# < user spaces
|
|
25
25
|
WELCOME = :welcome
|
|
26
26
|
GAMES = :games
|
|
27
27
|
KNOW = :know
|
|
28
28
|
SETUP = :setup
|
|
29
29
|
|
|
30
|
-
# > welcome
|
|
30
|
+
# > welcome spaces
|
|
31
31
|
WAITE = :waite
|
|
32
32
|
WINNER = :winner
|
|
33
33
|
|
|
34
|
-
# > game
|
|
34
|
+
# > game spaces
|
|
35
35
|
ABPPS = :abpps
|
|
36
36
|
HBPPS = :hbpps
|
|
37
37
|
SHPPS = :shpps
|
|
38
38
|
VIPPS = :vipps
|
|
39
39
|
|
|
40
|
-
# > know
|
|
40
|
+
# > know spaces
|
|
41
41
|
LIBRARY = :library
|
|
42
42
|
TEMPLE = :temple
|
|
43
43
|
# ...
|
|
44
44
|
|
|
45
|
-
# > setup
|
|
45
|
+
# > setup spaces
|
|
46
46
|
SETTINGS = :settings
|
|
47
47
|
# ...
|
|
48
48
|
|
|
49
49
|
def self.create(name)
|
|
50
50
|
if Dir.exist?(name) || File.exist?(name)
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
Aro::Dom::P.say(I18n.t("dom.errors.failed_directory_exists", name: name))
|
|
52
|
+
return
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
Aro::Dom::P.say("creating arodome named #{name}")
|
|
55
|
+
Aro::Dom::P.say(I18n.t("dom.messages.creating_arodome", name: name))
|
|
57
56
|
FileUtils.mkdir(name)
|
|
58
57
|
ether_file_path = "#{name}/#{Aro::Dom::ETHER_FILE}"
|
|
59
58
|
FileUtils.mkdir(ether_file_path)
|
|
@@ -61,16 +60,25 @@ module Aro
|
|
|
61
60
|
file.write(name)
|
|
62
61
|
end
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
Aro::Dom::P.say("#{name} arodome created. enter the following commands to begin.")
|
|
66
|
-
Aro::Dom::P.say("$ cd #{name}")
|
|
67
|
-
Aro::Dom::P.say("$ aro dom init")
|
|
63
|
+
Aro::Dom::P.say(I18n.t("dom.messages.arodome_created", name: name))
|
|
68
64
|
end
|
|
69
65
|
|
|
70
66
|
def self.in_arodom?
|
|
71
67
|
!Aro::Dom.ethergeist_path.nil?
|
|
72
68
|
end
|
|
73
69
|
|
|
70
|
+
def self.is_initialized?
|
|
71
|
+
File.exist?(File.join(Aro::Dom::ethergeist_path, Aos::Db::SQL_FILE.to_s))
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def self.domain
|
|
75
|
+
"#{Aro::Dom}#{Aos::Os::A}#{Aro::Dom.ethergeist_name}"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def self.dom_root
|
|
79
|
+
Aro::Dom.in_arodom? ? File.dirname(Aro::Dom::ethergeist_path) : nil
|
|
80
|
+
end
|
|
81
|
+
|
|
74
82
|
def self.room_path(needle)
|
|
75
83
|
return nil if needle.nil?
|
|
76
84
|
needle = needle.to_s.strip
|
|
@@ -103,7 +111,6 @@ module Aro
|
|
|
103
111
|
search_path.any?{|step|
|
|
104
112
|
search_pwd = File.join(search_pwd, step)
|
|
105
113
|
ls = Dir.glob("#{search_pwd}/#{ETHER_FILE}", File::FNM_DOTMATCH)
|
|
106
|
-
|
|
107
114
|
path = ls.first if ls.any?
|
|
108
115
|
!path.nil?
|
|
109
116
|
}
|
|
@@ -111,25 +118,29 @@ module Aro
|
|
|
111
118
|
return path
|
|
112
119
|
end
|
|
113
120
|
|
|
114
|
-
def self.
|
|
115
|
-
|
|
121
|
+
def self.ethergeist_name
|
|
122
|
+
return nil unless Aro::Dom.in_arodom?
|
|
123
|
+
|
|
124
|
+
File.read(
|
|
125
|
+
File.join(
|
|
126
|
+
Aro::Dom.ethergeist_path, Aro::Mancy::NAME_FILE.to_s
|
|
127
|
+
)
|
|
128
|
+
)
|
|
116
129
|
end
|
|
117
130
|
|
|
118
131
|
def generate
|
|
119
132
|
return unless Aro::Dom.in_arodom?
|
|
120
133
|
|
|
121
134
|
# todo: add file permissions to Aro::Dom::ARODOME and all WINGS
|
|
122
|
-
|
|
123
|
-
Aro::Dom::P.say("generating wings...")
|
|
135
|
+
Aro::Dom::P.say(I18n.t("dom.messages.generating_wings"))
|
|
124
136
|
Aro::Dom::D::LAYOUT.values.each{|w| generate_wing w}
|
|
125
|
-
|
|
126
|
-
Aro::Dom::P.say("
|
|
137
|
+
Aos::Db::new
|
|
138
|
+
Aro::Dom::P.say(I18n.t("dom.messages.initialization_complete", name: Aro::Dom.name))
|
|
127
139
|
end
|
|
128
140
|
|
|
129
141
|
def generate_wing(wing)
|
|
130
142
|
return unless Aro::Dom::D::LAYOUT.values.include?(wing)
|
|
131
|
-
|
|
132
|
-
Aro::Dom::P.say("generating the #{wing[:name]} wing...")
|
|
143
|
+
Aro::Dom::P.say(I18n.t("dom.messages.generating_wing", wing: wing[:name].to_s))
|
|
133
144
|
FileUtils.mkdir(wing[:name].to_s)
|
|
134
145
|
|
|
135
146
|
wing[:rooms].each{|r| generate_room(wing, r)}
|
|
@@ -138,7 +149,7 @@ module Aro
|
|
|
138
149
|
def generate_room(wing, room)
|
|
139
150
|
return unless Aro::Dom::D::WINGS[wing[:name].upcase].values.include?(room)
|
|
140
151
|
|
|
141
|
-
Aro::Dom::P.say("
|
|
152
|
+
Aro::Dom::P.say(I18n.t("dom.messages.generating_room", room: room[:name].to_s))
|
|
142
153
|
|
|
143
154
|
room_path = File.join(wing[:name].to_s, room[:name].to_s)
|
|
144
155
|
FileUtils.mkdir(room_path)
|
|
@@ -157,5 +168,5 @@ module Aro
|
|
|
157
168
|
)
|
|
158
169
|
)
|
|
159
170
|
end
|
|
160
|
-
end
|
|
171
|
+
end
|
|
161
172
|
end # aroadhome
|
data/sys/dom/p.rb
CHANGED
data/sys/models/deck.rb
CHANGED
|
@@ -42,9 +42,9 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
42
42
|
|
|
43
43
|
def generate_log
|
|
44
44
|
prev_cards = Base64::decode64(logs.last.card_data) if logs.any?
|
|
45
|
-
if prev_cards.present? && prev_cards != cards || prev_cards.nil?
|
|
45
|
+
if (prev_cards.present? && prev_cards != cards) || (prev_cards.nil? || prev_cards.empty?)
|
|
46
46
|
logs.create(
|
|
47
|
-
card_data: Base64::encode64(cards),
|
|
47
|
+
card_data: Base64::encode64(cards || ""),
|
|
48
48
|
drawn_data: Base64::encode64(drawn || "")
|
|
49
49
|
)
|
|
50
50
|
end
|
|
@@ -106,9 +106,9 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
106
106
|
# for now tests just expect text output
|
|
107
107
|
return h_logs if CLI::Config.is_test?
|
|
108
108
|
|
|
109
|
-
Aro::
|
|
109
|
+
Aro::D.say(I18n.t("cli.messages.showing", name: name, count: count_n, order: order_o))
|
|
110
110
|
|
|
111
|
-
Aos::Vi::
|
|
111
|
+
Aos::Vi::Game.show_game({
|
|
112
112
|
deck: self,
|
|
113
113
|
h_logs: h_logs,
|
|
114
114
|
count_n: count_n,
|
|
@@ -146,7 +146,7 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
146
146
|
# the deck. this will preserve all card orientations.
|
|
147
147
|
cards_arr = cards.split(Aro::Deck::CARD_DELIM.to_s) || []
|
|
148
148
|
drawn_arr = drawn&.split(Aro::Deck::CARD_DELIM.to_s) || []
|
|
149
|
-
|
|
149
|
+
|
|
150
150
|
# append each drawn card to cards
|
|
151
151
|
drawn_arr.each{|dc| cards_arr << dc }
|
|
152
152
|
|
|
@@ -154,7 +154,7 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
154
154
|
update(drawn: "", cards: cards_arr.join(Aro::Deck::CARD_DELIM.to_s))
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
-
def draw(is_dt_dimension: true, z_max: 7, z: 1)
|
|
157
|
+
def draw(is_dt_dimension: true, z_max: 7, z: 1)
|
|
158
158
|
# the true card
|
|
159
159
|
abs_dev_tarot = nil
|
|
160
160
|
|
|
@@ -168,6 +168,10 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
168
168
|
# get drawn
|
|
169
169
|
drawn_arr = drawn&.split(Aro::Deck::CARD_DELIM.to_s) || []
|
|
170
170
|
|
|
171
|
+
if cards_arr.empty?
|
|
172
|
+
Aro::P.say("there are no cards left to draw.")
|
|
173
|
+
return
|
|
174
|
+
end
|
|
171
175
|
sleeps = 0
|
|
172
176
|
sleeps_max = z_max
|
|
173
177
|
|
|
@@ -175,7 +179,7 @@ class Aro::Deck < ActiveRecord::Base
|
|
|
175
179
|
while sleeps <= sleeps_max && dev_tarot.nil? do
|
|
176
180
|
# use fallback randomness if /dev/tarot unavailable
|
|
177
181
|
if !is_dt_dimension || !File.exist?(Aro::T::DEV_TAROT_FILE.to_s)
|
|
178
|
-
dev_tarot = Aro::T.summon_ruby_facot
|
|
182
|
+
dev_tarot = Aro::T.summon_ruby_facot.split("")
|
|
179
183
|
else
|
|
180
184
|
# preferred randomness
|
|
181
185
|
read_value = Aro::T.read_dev_tarot&.strip&.split("")
|
data/sys/reiquire.rb
CHANGED
data/sys/shr/prompt.rb
CHANGED
data/sys/shr/t.rb
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
module Aro
|
|
12
12
|
module T
|
|
13
13
|
DEV_TAROT_FILE = :"/dev/tarot"
|
|
14
|
-
|
|
14
|
+
DEV_TAROT = :"Dev::Tarot".to_s
|
|
15
15
|
RUBY_FACOT = :"Ruby::Facot".to_s
|
|
16
16
|
|
|
17
17
|
def self.is_dev_tarot?
|
|
@@ -21,19 +21,21 @@ module Aro
|
|
|
21
21
|
# read dev_tarot
|
|
22
22
|
def self.read_dev_tarot
|
|
23
23
|
dt = nil
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
if Aro::T.is_dev_tarot? && File.exist?(Aro::T::DEV_TAROT_FILE.to_s)
|
|
25
|
+
File.open(Aro::T::DEV_TAROT_FILE.to_s, "r"){|dtf| dt = dtf.read(Aro::Mancy::N)}
|
|
26
|
+
# VERY IMPORTANT!
|
|
27
|
+
Aro::V.say(I18n.t("cli.very_important", dev_tarot: dt))
|
|
28
|
+
else
|
|
29
|
+
Aro::V.say("warning: summoning ruby_facot in #{__method__}")
|
|
30
|
+
dt = Aro::T.summon_ruby_facot unless Aro::T.is_dev_tarot?
|
|
31
|
+
end
|
|
30
32
|
return dt
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
# summon ruby_facot
|
|
34
|
-
def self.summon_ruby_facot
|
|
35
|
-
Aro::
|
|
36
|
-
ruby_facot =
|
|
36
|
+
def self.summon_ruby_facot
|
|
37
|
+
Aro::D.say(I18n.t("cli.messages.ruby_facot_random"))
|
|
38
|
+
ruby_facot = I18n.t("cards.index").map{|c| "+#{c}"}.sample.split("")
|
|
37
39
|
|
|
38
40
|
# get orientation
|
|
39
41
|
ruby_facot_str = ["+","-"].sample
|
data/sys/shr/version.rb
CHANGED
|
@@ -9,8 +9,10 @@
|
|
|
9
9
|
=end
|
|
10
10
|
|
|
11
11
|
module Aro
|
|
12
|
-
VERSION = :"0.1.
|
|
12
|
+
VERSION = :"0.1.9"
|
|
13
13
|
RELEASE_NOTES = :"this version".to_s + [
|
|
14
|
-
"
|
|
14
|
+
"adds improved views.",
|
|
15
|
+
"adds aro gameplay within an arodome game room.",
|
|
16
|
+
"adds ability to set config ivars from aos."
|
|
15
17
|
].join(",")
|
|
16
18
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: aro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- i2097i
|
|
@@ -193,6 +193,7 @@ files:
|
|
|
193
193
|
- checksums/aro-0.1.6.gem.sha512
|
|
194
194
|
- checksums/aro-0.1.7.gem.sha512
|
|
195
195
|
- checksums/aro-0.1.8.gem.sha512
|
|
196
|
+
- checksums/aro-0.1.9.gem.sha512
|
|
196
197
|
- db/migrate/1763374647_create_decks.rb
|
|
197
198
|
- db/migrate/1763432541_create_logs.rb
|
|
198
199
|
- db/migrate/1765148774_create_yous.rb
|
|
@@ -200,6 +201,7 @@ files:
|
|
|
200
201
|
- locale/en.aos.yml
|
|
201
202
|
- locale/en.cards.yml
|
|
202
203
|
- locale/en.cngelog.yml
|
|
204
|
+
- locale/en.dom.yml
|
|
203
205
|
- locale/en.usage.yml
|
|
204
206
|
- locale/en.yml
|
|
205
207
|
- sys/aos/aos.rb
|
|
@@ -209,7 +211,6 @@ files:
|
|
|
209
211
|
- sys/aos/views/dom.rb
|
|
210
212
|
- sys/aos/views/games.rb
|
|
211
213
|
- sys/aos/views/games/abpps.rb
|
|
212
|
-
- sys/aos/views/games/deck.rb
|
|
213
214
|
- sys/aos/views/games/game.rb
|
|
214
215
|
- sys/aos/views/games/hbpps.rb
|
|
215
216
|
- sys/aos/views/games/shpps.rb
|
|
@@ -269,5 +270,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
269
270
|
requirements: []
|
|
270
271
|
rubygems_version: 3.6.9
|
|
271
272
|
specification_version: 4
|
|
272
|
-
summary: this
|
|
273
|
+
summary: this versionadds improved views.,adds aro gameplay within an arodome game
|
|
274
|
+
room.,adds ability to set config ivars from aos.
|
|
273
275
|
test_files: []
|
data/sys/aos/views/games/deck.rb
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
|
|
3
|
-
views/games/deck.rb
|
|
4
|
-
|
|
5
|
-
the deck game view.
|
|
6
|
-
|
|
7
|
-
by i2097i
|
|
8
|
-
|
|
9
|
-
=end
|
|
10
|
-
|
|
11
|
-
require_relative :"../base".to_s
|
|
12
|
-
require_relative :"../../../models/deck".to_s
|
|
13
|
-
|
|
14
|
-
module Aos
|
|
15
|
-
module Vi
|
|
16
|
-
class Deck < Aos::Vi::Base
|
|
17
|
-
|
|
18
|
-
PARAMS = [
|
|
19
|
-
:deck,
|
|
20
|
-
:h_logs,
|
|
21
|
-
:count_n,
|
|
22
|
-
:order_o,
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
def self.show(model)
|
|
26
|
-
self.debug_log(model)
|
|
27
|
-
mk = model.keys
|
|
28
|
-
dp = Aos::Vi::Deck::PARAMS
|
|
29
|
-
return nil unless (mk & dp).count == dp.count
|
|
30
|
-
return nil unless model.values.all?{|v| v != nil}
|
|
31
|
-
|
|
32
|
-
deck = model[:deck]
|
|
33
|
-
h_logs = model[:h_logs]
|
|
34
|
-
count_n = model[:count_n]
|
|
35
|
-
order_o = model[:order_o]
|
|
36
|
-
|
|
37
|
-
dc = CLI::Config.display_config
|
|
38
|
-
width = dc[:WIDTH] = viewport_width
|
|
39
|
-
divider = dc[:DIVIDER] * viewport_width
|
|
40
|
-
lines = []
|
|
41
|
-
lines << divider
|
|
42
|
-
lines << ""
|
|
43
|
-
lines << "#{deck.name.upcase.center(width)}"
|
|
44
|
-
lines << ""
|
|
45
|
-
h_logs.each_with_index{|l, i|
|
|
46
|
-
lines << divider
|
|
47
|
-
lines << l.created_at.strftime(CLI::Config::DATE_FORMAT).center(width)
|
|
48
|
-
lines << "#{order_o.to_sym == Aro::Log::ORDERING[:DESC] ? deck.logs.count - i : 1 + i} of #{deck.logs.count}".rjust(width)
|
|
49
|
-
lines << divider
|
|
50
|
-
lines << ""
|
|
51
|
-
lines << ""
|
|
52
|
-
lines += self.get_display_for_cards(
|
|
53
|
-
Base64::decode64(l.card_data).split(Aro::Deck::CARD_DELIM.to_s)
|
|
54
|
-
)
|
|
55
|
-
lines << divider
|
|
56
|
-
|
|
57
|
-
drawn_cards = Base64::decode64(l.drawn_data).split(Aro::Deck::CARD_DELIM.to_s)
|
|
58
|
-
|
|
59
|
-
if !drawn_cards.nil? && drawn_cards.any?
|
|
60
|
-
lines << I18n.t("cli.messages.history_drawn").center(width)
|
|
61
|
-
lines << divider
|
|
62
|
-
lines << ""
|
|
63
|
-
lines += self.get_display_for_cards(
|
|
64
|
-
drawn_cards
|
|
65
|
-
)
|
|
66
|
-
lines << ""
|
|
67
|
-
lines << divider
|
|
68
|
-
end
|
|
69
|
-
}
|
|
70
|
-
if count_n == Aro::Mancy::S
|
|
71
|
-
draw(lines)
|
|
72
|
-
else
|
|
73
|
-
Aro::P.less(lines.join("\n"))
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def self.get_display_for_cards(input = [])
|
|
78
|
-
columns = CLI::Config.display_config[:COLUMNS].to_i
|
|
79
|
-
lines = []
|
|
80
|
-
card_line = ""
|
|
81
|
-
input.each_with_index{|c, i|
|
|
82
|
-
s = (i + Aro::Mancy::S) % [Aro::Mancy::S, columns].max
|
|
83
|
-
card_line += c.ljust(columns)
|
|
84
|
-
if Aro::Mancy::O == s || i == input.count - Aro::Mancy::S
|
|
85
|
-
lines << card_line
|
|
86
|
-
card_line = ""
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
lines << ""
|
|
91
|
-
lines
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|