amar-rpg 2.0.1

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.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +675 -0
  3. data/README.md +155 -0
  4. data/amar-tui.rb +8195 -0
  5. data/cli_enc_output.rb +87 -0
  6. data/cli_enc_output_new.rb +433 -0
  7. data/cli_enc_output_new_3tier.rb +198 -0
  8. data/cli_enc_output_new_compact.rb +238 -0
  9. data/cli_name_gen.rb +21 -0
  10. data/cli_npc_output.rb +279 -0
  11. data/cli_npc_output_new.rb +700 -0
  12. data/cli_town_output.rb +39 -0
  13. data/cli_weather_output.rb +36 -0
  14. data/includes/class_enc.rb +341 -0
  15. data/includes/class_enc_new.rb +512 -0
  16. data/includes/class_monster_new.rb +551 -0
  17. data/includes/class_npc.rb +1378 -0
  18. data/includes/class_npc_new.rb +1187 -0
  19. data/includes/class_npc_new.rb.backup +706 -0
  20. data/includes/class_npc_new_skills.rb +153 -0
  21. data/includes/class_town.rb +237 -0
  22. data/includes/d6s.rb +40 -0
  23. data/includes/equipment_tables.rb +120 -0
  24. data/includes/functions.rb +67 -0
  25. data/includes/includes.rb +30 -0
  26. data/includes/randomizer.rb +15 -0
  27. data/includes/spell_catalog.rb +441 -0
  28. data/includes/tables/armour.rb +13 -0
  29. data/includes/tables/chartype.rb +4412 -0
  30. data/includes/tables/chartype_new.rb +765 -0
  31. data/includes/tables/chartype_new_full.rb +2713 -0
  32. data/includes/tables/enc_specific.rb +168 -0
  33. data/includes/tables/enc_type.rb +17 -0
  34. data/includes/tables/encounters.rb +99 -0
  35. data/includes/tables/magick.rb +169 -0
  36. data/includes/tables/melee.rb +36 -0
  37. data/includes/tables/missile.rb +17 -0
  38. data/includes/tables/monster_stats_new.rb +264 -0
  39. data/includes/tables/month.rb +18 -0
  40. data/includes/tables/names.rb +21 -0
  41. data/includes/tables/personality.rb +12 -0
  42. data/includes/tables/race_templates.rb +318 -0
  43. data/includes/tables/religions.rb +266 -0
  44. data/includes/tables/spells_new.rb +496 -0
  45. data/includes/tables/tier_system.rb +104 -0
  46. data/includes/tables/town.rb +71 -0
  47. data/includes/tables/weather.rb +41 -0
  48. data/includes/town_relations.rb +127 -0
  49. data/includes/weather.rb +108 -0
  50. data/includes/weather2latex.rb +114 -0
  51. data/lib/rcurses.rb +33 -0
  52. metadata +157 -0
