Difference between revisions of "Module:Data/Enums"

From The Alchemist Code Wiki
Jump to: navigation, search
Line 118: Line 118:
 
['TS_SUBGROUP_BF'] = 'Brave Frontier',
 
['TS_SUBGROUP_BF'] = 'Brave Frontier',
 
['TS_SUBGROUP_GREED_ARMY'] = 'Greed Dike Army',
 
['TS_SUBGROUP_GREED_ARMY'] = 'Greed Dike Army',
  +
['TS_SUBGROUP_LUST_SCHOOL'] = 'Venus School of Magic',
  +
['TS_SUBGROUP_SEIKYOU_MAGNUS'] = 'Troublemakers',
  +
['TS_SUBGROUP_SLOTH_MECH'] = 'Slothstein Engineer',
 
}
 
}
   

Revision as of 18:25, 11 May 2021

Documentation for this module may be created at Module:Data/Enums/doc

local p = {}

local tagMap = mw.loadData("Module:Data/Extra/TagMap")
local statTypeMap = mw.loadData("Module:Data/Extra/StatTypeMap")
local statNameMap = mw.loadData("Module:Data/Extra/StatNameMap")

local sexMap = {
    [0] = 'Unknown',
    [1] = 'Male',
    [2] = 'Female',
}

local gateSinMap = {
    [1] = 'Envy',
    [2] = 'Sloth',
    [3] = 'Lust',
    [4] = 'Gluttony',
    [5] = 'Wrath',
}

local elemMap = {
    [1] = 'Fire',
    [2] = 'Water',
    [3] = 'Wind',
    [4] = 'Thunder',
    [5] = 'Light',
    [6] = 'Dark',
}

local elemReverseMap = {
    ['Fire'] = 1,
    ['Water'] = 2,
    ['Wind'] = 3,
    ['Thunder'] = 4,
    ['Light'] = 5,
    ['Dark'] = 6,
}

local originMap = {
    [0] = "Other", 
    [100] = "Other",
    [1] = "Envylia",
    [2] = "Wratharis",
    [3] = "Slothstein",
    [4] = "Lustburg",
    [5] = "Gluttony Foss", 
    [6] = "Greed Dike", 
    [7] = "Saga Region", 
    [8] = "Wadatsumi", 
    [9] = "Desert Zone",
    [10] = "Northern Pride", 
    [11] = "Lost Blue",
}

local originReverseMap = {
    ["Other"] = 0, 
    ["Envylia"] = 1,
    ["Wratharis"] = 2,
    ["Slothstein"] = 3,
    ["Lustburg"] = 4,
    ["Gluttony Foss"] = 5, 
    ["Greed Dike"] = 6, 
    ["Saga Region"] = 7, 
    ["Wadatsumi"] = 8, 
    ["Desert Zone"] = 9,
    ["Northern Pride"] = 10, 
    ["Lost Blue"] = 11,
}


local originNameMap = {
    ["その他"] = "Other",  -- 0&100
    ["エンヴィリア"] = "Envylia",  -- 1
    ["ラーストリス"] = "Wratharis", -- 2
    ["スロウスシュタイン"] = "Slothstein", -- 3
    ["ルストブルグ"] = "Lustburg", -- 4
    ["グラトニー=フォス"] = "Gluttony Foss", -- 5
    ["グリードダイク"] = "Greed Dike", -- 6
    ["サガ地方"] = "Saga Region",  -- 7
    ["ワダツミ"] = "Wadatsumi",   -- 8
    ["砂漠地帯"] = "Desert Zone", -- 9
    ["ノーザンブライド"] = "Northern Pride", -- 10
    ["ロストブルー"] = "Lost Blue", -- 11
}

local originEnlightMap = {
	[0] = 'IT_TB_BIRTH_ETC',
	[100] = 'IT_TB_BIRTH_ETC',
	[1] = 'IT_TB_BIRTH_ENV',
	[2] = 'IT_TB_BIRTH_WRA',
	[3] = 'IT_TB_BIRTH_SLO',
	[4] = 'IT_TB_BIRTH_LUS',
	[5] = 'IT_TB_BIRTH_GLU',
	[6] = 'IT_TB_BIRTH_GRE',
	[7] = 'IT_TB_BIRTH_SAG',
	[8] = 'IT_TB_BIRTH_WAD',
	[9] = 'IT_TB_BIRTH_DES',
	[10] = 'IT_TB_BIRTH_NOZ',
	[11] = 'IT_TB_BIRTH_LOS',
}

