amar-rpg 2.1.2 → 2.1.5
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/amar-tui.rb +7 -4
- data/cli_npc_output_new.rb +13 -2
- data/includes/class_npc_new.rb +10 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ede7df11c3ed8b57956227af6899e1d314a80383429c3e2a7d2b94882c62950
|
4
|
+
data.tar.gz: 011eacaa3c4d6005f0948248f3592d14d27bd4fc7677bed2a5d5802137ca1cb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae98400dd3e9a70d02d484bb49ce56b5502421db8a48ce7ba1f6e7e26e38f0991f3c2b7478003911500f96c33aa3a11cb14193e8545f6311ae77c5f3c8f91d0c
|
7
|
+
data.tar.gz: 48e1a937e8add57cf7b97704a129953bf97fbccaf543bd394829aeb646a7a8fdb7e83d3331ca512e5387a1b7fe36c9c3563760f204fb4b9ec6163ec8cadbda07
|
data/amar-tui.rb
CHANGED
@@ -60,7 +60,7 @@ require 'stringio' # For suppressing output
|
|
60
60
|
require 'fcntl' # For non-blocking IO
|
61
61
|
|
62
62
|
# GLOBAL VARS & CONSTANTS
|
63
|
-
@version = "2.1.
|
63
|
+
@version = "2.1.5"
|
64
64
|
$pgmdir = File.dirname(__FILE__) # Global for includes
|
65
65
|
|
66
66
|
# Debug logging
|
@@ -2048,17 +2048,20 @@ def npc_input_new_tui
|
|
2048
2048
|
show_content(type_text)
|
2049
2049
|
type_input = get_text_input("")
|
2050
2050
|
return nil if type_input == :cancelled
|
2051
|
-
|
2051
|
+
|
2052
2052
|
type = ""
|
2053
2053
|
if type_input && type_input.to_i > 0 && type_input.to_i <= types.length
|
2054
2054
|
type = types[type_input.to_i - 1]
|
2055
|
+
else
|
2056
|
+
# Random type selection (0 or empty input)
|
2057
|
+
type = types.sample
|
2055
2058
|
end
|
2056
|
-
|
2059
|
+
|
2057
2060
|
# If race is not Human and type doesn't already include race, prepend it
|
2058
2061
|
if race != "Human" && !type.include?(":")
|
2059
2062
|
type = "#{race}: #{type}" if !type.empty?
|
2060
2063
|
end
|
2061
|
-
|
2064
|
+
|
2062
2065
|
inputs << type
|
2063
2066
|
|
2064
2067
|
# Level selection
|
data/cli_npc_output_new.rb
CHANGED
@@ -94,10 +94,21 @@ def npc_output_new(n, cli, custom_width = nil)
|
|
94
94
|
n.tiers["BODY"].each do |attr_name, attr_data|
|
95
95
|
# Skip if attr_data is not a hash or doesn't have skills
|
96
96
|
next unless attr_data.is_a?(Hash) && attr_data["skills"].is_a?(Hash)
|
97
|
-
|
97
|
+
|
98
98
|
non_zero_skills = attr_data["skills"].select { |_, v| v > 0 }
|
99
|
+
|
100
|
+
# For Melee Combat and Missile Combat, show attribute but not individual weapon skills
|
101
|
+
if attr_name == "Melee Combat" || attr_name == "Missile Combat"
|
102
|
+
# Show attribute only if there are any skills
|
103
|
+
if non_zero_skills.any?
|
104
|
+
attr_level = attr_data["level"]
|
105
|
+
body_lines << " #{@attr_color}#{attr_name} (#{attr_level.to_s.rjust(2)})#{@reset}"
|
106
|
+
end
|
107
|
+
next # Skip individual weapon skills
|
108
|
+
end
|
109
|
+
|
99
110
|
next if non_zero_skills.empty?
|
100
|
-
|
111
|
+
|
101
112
|
attr_level = attr_data["level"]
|
102
113
|
body_lines << " #{@attr_color}#{attr_name} (#{attr_level.to_s.rjust(2)})#{@reset}"
|
103
114
|
non_zero_skills.each do |skill_name, skill_level|
|
data/includes/class_npc_new.rb
CHANGED
@@ -18,7 +18,7 @@ class NpcNew
|
|
18
18
|
# Generate random values for missing data
|
19
19
|
@name = name && !name.empty? ? name : generate_random_name(sex)
|
20
20
|
@type = type
|
21
|
-
@level = level.to_i
|
21
|
+
@level = level.to_i > 0 ? level.to_i : rand(1..6) # Random level 1-6 if 0 or invalid
|
22
22
|
@area = area && !area.empty? ? area : ["Amaronir", "Merisir", "Calaronir", "Feronir", "Rauinir"].sample
|
23
23
|
@sex = sex && !sex.empty? ? sex : ["M", "F"].sample
|
24
24
|
|
@@ -1258,6 +1258,15 @@ class NpcNew
|
|
1258
1258
|
unless @tiers["MIND"]["Awareness"]["skills"].key?("Reaction speed")
|
1259
1259
|
@tiers["MIND"]["Awareness"]["skills"]["Reaction speed"] = 0
|
1260
1260
|
end
|
1261
|
+
|
1262
|
+
# Ensure Social Knowledge attribute exists for Spoken Language
|
1263
|
+
@tiers["MIND"]["Social Knowledge"] ||= {"level" => 0, "skills" => {}}
|
1264
|
+
@tiers["MIND"]["Social Knowledge"]["skills"] ||= {}
|
1265
|
+
|
1266
|
+
# Ensure Spoken Language is at least 2 (native tongue)
|
1267
|
+
# All characters start with 2 in Spoken Language per character creation rules
|
1268
|
+
current_spoken = @tiers["MIND"]["Social Knowledge"]["skills"]["Spoken Language"] || 0
|
1269
|
+
@tiers["MIND"]["Social Knowledge"]["skills"]["Spoken Language"] = [current_spoken, 2].max
|
1261
1270
|
end
|
1262
1271
|
|
1263
1272
|
def apply_predetermined_stats
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amar-rpg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: "."
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-10-
|
11
|
+
date: 2025-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rcurses
|
@@ -123,7 +123,7 @@ metadata:
|
|
123
123
|
post_install_message: |2+
|
124
124
|
|
125
125
|
===========================================
|
126
|
-
AMAR RPG Tools v2.1.
|
126
|
+
AMAR RPG Tools v2.1.5 has been installed!
|
127
127
|
===========================================
|
128
128
|
|
129
129
|
To start the application:
|