@@ -0,0 +1,441 @@
1
+ # Creative Spell Catalog for 3-Tier System
2
+ # Revolutionary flexible magic system with unique, creative spells
3
+
4
+ $SpellCatalog = {
5
+ # FIRE MAGIC - Usually cast via Spirit->Casting->Fire
6
+ "Crimson Burst" => {
7
+ description: "A red fireball that leaves lingering embers",
8
+ skill_path: ["Spirit", "Attunement", "Fire"],
9
+ difficulty: 10,
10
+ cooldown: 3,
11
+ range: "30m",
12
+ duration: "Instant",
13
+ side_effects: "Caster's hands glow red for 1 hour"
14
+ },
15
+
16
+ "Blue Fireball" => {
17
+ description: "Cold fire that burns but doesn't spread flames",
18
+ skill_path: ["Spirit", "Attunement", "Fire"],
19
+ difficulty: 12,
20
+ cooldown: 2,
21
+ range: "25m",
22
+ duration: "Instant",
23
+ side_effects: "Target feels cold for 10 minutes"
24
+ },
25
+
26
+ "Forge Heart" => {
27
+ description: "Heats metal objects to forging temperature",
28
+ skill_path: ["Spirit", "Attunement", "Fire"],
29
+ difficulty: 8,
30
+ cooldown: 1,
31
+ range: "Touch",
32
+ duration: "1 hour",
33
+ side_effects: "Caster immune to cold for duration"
34
+ },
35
+
36
+ # WATER/ICE MAGIC
37
+ "Frostbite Touch" => {
38
+ description: "Freezes water on contact, gives caster a cold",
39
+ skill_path: ["Spirit", "Attunement", "Water"],
40
+ difficulty: 9,
41
+ cooldown: 4,
42
+ range: "Touch",
43
+ duration: "Permanent",
44
+ side_effects: "Caster sneezes for 2 hours"
45
+ },
46
+
47
+ "Misty Veil" => {
48
+ description: "Creates concealing fog around caster",
49
+ skill_path: ["Spirit", "Attunement", "Water"],
50
+ difficulty: 7,
51
+ cooldown: 2,
52
+ range: "Self",
53
+ duration: "10 minutes",
54
+ side_effects: "Caster's clothes become damp"
55
+ },
56
+
57
+ # AIR/WIND MAGIC
58
+ "Seeking Arrow" => {
59
+ description: "Enchants projectile to seek specific target types",
60
+ skill_path: ["Body", "Missile Combat", "Archery", "Spirit", "Casting", "Air"],
61
+ difficulty: 15,
62
+ cooldown: 5,
63
+ range: "Weapon range",
64
+ duration: "1 shot",
65
+ side_effects: "Caster feels dizzy for 1 hour"
66
+ },
67
+
68
+ "Whisper Wind" => {
69
+ description: "Carries a message on the wind to distant target",
70
+ skill_path: ["Spirit", "Attunement", "Air"],
71
+ difficulty: 11,
72
+ cooldown: 1,
73
+ range: "10 km",
74
+ duration: "Instant",
75
+ side_effects: "Caster loses voice for 10 minutes"
76
+ },
77
+
78
+ # EARTH MAGIC
79
+ "Stone Skin" => {
80
+ description: "Hardens skin like granite, reduces damage",
81
+ skill_path: ["Spirit", "Attunement", "Earth"],
82
+ difficulty: 13,
83
+ cooldown: 6,
84
+ range: "Self",
85
+ duration: "1 hour",
86
+ side_effects: "Movement reduced by half"
87
+ },
88
+
89
+ "Tremor Step" => {
90
+ description: "Each footstep creates small earthquake",
91
+ skill_path: ["Spirit", "Attunement", "Earth"],
92
+ difficulty: 16,
93
+ cooldown: 8,
94
+ range: "Self",
95
+ duration: "10 minutes",
96
+ side_effects: "Caster can't sneak for 1 day"
97
+ },
98
+
99
+ # MIND MAGIC
100
+ "Memory Thief" => {
101
+ description: "Steals one specific memory from target",
102
+ skill_path: ["Mind", "Social Knowledge", "Deception", "Spirit", "Casting", "Mind"],
103
+ difficulty: 18,
104
+ cooldown: 12,
105
+ range: "Touch",
106
+ duration: "Permanent",
107
+ side_effects: "Caster gains the stolen memory"
108
+ },
109
+
110
+ "Confusion Aura" => {
111
+ description: "Enemies in area attack randomly",
112
+ skill_path: ["Spirit", "Attunement", "Mind"],
113
+ difficulty: 14,
114
+ cooldown: 4,
115
+ range: "10m radius",
116
+ duration: "5 minutes",
117
+ side_effects: "Caster also confused for 1 minute"
118
+ },
119
+
120
+ # CREATIVE/UNIQUE SPELLS
121
+ "Dancer's Grace" => {
122
+ description: "Supernatural agility if Dancing roll 13+",
123
+ skill_path: ["Body", "Performance", "Dancing"],
124
+ difficulty: 13,
125
+ cooldown: 2,
126
+ range: "Self",
127
+ duration: "1 hour",
128
+ side_effects: "Must keep dancing or spell ends"
129
+ },
130
+
131
+ "Lucky Coin" => {
132
+ description: "Enchants coin to always land on chosen side",
133
+ skill_path: ["Spirit", "Attunement", "Fate"],
134
+ difficulty: 6,
135
+ cooldown: 1,
136
+ range: "Touch",
137
+ duration: "10 flips",
138
+ side_effects: "Caster has bad luck for 1 day"
139
+ },
140
+
141
+ "Shadow Step" => {
142
+ description: "Teleport between shadows up to 50 meters",
143
+ skill_path: ["Spirit", "Attunement", "Shadow"],
144
+ difficulty: 12,
145
+ cooldown: 3,
146
+ range: "50m",
147
+ duration: "Instant",
148
+ side_effects: "Caster loses 1 point of temporary strength"
149
+ },
150
+
151
+ "Beast Speech" => {
152
+ description: "Communicate with animals of chosen type",
153
+ skill_path: ["Mind", "Awareness", "Nature Knowledge", "Spirit", "Casting", "Nature"],
154
+ difficulty: 9,
155
+ cooldown: 1,
156
+ range: "100m",
157
+ duration: "1 hour",
158
+ side_effects: "Caster makes animal sounds when talking"
159
+ },
160
+
161
+ "Time Pocket" => {
162
+ description: "Small area experiences slower time flow",
163
+ skill_path: ["Spirit", "Attunement", "Time"],
164
+ difficulty: 20,
165
+ cooldown: 24,
166
+ range: "3m radius",
167
+ duration: "10 minutes",
168
+ side_effects: "Caster ages 1 year"
169
+ },
170
+
171
+ "Emotion Echo" => {
172
+ description: "Target feels caster's current emotions intensely",
173
+ skill_path: ["Mind", "Social Knowledge", "Empathy", "Spirit", "Casting", "Mind"],
174
+ difficulty: 10,
175
+ cooldown: 2,
176
+ range: "Line of sight",
177
+ duration: "1 hour",
178
+ side_effects: "Emotions amplified for both"
179
+ },
180
+
181
+ # HEALING MAGIC
182
+ "Gentle Mend" => {
183
+ description: "Heals minor wounds and bruises",
184
+ skill_path: ["Spirit", "Attunement", "Life"],
185
+ difficulty: 8,
186
+ cooldown: 1,
187
+ range: "Touch",
188
+ duration: "Instant",
189
+ side_effects: "Caster feels target's pain briefly"
190
+ },
191
+
192
+ "Life Link" => {
193
+ description: "Share life force between caster and target",
194
+ skill_path: ["Spirit", "Attunement", "Life"],
195
+ difficulty: 15,
196
+ cooldown: 6,
197
+ range: "Touch",
198
+ duration: "1 hour",
199
+ side_effects: "Damage splits between both"
200
+ },
201
+
202
+ # ILLUSION MAGIC
203
+ "Mirror Self" => {
204
+ description: "Creates perfect illusory duplicate",
205
+ skill_path: ["Spirit", "Attunement", "Illusion"],
206
+ difficulty: 14,
207
+ cooldown: 4,
208
+ range: "Self",
209
+ duration: "10 minutes",
210
+ side_effects: "Caster sees double for 1 hour"
211
+ },
212
+
213
+ "False Memory" => {
214
+ description: "Implants believable false memory",
215
+ skill_path: ["Mind", "Social Knowledge", "Deception", "Spirit", "Casting", "Illusion"],
216
+ difficulty: 17,
217
+ cooldown: 8,
218
+ range: "Touch",
219
+ duration: "Permanent",
220
+ side_effects: "Caster questions own memories"
221
+ },
222
+
223
+ # NATURE MAGIC
224
+ "Plant Growth" => {
225
+ description: "Accelerates plant growth dramatically",
226
+ skill_path: ["Spirit", "Attunement", "Nature"],
227
+ difficulty: 9,
228
+ cooldown: 2,
229
+ range: "10m radius",
230
+ duration: "1 hour",
231
+ side_effects: "Caster needs to eat immediately"
232
+ },
233
+
234
+ "Animal Bond" => {
235
+ description: "Forms temporary telepathic link with animal",
236
+ skill_path: ["Mind", "Awareness", "Nature Knowledge", "Spirit", "Casting", "Nature"],
237
+ difficulty: 12,
238
+ cooldown: 3,
239
+ range: "1 km",
240
+ duration: "1 day",
241
+ side_effects: "Caster adopts animal mannerisms"
242
+ },
243
+
244
+ # PROTECTION MAGIC
245
+ "Ward Circle" => {
246
+ description: "Creates protective barrier against hostile magic",
247
+ skill_path: ["Spirit", "Attunement", "Protection"],
248
+ difficulty: 11,
249
+ cooldown: 4,
250
+ range: "5m radius",
251
+ duration: "1 hour",
252
+ side_effects: "Drains 2 points temporary endurance"
253
+ },
254
+
255
+ "Truth Shield" => {
256
+ description: "Protects against lies and deception",
257
+ skill_path: ["Spirit", "Attunement", "Protection"],
258
+ difficulty: 13,
259
+ cooldown: 5,
260
+ range: "Self",
261
+ duration: "1 hour",
262
+ side_effects: "Caster must speak only truth"
263
+ },
264
+
265
+ # DARK MAGIC
266
+ "Fear Whisper" => {
267
+ description: "Instills paralyzing fear in target",
268
+ skill_path: ["Spirit", "Attunement", "Shadow"],
269
+ difficulty: 12,
270
+ cooldown: 3,
271
+ range: "30m",
272
+ duration: "10 minutes",
273
+ side_effects: "Caster experiences target's fear"
274
+ },
275
+
276
+ "Soul Glimpse" => {
277
+ description: "Briefly see target's deepest secrets",
278
+ skill_path: ["Spirit", "Attunement", "Shadow"],
279
+ difficulty: 16,
280
+ cooldown: 7,
281
+ range: "Touch",
282
+ duration: "Instant",
283
+ side_effects: "Caster's own secrets become visible to target"
284
+ },
285
+
286
+ # UTILITY SPELLS
287
+ "Mend Object" => {
288
+ description: "Repairs broken non-living items",
289
+ skill_path: ["Spirit", "Attunement", "Matter"],
290
+ difficulty: 7,
291
+ cooldown: 1,
292
+ range: "Touch",
293
+ duration: "Instant",
294
+ side_effects: "Caster feels phantom pain where object was broken"
295
+ },
296
+
297
+ "Language Gift" => {
298
+ description: "Temporarily understand any spoken language",
299
+ skill_path: ["Mind", "Social Knowledge", "Linguistics", "Spirit", "Casting", "Mind"],
300
+ difficulty: 10,
301
+ cooldown: 2,
302
+ range: "Self",
303
+ duration: "1 hour",
304
+ side_effects: "Native language sounds foreign for 1 hour"
305
+ },
306
+
307
+ "Night Eyes" => {
308
+ description: "See perfectly in complete darkness",
309
+ skill_path: ["Spirit", "Attunement", "Light"],
310
+ difficulty: 8,
311
+ cooldown: 1,
312
+ range: "Self",
313
+ duration: "1 hour",
314
+ side_effects: "Sensitive to bright light for 1 day"
315
+ },
316
+
317
+ # COMBAT ENHANCEMENT
318
+ "Weapon Bond" => {
319
+ description: "Temporarily merge consciousness with weapon",
320
+ skill_path: ["Body", "Melee Combat", "Chosen Weapon", "Spirit", "Casting", "Matter"],
321
+ difficulty: 14,
322
+ cooldown: 5,
323
+ range: "Touch",
324
+ duration: "10 minutes",
325
+ side_effects: "Caster feels every strike weapon takes"
326
+ },
327
+
328
+ "Battle Trance" => {
329
+ description: "Enter combat state, ignore pain and fear",
330
+ skill_path: ["Mind", "Awareness", "Battle Focus", "Spirit", "Casting", "Body"],
331
+ difficulty: 13,
332
+ cooldown: 6,
333
+ range: "Self",
334
+ duration: "Combat",
335
+ side_effects: "Exhausted for 2 hours after"
336
+ },
337
+
338
+ # SOCIAL MAGIC
339
+ "Charm Smile" => {
340
+ description: "Irresistibly likeable for brief period",
341
+ skill_path: ["Mind", "Social Knowledge", "Persuasion", "Spirit", "Casting", "Mind"],
342
+ difficulty: 9,
343
+ cooldown: 2,
344
+ range: "Self",
345
+ duration: "30 minutes",
346
+ side_effects: "Everyone becomes suspicious after spell ends"
347
+ },
348
+
349
+ "Truth Compulsion" => {
350
+ description: "Target must answer one question truthfully",
351
+ skill_path: ["Mind", "Social Knowledge", "Interrogation", "Spirit", "Casting", "Mind"],
352
+ difficulty: 15,
353
+ cooldown: 4,
354
+ range: "Conversation",
355
+ duration: "1 question",
356
+ side_effects: "Caster must also answer one truthful question"
357
+ }
358
+ }
359
+
360
+ # Spell assignment logic based on character type and skills
361
+ def assign_spells_to_npc(npc)
362
+ return [] unless npc.tiers["SPIRIT"] && (npc.tiers["SPIRIT"]["Casting"] || npc.tiers["SPIRIT"]["Attunement"])
363
+
364
+ assigned_spells = []
365
+ # More spells for competent magic users
366
+ casting_total = npc.get_skill_total("SPIRIT", "Casting", "Total") rescue 0
367
+ attunement_total = npc.get_skill_total("SPIRIT", "Attunement", "Total") rescue 0
368
+ magic_skill = [casting_total, attunement_total].max
369
+
370
+ max_spells = case magic_skill
371
+ when 0..5 then 0 # No spells for beginners
372
+ when 6..10 then 1 # 1 spell for novices
373
+ when 11..15 then 2 # 2 spells for competent
374
+ when 16..20 then 3 # 3 spells for skilled
375
+ when 21..25 then 4 # 4 spells for experts
376
+ else 5 # 5 spells for masters
377
+ end
378
+
379
+ # Get character's strongest magical domains
380
+ casting_skills = npc.tiers["SPIRIT"]["Casting"]["skills"] || {} rescue {}
381
+ attunement_skills = npc.tiers["SPIRIT"]["Attunement"]["skills"] || {} rescue {}
382
+ all_magic_skills = casting_skills.merge(attunement_skills)
383
+ preferred_domains = all_magic_skills.select { |skill, value| value > 0 }.keys
384
+
385
+ # Filter spells based on character type and skills
386
+ suitable_spells = $SpellCatalog.select do |spell_name, spell_data|
387
+ # Check if character has required skills
388
+ can_cast = true
389
+ spell_data[:skill_path].each do |skill_part|
390
+ # Simplified check - character should have some relevant skills
391
+ case skill_part
392
+ when "Fire" then can_cast &&= (all_magic_skills["Fire"] || 0) > 0
393
+ when "Water" then can_cast &&= (all_magic_skills["Water"] || 0) > 0
394
+ when "Air" then can_cast &&= (all_magic_skills["Air"] || 0) > 0
395
+ when "Earth" then can_cast &&= (all_magic_skills["Earth"] || 0) > 0
396
+ when "Mind" then can_cast &&= (all_magic_skills["Mind"] || 0) > 0
397
+ when "Nature" then can_cast &&= (all_magic_skills["Nature"] || 0) > 0
398
+ when "Protection" then can_cast &&= (all_magic_skills["Protection"] || 0) > 0
399
+ when "Illusion" then can_cast &&= (all_magic_skills["Illusion"] || 0) > 0
400
+ when "Shadow" then can_cast &&= (all_magic_skills["Shadow"] || 0) > 0
401
+ when "Self" then can_cast &&= (all_magic_skills["Self"] || 0) > 0
402
+ when "Life" then can_cast &&= (all_magic_skills["Life"] || 0) > 0
403
+ end
404
+ end
405
+ can_cast
406
+ end
407
+
408
+ # Randomly select spells from suitable ones
409
+ suitable_spells.keys.sample(max_spells).each do |spell_name|
410
+ spell_data = suitable_spells[spell_name]
411
+ assigned_spells << {
412
+ name: spell_name,
413
+ description: spell_data[:description],
414
+ skill_path: spell_data[:skill_path].join(" → "),
415
+ difficulty: spell_data[:difficulty],
416
+ cooldown: spell_data[:cooldown],
417
+ range: spell_data[:range],
418
+ duration: spell_data[:duration],
419
+ side_effects: spell_data[:side_effects]
420
+ }
421
+ end
422
+
423
+ assigned_spells
424
+ end
425
+
426
+ # Character type spell preferences
427
+ $SpellPreferences = {
428
+ "Mage" => ["Fire", "Water", "Air", "Earth"],
429
+ "Sorcerer" => ["Fire", "Shadow", "Mind"],
430
+ "Wizard (fire)" => ["Fire"],
431
+ "Wizard (water)" => ["Water"],
432
+ "Wizard (air)" => ["Air"],
433
+ "Wizard (earth)" => ["Earth"],
434
+ "Wizard (prot.)" => ["Protection"],
435
+ "Witch (black)" => ["Shadow", "Mind", "Fear"],
436
+ "Witch (white)" => ["Life", "Nature", "Protection"],
437
+ "Summoner" => ["Mind", "Nature", "Shadow"],
438
+ "Battle Mage" => ["Fire", "Protection", "Body"],
439
+ "Seer" => ["Mind", "Time", "Illusion"],
440
+ "Shaman" => ["Nature", "Spirit", "Animal"]
441
+ }
@@ -0,0 +1,13 @@
1
+ # The armour table
2
+
3
+ $Armour = Array.new
4
+
5
+ $Armour[0] = [ "Type", "AP", "M-Mod", "H-Mod", "Wt"]
6
+ $Armour[1] = [ "None", 0, 0, 0, 2 ]
7
+ $Armour[2] = [ "Heavy Cloth", 1, -2, 0, 5 ]
8
+ $Armour[3] = [ "Leather armour", 1, -1, 0, 7 ]
9
+ $Armour[4] = [ "Leather scale", 2, -3, 0, 9 ]
10
+ $Armour[5] = [ "Ringed mail", 2, -1, -1, 9 ]
11
+ $Armour[6] = [ "Cuir-boullie", 3, -2, 0, 15 ]
12
+ $Armour[7] = [ "Chain mail", 4, -4, -2, 20 ]
13
+ $Armour[8] = [ "Metal scale", 5, -6, -3, 25 ]