local mementoGroupMap = {
    ['TS_SUBGROUP_HIENKISHI'] = "Scarlet Flame Guard",
    ['TS_SUBGROUP_SEIKYOUKISHI'] = "Holy Guard",
    ['TS_SUBGROUP_SOUENKISHI'] = "Blue Flame Guard",
    ['TS_SUBGROUP_ENVYRIA_KNIGHT'] = "Envylia Royal Knighthood",
    ['TS_SUBGROUP_SHADOWMESSIAH'] = "Shadow Messiah",
    ['TS_GROUP_WRATH_KNIGHT'] = "Knights of Wratharis",
    ['TS_SUBGROUP_WADA_BUKE'] = "Wadatsumi Clan",
    ['TS_SUBGROUP_SHAYNA_FUNCLUB'] = 'Shayna Fan Club',
    ['TS_SUBGROUP_TS'] = 'The Seven Deadly Sins',
    ['TS_SUBGROUP_FGG'] = 'FgG Collab',
    ['TS_SUBGROUP_JIKKAI'] = 'Templars',
    ['TS_SUBGROUP_KAIZOKU'] = 'Pirates',
    ['TS_SUBGROUP_SABAKUTAMI'] = 'Desert Dwellers',
    ['TS_SUBGROUP_GL_ORIGINAL'] = 'Global Original',
    ['TS_SUBGROUP_CRY'] = 'Crystal of Re:union',
    ['TS_SUBGROUP_BF'] = 'Brave Frontier',
    ['TS_SUBGROUP_GREED_ARMY'] = 'Greed Dike Army',
    ['TS_SUBGROUP_LUST_SCHOOL'] = 'Venus School of Magic',
    ['TS_SUBGROUP_SEIKYOU_MAGNUS'] = 'Troublemakers',
    ['TS_SUBGROUP_SLOTH_MECH'] = 'Slothstein Engineer',
}

p["EAbilitySlot"] = {
	[0] = "Action",
	[1] = "Support",
	[2] = "Reaction"
}
p["EAbilityType"] = {
	[0] = "Active",
	[1] = "Passive"
}
p["EAbilityTypeDetail"] = {
	[0] = "Default",
	[1] = "Job_Unique",
	[2] = "Job_Basic",
	[3] = "Job_Support",
	[4] = "Job_Reaction",
	[5] = "MasterAbility",
	[6] = "CollaboAbility",
	[7] = "WeaponAbility",
	[8] = "VisionAbility",
	[9] = "MapEffectAbility",
	[10] = "TobiraAbility"
}
p["AttackDetailTypes"]= {
	-- atk type
	[0] = "None",
	[1] = "Slash",
	[2] = "Stab",
	[3] = "Blow",
	[4] = "Shot",
	[5] = "Magic",
	[6] = "Jump",
	[7] = "MAX"
}
p.AttackDetailNames = {
	Blow = 'Strike',
	Shot = 'Missile',
	Stab = 'Pierce',
}
function p.attackDetailNameFromKey(key)
	local atk_det = p.AttackDetailTypes[tonumber(key)]
	return p.AttackDetailNames[atk_det] or atk_det
end
p["AttackTypes"] = {
	-- dmg type
	[0] = "None",
	[1] = "PhyAttack",
	[2] = "MagAttack"
}
p["SkillEffectTypes"] = {
	[0] = "None",
	[1] = "Equipment",
	[2] = "Attack",
	[3] = "Defend",
	[4] = "Heal",
	[5] = "Buff",
	[6] = "Debuff",
	[7] = "Revive",
	[8] = "Shield",
	[9] = "ReflectDamage",
	[10] = "DamageControl",
	[11] = "FailCondition",
	[12] = "CureCondition",
	[13] = "DisableCondition",
	[14] = "GemsGift",
	[15] = "GemsIncDec",
	[16] = "Guard",
	[17] = "Teleport",
	[18] = "Changing",
	[19] = "RateHeal",
	[20] = "RateDamage",
	[21] = "PerfectAvoid",
	[22] = "Throw",
	[23] = "EffReplace",
	[24] = "SetTrick",
	[25] = "TransformUnit",
	[26] = "SetBreakObj",
	[27] = "ChangeWeather",
	[28] = "RateDamageCurrent",
	[29] = "TransformUnitTakeOverHP",
	[30] = "DynamicTransformUnit"
}
p["ESelectType"] = {
	[0] = "Cross",
	[1] = "Diamond",
	[2] = "Square",
	[3] = "Laser",
	[4] = "All",
	[5] = "Wall",
	[6] = "WallPlus",
	[7] = "Bishop",
	[8] = "Victory",
	[9] = "LaserSpread",
	[10] = "LaserWide",
	[11] = "Horse",
	[12] = "LaserTwin",
	[13] = "LaserTriple",
	[14] = "SquareOutline"
}

