Skip to content

Commit

Permalink
Added gender, personality & archetype to bot selection dropdowns (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
badwin-vt authored Dec 3, 2024
1 parent 5ccaabc commit 15c4c79
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Tertium4Or5/scripts/mods/Tertium4Or5/Tertium4Or5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ local mod = get_mod("Tertium4Or5")
local WeaponTemplates = require("scripts/settings/equipment/weapon_templates/weapon_templates")
local ProfileUtils = require("scripts/utilities/profile_utils")
local profiles = mod:persistent_table("profiles")
local Personalities = require("scripts/settings/character/personalities")

for _, weapon_template in pairs(WeaponTemplates) do
if table.array_contains(weapon_template.keywords, "ranged") then
Expand Down Expand Up @@ -44,8 +45,19 @@ mod:hook("ProfilesService", "fetch_all_profiles", function(func, ...)
profile.original_name = profile.name
profiles[profile.character_id] = profile

local gender_text = mod:localize("gender_female_abbreviation")
if profile.gender == "male" then
gender_text = mod:localize("gender_male_abbreviation")
end

local archetype = profile.archetype
local archetype_raw_name = Localize(archetype.archetype_name)
archetype_name = archetype_raw_name:sub(1,1):upper() .. archetype_raw_name:sub(2)

local personality_name = Localize(Personalities[profile.lore.backstory.personality].display_name)

table.insert(mod.character_options, {
text = profile.original_name,
text = profile.original_name .. " " .. gender_text .. " " .. personality_name .. " " .. archetype_name,
value = profile.character_id,
})
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ return {
en = "Bot 4",
["zh-cn"] = "机器人 4",
},
gender_male_abbreviation = {
en = "(m)",
},
gender_female_abbreviation = {
en = "(f)",
},
}

0 comments on commit 15c4c79

Please sign in to comment.