zarta 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,368 @@
1
+ ---
2
+ - abandoned
3
+ - acidic
4
+ - amazing
5
+ - ancient
6
+ - Arctic
7
+ - arid
8
+ - aromatic
9
+ - awesome
10
+ - awful
11
+ - barren
12
+ - black
13
+ - bleak
14
+ - blue
15
+ - boiling
16
+ - bright
17
+ - brilliant
18
+ - bronze
19
+ - brown
20
+ - bubbly
21
+ - buzzing
22
+ - cavernous
23
+ - cheery
24
+ - chilly
25
+ - circular
26
+ - clean
27
+ - cloudy
28
+ - cluttered
29
+ - cold
30
+ - colourful
31
+ - colossal
32
+ - comfortable
33
+ - complex
34
+ - cool
35
+ - corrupt
36
+ - crazy
37
+ - creamy
38
+ - creepy
39
+ - crooked
40
+ - cruel
41
+ - crushing
42
+ - cylindrical
43
+ - damp
44
+ - dangerous
45
+ - dark
46
+ - dazzling
47
+ - deafening
48
+ - deep
49
+ - delightful
50
+ - deserted
51
+ - detailed
52
+ - dim
53
+ - disgusting
54
+ - dismal
55
+ - dreary
56
+ - dirty
57
+ - drab
58
+ - draughty
59
+ - dry
60
+ - elaborate
61
+ - electric
62
+ - elegant
63
+ - empty
64
+ - enchanting
65
+ - enormous
66
+ - euphoric
67
+ - evil
68
+ - excellent
69
+ - exotic
70
+ - fabulous
71
+ - feathery
72
+ - filthy
73
+ - flamboyant
74
+ - flickering
75
+ - flowery
76
+ - fluffy
77
+ - forked
78
+ - forsaken
79
+ - fragrant
80
+ - fresh
81
+ - frightening
82
+ - frigid
83
+ - frosty
84
+ - frozen
85
+ - fuzzy
86
+ - gargantuan
87
+ - gaseous
88
+ - giant
89
+ - gigantic
90
+ - glamorous
91
+ - glass
92
+ - gleaming
93
+ - glistening
94
+ - glittering
95
+ - gloomy
96
+ - glorious
97
+ - glossy
98
+ - glum
99
+ - golden
100
+ - gorgeous
101
+ - grand
102
+ - grandiose
103
+ - grave
104
+ - grey
105
+ - green
106
+ - grim
107
+ - grimy
108
+ - gross
109
+ - grotesque
110
+ - grubby
111
+ - gruesome
112
+ - hairy
113
+ - handmade
114
+ - harsh
115
+ - haunting
116
+ - hearty
117
+ - heavenly
118
+ - hidden
119
+ - hideous
120
+ - hollow
121
+ - homely
122
+ - horrible
123
+ - hot
124
+ - huge
125
+ - humming
126
+ - humongous
127
+ - icky
128
+ - icy
129
+ - ill-fated
130
+ - immaculate
131
+ - immense
132
+ - impossible
133
+ - impressive
134
+ - incomplete
135
+ - incredible
136
+ - ironclad
137
+ - itchy
138
+ - jagged
139
+ - jumbo
140
+ - large
141
+ - lavish
142
+ - leafy
143
+ - linear
144
+ - lined
145
+ - little
146
+ - lively
147
+ - long
148
+ - low
149
+ - luminous
150
+ - luxurious
151
+ - magnificent
152
+ - majestic
153
+ - marvellous
154
+ - massive
155
+ - menacing
156
+ - metallic
157
+ - milky
158
+ - miniature
159
+ - miserable
160
+ - misty
161
+ - moist
162
+ - monstrous
163
+ - muddy
164
+ - multicoloured
165
+ - murky
166
+ - musty
167
+ - mysterious
168
+ - narrow
169
+ - nasty
170
+ - natural
171
+ - naughty
172
+ - neat
173
+ - neglected
174
+ - new
175
+ - nice
176
+ - nifty
177
+ - nippy
178
+ - noisy
179
+ - noteworthy
180
+ - noxious
181
+ - oblong
182
+ - oily
183
+ - odd
184
+ - old
185
+ - open
186
+ - opulent
187
+ - orange
188
+ - ornate
189
+ - outlandish
190
+ - oval
191
+ - pale
192
+ - parched
193
+ - peaceful
194
+ - peppery
195
+ - perfumed
196
+ - piercing
197
+ - pink
198
+ - pitiful
199
+ - plain
200
+ - pleasant
201
+ - pleasing
202
+ - plush
203
+ - polished
204
+ - poor
205
+ - posh
206
+ - pretty
207
+ - pristine
208
+ - puny
209
+ - purple
210
+ - putrid
211
+ - puzzling
212
+ - quaint
213
+ - quiet
214
+ - quirky
215
+ - radiant
216
+ - ragged
217
+ - rectangular
218
+ - red
219
+ - reflecting
220
+ - regal
221
+ - remarkable
222
+ - repulsive
223
+ - revolving
224
+ - ringed
225
+ - rosy
226
+ - rotating
227
+ - rotten
228
+ - rough
229
+ - round
230
+ - royal
231
+ - rubbery
232
+ - run-down
233
+ - rusty
234
+ - sad
235
+ - salty
236
+ - sandy
237
+ - scaly
238
+ - scary
239
+ - scented
240
+ - scratchy
241
+ - serene
242
+ - serpentine
243
+ - severe
244
+ - shabby
245
+ - shadowy
246
+ - shady
247
+ - hallow
248
+ - sharp
249
+ - shimmering
250
+ - shiny
251
+ - shocking
252
+ - shoddy
253
+ - short
254
+ - showy
255
+ - shrill
256
+ - silent
257
+ - silky
258
+ - silver
259
+ - simple
260
+ - sizzling
261
+ - slimy
262
+ - slippery
263
+ - small
264
+ - smoggy
265
+ - smooth
266
+ - soft
267
+ - soggy
268
+ - sombre
269
+ - spherical
270
+ - sophisticated
271
+ - sorrowful
272
+ - soupy
273
+ - sparkling
274
+ - sparse
275
+ - spectacular
276
+ - spicy
277
+ - spiffy
278
+ - splendid
279
+ - spotless
280
+ - spotted
281
+ - square
282
+ - squeaky
283
+ - stained
284
+ - stale
285
+ - stark
286
+ - starry
287
+ - steep
288
+ - sticky
289
+ - stiff
290
+ - stormy
291
+ - straight
292
+ - strange
293
+ - steel
294
+ - striking
295
+ - striped
296
+ - stunning
297
+ - stupendous
298
+ - stylish
299
+ - substantial
300
+ - subtle
301
+ - suburban
302
+ - sugary
303
+ - sunny
304
+ - superb
305
+ - suspicious
306
+ - sweaty
307
+ - sweltering
308
+ - tan
309
+ - tart
310
+ - tasty
311
+ - tattered
312
+ - tepid
313
+ - terrible
314
+ - terrific
315
+ - thick
316
+ - thin
317
+ - thirsty
318
+ - thorny
319
+ - thunderous
320
+ - tidy
321
+ - tight
322
+ - tinted
323
+ - tiny
324
+ - tremendous
325
+ - triangular
326
+ - turbulent
327
+ - ugly
328
+ - uncomfortable
329
+ - uneven
330
+ - unfinished
331
+ - unique
332
+ - unkempt
333
+ - unnatural
334
+ - unpleasant
335
+ - unsightly
336
+ - untidy
337
+ - unusual
338
+ - vacant
339
+ - vast
340
+ - velvety
341
+ - vibrant
342
+ - violet
343
+ - vivid
344
+ - voluminous
345
+ - warm
346
+ - warped
347
+ - waterlogged
348
+ - watery
349
+ - webbed
350
+ - weird
351
+ - well-lit
352
+ - well-made
353
+ - well-worn
354
+ - wet
355
+ - white
356
+ - wicked
357
+ - wide
358
+ - wild
359
+ - winding
360
+ - windy
361
+ - woeful
362
+ - wonderful
363
+ - wooden
364
+ - worn
365
+ - wretched
366
+ - yawning
367
+ - yellow
368
+ - zigzag
@@ -0,0 +1,67 @@
1
+ # The catch-all module for Zarta
2
+ module Zarta
3
+ # A weapon that can be wielded by the player or an enemey
4
+ class Weapon
5
+ # The dungeon whis weapon dropped in
6
+ attr_accessor :dungeon
7
+
8
+ # The player or monster wielding this weapon
9
+ attr_accessor :player
10
+
11
+ # The name of the weapon
12
+ attr_accessor :name
13
+
14
+ # The base damage that the weapon deals
15
+ attr_accessor :damage
16
+
17
+ def initialize(dungeon)
18
+ @dungeon = dungeon
19
+ @player = @dungeon.player
20
+ @pastel = Pastel.new
21
+
22
+ random_drop
23
+ end
24
+
25
+ def random_drop
26
+ drop_list = []
27
+ @dungeon.weapon_list.each do |weapon|
28
+ drop_list << weapon if weapon[:rarity] <= chance
29
+ end
30
+
31
+ drop = drop_list[rand(0...drop_list.length)]
32
+
33
+ @name = drop[:name]
34
+ @description = drop[:description]
35
+ @damage = drop[:damage]
36
+ @rarity = drop[:rarity]
37
+ end
38
+
39
+ def chance
40
+ rand((@dungeon.level - WEAPON_MIN_MOD)..
41
+ (@dungeon.level + WEAPON_MAX_MOD)).round
42
+ end
43
+
44
+ def inspect_weapon
45
+ title_table
46
+ table
47
+ gets
48
+ end
49
+
50
+ def title_table
51
+ table_title = Terminal::Table.new
52
+ table_title.title = @pastel.cyan.bold(@name)
53
+ table_title.style = { width: 40, padding_left: 1 }
54
+ table_title.align_column(0, :center)
55
+ table_title.add_row [@description]
56
+ puts table_title
57
+ end
58
+
59
+ def table
60
+ table = Terminal::Table.new
61
+ table.style = { width: 40, padding_left: 1 }
62
+ table.add_row ['Damage:', @damage]
63
+ table.add_row ['Rarity:', @rarity]
64
+ puts table
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,300 @@
1
+ ---
2
+ -
3
+ :name: 'Arming sword'
4
+ :description: 'No description yet.'
5
+ :damage: 3
6
+ :rarity: 3
7
+ -
8
+ :name: 'Broadsword'
9
+ :description: 'No description yet.'
10
+ :damage: 5
11
+ :rarity: 3
12
+ -
13
+ :name: 'Claymore'
14
+ :description: 'No description yet.'
15
+ :damage: 7
16
+ :rarity: 7
17
+ -
18
+ :name: 'Falchion'
19
+ :description: 'No description yet.'
20
+ :damage: 4
21
+ :rarity: 3
22
+ -
23
+ :name: 'Katana'
24
+ :description: 'No description yet.'
25
+ :damage: 6
26
+ :rarity: 8
27
+ -
28
+ :name: 'Longsword'
29
+ :description: 'No description yet.'
30
+ :damage: 6
31
+ :rarity: 6
32
+ -
33
+ :name: 'Rapier'
34
+ :description: 'No description yet.'
35
+ :damage: 3
36
+ :rarity: 2
37
+ -
38
+ :name: 'Sabre'
39
+ :description: 'No description yet.'
40
+ :damage: 3
41
+ :rarity: 2
42
+ -
43
+ :name: 'Shortsword'
44
+ :description: 'No description yet.'
45
+ :damage: 1
46
+ :rarity: 1
47
+ -
48
+ :name: 'Zweihander'
49
+ :description: 'No description yet.'
50
+ :damage: 8
51
+ :rarity: 10
52
+ -
53
+ :name: 'Gladius'
54
+ :description: 'No description yet.'
55
+ :damage: 3
56
+ :rarity: 3
57
+ -
58
+ :name: 'Battle axe'
59
+ :description: 'No description yet.'
60
+ :damage: 7
61
+ :rarity: 6
62
+ -
63
+ :name: 'Club'
64
+ :description: 'No description yet.'
65
+ :damage: 1
66
+ :rarity: 1
67
+ -
68
+ :name: 'Flail'
69
+ :description: 'No description yet.'
70
+ :damage: 3
71
+ :rarity: 2
72
+ -
73
+ :name: 'Mace'
74
+ :description: 'No description yet.'
75
+ :damage: 2
76
+ :rarity: 1
77
+ -
78
+ :name: 'Flanged mace'
79
+ :description: 'No description yet.'
80
+ :damage: 4
81
+ :rarity: 6
82
+ -
83
+ :name: 'Pernach'
84
+ :description: 'No description yet.'
85
+ :damage: 4
86
+ :rarity: 9
87
+ -
88
+ :name: 'Shestopyor'
89
+ :description: 'No description yet.'
90
+ :damage: 4
91
+ :rarity: 8
92
+ -
93
+ :name: 'Maul'
94
+ :description: 'No description yet.'
95
+ :damage: 2
96
+ :rarity: 2
97
+ -
98
+ :name: 'Morning star'
99
+ :description: 'No description yet.'
100
+ :damage: 3
101
+ :rarity: 2
102
+ -
103
+ :name: 'Quarterstaff'
104
+ :description: 'No description yet.'
105
+ :damage: 2
106
+ :rarity: 1
107
+ -
108
+ :name: 'War hammer'
109
+ :description: 'No description yet.'
110
+ :damage: 8
111
+ :rarity: 8
112
+ -
113
+ :name: 'Bec de Corbin'
114
+ :description: 'No description yet.'
115
+ :damage: 8
116
+ :rarity: 10
117
+ -
118
+ :name: 'Horseman’s pick'
119
+ :description: 'No description yet.'
120
+ :damage: 9
121
+ :rarity: 10
122
+ -
123
+ :name: 'Bludgeon'
124
+ :description: 'No description yet.'
125
+ :damage: 1
126
+ :rarity: 1
127
+ -
128
+ :name: 'Ahlspiess'
129
+ :description: 'No description yet.'
130
+ :damage: 4
131
+ :rarity: 5
132
+ -
133
+ :name: 'Bardiche'
134
+ :description: 'No description yet.'
135
+ :damage: 6
136
+ :rarity: 7
137
+ -
138
+ :name: 'Bill'
139
+ :description: 'No description yet.'
140
+ :damage: 6
141
+ :rarity: 7
142
+ -
143
+ :name: 'Glaive'
144
+ :description: 'No description yet.'
145
+ :damage: 7
146
+ :rarity: 8
147
+ -
148
+ :name: 'Guisarme'
149
+ :description: 'No description yet.'
150
+ :damage: 7
151
+ :rarity: 8
152
+ -
153
+ :name: 'Halberd'
154
+ :description: 'No description yet.'
155
+ :damage: 8
156
+ :rarity: 8
157
+ -
158
+ :name: 'Lance'
159
+ :description: 'No description yet.'
160
+ :damage: 4
161
+ :rarity: 4
162
+ -
163
+ :name: 'Lochaber Axe'
164
+ :description: 'No description yet.'
165
+ :damage: 6
166
+ :rarity: 8
167
+ -
168
+ :name: 'Lucerne hammer'
169
+ :description: 'No description yet.'
170
+ :damage: 6
171
+ :rarity: 8
172
+ -
173
+ :name: 'Man catcher'
174
+ :description: 'No description yet.'
175
+ :damage: 5
176
+ :rarity: 8
177
+ -
178
+ :name: 'Military fork'
179
+ :description: 'No description yet.'
180
+ :damage: 6
181
+ :rarity: 6
182
+ -
183
+ :name: 'Partisan'
184
+ :description: 'No description yet.'
185
+ :damage: 6
186
+ :rarity: 6
187
+ -
188
+ :name: 'Pike'
189
+ :description: 'No description yet.'
190
+ :damage: 5
191
+ :rarity: 4
192
+ -
193
+ :name: 'Plançon a picot'
194
+ :description: 'No description yet.'
195
+ :damage: 4
196
+ :rarity: 5
197
+ -
198
+ :name: 'Ranseur'
199
+ :description: "A spear-headed polearm with a\n
200
+ crescent-shaped cross guard\n
201
+ resembling a trident."
202
+ :damage: 6
203
+ :rarity: 7
204
+ -
205
+ :name: 'Sovnya'
206
+ :description: "A long polearm with a\n
207
+ single-edged curved blade on\n
208
+ the end."
209
+ :damage: 6
210
+ :rarity: 6
211
+ -
212
+ :name: 'Spetum'
213
+ :description: "A spear-headed polearm with\nsingle-edged, curved cross-blades."
214
+ :damage: 5
215
+ :rarity: 6
216
+ -
217
+ :name: 'Swordstaff'
218
+ :description: "A sword on the end of a staff.\nWho’d’ve thought it?"
219
+ :damage: 5
220
+ :rarity: 5
221
+ -
222
+ :name: 'Voulge'
223
+ :description: 'No description yet.'
224
+ :damage: 6
225
+ :rarity: 7
226
+ -
227
+ :name: 'War-scythe'
228
+ :description: 'No description yet.'
229
+ :damage: 8
230
+ :rarity: 9
231
+ -
232
+ :name: 'War hammer'
233
+ :description: 'No description yet.'
234
+ :damage: 9
235
+ :rarity: 10
236
+ -
237
+ :name: 'Bow'
238
+ :description: 'No description yet.'
239
+ :damage: 3
240
+ :rarity: 2
241
+ -
242
+ :name: 'Longbow'
243
+ :description: 'No description yet.'
244
+ :damage: 6
245
+ :rarity: 4
246
+ -
247
+ :name: 'Recurve bow'
248
+ :description: 'No description yet.'
249
+ :damage: 4
250
+ :rarity: 3
251
+ -
252
+ :name: 'Crossbow'
253
+ :description: 'No description yet.'
254
+ :damage: 5
255
+ :rarity: 4
256
+ -
257
+ :name: 'Repeating crossbow'
258
+ :description: 'No description yet.'
259
+ :damage: 7
260
+ :rarity: 9
261
+ -
262
+ :name: 'Sling'
263
+ :description: 'No description yet.'
264
+ :damage: 2
265
+ :rarity: 1
266
+ -
267
+ :name: 'Francisca'
268
+ :description: "A throwing axe with an\narch-shaped head."
269
+ :damage: 3
270
+ :rarity: 3
271
+ -
272
+ :name: 'Nzappa zap'
273
+ :description: "A throwing axe with an ornate,\nwrought iron blade."
274
+ :damage: 4
275
+ :rarity: 4
276
+ -
277
+ :name: 'Chakram'
278
+ :description: "A circular throwing weapon with\na sharp outer edge."
279
+ :damage: 4
280
+ :rarity: 4
281
+ -
282
+ :name: 'Hand cannon'
283
+ :description: "A rudimentary short-barrelled\ngunpowder projectile weapon"
284
+ :damage: 4
285
+ :rarity: 5
286
+ -
287
+ :name: 'Musket'
288
+ :description: "A long-barrelled, muzzle-loaded\ngunpowder projectile weapon"
289
+ :damage: 7
290
+ :rarity: 7
291
+ -
292
+ :name: 'Throwing Spear'
293
+ :description: 'No description yet.'
294
+ :damage: 3
295
+ :rarity: 3
296
+ -
297
+ :name: 'Shuriken'
298
+ :description: 'No description yet.'
299
+ :damage: 2
300
+ :rarity: 1
data/lib/zarta.rb ADDED
@@ -0,0 +1,8 @@
1
+ require_relative 'zarta/main'
2
+ require_relative 'zarta/dungeon'
3
+ require_relative 'zarta/player'
4
+ require_relative 'zarta/weapon'
5
+ require_relative 'zarta/enemy'
6
+
7
+ game = Zarta::Engine.new
8
+ game.play