p["SkillCategory"] = {
	[0] = "Damage",
	[1] = "Heal",
	[2] = "Support",
	[3] = "CureCondition",
	[4] = "FailCondition",
	[5] = "DisableCondition",
	[6] = "Transform",
}
p["ESkillCondition"] = {
    [0] = "None",
    [1] = "Dying",
    [2] = "MapEffect",
    [3] = "Weather",
    [4] = "CardSkill",
    [5] = "JudgeHP",
    [6] = "CardLsSkill"
}
p["ESkillTiming"] = {
    [0] = "Used",
    [1] = "Passive",
    [2] = "Wait",
    [3] = "Dead",
    [4] = "DamageCalculate",
    [5] = "DamageControl",
    [6] = "Reaction",
    [7] = "FirstReaction",
    [8] = "Auto",
    [9] = "Dying",
    [10] = "JudgeHP"
}
p["ESkillTarget"] = {
    [0] = "Self",
    [1] = "SelfSide",
    [2] = "EnemySide",
    [3] = "UnitAll",
    [4] = "NotSelf",
    [5] = "GridNoUnit",
    [6] = "ValidGrid",
    [7] = "SelfSideNotSelf"
}

p["ESkillType"] = {
    [0] = "Attack",
    [1] = "Skill",
    [2] = "Passive",
    [3] = "Item",
    [4] = "Reaction"
}

p["EnchantTypes"] = {
	[0] = "Poison",
	[1] = "Paralysed",
	[2] = "Stun",
	[3] = "Sleep",
	[4] = "Charm",
	[5] = "Stone",
	[6] = "Blind",
	[7] = "DisableSkill",
	[8] = "DisableMove",
	[9] = "DisableAttack",
	[10] = "Zombie",
	[11] = "DeathSentence",
	[12] = "Berserk",
	[13] = "Knockback",
	[14] = "ResistBuff",
	[15] = "ResistDebuff",
	[16] = "Stop",
	[17] = "Fast",
	[18] = "Slow",
	[19] = "AutoHeal",
	[20] = "Donsoku",
	[21] = "Rage",
	[22] = "GoodSleep",
	[23] = "AutoJewel",
	[24] = "DisableHeal",
	[25] = "SingleAttack",
	[26] = "AreaAttack",
	[27] = "DecCT",
	[28] = "IncCT",
	[29] = "ESA_Fire",
	[30] = "ESA_Water",
	[31] = "ESA_Wind",
	[32] = "ESA_Thunder",
	[33] = "ESA_Shine",
	[34] = "ESA_Dark",
	[35] = "MaxDamageHp",
	[36] = "MaxDamageMp",
	[37] = "SideAttack",
	[38] = "BackAttack",
	[39] = "ObstReaction",
}

p.EnchantTypeNames = {
	Fast = 'Quicken',
	Slow = 'Delay',
	Donsoku = 'Slow',
	Paralysed = 'Paralyze',
	Stone = 'Petrify',
	DisableSkill = 'Silence',
	DisableMove = 'Bind',
	DisableAttack = 'Daze',
	DecCT = 'Reduce CT',
	IncCT = 'Increase CT',
	ESA_Fire = 'Strong vs Fire',
	ESA_Water = 'Strong vs Water',
	ESA_Wind = 'Strong vs Wind',
	ESA_Thunder = 'Strong vs Thunder',
	ESA_Shine = 'Strong vs Light',
	MaxDamageHp = 'Max HP Damage Rate',
	MaxDamageMp = 'Max Jewel Damage Rate',
	ObstReaction = 'Reaction Block',
}

p.eCardType = {
    [0] = "None",
    [1] = "Equipment",
    [2] = "Enhance_exp",
    [3] = "Enhance_trust"
}
function p.enchantTypeNameFromKey(key)
	local enc_type = p.EnchantTypes[tonumber(key)]
	return p.EnchantTypeNames[enc_type] or enc_type
end


function p.elemFromKey(key)
    return elemMap[key]
end

function p.elemFromName(key)
    return elemReverseMap[key]
end

function p.gateSinFromKey(key)
    return gateSinMap[key]
end

function p.sexFromKey(key)
    return sexMap[key]
end

function p.originFromKey(key)
    return originMap[key]
end

function p.originKeyFromName(key)
    return originReverseMap[key]
end

function p.originFromNameKey(key)
    return originNameMap[key]
end

function p.originItemFromKey(key)
    return originEnlightMap[key]
end

function p.tagFromKey(key)
    return tagMap[key]
end

function p.statTypeFromKey(key)
    return statTypeMap[key]
end

function p.mementoGroupFromKey(key)
    return mementoGroupMap[key]
end

function p.mementoGroupList()
    return mementoGroupMap
end

-- Expected param is the string key returned from the stat type map
function p.statNameFromNameKey(key)
    return statNameMap[key]
end

-- Stat type is expected to be an integer
function p.statNameFromType(stat_type, tktag)
    local statName = p.statTypeFromKey(tostring(stat_type)) or stat_type
    if statName == 'Tokkou' then
        statName = 'Strong vs '..(p.tagFromKey(tktag) or tktag or statName)
    else
        statName = p.statNameFromNameKey(statName) or statName
    end
    
    return statName
end

return p