模块:NPC:修订间差异
来自星露谷物语扩展百科
更多操作
重构 |
无编辑摘要 |
||
| 第1行: | 第1行: | ||
local p = {} | local p = {} | ||
local characters = { | local characters = { | ||
{"亚历克斯", "Alex"}, | {"亚历克斯", "Alex"}, | ||
| 第55行: | 第54行: | ||
} | } | ||
local zh_to_en = {} | local zh_to_en = {} | ||
local en_to_zh = {} | local en_to_zh = {} | ||
| 第64行: | 第62行: | ||
end | end | ||
local function getArg(input) | local function getArg(input) | ||
if type(input) == "string" then | if type(input) == "string" then | ||
| 第72行: | 第69行: | ||
end | end | ||
function p.getEnglishName(input) | function p.getEnglishName(input) | ||
local name = getArg(input) | local name = getArg(input) | ||
| 第83行: | 第79行: | ||
end | end | ||
p.ZH = zh_to_en | p.ZH = zh_to_en | ||
p.EN = en_to_zh | p.EN = en_to_zh | ||
return p | return p | ||
2025年9月2日 (二) 19:28的版本
local p = {}
local characters = {
{"亚历克斯", "Alex"},
{"艾利欧特", "Elliott"},
{"哈维", "Harvey"},
{"山姆", "Sam"},
{"塞巴斯蒂安", "Sebastian"},
{"谢恩", "Shane"},
{"阿比盖尔", "Abigail"},
{"艾米丽", "Emily"},
{"海莉", "Haley"},
{"莉亚", "Leah"},
{"玛鲁", "Maru"},
{"潘妮", "Penny"},
{"卡洛琳", "Caroline"},
{"克林特", "Clint"},
{"德米特里厄斯", "Demetrius"},
{"矮人", "Dwarf"},
{"艾芙琳", "Evelyn"},
{"乔治", "George"},
{"格斯", "Gus"},
{"贾斯", "Jas"},
{"乔迪", "Jodi"},
{"肯特", "Kent"},
{"科罗布斯", "Krobus"},
{"刘易斯", "Lewis"},
{"莱纳斯", "Linus"},
{"玛妮", "Marnie"},
{"潘姆", "Pam"},
{"皮埃尔", "Pierre"},
{"罗宾", "Robin"},
{"桑迪", "Sandy"},
{"文森特", "Vincent"},
{"威利", "Willy"},
{"法师", "Wizard"},
{"吉尔", "Gil"},
{"冈瑟", "Gunther"},
{"仆从", "Henchman"},
{"马龙", "Marlon"},
{"莫里斯", "Morris"},
{"齐先生", "Mr. Qi"},
{"雷欧", "Leo"},
{"贝啼", "Birdie"},
{"蜗牛教授", "Professor Snail"},
{"姜岛商人", "Island Trader"},
{"沙漠商人", "Desert Trader"},
{"女巫", "Witch"},
{"州长", "Governer"},
{"门卫", "Bouncer"},
{"菲兹", "Fizz"},
{"老水手", "Mariner"},
{"爷爷", "Grandpa"}
}
local zh_to_en = {}
local en_to_zh = {}
for _, pair in ipairs(characters) do
zh_to_en[pair[1]] = pair[2]
en_to_zh[pair[2]] = pair[1]
end
local function getArg(input)
if type(input) == "string" then
return input
end
return input.args[1] or input:getParent().args[1]
end
function p.getEnglishName(input)
local name = getArg(input)
return zh_to_en[name] or name
end
function p.getChineseName(input)
local name = getArg(input)
return en_to_zh[name] or name
end
p.ZH = zh_to_en
p.EN = en_to_zh
return p