# This file is auto-generated by extract_enums.py in the scripts folder.
# You shouldn't edit this file directly.


from enum import IntEnum, StrEnum


class GenderType(IntEnum):
    MALE = 1
    FEMALE = 2
    OTHER = 3


class NiceGender(StrEnum):
    """Gender Enum"""

    male = "male"
    female = "female"
    other = "unknown"


GENDER_TYPE_NAME: dict[int, NiceGender] = {
    1: NiceGender.male,
    2: NiceGender.female,
    3: NiceGender.other,
}


class SvtType(IntEnum):
    NORMAL = 1
    HEROINE = 2
    COMBINE_MATERIAL = 3
    ENEMY = 4
    ENEMY_COLLECTION = 5
    SERVANT_EQUIP = 6
    STATUS_UP = 7
    SVT_EQUIP_MATERIAL = 8
    ENEMY_COLLECTION_DETAIL = 9
    ALL = 10
    COMMAND_CODE = 11
    SVT_MATERIAL_TD = 12


class NiceSvtType(StrEnum):
    """Servant Type Enum"""

    normal = "normal"
    heroine = "heroine"
    combineMaterial = "combineMaterial"
    enemy = "enemy"
    enemyCollection = "enemyCollection"
    servantEquip = "servantEquip"
    statusUp = "statusUp"
    svtEquipMaterial = "svtEquipMaterial"
    enemyCollectionDetail = "enemyCollectionDetail"
    all = "all"
    commandCode = "commandCode"
    svtMaterialTd = "svtMaterialTd"


SVT_TYPE_NAME: dict[int, NiceSvtType] = {
    1: NiceSvtType.normal,
    2: NiceSvtType.heroine,
    3: NiceSvtType.combineMaterial,
    4: NiceSvtType.enemy,
    5: NiceSvtType.enemyCollection,
    6: NiceSvtType.servantEquip,
    7: NiceSvtType.statusUp,
    8: NiceSvtType.svtEquipMaterial,
    9: NiceSvtType.enemyCollectionDetail,
    10: NiceSvtType.all,
    11: NiceSvtType.commandCode,
    12: NiceSvtType.svtMaterialTd,
}


class SvtFlag(IntEnum):
    ONLY_USE_FOR_NPC = 2
    SVT_EQUIP_FRIEND_SHIP = 4
    IGNORE_COMBINE_LIMIT_SPECIAL = 8
    SVT_EQUIP_EXP = 16
    SVT_EQUIP_CHOCOLATE = 32
    SVT_EQUIP_MANA_EXCHANGE = 128
    SVT_EQUIP_CAMPAIGN = 256
    SVT_EQUIP_EVENT = 512
    SVT_EQUIP_EVENT_REWARD = 1024
    SVT_EQUIP_RARITY_LEVEL_NUM_MISSION = 2048


class NiceSvtFlag(StrEnum):
    """Servant Flag Enum"""

    onlyUseForNpc = "onlyUseForNpc"
    svtEquipFriendShip = "svtEquipFriendShip"
    ignoreCombineLimitSpecial = "ignoreCombineLimitSpecial"
    svtEquipExp = "svtEquipExp"
    svtEquipChocolate = "svtEquipChocolate"
    svtEquipManaExchange = "svtEquipManaExchange"
    svtEquipCampaign = "svtEquipCampaign"
    svtEquipEvent = "svtEquipEvent"
    svtEquipEventReward = "svtEquipEventReward"
    svtEquipRarityLevelNumMission = "svtEquipRarityLevelNumMission"
    normal = "normal"
    goetia = "goetia"
    matDropRateUpCe = "matDropRateUpCe"
    unknown = "unknown"


SVT_FLAG_NAME: dict[int, NiceSvtFlag] = {
    2: NiceSvtFlag.onlyUseForNpc,
    4: NiceSvtFlag.svtEquipFriendShip,
    8: NiceSvtFlag.ignoreCombineLimitSpecial,
    16: NiceSvtFlag.svtEquipExp,
    32: NiceSvtFlag.svtEquipChocolate,
    128: NiceSvtFlag.svtEquipManaExchange,
    256: NiceSvtFlag.svtEquipCampaign,
    512: NiceSvtFlag.svtEquipEvent,
    1024: NiceSvtFlag.svtEquipEventReward,
    2048: NiceSvtFlag.svtEquipRarityLevelNumMission,
    0: NiceSvtFlag.normal,
    63: NiceSvtFlag.goetia,
    64: NiceSvtFlag.matDropRateUpCe,
    -1: NiceSvtFlag.unknown,
}


class SvtFlagOriginal(IntEnum):
    ONLY_USE_FOR_NPC = 2
    SVT_EQUIP_FRIEND_SHIP = 4
    IGNORE_COMBINE_LIMIT_SPECIAL = 8
    SVT_EQUIP_EXP = 16
    SVT_EQUIP_CHOCOLATE = 32
    SVT_EQUIP_MANA_EXCHANGE = 128
    SVT_EQUIP_CAMPAIGN = 256
    SVT_EQUIP_EVENT = 512
    SVT_EQUIP_EVENT_REWARD = 1024
    SVT_EQUIP_RARITY_LEVEL_NUM_MISSION = 2048


class NiceSvtFlagOriginal(StrEnum):
    """Original Servant Flag Enum"""

    onlyUseForNpc = "onlyUseForNpc"
    svtEquipFriendShip = "svtEquipFriendShip"
    ignoreCombineLimitSpecial = "ignoreCombineLimitSpecial"
    svtEquipExp = "svtEquipExp"
    svtEquipChocolate = "svtEquipChocolate"
    svtEquipManaExchange = "svtEquipManaExchange"
    svtEquipCampaign = "svtEquipCampaign"
    svtEquipEvent = "svtEquipEvent"
    svtEquipEventReward = "svtEquipEventReward"
    svtEquipRarityLevelNumMission = "svtEquipRarityLevelNumMission"


SVT_FLAG_ORIGINAL_NAME: dict[int, NiceSvtFlagOriginal] = {
    2: NiceSvtFlagOriginal.onlyUseForNpc,
    4: NiceSvtFlagOriginal.svtEquipFriendShip,
    8: NiceSvtFlagOriginal.ignoreCombineLimitSpecial,
    16: NiceSvtFlagOriginal.svtEquipExp,
    32: NiceSvtFlagOriginal.svtEquipChocolate,
    128: NiceSvtFlagOriginal.svtEquipManaExchange,
    256: NiceSvtFlagOriginal.svtEquipCampaign,
    512: NiceSvtFlagOriginal.svtEquipEvent,
    1024: NiceSvtFlagOriginal.svtEquipEventReward,
    2048: NiceSvtFlagOriginal.svtEquipRarityLevelNumMission,
}


class FuncType(IntEnum):
    NONE = 0
    ADD_STATE = 1
    SUB_STATE = 2
    DAMAGE = 3
    DAMAGE_NP = 4
    GAIN_STAR = 5
    GAIN_HP = 6
    GAIN_NP = 7
    LOSS_NP = 8
    SHORTEN_SKILL = 9
    EXTEND_SKILL = 10
    RELEASE_STATE = 11
    LOSS_HP = 12
    INSTANT_DEATH = 13
    DAMAGE_NP_PIERCE = 14
    DAMAGE_NP_INDIVIDUAL = 15
    ADD_STATE_SHORT = 16
    GAIN_HP_PER = 17
    DAMAGE_NP_STATE_INDIVIDUAL = 18
    HASTEN_NPTURN = 19
    DELAY_NPTURN = 20
    DAMAGE_NP_HPRATIO_HIGH = 21
    DAMAGE_NP_HPRATIO_LOW = 22
    CARD_RESET = 23
    REPLACE_MEMBER = 24
    LOSS_HP_SAFE = 25
    DAMAGE_NP_COUNTER = 26
    DAMAGE_NP_STATE_INDIVIDUAL_FIX = 27
    DAMAGE_NP_SAFE = 28
    CALL_SERVANT = 29
    PT_SHUFFLE = 30
    LOSS_STAR = 31
    CHANGE_SERVANT = 32
    CHANGE_BG = 33
    DAMAGE_VALUE = 34
    WITHDRAW = 35
    FIX_COMMANDCARD = 36
    SHORTEN_BUFFTURN = 37
    EXTEND_BUFFTURN = 38
    SHORTEN_BUFFCOUNT = 39
    EXTEND_BUFFCOUNT = 40
    CHANGE_BGM = 41
    DISPLAY_BUFFSTRING = 42
    RESURRECTION = 43
    GAIN_NP_BUFF_INDIVIDUAL_SUM = 44
    SET_SYSTEM_ALIVE_FLAG = 45
    FORCE_INSTANT_DEATH = 46
    DAMAGE_NP_RARE = 47
    GAIN_NP_FROM_TARGETS = 48
    GAIN_HP_FROM_TARGETS = 49
    LOSS_HP_PER = 50
    LOSS_HP_PER_SAFE = 51
    SHORTEN_USER_EQUIP_SKILL = 52
    QUICK_CHANGE_BG = 53
    SHIFT_SERVANT = 54
    DAMAGE_NP_AND_OR_CHECK_INDIVIDUALITY = 55
    ABSORB_NPTURN = 56
    OVERWRITE_DEAD_TYPE = 57
    FORCE_ALL_BUFF_NOACT = 58
    BREAK_GAUGE_UP = 59
    BREAK_GAUGE_DOWN = 60
    MOVE_TO_LAST_SUBMEMBER = 61
    EXTEND_USER_EQUIP_SKILL = 62
    UPDATE_ENEMY_ENTRY_MAX_COUNT_EACH_TURN = 63
    EXP_UP = 101
    QP_UP = 102
    DROP_UP = 103
    FRIEND_POINT_UP = 104
    EVENT_DROP_UP = 105
    EVENT_DROP_RATE_UP = 106
    EVENT_POINT_UP = 107
    EVENT_POINT_RATE_UP = 108
    TRANSFORM_SERVANT = 109
    QP_DROP_UP = 110
    SERVANT_FRIENDSHIP_UP = 111
    USER_EQUIP_EXP_UP = 112
    CLASS_DROP_UP = 113
    ENEMY_ENCOUNT_COPY_RATE_UP = 114
    ENEMY_ENCOUNT_RATE_UP = 115
    ENEMY_PROB_DOWN = 116
    GET_REWARD_GIFT = 117
    SEND_SUPPORT_FRIEND_POINT = 118
    MOVE_POSITION = 119
    REVIVAL = 120
    DAMAGE_NP_INDIVIDUAL_SUM = 121
    DAMAGE_VALUE_SAFE = 122
    FRIEND_POINT_UP_DUPLICATE = 123
    MOVE_STATE = 124
    CHANGE_BGM_COSTUME = 125
    LOSS_COMMAND_SPELL = 126
    GAIN_COMMAND_SPELL = 127
    UPDATE_ENTRY_POSITIONS = 128
    BUDDY_POINT_UP = 129
    ADD_FIELD_CHANGE_TO_FIELD = 130
    SUB_FIELD_BUFF = 131
    EVENT_FORTIFICATION_POINT_UP = 132
    GAIN_NP_INDIVIDUAL_SUM = 133
    SET_QUEST_ROUTE_FLAG = 134
    LAST_USE_PLAYER_SKILL_COPY = 135
    CHANGE_ENEMY_MASTER_FACE = 136
    DAMAGE_VALUE_SAFE_ONCE = 137
    ADD_BATTLE_VALUE = 138
    SET_BATTLE_VALUE = 139
    GAIN_MULTIPLY_NP = 140
    LOSS_MULTIPLY_NP = 141
    ADD_BATTLE_POINT = 142
    DAMAGE_NP_BATTLE_POINT_PHASE = 143
    SET_NP_EXECUTED_STATE = 144
    HIDE_OVER_GAUGE = 145
    GAIN_NP_TARGET_SUM = 146
    ENEMY_COUNT_CHANGE = 147
    DISPLAY_BATTLE_MESSAGE = 148
    GENERATE_BATTLE_SKILL_DROP = 149
    CHANGE_MASTER_FACE = 150
    ENABLE_MASTER_SKILL = 151
    ENABLE_MASTER_COMMAND_SPELL = 152
    BATTLE_MODEL_CHANGE = 153
    GAIN_NP_CRITICALSTAR_SUM = 154
    ADD_BATTLE_MISSION_VALUE = 155
    SET_BATTLE_MISSION_VALUE = 156
    CHANGE_ENEMY_STATUS_UI_TYPE = 157
    SWAP_FIELD_POSITION = 158
    SET_DISPLAY_DIRECT_BATTLE_MESSAGE_IN_FSM = 159
    ADD_STATE_TO_FIELD = 160
    ADD_STATE_SHORT_TO_FIELD = 161


class NiceFuncType(StrEnum):
    """Function Type Enum"""

    none = "none"
    addState = "addState"
    subState = "subState"
    damage = "damage"
    damageNp = "damageNp"
    gainStar = "gainStar"
    gainHp = "gainHp"
    gainNp = "gainNp"
    lossNp = "lossNp"
    shortenSkill = "shortenSkill"
    extendSkill = "extendSkill"
    releaseState = "releaseState"
    lossHp = "lossHp"
    instantDeath = "instantDeath"
    damageNpPierce = "damageNpPierce"
    damageNpIndividual = "damageNpIndividual"
    addStateShort = "addStateShort"
    gainHpPer = "gainHpPer"
    damageNpStateIndividual = "damageNpStateIndividual"
    hastenNpturn = "hastenNpturn"
    delayNpturn = "delayNpturn"
    damageNpHpratioHigh = "damageNpHpratioHigh"
    damageNpHpratioLow = "damageNpHpratioLow"
    cardReset = "cardReset"
    replaceMember = "replaceMember"
    lossHpSafe = "lossHpSafe"
    damageNpCounter = "damageNpCounter"
    damageNpStateIndividualFix = "damageNpStateIndividualFix"
    damageNpSafe = "damageNpSafe"
    callServant = "callServant"
    ptShuffle = "ptShuffle"
    lossStar = "lossStar"
    changeServant = "changeServant"
    changeBg = "changeBg"
    damageValue = "damageValue"
    withdraw = "withdraw"
    fixCommandcard = "fixCommandcard"
    shortenBuffturn = "shortenBuffturn"
    extendBuffturn = "extendBuffturn"
    shortenBuffcount = "shortenBuffcount"
    extendBuffcount = "extendBuffcount"
    changeBgm = "changeBgm"
    displayBuffstring = "displayBuffstring"
    resurrection = "resurrection"
    gainNpBuffIndividualSum = "gainNpBuffIndividualSum"
    setSystemAliveFlag = "setSystemAliveFlag"
    forceInstantDeath = "forceInstantDeath"
    damageNpRare = "damageNpRare"
    gainNpFromTargets = "gainNpFromTargets"
    gainHpFromTargets = "gainHpFromTargets"
    lossHpPer = "lossHpPer"
    lossHpPerSafe = "lossHpPerSafe"
    shortenUserEquipSkill = "shortenUserEquipSkill"
    quickChangeBg = "quickChangeBg"
    shiftServant = "shiftServant"
    damageNpAndOrCheckIndividuality = "damageNpAndOrCheckIndividuality"
    absorbNpturn = "absorbNpturn"
    overwriteDeadType = "overwriteDeadType"
    forceAllBuffNoact = "forceAllBuffNoact"
    breakGaugeUp = "breakGaugeUp"
    breakGaugeDown = "breakGaugeDown"
    moveToLastSubmember = "moveToLastSubmember"
    extendUserEquipSkill = "extendUserEquipSkill"
    updateEnemyEntryMaxCountEachTurn = "updateEnemyEntryMaxCountEachTurn"
    expUp = "expUp"
    qpUp = "qpUp"
    dropUp = "dropUp"
    friendPointUp = "friendPointUp"
    eventDropUp = "eventDropUp"
    eventDropRateUp = "eventDropRateUp"
    eventPointUp = "eventPointUp"
    eventPointRateUp = "eventPointRateUp"
    transformServant = "transformServant"
    qpDropUp = "qpDropUp"
    servantFriendshipUp = "servantFriendshipUp"
    userEquipExpUp = "userEquipExpUp"
    classDropUp = "classDropUp"
    enemyEncountCopyRateUp = "enemyEncountCopyRateUp"
    enemyEncountRateUp = "enemyEncountRateUp"
    enemyProbDown = "enemyProbDown"
    getRewardGift = "getRewardGift"
    sendSupportFriendPoint = "sendSupportFriendPoint"
    movePosition = "movePosition"
    revival = "revival"
    damageNpIndividualSum = "damageNpIndividualSum"
    damageValueSafe = "damageValueSafe"
    friendPointUpDuplicate = "friendPointUpDuplicate"
    moveState = "moveState"
    changeBgmCostume = "changeBgmCostume"
    lossCommandSpell = "lossCommandSpell"
    gainCommandSpell = "gainCommandSpell"
    updateEntryPositions = "updateEntryPositions"
    buddyPointUp = "buddyPointUp"
    addFieldChangeToField = "addFieldChangeToField"
    subFieldBuff = "subFieldBuff"
    eventFortificationPointUp = "eventFortificationPointUp"
    gainNpIndividualSum = "gainNpIndividualSum"
    setQuestRouteFlag = "setQuestRouteFlag"
    lastUsePlayerSkillCopy = "lastUsePlayerSkillCopy"
    changeEnemyMasterFace = "changeEnemyMasterFace"
    damageValueSafeOnce = "damageValueSafeOnce"
    addBattleValue = "addBattleValue"
    setBattleValue = "setBattleValue"
    gainMultiplyNp = "gainMultiplyNp"
    lossMultiplyNp = "lossMultiplyNp"
    addBattlePoint = "addBattlePoint"
    damageNpBattlePointPhase = "damageNpBattlePointPhase"
    setNpExecutedState = "setNpExecutedState"
    hideOverGauge = "hideOverGauge"
    gainNpTargetSum = "gainNpTargetSum"
    enemyCountChange = "enemyCountChange"
    displayBattleMessage = "displayBattleMessage"
    generateBattleSkillDrop = "generateBattleSkillDrop"
    changeMasterFace = "changeMasterFace"
    enableMasterSkill = "enableMasterSkill"
    enableMasterCommandSpell = "enableMasterCommandSpell"
    battleModelChange = "battleModelChange"
    gainNpCriticalstarSum = "gainNpCriticalstarSum"
    addBattleMissionValue = "addBattleMissionValue"
    setBattleMissionValue = "setBattleMissionValue"
    changeEnemyStatusUiType = "changeEnemyStatusUiType"
    swapFieldPosition = "swapFieldPosition"
    setDisplayDirectBattleMessageInFsm = "setDisplayDirectBattleMessageInFsm"
    addStateToField = "addStateToField"
    addStateShortToField = "addStateShortToField"


FUNC_TYPE_NAME: dict[int, NiceFuncType] = {
    0: NiceFuncType.none,
    1: NiceFuncType.addState,
    2: NiceFuncType.subState,
    3: NiceFuncType.damage,
    4: NiceFuncType.damageNp,
    5: NiceFuncType.gainStar,
    6: NiceFuncType.gainHp,
    7: NiceFuncType.gainNp,
    8: NiceFuncType.lossNp,
    9: NiceFuncType.shortenSkill,
    10: NiceFuncType.extendSkill,
    11: NiceFuncType.releaseState,
    12: NiceFuncType.lossHp,
    13: NiceFuncType.instantDeath,
    14: NiceFuncType.damageNpPierce,
    15: NiceFuncType.damageNpIndividual,
    16: NiceFuncType.addStateShort,
    17: NiceFuncType.gainHpPer,
    18: NiceFuncType.damageNpStateIndividual,
    19: NiceFuncType.hastenNpturn,
    20: NiceFuncType.delayNpturn,
    21: NiceFuncType.damageNpHpratioHigh,
    22: NiceFuncType.damageNpHpratioLow,
    23: NiceFuncType.cardReset,
    24: NiceFuncType.replaceMember,
    25: NiceFuncType.lossHpSafe,
    26: NiceFuncType.damageNpCounter,
    27: NiceFuncType.damageNpStateIndividualFix,
    28: NiceFuncType.damageNpSafe,
    29: NiceFuncType.callServant,
    30: NiceFuncType.ptShuffle,
    31: NiceFuncType.lossStar,
    32: NiceFuncType.changeServant,
    33: NiceFuncType.changeBg,
    34: NiceFuncType.damageValue,
    35: NiceFuncType.withdraw,
    36: NiceFuncType.fixCommandcard,
    37: NiceFuncType.shortenBuffturn,
    38: NiceFuncType.extendBuffturn,
    39: NiceFuncType.shortenBuffcount,
    40: NiceFuncType.extendBuffcount,
    41: NiceFuncType.changeBgm,
    42: NiceFuncType.displayBuffstring,
    43: NiceFuncType.resurrection,
    44: NiceFuncType.gainNpBuffIndividualSum,
    45: NiceFuncType.setSystemAliveFlag,
    46: NiceFuncType.forceInstantDeath,
    47: NiceFuncType.damageNpRare,
    48: NiceFuncType.gainNpFromTargets,
    49: NiceFuncType.gainHpFromTargets,
    50: NiceFuncType.lossHpPer,
    51: NiceFuncType.lossHpPerSafe,
    52: NiceFuncType.shortenUserEquipSkill,
    53: NiceFuncType.quickChangeBg,
    54: NiceFuncType.shiftServant,
    55: NiceFuncType.damageNpAndOrCheckIndividuality,
    56: NiceFuncType.absorbNpturn,
    57: NiceFuncType.overwriteDeadType,
    58: NiceFuncType.forceAllBuffNoact,
    59: NiceFuncType.breakGaugeUp,
    60: NiceFuncType.breakGaugeDown,
    61: NiceFuncType.moveToLastSubmember,
    62: NiceFuncType.extendUserEquipSkill,
    63: NiceFuncType.updateEnemyEntryMaxCountEachTurn,
    101: NiceFuncType.expUp,
    102: NiceFuncType.qpUp,
    103: NiceFuncType.dropUp,
    104: NiceFuncType.friendPointUp,
    105: NiceFuncType.eventDropUp,
    106: NiceFuncType.eventDropRateUp,
    107: NiceFuncType.eventPointUp,
    108: NiceFuncType.eventPointRateUp,
    109: NiceFuncType.transformServant,
    110: NiceFuncType.qpDropUp,
    111: NiceFuncType.servantFriendshipUp,
    112: NiceFuncType.userEquipExpUp,
    113: NiceFuncType.classDropUp,
    114: NiceFuncType.enemyEncountCopyRateUp,
    115: NiceFuncType.enemyEncountRateUp,
    116: NiceFuncType.enemyProbDown,
    117: NiceFuncType.getRewardGift,
    118: NiceFuncType.sendSupportFriendPoint,
    119: NiceFuncType.movePosition,
    120: NiceFuncType.revival,
    121: NiceFuncType.damageNpIndividualSum,
    122: NiceFuncType.damageValueSafe,
    123: NiceFuncType.friendPointUpDuplicate,
    124: NiceFuncType.moveState,
    125: NiceFuncType.changeBgmCostume,
    126: NiceFuncType.lossCommandSpell,
    127: NiceFuncType.gainCommandSpell,
    128: NiceFuncType.updateEntryPositions,
    129: NiceFuncType.buddyPointUp,
    130: NiceFuncType.addFieldChangeToField,
    131: NiceFuncType.subFieldBuff,
    132: NiceFuncType.eventFortificationPointUp,
    133: NiceFuncType.gainNpIndividualSum,
    134: NiceFuncType.setQuestRouteFlag,
    135: NiceFuncType.lastUsePlayerSkillCopy,
    136: NiceFuncType.changeEnemyMasterFace,
    137: NiceFuncType.damageValueSafeOnce,
    138: NiceFuncType.addBattleValue,
    139: NiceFuncType.setBattleValue,
    140: NiceFuncType.gainMultiplyNp,
    141: NiceFuncType.lossMultiplyNp,
    142: NiceFuncType.addBattlePoint,
    143: NiceFuncType.damageNpBattlePointPhase,
    144: NiceFuncType.setNpExecutedState,
    145: NiceFuncType.hideOverGauge,
    146: NiceFuncType.gainNpTargetSum,
    147: NiceFuncType.enemyCountChange,
    148: NiceFuncType.displayBattleMessage,
    149: NiceFuncType.generateBattleSkillDrop,
    150: NiceFuncType.changeMasterFace,
    151: NiceFuncType.enableMasterSkill,
    152: NiceFuncType.enableMasterCommandSpell,
    153: NiceFuncType.battleModelChange,
    154: NiceFuncType.gainNpCriticalstarSum,
    155: NiceFuncType.addBattleMissionValue,
    156: NiceFuncType.setBattleMissionValue,
    157: NiceFuncType.changeEnemyStatusUiType,
    158: NiceFuncType.swapFieldPosition,
    159: NiceFuncType.setDisplayDirectBattleMessageInFsm,
    160: NiceFuncType.addStateToField,
    161: NiceFuncType.addStateShortToField,
}


class FuncTargetType(IntEnum):
    SELF = 0
    PT_ONE = 1
    PT_ANOTHER = 2
    PT_ALL = 3
    ENEMY = 4
    ENEMY_ANOTHER = 5
    ENEMY_ALL = 6
    PT_FULL = 7
    ENEMY_FULL = 8
    PT_OTHER = 9
    PT_ONE_OTHER = 10
    PT_RANDOM = 11
    ENEMY_OTHER = 12
    ENEMY_RANDOM = 13
    PT_OTHER_FULL = 14
    ENEMY_OTHER_FULL = 15
    PTSELECT_ONE_SUB = 16
    PTSELECT_SUB = 17
    PT_ONE_ANOTHER_RANDOM = 18
    PT_SELF_ANOTHER_RANDOM = 19
    ENEMY_ONE_ANOTHER_RANDOM = 20
    PT_SELF_ANOTHER_FIRST = 21
    PT_SELF_BEFORE = 22
    PT_SELF_AFTER = 23
    PT_SELF_ANOTHER_LAST = 24
    COMMAND_TYPE_SELF_TREASURE_DEVICE = 25
    FIELD_OTHER = 26
    ENEMY_ONE_NO_TARGET_NO_ACTION = 27
    PT_ONE_HP_LOWEST_VALUE = 28
    PT_ONE_HP_LOWEST_RATE = 29
    ENEMY_RANGE = 30
    HAND_COMMANDCARD_RANDOM_ONE = 31
    FIELD_ALL = 32
    NO_TARGET = 33
    FIELD_RANDOM = 34


class NiceFuncTargetType(StrEnum):
    """Function Target Type Enum"""

    self_ = "self"
    ptOne = "ptOne"
    ptAnother = "ptAnother"
    ptAll = "ptAll"
    enemy = "enemy"
    enemyAnother = "enemyAnother"
    enemyAll = "enemyAll"
    ptFull = "ptFull"
    enemyFull = "enemyFull"
    ptOther = "ptOther"
    ptOneOther = "ptOneOther"
    ptRandom = "ptRandom"
    enemyOther = "enemyOther"
    enemyRandom = "enemyRandom"
    ptOtherFull = "ptOtherFull"
    enemyOtherFull = "enemyOtherFull"
    ptselectOneSub = "ptselectOneSub"
    ptselectSub = "ptselectSub"
    ptOneAnotherRandom = "ptOneAnotherRandom"
    ptSelfAnotherRandom = "ptSelfAnotherRandom"
    enemyOneAnotherRandom = "enemyOneAnotherRandom"
    ptSelfAnotherFirst = "ptSelfAnotherFirst"
    ptSelfBefore = "ptSelfBefore"
    ptSelfAfter = "ptSelfAfter"
    ptSelfAnotherLast = "ptSelfAnotherLast"
    commandTypeSelfTreasureDevice = "commandTypeSelfTreasureDevice"
    fieldOther = "fieldOther"
    enemyOneNoTargetNoAction = "enemyOneNoTargetNoAction"
    ptOneHpLowestValue = "ptOneHpLowestValue"
    ptOneHpLowestRate = "ptOneHpLowestRate"
    enemyRange = "enemyRange"
    handCommandcardRandomOne = "handCommandcardRandomOne"
    fieldAll = "fieldAll"
    noTarget = "noTarget"
    fieldRandom = "fieldRandom"


FUNC_TARGETTYPE_NAME: dict[int, NiceFuncTargetType] = {
    0: NiceFuncTargetType.self_,
    1: NiceFuncTargetType.ptOne,
    2: NiceFuncTargetType.ptAnother,
    3: NiceFuncTargetType.ptAll,
    4: NiceFuncTargetType.enemy,
    5: NiceFuncTargetType.enemyAnother,
    6: NiceFuncTargetType.enemyAll,
    7: NiceFuncTargetType.ptFull,
    8: NiceFuncTargetType.enemyFull,
    9: NiceFuncTargetType.ptOther,
    10: NiceFuncTargetType.ptOneOther,
    11: NiceFuncTargetType.ptRandom,
    12: NiceFuncTargetType.enemyOther,
    13: NiceFuncTargetType.enemyRandom,
    14: NiceFuncTargetType.ptOtherFull,
    15: NiceFuncTargetType.enemyOtherFull,
    16: NiceFuncTargetType.ptselectOneSub,
    17: NiceFuncTargetType.ptselectSub,
    18: NiceFuncTargetType.ptOneAnotherRandom,
    19: NiceFuncTargetType.ptSelfAnotherRandom,
    20: NiceFuncTargetType.enemyOneAnotherRandom,
    21: NiceFuncTargetType.ptSelfAnotherFirst,
    22: NiceFuncTargetType.ptSelfBefore,
    23: NiceFuncTargetType.ptSelfAfter,
    24: NiceFuncTargetType.ptSelfAnotherLast,
    25: NiceFuncTargetType.commandTypeSelfTreasureDevice,
    26: NiceFuncTargetType.fieldOther,
    27: NiceFuncTargetType.enemyOneNoTargetNoAction,
    28: NiceFuncTargetType.ptOneHpLowestValue,
    29: NiceFuncTargetType.ptOneHpLowestRate,
    30: NiceFuncTargetType.enemyRange,
    31: NiceFuncTargetType.handCommandcardRandomOne,
    32: NiceFuncTargetType.fieldAll,
    33: NiceFuncTargetType.noTarget,
    34: NiceFuncTargetType.fieldRandom,
}


class FuncApplyTargetType(IntEnum):
    PLAYER = 1
    ENEMY = 2
    ALL = 3


class NiceFuncApplyTargetType(StrEnum):
    """Function Apply Target Type Enum"""

    player = "player"
    enemy = "enemy"
    all = "all"


FUNC_APPLY_TARGET_TYPE_NAME: dict[int, NiceFuncApplyTargetType] = {
    1: NiceFuncApplyTargetType.player,
    2: NiceFuncApplyTargetType.enemy,
    3: NiceFuncApplyTargetType.all,
}


class BuffType(IntEnum):
    NONE = 0
    INVALID = -1
    UP_COMMANDATK = 1
    UP_STARWEIGHT = 2
    UP_CRITICALPOINT = 3
    DOWN_CRITICALPOINT = 4
    REGAIN_NP = 5
    REGAIN_STAR = 6
    REGAIN_HP = 7
    REDUCE_HP = 8
    UP_ATK = 9
    DOWN_ATK = 10
    UP_DAMAGE = 11
    DOWN_DAMAGE = 12
    ADD_DAMAGE = 13
    SUB_DAMAGE = 14
    UP_NPDAMAGE = 15
    DOWN_NPDAMAGE = 16
    UP_DROPNP = 17
    UP_CRITICALDAMAGE = 18
    DOWN_CRITICALDAMAGE = 19
    ADD_SELFDAMAGE = 22
    SUB_SELFDAMAGE = 23
    AVOIDANCE = 24
    BREAK_AVOIDANCE = 25
    INVINCIBLE = 26
    UP_GRANTSTATE = 27
    DOWN_GRANTSTATE = 28
    UP_TOLERANCE = 29
    DOWN_TOLERANCE = 30
    AVOID_STATE = 31
    DONOT_ACT = 32
    DONOT_SKILL = 33
    DONOT_NOBLE = 34
    DONOT_RECOVERY = 35
    DISABLE_GENDER = 36
    GUTS = 37
    UP_HATE = 38
    ADD_INDIVIDUALITY = 40
    SUB_INDIVIDUALITY = 41
    UP_DEFENCE = 42
    DOWN_DEFENCE = 43
    UP_COMMANDSTAR = 50
    UP_COMMANDNP = 51
    UP_COMMANDALL = 52
    DOWN_COMMANDALL = 60
    DOWN_STARWEIGHT = 61
    REDUCE_NP = 62
    DOWN_DROPNP = 63
    UP_GAIN_HP = 64
    DOWN_GAIN_HP = 65
    DOWN_COMMANDATK = 66
    UP_CRITICALRATE = 70
    DOWN_CRITICALRATE = 71
    PIERCE_INVINCIBLE = 72
    AVOID_INSTANTDEATH = 73
    UP_RESIST_INSTANTDEATH = 74
    UP_NONRESIST_INSTANTDEATH = 75
    DELAY_FUNCTION = 76
    REGAIN_NP_USED_NOBLE = 77
    DEAD_FUNCTION = 78
    UP_MAXHP = 79
    DOWN_MAXHP = 80
    ADD_MAXHP = 81
    SUB_MAXHP = 82
    BATTLESTART_FUNCTION = 83
    WAVESTART_FUNCTION = 84
    SELFTURNEND_FUNCTION = 85
    DAMAGE_FUNCTION = 86
    UP_GIVEGAIN_HP = 87
    DOWN_GIVEGAIN_HP = 88
    COMMANDATTACK_AFTER_FUNCTION = 89
    DEADATTACK_FUNCTION = 90
    UP_SPECIALDEFENCE = 91
    DOWN_SPECIALDEFENCE = 92
    UP_DAMAGEDROPNP = 93
    DOWN_DAMAGEDROPNP = 94
    ENTRY_FUNCTION = 95
    UP_CHAGETD = 96
    REFLECTION_FUNCTION = 97
    UP_GRANT_SUBSTATE = 98
    DOWN_GRANT_SUBSTATE = 99
    UP_TOLERANCE_SUBSTATE = 100
    DOWN_TOLERANCE_SUBSTATE = 101
    UP_GRANT_INSTANTDEATH = 102
    DOWN_GRANT_INSTANTDEATH = 103
    GUTS_RATIO = 104
    UP_DEFENCECOMMANDALL = 105
    DOWN_DEFENCECOMMANDALL = 106
    OVERWRITE_BATTLECLASS = 107
    OVERWRITE_CLASSRELATIO_ATK = 108
    OVERWRITE_CLASSRELATIO_DEF = 109
    UP_DAMAGE_INDIVIDUALITY = 110
    DOWN_DAMAGE_INDIVIDUALITY = 111
    UP_DAMAGE_INDIVIDUALITY_ACTIVEONLY = 112
    DOWN_DAMAGE_INDIVIDUALITY_ACTIVEONLY = 113
    UP_NPTURNVAL = 114
    DOWN_NPTURNVAL = 115
    MULTIATTACK = 116
    UP_GIVE_NP = 117
    DOWN_GIVE_NP = 118
    UP_RESISTANCE_DELAY_NPTURN = 119
    DOWN_RESISTANCE_DELAY_NPTURN = 120
    PIERCE_DEFENCE = 121
    UP_GUTS_HP = 122
    DOWN_GUTS_HP = 123
    UP_FUNCGAIN_NP = 124
    DOWN_FUNCGAIN_NP = 125
    UP_FUNC_HP_REDUCE = 126
    DOWN_FUNC_HP_REDUCE = 127
    UP_DEFENCE_COMMANDDAMAGE = 128
    DOWN_DEFENCE_COMMANDDAMAGE = 129
    NPATTACK_PREV_BUFF = 130
    FIX_COMMANDCARD = 131
    DONOT_GAINNP = 132
    FIELD_INDIVIDUALITY = 133
    DONOT_ACT_COMMANDTYPE = 134
    UP_DAMAGE_EVENT_POINT = 135
    UP_DAMAGE_SPECIAL = 136
    ATTACK_AFTER_FUNCTION = 137
    COMMANDCODEATTACK_BEFORE_FUNCTION = 138
    DONOT_NOBLE_COND_MISMATCH = 139
    DONOT_SELECT_COMMANDCARD = 140
    DONOT_REPLACE = 141
    SHORTEN_USER_EQUIP_SKILL = 142
    TD_TYPE_CHANGE = 143
    OVERWRITE_CLASS_RELATION = 144
    TD_TYPE_CHANGE_ARTS = 145
    TD_TYPE_CHANGE_BUSTER = 146
    TD_TYPE_CHANGE_QUICK = 147
    COMMANDATTACK_BEFORE_FUNCTION = 148
    GUTS_FUNCTION = 149
    UP_CRITICAL_RATE_DAMAGE_TAKEN = 150
    DOWN_CRITICAL_RATE_DAMAGE_TAKEN = 151
    UP_CRITICAL_STAR_DAMAGE_TAKEN = 152
    DOWN_CRITICAL_STAR_DAMAGE_TAKEN = 153
    SKILL_RANK_UP = 154
    AVOIDANCE_INDIVIDUALITY = 155
    CHANGE_COMMAND_CARD_TYPE = 156
    SPECIAL_INVINCIBLE = 157
    PREVENT_DEATH_BY_DAMAGE = 158
    COMMANDCODEATTACK_AFTER_FUNCTION = 159
    ATTACK_BEFORE_FUNCTION = 160
    DONOT_SKILL_SELECT = 161
    BUFF_RATE = 162
    INVISIBLE_BATTLE_CHARA = 163
    COUNTER_FUNCTION = 165
    NOT_TARGET_SKILL = 166
    HP_REDUCE_TO_REGAIN = 167
    SELFTURNSTART_FUNCTION = 168
    OVERWRITE_DEAD_TYPE = 169
    UP_ACTION_COUNT = 170
    DOWN_ACTION_COUNT = 171
    SHIFT_GUTS = 172
    SHIFT_GUTS_RATIO = 173
    MASTER_SKILL_VALUE_UP = 174
    BUFF_CONVERT = 175
    SUB_FIELD_INDIVIDUALITY = 176
    COMMANDCODEATTACK_BEFORE_FUNCTION_MAIN_ONLY = 177
    COMMANDCODEATTACK_AFTER_FUNCTION_MAIN_ONLY = 178
    COMMANDATTACK_BEFORE_FUNCTION_MAIN_ONLY = 179
    COMMANDATTACK_AFTER_FUNCTION_MAIN_ONLY = 180
    ATTACK_BEFORE_FUNCTION_MAIN_ONLY = 181
    ATTACK_AFTER_FUNCTION_MAIN_ONLY = 182
    WAR_BOARD_NOT_ATTACKED = 183
    WAR_BOARD_IGNORE_DEFEATPOINT = 184
    SKILL_AFTER_FUNCTION = 185
    TREASURE_DEVICE_AFTER_FUNCTION = 186
    SKILL_AFTER_FUNCTION_MAIN_ONLY = 187
    TREASURE_DEVICE_AFTER_FUNCTION_MAIN_ONLY = 188
    PREVENT_INVISIBLE_WHEN_INSTANT_DEATH = 189
    OVERWRITE_SUBATTRIBUTE = 190
    AVOIDANCE_ATTACK_DEATH_DAMAGE = 191
    AVOID_FUNCTION_EXECUTE_SELF = 192
    PIERCE_SUBDAMAGE = 193
    CONTINUE_FUNCTION = 194
    ADD_SPECIALDAMAGE = 195
    SUB_SPECIALDAMAGE = 196
    ADD_FUNC_HP_REDUCE = 197
    SUB_FUNC_HP_REDUCE = 198
    CHANGE_BGM = 199
    CONFIRM_COMMAND_FUNCTION = 200
    SKILL_BEFORE_FUNCTION = 201
    SKILL_TARGETED_BEFORE_FUNCTION = 202
    FIELD_INDIVIDUALITY_CHANGED_FUNCTION = 203
    TREASURE_DEVICE_BEFORE_FUNCTION = 204
    STEP_IN_AFTER_FUNCTION = 205
    SHORTEN_SKILL_AFTER_USE_SKILL = 206
    PIERCE_SPECIAL_INVINCIBLE = 207
    FUNCTIONED_FUNCTION = 208
    DONOT_ACT_COMMANDCARD = 209
    UP_NPDAMAGE_INDIVIDUALITY_SUM = 210
    COMBO_START_FUNCTION = 211
    COMBO_END_FUNCTION = 212
    OVERWRITE_SVT_CARD_TYPE = 213
    UP_DEFENCE_DAMAGE = 214
    DOWN_DEFENCE_DAMAGE = 215
    UP_DEFENCE_CRITICALDAMAGE = 216
    DOWN_DEFENCE_CRITICALDAMAGE = 217
    UP_DEFENCE_NPDAMAGE = 218
    DOWN_DEFENCE_NPDAMAGE = 219
    UP_DEFENCE_COMMANDNP = 220
    DOWN_COMMANDNP = 221
    DOWN_DEFENCE_COMMANDNP = 222
    UP_DEFENCE_COMMANDSTAR = 223
    DOWN_COMMANDSTAR = 224
    DOWN_DEFENCE_COMMANDSTAR = 225
    WAVESTART_ANIMATION_BEFORE_FUNCTION = 226
    SUB_FIXED_SELFDAMAGE = 227
    OVERWRITE_FIXED_DEFENCE_DAMAGE = 228
    EXTEND_ACTION_COUNT = 229
    GUTS_BEFORE_FUNCTION = 230
    OVERWRITE_BUFF_USE_RATE = 231
    UP_BUFF_USE_RATE = 232
    DOWN_BUFF_USE_RATE = 233
    REACTIVE_DAMAGE_GAIN_HP = 234
    UP_HATE_TO_GRANTED_OPPONENT = 235
    UP_BASE_HP = 236
    ADD_BASE_HP = 237
    SUBSTITUTE_INSTANT_DEATH = 238
    SUBSTITUTE_ADD_STATE = 239
    OTHER_TREASURE_DEVICE_PRE_BEFORE_FUNCTION = 240
    ATTACK_PHASE_START_FUNCTION = 241
    TO_FIELD_CHANGE_FIELD = 10001
    TO_FIELD_AVOID_BUFF = 10002
    TO_FIELD_SUB_INDIVIDUALITY_FIELD = 10003


class NiceBuffType(StrEnum):
    """Buff Type Enum"""

    none = "none"
    invalid = "invalid"
    upCommandatk = "upCommandatk"
    upStarweight = "upStarweight"
    upCriticalpoint = "upCriticalpoint"
    downCriticalpoint = "downCriticalpoint"
    regainNp = "regainNp"
    regainStar = "regainStar"
    regainHp = "regainHp"
    reduceHp = "reduceHp"
    upAtk = "upAtk"
    downAtk = "downAtk"
    upDamage = "upDamage"
    downDamage = "downDamage"
    addDamage = "addDamage"
    subDamage = "subDamage"
    upNpdamage = "upNpdamage"
    downNpdamage = "downNpdamage"
    upDropnp = "upDropnp"
    upCriticaldamage = "upCriticaldamage"
    downCriticaldamage = "downCriticaldamage"
    addSelfdamage = "addSelfdamage"
    subSelfdamage = "subSelfdamage"
    avoidance = "avoidance"
    breakAvoidance = "breakAvoidance"
    invincible = "invincible"
    upGrantstate = "upGrantstate"
    downGrantstate = "downGrantstate"
    upTolerance = "upTolerance"
    downTolerance = "downTolerance"
    avoidState = "avoidState"
    donotAct = "donotAct"
    donotSkill = "donotSkill"
    donotNoble = "donotNoble"
    donotRecovery = "donotRecovery"
    disableGender = "disableGender"
    guts = "guts"
    upHate = "upHate"
    addIndividuality = "addIndividuality"
    subIndividuality = "subIndividuality"
    upDefence = "upDefence"
    downDefence = "downDefence"
    upCommandstar = "upCommandstar"
    upCommandnp = "upCommandnp"
    upCommandall = "upCommandall"
    downCommandall = "downCommandall"
    downStarweight = "downStarweight"
    reduceNp = "reduceNp"
    downDropnp = "downDropnp"
    upGainHp = "upGainHp"
    downGainHp = "downGainHp"
    downCommandatk = "downCommandatk"
    upCriticalrate = "upCriticalrate"
    downCriticalrate = "downCriticalrate"
    pierceInvincible = "pierceInvincible"
    avoidInstantdeath = "avoidInstantdeath"
    upResistInstantdeath = "upResistInstantdeath"
    upNonresistInstantdeath = "upNonresistInstantdeath"
    delayFunction = "delayFunction"
    regainNpUsedNoble = "regainNpUsedNoble"
    deadFunction = "deadFunction"
    upMaxhp = "upMaxhp"
    downMaxhp = "downMaxhp"
    addMaxhp = "addMaxhp"
    subMaxhp = "subMaxhp"
    battlestartFunction = "battlestartFunction"
    wavestartFunction = "wavestartFunction"
    selfturnendFunction = "selfturnendFunction"
    damageFunction = "damageFunction"
    upGivegainHp = "upGivegainHp"
    downGivegainHp = "downGivegainHp"
    commandattackAfterFunction = "commandattackAfterFunction"
    deadattackFunction = "deadattackFunction"
    upSpecialdefence = "upSpecialdefence"
    downSpecialdefence = "downSpecialdefence"
    upDamagedropnp = "upDamagedropnp"
    downDamagedropnp = "downDamagedropnp"
    entryFunction = "entryFunction"
    upChagetd = "upChagetd"
    reflectionFunction = "reflectionFunction"
    upGrantSubstate = "upGrantSubstate"
    downGrantSubstate = "downGrantSubstate"
    upToleranceSubstate = "upToleranceSubstate"
    downToleranceSubstate = "downToleranceSubstate"
    upGrantInstantdeath = "upGrantInstantdeath"
    downGrantInstantdeath = "downGrantInstantdeath"
    gutsRatio = "gutsRatio"
    upDefencecommandall = "upDefencecommandall"
    downDefencecommandall = "downDefencecommandall"
    overwriteBattleclass = "overwriteBattleclass"
    overwriteClassrelatioAtk = "overwriteClassrelatioAtk"
    overwriteClassrelatioDef = "overwriteClassrelatioDef"
    upDamageIndividuality = "upDamageIndividuality"
    downDamageIndividuality = "downDamageIndividuality"
    upDamageIndividualityActiveonly = "upDamageIndividualityActiveonly"
    downDamageIndividualityActiveonly = "downDamageIndividualityActiveonly"
    upNpturnval = "upNpturnval"
    downNpturnval = "downNpturnval"
    multiattack = "multiattack"
    upGiveNp = "upGiveNp"
    downGiveNp = "downGiveNp"
    upResistanceDelayNpturn = "upResistanceDelayNpturn"
    downResistanceDelayNpturn = "downResistanceDelayNpturn"
    pierceDefence = "pierceDefence"
    upGutsHp = "upGutsHp"
    downGutsHp = "downGutsHp"
    upFuncgainNp = "upFuncgainNp"
    downFuncgainNp = "downFuncgainNp"
    upFuncHpReduce = "upFuncHpReduce"
    downFuncHpReduce = "downFuncHpReduce"
    upDefenceCommanddamage = "upDefenceCommanddamage"
    downDefenceCommanddamage = "downDefenceCommanddamage"
    npattackPrevBuff = "npattackPrevBuff"
    fixCommandcard = "fixCommandcard"
    donotGainnp = "donotGainnp"
    fieldIndividuality = "fieldIndividuality"
    donotActCommandtype = "donotActCommandtype"
    upDamageEventPoint = "upDamageEventPoint"
    upDamageSpecial = "upDamageSpecial"
    attackAfterFunction = "attackAfterFunction"
    commandcodeattackBeforeFunction = "commandcodeattackBeforeFunction"
    donotNobleCondMismatch = "donotNobleCondMismatch"
    donotSelectCommandcard = "donotSelectCommandcard"
    donotReplace = "donotReplace"
    shortenUserEquipSkill = "shortenUserEquipSkill"
    tdTypeChange = "tdTypeChange"
    overwriteClassRelation = "overwriteClassRelation"
    tdTypeChangeArts = "tdTypeChangeArts"
    tdTypeChangeBuster = "tdTypeChangeBuster"
    tdTypeChangeQuick = "tdTypeChangeQuick"
    commandattackBeforeFunction = "commandattackBeforeFunction"
    gutsFunction = "gutsFunction"
    upCriticalRateDamageTaken = "upCriticalRateDamageTaken"
    downCriticalRateDamageTaken = "downCriticalRateDamageTaken"
    upCriticalStarDamageTaken = "upCriticalStarDamageTaken"
    downCriticalStarDamageTaken = "downCriticalStarDamageTaken"
    skillRankUp = "skillRankUp"
    avoidanceIndividuality = "avoidanceIndividuality"
    changeCommandCardType = "changeCommandCardType"
    specialInvincible = "specialInvincible"
    preventDeathByDamage = "preventDeathByDamage"
    commandcodeattackAfterFunction = "commandcodeattackAfterFunction"
    attackBeforeFunction = "attackBeforeFunction"
    donotSkillSelect = "donotSkillSelect"
    buffRate = "buffRate"
    invisibleBattleChara = "invisibleBattleChara"
    counterFunction = "counterFunction"
    notTargetSkill = "notTargetSkill"
    hpReduceToRegain = "hpReduceToRegain"
    selfturnstartFunction = "selfturnstartFunction"
    overwriteDeadType = "overwriteDeadType"
    upActionCount = "upActionCount"
    downActionCount = "downActionCount"
    shiftGuts = "shiftGuts"
    shiftGutsRatio = "shiftGutsRatio"
    masterSkillValueUp = "masterSkillValueUp"
    buffConvert = "buffConvert"
    subFieldIndividuality = "subFieldIndividuality"
    commandcodeattackBeforeFunctionMainOnly = "commandcodeattackBeforeFunctionMainOnly"
    commandcodeattackAfterFunctionMainOnly = "commandcodeattackAfterFunctionMainOnly"
    commandattackBeforeFunctionMainOnly = "commandattackBeforeFunctionMainOnly"
    commandattackAfterFunctionMainOnly = "commandattackAfterFunctionMainOnly"
    attackBeforeFunctionMainOnly = "attackBeforeFunctionMainOnly"
    attackAfterFunctionMainOnly = "attackAfterFunctionMainOnly"
    warBoardNotAttacked = "warBoardNotAttacked"
    warBoardIgnoreDefeatpoint = "warBoardIgnoreDefeatpoint"
    skillAfterFunction = "skillAfterFunction"
    treasureDeviceAfterFunction = "treasureDeviceAfterFunction"
    skillAfterFunctionMainOnly = "skillAfterFunctionMainOnly"
    treasureDeviceAfterFunctionMainOnly = "treasureDeviceAfterFunctionMainOnly"
    preventInvisibleWhenInstantDeath = "preventInvisibleWhenInstantDeath"
    overwriteSubattribute = "overwriteSubattribute"
    avoidanceAttackDeathDamage = "avoidanceAttackDeathDamage"
    avoidFunctionExecuteSelf = "avoidFunctionExecuteSelf"
    pierceSubdamage = "pierceSubdamage"
    continueFunction = "continueFunction"
    addSpecialdamage = "addSpecialdamage"
    subSpecialdamage = "subSpecialdamage"
    addFuncHpReduce = "addFuncHpReduce"
    subFuncHpReduce = "subFuncHpReduce"
    changeBgm = "changeBgm"
    confirmCommandFunction = "confirmCommandFunction"
    skillBeforeFunction = "skillBeforeFunction"
    skillTargetedBeforeFunction = "skillTargetedBeforeFunction"
    fieldIndividualityChangedFunction = "fieldIndividualityChangedFunction"
    treasureDeviceBeforeFunction = "treasureDeviceBeforeFunction"
    stepInAfterFunction = "stepInAfterFunction"
    shortenSkillAfterUseSkill = "shortenSkillAfterUseSkill"
    pierceSpecialInvincible = "pierceSpecialInvincible"
    functionedFunction = "functionedFunction"
    donotActCommandcard = "donotActCommandcard"
    upNpdamageIndividualitySum = "upNpdamageIndividualitySum"
    comboStartFunction = "comboStartFunction"
    comboEndFunction = "comboEndFunction"
    overwriteSvtCardType = "overwriteSvtCardType"
    upDefenceDamage = "upDefenceDamage"
    downDefenceDamage = "downDefenceDamage"
    upDefenceCriticaldamage = "upDefenceCriticaldamage"
    downDefenceCriticaldamage = "downDefenceCriticaldamage"
    upDefenceNpdamage = "upDefenceNpdamage"
    downDefenceNpdamage = "downDefenceNpdamage"
    upDefenceCommandnp = "upDefenceCommandnp"
    downDefenceCommandnp = "downDefenceCommandnp"
    upDefenceCommandstar = "upDefenceCommandstar"
    downCommandstar = "downCommandstar"
    downDefenceCommandstar = "downDefenceCommandstar"
    wavestartAnimationBeforeFunction = "wavestartAnimationBeforeFunction"
    subFixedSelfdamage = "subFixedSelfdamage"
    overwriteFixedDefenceDamage = "overwriteFixedDefenceDamage"
    extendActionCount = "extendActionCount"
    gutsBeforeFunction = "gutsBeforeFunction"
    overwriteBuffUseRate = "overwriteBuffUseRate"
    upBuffUseRate = "upBuffUseRate"
    downBuffUseRate = "downBuffUseRate"
    reactiveDamageGainHp = "reactiveDamageGainHp"
    upHateToGrantedOpponent = "upHateToGrantedOpponent"
    upBaseHp = "upBaseHp"
    addBaseHp = "addBaseHp"
    substituteInstantDeath = "substituteInstantDeath"
    substituteAddState = "substituteAddState"
    otherTreasureDevicePreBeforeFunction = "otherTreasureDevicePreBeforeFunction"
    attackPhaseStartFunction = "attackPhaseStartFunction"
    toFieldChangeField = "toFieldChangeField"
    toFieldAvoidBuff = "toFieldAvoidBuff"
    toFieldSubIndividualityField = "toFieldSubIndividualityField"
    upSelfdamage = "upSelfdamage"
    downSelfdamage = "downSelfdamage"
    downCommanstar = "downCommanstar"
    downCommandnp = "downCommandnp"


BUFF_TYPE_NAME: dict[int, NiceBuffType] = {
    0: NiceBuffType.none,
    -1: NiceBuffType.invalid,
    1: NiceBuffType.upCommandatk,
    2: NiceBuffType.upStarweight,
    3: NiceBuffType.upCriticalpoint,
    4: NiceBuffType.downCriticalpoint,
    5: NiceBuffType.regainNp,
    6: NiceBuffType.regainStar,
    7: NiceBuffType.regainHp,
    8: NiceBuffType.reduceHp,
    9: NiceBuffType.upAtk,
    10: NiceBuffType.downAtk,
    11: NiceBuffType.upDamage,
    12: NiceBuffType.downDamage,
    13: NiceBuffType.addDamage,
    14: NiceBuffType.subDamage,
    15: NiceBuffType.upNpdamage,
    16: NiceBuffType.downNpdamage,
    17: NiceBuffType.upDropnp,
    18: NiceBuffType.upCriticaldamage,
    19: NiceBuffType.downCriticaldamage,
    22: NiceBuffType.addSelfdamage,
    23: NiceBuffType.subSelfdamage,
    24: NiceBuffType.avoidance,
    25: NiceBuffType.breakAvoidance,
    26: NiceBuffType.invincible,
    27: NiceBuffType.upGrantstate,
    28: NiceBuffType.downGrantstate,
    29: NiceBuffType.upTolerance,
    30: NiceBuffType.downTolerance,
    31: NiceBuffType.avoidState,
    32: NiceBuffType.donotAct,
    33: NiceBuffType.donotSkill,
    34: NiceBuffType.donotNoble,
    35: NiceBuffType.donotRecovery,
    36: NiceBuffType.disableGender,
    37: NiceBuffType.guts,
    38: NiceBuffType.upHate,
    40: NiceBuffType.addIndividuality,
    41: NiceBuffType.subIndividuality,
    42: NiceBuffType.upDefence,
    43: NiceBuffType.downDefence,
    50: NiceBuffType.upCommandstar,
    51: NiceBuffType.upCommandnp,
    52: NiceBuffType.upCommandall,
    60: NiceBuffType.downCommandall,
    61: NiceBuffType.downStarweight,
    62: NiceBuffType.reduceNp,
    63: NiceBuffType.downDropnp,
    64: NiceBuffType.upGainHp,
    65: NiceBuffType.downGainHp,
    66: NiceBuffType.downCommandatk,
    70: NiceBuffType.upCriticalrate,
    71: NiceBuffType.downCriticalrate,
    72: NiceBuffType.pierceInvincible,
    73: NiceBuffType.avoidInstantdeath,
    74: NiceBuffType.upResistInstantdeath,
    75: NiceBuffType.upNonresistInstantdeath,
    76: NiceBuffType.delayFunction,
    77: NiceBuffType.regainNpUsedNoble,
    78: NiceBuffType.deadFunction,
    79: NiceBuffType.upMaxhp,
    80: NiceBuffType.downMaxhp,
    81: NiceBuffType.addMaxhp,
    82: NiceBuffType.subMaxhp,
    83: NiceBuffType.battlestartFunction,
    84: NiceBuffType.wavestartFunction,
    85: NiceBuffType.selfturnendFunction,
    86: NiceBuffType.damageFunction,
    87: NiceBuffType.upGivegainHp,
    88: NiceBuffType.downGivegainHp,
    89: NiceBuffType.commandattackAfterFunction,
    90: NiceBuffType.deadattackFunction,
    91: NiceBuffType.upSpecialdefence,
    92: NiceBuffType.downSpecialdefence,
    93: NiceBuffType.upDamagedropnp,
    94: NiceBuffType.downDamagedropnp,
    95: NiceBuffType.entryFunction,
    96: NiceBuffType.upChagetd,
    97: NiceBuffType.reflectionFunction,
    98: NiceBuffType.upGrantSubstate,
    99: NiceBuffType.downGrantSubstate,
    100: NiceBuffType.upToleranceSubstate,
    101: NiceBuffType.downToleranceSubstate,
    102: NiceBuffType.upGrantInstantdeath,
    103: NiceBuffType.downGrantInstantdeath,
    104: NiceBuffType.gutsRatio,
    105: NiceBuffType.upDefencecommandall,
    106: NiceBuffType.downDefencecommandall,
    107: NiceBuffType.overwriteBattleclass,
    108: NiceBuffType.overwriteClassrelatioAtk,
    109: NiceBuffType.overwriteClassrelatioDef,
    110: NiceBuffType.upDamageIndividuality,
    111: NiceBuffType.downDamageIndividuality,
    112: NiceBuffType.upDamageIndividualityActiveonly,
    113: NiceBuffType.downDamageIndividualityActiveonly,
    114: NiceBuffType.upNpturnval,
    115: NiceBuffType.downNpturnval,
    116: NiceBuffType.multiattack,
    117: NiceBuffType.upGiveNp,
    118: NiceBuffType.downGiveNp,
    119: NiceBuffType.upResistanceDelayNpturn,
    120: NiceBuffType.downResistanceDelayNpturn,
    121: NiceBuffType.pierceDefence,
    122: NiceBuffType.upGutsHp,
    123: NiceBuffType.downGutsHp,
    124: NiceBuffType.upFuncgainNp,
    125: NiceBuffType.downFuncgainNp,
    126: NiceBuffType.upFuncHpReduce,
    127: NiceBuffType.downFuncHpReduce,
    128: NiceBuffType.upDefenceCommanddamage,
    129: NiceBuffType.downDefenceCommanddamage,
    130: NiceBuffType.npattackPrevBuff,
    131: NiceBuffType.fixCommandcard,
    132: NiceBuffType.donotGainnp,
    133: NiceBuffType.fieldIndividuality,
    134: NiceBuffType.donotActCommandtype,
    135: NiceBuffType.upDamageEventPoint,
    136: NiceBuffType.upDamageSpecial,
    137: NiceBuffType.attackAfterFunction,
    138: NiceBuffType.commandcodeattackBeforeFunction,
    139: NiceBuffType.donotNobleCondMismatch,
    140: NiceBuffType.donotSelectCommandcard,
    141: NiceBuffType.donotReplace,
    142: NiceBuffType.shortenUserEquipSkill,
    143: NiceBuffType.tdTypeChange,
    144: NiceBuffType.overwriteClassRelation,
    145: NiceBuffType.tdTypeChangeArts,
    146: NiceBuffType.tdTypeChangeBuster,
    147: NiceBuffType.tdTypeChangeQuick,
    148: NiceBuffType.commandattackBeforeFunction,
    149: NiceBuffType.gutsFunction,
    150: NiceBuffType.upCriticalRateDamageTaken,
    151: NiceBuffType.downCriticalRateDamageTaken,
    152: NiceBuffType.upCriticalStarDamageTaken,
    153: NiceBuffType.downCriticalStarDamageTaken,
    154: NiceBuffType.skillRankUp,
    155: NiceBuffType.avoidanceIndividuality,
    156: NiceBuffType.changeCommandCardType,
    157: NiceBuffType.specialInvincible,
    158: NiceBuffType.preventDeathByDamage,
    159: NiceBuffType.commandcodeattackAfterFunction,
    160: NiceBuffType.attackBeforeFunction,
    161: NiceBuffType.donotSkillSelect,
    162: NiceBuffType.buffRate,
    163: NiceBuffType.invisibleBattleChara,
    165: NiceBuffType.counterFunction,
    166: NiceBuffType.notTargetSkill,
    167: NiceBuffType.hpReduceToRegain,
    168: NiceBuffType.selfturnstartFunction,
    169: NiceBuffType.overwriteDeadType,
    170: NiceBuffType.upActionCount,
    171: NiceBuffType.downActionCount,
    172: NiceBuffType.shiftGuts,
    173: NiceBuffType.shiftGutsRatio,
    174: NiceBuffType.masterSkillValueUp,
    175: NiceBuffType.buffConvert,
    176: NiceBuffType.subFieldIndividuality,
    177: NiceBuffType.commandcodeattackBeforeFunctionMainOnly,
    178: NiceBuffType.commandcodeattackAfterFunctionMainOnly,
    179: NiceBuffType.commandattackBeforeFunctionMainOnly,
    180: NiceBuffType.commandattackAfterFunctionMainOnly,
    181: NiceBuffType.attackBeforeFunctionMainOnly,
    182: NiceBuffType.attackAfterFunctionMainOnly,
    183: NiceBuffType.warBoardNotAttacked,
    184: NiceBuffType.warBoardIgnoreDefeatpoint,
    185: NiceBuffType.skillAfterFunction,
    186: NiceBuffType.treasureDeviceAfterFunction,
    187: NiceBuffType.skillAfterFunctionMainOnly,
    188: NiceBuffType.treasureDeviceAfterFunctionMainOnly,
    189: NiceBuffType.preventInvisibleWhenInstantDeath,
    190: NiceBuffType.overwriteSubattribute,
    191: NiceBuffType.avoidanceAttackDeathDamage,
    192: NiceBuffType.avoidFunctionExecuteSelf,
    193: NiceBuffType.pierceSubdamage,
    194: NiceBuffType.continueFunction,
    195: NiceBuffType.addSpecialdamage,
    196: NiceBuffType.subSpecialdamage,
    197: NiceBuffType.addFuncHpReduce,
    198: NiceBuffType.subFuncHpReduce,
    199: NiceBuffType.changeBgm,
    200: NiceBuffType.confirmCommandFunction,
    201: NiceBuffType.skillBeforeFunction,
    202: NiceBuffType.skillTargetedBeforeFunction,
    203: NiceBuffType.fieldIndividualityChangedFunction,
    204: NiceBuffType.treasureDeviceBeforeFunction,
    205: NiceBuffType.stepInAfterFunction,
    206: NiceBuffType.shortenSkillAfterUseSkill,
    207: NiceBuffType.pierceSpecialInvincible,
    208: NiceBuffType.functionedFunction,
    209: NiceBuffType.donotActCommandcard,
    210: NiceBuffType.upNpdamageIndividualitySum,
    211: NiceBuffType.comboStartFunction,
    212: NiceBuffType.comboEndFunction,
    213: NiceBuffType.overwriteSvtCardType,
    216: NiceBuffType.upDefenceCriticaldamage,
    217: NiceBuffType.downDefenceCriticaldamage,
    218: NiceBuffType.upDefenceNpdamage,
    219: NiceBuffType.downDefenceNpdamage,
    220: NiceBuffType.upDefenceCommandnp,
    221: NiceBuffType.downCommandnp,
    222: NiceBuffType.downDefenceCommandnp,
    223: NiceBuffType.upDefenceCommandstar,
    224: NiceBuffType.downCommandstar,
    225: NiceBuffType.downDefenceCommandstar,
    226: NiceBuffType.wavestartAnimationBeforeFunction,
    227: NiceBuffType.subFixedSelfdamage,
    228: NiceBuffType.overwriteFixedDefenceDamage,
    229: NiceBuffType.extendActionCount,
    230: NiceBuffType.gutsBeforeFunction,
    231: NiceBuffType.overwriteBuffUseRate,
    232: NiceBuffType.upBuffUseRate,
    233: NiceBuffType.downBuffUseRate,
    234: NiceBuffType.reactiveDamageGainHp,
    235: NiceBuffType.upHateToGrantedOpponent,
    236: NiceBuffType.upBaseHp,
    237: NiceBuffType.addBaseHp,
    238: NiceBuffType.substituteInstantDeath,
    239: NiceBuffType.substituteAddState,
    240: NiceBuffType.otherTreasureDevicePreBeforeFunction,
    241: NiceBuffType.attackPhaseStartFunction,
    10001: NiceBuffType.toFieldChangeField,
    10002: NiceBuffType.toFieldAvoidBuff,
    10003: NiceBuffType.toFieldSubIndividualityField,
    20: NiceBuffType.upSelfdamage,
    21: NiceBuffType.downSelfdamage,
    214: NiceBuffType.upSelfdamage,
    215: NiceBuffType.downSelfdamage,
    67: NiceBuffType.downCommanstar,
    68: NiceBuffType.downCommandnp,
}


class BuffAction(IntEnum):
    NONE = 0
    COMMAND_ATK = 1
    COMMAND_DEF = 2
    ATK = 3
    DEFENCE = 4
    DEFENCE_PIERCE = 5
    SPECIALDEFENCE = 6
    DAMAGE = 7
    DAMAGE_INDIVIDUALITY = 8
    DAMAGE_INDIVIDUALITY_ACTIVEONLY = 9
    DAMAGE_DEF = 10
    CRITICAL_DAMAGE = 11
    NPDAMAGE = 12
    GIVEN_DAMAGE = 13
    RECEIVE_DAMAGE = 14
    PIERCE_INVINCIBLE = 15
    INVINCIBLE = 16
    BREAK_AVOIDANCE = 17
    AVOIDANCE = 18
    OVERWRITE_BATTLECLASS = 19
    OVERWRITE_CLASSRELATIO_ATK = 20
    OVERWRITE_CLASSRELATIO_DEF = 21
    COMMAND_NP_ATK = 22
    COMMAND_NP_DEF = 23
    DROP_NP = 24
    DROP_NP_DAMAGE = 25
    COMMAND_STAR_ATK = 26
    COMMAND_STAR_DEF = 27
    CRITICAL_POINT = 28
    STARWEIGHT = 29
    TURNEND_NP = 30
    TURNEND_STAR = 31
    TURNEND_HP_REGAIN = 32
    TURNEND_HP_REDUCE = 33
    GAIN_HP = 34
    TURNVAL_NP = 35
    GRANT_STATE = 36
    RESISTANCE_STATE = 37
    AVOID_STATE = 38
    DONOT_ACT = 39
    DONOT_SKILL = 40
    DONOT_NOBLE = 41
    DONOT_RECOVERY = 42
    INDIVIDUALITY_ADD = 43
    INDIVIDUALITY_SUB = 44
    HATE = 45
    CRITICAL_RATE = 46
    AVOID_INSTANTDEATH = 47
    RESIST_INSTANTDEATH = 48
    NONRESIST_INSTANTDEATH = 49
    REGAIN_NP_USED_NOBLE = 50
    FUNCTION_DEAD = 51
    MAXHP_RATE = 52
    MAXHP_VALUE = 53
    FUNCTION_WAVESTART = 54
    FUNCTION_SELFTURNEND = 55
    GIVE_GAIN_HP = 56
    FUNCTION_COMMANDATTACK_AFTER = 57
    FUNCTION_DEADATTACK = 58
    FUNCTION_ENTRY = 59
    CHAGETD = 60
    GRANT_SUBSTATE = 61
    TOLERANCE_SUBSTATE = 62
    GRANT_INSTANTDEATH = 63
    FUNCTION_DAMAGE = 64
    FUNCTION_REFLECTION = 65
    MULTIATTACK = 66
    GIVE_NP = 67
    RESISTANCE_DELAY_NPTURN = 68
    PIERCE_DEFENCE = 69
    GUTS_HP = 70
    FUNCGAIN_NP = 71
    FUNC_HP_REDUCE = 72
    FUNCTION_NPATTACK = 73
    FIX_COMMANDCARD = 74
    DONOT_GAINNP = 75
    FIELD_INDIVIDUALITY = 76
    DONOT_ACT_COMMANDTYPE = 77
    DAMAGE_EVENT_POINT = 78
    DAMAGE_SPECIAL = 79
    FUNCTION_ATTACK_AFTER = 80
    FUNCTION_COMMANDCODEATTACK_BEFORE = 81
    DONOT_NOBLE_COND_MISMATCH = 82
    DONOT_SELECT_COMMANDCARD = 83
    DONOT_REPLACE = 84
    SHORTEN_USER_EQUIP_SKILL = 85
    TD_TYPE_CHANGE = 86
    OVERWRITE_CLASS_RELATION = 87
    FUNCTION_COMMANDATTACK_BEFORE = 88
    FUNCTION_GUTS = 89
    CRITICAL_RATE_DAMAGE_TAKEN = 90
    CRITICAL_STAR_DAMAGE_TAKEN = 91
    SKILL_RANK_CHANGE = 92
    AVOIDANCE_INDIVIDUALITY = 93
    CHANGE_COMMAND_CARD_TYPE = 94
    SPECIAL_INVINCIBLE = 95
    PREVENT_DEATH_BY_DAMAGE = 96
    FUNCTION_COMMANDCODEATTACK_AFTER = 97
    FUNCTION_ATTACK_BEFORE = 98
    DONOT_SKILL_SELECT = 99
    INVISIBLE_BATTLE_CHARA = 100
    BUFF_RATE = 101
    COUNTER_FUNCTION = 102
    NOT_TARGET_SKILL = 103
    TO_FIELD_CHANGE_FIELD = 104
    TO_FIELD_AVOID_BUFF = 105
    GRANT_STATE_UP_ONLY = 106
    TURNEND_HP_REDUCE_TO_REGAIN = 107
    FUNCTION_SELFTURNSTART = 108
    OVERWRITE_DEAD_TYPE = 109
    ACTION_COUNT = 110
    SHIFT_GUTS = 111
    TO_FIELD_SUB_INDIVIDUALITY_FIELD = 112
    MASTER_SKILL_VALUE_UP = 113
    BUFF_CONVERT = 114
    SUB_FIELD_INDIVIDUALITY = 115
    FUNCTION_COMMANDCODEATTACK_BEFORE_MAIN_ONLY = 116
    FUNCTION_COMMANDCODEATTACK_AFTER_MAIN_ONLY = 117
    FUNCTION_COMMANDATTACK_BEFORE_MAIN_ONLY = 118
    FUNCTION_COMMANDATTACK_AFTER_MAIN_ONLY = 119
    FUNCTION_ATTACK_BEFORE_MAIN_ONLY = 120
    FUNCTION_ATTACK_AFTER_MAIN_ONLY = 121
    FUNCTION_SKILL_AFTER = 122
    FUNCTION_SKILL_AFTER_MAIN_ONLY = 123
    FUNCTION_TREASURE_DEVICE_AFTER = 124
    FUNCTION_TREASURE_DEVICE_AFTER_MAIN_ONLY = 125
    GUTS = 126
    PREVENT_INVISIBLE_WHEN_INSTANT_DEATH = 127
    OVERWRITE_SUBATTRIBUTE = 128
    AVOIDANCE_ATTACK_DEATH_DAMAGE = 129
    AVOID_FUNCTION_EXECUTE_SELF = 130
    FUNCTION_CONTINUE = 131
    PIERCE_SUBDAMAGE = 132
    RECEIVE_DAMAGE_PIERCE = 133
    SPECIAL_RECEIVE_DAMAGE = 134
    FUNC_HP_REDUCE_VALUE = 135
    CHANGE_BGM = 136
    FUNCTION_CONFIRM_COMMAND = 137
    FUNCTION_SKILL_BEFORE = 138
    FUNCTION_SKILL_TARGETED_BEFORE = 139
    FUNCTION_FIELD_INDIVIDUALITY_CHANGED = 140
    FUNCTION_TREASURE_DEVICE_BEFORE = 141
    FUNCTION_STEP_IN_AFTER = 142
    SHORTEN_SKILL_AFTER_USE_SKILL = 143
    PIERCE_SPECIAL_INVINCIBLE = 144
    FUNCTIONED_FUNCTION = 145
    DONOT_ACT_COMMANDCARD = 146
    NPDAMAGE_INDIVIDUALITY = 147
    FUNCTION_COMBO_START = 148
    FUNCTION_COMBO_END = 149
    OVERWRITE_SVT_CARD_TYPE = 150
    CRITICAL_DAMAGE_DEF = 151
    NPDAMAGE_DEF = 152
    FUNCTION_WAVESTART_ANIMATION_BEFORE = 153
    RECEIVE_FIXED_DAMAGE = 154
    OVERWRITE_DAMAGE_DEF = 155
    CHANGE_ACT_IN_ADD_COUNT = 156
    FUNCTION_GUTS_BEFORE = 157
    OVERWRITE_BUFF_USE_RATE = 158
    CHANGE_BUFF_USE_RATE = 159
    HATE_TO_GRANTED_OPPONENT = 160
    REACTIVE_DAMAGE_GAIN_HP = 161
    BASE_HP_RATE = 162
    BASE_HP_VALUE = 163
    SUBSTITUTE_INSTANT_DEATH = 164
    SUBSTITUTE_ADD_STATE = 165
    FUNCTION_OTHER_TREASURE_DEVICE_PRE_BEFORE = 166
    FUNCTION_ATTACK_PHASE_START = 167


class NiceBuffAction(StrEnum):
    """Buff Action Type Enum"""

    none = "none"
    commandAtk = "commandAtk"
    commandDef = "commandDef"
    atk = "atk"
    defence = "defence"
    defencePierce = "defencePierce"
    specialdefence = "specialdefence"
    damage = "damage"
    damageIndividuality = "damageIndividuality"
    damageIndividualityActiveonly = "damageIndividualityActiveonly"
    damageDef = "damageDef"
    criticalDamage = "criticalDamage"
    npdamage = "npdamage"
    givenDamage = "givenDamage"
    receiveDamage = "receiveDamage"
    pierceInvincible = "pierceInvincible"
    invincible = "invincible"
    breakAvoidance = "breakAvoidance"
    avoidance = "avoidance"
    overwriteBattleclass = "overwriteBattleclass"
    overwriteClassrelatioAtk = "overwriteClassrelatioAtk"
    overwriteClassrelatioDef = "overwriteClassrelatioDef"
    commandNpAtk = "commandNpAtk"
    commandNpDef = "commandNpDef"
    dropNp = "dropNp"
    dropNpDamage = "dropNpDamage"
    commandStarAtk = "commandStarAtk"
    commandStarDef = "commandStarDef"
    criticalPoint = "criticalPoint"
    starweight = "starweight"
    turnendNp = "turnendNp"
    turnendStar = "turnendStar"
    turnendHpRegain = "turnendHpRegain"
    turnendHpReduce = "turnendHpReduce"
    gainHp = "gainHp"
    turnvalNp = "turnvalNp"
    grantState = "grantState"
    resistanceState = "resistanceState"
    avoidState = "avoidState"
    donotAct = "donotAct"
    donotSkill = "donotSkill"
    donotNoble = "donotNoble"
    donotRecovery = "donotRecovery"
    individualityAdd = "individualityAdd"
    individualitySub = "individualitySub"
    hate = "hate"
    criticalRate = "criticalRate"
    avoidInstantdeath = "avoidInstantdeath"
    resistInstantdeath = "resistInstantdeath"
    nonresistInstantdeath = "nonresistInstantdeath"
    regainNpUsedNoble = "regainNpUsedNoble"
    functionDead = "functionDead"
    maxhpRate = "maxhpRate"
    maxhpValue = "maxhpValue"
    functionWavestart = "functionWavestart"
    functionSelfturnend = "functionSelfturnend"
    giveGainHp = "giveGainHp"
    functionCommandattackAfter = "functionCommandattackAfter"
    functionDeadattack = "functionDeadattack"
    functionEntry = "functionEntry"
    chagetd = "chagetd"
    grantSubstate = "grantSubstate"
    toleranceSubstate = "toleranceSubstate"
    grantInstantdeath = "grantInstantdeath"
    functionDamage = "functionDamage"
    functionReflection = "functionReflection"
    multiattack = "multiattack"
    giveNp = "giveNp"
    resistanceDelayNpturn = "resistanceDelayNpturn"
    pierceDefence = "pierceDefence"
    gutsHp = "gutsHp"
    funcgainNp = "funcgainNp"
    funcHpReduce = "funcHpReduce"
    functionNpattack = "functionNpattack"
    fixCommandcard = "fixCommandcard"
    donotGainnp = "donotGainnp"
    fieldIndividuality = "fieldIndividuality"
    donotActCommandtype = "donotActCommandtype"
    damageEventPoint = "damageEventPoint"
    damageSpecial = "damageSpecial"
    functionAttackAfter = "functionAttackAfter"
    functionCommandcodeattackBefore = "functionCommandcodeattackBefore"
    donotNobleCondMismatch = "donotNobleCondMismatch"
    donotSelectCommandcard = "donotSelectCommandcard"
    donotReplace = "donotReplace"
    shortenUserEquipSkill = "shortenUserEquipSkill"
    tdTypeChange = "tdTypeChange"
    overwriteClassRelation = "overwriteClassRelation"
    functionCommandattackBefore = "functionCommandattackBefore"
    functionGuts = "functionGuts"
    criticalRateDamageTaken = "criticalRateDamageTaken"
    criticalStarDamageTaken = "criticalStarDamageTaken"
    skillRankChange = "skillRankChange"
    avoidanceIndividuality = "avoidanceIndividuality"
    changeCommandCardType = "changeCommandCardType"
    specialInvincible = "specialInvincible"
    preventDeathByDamage = "preventDeathByDamage"
    functionCommandcodeattackAfter = "functionCommandcodeattackAfter"
    functionAttackBefore = "functionAttackBefore"
    donotSkillSelect = "donotSkillSelect"
    invisibleBattleChara = "invisibleBattleChara"
    buffRate = "buffRate"
    counterFunction = "counterFunction"
    notTargetSkill = "notTargetSkill"
    toFieldChangeField = "toFieldChangeField"
    toFieldAvoidBuff = "toFieldAvoidBuff"
    grantStateUpOnly = "grantStateUpOnly"
    turnendHpReduceToRegain = "turnendHpReduceToRegain"
    functionSelfturnstart = "functionSelfturnstart"
    overwriteDeadType = "overwriteDeadType"
    actionCount = "actionCount"
    shiftGuts = "shiftGuts"
    toFieldSubIndividualityField = "toFieldSubIndividualityField"
    masterSkillValueUp = "masterSkillValueUp"
    buffConvert = "buffConvert"
    subFieldIndividuality = "subFieldIndividuality"
    functionCommandcodeattackBeforeMainOnly = "functionCommandcodeattackBeforeMainOnly"
    functionCommandcodeattackAfterMainOnly = "functionCommandcodeattackAfterMainOnly"
    functionCommandattackBeforeMainOnly = "functionCommandattackBeforeMainOnly"
    functionCommandattackAfterMainOnly = "functionCommandattackAfterMainOnly"
    functionAttackBeforeMainOnly = "functionAttackBeforeMainOnly"
    functionAttackAfterMainOnly = "functionAttackAfterMainOnly"
    functionSkillAfter = "functionSkillAfter"
    functionSkillAfterMainOnly = "functionSkillAfterMainOnly"
    functionTreasureDeviceAfter = "functionTreasureDeviceAfter"
    functionTreasureDeviceAfterMainOnly = "functionTreasureDeviceAfterMainOnly"
    guts = "guts"
    preventInvisibleWhenInstantDeath = "preventInvisibleWhenInstantDeath"
    overwriteSubattribute = "overwriteSubattribute"
    avoidanceAttackDeathDamage = "avoidanceAttackDeathDamage"
    avoidFunctionExecuteSelf = "avoidFunctionExecuteSelf"
    functionContinue = "functionContinue"
    pierceSubdamage = "pierceSubdamage"
    receiveDamagePierce = "receiveDamagePierce"
    specialReceiveDamage = "specialReceiveDamage"
    funcHpReduceValue = "funcHpReduceValue"
    changeBgm = "changeBgm"
    functionConfirmCommand = "functionConfirmCommand"
    functionSkillBefore = "functionSkillBefore"
    functionSkillTargetedBefore = "functionSkillTargetedBefore"
    functionFieldIndividualityChanged = "functionFieldIndividualityChanged"
    functionTreasureDeviceBefore = "functionTreasureDeviceBefore"
    functionStepInAfter = "functionStepInAfter"
    shortenSkillAfterUseSkill = "shortenSkillAfterUseSkill"
    pierceSpecialInvincible = "pierceSpecialInvincible"
    functionedFunction = "functionedFunction"
    donotActCommandcard = "donotActCommandcard"
    npdamageIndividuality = "npdamageIndividuality"
    functionComboStart = "functionComboStart"
    functionComboEnd = "functionComboEnd"
    overwriteSvtCardType = "overwriteSvtCardType"
    criticalDamageDef = "criticalDamageDef"
    npdamageDef = "npdamageDef"
    functionWavestartAnimationBefore = "functionWavestartAnimationBefore"
    receiveFixedDamage = "receiveFixedDamage"
    overwriteDamageDef = "overwriteDamageDef"
    changeActInAddCount = "changeActInAddCount"
    functionGutsBefore = "functionGutsBefore"
    overwriteBuffUseRate = "overwriteBuffUseRate"
    changeBuffUseRate = "changeBuffUseRate"
    hateToGrantedOpponent = "hateToGrantedOpponent"
    reactiveDamageGainHp = "reactiveDamageGainHp"
    baseHpRate = "baseHpRate"
    baseHpValue = "baseHpValue"
    substituteInstantDeath = "substituteInstantDeath"
    substituteAddState = "substituteAddState"
    functionOtherTreasureDevicePreBefore = "functionOtherTreasureDevicePreBefore"
    functionAttackPhaseStart = "functionAttackPhaseStart"


BUFF_ACTION_NAME: dict[int, NiceBuffAction] = {
    0: NiceBuffAction.none,
    1: NiceBuffAction.commandAtk,
    2: NiceBuffAction.commandDef,
    3: NiceBuffAction.atk,
    4: NiceBuffAction.defence,
    5: NiceBuffAction.defencePierce,
    6: NiceBuffAction.specialdefence,
    7: NiceBuffAction.damage,
    8: NiceBuffAction.damageIndividuality,
    9: NiceBuffAction.damageIndividualityActiveonly,
    10: NiceBuffAction.damageDef,
    11: NiceBuffAction.criticalDamage,
    12: NiceBuffAction.npdamage,
    13: NiceBuffAction.givenDamage,
    14: NiceBuffAction.receiveDamage,
    15: NiceBuffAction.pierceInvincible,
    16: NiceBuffAction.invincible,
    17: NiceBuffAction.breakAvoidance,
    18: NiceBuffAction.avoidance,
    19: NiceBuffAction.overwriteBattleclass,
    20: NiceBuffAction.overwriteClassrelatioAtk,
    21: NiceBuffAction.overwriteClassrelatioDef,
    22: NiceBuffAction.commandNpAtk,
    23: NiceBuffAction.commandNpDef,
    24: NiceBuffAction.dropNp,
    25: NiceBuffAction.dropNpDamage,
    26: NiceBuffAction.commandStarAtk,
    27: NiceBuffAction.commandStarDef,
    28: NiceBuffAction.criticalPoint,
    29: NiceBuffAction.starweight,
    30: NiceBuffAction.turnendNp,
    31: NiceBuffAction.turnendStar,
    32: NiceBuffAction.turnendHpRegain,
    33: NiceBuffAction.turnendHpReduce,
    34: NiceBuffAction.gainHp,
    35: NiceBuffAction.turnvalNp,
    36: NiceBuffAction.grantState,
    37: NiceBuffAction.resistanceState,
    38: NiceBuffAction.avoidState,
    39: NiceBuffAction.donotAct,
    40: NiceBuffAction.donotSkill,
    41: NiceBuffAction.donotNoble,
    42: NiceBuffAction.donotRecovery,
    43: NiceBuffAction.individualityAdd,
    44: NiceBuffAction.individualitySub,
    45: NiceBuffAction.hate,
    46: NiceBuffAction.criticalRate,
    47: NiceBuffAction.avoidInstantdeath,
    48: NiceBuffAction.resistInstantdeath,
    49: NiceBuffAction.nonresistInstantdeath,
    50: NiceBuffAction.regainNpUsedNoble,
    51: NiceBuffAction.functionDead,
    52: NiceBuffAction.maxhpRate,
    53: NiceBuffAction.maxhpValue,
    54: NiceBuffAction.functionWavestart,
    55: NiceBuffAction.functionSelfturnend,
    56: NiceBuffAction.giveGainHp,
    57: NiceBuffAction.functionCommandattackAfter,
    58: NiceBuffAction.functionDeadattack,
    59: NiceBuffAction.functionEntry,
    60: NiceBuffAction.chagetd,
    61: NiceBuffAction.grantSubstate,
    62: NiceBuffAction.toleranceSubstate,
    63: NiceBuffAction.grantInstantdeath,
    64: NiceBuffAction.functionDamage,
    65: NiceBuffAction.functionReflection,
    66: NiceBuffAction.multiattack,
    67: NiceBuffAction.giveNp,
    68: NiceBuffAction.resistanceDelayNpturn,
    69: NiceBuffAction.pierceDefence,
    70: NiceBuffAction.gutsHp,
    71: NiceBuffAction.funcgainNp,
    72: NiceBuffAction.funcHpReduce,
    73: NiceBuffAction.functionNpattack,
    74: NiceBuffAction.fixCommandcard,
    75: NiceBuffAction.donotGainnp,
    76: NiceBuffAction.fieldIndividuality,
    77: NiceBuffAction.donotActCommandtype,
    78: NiceBuffAction.damageEventPoint,
    79: NiceBuffAction.damageSpecial,
    80: NiceBuffAction.functionAttackAfter,
    81: NiceBuffAction.functionCommandcodeattackBefore,
    82: NiceBuffAction.donotNobleCondMismatch,
    83: NiceBuffAction.donotSelectCommandcard,
    84: NiceBuffAction.donotReplace,
    85: NiceBuffAction.shortenUserEquipSkill,
    86: NiceBuffAction.tdTypeChange,
    87: NiceBuffAction.overwriteClassRelation,
    88: NiceBuffAction.functionCommandattackBefore,
    89: NiceBuffAction.functionGuts,
    90: NiceBuffAction.criticalRateDamageTaken,
    91: NiceBuffAction.criticalStarDamageTaken,
    92: NiceBuffAction.skillRankChange,
    93: NiceBuffAction.avoidanceIndividuality,
    94: NiceBuffAction.changeCommandCardType,
    95: NiceBuffAction.specialInvincible,
    96: NiceBuffAction.preventDeathByDamage,
    97: NiceBuffAction.functionCommandcodeattackAfter,
    98: NiceBuffAction.functionAttackBefore,
    99: NiceBuffAction.donotSkillSelect,
    100: NiceBuffAction.invisibleBattleChara,
    101: NiceBuffAction.buffRate,
    102: NiceBuffAction.counterFunction,
    103: NiceBuffAction.notTargetSkill,
    104: NiceBuffAction.toFieldChangeField,
    105: NiceBuffAction.toFieldAvoidBuff,
    106: NiceBuffAction.grantStateUpOnly,
    107: NiceBuffAction.turnendHpReduceToRegain,
    108: NiceBuffAction.functionSelfturnstart,
    109: NiceBuffAction.overwriteDeadType,
    110: NiceBuffAction.actionCount,
    111: NiceBuffAction.shiftGuts,
    112: NiceBuffAction.toFieldSubIndividualityField,
    113: NiceBuffAction.masterSkillValueUp,
    114: NiceBuffAction.buffConvert,
    115: NiceBuffAction.subFieldIndividuality,
    116: NiceBuffAction.functionCommandcodeattackBeforeMainOnly,
    117: NiceBuffAction.functionCommandcodeattackAfterMainOnly,
    118: NiceBuffAction.functionCommandattackBeforeMainOnly,
    119: NiceBuffAction.functionCommandattackAfterMainOnly,
    120: NiceBuffAction.functionAttackBeforeMainOnly,
    121: NiceBuffAction.functionAttackAfterMainOnly,
    122: NiceBuffAction.functionSkillAfter,
    123: NiceBuffAction.functionSkillAfterMainOnly,
    124: NiceBuffAction.functionTreasureDeviceAfter,
    125: NiceBuffAction.functionTreasureDeviceAfterMainOnly,
    126: NiceBuffAction.guts,
    127: NiceBuffAction.preventInvisibleWhenInstantDeath,
    128: NiceBuffAction.overwriteSubattribute,
    129: NiceBuffAction.avoidanceAttackDeathDamage,
    130: NiceBuffAction.avoidFunctionExecuteSelf,
    131: NiceBuffAction.functionContinue,
    132: NiceBuffAction.pierceSubdamage,
    133: NiceBuffAction.receiveDamagePierce,
    134: NiceBuffAction.specialReceiveDamage,
    135: NiceBuffAction.funcHpReduceValue,
    136: NiceBuffAction.changeBgm,
    137: NiceBuffAction.functionConfirmCommand,
    138: NiceBuffAction.functionSkillBefore,
    139: NiceBuffAction.functionSkillTargetedBefore,
    140: NiceBuffAction.functionFieldIndividualityChanged,
    141: NiceBuffAction.functionTreasureDeviceBefore,
    142: NiceBuffAction.functionStepInAfter,
    143: NiceBuffAction.shortenSkillAfterUseSkill,
    144: NiceBuffAction.pierceSpecialInvincible,
    145: NiceBuffAction.functionedFunction,
    146: NiceBuffAction.donotActCommandcard,
    147: NiceBuffAction.npdamageIndividuality,
    148: NiceBuffAction.functionComboStart,
    149: NiceBuffAction.functionComboEnd,
    150: NiceBuffAction.overwriteSvtCardType,
    151: NiceBuffAction.criticalDamageDef,
    152: NiceBuffAction.npdamageDef,
    153: NiceBuffAction.functionWavestartAnimationBefore,
    154: NiceBuffAction.receiveFixedDamage,
    155: NiceBuffAction.overwriteDamageDef,
    156: NiceBuffAction.changeActInAddCount,
    157: NiceBuffAction.functionGutsBefore,
    158: NiceBuffAction.overwriteBuffUseRate,
    159: NiceBuffAction.changeBuffUseRate,
    160: NiceBuffAction.hateToGrantedOpponent,
    161: NiceBuffAction.reactiveDamageGainHp,
    162: NiceBuffAction.baseHpRate,
    163: NiceBuffAction.baseHpValue,
    164: NiceBuffAction.substituteInstantDeath,
    165: NiceBuffAction.substituteAddState,
    166: NiceBuffAction.functionOtherTreasureDevicePreBefore,
    167: NiceBuffAction.functionAttackPhaseStart,
}


class BuffLimit(IntEnum):
    NONE = 0
    UPPER = 1
    LOWER = 2
    NORMAL = 3


class NiceBuffLimit(StrEnum):
    """Buff Limit Enum"""

    none = "none"
    upper_ = "upper"
    lower_ = "lower"
    normal = "normal"


BUFF_LIMIT_NAME: dict[int, NiceBuffLimit] = {
    0: NiceBuffLimit.none,
    1: NiceBuffLimit.upper_,
    2: NiceBuffLimit.lower_,
    3: NiceBuffLimit.normal,
}


class DataValsType(IntEnum):
    Rate = 0
    Turn = 1
    Count = 2
    Value = 3
    Value2 = 4
    UseRate = 5
    Target = 6
    Correction = 7
    ParamAdd = 8
    ParamMax = 9
    HideMiss = 10
    OnField = 11
    HideNoEffect = 12
    Unaffected = 13
    ShowState = 14
    AuraEffectId = 15
    ActSet = 16
    ActSetWeight = 17
    ShowQuestNoEffect = 18
    CheckDead = 19
    RatioHPHigh = 20
    RatioHPLow = 21
    SetPassiveFrame = 22
    ProcPassive = 23
    ProcActive = 24
    HideParam = 25
    SkillID = 26
    SkillLV = 27
    ShowCardOnly = 28
    EffectSummon = 29
    RatioHPRangeHigh = 30
    RatioHPRangeLow = 31
    TargetList = 32
    OpponentOnly = 33
    StatusEffectId = 34
    EndBattle = 35
    LoseBattle = 36
    AddIndividualty = 37
    AddLinkageTargetIndividualty = 38
    SameBuffLimitTargetIndividuality = 39
    SameBuffLimitNum = 40
    CheckDuplicate = 41
    OnFieldCount = 42
    TargetRarityList = 43
    DependFuncId = 44
    DependFuncVals = 45
    InvalidHide = 46
    OutEnemyNpcId = 47
    InEnemyNpcId = 48
    OutEnemyPosition = 49
    IgnoreIndividuality = 50
    StarHigher = 51
    ChangeTDCommandType = 52
    ShiftNpcId = 53
    DisplayLastFuncInvalidType = 54
    AndCheckIndividualityList = 55
    AndOrCheckIndividualityList = 56
    WinBattleNotRelatedSurvivalStatus = 57
    ForceSelfInstantDeath = 58
    ChangeMaxBreakGauge = 59
    ParamAddMaxValue = 60
    ParamAddMaxCount = 61
    LossHpChangeDamage = 62
    IncludePassiveIndividuality = 63
    MotionChange = 64
    PopLabelDelay = 65
    NoTargetNoAct = 66
    CardIndex = 67
    CardIndividuality = 68
    WarBoardTakeOverBuff = 69
    ParamAddSelfIndividuality = 70
    ParamAddOpIndividuality = 71
    ParamAddFieldIndividuality = 72
    ParamAddValue = 73
    MultipleGainStar = 74
    NoCheckIndividualityIfNotUnit = 75
    ForcedEffectSpeedOne = 76
    SetLimitCount = 77
    CheckEnemyFieldSpace = 78
    TriggeredFuncPosition = 79
    DamageCount = 80
    DamageRates = 81
    OnPositions = 82
    OffPositions = 83
    TargetIndiv = 84
    IncludeIgnoreIndividuality = 85
    EvenIfWinDie = 86
    CallSvtEffectId = 87
    ForceAddState = 88
    UnSubState = 89
    ForceSubState = 90
    IgnoreIndivUnreleaseable = 91
    OnParty = 92
    CounterId = 93
    CounterLv = 94
    CounterOc = 95
    UseTreasureDevice = 96
    SkillReaction = 97
    BehaveAsFamilyBuff = 98
    UnSubStateWhileLinkedToOthers = 99
    NotAccompanyWhenLinkedTargetMoveState = 100
    NotTargetSkillIdArray = 101
    ShortTurn = 102
    FieldIndividuality = 103
    BGId = 104
    BGType = 105
    BgmId = 106
    TakeOverFieldState = 107
    TakeOverNextWaveBGAndBGM = 108
    RemoveFieldBuffActorDeath = 109
    FieldBuffGrantType = 110
    Priority = 111
    AddIndividualityEx = 112
    IgnoreResistance = 113
    GainNpTargetPassiveIndividuality = 114
    HpReduceToRegainIndiv = 115
    DisplayActualRecoveryHpFlag = 116
    ShiftDeckIndex = 117
    PopValueText = 118
    IsLossHpPerNow = 119
    CopyTargetFunctionType = 120
    CopyFunctionTargetPTOnly = 121
    IgnoreValueUp = 122
    ApplyValueUp = 123
    ActNoDamageBuff = 124
    ActSelectIndex = 125
    CopyTargetBuffType = 126
    NotSkillCopyTargetFuncIds = 127
    NotSkillCopyTargetIndividualities = 128
    ClassIconAuraEffectId = 129
    ActMasterGenderType = 130
    IntervalTurn = 131
    IntervalCount = 132
    TriggeredFieldCountTarget = 133
    TriggeredFieldCountRange = 134
    TargetEnemyRange = 135
    TriggeredFuncPositionSameTarget = 136
    TriggeredFuncPositionAll = 137
    TriggeredTargetHpRange = 138
    TriggeredTargetHpRateRange = 139
    ExcludeUnSubStateIndiv = 140
    ProgressTurnOnBoard = 141
    CheckTargetResurrectable = 142
    CancelTransform = 143
    UnSubStateWhenContinue = 144
    CheckTargetHaveDefeatPoint = 145
    NPFixedDamageValue = 146
    IgnoreShiftSafeDamage = 147
    ActAttackFunction = 148
    DelayRemoveBuffExpiredOnPlayerTurn = 149
    AllowRemoveBuff = 150
    NotExecFunctionIfKeepAliveOnWarBoard = 151
    SnapShotParamAddSelfIndv = 152
    SnapShotParamAddOpIndv = 153
    SnapShotParamAddFieldIndv = 154
    SnapShotParamAddValue = 155
    SnapShotParamAddMaxValue = 156
    SnapShotParamAddMaxCount = 157
    NotExecOnTransform = 158
    NotRemoveOnTransform = 159
    PriorityBgm = 160
    BgmAllowSubPlaying = 161
    BgPriority = 162
    PriorityBg = 163
    ResetPriorityBgmAtWaveStart = 164
    ControlOtherBgmAtOverStageBgm_Priority = 165
    ControlOtherBgmAtOverStageBgm_Target = 166
    ExtendBuffHalfTurnInOpponentTurn = 167
    ShortenBuffHalfTurnInOpponentTurn = 168
    ExtendBuffHalfTurnInPartyTurn = 169
    ShortenBuffHalfTurnInPartyTurn = 170
    LinkageBuffGrantSuccessEvenIfOtherFailed = 171
    DisplayNoEffectCauses = 172
    BattlePointId = 173
    BattlePointValue = 174
    BattlePointUiUpdateType = 175
    BattlePointOverwrite = 176
    CheckOverChargeStageRange = 177
    CheckBattlePointPhaseRange = 178
    StartingPosition = 179
    FriendShipAbove = 180
    DamageRateBattlePointPhase = 181
    ParamAddBattlePointPhaseId = 182
    ParamAddBattlePointPhaseValue = 183
    ShortenMaxCountEachSkill = 184
    ChargeHpMaxBeforeBreakGaugeUp = 185
    TargetFunctionIndividuality = 186
    TargetBuffIndividuality = 187
    TargetEnemyClass = 188
    ParamAddIndividualityTargetType = 189
    TriggeredFuncIndexAndCheckList = 190
    FuncCheckTargetIndividualityTargetType = 191
    FuncCheckTargetIndividualityCountHigher = 192
    FuncCheckTargetIndividualityCountLower = 193
    FuncCheckTargetIndividualityCountEqual = 194
    ParamAddSelfIndividualityAndCheck = 195
    ParamAddOpIndividualityAndCheck = 196
    ParamAddFieldIndividualityAndCheck = 197
    SnapShotParamAddSelfIndividualityAndCheck = 198
    SnapShotParamAddOpIndividualityAndCheck = 199
    SnapShotParamAddFieldIndividualityAndCheck = 200
    EnemyCountChangeTime = 201
    EnemyCountChangeEffectId = 202
    EnemyCountWaitTimeAfterMessage = 203
    WaitMessageEnd = 204
    ContinueDisplayMessage = 205
    MessageStartDelayTime = 206
    StartIntervalTurn = 207
    StartIntervalCount = 208
    CommonReleaseId = 209
    ForceTurnProgressIfTimingIsOverInPartyTurn = 210
    ForceTurnProgressIfTimingIsOverInOpponentTurn = 211
    OverwriteFuncInvalidType = 212
    BgmFadeTime = 213
    KeepChangeModelAfterContinue = 214
    DefenceDamageHigher = 215
    SameIndivBuffActorOnField = 216
    SyncUsedSameIndivBuffActorOnField = 217
    OnlyMaxFuncGroupId = 218
    UseAttack = 219
    CondParamAddType = 220
    CondParamAddValue = 221
    CondParamAddMaxValue = 222
    CondParamAddTargetId = 223
    CondParamRangeType = 224
    CondParamRangeMaxCount = 225
    CondParamRangeMaxValue = 226
    CondParamRangeTargetId = 227
    ExecOnce = 228
    ApplyBuffIndividuality = 229
    ExecWhenCanNotAttack = 230
    ExecEvenCardSelectState = 231
    OverwriteShift = 232
    IgnoreShiftWhiteFade = 233
    BackStepTargets = 234
    ReplacePositionTargets = 235
    ApplySupportSvt = 236
    ApplyHighestValueInFieldGroup = 237
    IsClassIconChangeSaveGrand = 238
    ExecuteEffectId = 239
    PriorityUpHate = 240
    JudgeUseEveryTime = 241
    IgnoreDeathRate = 242
    SubstituteRate = 243
    SubstituteResist = 244
    UseSvtResistRate = 245
    UseBuffResistRate = 246
    SubstituteSkillId = 247
    SubstituteSkillLv = 248
    ResistSkillId = 249
    ResistSkillLv = 250
    SubstitutePopupText = 251
    SubstitutePopupIconId = 252
    ResistPopupText = 253
    ResistPopupIconId = 254
    SubstituteEffectList = 255
    ResistEffectList = 256
    EnablePassiveBuffConvert = 257
    FieldBuffApplyTarget = 258


class ClassRelationOverwriteType(IntEnum):
    OVERWRITE_FORCE = 0
    OVERWRITE_MORE_THAN_TARGET = 1
    OVERWRITE_LESS_THAN_TARGET = 2


class NiceClassRelationOverwriteType(StrEnum):
    """Class Relation Overwrite Type Enum"""

    overwriteForce = "overwriteForce"
    overwriteMoreThanTarget = "overwriteMoreThanTarget"
    overwriteLessThanTarget = "overwriteLessThanTarget"


CLASS_OVERWRITE_NAME: dict[int, NiceClassRelationOverwriteType] = {
    0: NiceClassRelationOverwriteType.overwriteForce,
    1: NiceClassRelationOverwriteType.overwriteMoreThanTarget,
    2: NiceClassRelationOverwriteType.overwriteLessThanTarget,
}


class ItemType(IntEnum):
    QP = 1
    STONE = 2
    AP_RECOVER = 3
    AP_ADD = 4
    MANA = 5
    KEY = 6
    GACHA_CLASS = 7
    GACHA_RELIC = 8
    GACHA_TICKET = 9
    LIMIT = 10
    SKILL_LV_UP = 11
    TD_LV_UP = 12
    FRIEND_POINT = 13
    EVENT_POINT = 14
    EVENT_ITEM = 15
    QUEST_REWARD_QP = 16
    CHARGE_STONE = 17
    RP_ADD = 18
    BOOST_ITEM = 19
    STONE_FRAGMENTS = 20
    ANONYMOUS = 21
    RARE_PRI = 22
    COSTUME_RELEASE = 23
    ITEM_SELECT = 24
    COMMAND_CARD_PRM_UP = 25
    DICE = 26
    CONTINUE_ITEM = 27
    EUQIP_SKILL_USE_ITEM = 28
    SVT_COIN = 29
    FRIENDSHIP_UP_ITEM = 30
    PURE_PRI = 31
    TRADE_AP = 32
    REVIVAL_ITEM = 33
    STORMPOD = 34
    BATTLE_ITEM = 35
    ANIPLEX_PLUS_CHARGE_STONE = 36
    PURE_PRI_SHOP_RESET = 37
    EXCHANGE_SVT_COIN = 38
    REDUCE_TRADE_TIME = 39
    EVENT_PASSIVE_SKILL_GIVEN = 40
    CLASS_BOARD_RESET_ITEM = 41


class NiceItemType(StrEnum):
    """Item Type Enum"""

    qp = "qp"
    stone = "stone"
    apRecover = "apRecover"
    apAdd = "apAdd"
    mana = "mana"
    key = "key"
    gachaClass = "gachaClass"
    gachaRelic = "gachaRelic"
    gachaTicket = "gachaTicket"
    limit = "limit"
    skillLvUp = "skillLvUp"
    tdLvUp = "tdLvUp"
    friendPoint = "friendPoint"
    eventPoint = "eventPoint"
    eventItem = "eventItem"
    questRewardQp = "questRewardQp"
    chargeStone = "chargeStone"
    rpAdd = "rpAdd"
    boostItem = "boostItem"
    stoneFragments = "stoneFragments"
    anonymous = "anonymous"
    rarePri = "rarePri"
    costumeRelease = "costumeRelease"
    itemSelect = "itemSelect"
    commandCardPrmUp = "commandCardPrmUp"
    dice = "dice"
    continueItem = "continueItem"
    euqipSkillUseItem = "euqipSkillUseItem"
    svtCoin = "svtCoin"
    friendshipUpItem = "friendshipUpItem"
    purePri = "purePri"
    tradeAp = "tradeAp"
    revivalItem = "revivalItem"
    stormpod = "stormpod"
    battleItem = "battleItem"
    aniplexPlusChargeStone = "aniplexPlusChargeStone"
    purePriShopReset = "purePriShopReset"
    exchangeSvtCoin = "exchangeSvtCoin"
    reduceTradeTime = "reduceTradeTime"
    eventPassiveSkillGiven = "eventPassiveSkillGiven"
    classBoardResetItem = "classBoardResetItem"
    netmarbleChargeStone = "netmarbleChargeStone"


ITEM_TYPE_NAME: dict[int, NiceItemType] = {
    1: NiceItemType.qp,
    2: NiceItemType.stone,
    3: NiceItemType.apRecover,
    4: NiceItemType.apAdd,
    5: NiceItemType.mana,
    6: NiceItemType.key,
    7: NiceItemType.gachaClass,
    8: NiceItemType.gachaRelic,
    9: NiceItemType.gachaTicket,
    10: NiceItemType.limit,
    11: NiceItemType.skillLvUp,
    12: NiceItemType.tdLvUp,
    13: NiceItemType.friendPoint,
    14: NiceItemType.eventPoint,
    15: NiceItemType.eventItem,
    16: NiceItemType.questRewardQp,
    17: NiceItemType.chargeStone,
    18: NiceItemType.rpAdd,
    19: NiceItemType.boostItem,
    20: NiceItemType.stoneFragments,
    21: NiceItemType.anonymous,
    22: NiceItemType.rarePri,
    23: NiceItemType.costumeRelease,
    24: NiceItemType.itemSelect,
    25: NiceItemType.commandCardPrmUp,
    26: NiceItemType.dice,
    27: NiceItemType.continueItem,
    28: NiceItemType.euqipSkillUseItem,
    29: NiceItemType.svtCoin,
    30: NiceItemType.friendshipUpItem,
    31: NiceItemType.purePri,
    32: NiceItemType.tradeAp,
    33: NiceItemType.revivalItem,
    34: NiceItemType.stormpod,
    35: NiceItemType.battleItem,
    36: NiceItemType.aniplexPlusChargeStone,
    37: NiceItemType.purePriShopReset,
    38: NiceItemType.exchangeSvtCoin,
    39: NiceItemType.reduceTradeTime,
    40: NiceItemType.eventPassiveSkillGiven,
    41: NiceItemType.classBoardResetItem,
    9999: NiceItemType.netmarbleChargeStone,
}


class GiftType(IntEnum):
    SERVANT = 1
    ITEM = 2
    FRIENDSHIP = 3
    USER_EXP = 4
    EQUIP = 5
    EVENT_SVT_JOIN = 6
    EVENT_SVT_GET = 7
    QUEST_REWARD_ICON = 8
    COSTUME_RELEASE = 9
    COSTUME_GET = 10
    COMMAND_CODE = 11
    EVENT_POINT_BUFF = 12
    EVENT_BOARD_GAME_TOKEN = 13
    EVENT_COMMAND_ASSIST = 14
    EVENT_HEEL_PORTRAIT = 15
    BATTLE_ITEM = 16
    PRIVILEGE = 17
    CLASS_SKILL = 18


class NiceGiftType(StrEnum):
    """Gift Type Enum"""

    servant = "servant"
    item = "item"
    friendship = "friendship"
    userExp = "userExp"
    equip = "equip"
    eventSvtJoin = "eventSvtJoin"
    eventSvtGet = "eventSvtGet"
    questRewardIcon = "questRewardIcon"
    costumeRelease = "costumeRelease"
    costumeGet = "costumeGet"
    commandCode = "commandCode"
    eventPointBuff = "eventPointBuff"
    eventBoardGameToken = "eventBoardGameToken"
    eventCommandAssist = "eventCommandAssist"
    eventHeelPortrait = "eventHeelPortrait"
    battleItem = "battleItem"
    privilege = "privilege"
    classSkill = "classSkill"


GIFT_TYPE_NAME: dict[int, NiceGiftType] = {
    1: NiceGiftType.servant,
    2: NiceGiftType.item,
    3: NiceGiftType.friendship,
    4: NiceGiftType.userExp,
    5: NiceGiftType.equip,
    6: NiceGiftType.eventSvtJoin,
    7: NiceGiftType.eventSvtGet,
    8: NiceGiftType.questRewardIcon,
    9: NiceGiftType.costumeRelease,
    10: NiceGiftType.costumeGet,
    11: NiceGiftType.commandCode,
    12: NiceGiftType.eventPointBuff,
    13: NiceGiftType.eventBoardGameToken,
    14: NiceGiftType.eventCommandAssist,
    15: NiceGiftType.eventHeelPortrait,
    16: NiceGiftType.battleItem,
    17: NiceGiftType.privilege,
    18: NiceGiftType.classSkill,
}


class ShopType(IntEnum):
    NONE = 0
    EVENT_ITEM = 1
    MANA = 2
    RARE_PRI = 3
    SVT_STORAGE = 4
    SVT_EQUIP_STORAGE = 5
    STONE_FRAGMENTS = 6
    SVT_ANONYMOUS = 7
    BGM = 8
    LIMIT_MATERIAL = 9
    GRAIL_FRAGMENTS = 10
    SVT_COSTUME = 11
    START_UP_SUMMON = 12
    PURE_PRI = 13
    TRADE_AP = 14
    REVIVAL_ITEM = 15
    EVENT_SVT_EQUIP = 16
    EXCHANGE_SVT_COIN = 17
    CLASS_BOARD_RESET = 18


class NiceShopType(StrEnum):
    """Shop Type Enum"""

    none = "none"
    eventItem = "eventItem"
    mana = "mana"
    rarePri = "rarePri"
    svtStorage = "svtStorage"
    svtEquipStorage = "svtEquipStorage"
    stoneFragments = "stoneFragments"
    svtAnonymous = "svtAnonymous"
    bgm = "bgm"
    limitMaterial = "limitMaterial"
    grailFragments = "grailFragments"
    svtCostume = "svtCostume"
    startUpSummon = "startUpSummon"
    purePri = "purePri"
    tradeAp = "tradeAp"
    revivalItem = "revivalItem"
    eventSvtEquip = "eventSvtEquip"
    exchangeSvtCoin = "exchangeSvtCoin"
    classBoardReset = "classBoardReset"


SHOP_TYPE_NAME: dict[int, NiceShopType] = {
    0: NiceShopType.none,
    1: NiceShopType.eventItem,
    2: NiceShopType.mana,
    3: NiceShopType.rarePri,
    4: NiceShopType.svtStorage,
    5: NiceShopType.svtEquipStorage,
    6: NiceShopType.stoneFragments,
    7: NiceShopType.svtAnonymous,
    8: NiceShopType.bgm,
    9: NiceShopType.limitMaterial,
    10: NiceShopType.grailFragments,
    11: NiceShopType.svtCostume,
    12: NiceShopType.startUpSummon,
    13: NiceShopType.purePri,
    14: NiceShopType.tradeAp,
    15: NiceShopType.revivalItem,
    16: NiceShopType.eventSvtEquip,
    17: NiceShopType.exchangeSvtCoin,
    18: NiceShopType.classBoardReset,
}


class PayType(IntEnum):
    STONE = 1
    QP = 2
    FRIEND_POINT = 3
    MANA = 4
    TICKET = 5
    EVENT_ITEM = 6
    CHARGE_STONE = 7
    STONE_FRAGMENTS = 8
    ANONYMOUS = 9
    RARE_PRI = 10
    ITEM = 11
    GRAIL_FRAGMENTS = 12
    FREE = 13
    COMMON_CONSUME = 14


class NicePayType(StrEnum):
    """Pay Type Enum"""

    stone = "stone"
    qp = "qp"
    friendPoint = "friendPoint"
    mana = "mana"
    ticket = "ticket"
    eventItem = "eventItem"
    chargeStone = "chargeStone"
    stoneFragments = "stoneFragments"
    anonymous = "anonymous"
    rarePri = "rarePri"
    item = "item"
    grailFragments = "grailFragments"
    free = "free"
    commonConsume = "commonConsume"


PAY_TYPE_NAME: dict[int, NicePayType] = {
    1: NicePayType.stone,
    2: NicePayType.qp,
    3: NicePayType.friendPoint,
    4: NicePayType.mana,
    5: NicePayType.ticket,
    6: NicePayType.eventItem,
    7: NicePayType.chargeStone,
    8: NicePayType.stoneFragments,
    9: NicePayType.anonymous,
    10: NicePayType.rarePri,
    11: NicePayType.item,
    12: NicePayType.grailFragments,
    13: NicePayType.free,
    14: NicePayType.commonConsume,
}


class PurchaseType(IntEnum):
    NONE = 0
    ITEM = 1
    EQUIP = 2
    FRIEND_GACHA = 3
    SERVANT = 4
    SET_ITEM = 5
    QUEST = 6
    EVENT_SHOP = 7
    EVENT_SVT_GET = 8
    MANA_SHOP = 9
    STORAGE_SVT = 10
    STORAGE_SVTEQUIP = 11
    BGM = 12
    COSTUME_RELEASE = 14
    BGM_RELEASE = 15
    LOTTERY_SHOP = 16
    EVENT_FACTORY = 17
    ITEM_AS_PRESENT = 18
    COMMAND_CODE = 19
    GIFT = 20
    EVENT_SVT_JOIN = 21
    ASSIST = 22
    CLASS_BOARD_RESET_ITEM = 23
    PARTS_SKILL = 24


class NicePurchaseType(StrEnum):
    """Purchase Type Enum"""

    none = "none"
    item = "item"
    equip = "equip"
    friendGacha = "friendGacha"
    servant = "servant"
    setItem = "setItem"
    quest = "quest"
    eventShop = "eventShop"
    eventSvtGet = "eventSvtGet"
    manaShop = "manaShop"
    storageSvt = "storageSvt"
    storageSvtequip = "storageSvtequip"
    bgm = "bgm"
    costumeRelease = "costumeRelease"
    bgmRelease = "bgmRelease"
    lotteryShop = "lotteryShop"
    eventFactory = "eventFactory"
    itemAsPresent = "itemAsPresent"
    commandCode = "commandCode"
    gift = "gift"
    eventSvtJoin = "eventSvtJoin"
    assist = "assist"
    classBoardResetItem = "classBoardResetItem"
    partsSkill = "partsSkill"
    kiaraPunisherReset = "kiaraPunisherReset"


PURCHASE_TYPE_NAME: dict[int, NicePurchaseType] = {
    0: NicePurchaseType.none,
    1: NicePurchaseType.item,
    2: NicePurchaseType.equip,
    3: NicePurchaseType.friendGacha,
    4: NicePurchaseType.servant,
    5: NicePurchaseType.setItem,
    6: NicePurchaseType.quest,
    7: NicePurchaseType.eventShop,
    8: NicePurchaseType.eventSvtGet,
    9: NicePurchaseType.manaShop,
    10: NicePurchaseType.storageSvt,
    11: NicePurchaseType.storageSvtequip,
    12: NicePurchaseType.bgm,
    14: NicePurchaseType.costumeRelease,
    15: NicePurchaseType.bgmRelease,
    16: NicePurchaseType.lotteryShop,
    17: NicePurchaseType.eventFactory,
    18: NicePurchaseType.itemAsPresent,
    19: NicePurchaseType.commandCode,
    20: NicePurchaseType.gift,
    21: NicePurchaseType.eventSvtJoin,
    22: NicePurchaseType.assist,
    23: NicePurchaseType.classBoardResetItem,
    24: NicePurchaseType.partsSkill,
    13: NicePurchaseType.kiaraPunisherReset,
}


class CardType(IntEnum):
    NONE = 0
    ARTS = 1
    BUSTER = 2
    QUICK = 3
    ADDATTACK = 4
    BLANK = 5
    WEAK = 10
    STRENGTH = 11
    WEAKALT1 = 21
    WEAKALT2 = 22
    BUSTERALT1 = 60
    EXTRA2 = 104


class NiceCardType(StrEnum):
    """Card Type Enum"""

    none = "0"
    arts = "1"
    buster = "2"
    quick = "3"
    addattack = "4"
    blank = "5"
    weak = "10"
    strength = "11"
    weakalt1 = "21"
    weakalt2 = "22"
    busteralt1 = "60"
    extra2 = "104"


CARD_TYPE_NAME: dict[int, NiceCardType] = {
    0: NiceCardType.none,
    1: NiceCardType.arts,
    2: NiceCardType.buster,
    3: NiceCardType.quick,
    4: NiceCardType.addattack,
    5: NiceCardType.blank,
    10: NiceCardType.weak,
    11: NiceCardType.strength,
    21: NiceCardType.weakalt1,
    22: NiceCardType.weakalt2,
    60: NiceCardType.busteralt1,
    104: NiceCardType.extra2,
}


class CondType(IntEnum):
    NONE = 0
    QUEST_CLEAR = 1
    ITEM_GET = 2
    USE_ITEM_ETERNITY = 3
    USE_ITEM_TIME = 4
    USE_ITEM_COUNT = 5
    SVT_LEVEL = 6
    SVT_LIMIT = 7
    SVT_GET = 8
    SVT_FRIENDSHIP = 9
    SVT_GROUP = 10
    EVENT = 11
    DATE = 12
    WEEKDAY = 13
    PURCHASE_QP_SHOP = 14
    PURCHASE_STONE_SHOP = 15
    WAR_CLEAR = 16
    FLAG = 17
    SVT_COUNT_STOP = 18
    BIRTH_DAY = 19
    EVENT_END = 20
    SVT_EVENT_JOIN = 21
    MISSION_CONDITION_DETAIL = 22
    EVENT_MISSION_CLEAR = 23
    EVENT_MISSION_ACHIEVE = 24
    QUEST_CLEAR_NUM = 25
    NOT_QUEST_GROUP_CLEAR = 26
    RAID_ALIVE = 27
    RAID_DEAD = 28
    RAID_DAMAGE = 29
    QUEST_CHALLENGE_NUM = 30
    MASTER_MISSION = 31
    QUEST_GROUP_CLEAR = 32
    SUPER_BOSS_DAMAGE = 33
    SUPER_BOSS_DAMAGE_ALL = 34
    PURCHASE_SHOP = 35
    QUEST_NOT_CLEAR = 36
    NOT_SHOP_PURCHASE = 37
    NOT_SVT_GET = 38
    NOT_EVENT_SHOP_PURCHASE = 39
    SVT_HAVING = 40
    NOT_SVT_HAVING = 41
    QUEST_CHALLENGE_NUM_EQUAL = 42
    QUEST_CHALLENGE_NUM_BELOW = 43
    QUEST_CLEAR_NUM_EQUAL = 44
    QUEST_CLEAR_NUM_BELOW = 45
    QUEST_CLEAR_PHASE = 46
    NOT_QUEST_CLEAR_PHASE = 47
    EVENT_POINT_GROUP_WIN = 48
    EVENT_NORMA_POINT_CLEAR = 49
    QUEST_AVAILABLE = 50
    QUEST_GROUP_AVAILABLE_NUM = 51
    EVENT_NORMA_POINT_NOT_CLEAR = 52
    NOT_ITEM_GET = 53
    COSTUME_GET = 54
    QUEST_RESET_AVAILABLE = 55
    SVT_GET_BEFORE_EVENT_END = 56
    QUEST_CLEAR_RAW = 57
    QUEST_GROUP_CLEAR_RAW = 58
    EVENT_GROUP_POINT_RATIO_IN_TERM = 59
    EVENT_GROUP_RANK_IN_TERM = 60
    NOT_EVENT_RACE_QUEST_OR_NOT_ALL_GROUP_GOAL = 61
    EVENT_GROUP_TOTAL_WIN_EACH_PLAYER = 62
    EVENT_SCRIPT_PLAY = 63
    SVT_COSTUME_RELEASED = 64
    QUEST_NOT_CLEAR_AND = 65
    SVT_RECOVERD = 66
    SHOP_RELEASED = 67
    EVENT_POINT = 68
    EVENT_REWARD_DISP_COUNT = 69
    EQUIP_WITH_TARGET_COSTUME = 70
    RAID_GROUP_DEAD = 71
    NOT_SVT_GROUP = 72
    NOT_QUEST_RESET_AVAILABLE = 73
    NOT_QUEST_CLEAR_RAW = 74
    NOT_QUEST_GROUP_CLEAR_RAW = 75
    NOT_EVENT_MISSION_CLEAR = 76
    NOT_EVENT_MISSION_ACHIEVE = 77
    NOT_COSTUME_GET = 78
    NOT_SVT_COSTUME_RELEASED = 79
    NOT_EVENT_RACE_QUEST_OR_NOT_TARGET_RANK_GOAL = 80
    PLAYER_GENDER_TYPE = 81
    SHOP_GROUP_LIMIT_NUM = 82
    EVENT_GROUP_POINT = 83
    EVENT_GROUP_POINT_BELOW = 84
    EVENT_TOTAL_POINT = 85
    EVENT_TOTAL_POINT_BELOW = 86
    EVENT_VALUE = 87
    EVENT_VALUE_BELOW = 88
    EVENT_FLAG = 89
    EVENT_STATUS = 90
    NOT_EVENT_STATUS = 91
    FORCE_FALSE = 92
    SVT_HAVING_LIMIT_MAX = 93
    EVENT_POINT_BELOW = 94
    SVT_EQUIP_FRIENDSHIP_HAVING = 95
    MOVIE_NOT_DOWNLOAD = 96
    MULTIPLE_DATE = 97
    SVT_FRIENDSHIP_ABOVE = 98
    SVT_FRIENDSHIP_BELOW = 99
    MOVIE_DOWNLOADED = 100
    ROUTE_SELECT = 101
    NOT_ROUTE_SELECT = 102
    LIMIT_COUNT = 103
    LIMIT_COUNT_ABOVE = 104
    LIMIT_COUNT_BELOW = 105
    BAD_END_PLAY = 106
    COMMAND_CODE_GET = 107
    NOT_COMMAND_CODE_GET = 108
    ALL_USERS_BOX_GACHA_COUNT = 109
    TOTAL_TD_LEVEL = 110
    TOTAL_TD_LEVEL_ABOVE = 111
    TOTAL_TD_LEVEL_BELOW = 112
    COMMON_RELEASE = 113
    BATTLE_RESULT_WIN = 114
    BATTLE_RESULT_LOSE = 115
    EVENT_VALUE_EQUAL = 116
    BOARD_GAME_TOKEN_HAVING = 117
    BOARD_GAME_TOKEN_GROUP_HAVING = 118
    EVENT_FLAG_ON = 119
    EVENT_FLAG_OFF = 120
    QUEST_STATUS_FLAG_ON = 121
    QUEST_STATUS_FLAG_OFF = 122
    EVENT_VALUE_NOT_EQUAL = 123
    LIMIT_COUNT_MAX_EQUAL = 124
    LIMIT_COUNT_MAX_ABOVE = 125
    LIMIT_COUNT_MAX_BELOW = 126
    BOARD_GAME_TOKEN_GET_NUM = 127
    BATTLE_LINE_WIN_ABOVE = 128
    BATTLE_LINE_LOSE_ABOVE = 129
    BATTLE_LINE_CONTINUE_WIN = 130
    BATTLE_LINE_CONTINUE_LOSE = 131
    BATTLE_LINE_CONTINUE_WIN_BELOW = 132
    BATTLE_LINE_CONTINUE_LOSE_BELOW = 133
    BATTLE_GROUP_WIN_AVOVE = 134
    BATTLE_GROUP_LOSE_AVOVE = 135
    SVT_LIMIT_CLASS_NUM = 136
    OVER_TIME_LIMIT_RAID_ALIVE = 137
    ON_TIME_LIMIT_RAID_DEAD = 138
    ON_TIME_LIMIT_RAID_DEAD_NUM = 139
    RAID_BATTLE_PROGRESS_ABOVE = 140
    SVT_EQUIP_RARITY_LEVEL_NUM = 141
    LATEST_MAIN_SCENARIO_WAR_CLEAR = 142
    EVENT_MAP_VALUE_CONTAINS = 143
    RESET_BIRTH_DAY = 144
    SHOP_FLAG_ON = 145
    SHOP_FLAG_OFF = 146
    PURCHASE_VALID_SHOP_GROUP = 147
    SVT_LEVEL_CLASS_NUM = 148
    SVT_LEVEL_ID_NUM = 149
    LIMIT_COUNT_IMAGE_EQUAL = 150
    LIMIT_COUNT_IMAGE_ABOVE = 151
    LIMIT_COUNT_IMAGE_BELOW = 152
    EVENT_TYPE_START_TIME_TO_END_DATE = 153
    EXIST_BOX_GACHA_SCRIPT_REPLACE_GIFT_ID = 154
    NOT_EXIST_BOX_GACHA_SCRIPT_REPLACE_GIFT_ID = 155
    LIMITED_PERIOD_VOICE_CHANGE_TYPE_ON = 156
    START_RANDOM_MISSION = 157
    RANDOM_MISSION_CLEAR_NUM = 158
    PROGRESS_VALUE_EQUAL = 159
    PROGRESS_VALUE_ABOVE = 160
    PROGRESS_VALUE_BELOW = 161
    RANDOM_MISSION_TOTAL_CLEAR_NUM = 162
    WEEKDAYS = 166
    EVENT_FORTIFICATION_REWARD_NUM = 167
    QUEST_CLEAR_BEFORE_EVENT_START = 168
    NOT_QUEST_CLEAR_BEFORE_EVENT_START = 169
    EVENT_TUTORIAL_FLAG_ON = 170
    EVENT_TUTORIAL_FLAG_OFF = 171
    EVENT_SUPER_BOSS_VALUE_EQUAL = 172
    NOT_EVENT_SUPER_BOSS_VALUE_EQUAL = 173
    ALL_SVT_TARGET_SKILL_LV_NUM = 174
    SUPER_BOSS_DAMAGE_ABOVE = 175
    SUPER_BOSS_DAMAGE_BELOW = 176
    EVENT_MISSION_GROUP_ACHIEVE = 177
    SVT_FRIENDSHIP_CLASS_NUM_ABOVE = 178
    NOT_WAR_CLEAR = 179
    SVT_SKILL_LV_CLASS_NUM_ABOVE = 180
    SVT_CLASS_LV_UP_COUNT = 181
    SVT_CLASS_SKILL_LV_UP_COUNT = 182
    SVT_CLASS_LIMIT_UP_COUNT = 183
    SVT_CLASS_FRIENDSHIP_COUNT = 184
    COMPLETE_HEEL_PORTRAIT = 185
    NOT_COMPLETE_HEEL_PORTRAIT = 186
    CLASS_BOARD_SQUARE_RELEASED = 187
    SVT_LEVEL_EXCHANGE_SVT = 188
    SVT_LIMIT_EXCHANGE_SVT = 189
    SKILL_LV_EXCHANGE_SVT = 190
    SVT_FRIENDSHIP_EXCHANGE_SVT = 191
    EXCHANGE_SVT = 192
    RAID_DAMAGE_ABOVE = 193
    RAID_DAMAGE_BELOW = 194
    RAID_GROUP_DAMAGE_ABOVE = 195
    RAID_GROUP_DAMAGE_BELOW = 196
    RAID_DAMAGE_RATE_ABOVE = 197
    RAID_DAMAGE_RATE_BELOW = 198
    RAID_DAMAGE_RATE_NOT_ABOVE = 199
    RAID_DAMAGE_RATE_NOT_BELOW = 200
    RAID_GROUP_DAMAGE_RATE_ABOVE = 201
    RAID_GROUP_DAMAGE_RATE_BELOW = 202
    RAID_GROUP_DAMAGE_RATE_NOT_ABOVE = 203
    RAID_GROUP_DAMAGE_RATE_NOT_BELOW = 204
    NOT_QUEST_GROUP_CLEAR_NUM = 205
    RAID_GROUP_OPEN_ABOVE = 206
    RAID_GROUP_OPEN_BELOW = 207
    TREASURE_DEVICE_ACCELERATE = 208
    PLAY_QUEST_PHASE = 209
    NOT_PLAY_QUEST_PHASE = 210
    EVENT_START_TO_END = 211
    COMMON_VALUE_ABOVE = 212
    COMMON_VALUE_BELOW = 213
    COMMON_VALUE_EQUAL = 214
    ELAPSED_TIME_AFTER_QUEST_CLEAR = 215
    WITH_STARTING_MEMBER = 216
    LATEST_QUEST_PHASE_EQUAL = 217
    NOT_LATEST_QUEST_PHASE_EQUAL = 218
    PURCHASE_SHOP_NUM = 219
    EVENT_TRADE_TOTAL_NUM = 220
    LIMITED_MISSION_ACHIEVE_NUM_BELOW = 221
    LIMITED_MISSION_ACHIEVE_NUM_ABOVE = 222
    NOT_SVT_VOICE_PLAYED = 223
    BATTLE_POINT_ABOVE = 225
    BATTLE_POINT_BELOW = 226
    BEFORE_SPECIFIED_DATE = 228
    NOT_HAVE_CHARGE_STONE = 229
    HAVE_CHARGE_STONE = 230
    BATTLE_FUNCTION_TARGET_ALL_INDIVIDUALITY = 231
    BATTLE_FUNCTION_TARGET_ONE_INDIVIDUALITY = 232
    BEFORE_QUEST_CLEAR_TIME = 233
    AFTER_QUEST_CLEAR_TIME = 234
    NOT_BATTLE_FUNCTION_TARGET_ALL_INDIVIDUALITY = 235
    NOT_BATTLE_FUNCTION_TARGET_ONE_INDIVIDUALITY = 236
    EVENT_SCRIPT_NOT_PLAY = 237
    EVENT_SCRIPT_FLAG = 238
    IMAGE_PARTS_GROUP = 241
    USER_LEVEL_ABOVE = 242
    USER_LEVEL_BELOW = 243
    USER_LEVEL_EQUAL = 244
    HIGHEST_WAVE_ABOVE = 245
    HIGHEST_WAVE_BELOW = 246
    PRIVILEGE_VALID = 247
    PRIVILEGE_INVALID = 248
    BATTLE_ACTION_OPPONENT_INDIVIDUALITY = 249
    NOT_BATTLE_ACTION_OPPONENT_INDIVIDUALITY = 250
    TREASURE_DEVICE_OF_SELECTED_CARD = 251
    BATTLE_SVT_FRIENDSHIP_ABOVE = 252
    BATTLE_SVT_FRIENDSHIP_BELOW = 253
    ELAPSED_TIME_AFTER_SVT_GET = 254
    NOT_ELAPSED_TIME_AFTER_QUEST_CLEAR = 255
    NOT_ELAPSED_TIME_AFTER_SVT_GET = 256
    GRAND_SVT_SET = 258
    PLAYED_MOVIE = 259
    NOT_PLAYED_MOVIE = 260
    NOT_SHOP_GROUP_LIMIT_NUM = 263
    EQUIP_GET = 264
    NOT_EQUIP_GET = 265
    SVT_GET_BEFORE_DATE = 266
    SVT_GET_AFTER_DATE = 267


class NiceCondType(StrEnum):
    """Condition Type Enum"""

    none = "none"
    questClear = "questClear"
    itemGet = "itemGet"
    useItemEternity = "useItemEternity"
    useItemTime = "useItemTime"
    useItemCount = "useItemCount"
    svtLevel = "svtLevel"
    svtLimit = "svtLimit"
    svtGet = "svtGet"
    svtFriendship = "svtFriendship"
    svtGroup = "svtGroup"
    event = "event"
    date = "date"
    weekday = "weekday"
    purchaseQpShop = "purchaseQpShop"
    purchaseStoneShop = "purchaseStoneShop"
    warClear = "warClear"
    flag = "flag"
    svtCountStop = "svtCountStop"
    birthDay = "birthDay"
    eventEnd = "eventEnd"
    svtEventJoin = "svtEventJoin"
    missionConditionDetail = "missionConditionDetail"
    eventMissionClear = "eventMissionClear"
    eventMissionAchieve = "eventMissionAchieve"
    questClearNum = "questClearNum"
    notQuestGroupClear = "notQuestGroupClear"
    raidAlive = "raidAlive"
    raidDead = "raidDead"
    raidDamage = "raidDamage"
    questChallengeNum = "questChallengeNum"
    masterMission = "masterMission"
    questGroupClear = "questGroupClear"
    superBossDamage = "superBossDamage"
    superBossDamageAll = "superBossDamageAll"
    purchaseShop = "purchaseShop"
    questNotClear = "questNotClear"
    notShopPurchase = "notShopPurchase"
    notSvtGet = "notSvtGet"
    notEventShopPurchase = "notEventShopPurchase"
    svtHaving = "svtHaving"
    notSvtHaving = "notSvtHaving"
    questChallengeNumEqual = "questChallengeNumEqual"
    questChallengeNumBelow = "questChallengeNumBelow"
    questClearNumEqual = "questClearNumEqual"
    questClearNumBelow = "questClearNumBelow"
    questClearPhase = "questClearPhase"
    notQuestClearPhase = "notQuestClearPhase"
    eventPointGroupWin = "eventPointGroupWin"
    eventNormaPointClear = "eventNormaPointClear"
    questAvailable = "questAvailable"
    questGroupAvailableNum = "questGroupAvailableNum"
    eventNormaPointNotClear = "eventNormaPointNotClear"
    notItemGet = "notItemGet"
    costumeGet = "costumeGet"
    questResetAvailable = "questResetAvailable"
    svtGetBeforeEventEnd = "svtGetBeforeEventEnd"
    questClearRaw = "questClearRaw"
    questGroupClearRaw = "questGroupClearRaw"
    eventGroupPointRatioInTerm = "eventGroupPointRatioInTerm"
    eventGroupRankInTerm = "eventGroupRankInTerm"
    notEventRaceQuestOrNotAllGroupGoal = "notEventRaceQuestOrNotAllGroupGoal"
    eventGroupTotalWinEachPlayer = "eventGroupTotalWinEachPlayer"
    eventScriptPlay = "eventScriptPlay"
    svtCostumeReleased = "svtCostumeReleased"
    questNotClearAnd = "questNotClearAnd"
    svtRecoverd = "svtRecoverd"
    shopReleased = "shopReleased"
    eventPoint = "eventPoint"
    eventRewardDispCount = "eventRewardDispCount"
    equipWithTargetCostume = "equipWithTargetCostume"
    raidGroupDead = "raidGroupDead"
    notSvtGroup = "notSvtGroup"
    notQuestResetAvailable = "notQuestResetAvailable"
    notQuestClearRaw = "notQuestClearRaw"
    notQuestGroupClearRaw = "notQuestGroupClearRaw"
    notEventMissionClear = "notEventMissionClear"
    notEventMissionAchieve = "notEventMissionAchieve"
    notCostumeGet = "notCostumeGet"
    notSvtCostumeReleased = "notSvtCostumeReleased"
    notEventRaceQuestOrNotTargetRankGoal = "notEventRaceQuestOrNotTargetRankGoal"
    playerGenderType = "playerGenderType"
    shopGroupLimitNum = "shopGroupLimitNum"
    eventGroupPoint = "eventGroupPoint"
    eventGroupPointBelow = "eventGroupPointBelow"
    eventTotalPoint = "eventTotalPoint"
    eventTotalPointBelow = "eventTotalPointBelow"
    eventValue = "eventValue"
    eventValueBelow = "eventValueBelow"
    eventFlag = "eventFlag"
    eventStatus = "eventStatus"
    notEventStatus = "notEventStatus"
    forceFalse = "forceFalse"
    svtHavingLimitMax = "svtHavingLimitMax"
    eventPointBelow = "eventPointBelow"
    svtEquipFriendshipHaving = "svtEquipFriendshipHaving"
    movieNotDownload = "movieNotDownload"
    multipleDate = "multipleDate"
    svtFriendshipAbove = "svtFriendshipAbove"
    svtFriendshipBelow = "svtFriendshipBelow"
    movieDownloaded = "movieDownloaded"
    routeSelect = "routeSelect"
    notRouteSelect = "notRouteSelect"
    limitCount = "limitCount"
    limitCountAbove = "limitCountAbove"
    limitCountBelow = "limitCountBelow"
    badEndPlay = "badEndPlay"
    commandCodeGet = "commandCodeGet"
    notCommandCodeGet = "notCommandCodeGet"
    allUsersBoxGachaCount = "allUsersBoxGachaCount"
    totalTdLevel = "totalTdLevel"
    totalTdLevelAbove = "totalTdLevelAbove"
    totalTdLevelBelow = "totalTdLevelBelow"
    commonRelease = "commonRelease"
    battleResultWin = "battleResultWin"
    battleResultLose = "battleResultLose"
    eventValueEqual = "eventValueEqual"
    boardGameTokenHaving = "boardGameTokenHaving"
    boardGameTokenGroupHaving = "boardGameTokenGroupHaving"
    eventFlagOn = "eventFlagOn"
    eventFlagOff = "eventFlagOff"
    questStatusFlagOn = "questStatusFlagOn"
    questStatusFlagOff = "questStatusFlagOff"
    eventValueNotEqual = "eventValueNotEqual"
    limitCountMaxEqual = "limitCountMaxEqual"
    limitCountMaxAbove = "limitCountMaxAbove"
    limitCountMaxBelow = "limitCountMaxBelow"
    boardGameTokenGetNum = "boardGameTokenGetNum"
    battleLineWinAbove = "battleLineWinAbove"
    battleLineLoseAbove = "battleLineLoseAbove"
    battleLineContinueWin = "battleLineContinueWin"
    battleLineContinueLose = "battleLineContinueLose"
    battleLineContinueWinBelow = "battleLineContinueWinBelow"
    battleLineContinueLoseBelow = "battleLineContinueLoseBelow"
    battleGroupWinAvove = "battleGroupWinAvove"
    battleGroupLoseAvove = "battleGroupLoseAvove"
    svtLimitClassNum = "svtLimitClassNum"
    overTimeLimitRaidAlive = "overTimeLimitRaidAlive"
    onTimeLimitRaidDead = "onTimeLimitRaidDead"
    onTimeLimitRaidDeadNum = "onTimeLimitRaidDeadNum"
    raidBattleProgressAbove = "raidBattleProgressAbove"
    svtEquipRarityLevelNum = "svtEquipRarityLevelNum"
    latestMainScenarioWarClear = "latestMainScenarioWarClear"
    eventMapValueContains = "eventMapValueContains"
    resetBirthDay = "resetBirthDay"
    shopFlagOn = "shopFlagOn"
    shopFlagOff = "shopFlagOff"
    purchaseValidShopGroup = "purchaseValidShopGroup"
    svtLevelClassNum = "svtLevelClassNum"
    svtLevelIdNum = "svtLevelIdNum"
    limitCountImageEqual = "limitCountImageEqual"
    limitCountImageAbove = "limitCountImageAbove"
    limitCountImageBelow = "limitCountImageBelow"
    eventTypeStartTimeToEndDate = "eventTypeStartTimeToEndDate"
    existBoxGachaScriptReplaceGiftId = "existBoxGachaScriptReplaceGiftId"
    notExistBoxGachaScriptReplaceGiftId = "notExistBoxGachaScriptReplaceGiftId"
    limitedPeriodVoiceChangeTypeOn = "limitedPeriodVoiceChangeTypeOn"
    startRandomMission = "startRandomMission"
    randomMissionClearNum = "randomMissionClearNum"
    progressValueEqual = "progressValueEqual"
    progressValueAbove = "progressValueAbove"
    progressValueBelow = "progressValueBelow"
    randomMissionTotalClearNum = "randomMissionTotalClearNum"
    weekdays = "weekdays"
    eventFortificationRewardNum = "eventFortificationRewardNum"
    questClearBeforeEventStart = "questClearBeforeEventStart"
    notQuestClearBeforeEventStart = "notQuestClearBeforeEventStart"
    eventTutorialFlagOn = "eventTutorialFlagOn"
    eventTutorialFlagOff = "eventTutorialFlagOff"
    eventSuperBossValueEqual = "eventSuperBossValueEqual"
    notEventSuperBossValueEqual = "notEventSuperBossValueEqual"
    allSvtTargetSkillLvNum = "allSvtTargetSkillLvNum"
    superBossDamageAbove = "superBossDamageAbove"
    superBossDamageBelow = "superBossDamageBelow"
    eventMissionGroupAchieve = "eventMissionGroupAchieve"
    svtFriendshipClassNumAbove = "svtFriendshipClassNumAbove"
    notWarClear = "notWarClear"
    svtSkillLvClassNumAbove = "svtSkillLvClassNumAbove"
    svtClassLvUpCount = "svtClassLvUpCount"
    svtClassSkillLvUpCount = "svtClassSkillLvUpCount"
    svtClassLimitUpCount = "svtClassLimitUpCount"
    svtClassFriendshipCount = "svtClassFriendshipCount"
    completeHeelPortrait = "completeHeelPortrait"
    notCompleteHeelPortrait = "notCompleteHeelPortrait"
    classBoardSquareReleased = "classBoardSquareReleased"
    svtLevelExchangeSvt = "svtLevelExchangeSvt"
    svtLimitExchangeSvt = "svtLimitExchangeSvt"
    skillLvExchangeSvt = "skillLvExchangeSvt"
    svtFriendshipExchangeSvt = "svtFriendshipExchangeSvt"
    exchangeSvt = "exchangeSvt"
    raidDamageAbove = "raidDamageAbove"
    raidDamageBelow = "raidDamageBelow"
    raidGroupDamageAbove = "raidGroupDamageAbove"
    raidGroupDamageBelow = "raidGroupDamageBelow"
    raidDamageRateAbove = "raidDamageRateAbove"
    raidDamageRateBelow = "raidDamageRateBelow"
    raidDamageRateNotAbove = "raidDamageRateNotAbove"
    raidDamageRateNotBelow = "raidDamageRateNotBelow"
    raidGroupDamageRateAbove = "raidGroupDamageRateAbove"
    raidGroupDamageRateBelow = "raidGroupDamageRateBelow"
    raidGroupDamageRateNotAbove = "raidGroupDamageRateNotAbove"
    raidGroupDamageRateNotBelow = "raidGroupDamageRateNotBelow"
    notQuestGroupClearNum = "notQuestGroupClearNum"
    raidGroupOpenAbove = "raidGroupOpenAbove"
    raidGroupOpenBelow = "raidGroupOpenBelow"
    treasureDeviceAccelerate = "treasureDeviceAccelerate"
    playQuestPhase = "playQuestPhase"
    notPlayQuestPhase = "notPlayQuestPhase"
    eventStartToEnd = "eventStartToEnd"
    commonValueAbove = "commonValueAbove"
    commonValueBelow = "commonValueBelow"
    commonValueEqual = "commonValueEqual"
    elapsedTimeAfterQuestClear = "elapsedTimeAfterQuestClear"
    withStartingMember = "withStartingMember"
    latestQuestPhaseEqual = "latestQuestPhaseEqual"
    notLatestQuestPhaseEqual = "notLatestQuestPhaseEqual"
    purchaseShopNum = "purchaseShopNum"
    eventTradeTotalNum = "eventTradeTotalNum"
    limitedMissionAchieveNumBelow = "limitedMissionAchieveNumBelow"
    limitedMissionAchieveNumAbove = "limitedMissionAchieveNumAbove"
    notSvtVoicePlayed = "notSvtVoicePlayed"
    battlePointAbove = "battlePointAbove"
    battlePointBelow = "battlePointBelow"
    beforeSpecifiedDate = "beforeSpecifiedDate"
    notHaveChargeStone = "notHaveChargeStone"
    haveChargeStone = "haveChargeStone"
    battleFunctionTargetAllIndividuality = "battleFunctionTargetAllIndividuality"
    battleFunctionTargetOneIndividuality = "battleFunctionTargetOneIndividuality"
    beforeQuestClearTime = "beforeQuestClearTime"
    afterQuestClearTime = "afterQuestClearTime"
    notBattleFunctionTargetAllIndividuality = "notBattleFunctionTargetAllIndividuality"
    notBattleFunctionTargetOneIndividuality = "notBattleFunctionTargetOneIndividuality"
    eventScriptNotPlay = "eventScriptNotPlay"
    eventScriptFlag = "eventScriptFlag"
    imagePartsGroup = "imagePartsGroup"
    userLevelAbove = "userLevelAbove"
    userLevelBelow = "userLevelBelow"
    userLevelEqual = "userLevelEqual"
    highestWaveAbove = "highestWaveAbove"
    highestWaveBelow = "highestWaveBelow"
    privilegeValid = "privilegeValid"
    privilegeInvalid = "privilegeInvalid"
    battleActionOpponentIndividuality = "battleActionOpponentIndividuality"
    notBattleActionOpponentIndividuality = "notBattleActionOpponentIndividuality"
    treasureDeviceOfSelectedCard = "treasureDeviceOfSelectedCard"
    battleSvtFriendshipAbove = "battleSvtFriendshipAbove"
    battleSvtFriendshipBelow = "battleSvtFriendshipBelow"
    elapsedTimeAfterSvtGet = "elapsedTimeAfterSvtGet"
    notElapsedTimeAfterQuestClear = "notElapsedTimeAfterQuestClear"
    notElapsedTimeAfterSvtGet = "notElapsedTimeAfterSvtGet"
    grandSvtSet = "grandSvtSet"
    playedMovie = "playedMovie"
    notPlayedMovie = "notPlayedMovie"
    notShopGroupLimitNum = "notShopGroupLimitNum"
    equipGet = "equipGet"
    notEquipGet = "notEquipGet"
    svtGetBeforeDate = "svtGetBeforeDate"
    svtGetAfterDate = "svtGetAfterDate"


COND_TYPE_NAME: dict[int, NiceCondType] = {
    0: NiceCondType.none,
    1: NiceCondType.questClear,
    2: NiceCondType.itemGet,
    3: NiceCondType.useItemEternity,
    4: NiceCondType.useItemTime,
    5: NiceCondType.useItemCount,
    6: NiceCondType.svtLevel,
    7: NiceCondType.svtLimit,
    8: NiceCondType.svtGet,
    9: NiceCondType.svtFriendship,
    10: NiceCondType.svtGroup,
    11: NiceCondType.event,
    12: NiceCondType.date,
    13: NiceCondType.weekday,
    14: NiceCondType.purchaseQpShop,
    15: NiceCondType.purchaseStoneShop,
    16: NiceCondType.warClear,
    17: NiceCondType.flag,
    18: NiceCondType.svtCountStop,
    19: NiceCondType.birthDay,
    20: NiceCondType.eventEnd,
    21: NiceCondType.svtEventJoin,
    22: NiceCondType.missionConditionDetail,
    23: NiceCondType.eventMissionClear,
    24: NiceCondType.eventMissionAchieve,
    25: NiceCondType.questClearNum,
    26: NiceCondType.notQuestGroupClear,
    27: NiceCondType.raidAlive,
    28: NiceCondType.raidDead,
    29: NiceCondType.raidDamage,
    30: NiceCondType.questChallengeNum,
    31: NiceCondType.masterMission,
    32: NiceCondType.questGroupClear,
    33: NiceCondType.superBossDamage,
    34: NiceCondType.superBossDamageAll,
    35: NiceCondType.purchaseShop,
    36: NiceCondType.questNotClear,
    37: NiceCondType.notShopPurchase,
    38: NiceCondType.notSvtGet,
    39: NiceCondType.notEventShopPurchase,
    40: NiceCondType.svtHaving,
    41: NiceCondType.notSvtHaving,
    42: NiceCondType.questChallengeNumEqual,
    43: NiceCondType.questChallengeNumBelow,
    44: NiceCondType.questClearNumEqual,
    45: NiceCondType.questClearNumBelow,
    46: NiceCondType.questClearPhase,
    47: NiceCondType.notQuestClearPhase,
    48: NiceCondType.eventPointGroupWin,
    49: NiceCondType.eventNormaPointClear,
    50: NiceCondType.questAvailable,
    51: NiceCondType.questGroupAvailableNum,
    52: NiceCondType.eventNormaPointNotClear,
    53: NiceCondType.notItemGet,
    54: NiceCondType.costumeGet,
    55: NiceCondType.questResetAvailable,
    56: NiceCondType.svtGetBeforeEventEnd,
    57: NiceCondType.questClearRaw,
    58: NiceCondType.questGroupClearRaw,
    59: NiceCondType.eventGroupPointRatioInTerm,
    60: NiceCondType.eventGroupRankInTerm,
    61: NiceCondType.notEventRaceQuestOrNotAllGroupGoal,
    62: NiceCondType.eventGroupTotalWinEachPlayer,
    63: NiceCondType.eventScriptPlay,
    64: NiceCondType.svtCostumeReleased,
    65: NiceCondType.questNotClearAnd,
    66: NiceCondType.svtRecoverd,
    67: NiceCondType.shopReleased,
    68: NiceCondType.eventPoint,
    69: NiceCondType.eventRewardDispCount,
    70: NiceCondType.equipWithTargetCostume,
    71: NiceCondType.raidGroupDead,
    72: NiceCondType.notSvtGroup,
    73: NiceCondType.notQuestResetAvailable,
    74: NiceCondType.notQuestClearRaw,
    75: NiceCondType.notQuestGroupClearRaw,
    76: NiceCondType.notEventMissionClear,
    77: NiceCondType.notEventMissionAchieve,
    78: NiceCondType.notCostumeGet,
    79: NiceCondType.notSvtCostumeReleased,
    80: NiceCondType.notEventRaceQuestOrNotTargetRankGoal,
    81: NiceCondType.playerGenderType,
    82: NiceCondType.shopGroupLimitNum,
    83: NiceCondType.eventGroupPoint,
    84: NiceCondType.eventGroupPointBelow,
    85: NiceCondType.eventTotalPoint,
    86: NiceCondType.eventTotalPointBelow,
    87: NiceCondType.eventValue,
    88: NiceCondType.eventValueBelow,
    89: NiceCondType.eventFlag,
    90: NiceCondType.eventStatus,
    91: NiceCondType.notEventStatus,
    92: NiceCondType.forceFalse,
    93: NiceCondType.svtHavingLimitMax,
    94: NiceCondType.eventPointBelow,
    95: NiceCondType.svtEquipFriendshipHaving,
    96: NiceCondType.movieNotDownload,
    97: NiceCondType.multipleDate,
    98: NiceCondType.svtFriendshipAbove,
    99: NiceCondType.svtFriendshipBelow,
    100: NiceCondType.movieDownloaded,
    101: NiceCondType.routeSelect,
    102: NiceCondType.notRouteSelect,
    103: NiceCondType.limitCount,
    104: NiceCondType.limitCountAbove,
    105: NiceCondType.limitCountBelow,
    106: NiceCondType.badEndPlay,
    107: NiceCondType.commandCodeGet,
    108: NiceCondType.notCommandCodeGet,
    109: NiceCondType.allUsersBoxGachaCount,
    110: NiceCondType.totalTdLevel,
    111: NiceCondType.totalTdLevelAbove,
    112: NiceCondType.totalTdLevelBelow,
    113: NiceCondType.commonRelease,
    114: NiceCondType.battleResultWin,
    115: NiceCondType.battleResultLose,
    116: NiceCondType.eventValueEqual,
    117: NiceCondType.boardGameTokenHaving,
    118: NiceCondType.boardGameTokenGroupHaving,
    119: NiceCondType.eventFlagOn,
    120: NiceCondType.eventFlagOff,
    121: NiceCondType.questStatusFlagOn,
    122: NiceCondType.questStatusFlagOff,
    123: NiceCondType.eventValueNotEqual,
    124: NiceCondType.limitCountMaxEqual,
    125: NiceCondType.limitCountMaxAbove,
    126: NiceCondType.limitCountMaxBelow,
    127: NiceCondType.boardGameTokenGetNum,
    128: NiceCondType.battleLineWinAbove,
    129: NiceCondType.battleLineLoseAbove,
    130: NiceCondType.battleLineContinueWin,
    131: NiceCondType.battleLineContinueLose,
    132: NiceCondType.battleLineContinueWinBelow,
    133: NiceCondType.battleLineContinueLoseBelow,
    134: NiceCondType.battleGroupWinAvove,
    135: NiceCondType.battleGroupLoseAvove,
    136: NiceCondType.svtLimitClassNum,
    137: NiceCondType.overTimeLimitRaidAlive,
    138: NiceCondType.onTimeLimitRaidDead,
    139: NiceCondType.onTimeLimitRaidDeadNum,
    140: NiceCondType.raidBattleProgressAbove,
    141: NiceCondType.svtEquipRarityLevelNum,
    142: NiceCondType.latestMainScenarioWarClear,
    143: NiceCondType.eventMapValueContains,
    144: NiceCondType.resetBirthDay,
    145: NiceCondType.shopFlagOn,
    146: NiceCondType.shopFlagOff,
    147: NiceCondType.purchaseValidShopGroup,
    148: NiceCondType.svtLevelClassNum,
    149: NiceCondType.svtLevelIdNum,
    150: NiceCondType.limitCountImageEqual,
    151: NiceCondType.limitCountImageAbove,
    152: NiceCondType.limitCountImageBelow,
    153: NiceCondType.eventTypeStartTimeToEndDate,
    154: NiceCondType.existBoxGachaScriptReplaceGiftId,
    155: NiceCondType.notExistBoxGachaScriptReplaceGiftId,
    156: NiceCondType.limitedPeriodVoiceChangeTypeOn,
    157: NiceCondType.startRandomMission,
    158: NiceCondType.randomMissionClearNum,
    159: NiceCondType.progressValueEqual,
    160: NiceCondType.progressValueAbove,
    161: NiceCondType.progressValueBelow,
    162: NiceCondType.randomMissionTotalClearNum,
    166: NiceCondType.weekdays,
    167: NiceCondType.eventFortificationRewardNum,
    168: NiceCondType.questClearBeforeEventStart,
    169: NiceCondType.notQuestClearBeforeEventStart,
    170: NiceCondType.eventTutorialFlagOn,
    171: NiceCondType.eventTutorialFlagOff,
    172: NiceCondType.eventSuperBossValueEqual,
    173: NiceCondType.notEventSuperBossValueEqual,
    174: NiceCondType.allSvtTargetSkillLvNum,
    175: NiceCondType.superBossDamageAbove,
    176: NiceCondType.superBossDamageBelow,
    177: NiceCondType.eventMissionGroupAchieve,
    178: NiceCondType.svtFriendshipClassNumAbove,
    179: NiceCondType.notWarClear,
    180: NiceCondType.svtSkillLvClassNumAbove,
    181: NiceCondType.svtClassLvUpCount,
    182: NiceCondType.svtClassSkillLvUpCount,
    183: NiceCondType.svtClassLimitUpCount,
    184: NiceCondType.svtClassFriendshipCount,
    185: NiceCondType.completeHeelPortrait,
    186: NiceCondType.notCompleteHeelPortrait,
    187: NiceCondType.classBoardSquareReleased,
    188: NiceCondType.svtLevelExchangeSvt,
    189: NiceCondType.svtLimitExchangeSvt,
    190: NiceCondType.skillLvExchangeSvt,
    191: NiceCondType.svtFriendshipExchangeSvt,
    192: NiceCondType.exchangeSvt,
    193: NiceCondType.raidDamageAbove,
    194: NiceCondType.raidDamageBelow,
    195: NiceCondType.raidGroupDamageAbove,
    196: NiceCondType.raidGroupDamageBelow,
    197: NiceCondType.raidDamageRateAbove,
    198: NiceCondType.raidDamageRateBelow,
    199: NiceCondType.raidDamageRateNotAbove,
    200: NiceCondType.raidDamageRateNotBelow,
    201: NiceCondType.raidGroupDamageRateAbove,
    202: NiceCondType.raidGroupDamageRateBelow,
    203: NiceCondType.raidGroupDamageRateNotAbove,
    204: NiceCondType.raidGroupDamageRateNotBelow,
    205: NiceCondType.notQuestGroupClearNum,
    206: NiceCondType.raidGroupOpenAbove,
    207: NiceCondType.raidGroupOpenBelow,
    208: NiceCondType.treasureDeviceAccelerate,
    209: NiceCondType.playQuestPhase,
    210: NiceCondType.notPlayQuestPhase,
    211: NiceCondType.eventStartToEnd,
    212: NiceCondType.commonValueAbove,
    213: NiceCondType.commonValueBelow,
    214: NiceCondType.commonValueEqual,
    215: NiceCondType.elapsedTimeAfterQuestClear,
    216: NiceCondType.withStartingMember,
    217: NiceCondType.latestQuestPhaseEqual,
    218: NiceCondType.notLatestQuestPhaseEqual,
    219: NiceCondType.purchaseShopNum,
    220: NiceCondType.eventTradeTotalNum,
    221: NiceCondType.limitedMissionAchieveNumBelow,
    222: NiceCondType.limitedMissionAchieveNumAbove,
    223: NiceCondType.notSvtVoicePlayed,
    225: NiceCondType.battlePointAbove,
    226: NiceCondType.battlePointBelow,
    228: NiceCondType.beforeSpecifiedDate,
    229: NiceCondType.notHaveChargeStone,
    230: NiceCondType.haveChargeStone,
    231: NiceCondType.battleFunctionTargetAllIndividuality,
    232: NiceCondType.battleFunctionTargetOneIndividuality,
    233: NiceCondType.beforeQuestClearTime,
    234: NiceCondType.afterQuestClearTime,
    235: NiceCondType.notBattleFunctionTargetAllIndividuality,
    236: NiceCondType.notBattleFunctionTargetOneIndividuality,
    237: NiceCondType.eventScriptNotPlay,
    238: NiceCondType.eventScriptFlag,
    241: NiceCondType.imagePartsGroup,
    242: NiceCondType.userLevelAbove,
    243: NiceCondType.userLevelBelow,
    244: NiceCondType.userLevelEqual,
    245: NiceCondType.highestWaveAbove,
    246: NiceCondType.highestWaveBelow,
    247: NiceCondType.privilegeValid,
    248: NiceCondType.privilegeInvalid,
    249: NiceCondType.battleActionOpponentIndividuality,
    250: NiceCondType.notBattleActionOpponentIndividuality,
    251: NiceCondType.treasureDeviceOfSelectedCard,
    252: NiceCondType.battleSvtFriendshipAbove,
    253: NiceCondType.battleSvtFriendshipBelow,
    254: NiceCondType.elapsedTimeAfterSvtGet,
    255: NiceCondType.notElapsedTimeAfterQuestClear,
    256: NiceCondType.notElapsedTimeAfterSvtGet,
    258: NiceCondType.grandSvtSet,
    259: NiceCondType.playedMovie,
    260: NiceCondType.notPlayedMovie,
    263: NiceCondType.notShopGroupLimitNum,
    264: NiceCondType.equipGet,
    265: NiceCondType.notEquipGet,
    266: NiceCondType.svtGetBeforeDate,
    267: NiceCondType.svtGetAfterDate,
}


class VoiceCondType(IntEnum):
    BIRTH_DAY = 1
    EVENT = 2
    FRIENDSHIP = 3
    SVT_GET = 4
    SVT_GROUP = 5
    QUEST_CLEAR = 6
    NOT_QUEST_CLEAR = 7
    LEVEL_UP = 8
    LIMIT_COUNT = 9
    LIMIT_COUNT_COMMON = 10
    COUNT_STOP = 11
    ISNEW_WAR = 12
    EVENT_END = 13
    EVENT_NOEND = 14
    EVENT_MISSION_ACTION = 15
    MASTER_MISSION = 16
    LIMIT_COUNT_ABOVE = 17
    EVENT_SHOP_PURCHASE = 18
    EVENT_PERIOD = 19
    FRIENDSHIP_ABOVE = 20
    SPACIFIC_SHOP_PURCHASE = 21
    FRIENDSHIP_BELOW = 22
    COSTUME = 23
    LEVEL_UP_LIMIT_COUNT = 24
    LEVEL_UP_LIMIT_COUNT_ABOVE = 25
    LEVEL_UP_LIMIT_COUNT_BELOW = 26
    SVT_EXCEED_COUNT = 41
    SVT_EXCEED_COUNT_ABOVE = 42
    SVT_EXCEED_COUNT_BELOW = 43


class NiceVoiceCondType(StrEnum):
    """Voice Condition Type Enum"""

    birthDay = "birthDay"
    event = "event"
    friendship = "friendship"
    svtGet = "svtGet"
    svtGroup = "svtGroup"
    questClear = "questClear"
    notQuestClear = "notQuestClear"
    levelUp = "levelUp"
    limitCount = "limitCount"
    limitCountCommon = "limitCountCommon"
    countStop = "countStop"
    isnewWar = "isnewWar"
    eventEnd = "eventEnd"
    eventNoend = "eventNoend"
    eventMissionAction = "eventMissionAction"
    masterMission = "masterMission"
    limitCountAbove = "limitCountAbove"
    eventShopPurchase = "eventShopPurchase"
    eventPeriod = "eventPeriod"
    friendshipAbove = "friendshipAbove"
    spacificShopPurchase = "spacificShopPurchase"
    friendshipBelow = "friendshipBelow"
    costume = "costume"
    levelUpLimitCount = "levelUpLimitCount"
    levelUpLimitCountAbove = "levelUpLimitCountAbove"
    levelUpLimitCountBelow = "levelUpLimitCountBelow"
    svtExceedCount = "svtExceedCount"
    svtExceedCountAbove = "svtExceedCountAbove"
    svtExceedCountBelow = "svtExceedCountBelow"
    unknown27 = "unknown27"
    unknown30 = "unknown30"
    unknown32 = "unknown32"
    unknown34 = "unknown34"
    unknown35 = "unknown35"
    unknown37 = "unknown37"
    unknown38 = "unknown38"
    unknown40 = "unknown40"
    unknown = "unknown"


VOICE_COND_NAME: dict[int, NiceVoiceCondType] = {
    1: NiceVoiceCondType.birthDay,
    2: NiceVoiceCondType.event,
    3: NiceVoiceCondType.friendship,
    4: NiceVoiceCondType.svtGet,
    5: NiceVoiceCondType.svtGroup,
    6: NiceVoiceCondType.questClear,
    7: NiceVoiceCondType.notQuestClear,
    8: NiceVoiceCondType.levelUp,
    9: NiceVoiceCondType.limitCount,
    10: NiceVoiceCondType.limitCountCommon,
    11: NiceVoiceCondType.countStop,
    12: NiceVoiceCondType.isnewWar,
    13: NiceVoiceCondType.eventEnd,
    14: NiceVoiceCondType.eventNoend,
    15: NiceVoiceCondType.eventMissionAction,
    16: NiceVoiceCondType.masterMission,
    17: NiceVoiceCondType.limitCountAbove,
    18: NiceVoiceCondType.eventShopPurchase,
    19: NiceVoiceCondType.eventPeriod,
    20: NiceVoiceCondType.friendshipAbove,
    21: NiceVoiceCondType.spacificShopPurchase,
    22: NiceVoiceCondType.friendshipBelow,
    23: NiceVoiceCondType.costume,
    24: NiceVoiceCondType.levelUpLimitCount,
    25: NiceVoiceCondType.levelUpLimitCountAbove,
    26: NiceVoiceCondType.levelUpLimitCountBelow,
    41: NiceVoiceCondType.svtExceedCount,
    42: NiceVoiceCondType.svtExceedCountAbove,
    43: NiceVoiceCondType.svtExceedCountBelow,
    27: NiceVoiceCondType.unknown27,
    30: NiceVoiceCondType.unknown30,
    32: NiceVoiceCondType.unknown32,
    34: NiceVoiceCondType.unknown34,
    35: NiceVoiceCondType.unknown35,
    37: NiceVoiceCondType.unknown37,
    38: NiceVoiceCondType.unknown38,
    40: NiceVoiceCondType.unknown40,
    -1: NiceVoiceCondType.unknown,
}


class SvtVoiceType(IntEnum):
    HOME = 1
    GROETH = 2
    FIRST_GET = 3
    EVENT_JOIN = 4
    EVENT_REWARD = 5
    BATTLE = 6
    TREASURE_DEVICE = 7
    MASTER_MISSION = 8
    EVENT_SHOP = 9
    HOME_COSTUME = 10
    BOX_GACHA_TALK = 11
    BATTLE_ENTRY = 12
    BATTLE_WIN = 13
    EVENT_TOWER_REWARD = 14
    GUIDE = 15
    EVENT_DAILY_POINT = 16
    TDDAMAGE = 17
    TREASURE_BOX = 18
    WAR_BOARD = 19
    EVENT_DIGGING = 20
    EVENT_EXPEDITION = 21
    EVENT_RECIPE = 22
    EVENT_FORTIFICATION = 23
    EVENT_TRADE = 24
    SUM = 25


class NiceSvtVoiceType(StrEnum):
    """Servant Voice Type Enum"""

    home = "home"
    groeth = "groeth"
    firstGet = "firstGet"
    eventJoin = "eventJoin"
    eventReward = "eventReward"
    battle = "battle"
    treasureDevice = "treasureDevice"
    masterMission = "masterMission"
    eventShop = "eventShop"
    homeCostume = "homeCostume"
    boxGachaTalk = "boxGachaTalk"
    battleEntry = "battleEntry"
    battleWin = "battleWin"
    eventTowerReward = "eventTowerReward"
    guide = "guide"
    eventDailyPoint = "eventDailyPoint"
    tddamage = "tddamage"
    treasureBox = "treasureBox"
    warBoard = "warBoard"
    eventDigging = "eventDigging"
    eventExpedition = "eventExpedition"
    eventRecipe = "eventRecipe"
    eventFortification = "eventFortification"
    eventTrade = "eventTrade"
    sum = "sum"


VOICE_TYPE_NAME: dict[int, NiceSvtVoiceType] = {
    1: NiceSvtVoiceType.home,
    2: NiceSvtVoiceType.groeth,
    3: NiceSvtVoiceType.firstGet,
    4: NiceSvtVoiceType.eventJoin,
    5: NiceSvtVoiceType.eventReward,
    6: NiceSvtVoiceType.battle,
    7: NiceSvtVoiceType.treasureDevice,
    8: NiceSvtVoiceType.masterMission,
    9: NiceSvtVoiceType.eventShop,
    10: NiceSvtVoiceType.homeCostume,
    11: NiceSvtVoiceType.boxGachaTalk,
    12: NiceSvtVoiceType.battleEntry,
    13: NiceSvtVoiceType.battleWin,
    14: NiceSvtVoiceType.eventTowerReward,
    15: NiceSvtVoiceType.guide,
    16: NiceSvtVoiceType.eventDailyPoint,
    17: NiceSvtVoiceType.tddamage,
    18: NiceSvtVoiceType.treasureBox,
    19: NiceSvtVoiceType.warBoard,
    20: NiceSvtVoiceType.eventDigging,
    21: NiceSvtVoiceType.eventExpedition,
    22: NiceSvtVoiceType.eventRecipe,
    23: NiceSvtVoiceType.eventFortification,
    24: NiceSvtVoiceType.eventTrade,
    25: NiceSvtVoiceType.sum,
}


class QuestType(IntEnum):
    MAIN = 1
    FREE = 2
    FRIENDSHIP = 3
    EVENT = 5
    HEROBALLAD = 6
    WAR_BOARD = 7
    AUTO_EXECUTE = 8


class NiceQuestType(StrEnum):
    """Quest Type Enum"""

    main = "main"
    free = "free"
    friendship = "friendship"
    event = "event"
    heroballad = "heroballad"
    warBoard = "warBoard"
    autoExecute = "autoExecute"


QUEST_TYPE_NAME: dict[int, NiceQuestType] = {
    1: NiceQuestType.main,
    2: NiceQuestType.free,
    3: NiceQuestType.friendship,
    5: NiceQuestType.event,
    6: NiceQuestType.heroballad,
    7: NiceQuestType.warBoard,
    8: NiceQuestType.autoExecute,
}


class QuestConsumeType(IntEnum):
    NONE = 0
    AP = 1
    RP = 2
    ITEM = 3
    AP_AND_ITEM = 4


class NiceConsumeType(StrEnum):
    """Consume Type Enum"""

    none = "none"
    ap = "ap"
    rp = "rp"
    item = "item"
    apAndItem = "apAndItem"


QUEST_CONSUME_TYPE_NAME: dict[int, NiceConsumeType] = {
    0: NiceConsumeType.none,
    1: NiceConsumeType.ap,
    2: NiceConsumeType.rp,
    3: NiceConsumeType.item,
    4: NiceConsumeType.apAndItem,
}


class QuestAfterClearType(IntEnum):
    CLOSE = 1
    REPEAT_FIRST = 2
    REPEAT_LAST = 3
    RESET_INTERVAL = 4
    CLOSE_DISP = 5


class NiceQuestAfterClearType(StrEnum):
    """Quest After Clear Enum"""

    close = "close"
    repeatFirst = "repeatFirst"
    repeatLast = "repeatLast"
    resetInterval = "resetInterval"
    closeDisp = "closeDisp"


QUEST_AFTER_CLEAR_NAME: dict[int, NiceQuestAfterClearType] = {
    1: NiceQuestAfterClearType.close,
    2: NiceQuestAfterClearType.repeatFirst,
    3: NiceQuestAfterClearType.repeatLast,
    4: NiceQuestAfterClearType.resetInterval,
    5: NiceQuestAfterClearType.closeDisp,
}


class QuestFlag(IntEnum):
    NONE = 1
    NO_BATTLE = 2
    RAID = 4
    RAID_CONNECTION = 8
    NO_CONTINUE = 16
    NO_DISPLAY_REMAIN = 32
    RAID_LAST_DAY = 64
    CLOSED_HIDE_COST_ITEM = 128
    CLOSED_HIDE_COST_NUM = 256
    CLOSED_HIDE_PROGRESS = 512
    CLOSED_HIDE_RECOMMEND_LV = 1024
    CLOSED_HIDE_TREND_CLASS = 2048
    CLOSED_HIDE_REWARD = 4096
    NO_DISPLAY_CONSUME = 8192
    SUPER_BOSS = 16384
    NO_DISPLAY_MISSION_NOTIFY = 32768
    HIDE_PROGRESS = 65536
    DROP_FIRST_TIME_ONLY = 131072
    CHAPTER_SUB_ID_JAPANESE_NUMERALS_CALLIGRAPHY = 262144
    SUPPORT_ONLY_FORCE_BATTLE = 524288
    EVENT_DECK_NO_SUPPORT = 1048576
    FATIGUE_BATTLE = 2097152
    SUPPORT_SELECT_AFTER_SCRIPT = 4194304
    BRANCH = 8388608
    USER_EVENT_DECK = 16777216
    NO_DISPLAY_RAID_REMAIN = 33554432
    QUEST_MAX_DAMAGE_RECORD = 67108864
    ENABLE_FOLLOW_QUEST = 134217728
    SUPPORT_SVT_MULTIPLE_SET = 268435456
    SUPPORT_ONLY_BATTLE = 536870912
    ACT_CONSUME_BATTLE_WIN = 1073741824
    VOTE = 2147483648
    HIDE_MASTER = 4294967296
    DISABLE_MASTER_SKILL = 8589934592
    DISABLE_COMMAND_SPEEL = 17179869184
    SUPPORT_SVT_EDITABLE_POSITION = 34359738368
    BRANCH_SCENARIO = 68719476736
    QUEST_KNOCKDOWN_RECORD = 137438953472
    NOT_RETRIEVABLE = 274877906944
    DISPLAY_LOOPMARK = 549755813888
    BOOST_ITEM_CONSUME_BATTLE_WIN = 1099511627776
    PLAY_SCENARIO_WITH_MAPSCREEN = 2199023255552
    BATTLE_RETREAT_QUEST_CLEAR = 4398046511104
    BATTLE_RESULT_LOSE_QUEST_CLEAR = 8796093022208
    BRANCH_HAVING = 35184372088832
    NO_DISPLAY_NEXT_ICON = 70368744177664
    WINDOW_ONLY = 140737488355328
    CHANGE_MASTERS = 281474976710656
    NOT_DISPLAY_RESULT_GET_POINT = 562949953421312
    FORCE_TO_NO_DROP = 1125899906842624
    DISPLAY_CONSUME_ICON = 2251799813685248
    HARVEST = 4503599627370496
    RECONSTRUCTION = 9007199254740992
    ENEMY_IMMEDIATE_APPEAR = 18014398509481984
    NO_SUPPORT_LIST = 36028797018963968
    LIVE = 72057594037927936
    FORCE_DISPLAY_ENEMY_INFO = 144115188075855872
    ALLOUT_BATTLE = 288230376151711744
    RECOLLECTION = 576460752303423488
    NOT_SINGLE_SUPPORT_ONLY = 1152921504606846976
    DISABLE_CHAPTER_SUB = 2305843009213693952


class NiceQuestFlag(StrEnum):
    """Quest Flag Enum"""

    none = "none"
    noBattle = "noBattle"
    raid = "raid"
    raidConnection = "raidConnection"
    noContinue = "noContinue"
    noDisplayRemain = "noDisplayRemain"
    raidLastDay = "raidLastDay"
    closedHideCostItem = "closedHideCostItem"
    closedHideCostNum = "closedHideCostNum"
    closedHideProgress = "closedHideProgress"
    closedHideRecommendLv = "closedHideRecommendLv"
    closedHideTrendClass = "closedHideTrendClass"
    closedHideReward = "closedHideReward"
    noDisplayConsume = "noDisplayConsume"
    superBoss = "superBoss"
    noDisplayMissionNotify = "noDisplayMissionNotify"
    hideProgress = "hideProgress"
    dropFirstTimeOnly = "dropFirstTimeOnly"
    chapterSubIdJapaneseNumeralsCalligraphy = "chapterSubIdJapaneseNumeralsCalligraphy"
    supportOnlyForceBattle = "supportOnlyForceBattle"
    eventDeckNoSupport = "eventDeckNoSupport"
    fatigueBattle = "fatigueBattle"
    supportSelectAfterScript = "supportSelectAfterScript"
    branch = "branch"
    userEventDeck = "userEventDeck"
    noDisplayRaidRemain = "noDisplayRaidRemain"
    questMaxDamageRecord = "questMaxDamageRecord"
    enableFollowQuest = "enableFollowQuest"
    supportSvtMultipleSet = "supportSvtMultipleSet"
    supportOnlyBattle = "supportOnlyBattle"
    actConsumeBattleWin = "actConsumeBattleWin"
    vote = "vote"
    hideMaster = "hideMaster"
    disableMasterSkill = "disableMasterSkill"
    disableCommandSpeel = "disableCommandSpeel"
    supportSvtEditablePosition = "supportSvtEditablePosition"
    branchScenario = "branchScenario"
    questKnockdownRecord = "questKnockdownRecord"
    notRetrievable = "notRetrievable"
    displayLoopmark = "displayLoopmark"
    boostItemConsumeBattleWin = "boostItemConsumeBattleWin"
    playScenarioWithMapscreen = "playScenarioWithMapscreen"
    battleRetreatQuestClear = "battleRetreatQuestClear"
    battleResultLoseQuestClear = "battleResultLoseQuestClear"
    branchHaving = "branchHaving"
    noDisplayNextIcon = "noDisplayNextIcon"
    windowOnly = "windowOnly"
    changeMasters = "changeMasters"
    notDisplayResultGetPoint = "notDisplayResultGetPoint"
    forceToNoDrop = "forceToNoDrop"
    displayConsumeIcon = "displayConsumeIcon"
    harvest = "harvest"
    reconstruction = "reconstruction"
    enemyImmediateAppear = "enemyImmediateAppear"
    noSupportList = "noSupportList"
    live = "live"
    forceDisplayEnemyInfo = "forceDisplayEnemyInfo"
    alloutBattle = "alloutBattle"
    recollection = "recollection"
    notSingleSupportOnly = "notSingleSupportOnly"
    disableChapterSub = "disableChapterSub"


Quest_FLAG_NAME: dict[int, NiceQuestFlag] = {
    1: NiceQuestFlag.none,
    2: NiceQuestFlag.noBattle,
    4: NiceQuestFlag.raid,
    8: NiceQuestFlag.raidConnection,
    16: NiceQuestFlag.noContinue,
    32: NiceQuestFlag.noDisplayRemain,
    64: NiceQuestFlag.raidLastDay,
    128: NiceQuestFlag.closedHideCostItem,
    256: NiceQuestFlag.closedHideCostNum,
    512: NiceQuestFlag.closedHideProgress,
    1024: NiceQuestFlag.closedHideRecommendLv,
    2048: NiceQuestFlag.closedHideTrendClass,
    4096: NiceQuestFlag.closedHideReward,
    8192: NiceQuestFlag.noDisplayConsume,
    16384: NiceQuestFlag.superBoss,
    32768: NiceQuestFlag.noDisplayMissionNotify,
    65536: NiceQuestFlag.hideProgress,
    131072: NiceQuestFlag.dropFirstTimeOnly,
    262144: NiceQuestFlag.chapterSubIdJapaneseNumeralsCalligraphy,
    524288: NiceQuestFlag.supportOnlyForceBattle,
    1048576: NiceQuestFlag.eventDeckNoSupport,
    2097152: NiceQuestFlag.fatigueBattle,
    4194304: NiceQuestFlag.supportSelectAfterScript,
    8388608: NiceQuestFlag.branch,
    16777216: NiceQuestFlag.userEventDeck,
    33554432: NiceQuestFlag.noDisplayRaidRemain,
    67108864: NiceQuestFlag.questMaxDamageRecord,
    134217728: NiceQuestFlag.enableFollowQuest,
    268435456: NiceQuestFlag.supportSvtMultipleSet,
    536870912: NiceQuestFlag.supportOnlyBattle,
    1073741824: NiceQuestFlag.actConsumeBattleWin,
    2147483648: NiceQuestFlag.vote,
    4294967296: NiceQuestFlag.hideMaster,
    8589934592: NiceQuestFlag.disableMasterSkill,
    17179869184: NiceQuestFlag.disableCommandSpeel,
    34359738368: NiceQuestFlag.supportSvtEditablePosition,
    68719476736: NiceQuestFlag.branchScenario,
    137438953472: NiceQuestFlag.questKnockdownRecord,
    274877906944: NiceQuestFlag.notRetrievable,
    549755813888: NiceQuestFlag.displayLoopmark,
    1099511627776: NiceQuestFlag.boostItemConsumeBattleWin,
    2199023255552: NiceQuestFlag.playScenarioWithMapscreen,
    4398046511104: NiceQuestFlag.battleRetreatQuestClear,
    8796093022208: NiceQuestFlag.battleResultLoseQuestClear,
    35184372088832: NiceQuestFlag.branchHaving,
    70368744177664: NiceQuestFlag.noDisplayNextIcon,
    140737488355328: NiceQuestFlag.windowOnly,
    281474976710656: NiceQuestFlag.changeMasters,
    562949953421312: NiceQuestFlag.notDisplayResultGetPoint,
    1125899906842624: NiceQuestFlag.forceToNoDrop,
    2251799813685248: NiceQuestFlag.displayConsumeIcon,
    4503599627370496: NiceQuestFlag.harvest,
    9007199254740992: NiceQuestFlag.reconstruction,
    18014398509481984: NiceQuestFlag.enemyImmediateAppear,
    36028797018963968: NiceQuestFlag.noSupportList,
    72057594037927936: NiceQuestFlag.live,
    144115188075855872: NiceQuestFlag.forceDisplayEnemyInfo,
    288230376151711744: NiceQuestFlag.alloutBattle,
    576460752303423488: NiceQuestFlag.recollection,
    1152921504606846976: NiceQuestFlag.notSingleSupportOnly,
    2305843009213693952: NiceQuestFlag.disableChapterSub,
}


class QuestGroupType(IntEnum):
    NONE = 0
    EVENT_QUEST = 1
    QUEST_RELEASE = 2
    EVENT_POINT_QUEST = 3
    EVENT_POINT_GROUP_QUEST = 4
    EVENT_RACE_QUEST = 5
    EVENT_RACE_GROUP_QUEST = 6
    MISSION_GROUP_QUEST = 7
    EVENT_TOWER = 8
    EVENT_TOWER_FLOOR = 9
    HIGHLIGHT_QUEST = 10
    EVENT_DAILY_POINT = 11
    EVENT_ACTIVITY_POINT_GAUGE = 12
    INTERLUDE = 13
    EVENT_BATTLE_LINE = 14
    BATTLE_GROUP = 15
    SHARE_QUEST_INFO = 16
    ALLOUT_BATTLE_QUEST = 17
    EVENT_FORTIFICATION = 18


class NiceQuestGroupType(StrEnum):
    """Quest Group Type"""

    none = "none"
    eventQuest = "eventQuest"
    questRelease = "questRelease"
    eventPointQuest = "eventPointQuest"
    eventPointGroupQuest = "eventPointGroupQuest"
    eventRaceQuest = "eventRaceQuest"
    eventRaceGroupQuest = "eventRaceGroupQuest"
    missionGroupQuest = "missionGroupQuest"
    eventTower = "eventTower"
    eventTowerFloor = "eventTowerFloor"
    highlightQuest = "highlightQuest"
    eventDailyPoint = "eventDailyPoint"
    eventActivityPointGauge = "eventActivityPointGauge"
    interlude = "interlude"
    eventBattleLine = "eventBattleLine"
    battleGroup = "battleGroup"
    shareQuestInfo = "shareQuestInfo"
    alloutBattleQuest = "alloutBattleQuest"
    eventFortification = "eventFortification"


Quest_GROUP_TYPE_NAME: dict[int, NiceQuestGroupType] = {
    0: NiceQuestGroupType.none,
    1: NiceQuestGroupType.eventQuest,
    2: NiceQuestGroupType.questRelease,
    3: NiceQuestGroupType.eventPointQuest,
    4: NiceQuestGroupType.eventPointGroupQuest,
    5: NiceQuestGroupType.eventRaceQuest,
    6: NiceQuestGroupType.eventRaceGroupQuest,
    7: NiceQuestGroupType.missionGroupQuest,
    8: NiceQuestGroupType.eventTower,
    9: NiceQuestGroupType.eventTowerFloor,
    10: NiceQuestGroupType.highlightQuest,
    11: NiceQuestGroupType.eventDailyPoint,
    12: NiceQuestGroupType.eventActivityPointGauge,
    13: NiceQuestGroupType.interlude,
    14: NiceQuestGroupType.eventBattleLine,
    15: NiceQuestGroupType.battleGroup,
    16: NiceQuestGroupType.shareQuestInfo,
    17: NiceQuestGroupType.alloutBattleQuest,
    18: NiceQuestGroupType.eventFortification,
}


class StatusRank(IntEnum):
    A = 11
    A_PLUS = 12
    A_PLUS2 = 13
    A_MINUS = 14
    A_PLUS3 = 15
    A_QUESTION = 16
    A_B = 17
    A_C = 18
    A_D = 19
    A_E = 20
    B = 21
    B_PLUS = 22
    B_PLUS2 = 23
    B_MINUS = 24
    B_PLUS3 = 25
    B_QUESTION = 26
    B_A = 27
    B_C = 28
    B_D = 29
    B_E = 30
    C = 31
    C_PLUS = 32
    C_PLUS2 = 33
    C_MINUS = 34
    C_PLUS3 = 35
    C_QUESTION = 36
    C_A = 37
    C_B = 38
    C_D = 39
    C_E = 40
    D = 41
    D_PLUS = 42
    D_PLUS2 = 43
    D_MINUS = 44
    D_PLUS3 = 45
    D_QUESTION = 46
    D_A = 47
    D_B = 48
    D_C = 49
    D_E = 50
    E = 51
    E_PLUS = 52
    E_PLUS2 = 53
    E_MINUS = 54
    E_PLUS3 = 55
    E_QUESTION = 56
    E_A = 57
    E_B = 58
    E_C = 59
    E_D = 60
    EX = 61
    QUESTION = 98
    NONE = 99


class NiceStatusRank(StrEnum):
    """Status Rank Enum"""

    a = "A"
    aPlus = "A+"
    aPlus2 = "A++"
    aMinus = "A-"
    aPlus3 = "A+++"
    aQuestion = "A?"
    aB = "A(B)"
    aC = "A(C)"
    aD = "A(D)"
    aE = "A(E)"
    b = "B"
    bPlus = "B+"
    bPlus2 = "B++"
    bMinus = "B-"
    bPlus3 = "B+++"
    bQuestion = "B?"
    bA = "B(A)"
    bC = "B(C)"
    bD = "B(D)"
    bE = "B(E)"
    c = "C"
    cPlus = "C+"
    cPlus2 = "C++"
    cMinus = "C-"
    cPlus3 = "C+++"
    cQuestion = "C?"
    cA = "C(A)"
    cB = "C(B)"
    cD = "C(D)"
    cE = "C(E)"
    d = "D"
    dPlus = "D+"
    dPlus2 = "D++"
    dMinus = "D-"
    dPlus3 = "D+++"
    dQuestion = "D?"
    dA = "D(A)"
    dB = "D(B)"
    dC = "D(C)"
    dE = "D(E)"
    e = "E"
    ePlus = "E+"
    ePlus2 = "E++"
    eMinus = "E-"
    ePlus3 = "E+++"
    eQuestion = "E?"
    eA = "E(A)"
    eB = "E(B)"
    eC = "E(C)"
    eD = "E(D)"
    ex = "EX"
    question = "?"
    none = "None"
    unknown = "Unknown"


STATUS_RANK_NAME: dict[int, NiceStatusRank] = {
    11: NiceStatusRank.a,
    12: NiceStatusRank.aPlus,
    13: NiceStatusRank.aPlus2,
    14: NiceStatusRank.aMinus,
    15: NiceStatusRank.aPlus3,
    16: NiceStatusRank.aQuestion,
    17: NiceStatusRank.aB,
    18: NiceStatusRank.aC,
    19: NiceStatusRank.aD,
    20: NiceStatusRank.aE,
    21: NiceStatusRank.b,
    22: NiceStatusRank.bPlus,
    23: NiceStatusRank.bPlus2,
    24: NiceStatusRank.bMinus,
    25: NiceStatusRank.bPlus3,
    26: NiceStatusRank.bQuestion,
    27: NiceStatusRank.bA,
    28: NiceStatusRank.bC,
    29: NiceStatusRank.bD,
    30: NiceStatusRank.bE,
    31: NiceStatusRank.c,
    32: NiceStatusRank.cPlus,
    33: NiceStatusRank.cPlus2,
    34: NiceStatusRank.cMinus,
    35: NiceStatusRank.cPlus3,
    36: NiceStatusRank.cQuestion,
    37: NiceStatusRank.cA,
    38: NiceStatusRank.cB,
    39: NiceStatusRank.cD,
    40: NiceStatusRank.cE,
    41: NiceStatusRank.d,
    42: NiceStatusRank.dPlus,
    43: NiceStatusRank.dPlus2,
    44: NiceStatusRank.dMinus,
    45: NiceStatusRank.dPlus3,
    46: NiceStatusRank.dQuestion,
    47: NiceStatusRank.dA,
    48: NiceStatusRank.dB,
    49: NiceStatusRank.dC,
    50: NiceStatusRank.dE,
    51: NiceStatusRank.e,
    52: NiceStatusRank.ePlus,
    53: NiceStatusRank.ePlus2,
    54: NiceStatusRank.eMinus,
    55: NiceStatusRank.ePlus3,
    56: NiceStatusRank.eQuestion,
    57: NiceStatusRank.eA,
    58: NiceStatusRank.eB,
    59: NiceStatusRank.eC,
    60: NiceStatusRank.eD,
    61: NiceStatusRank.ex,
    98: NiceStatusRank.question,
    99: NiceStatusRank.none,
    -1: NiceStatusRank.unknown,
}


class EventType(IntEnum):
    NONE = 0
    RAID_BOSS = 1
    PVP = 2
    POINT = 3
    LOGIN_BONUS = 4
    COMBINE_CAMPAIGN = 5
    SHOP = 6
    QUEST_CAMPAIGN = 7
    BANK = 8
    SERIAL_CAMPAIGN = 9
    LOGIN_CAMPAIGN = 10
    LOGIN_CAMPAIGN_REPEAT = 11
    EVENT_QUEST = 12
    SVTEQUIP_COMBINE_CAMPAIGN = 13
    TERMINAL_BANNER = 14
    BOX_GACHA = 15
    BOX_GACHA_POINT = 16
    LOGIN_CAMPAIGN_STRICT = 17
    TOTAL_LOGIN = 18
    COMEBACK_CAMPAIGN = 19
    LOCATION_CAMPAIGN = 20
    WAR_BOARD = 22
    COMBINE_COSUTUME_ITEM = 23
    MYROOM_MULTIPLE_VIEW_CAMPAIGN = 24
    INTERLUDE_CAMPAIGN = 25
    MYROOM_PHOTO_CAMPAIGN = 26


class NiceEventType(StrEnum):
    """Event Type Enum"""

    none = "none"
    raidBoss = "raidBoss"
    pvp = "pvp"
    point = "point"
    loginBonus = "loginBonus"
    combineCampaign = "combineCampaign"
    shop = "shop"
    questCampaign = "questCampaign"
    bank = "bank"
    serialCampaign = "serialCampaign"
    loginCampaign = "loginCampaign"
    loginCampaignRepeat = "loginCampaignRepeat"
    eventQuest = "eventQuest"
    svtequipCombineCampaign = "svtequipCombineCampaign"
    terminalBanner = "terminalBanner"
    boxGacha = "boxGacha"
    boxGachaPoint = "boxGachaPoint"
    loginCampaignStrict = "loginCampaignStrict"
    totalLogin = "totalLogin"
    comebackCampaign = "comebackCampaign"
    locationCampaign = "locationCampaign"
    warBoard = "warBoard"
    combineCosutumeItem = "combineCosutumeItem"
    myroomMultipleViewCampaign = "myroomMultipleViewCampaign"
    interludeCampaign = "interludeCampaign"
    myroomPhotoCampaign = "myroomPhotoCampaign"
    fortuneCampaign = "fortuneCampaign"
    genderSelection = "genderSelection"


EVENT_TYPE_NAME: dict[int, NiceEventType] = {
    0: NiceEventType.none,
    1: NiceEventType.raidBoss,
    2: NiceEventType.pvp,
    3: NiceEventType.point,
    4: NiceEventType.loginBonus,
    5: NiceEventType.combineCampaign,
    6: NiceEventType.shop,
    7: NiceEventType.questCampaign,
    8: NiceEventType.bank,
    9: NiceEventType.serialCampaign,
    10: NiceEventType.loginCampaign,
    11: NiceEventType.loginCampaignRepeat,
    12: NiceEventType.eventQuest,
    13: NiceEventType.svtequipCombineCampaign,
    14: NiceEventType.terminalBanner,
    15: NiceEventType.boxGacha,
    16: NiceEventType.boxGachaPoint,
    17: NiceEventType.loginCampaignStrict,
    18: NiceEventType.totalLogin,
    19: NiceEventType.comebackCampaign,
    20: NiceEventType.locationCampaign,
    22: NiceEventType.warBoard,
    23: NiceEventType.combineCosutumeItem,
    24: NiceEventType.myroomMultipleViewCampaign,
    25: NiceEventType.interludeCampaign,
    26: NiceEventType.myroomPhotoCampaign,
    27: NiceEventType.fortuneCampaign,
    28: NiceEventType.genderSelection,
    21: NiceEventType.comebackCampaign,
}


class EventFlag(IntEnum):
    TYPE_POINT = 1
    TYPE_EXCHANGE_SHOP = 2
    TYPE_BOX_GACHA = 4
    TYPE_RANKING = 8
    TYPE_BONUS_SKILL = 16
    TYPE_MISSION = 32
    TYPE_RAID = 64
    TYPE_EVENT_SHOP = 128
    MATERIAL_ADD_QUEST_GROUP = 256
    MATERIAL_ADD_EVENT_END = 512
    SUPER_BOSS = 1024
    RAID_DEFEAT_COUNT = 2048
    BP = 4096
    NO_MATERIAL_BANNER = 8192
    EVENT_POINT = 16384
    EVENT_GROUP_POINT = 32768
    EVENT_VOICE_PLAY = 65536
    DAILY_MISSION = 131072
    EVENT_GROUP_RANKING = 262144
    EVENT_TOWER = 524288
    EVENT_FATIGUE = 1048576
    NO_DISP_ARROW = 2097152
    FORCED_ADJUSTMENT_DIALOG = 4194304
    SHIFT_HELP_INFO = 8388608
    CLOSE_PURCHASE_SHOP = 16777216
    TIME_STATUS_RECORD = 33554432
    USE_EVENT_SUPPORT_DECK = 67108864
    EVENT_DAIRY_POINT = 134217728
    EVENT_ACTIVITY_POINT = 268435456
    EVENT_ONLY_EQUIP = 536870912
    MAP_SWITCH_BUTTON_TOP = 1073741824
    EVENT_REVIVAL = 2147483648
    EVENT_CONQUEST = 4294967296
    EVENT_POINT_BY_QP = 8589934592
    ALL_USERS_BOX_GACHA_COUNT = 17179869184
    NOT_DISPLAY_BONUS_ON_SUPPORT_SET = 34359738368
    FRIEND_POINT_BOOST_ITEM = 68719476736
    EVENT_BOARD_GAME = 137438953472
    NOT_DISPLAY_DA_VINCI = 274877906944
    IS_MAIN_INTERLUDE = 549755813888
    QUEST_COOLTIME = 2199023255552
    EVENT_PANEL = 4398046511104
    EVENT_ASSIST = 8796093022208
    TREASURE_BOX = 17592186044416
    HIDE_AFTER_PURCHASE = 35184372088832
    ALLOUT_BATTLE = 70368744177664
    SPOT_COOLTIME = 140737488355328


class NiceEventFlag(StrEnum):
    """Event Flag Enum"""

    typePoint = "typePoint"
    typeExchangeShop = "typeExchangeShop"
    typeBoxGacha = "typeBoxGacha"
    typeRanking = "typeRanking"
    typeBonusSkill = "typeBonusSkill"
    typeMission = "typeMission"
    typeRaid = "typeRaid"
    typeEventShop = "typeEventShop"
    materialAddQuestGroup = "materialAddQuestGroup"
    materialAddEventEnd = "materialAddEventEnd"
    superBoss = "superBoss"
    raidDefeatCount = "raidDefeatCount"
    bp = "bp"
    noMaterialBanner = "noMaterialBanner"
    eventPoint = "eventPoint"
    eventGroupPoint = "eventGroupPoint"
    eventVoicePlay = "eventVoicePlay"
    dailyMission = "dailyMission"
    eventGroupRanking = "eventGroupRanking"
    eventTower = "eventTower"
    eventFatigue = "eventFatigue"
    noDispArrow = "noDispArrow"
    forcedAdjustmentDialog = "forcedAdjustmentDialog"
    shiftHelpInfo = "shiftHelpInfo"
    closePurchaseShop = "closePurchaseShop"
    timeStatusRecord = "timeStatusRecord"
    useEventSupportDeck = "useEventSupportDeck"
    eventDairyPoint = "eventDairyPoint"
    eventActivityPoint = "eventActivityPoint"
    eventOnlyEquip = "eventOnlyEquip"
    mapSwitchButtonTop = "mapSwitchButtonTop"
    eventRevival = "eventRevival"
    eventConquest = "eventConquest"
    eventPointByQp = "eventPointByQp"
    allUsersBoxGachaCount = "allUsersBoxGachaCount"
    notDisplayBonusOnSupportSet = "notDisplayBonusOnSupportSet"
    friendPointBoostItem = "friendPointBoostItem"
    eventBoardGame = "eventBoardGame"
    notDisplayDaVinci = "notDisplayDaVinci"
    isMainInterlude = "isMainInterlude"
    questCooltime = "questCooltime"
    eventPanel = "eventPanel"
    eventAssist = "eventAssist"
    treasureBox = "treasureBox"
    hideAfterPurchase = "hideAfterPurchase"
    alloutBattle = "alloutBattle"
    spotCooltime = "spotCooltime"


EVENT_FLAG_NAME: dict[int, NiceEventFlag] = {
    1: NiceEventFlag.typePoint,
    2: NiceEventFlag.typeExchangeShop,
    4: NiceEventFlag.typeBoxGacha,
    8: NiceEventFlag.typeRanking,
    16: NiceEventFlag.typeBonusSkill,
    32: NiceEventFlag.typeMission,
    64: NiceEventFlag.typeRaid,
    128: NiceEventFlag.typeEventShop,
    256: NiceEventFlag.materialAddQuestGroup,
    512: NiceEventFlag.materialAddEventEnd,
    1024: NiceEventFlag.superBoss,
    2048: NiceEventFlag.raidDefeatCount,
    4096: NiceEventFlag.bp,
    8192: NiceEventFlag.noMaterialBanner,
    16384: NiceEventFlag.eventPoint,
    32768: NiceEventFlag.eventGroupPoint,
    65536: NiceEventFlag.eventVoicePlay,
    131072: NiceEventFlag.dailyMission,
    262144: NiceEventFlag.eventGroupRanking,
    524288: NiceEventFlag.eventTower,
    1048576: NiceEventFlag.eventFatigue,
    2097152: NiceEventFlag.noDispArrow,
    4194304: NiceEventFlag.forcedAdjustmentDialog,
    8388608: NiceEventFlag.shiftHelpInfo,
    16777216: NiceEventFlag.closePurchaseShop,
    33554432: NiceEventFlag.timeStatusRecord,
    67108864: NiceEventFlag.useEventSupportDeck,
    134217728: NiceEventFlag.eventDairyPoint,
    268435456: NiceEventFlag.eventActivityPoint,
    536870912: NiceEventFlag.eventOnlyEquip,
    1073741824: NiceEventFlag.mapSwitchButtonTop,
    2147483648: NiceEventFlag.eventRevival,
    4294967296: NiceEventFlag.eventConquest,
    8589934592: NiceEventFlag.eventPointByQp,
    17179869184: NiceEventFlag.allUsersBoxGachaCount,
    34359738368: NiceEventFlag.notDisplayBonusOnSupportSet,
    68719476736: NiceEventFlag.friendPointBoostItem,
    137438953472: NiceEventFlag.eventBoardGame,
    274877906944: NiceEventFlag.notDisplayDaVinci,
    549755813888: NiceEventFlag.isMainInterlude,
    2199023255552: NiceEventFlag.questCooltime,
    4398046511104: NiceEventFlag.eventPanel,
    8796093022208: NiceEventFlag.eventAssist,
    17592186044416: NiceEventFlag.treasureBox,
    35184372088832: NiceEventFlag.hideAfterPurchase,
    70368744177664: NiceEventFlag.alloutBattle,
    140737488355328: NiceEventFlag.spotCooltime,
}


class EventOverwriteType(IntEnum):
    BG_IMAGE = 1
    BGM = 2
    NAME = 3
    BANNER = 4
    NOTICE_BANNER = 5


class NiceEventOverwriteType(StrEnum):
    """Event Overwrite Type Enum"""

    bgImage = "bgImage"
    bgm = "bgm"
    name_ = "name"
    banner = "banner"
    noticeBanner = "noticeBanner"


EVENT_OVERWRITE_TYPE_NAME: dict[int, NiceEventOverwriteType] = {
    1: NiceEventOverwriteType.bgImage,
    2: NiceEventOverwriteType.bgm,
    3: NiceEventOverwriteType.name_,
    4: NiceEventOverwriteType.banner,
    5: NiceEventOverwriteType.noticeBanner,
}


class WarEntityFlag(IntEnum):
    WITH_MAP = 2
    SHOW_ON_MATERIAL = 4
    FOLDER_SORT_PRIOR = 8
    STORY_SHORTCUT = 16
    IS_EVENT = 32
    CLOSE_AFTER_CLEAR = 64
    MAIN_SCENARIO = 128
    IS_WAR_ICON_LEFT = 256
    CLEARED_RETURN_TO_TITLE = 512
    NO_CLEAR_MARK_WITH_CLEAR = 1024
    NO_CLEAR_MARK_WITH_COMPLETE = 2048
    NOT_ENTRY_BANNER_ACTIVE = 4096
    SHOP = 8192
    BLACK_MARK_WITH_CLEAR = 16384
    DISP_FIRST_QUEST = 32768
    EFFECT_DISAPPEAR_BANNER = 65536
    WHITE_MARK_WITH_CLEAR = 131072
    WHITE_MARK_UNDER_BOARD = 262144
    SUB_FOLDER = 524288
    DISP_EARTH_POINT_WITHOUT_MAP = 1048576
    IS_WAR_ICON_FREE = 2097152
    IS_WAR_ICON_CENTER = 4194304
    NOTICE_BOARD = 8388608
    CHANGE_DISP_CLOSED_MESSAGE = 16777216
    CHAPTER_SUB_ID_JAPANESE_NUMERALS_NORMAL = 33554432
    CALDEAGATE_PRIORITY_DISPLAY = 67108864
    AREA_BOARD_SHORTCUT = 134217728


class NiceWarFlag(StrEnum):
    """War Flag Enum"""

    withMap = "withMap"
    showOnMaterial = "showOnMaterial"
    folderSortPrior = "folderSortPrior"
    storyShortcut = "storyShortcut"
    isEvent = "isEvent"
    closeAfterClear = "closeAfterClear"
    mainScenario = "mainScenario"
    isWarIconLeft = "isWarIconLeft"
    clearedReturnToTitle = "clearedReturnToTitle"
    noClearMarkWithClear = "noClearMarkWithClear"
    noClearMarkWithComplete = "noClearMarkWithComplete"
    notEntryBannerActive = "notEntryBannerActive"
    shop = "shop"
    blackMarkWithClear = "blackMarkWithClear"
    dispFirstQuest = "dispFirstQuest"
    effectDisappearBanner = "effectDisappearBanner"
    whiteMarkWithClear = "whiteMarkWithClear"
    whiteMarkUnderBoard = "whiteMarkUnderBoard"
    subFolder = "subFolder"
    dispEarthPointWithoutMap = "dispEarthPointWithoutMap"
    isWarIconFree = "isWarIconFree"
    isWarIconCenter = "isWarIconCenter"
    noticeBoard = "noticeBoard"
    changeDispClosedMessage = "changeDispClosedMessage"
    chapterSubIdJapaneseNumeralsNormal = "chapterSubIdJapaneseNumeralsNormal"
    caldeagatePriorityDisplay = "caldeagatePriorityDisplay"
    areaBoardShortcut = "areaBoardShortcut"


WAR_FLAG_NAME: dict[int, NiceWarFlag] = {
    2: NiceWarFlag.withMap,
    4: NiceWarFlag.showOnMaterial,
    8: NiceWarFlag.folderSortPrior,
    16: NiceWarFlag.storyShortcut,
    32: NiceWarFlag.isEvent,
    64: NiceWarFlag.closeAfterClear,
    128: NiceWarFlag.mainScenario,
    256: NiceWarFlag.isWarIconLeft,
    512: NiceWarFlag.clearedReturnToTitle,
    1024: NiceWarFlag.noClearMarkWithClear,
    2048: NiceWarFlag.noClearMarkWithComplete,
    4096: NiceWarFlag.notEntryBannerActive,
    8192: NiceWarFlag.shop,
    16384: NiceWarFlag.blackMarkWithClear,
    32768: NiceWarFlag.dispFirstQuest,
    65536: NiceWarFlag.effectDisappearBanner,
    131072: NiceWarFlag.whiteMarkWithClear,
    262144: NiceWarFlag.whiteMarkUnderBoard,
    524288: NiceWarFlag.subFolder,
    1048576: NiceWarFlag.dispEarthPointWithoutMap,
    2097152: NiceWarFlag.isWarIconFree,
    4194304: NiceWarFlag.isWarIconCenter,
    8388608: NiceWarFlag.noticeBoard,
    16777216: NiceWarFlag.changeDispClosedMessage,
    33554432: NiceWarFlag.chapterSubIdJapaneseNumeralsNormal,
    67108864: NiceWarFlag.caldeagatePriorityDisplay,
    134217728: NiceWarFlag.areaBoardShortcut,
}


class WarEntityStartType(IntEnum):
    NONE = 0
    SCRIPT = 1
    QUEST = 2


class NiceWarStartType(StrEnum):
    """War Start Type Enum"""

    none = "none"
    script = "script"
    quest = "quest"


WAR_START_TYPE_NAME: dict[int, NiceWarStartType] = {
    0: NiceWarStartType.none,
    1: NiceWarStartType.script,
    2: NiceWarStartType.quest,
}


class WarOverwriteType(IntEnum):
    BGM = 1
    PARENT_WAR = 2
    BANNER = 3
    BG_IMAGE = 4
    SVT_IMAGE = 5
    FLAG = 6
    BASE_MAP_ID = 7
    NAME = 8
    LONG_NAME = 9
    MATERIAL_PARENT_WAR = 10
    COORDINATES = 11
    EFFECT_CHANGE_BLACK_MARK = 12
    QUEST_BOARD_SECTION_IMAGE = 13
    WAR_FORCE_DISP = 14
    WAR_FORCE_HIDE = 15
    START_TYPE = 16
    NOTICE_DIALOG_TEXT = 17
    CLEAR_MARK = 18
    EFFECT_CHANGE_WHITE_MARK = 19
    COMMAND_SPELL_ICON = 20
    MASTER_FACE_ICON = 21
    PRIORITY = 22


class NiceWarOverwriteType(StrEnum):
    """War Overwrite Type Enum"""

    bgm = "bgm"
    parentWar = "parentWar"
    banner = "banner"
    bgImage = "bgImage"
    svtImage = "svtImage"
    flag = "flag"
    baseMapId = "baseMapId"
    name_ = "name"
    longName = "longName"
    materialParentWar = "materialParentWar"
    coordinates = "coordinates"
    effectChangeBlackMark = "effectChangeBlackMark"
    questBoardSectionImage = "questBoardSectionImage"
    warForceDisp = "warForceDisp"
    warForceHide = "warForceHide"
    startType = "startType"
    noticeDialogText = "noticeDialogText"
    clearMark = "clearMark"
    effectChangeWhiteMark = "effectChangeWhiteMark"
    commandSpellIcon = "commandSpellIcon"
    masterFaceIcon = "masterFaceIcon"
    priority = "priority"


WAR_OVERWRITE_TYPE_NAME: dict[int, NiceWarOverwriteType] = {
    1: NiceWarOverwriteType.bgm,
    2: NiceWarOverwriteType.parentWar,
    3: NiceWarOverwriteType.banner,
    4: NiceWarOverwriteType.bgImage,
    5: NiceWarOverwriteType.svtImage,
    6: NiceWarOverwriteType.flag,
    7: NiceWarOverwriteType.baseMapId,
    8: NiceWarOverwriteType.name_,
    9: NiceWarOverwriteType.longName,
    10: NiceWarOverwriteType.materialParentWar,
    11: NiceWarOverwriteType.coordinates,
    12: NiceWarOverwriteType.effectChangeBlackMark,
    13: NiceWarOverwriteType.questBoardSectionImage,
    14: NiceWarOverwriteType.warForceDisp,
    15: NiceWarOverwriteType.warForceHide,
    16: NiceWarOverwriteType.startType,
    17: NiceWarOverwriteType.noticeDialogText,
    18: NiceWarOverwriteType.clearMark,
    19: NiceWarOverwriteType.effectChangeWhiteMark,
    20: NiceWarOverwriteType.commandSpellIcon,
    21: NiceWarOverwriteType.masterFaceIcon,
    22: NiceWarOverwriteType.priority,
}


class AiCond(IntEnum):
    NONE = 0
    HP_HIGHER = 10
    HP_LOWER = 11
    ACTCOUNT = 20
    ACTCOUNT_MULTIPLE = 21
    TURN = 30
    TURN_MULTIPLE = 31
    BEFORE_ACT_ID = 40
    BEFORE_ACT_TYPE = 41
    BEFORE_NOT_ACT_ID = 42
    BEFORE_NOT_ACT_TYPE = 43
    CHECK_SELF_BUFF = 50
    CHECK_SELF_INDIVIDUALITY = 51
    CHECK_PT_BUFF = 52
    CHECK_PT_INDIVIDUALITY = 53
    CHECK_OPPONENT_BUFF = 55
    CHECK_OPPONENT_INDIVIDUALITY = 56
    CHECK_SELF_BUFF_INDIVIDUALITY = 57
    CHECK_PT_BUFF_INDIVIDUALITY = 58
    CHECK_OPPONENT_BUFF_INDIVIDUALITY = 59
    CHECK_SELF_NPTURN = 60
    CHECK_PT_LOWER_NPTURN = 61
    CHECK_OPPONENT_HEIGHT_NPGAUGE = 62
    ACTCOUNT_THISTURN = 63
    CHECK_PT_HP_HIGHER = 64
    CHECK_PT_HP_LOWER = 65
    CHECK_SELF_NOT_BUFF_INDIVIDUALITY = 66
    TURN_AND_ACTCOUNT_THISTURN = 67
    FIELDTURN = 68
    FIELDTURN_MULTIPLE = 69
    CHECK_PT_LOWER_TDTURN = 70
    RAID_HP_HIGHER = 71
    RAID_HP_LOWER = 72
    RAID_COUNT_HIGHER = 73
    RAID_COUNT_LOWER = 74
    RAID_COUNT_VALUE_HIGHER = 75
    RAID_COUNT_VALUE_LOWER = 76
    CHECK_SPACE = 77
    TURN_HIGHER = 78
    TURN_LOWER = 79
    CHARACTOR_TURN_HIGHER = 80
    CHARACTOR_TURN_LOWER = 81
    COUNT_ALIVE_PT = 82
    COUNT_ALIVE_OPPONENT = 83
    COUNT_PT_REST_HIGHER = 84
    COUNT_PT_REST_LOWER = 85
    COUNT_OPPONENT_REST_HIGHER = 86
    COUNT_OPPONENT_REST_LOWER = 87
    COUNT_ITEM_HIGHER = 88
    COUNT_ITEM_LOWER = 89
    CHECK_SELF_BUFFCOUNT_INDIVIDUALITY = 90
    CHECK_PT_BUFFCOUNT_INDIVIDUALITY = 91
    CHECK_SELF_BUFF_ACTIVE = 92
    CHECK_PT_BUFF_ACTIVE = 93
    CHECK_OPPONENT_BUFF_ACTIVE = 94
    COUNT_ENEMY_COMMAND_SPELL_HIGHER = 95
    CHECK_PT_ALL_INDIVIDUALITY = 96
    CHECK_OPPONENT_ALL_INDIVIDUALITY = 97
    STAR_HIGHER = 98
    STAR_LOWER = 99
    CHECK_OPPONENT_HP_HIGHER = 100
    CHECK_OPPONENT_HP_LOWER = 101
    CHECK_TARGET_POSITION = 102
    CHECK_SELF_BUFF_ACTIVE_AND_PASSIVE_INDIVIDUALITY = 103
    CHECK_PT_BUFF_ACTIVE_AND_PASSIVE_INDIVIDUALITY = 104
    CHECK_OPPONENT_BUFF_ACTIVE_AND_PASSIVE_INDIVIDUALITY = 105
    CHECK_PT_ALL_BUFF = 106
    CHECK_OPPONENT_ALL_BUFF = 107
    CHECK_PT_ALL_BUFF_INDIVIDUALITY = 108
    CHECK_OPPONENT_ALL_BUFF_INDIVIDUALITY = 109
    COUNT_ALIVE_PT_ALL = 110
    COUNT_ALIVE_OPPONENT_ALL = 111
    CHECK_PT_ALL_BUFF_ACTIVE = 112
    CHECK_OPPONENT_ALL_BUFF_ACTIVE = 113
    COUNT_HIGHER_BUFF_INDIVIDUALITY_SUM_PT = 114
    COUNT_HIGHER_BUFF_INDIVIDUALITY_SUM_PT_ALL = 115
    COUNT_HIGHER_BUFF_INDIVIDUALITY_SUM_OPPONENT = 116
    COUNT_HIGHER_BUFF_INDIVIDUALITY_SUM_OPPONENT_ALL = 117
    COUNT_HIGHER_BUFF_INDIVIDUALITY_SUM_SELF = 118
    COUNT_LOWER_BUFF_INDIVIDUALITY_SUM_PT = 119
    COUNT_LOWER_BUFF_INDIVIDUALITY_SUM_PT_ALL = 120
    COUNT_LOWER_BUFF_INDIVIDUALITY_SUM_OPPONENT = 121
    COUNT_LOWER_BUFF_INDIVIDUALITY_SUM_OPPONENT_ALL = 122
    COUNT_LOWER_BUFF_INDIVIDUALITY_SUM_SELF = 123
    COUNT_EQUAL_BUFF_INDIVIDUALITY_SUM_PT = 124
    COUNT_EQUAL_BUFF_INDIVIDUALITY_SUM_PT_ALL = 125
    COUNT_EQUAL_BUFF_INDIVIDUALITY_SUM_OPPONENT = 126
    COUNT_EQUAL_BUFF_INDIVIDUALITY_SUM_OPPONENT_ALL = 127
    COUNT_EQUAL_BUFF_INDIVIDUALITY_SUM_SELF = 128
    EXIST_INDIVIDUALITY_OPPONENT_FRONT = 129
    EXIST_INDIVIDUALITY_OPPONENT_CENTER = 130
    EXIST_INDIVIDUALITY_OPPONENT_BACK = 131
    TOTAL_COUNT_HIGHER_INDIVIDUALITY_PT = 132
    TOTAL_COUNT_HIGHER_INDIVIDUALITY_PT_ALL = 133
    TOTAL_COUNT_HIGHER_INDIVIDUALITY_OPPONENT = 134
    TOTAL_COUNT_HIGHER_INDIVIDUALITY_OPPONENT_ALL = 135
    TOTAL_COUNT_HIGHER_INDIVIDUALITY_ALL_FIELD = 136
    TOTAL_COUNT_LOWER_INDIVIDUALITY_PT = 137
    TOTAL_COUNT_LOWER_INDIVIDUALITY_PT_ALL = 138
    TOTAL_COUNT_LOWER_INDIVIDUALITY_OPPONENT = 139
    TOTAL_COUNT_LOWER_INDIVIDUALITY_OPPONENT_ALL = 140
    TOTAL_COUNT_LOWER_INDIVIDUALITY_ALL_FIELD = 141
    TOTAL_COUNT_EQUAL_INDIVIDUALITY_PT = 142
    TOTAL_COUNT_EQUAL_INDIVIDUALITY_PT_ALL = 143
    TOTAL_COUNT_EQUAL_INDIVIDUALITY_OPPONENT = 144
    TOTAL_COUNT_EQUAL_INDIVIDUALITY_OPPONENT_ALL = 145
    TOTAL_COUNT_EQUAL_INDIVIDUALITY_ALL_FIELD = 146
    PT_FRONT_DEAD_EQUAL = 147
    PT_CENTER_DEAD_EQUAL = 148
    PT_BACK_DEAD_EQUAL = 149
    COUNT_HIGHER_INDIVIDUALITY_PT_FRONT = 150
    COUNT_HIGHER_INDIVIDUALITY_PT_CENTER = 151
    COUNT_HIGHER_INDIVIDUALITY_PT_BACK = 152
    COUNT_HIGHER_INDIVIDUALITY_OPPONENT_FRONT = 153
    COUNT_HIGHER_INDIVIDUALITY_OPPONENT_CENTER = 154
    COUNT_HIGHER_INDIVIDUALITY_OPPONENT_BACK = 155
    COUNT_LOWER_INDIVIDUALITY_PT_FRONT = 156
    COUNT_LOWER_INDIVIDUALITY_PT_CENTER = 157
    COUNT_LOWER_INDIVIDUALITY_PT_BACK = 158
    COUNT_LOWER_INDIVIDUALITY_OPPONENT_FRONT = 159
    COUNT_LOWER_INDIVIDUALITY_OPPONENT_CENTER = 160
    COUNT_LOWER_INDIVIDUALITY_OPPONENT_BACK = 161
    COUNT_EQUAL_INDIVIDUALITY_PT_FRONT = 162
    COUNT_EQUAL_INDIVIDUALITY_PT_CENTER = 163
    COUNT_EQUAL_INDIVIDUALITY_PT_BACK = 164
    COUNT_EQUAL_INDIVIDUALITY_OPPONENT_FRONT = 165
    COUNT_EQUAL_INDIVIDUALITY_OPPONENT_CENTER = 166
    COUNT_EQUAL_INDIVIDUALITY_OPPONENT_BACK = 167
    CHECK_PRECEDING_ENEMY = 168
    COUNT_HIGHER_REMAIN_TURN = 169
    COUNT_LOWER_REMAIN_TURN = 170
    COUNT_HIGHER_PLAYER_COMMAND_SPELL = 171
    COUNT_LOWER_PLAYER_COMMAND_SPELL = 172
    COUNT_EQUAL_PLAYER_COMMAND_SPELL = 173
    CHECK_MASTER_SKILL_THISTURN = 174
    CHECK_SELF_NPTURN_HIGHER = 175
    CHECK_SELF_NPTURN_LOWER = 176
    CHECK_USE_SKILL_THISTURN = 177
    COUNT_CHAIN_HIGHER = 178
    COUNT_CHAIN_LOWER = 179
    COUNT_CHAIN_EQUAL = 180
    CHECK_SELECT_CHAIN = 181
    COUNT_PLAYER_NP_HIGHER = 182
    COUNT_PLAYER_NP_LOWER = 183
    COUNT_PLAYER_NP_EQUAL = 184
    COUNT_PLAYER_SKILL_HIGHER = 185
    COUNT_PLAYER_SKILL_LOWER = 186
    COUNT_PLAYER_SKILL_EQUAL = 187
    COUNT_PLAYER_SKILL_HIGHER_INCLUDE_MASTER_SKILL = 188
    COUNT_PLAYER_SKILL_LOWER_INCLUDE_MASTER_SKILL = 189
    COUNT_PLAYER_SKILL_EQUAL_INCLUDE_MASTER_SKILL = 190
    TOTAL_TURN_HIGHER = 191
    TOTAL_TURN_LOWER = 192
    TOTAL_TURN_EQUAL = 193
    CHECK_WAR_BOARD_SQUARE_INDIVIDUALITY = 194
    CHECK_PT_HIGHER_NPGAUGE = 195
    CHECK_SELF_HIGHER_NPGAUGE = 196
    CHECK_BATTLE_VALUE_ABOVE = 197
    CHECK_BATTLE_VALUE_EQUAL = 198
    CHECK_BATTLE_VALUE_NOT_EQUAL = 199
    CHECK_BATTLE_VALUE_BELOW = 200
    CHECK_BATTLE_VALUE_BETWEEN = 201
    CHECK_BATTLE_VALUE_NOT_BETWEEN = 202
    CHECK_USE_MASTER_SKILL_INDEX = 203
    CHECK_USE_MASTER_SKILL_INDEX_THIS_TURN = 204
    COUNT_MASTER_SKILL_HIGHER_THIS_TURN = 205
    COUNT_MASTER_SKILL_LOWER_THIS_TURN = 206
    COUNT_MASTER_SKILL_EQUAL_THIS_TURN = 207
    COUNT_MASTER_SKILL_HIGHER_THIS_WAVE = 208
    COUNT_MASTER_SKILL_LOWER_THIS_WAVE = 209
    COUNT_MASTER_SKILL_EQUAL_THIS_WAVE = 210
    COUNT_AVAILABLE_PLAYER_AND_MASTER_SKILL_HIGHER = 211
    COUNT_AVAILABLE_PLAYER_AND_MASTER_SKILL_LOWER = 212
    COUNT_AVAILABLE_PLAYER_AND_MASTER_SKILL_EQUAL = 213
    COUNT_AVAILABLE_PLAYER_SKILL_HIGHER = 214
    COUNT_AVAILABLE_PLAYER_SKILL_LOWER = 215
    COUNT_AVAILABLE_PLAYER_SKILL_EQUAL = 216
    COUNT_AVAILABLE_MASTER_SKILL_HIGHER = 217
    COUNT_AVAILABLE_MASTER_SKILL_LOWER = 218
    COUNT_AVAILABLE_MASTER_SKILL_EQUAL = 219
    COMMON_RELEASE_ID = 220


class NiceAiCond(StrEnum):
    """AI Cond Enum"""

    none = "none"
    hpHigher = "hpHigher"
    hpLower = "hpLower"
    actcount = "actcount"
    actcountMultiple = "actcountMultiple"
    turn = "turn"
    turnMultiple = "turnMultiple"
    beforeActId = "beforeActId"
    beforeActType = "beforeActType"
    beforeNotActId = "beforeNotActId"
    beforeNotActType = "beforeNotActType"
    checkSelfBuff = "checkSelfBuff"
    checkSelfIndividuality = "checkSelfIndividuality"
    checkPtBuff = "checkPtBuff"
    checkPtIndividuality = "checkPtIndividuality"
    checkOpponentBuff = "checkOpponentBuff"
    checkOpponentIndividuality = "checkOpponentIndividuality"
    checkSelfBuffIndividuality = "checkSelfBuffIndividuality"
    checkPtBuffIndividuality = "checkPtBuffIndividuality"
    checkOpponentBuffIndividuality = "checkOpponentBuffIndividuality"
    checkSelfNpturn = "checkSelfNpturn"
    checkPtLowerNpturn = "checkPtLowerNpturn"
    checkOpponentHeightNpgauge = "checkOpponentHeightNpgauge"
    actcountThisturn = "actcountThisturn"
    checkPtHpHigher = "checkPtHpHigher"
    checkPtHpLower = "checkPtHpLower"
    checkSelfNotBuffIndividuality = "checkSelfNotBuffIndividuality"
    turnAndActcountThisturn = "turnAndActcountThisturn"
    fieldturn = "fieldturn"
    fieldturnMultiple = "fieldturnMultiple"
    checkPtLowerTdturn = "checkPtLowerTdturn"
    raidHpHigher = "raidHpHigher"
    raidHpLower = "raidHpLower"
    raidCountHigher = "raidCountHigher"
    raidCountLower = "raidCountLower"
    raidCountValueHigher = "raidCountValueHigher"
    raidCountValueLower = "raidCountValueLower"
    checkSpace = "checkSpace"
    turnHigher = "turnHigher"
    turnLower = "turnLower"
    charactorTurnHigher = "charactorTurnHigher"
    charactorTurnLower = "charactorTurnLower"
    countAlivePt = "countAlivePt"
    countAliveOpponent = "countAliveOpponent"
    countPtRestHigher = "countPtRestHigher"
    countPtRestLower = "countPtRestLower"
    countOpponentRestHigher = "countOpponentRestHigher"
    countOpponentRestLower = "countOpponentRestLower"
    countItemHigher = "countItemHigher"
    countItemLower = "countItemLower"
    checkSelfBuffcountIndividuality = "checkSelfBuffcountIndividuality"
    checkPtBuffcountIndividuality = "checkPtBuffcountIndividuality"
    checkSelfBuffActive = "checkSelfBuffActive"
    checkPtBuffActive = "checkPtBuffActive"
    checkOpponentBuffActive = "checkOpponentBuffActive"
    countEnemyCommandSpellHigher = "countEnemyCommandSpellHigher"
    checkPtAllIndividuality = "checkPtAllIndividuality"
    checkOpponentAllIndividuality = "checkOpponentAllIndividuality"
    starHigher = "starHigher"
    starLower = "starLower"
    checkOpponentHpHigher = "checkOpponentHpHigher"
    checkOpponentHpLower = "checkOpponentHpLower"
    checkTargetPosition = "checkTargetPosition"
    checkSelfBuffActiveAndPassiveIndividuality = (
        "checkSelfBuffActiveAndPassiveIndividuality"
    )
    checkPtBuffActiveAndPassiveIndividuality = (
        "checkPtBuffActiveAndPassiveIndividuality"
    )
    checkOpponentBuffActiveAndPassiveIndividuality = (
        "checkOpponentBuffActiveAndPassiveIndividuality"
    )
    checkPtAllBuff = "checkPtAllBuff"
    checkOpponentAllBuff = "checkOpponentAllBuff"
    checkPtAllBuffIndividuality = "checkPtAllBuffIndividuality"
    checkOpponentAllBuffIndividuality = "checkOpponentAllBuffIndividuality"
    countAlivePtAll = "countAlivePtAll"
    countAliveOpponentAll = "countAliveOpponentAll"
    checkPtAllBuffActive = "checkPtAllBuffActive"
    checkOpponentAllBuffActive = "checkOpponentAllBuffActive"
    countHigherBuffIndividualitySumPt = "countHigherBuffIndividualitySumPt"
    countHigherBuffIndividualitySumPtAll = "countHigherBuffIndividualitySumPtAll"
    countHigherBuffIndividualitySumOpponent = "countHigherBuffIndividualitySumOpponent"
    countHigherBuffIndividualitySumOpponentAll = (
        "countHigherBuffIndividualitySumOpponentAll"
    )
    countHigherBuffIndividualitySumSelf = "countHigherBuffIndividualitySumSelf"
    countLowerBuffIndividualitySumPt = "countLowerBuffIndividualitySumPt"
    countLowerBuffIndividualitySumPtAll = "countLowerBuffIndividualitySumPtAll"
    countLowerBuffIndividualitySumOpponent = "countLowerBuffIndividualitySumOpponent"
    countLowerBuffIndividualitySumOpponentAll = (
        "countLowerBuffIndividualitySumOpponentAll"
    )
    countLowerBuffIndividualitySumSelf = "countLowerBuffIndividualitySumSelf"
    countEqualBuffIndividualitySumPt = "countEqualBuffIndividualitySumPt"
    countEqualBuffIndividualitySumPtAll = "countEqualBuffIndividualitySumPtAll"
    countEqualBuffIndividualitySumOpponent = "countEqualBuffIndividualitySumOpponent"
    countEqualBuffIndividualitySumOpponentAll = (
        "countEqualBuffIndividualitySumOpponentAll"
    )
    countEqualBuffIndividualitySumSelf = "countEqualBuffIndividualitySumSelf"
    existIndividualityOpponentFront = "existIndividualityOpponentFront"
    existIndividualityOpponentCenter = "existIndividualityOpponentCenter"
    existIndividualityOpponentBack = "existIndividualityOpponentBack"
    totalCountHigherIndividualityPt = "totalCountHigherIndividualityPt"
    totalCountHigherIndividualityPtAll = "totalCountHigherIndividualityPtAll"
    totalCountHigherIndividualityOpponent = "totalCountHigherIndividualityOpponent"
    totalCountHigherIndividualityOpponentAll = (
        "totalCountHigherIndividualityOpponentAll"
    )
    totalCountHigherIndividualityAllField = "totalCountHigherIndividualityAllField"
    totalCountLowerIndividualityPt = "totalCountLowerIndividualityPt"
    totalCountLowerIndividualityPtAll = "totalCountLowerIndividualityPtAll"
    totalCountLowerIndividualityOpponent = "totalCountLowerIndividualityOpponent"
    totalCountLowerIndividualityOpponentAll = "totalCountLowerIndividualityOpponentAll"
    totalCountLowerIndividualityAllField = "totalCountLowerIndividualityAllField"
    totalCountEqualIndividualityPt = "totalCountEqualIndividualityPt"
    totalCountEqualIndividualityPtAll = "totalCountEqualIndividualityPtAll"
    totalCountEqualIndividualityOpponent = "totalCountEqualIndividualityOpponent"
    totalCountEqualIndividualityOpponentAll = "totalCountEqualIndividualityOpponentAll"
    totalCountEqualIndividualityAllField = "totalCountEqualIndividualityAllField"
    ptFrontDeadEqual = "ptFrontDeadEqual"
    ptCenterDeadEqual = "ptCenterDeadEqual"
    ptBackDeadEqual = "ptBackDeadEqual"
    countHigherIndividualityPtFront = "countHigherIndividualityPtFront"
    countHigherIndividualityPtCenter = "countHigherIndividualityPtCenter"
    countHigherIndividualityPtBack = "countHigherIndividualityPtBack"
    countHigherIndividualityOpponentFront = "countHigherIndividualityOpponentFront"
    countHigherIndividualityOpponentCenter = "countHigherIndividualityOpponentCenter"
    countHigherIndividualityOpponentBack = "countHigherIndividualityOpponentBack"
    countLowerIndividualityPtFront = "countLowerIndividualityPtFront"
    countLowerIndividualityPtCenter = "countLowerIndividualityPtCenter"
    countLowerIndividualityPtBack = "countLowerIndividualityPtBack"
    countLowerIndividualityOpponentFront = "countLowerIndividualityOpponentFront"
    countLowerIndividualityOpponentCenter = "countLowerIndividualityOpponentCenter"
    countLowerIndividualityOpponentBack = "countLowerIndividualityOpponentBack"
    countEqualIndividualityPtFront = "countEqualIndividualityPtFront"
    countEqualIndividualityPtCenter = "countEqualIndividualityPtCenter"
    countEqualIndividualityPtBack = "countEqualIndividualityPtBack"
    countEqualIndividualityOpponentFront = "countEqualIndividualityOpponentFront"
    countEqualIndividualityOpponentCenter = "countEqualIndividualityOpponentCenter"
    countEqualIndividualityOpponentBack = "countEqualIndividualityOpponentBack"
    checkPrecedingEnemy = "checkPrecedingEnemy"
    countHigherRemainTurn = "countHigherRemainTurn"
    countLowerRemainTurn = "countLowerRemainTurn"
    countHigherPlayerCommandSpell = "countHigherPlayerCommandSpell"
    countLowerPlayerCommandSpell = "countLowerPlayerCommandSpell"
    countEqualPlayerCommandSpell = "countEqualPlayerCommandSpell"
    checkMasterSkillThisturn = "checkMasterSkillThisturn"
    checkSelfNpturnHigher = "checkSelfNpturnHigher"
    checkSelfNpturnLower = "checkSelfNpturnLower"
    checkUseSkillThisturn = "checkUseSkillThisturn"
    countChainHigher = "countChainHigher"
    countChainLower = "countChainLower"
    countChainEqual = "countChainEqual"
    checkSelectChain = "checkSelectChain"
    countPlayerNpHigher = "countPlayerNpHigher"
    countPlayerNpLower = "countPlayerNpLower"
    countPlayerNpEqual = "countPlayerNpEqual"
    countPlayerSkillHigher = "countPlayerSkillHigher"
    countPlayerSkillLower = "countPlayerSkillLower"
    countPlayerSkillEqual = "countPlayerSkillEqual"
    countPlayerSkillHigherIncludeMasterSkill = (
        "countPlayerSkillHigherIncludeMasterSkill"
    )
    countPlayerSkillLowerIncludeMasterSkill = "countPlayerSkillLowerIncludeMasterSkill"
    countPlayerSkillEqualIncludeMasterSkill = "countPlayerSkillEqualIncludeMasterSkill"
    totalTurnHigher = "totalTurnHigher"
    totalTurnLower = "totalTurnLower"
    totalTurnEqual = "totalTurnEqual"
    checkWarBoardSquareIndividuality = "checkWarBoardSquareIndividuality"
    checkPtHigherNpgauge = "checkPtHigherNpgauge"
    checkSelfHigherNpgauge = "checkSelfHigherNpgauge"
    checkBattleValueAbove = "checkBattleValueAbove"
    checkBattleValueEqual = "checkBattleValueEqual"
    checkBattleValueNotEqual = "checkBattleValueNotEqual"
    checkBattleValueBelow = "checkBattleValueBelow"
    checkBattleValueBetween = "checkBattleValueBetween"
    checkBattleValueNotBetween = "checkBattleValueNotBetween"
    checkUseMasterSkillIndex = "checkUseMasterSkillIndex"
    checkUseMasterSkillIndexThisTurn = "checkUseMasterSkillIndexThisTurn"
    countMasterSkillHigherThisTurn = "countMasterSkillHigherThisTurn"
    countMasterSkillLowerThisTurn = "countMasterSkillLowerThisTurn"
    countMasterSkillEqualThisTurn = "countMasterSkillEqualThisTurn"
    countMasterSkillHigherThisWave = "countMasterSkillHigherThisWave"
    countMasterSkillLowerThisWave = "countMasterSkillLowerThisWave"
    countMasterSkillEqualThisWave = "countMasterSkillEqualThisWave"
    countAvailablePlayerAndMasterSkillHigher = (
        "countAvailablePlayerAndMasterSkillHigher"
    )
    countAvailablePlayerAndMasterSkillLower = "countAvailablePlayerAndMasterSkillLower"
    countAvailablePlayerAndMasterSkillEqual = "countAvailablePlayerAndMasterSkillEqual"
    countAvailablePlayerSkillHigher = "countAvailablePlayerSkillHigher"
    countAvailablePlayerSkillLower = "countAvailablePlayerSkillLower"
    countAvailablePlayerSkillEqual = "countAvailablePlayerSkillEqual"
    countAvailableMasterSkillHigher = "countAvailableMasterSkillHigher"
    countAvailableMasterSkillLower = "countAvailableMasterSkillLower"
    countAvailableMasterSkillEqual = "countAvailableMasterSkillEqual"
    commonReleaseId = "commonReleaseId"


AI_COND_NAME: dict[int, NiceAiCond] = {
    0: NiceAiCond.none,
    10: NiceAiCond.hpHigher,
    11: NiceAiCond.hpLower,
    20: NiceAiCond.actcount,
    21: NiceAiCond.actcountMultiple,
    30: NiceAiCond.turn,
    31: NiceAiCond.turnMultiple,
    40: NiceAiCond.beforeActId,
    41: NiceAiCond.beforeActType,
    42: NiceAiCond.beforeNotActId,
    43: NiceAiCond.beforeNotActType,
    50: NiceAiCond.checkSelfBuff,
    51: NiceAiCond.checkSelfIndividuality,
    52: NiceAiCond.checkPtBuff,
    53: NiceAiCond.checkPtIndividuality,
    55: NiceAiCond.checkOpponentBuff,
    56: NiceAiCond.checkOpponentIndividuality,
    57: NiceAiCond.checkSelfBuffIndividuality,
    58: NiceAiCond.checkPtBuffIndividuality,
    59: NiceAiCond.checkOpponentBuffIndividuality,
    60: NiceAiCond.checkSelfNpturn,
    61: NiceAiCond.checkPtLowerNpturn,
    62: NiceAiCond.checkOpponentHeightNpgauge,
    63: NiceAiCond.actcountThisturn,
    64: NiceAiCond.checkPtHpHigher,
    65: NiceAiCond.checkPtHpLower,
    66: NiceAiCond.checkSelfNotBuffIndividuality,
    67: NiceAiCond.turnAndActcountThisturn,
    68: NiceAiCond.fieldturn,
    69: NiceAiCond.fieldturnMultiple,
    70: NiceAiCond.checkPtLowerTdturn,
    71: NiceAiCond.raidHpHigher,
    72: NiceAiCond.raidHpLower,
    73: NiceAiCond.raidCountHigher,
    74: NiceAiCond.raidCountLower,
    75: NiceAiCond.raidCountValueHigher,
    76: NiceAiCond.raidCountValueLower,
    77: NiceAiCond.checkSpace,
    78: NiceAiCond.turnHigher,
    79: NiceAiCond.turnLower,
    80: NiceAiCond.charactorTurnHigher,
    81: NiceAiCond.charactorTurnLower,
    82: NiceAiCond.countAlivePt,
    83: NiceAiCond.countAliveOpponent,
    84: NiceAiCond.countPtRestHigher,
    85: NiceAiCond.countPtRestLower,
    86: NiceAiCond.countOpponentRestHigher,
    87: NiceAiCond.countOpponentRestLower,
    88: NiceAiCond.countItemHigher,
    89: NiceAiCond.countItemLower,
    90: NiceAiCond.checkSelfBuffcountIndividuality,
    91: NiceAiCond.checkPtBuffcountIndividuality,
    92: NiceAiCond.checkSelfBuffActive,
    93: NiceAiCond.checkPtBuffActive,
    94: NiceAiCond.checkOpponentBuffActive,
    95: NiceAiCond.countEnemyCommandSpellHigher,
    96: NiceAiCond.checkPtAllIndividuality,
    97: NiceAiCond.checkOpponentAllIndividuality,
    98: NiceAiCond.starHigher,
    99: NiceAiCond.starLower,
    100: NiceAiCond.checkOpponentHpHigher,
    101: NiceAiCond.checkOpponentHpLower,
    102: NiceAiCond.checkTargetPosition,
    103: NiceAiCond.checkSelfBuffActiveAndPassiveIndividuality,
    104: NiceAiCond.checkPtBuffActiveAndPassiveIndividuality,
    105: NiceAiCond.checkOpponentBuffActiveAndPassiveIndividuality,
    106: NiceAiCond.checkPtAllBuff,
    107: NiceAiCond.checkOpponentAllBuff,
    108: NiceAiCond.checkPtAllBuffIndividuality,
    109: NiceAiCond.checkOpponentAllBuffIndividuality,
    110: NiceAiCond.countAlivePtAll,
    111: NiceAiCond.countAliveOpponentAll,
    112: NiceAiCond.checkPtAllBuffActive,
    113: NiceAiCond.checkOpponentAllBuffActive,
    114: NiceAiCond.countHigherBuffIndividualitySumPt,
    115: NiceAiCond.countHigherBuffIndividualitySumPtAll,
    116: NiceAiCond.countHigherBuffIndividualitySumOpponent,
    117: NiceAiCond.countHigherBuffIndividualitySumOpponentAll,
    118: NiceAiCond.countHigherBuffIndividualitySumSelf,
    119: NiceAiCond.countLowerBuffIndividualitySumPt,
    120: NiceAiCond.countLowerBuffIndividualitySumPtAll,
    121: NiceAiCond.countLowerBuffIndividualitySumOpponent,
    122: NiceAiCond.countLowerBuffIndividualitySumOpponentAll,
    123: NiceAiCond.countLowerBuffIndividualitySumSelf,
    124: NiceAiCond.countEqualBuffIndividualitySumPt,
    125: NiceAiCond.countEqualBuffIndividualitySumPtAll,
    126: NiceAiCond.countEqualBuffIndividualitySumOpponent,
    127: NiceAiCond.countEqualBuffIndividualitySumOpponentAll,
    128: NiceAiCond.countEqualBuffIndividualitySumSelf,
    129: NiceAiCond.existIndividualityOpponentFront,
    130: NiceAiCond.existIndividualityOpponentCenter,
    131: NiceAiCond.existIndividualityOpponentBack,
    132: NiceAiCond.totalCountHigherIndividualityPt,
    133: NiceAiCond.totalCountHigherIndividualityPtAll,
    134: NiceAiCond.totalCountHigherIndividualityOpponent,
    135: NiceAiCond.totalCountHigherIndividualityOpponentAll,
    136: NiceAiCond.totalCountHigherIndividualityAllField,
    137: NiceAiCond.totalCountLowerIndividualityPt,
    138: NiceAiCond.totalCountLowerIndividualityPtAll,
    139: NiceAiCond.totalCountLowerIndividualityOpponent,
    140: NiceAiCond.totalCountLowerIndividualityOpponentAll,
    141: NiceAiCond.totalCountLowerIndividualityAllField,
    142: NiceAiCond.totalCountEqualIndividualityPt,
    143: NiceAiCond.totalCountEqualIndividualityPtAll,
    144: NiceAiCond.totalCountEqualIndividualityOpponent,
    145: NiceAiCond.totalCountEqualIndividualityOpponentAll,
    146: NiceAiCond.totalCountEqualIndividualityAllField,
    147: NiceAiCond.ptFrontDeadEqual,
    148: NiceAiCond.ptCenterDeadEqual,
    149: NiceAiCond.ptBackDeadEqual,
    150: NiceAiCond.countHigherIndividualityPtFront,
    151: NiceAiCond.countHigherIndividualityPtCenter,
    152: NiceAiCond.countHigherIndividualityPtBack,
    153: NiceAiCond.countHigherIndividualityOpponentFront,
    154: NiceAiCond.countHigherIndividualityOpponentCenter,
    155: NiceAiCond.countHigherIndividualityOpponentBack,
    156: NiceAiCond.countLowerIndividualityPtFront,
    157: NiceAiCond.countLowerIndividualityPtCenter,
    158: NiceAiCond.countLowerIndividualityPtBack,
    159: NiceAiCond.countLowerIndividualityOpponentFront,
    160: NiceAiCond.countLowerIndividualityOpponentCenter,
    161: NiceAiCond.countLowerIndividualityOpponentBack,
    162: NiceAiCond.countEqualIndividualityPtFront,
    163: NiceAiCond.countEqualIndividualityPtCenter,
    164: NiceAiCond.countEqualIndividualityPtBack,
    165: NiceAiCond.countEqualIndividualityOpponentFront,
    166: NiceAiCond.countEqualIndividualityOpponentCenter,
    167: NiceAiCond.countEqualIndividualityOpponentBack,
    168: NiceAiCond.checkPrecedingEnemy,
    169: NiceAiCond.countHigherRemainTurn,
    170: NiceAiCond.countLowerRemainTurn,
    171: NiceAiCond.countHigherPlayerCommandSpell,
    172: NiceAiCond.countLowerPlayerCommandSpell,
    173: NiceAiCond.countEqualPlayerCommandSpell,
    174: NiceAiCond.checkMasterSkillThisturn,
    175: NiceAiCond.checkSelfNpturnHigher,
    176: NiceAiCond.checkSelfNpturnLower,
    177: NiceAiCond.checkUseSkillThisturn,
    178: NiceAiCond.countChainHigher,
    179: NiceAiCond.countChainLower,
    180: NiceAiCond.countChainEqual,
    181: NiceAiCond.checkSelectChain,
    182: NiceAiCond.countPlayerNpHigher,
    183: NiceAiCond.countPlayerNpLower,
    184: NiceAiCond.countPlayerNpEqual,
    185: NiceAiCond.countPlayerSkillHigher,
    186: NiceAiCond.countPlayerSkillLower,
    187: NiceAiCond.countPlayerSkillEqual,
    188: NiceAiCond.countPlayerSkillHigherIncludeMasterSkill,
    189: NiceAiCond.countPlayerSkillLowerIncludeMasterSkill,
    190: NiceAiCond.countPlayerSkillEqualIncludeMasterSkill,
    191: NiceAiCond.totalTurnHigher,
    192: NiceAiCond.totalTurnLower,
    193: NiceAiCond.totalTurnEqual,
    194: NiceAiCond.checkWarBoardSquareIndividuality,
    195: NiceAiCond.checkPtHigherNpgauge,
    196: NiceAiCond.checkSelfHigherNpgauge,
    197: NiceAiCond.checkBattleValueAbove,
    198: NiceAiCond.checkBattleValueEqual,
    199: NiceAiCond.checkBattleValueNotEqual,
    200: NiceAiCond.checkBattleValueBelow,
    201: NiceAiCond.checkBattleValueBetween,
    202: NiceAiCond.checkBattleValueNotBetween,
    203: NiceAiCond.checkUseMasterSkillIndex,
    204: NiceAiCond.checkUseMasterSkillIndexThisTurn,
    205: NiceAiCond.countMasterSkillHigherThisTurn,
    206: NiceAiCond.countMasterSkillLowerThisTurn,
    207: NiceAiCond.countMasterSkillEqualThisTurn,
    208: NiceAiCond.countMasterSkillHigherThisWave,
    209: NiceAiCond.countMasterSkillLowerThisWave,
    210: NiceAiCond.countMasterSkillEqualThisWave,
    211: NiceAiCond.countAvailablePlayerAndMasterSkillHigher,
    212: NiceAiCond.countAvailablePlayerAndMasterSkillLower,
    213: NiceAiCond.countAvailablePlayerAndMasterSkillEqual,
    214: NiceAiCond.countAvailablePlayerSkillHigher,
    215: NiceAiCond.countAvailablePlayerSkillLower,
    216: NiceAiCond.countAvailablePlayerSkillEqual,
    217: NiceAiCond.countAvailableMasterSkillHigher,
    218: NiceAiCond.countAvailableMasterSkillLower,
    219: NiceAiCond.countAvailableMasterSkillEqual,
    220: NiceAiCond.commonReleaseId,
}


class AiActType(IntEnum):
    NONE = 0
    RANDOM = 1
    ATTACK = 2
    SKILL_RANDOM = 10
    SKILL1 = 11
    SKILL2 = 12
    SKILL3 = 13
    ATTACK_A = 14
    ATTACK_B = 15
    ATTACK_Q = 16
    ATTACK_A_CRITICAL = 17
    ATTACK_B_CRITICAL = 18
    ATTACK_Q_CRITICAL = 19
    ATTACK_CRITICAL = 30
    SKILL_ID = 40
    SKILL_ID_CHECKBUFF = 41
    RESURRECTION = 42
    BATTLE_SCRIPT = 50
    PLAY_MOTION = 71
    MESSAGE = 72
    MESSAGE_GROUP = 73
    NOBLE_PHANTASM = 80
    BATTLE_END = 90
    LOSE_END = 91
    BATTLE_END_NOT_RELATED_SURVIVAL_STATUS = 92
    BATTLE_END_NOT_RELATED_SURVIVAL_STATUS_INSTANTLY = 93
    ALL_BATTLE_END = 94
    CHANGE_THINKING = 99


class NiceAiActType(StrEnum):
    """AI Act Type Enum"""

    none = "none"
    random = "random"
    attack = "attack"
    skillRandom = "skillRandom"
    skill1 = "skill1"
    skill2 = "skill2"
    skill3 = "skill3"
    attackA = "attackA"
    attackB = "attackB"
    attackQ = "attackQ"
    attackACritical = "attackACritical"
    attackBCritical = "attackBCritical"
    attackQCritical = "attackQCritical"
    attackCritical = "attackCritical"
    skillId = "skillId"
    skillIdCheckbuff = "skillIdCheckbuff"
    resurrection = "resurrection"
    battleScript = "battleScript"
    playMotion = "playMotion"
    message = "message"
    messageGroup = "messageGroup"
    noblePhantasm = "noblePhantasm"
    battleEnd = "battleEnd"
    loseEnd = "loseEnd"
    battleEndNotRelatedSurvivalStatus = "battleEndNotRelatedSurvivalStatus"
    battleEndNotRelatedSurvivalStatusInstantly = (
        "battleEndNotRelatedSurvivalStatusInstantly"
    )
    allBattleEnd = "allBattleEnd"
    changeThinking = "changeThinking"


AI_ACT_TYPE_NAME: dict[int, NiceAiActType] = {
    0: NiceAiActType.none,
    1: NiceAiActType.random,
    2: NiceAiActType.attack,
    10: NiceAiActType.skillRandom,
    11: NiceAiActType.skill1,
    12: NiceAiActType.skill2,
    13: NiceAiActType.skill3,
    14: NiceAiActType.attackA,
    15: NiceAiActType.attackB,
    16: NiceAiActType.attackQ,
    17: NiceAiActType.attackACritical,
    18: NiceAiActType.attackBCritical,
    19: NiceAiActType.attackQCritical,
    30: NiceAiActType.attackCritical,
    40: NiceAiActType.skillId,
    41: NiceAiActType.skillIdCheckbuff,
    42: NiceAiActType.resurrection,
    50: NiceAiActType.battleScript,
    71: NiceAiActType.playMotion,
    72: NiceAiActType.message,
    73: NiceAiActType.messageGroup,
    80: NiceAiActType.noblePhantasm,
    90: NiceAiActType.battleEnd,
    91: NiceAiActType.loseEnd,
    92: NiceAiActType.battleEndNotRelatedSurvivalStatus,
    93: NiceAiActType.battleEndNotRelatedSurvivalStatusInstantly,
    94: NiceAiActType.allBattleEnd,
    99: NiceAiActType.changeThinking,
}


class AiActTarget(IntEnum):
    NONE = 0
    RANDOM = 1
    HP_HIGHER = 2
    HP_LOWER = 3
    NPTURN_LOWER = 10
    NPGAUGE_HIGHER = 11
    REVENGE = 12
    INDIVIDUALITY_ACTIVE = 13
    BUFF_ACTIVE = 14
    FRONT = 15
    CENTER = 16
    BACK = 17


class NiceAiActTarget(StrEnum):
    """AI Act Target Enum"""

    none = "none"
    random = "random"
    hpHigher = "hpHigher"
    hpLower = "hpLower"
    npturnLower = "npturnLower"
    npgaugeHigher = "npgaugeHigher"
    revenge = "revenge"
    individualityActive = "individualityActive"
    buffActive = "buffActive"
    front = "front"
    center_ = "center"
    back = "back"


AI_ACT_TARGET_NAME: dict[int, NiceAiActTarget] = {
    0: NiceAiActTarget.none,
    1: NiceAiActTarget.random,
    2: NiceAiActTarget.hpHigher,
    3: NiceAiActTarget.hpLower,
    10: NiceAiActTarget.npturnLower,
    11: NiceAiActTarget.npgaugeHigher,
    12: NiceAiActTarget.revenge,
    13: NiceAiActTarget.individualityActive,
    14: NiceAiActTarget.buffActive,
    15: NiceAiActTarget.front,
    16: NiceAiActTarget.center_,
    17: NiceAiActTarget.back,
}


class AiActNum(IntEnum):
    NOMAL = 0
    ANYTIME = -1
    REACTION_PLAYER_COMBO_END = -2
    REACTION_PLYAER_SKILL = -3
    REACTION_ENEMYTURN_START = -4
    REACTION_ENEMYTURN_END = -5
    REACTION_DEAD = -6
    REACTION_PLAYERACTIONEND = -7
    REACTION_WAVESTART = -8
    MAXNP = -9
    AFTER_TURN_PLAYER_END = -10
    USENP_TARGET = -11
    REACTION_TURNSTART = -12
    REACTION_PLAYERACTIONSTART = -13
    REACTION_ENTRY_ANY_UNIT = -14
    REACTION_BEFORE_RESURRECTION = -15
    REACTION_BEFORE_DEAD = -16
    SHIFT_SERVANT_AFTER = -17
    REACTION_BEFORE_MOVE_WAVE = -18
    SHIFT_SERVANT_BEFORE = -19
    REACTION_PLAYER_COMBO_END_PRIORITY = -201
    REACTION_ENEMY_TURN_START_PRIORITY = -401
    REACTION_ENEMY_TURN_END_PRIORITY = -501
    REACTION_ENTRY_ANY_UNIT_PRIORITY = -1401
    SHIFT_SERVANT_BEFORE_PRIORITY = -1901


class NiceAiActNum(StrEnum):
    """AI Act Num Enum"""

    nomal = "nomal"
    anytime = "anytime"
    reactionPlayerComboEnd = "reactionPlayerComboEnd"
    reactionPlyaerSkill = "reactionPlyaerSkill"
    reactionEnemyturnStart = "reactionEnemyturnStart"
    reactionEnemyturnEnd = "reactionEnemyturnEnd"
    reactionDead = "reactionDead"
    reactionPlayeractionend = "reactionPlayeractionend"
    reactionWavestart = "reactionWavestart"
    maxnp = "maxnp"
    afterTurnPlayerEnd = "afterTurnPlayerEnd"
    usenpTarget = "usenpTarget"
    reactionTurnstart = "reactionTurnstart"
    reactionPlayeractionstart = "reactionPlayeractionstart"
    reactionEntryAnyUnit = "reactionEntryAnyUnit"
    reactionBeforeResurrection = "reactionBeforeResurrection"
    reactionBeforeDead = "reactionBeforeDead"
    shiftServantAfter = "shiftServantAfter"
    reactionBeforeMoveWave = "reactionBeforeMoveWave"
    shiftServantBefore = "shiftServantBefore"
    reactionPlayerComboEndPriority = "reactionPlayerComboEndPriority"
    reactionEnemyTurnStartPriority = "reactionEnemyTurnStartPriority"
    reactionEnemyTurnEndPriority = "reactionEnemyTurnEndPriority"
    reactionEntryAnyUnitPriority = "reactionEntryAnyUnitPriority"
    shiftServantBeforePriority = "shiftServantBeforePriority"
    unknown = "unknown"


AI_ACT_NUM_NAME: dict[int, NiceAiActNum] = {
    0: NiceAiActNum.nomal,
    -1: NiceAiActNum.anytime,
    -2: NiceAiActNum.reactionPlayerComboEnd,
    -3: NiceAiActNum.reactionPlyaerSkill,
    -4: NiceAiActNum.reactionEnemyturnStart,
    -5: NiceAiActNum.reactionEnemyturnEnd,
    -6: NiceAiActNum.reactionDead,
    -7: NiceAiActNum.reactionPlayeractionend,
    -8: NiceAiActNum.reactionWavestart,
    -9: NiceAiActNum.maxnp,
    -10: NiceAiActNum.afterTurnPlayerEnd,
    -11: NiceAiActNum.usenpTarget,
    -12: NiceAiActNum.reactionTurnstart,
    -13: NiceAiActNum.reactionPlayeractionstart,
    -14: NiceAiActNum.reactionEntryAnyUnit,
    -15: NiceAiActNum.reactionBeforeResurrection,
    -16: NiceAiActNum.reactionBeforeDead,
    -17: NiceAiActNum.shiftServantAfter,
    -18: NiceAiActNum.reactionBeforeMoveWave,
    -19: NiceAiActNum.shiftServantBefore,
    -201: NiceAiActNum.reactionPlayerComboEndPriority,
    -401: NiceAiActNum.reactionEnemyTurnStartPriority,
    -501: NiceAiActNum.reactionEnemyTurnEndPriority,
    -1401: NiceAiActNum.reactionEntryAnyUnitPriority,
    -1901: NiceAiActNum.shiftServantBeforePriority,
    -9999: NiceAiActNum.unknown,
}


class MissionType(IntEnum):
    NONE = 0
    EVENT = 1
    WEEKLY = 2
    DAILY = 3
    EXTRA = 4
    LIMITED = 5
    COMPLETE = 6
    RANDOM = 7
    SERVANT = 8


class NiceMissionType(StrEnum):
    """Mission Type Enum"""

    none = "none"
    event = "event"
    weekly = "weekly"
    daily = "daily"
    extra = "extra"
    limited = "limited"
    complete = "complete"
    random = "random"
    servant = "servant"


MISSION_TYPE_NAME: dict[int, NiceMissionType] = {
    0: NiceMissionType.none,
    1: NiceMissionType.event,
    2: NiceMissionType.weekly,
    3: NiceMissionType.daily,
    4: NiceMissionType.extra,
    5: NiceMissionType.limited,
    6: NiceMissionType.complete,
    7: NiceMissionType.random,
    8: NiceMissionType.servant,
}


class MissionRewardType(IntEnum):
    GIFT = 1
    EXTRA = 2
    SET = 3


class NiceMissionRewardType(StrEnum):
    """Mission Reward Type Enum"""

    gift = "gift"
    extra = "extra"
    set_ = "set"


MISSION_REWARD_TYPE_NAME: dict[int, NiceMissionRewardType] = {
    1: NiceMissionRewardType.gift,
    2: NiceMissionRewardType.extra,
    3: NiceMissionRewardType.set_,
}


class MissionProgressType(IntEnum):
    NONE = 0
    REGIST = 1
    OPEN_CONDITION = 2
    START = 3
    CLEAR = 4
    ACHIEVE = 5


class NiceMissionProgressType(StrEnum):
    """Mission Progress Type Enum"""

    none = "none"
    regist = "regist"
    openCondition = "openCondition"
    start = "start"
    clear = "clear"
    achieve = "achieve"


MISSION_PROGRESS_TYPE_NAME: dict[int, NiceMissionProgressType] = {
    0: NiceMissionProgressType.none,
    1: NiceMissionProgressType.regist,
    2: NiceMissionProgressType.openCondition,
    3: NiceMissionProgressType.start,
    4: NiceMissionProgressType.clear,
    5: NiceMissionProgressType.achieve,
}


class BoxGachaFlag(IntEnum):
    NONE = 1
    LIMIT_RESET = 2


class NiceLotteryFlag(StrEnum):
    """Event Lottery Flag"""

    none = "none"
    limitReset = "limitReset"


EVENT_LOTTERY_FLAG_NAME: dict[int, NiceLotteryFlag] = {
    1: NiceLotteryFlag.none,
    2: NiceLotteryFlag.limitReset,
}


class BgmFlag(IntEnum):
    IS_NOT_RELEASE = 1


class NiceBgmFlag(StrEnum):
    """Bgm Flag"""

    isNotRelease = "isNotRelease"


BGM_FLAG_NAME: dict[int, NiceBgmFlag] = {
    1: NiceBgmFlag.isNotRelease,
}


class SvtFrameType(IntEnum):
    BLACK = 0
    BRONZE = 1
    SILVER = 2
    GOLD = 3
    GOLD_RED = 4
    GOLD_RED_GREAT = 5
    GOLD_BLACK = 6
    GOLD_BLACK_GREAT = 7


class NiceSvtFrameType(StrEnum):
    """Servant Frame Type"""

    black = "black"
    bronze = "bronze"
    silver = "silver"
    gold = "gold"
    goldRed = "goldRed"
    goldRedGreat = "goldRedGreat"
    goldBlack = "goldBlack"
    goldBlackGreat = "goldBlackGreat"


SERVANT_FRAME_TYPE_NAME: dict[int, NiceSvtFrameType] = {
    0: NiceSvtFrameType.black,
    1: NiceSvtFrameType.bronze,
    2: NiceSvtFrameType.silver,
    3: NiceSvtFrameType.gold,
    4: NiceSvtFrameType.goldRed,
    5: NiceSvtFrameType.goldRedGreat,
    6: NiceSvtFrameType.goldBlack,
    7: NiceSvtFrameType.goldBlackGreat,
}


class CommonConsumeType(IntEnum):
    ITEM = 1
    AP = 2


class NiceCommonConsumeType(StrEnum):
    """Common Consume Type"""

    item = "item"
    ap = "ap"


COMMON_CONSUME_TYPE_NAME: dict[int, NiceCommonConsumeType] = {
    1: NiceCommonConsumeType.item,
    2: NiceCommonConsumeType.ap,
}


class EventRewardSceneFlag(IntEnum):
    NPC_GUIDE = 2
    IS_CHANGE_SVT_BY_CHANGED_TAB = 4
    IS_HIDE_TAB = 8


class NiceEventRewardSceneFlag(StrEnum):
    """Event Reward Scene Flag"""

    npcGuide = "npcGuide"
    isChangeSvtByChangedTab = "isChangeSvtByChangedTab"
    isHideTab = "isHideTab"


EVENT_REWARD_SCENE_FLAG: dict[int, NiceEventRewardSceneFlag] = {
    2: NiceEventRewardSceneFlag.npcGuide,
    4: NiceEventRewardSceneFlag.isChangeSvtByChangedTab,
    8: NiceEventRewardSceneFlag.isHideTab,
}


class AiCondTarget(IntEnum):
    NONE = 0
    FIELD = 1
    SELF = 2
    PT = 3
    OPPONENT = 4
    PT_FIELD = 5
    OPPONENT_FIELD = 6
    PT_ALL = 7
    OPPONENT_ALL = 8
    OPPONENT_FRONT = 9
    OPPONENT_CENTER = 10
    OPPONENT_BACK = 11
    ALL_FIELD = 12
    PT_FRONT = 13
    PT_CENTER = 14
    PT_BACK = 15


class NiceAiCondTarget(StrEnum):
    """Ai Condition Target"""

    none = "none"
    field = "field"
    self_ = "self"
    pt = "pt"
    opponent = "opponent"
    ptField = "ptField"
    opponentField = "opponentField"
    ptAll = "ptAll"
    opponentAll = "opponentAll"
    opponentFront = "opponentFront"
    opponentCenter = "opponentCenter"
    opponentBack = "opponentBack"
    allField = "allField"
    ptFront = "ptFront"
    ptCenter = "ptCenter"
    ptBack = "ptBack"


AI_COND_TARGET_NAME: dict[int, NiceAiCondTarget] = {
    0: NiceAiCondTarget.none,
    1: NiceAiCondTarget.field,
    2: NiceAiCondTarget.self_,
    3: NiceAiCondTarget.pt,
    4: NiceAiCondTarget.opponent,
    5: NiceAiCondTarget.ptField,
    6: NiceAiCondTarget.opponentField,
    7: NiceAiCondTarget.ptAll,
    8: NiceAiCondTarget.opponentAll,
    9: NiceAiCondTarget.opponentFront,
    10: NiceAiCondTarget.opponentCenter,
    11: NiceAiCondTarget.opponentBack,
    12: NiceAiCondTarget.allField,
    13: NiceAiCondTarget.ptFront,
    14: NiceAiCondTarget.ptCenter,
    15: NiceAiCondTarget.ptBack,
}


class AiCondParameter(IntEnum):
    NONE = 0
    TURN = 1
    SPACE = 2
    PREV_ACTID = 3
    PREV_ACTTYPE = 4
    HP = 5
    NPGAUGE = 6
    TDTURN = 7
    ACT_COUNT = 8
    ACT_COUNT_THISTURN = 9
    TURN_FIELD = 10
    TURN_ACT_COUNT = 11
    BUFF_ID = 12
    INDIVIDUALITY = 13
    BUFF_INDIVIDUALITY = 14
    BUFF_ACTIVE_INDIVIDUALITY = 15
    RAID_HP = 16
    RAID_COUNT = 17
    RAID_COUNT_VALUE = 18
    COUNT_ALIVE = 19
    COUNT_REST = 20
    COUNT_ITEM = 21
    COUNT_BUFFCOUNT_INDIVIDUALITY = 22
    BUFF_ACTIVE_ID = 23
    ENEMY_MASTER_COMMAND_SPELL_COUNT = 24
    COUNT_STAR = 25
    TARGET_POSITION = 26
    COUNT_TARGET_BUFF_INDIVIDUALITY_SUM = 27
    DEAD = 28
    PRECEDING_ENEMY = 29
    REMAIN_TURN = 30
    MASTER_COMMAND_SPELL_COUNT = 31
    CHECK_MASTER_SKILL_THISTURN = 32
    CHAIN_COUNT = 33
    CHECK_TARGET_SKILL_THISTURN = 34
    CHECK_SELECT_CHAIN = 35
    COUNT_PLAYER_NP = 36
    COUNT_PLAYER_SKILL = 37
    COUNT_PLAYER_SKILL_INCLUDE_MASTER_SKILL = 38
    TOTAL_TURN = 39
    WAR_BOARD_SQUARE_INDIVIDUALITY = 40
    CHECK_BATTLE_VALUE = 41
    CHECK_PLAYER_MASTER_SKILL_INDEX = 42
    CHECK_PLAYER_MASTER_SKILL_INDEX_THIS_TURN = 43
    COUNT_PLAYER_MASTER_SKILL_THIS_TURN = 44
    COUNT_PLAYER_MASTER_SKILL_THIS_WAVE = 45
    COUNT_AVAILABLE_PLAYER_AND_MASTER_SKILL = 46
    COUNT_AVAILABLE_PLAYER_SKILL = 47
    COUNT_AVAILABLE_MASTER_SKILL = 48
    COMMON_RELEASE_ID = 49


class NiceAiCondParameter(StrEnum):
    """Ai Condition Parameter"""

    none = "none"
    turn = "turn"
    space = "space"
    prevActid = "prevActid"
    prevActtype = "prevActtype"
    hp = "hp"
    npgauge = "npgauge"
    tdturn = "tdturn"
    actCount = "actCount"
    actCountThisturn = "actCountThisturn"
    turnField = "turnField"
    turnActCount = "turnActCount"
    buffId = "buffId"
    individuality = "individuality"
    buffIndividuality = "buffIndividuality"
    buffActiveIndividuality = "buffActiveIndividuality"
    raidHp = "raidHp"
    raidCount = "raidCount"
    raidCountValue = "raidCountValue"
    countAlive = "countAlive"
    countRest = "countRest"
    countItem = "countItem"
    countBuffcountIndividuality = "countBuffcountIndividuality"
    buffActiveId = "buffActiveId"
    enemyMasterCommandSpellCount = "enemyMasterCommandSpellCount"
    countStar = "countStar"
    targetPosition = "targetPosition"
    countTargetBuffIndividualitySum = "countTargetBuffIndividualitySum"
    dead = "dead"
    precedingEnemy = "precedingEnemy"
    remainTurn = "remainTurn"
    masterCommandSpellCount = "masterCommandSpellCount"
    checkMasterSkillThisturn = "checkMasterSkillThisturn"
    chainCount = "chainCount"
    checkTargetSkillThisturn = "checkTargetSkillThisturn"
    checkSelectChain = "checkSelectChain"
    countPlayerNp = "countPlayerNp"
    countPlayerSkill = "countPlayerSkill"
    countPlayerSkillIncludeMasterSkill = "countPlayerSkillIncludeMasterSkill"
    totalTurn = "totalTurn"
    warBoardSquareIndividuality = "warBoardSquareIndividuality"
    checkBattleValue = "checkBattleValue"
    checkPlayerMasterSkillIndex = "checkPlayerMasterSkillIndex"
    checkPlayerMasterSkillIndexThisTurn = "checkPlayerMasterSkillIndexThisTurn"
    countPlayerMasterSkillThisTurn = "countPlayerMasterSkillThisTurn"
    countPlayerMasterSkillThisWave = "countPlayerMasterSkillThisWave"
    countAvailablePlayerAndMasterSkill = "countAvailablePlayerAndMasterSkill"
    countAvailablePlayerSkill = "countAvailablePlayerSkill"
    countAvailableMasterSkill = "countAvailableMasterSkill"
    commonReleaseId = "commonReleaseId"


AI_COND_PARAMETER_NAME: dict[int, NiceAiCondParameter] = {
    0: NiceAiCondParameter.none,
    1: NiceAiCondParameter.turn,
    2: NiceAiCondParameter.space,
    3: NiceAiCondParameter.prevActid,
    4: NiceAiCondParameter.prevActtype,
    5: NiceAiCondParameter.hp,
    6: NiceAiCondParameter.npgauge,
    7: NiceAiCondParameter.tdturn,
    8: NiceAiCondParameter.actCount,
    9: NiceAiCondParameter.actCountThisturn,
    10: NiceAiCondParameter.turnField,
    11: NiceAiCondParameter.turnActCount,
    12: NiceAiCondParameter.buffId,
    13: NiceAiCondParameter.individuality,
    14: NiceAiCondParameter.buffIndividuality,
    15: NiceAiCondParameter.buffActiveIndividuality,
    16: NiceAiCondParameter.raidHp,
    17: NiceAiCondParameter.raidCount,
    18: NiceAiCondParameter.raidCountValue,
    19: NiceAiCondParameter.countAlive,
    20: NiceAiCondParameter.countRest,
    21: NiceAiCondParameter.countItem,
    22: NiceAiCondParameter.countBuffcountIndividuality,
    23: NiceAiCondParameter.buffActiveId,
    24: NiceAiCondParameter.enemyMasterCommandSpellCount,
    25: NiceAiCondParameter.countStar,
    26: NiceAiCondParameter.targetPosition,
    27: NiceAiCondParameter.countTargetBuffIndividualitySum,
    28: NiceAiCondParameter.dead,
    29: NiceAiCondParameter.precedingEnemy,
    30: NiceAiCondParameter.remainTurn,
    31: NiceAiCondParameter.masterCommandSpellCount,
    32: NiceAiCondParameter.checkMasterSkillThisturn,
    33: NiceAiCondParameter.chainCount,
    34: NiceAiCondParameter.checkTargetSkillThisturn,
    35: NiceAiCondParameter.checkSelectChain,
    36: NiceAiCondParameter.countPlayerNp,
    37: NiceAiCondParameter.countPlayerSkill,
    38: NiceAiCondParameter.countPlayerSkillIncludeMasterSkill,
    39: NiceAiCondParameter.totalTurn,
    40: NiceAiCondParameter.warBoardSquareIndividuality,
    41: NiceAiCondParameter.checkBattleValue,
    42: NiceAiCondParameter.checkPlayerMasterSkillIndex,
    43: NiceAiCondParameter.checkPlayerMasterSkillIndexThisTurn,
    44: NiceAiCondParameter.countPlayerMasterSkillThisTurn,
    45: NiceAiCondParameter.countPlayerMasterSkillThisWave,
    46: NiceAiCondParameter.countAvailablePlayerAndMasterSkill,
    47: NiceAiCondParameter.countAvailablePlayerSkill,
    48: NiceAiCondParameter.countAvailableMasterSkill,
    49: NiceAiCondParameter.commonReleaseId,
}


class AiRefineTarget(IntEnum):
    ANY = 0
    ALL = 1
    HIGHER = 2
    LOWER = 3
    TOTAL_COUNT = 4


class NiceAiCondRefine(StrEnum):
    """Ai Condition Refine"""

    any = "any"
    all = "all"
    higher = "higher"
    lower_ = "lower"
    totalCount = "totalCount"


AI_COND_REFINE_NAME: dict[int, NiceAiCondRefine] = {
    0: NiceAiCondRefine.any,
    1: NiceAiCondRefine.all,
    2: NiceAiCondRefine.higher,
    3: NiceAiCondRefine.lower_,
    4: NiceAiCondRefine.totalCount,
}


class AiCheckTarget(IntEnum):
    NONE = 0
    EQUAL = 1
    EQUAL_NOT = 2
    HIGHER = 3
    LOWER = 4
    MULTIPLE = 5
    EXIST = 6
    BETWEEN = 7
    BETWEEN_NOT = 8
    ALL_EXIST = 9


class NiceAiCondCheck(StrEnum):
    """Ai Condition Check"""

    none = "none"
    equal = "equal"
    equalNot = "equalNot"
    higher = "higher"
    lower_ = "lower"
    multiple = "multiple"
    exist = "exist"
    between = "between"
    betweenNot = "betweenNot"
    allExist = "allExist"


AI_COND_CHECK_NAME: dict[int, NiceAiCondCheck] = {
    0: NiceAiCondCheck.none,
    1: NiceAiCondCheck.equal,
    2: NiceAiCondCheck.equalNot,
    3: NiceAiCondCheck.higher,
    4: NiceAiCondCheck.lower_,
    5: NiceAiCondCheck.multiple,
    6: NiceAiCondCheck.exist,
    7: NiceAiCondCheck.between,
    8: NiceAiCondCheck.betweenNot,
    9: NiceAiCondCheck.allExist,
}


class TreasureDeviceEffectFlag(IntEnum):
    SUPPORT = -1
    ATTACK_ENEMY_ALL = 1
    ATTACK_ENEMY_ONE = 2


class NiceTdEffectFlag(StrEnum):
    """Treasure Device Effect Flag"""

    support = "support"
    attackEnemyAll = "attackEnemyAll"
    attackEnemyOne = "attackEnemyOne"


TREASURE_DEVICE_EFFECT_FLAG_NAME: dict[int, NiceTdEffectFlag] = {
    -1: NiceTdEffectFlag.support,
    1: NiceTdEffectFlag.attackEnemyAll,
    2: NiceTdEffectFlag.attackEnemyOne,
}


class CombineAdjustTargetType(IntEnum):
    COMBINE_QP = 1
    COMBINE_EXP = 2
    ACTIVE_SKILL = 3
    LARGE_SUCCESS = 4
    SUPER_SUCCESS = 5
    LIMIT_QP = 6
    LIMIT_ITEM = 7
    SKILL_QP = 8
    SKILL_ITEM = 9
    TREASURE_DEVICE_QP = 10
    TREASURE_DEVICE_ITEM = 11
    QUEST_AP = 12
    QUEST_EXP = 13
    QUEST_QP = 14
    QUEST_DROP = 15
    SVTEQUIP_COMBINE_QP = 16
    SVTEQUIP_COMBINE_EXP = 17
    SVTEQUIP_LARGE_SUCCESS = 18
    SVTEQUIP_SUPER_SUCCESS = 19
    QUEST_EVENT_POINT = 20
    ENEMY_SVT_CLASS_PICK_UP = 21
    EVENT_EACH_DROP_NUM = 22
    EVENT_EACH_DROP_RATE = 23
    QUEST_FP = 24
    QUEST_AP_FIRST_TIME = 25
    DAILY_DROP_UP = 26
    EXCHANGE_SVT_COMBINE_EXP = 27
    QUEST_USE_CONTINUE_ITEM = 28
    FRIEND_POINT_GACHA_FREE_DRAW_NUM = 29
    QUEST_USE_FRIENDSHIP_UP_ITEM = 30
    QUEST_FRIENDSHIP = 31
    LARGE_SUCCESS_BY_CLASS = 32
    SUPER_SUCCESS_BY_CLASS = 33
    EXCHANGE_SVT = 34
    QUEST_ITEM_FIRST_TIME = 35
    QUEST_USE_REWARD_ADD_ITEM = 36
    QUEST_EQUIP_EXP = 37
    QUEST_PASSIVE_SKILL = 38


class NiceCombineAdjustTarget(StrEnum):
    """Combine Adjust Target Type"""

    combineQp = "combineQp"
    combineExp = "combineExp"
    activeSkill = "activeSkill"
    largeSuccess = "largeSuccess"
    superSuccess = "superSuccess"
    limitQp = "limitQp"
    limitItem = "limitItem"
    skillQp = "skillQp"
    skillItem = "skillItem"
    treasureDeviceQp = "treasureDeviceQp"
    treasureDeviceItem = "treasureDeviceItem"
    questAp = "questAp"
    questExp = "questExp"
    questQp = "questQp"
    questDrop = "questDrop"
    svtequipCombineQp = "svtequipCombineQp"
    svtequipCombineExp = "svtequipCombineExp"
    svtequipLargeSuccess = "svtequipLargeSuccess"
    svtequipSuperSuccess = "svtequipSuperSuccess"
    questEventPoint = "questEventPoint"
    enemySvtClassPickUp = "enemySvtClassPickUp"
    eventEachDropNum = "eventEachDropNum"
    eventEachDropRate = "eventEachDropRate"
    questFp = "questFp"
    questApFirstTime = "questApFirstTime"
    dailyDropUp = "dailyDropUp"
    exchangeSvtCombineExp = "exchangeSvtCombineExp"
    questUseContinueItem = "questUseContinueItem"
    friendPointGachaFreeDrawNum = "friendPointGachaFreeDrawNum"
    questUseFriendshipUpItem = "questUseFriendshipUpItem"
    questFriendship = "questFriendship"
    largeSuccessByClass = "largeSuccessByClass"
    superSuccessByClass = "superSuccessByClass"
    exchangeSvt = "exchangeSvt"
    questItemFirstTime = "questItemFirstTime"
    questUseRewardAddItem = "questUseRewardAddItem"
    questEquipExp = "questEquipExp"
    questPassiveSkill = "questPassiveSkill"


COMBINE_ADJUST_TARGET_TYPE_NAME: dict[int, NiceCombineAdjustTarget] = {
    1: NiceCombineAdjustTarget.combineQp,
    2: NiceCombineAdjustTarget.combineExp,
    3: NiceCombineAdjustTarget.activeSkill,
    4: NiceCombineAdjustTarget.largeSuccess,
    5: NiceCombineAdjustTarget.superSuccess,
    6: NiceCombineAdjustTarget.limitQp,
    7: NiceCombineAdjustTarget.limitItem,
    8: NiceCombineAdjustTarget.skillQp,
    9: NiceCombineAdjustTarget.skillItem,
    10: NiceCombineAdjustTarget.treasureDeviceQp,
    11: NiceCombineAdjustTarget.treasureDeviceItem,
    12: NiceCombineAdjustTarget.questAp,
    13: NiceCombineAdjustTarget.questExp,
    14: NiceCombineAdjustTarget.questQp,
    15: NiceCombineAdjustTarget.questDrop,
    16: NiceCombineAdjustTarget.svtequipCombineQp,
    17: NiceCombineAdjustTarget.svtequipCombineExp,
    18: NiceCombineAdjustTarget.svtequipLargeSuccess,
    19: NiceCombineAdjustTarget.svtequipSuperSuccess,
    20: NiceCombineAdjustTarget.questEventPoint,
    21: NiceCombineAdjustTarget.enemySvtClassPickUp,
    22: NiceCombineAdjustTarget.eventEachDropNum,
    23: NiceCombineAdjustTarget.eventEachDropRate,
    24: NiceCombineAdjustTarget.questFp,
    25: NiceCombineAdjustTarget.questApFirstTime,
    26: NiceCombineAdjustTarget.dailyDropUp,
    27: NiceCombineAdjustTarget.exchangeSvtCombineExp,
    28: NiceCombineAdjustTarget.questUseContinueItem,
    29: NiceCombineAdjustTarget.friendPointGachaFreeDrawNum,
    30: NiceCombineAdjustTarget.questUseFriendshipUpItem,
    31: NiceCombineAdjustTarget.questFriendship,
    32: NiceCombineAdjustTarget.largeSuccessByClass,
    33: NiceCombineAdjustTarget.superSuccessByClass,
    34: NiceCombineAdjustTarget.exchangeSvt,
    35: NiceCombineAdjustTarget.questItemFirstTime,
    36: NiceCombineAdjustTarget.questUseRewardAddItem,
    37: NiceCombineAdjustTarget.questEquipExp,
    38: NiceCombineAdjustTarget.questPassiveSkill,
}


class EventCombineEntityCalcType(IntEnum):
    ADDITION = 1
    MULTIPLICATION = 2
    FIXED_VALUE = 3
    NONE = 4


class NiceEventCombineCalc(StrEnum):
    """Event Combine Calc Type"""

    addition = "addition"
    multiplication = "multiplication"
    fixedValue = "fixedValue"
    none = "none"


EVENT_COMBINE_CALC_TYPE_NAME: dict[int, NiceEventCombineCalc] = {
    1: NiceEventCombineCalc.addition,
    2: NiceEventCombineCalc.multiplication,
    3: NiceEventCombineCalc.fixedValue,
    4: NiceEventCombineCalc.none,
}


class EventWorkType(IntEnum):
    MILITSRY_AFFAIRS = 1
    INTERNAL_AFFAIRS = 2
    FARMMING = 3


class NiceEventWorkType(StrEnum):
    """Event Fortification Work Type"""

    militsryAffairs = "militsryAffairs"
    internalAffairs = "internalAffairs"
    farmming = "farmming"


EVENT_WORK_TYPE_NAME: dict[int, NiceEventWorkType] = {
    1: NiceEventWorkType.militsryAffairs,
    2: NiceEventWorkType.internalAffairs,
    3: NiceEventWorkType.farmming,
}


class EventFortificationSvtType(IntEnum):
    USER_SVT = 0
    NPC = 1
    NONE = 2


class NiceEventFortificationSvtType(StrEnum):
    """Event Fortification Servant Type"""

    userSvt = "userSvt"
    npc = "npc"
    none = "none"


EVENT_FORTIFICATION_SVT_TYPE_NAME: dict[int, NiceEventFortificationSvtType] = {
    0: NiceEventFortificationSvtType.userSvt,
    1: NiceEventFortificationSvtType.npc,
    2: NiceEventFortificationSvtType.none,
}


class EventTradeGoodsBoardType(IntEnum):
    TRADE = 0
    CRAFT = 1


class NiceEventTradeGoodsBoardType(StrEnum):
    """Event Trade Goods Board Type"""

    trade = "trade"
    craft = "craft"


EVENT_TRADE_GOODS_BOARD_TYPE: dict[int, NiceEventTradeGoodsBoardType] = {
    0: NiceEventTradeGoodsBoardType.trade,
    1: NiceEventTradeGoodsBoardType.craft,
}


class ServantClassSupportGroupType(IntEnum):
    ALL = 0
    SABER = 1
    ARCHER = 2
    LANCER = 3
    RIDER = 4
    CASTER = 5
    ASSASSIN = 6
    BERSERKER = 7
    EXTRA = 8
    MIX = 9
    RECOMMEND = 10
    NOT_SUPPORT = 999


class NiceSvtClassSupportGroupType(StrEnum):
    """Servant Class Support Group Type"""

    all = "all"
    saber = "saber"
    archer = "archer"
    lancer = "lancer"
    rider = "rider"
    caster = "caster"
    assassin = "assassin"
    berserker = "berserker"
    extra = "extra"
    mix = "mix"
    recommend = "recommend"
    notSupport = "notSupport"


SVT_CLASS_SUPPORT_GROUP_TYPE_NAME: dict[int, NiceSvtClassSupportGroupType] = {
    0: NiceSvtClassSupportGroupType.all,
    1: NiceSvtClassSupportGroupType.saber,
    2: NiceSvtClassSupportGroupType.archer,
    3: NiceSvtClassSupportGroupType.lancer,
    4: NiceSvtClassSupportGroupType.rider,
    5: NiceSvtClassSupportGroupType.caster,
    6: NiceSvtClassSupportGroupType.assassin,
    7: NiceSvtClassSupportGroupType.berserker,
    8: NiceSvtClassSupportGroupType.extra,
    9: NiceSvtClassSupportGroupType.mix,
    10: NiceSvtClassSupportGroupType.recommend,
    999: NiceSvtClassSupportGroupType.notSupport,
}


class RestrictionType(IntEnum):
    INDIVIDUALITY = 1
    RARITY = 2
    TOTAL_COST = 3
    LV = 4
    SUPPORT_ONLY = 5
    UNIQUE_SVT_ONLY = 6
    FIXED_SUPPORT_POSITION = 7
    FIXED_MY_SVT_INDIVIDUALITY_POSITION_MAIN = 8
    FIXED_MY_SVT_INDIVIDUALITY_SINGLE = 9
    SVT_NUM = 10
    MY_SVT_NUM = 11
    MY_SVT_OR_NPC = 12
    ALLOUT_BATTLE_UNIQUE_SVT = 13
    FIXED_SVT_INDIVIDUALITY_POSITION_MAIN = 14
    UNIQUE_INDIVIDUALITY = 15
    MY_SVT_OR_SUPPORT = 16
    DATA_LOST_BATTLE_UNIQUE_SVT = 17
    MY_GRAND_SVT = 21
    FIXED_MY_GRAND_SVT = 22
    MY_GRAND_SVT_POSITION_MAIN = 23
    FIXED_COSTUME = 101


class NiceRestrictionType(StrEnum):
    """Restriction Type"""

    individuality = "individuality"
    rarity = "rarity"
    totalCost = "totalCost"
    lv = "lv"
    supportOnly = "supportOnly"
    uniqueSvtOnly = "uniqueSvtOnly"
    fixedSupportPosition = "fixedSupportPosition"
    fixedMySvtIndividualityPositionMain = "fixedMySvtIndividualityPositionMain"
    fixedMySvtIndividualitySingle = "fixedMySvtIndividualitySingle"
    svtNum = "svtNum"
    mySvtNum = "mySvtNum"
    mySvtOrNpc = "mySvtOrNpc"
    alloutBattleUniqueSvt = "alloutBattleUniqueSvt"
    fixedSvtIndividualityPositionMain = "fixedSvtIndividualityPositionMain"
    uniqueIndividuality = "uniqueIndividuality"
    mySvtOrSupport = "mySvtOrSupport"
    dataLostBattleUniqueSvt = "dataLostBattleUniqueSvt"
    myGrandSvt = "myGrandSvt"
    fixedMyGrandSvt = "fixedMyGrandSvt"
    myGrandSvtPositionMain = "myGrandSvtPositionMain"
    fixedCostume = "fixedCostume"


RESTRICTION_TYPE_NAME: dict[int, NiceRestrictionType] = {
    1: NiceRestrictionType.individuality,
    2: NiceRestrictionType.rarity,
    3: NiceRestrictionType.totalCost,
    4: NiceRestrictionType.lv,
    5: NiceRestrictionType.supportOnly,
    6: NiceRestrictionType.uniqueSvtOnly,
    7: NiceRestrictionType.fixedSupportPosition,
    8: NiceRestrictionType.fixedMySvtIndividualityPositionMain,
    9: NiceRestrictionType.fixedMySvtIndividualitySingle,
    10: NiceRestrictionType.svtNum,
    11: NiceRestrictionType.mySvtNum,
    12: NiceRestrictionType.mySvtOrNpc,
    13: NiceRestrictionType.alloutBattleUniqueSvt,
    14: NiceRestrictionType.fixedSvtIndividualityPositionMain,
    15: NiceRestrictionType.uniqueIndividuality,
    16: NiceRestrictionType.mySvtOrSupport,
    17: NiceRestrictionType.dataLostBattleUniqueSvt,
    21: NiceRestrictionType.myGrandSvt,
    22: NiceRestrictionType.fixedMyGrandSvt,
    23: NiceRestrictionType.myGrandSvtPositionMain,
    101: NiceRestrictionType.fixedCostume,
}


class RestrictionRangeType(IntEnum):
    NONE = 0
    EQUAL = 1
    NOT_EQUAL = 2
    ABOVE = 3
    BELOW = 4
    BETWEEN = 5


class NiceRestrictionRangeType(StrEnum):
    """Restriction Range Type"""

    none = "none"
    equal = "equal"
    notEqual = "notEqual"
    above = "above"
    below = "below"
    between = "between"


RESTRICTION_RANGE_TYPE_NAME: dict[int, NiceRestrictionRangeType] = {
    0: NiceRestrictionRangeType.none,
    1: NiceRestrictionRangeType.equal,
    2: NiceRestrictionRangeType.notEqual,
    3: NiceRestrictionRangeType.above,
    4: NiceRestrictionRangeType.below,
    5: NiceRestrictionRangeType.between,
}


class FrequencyType(IntEnum):
    NONE = 0
    ONCE = 1
    ONCE_UNTIL_REBOOT = 2
    EVERY_TIME = 3
    VALENTINE = 4
    EVERY_TIME_AFTER = 5
    EVERY_TIME_BEFORE = 6
    ONCE_UNTIL_REMIND = 7


class NiceFrequencyType(StrEnum):
    """Frequency Type"""

    none = "none"
    once = "once"
    onceUntilReboot = "onceUntilReboot"
    everyTime = "everyTime"
    valentine = "valentine"
    everyTimeAfter = "everyTimeAfter"
    everyTimeBefore = "everyTimeBefore"
    onceUntilRemind = "onceUntilRemind"


FREQUENCY_TYPE_NAME: dict[int, NiceFrequencyType] = {
    0: NiceFrequencyType.none,
    1: NiceFrequencyType.once,
    2: NiceFrequencyType.onceUntilReboot,
    3: NiceFrequencyType.everyTime,
    4: NiceFrequencyType.valentine,
    5: NiceFrequencyType.everyTimeAfter,
    6: NiceFrequencyType.everyTimeBefore,
    7: NiceFrequencyType.onceUntilRemind,
}


class CommandCardAttackType(IntEnum):
    ONE = 1
    ALL = 2


class NiceCommandCardAttackType(StrEnum):
    """Command Card Attack Type"""

    one = "one"
    all = "all"


COMMAND_CARD_ATK_TYPE_NAME: dict[int, NiceCommandCardAttackType] = {
    1: NiceCommandCardAttackType.one,
    2: NiceCommandCardAttackType.all,
}


class SpotOverwriteType(IntEnum):
    NONE = 0
    FLAG = 1
    PATH_POINT_RATIO = 2
    PATH_POINT_RATIO_LIMIT = 3
    NAME_PANEL_OFFSET_X = 4
    NAME_PANEL_OFFSET_Y = 5
    NAME = 6


class NiceSpotOverwriteType(StrEnum):
    """Spot Overwrite Type"""

    none = "none"
    flag = "flag"
    pathPointRatio = "pathPointRatio"
    pathPointRatioLimit = "pathPointRatioLimit"
    namePanelOffsetX = "namePanelOffsetX"
    namePanelOffsetY = "namePanelOffsetY"
    name_ = "name"


SPOT_OVERWRITE_TYPE_NAME: dict[int, NiceSpotOverwriteType] = {
    0: NiceSpotOverwriteType.none,
    1: NiceSpotOverwriteType.flag,
    2: NiceSpotOverwriteType.pathPointRatio,
    3: NiceSpotOverwriteType.pathPointRatioLimit,
    4: NiceSpotOverwriteType.namePanelOffsetX,
    5: NiceSpotOverwriteType.namePanelOffsetY,
    6: NiceSpotOverwriteType.name_,
}


class BuffConvertType(IntEnum):
    NONE = 0
    BUFF = 1
    INDIVIDUALITY = 2


class NiceBuffConvertType(StrEnum):
    """Buff Convert Type"""

    none = "none"
    buff = "buff"
    individuality = "individuality"


BUFF_CONVERT_TYPE_NAME: dict[int, NiceBuffConvertType] = {
    0: NiceBuffConvertType.none,
    1: NiceBuffConvertType.buff,
    2: NiceBuffConvertType.individuality,
}


class BuffConvertLimitType(IntEnum):
    ALL = 0
    SELF = 1


class NiceBuffConvertLimitType(StrEnum):
    """Buff Convert Limit Type"""

    all = "all"
    self_ = "self"


BUFF_CONVERT_LIMIT_TYPE_NAME: dict[int, NiceBuffConvertLimitType] = {
    0: NiceBuffConvertLimitType.all,
    1: NiceBuffConvertLimitType.self_,
}


class NpcServantFollowerFlag(IntEnum):
    NPC = 1
    HIDE_SUPPORT = 2
    NOT_USED_TREASURE_DEVICE = 4
    NO_DISPLAY_BONUS_ICON = 8
    APPLY_SVT_CHANGE = 16
    HIDE_EQUIP = 32
    NO_DISPLAY_BONUS_ICON_EQUIP = 64
    HIDE_TREASURE_DEVICE_LV = 256
    HIDE_TREASURE_DEVICE_DETAIL = 512
    HIDE_RARITY = 1024
    NOT_CLASS_BOARD = 2048


class NiceNpcServantFollowerFlag(StrEnum):
    """NPC Servant Follower Flag"""

    npc = "npc"
    hideSupport = "hideSupport"
    notUsedTreasureDevice = "notUsedTreasureDevice"
    noDisplayBonusIcon = "noDisplayBonusIcon"
    applySvtChange = "applySvtChange"
    hideEquip = "hideEquip"
    noDisplayBonusIconEquip = "noDisplayBonusIconEquip"
    hideTreasureDeviceLv = "hideTreasureDeviceLv"
    hideTreasureDeviceDetail = "hideTreasureDeviceDetail"
    hideRarity = "hideRarity"
    notClassBoard = "notClassBoard"


NPC_SERVANT_FOLLOWER_FLAG_NAME: dict[int, NiceNpcServantFollowerFlag] = {
    1: NiceNpcServantFollowerFlag.npc,
    2: NiceNpcServantFollowerFlag.hideSupport,
    4: NiceNpcServantFollowerFlag.notUsedTreasureDevice,
    8: NiceNpcServantFollowerFlag.noDisplayBonusIcon,
    16: NiceNpcServantFollowerFlag.applySvtChange,
    32: NiceNpcServantFollowerFlag.hideEquip,
    64: NiceNpcServantFollowerFlag.noDisplayBonusIconEquip,
    256: NiceNpcServantFollowerFlag.hideTreasureDeviceLv,
    512: NiceNpcServantFollowerFlag.hideTreasureDeviceDetail,
    1024: NiceNpcServantFollowerFlag.hideRarity,
    2048: NiceNpcServantFollowerFlag.notClassBoard,
}


class ClassBoardSquareFlag(IntEnum):
    START = 1
    BLANK = 2


class NiceClassBoardSquareFlag(StrEnum):
    """Class Board Square Flag"""

    start = "start"
    blank = "blank"


CLASS_BOARD_SQUARE_FLAG_NAME: dict[int, NiceClassBoardSquareFlag] = {
    1: NiceClassBoardSquareFlag.start,
    2: NiceClassBoardSquareFlag.blank,
}


class ClassBoardSkillType(IntEnum):
    NONE = 0
    PASSIVE = 1
    COMMAND_SPELL = 2


class NiceClassBoardSkillType(StrEnum):
    """Class Board Skill Type"""

    none = "none"
    passive = "passive"
    commandSpell = "commandSpell"


CLASS_BOARD_SKILL_TYPE_NAME: dict[int, NiceClassBoardSkillType] = {
    0: NiceClassBoardSkillType.none,
    1: NiceClassBoardSkillType.passive,
    2: NiceClassBoardSkillType.commandSpell,
}


class WarBoardStageLayoutType(IntEnum):
    NORMAL = 1
    ITEM = 2
    EFFECT = 3
    TREASURE = 4
    WALL = 5


class NiceWarBoardStageSquareType(StrEnum):
    """War Board Stage Square Type"""

    normal = "normal"
    item = "item"
    effect = "effect"
    treasure = "treasure"
    wall = "wall"


WAR_BOARD_STAGE_SQUARE_TYPE_NAME: dict[int, NiceWarBoardStageSquareType] = {
    1: NiceWarBoardStageSquareType.normal,
    2: NiceWarBoardStageSquareType.item,
    3: NiceWarBoardStageSquareType.effect,
    4: NiceWarBoardStageSquareType.treasure,
    5: NiceWarBoardStageSquareType.wall,
}


class WarBoardTreasureRarity(IntEnum):
    COMMON = 0
    RARE = 1
    SRARE = 2
    COMMON_PLUS = 3
    RARE_PLUS = 4
    SRARE_PLUS = 5
    COMMON_PLUS2 = 6
    RARE_PLUS2 = 7
    SRARE_PLUS2 = 8
    ITEM_ICON = 9
    ITEM_ICON_PLUS = 10
    ITEM_ICON_PLUS2 = 11


class NiceWarBoardTreasureRarity(StrEnum):
    """War Board Treasure Rarity"""

    common = "common"
    rare = "rare"
    srare = "srare"
    commonPlus = "commonPlus"
    rarePlus = "rarePlus"
    srarePlus = "srarePlus"
    commonPlus2 = "commonPlus2"
    rarePlus2 = "rarePlus2"
    srarePlus2 = "srarePlus2"
    itemIcon = "itemIcon"
    itemIconPlus = "itemIconPlus"
    itemIconPlus2 = "itemIconPlus2"


WAR_BOARD_TREASURE_RARITY_NAME: dict[int, NiceWarBoardTreasureRarity] = {
    0: NiceWarBoardTreasureRarity.common,
    1: NiceWarBoardTreasureRarity.rare,
    2: NiceWarBoardTreasureRarity.srare,
    3: NiceWarBoardTreasureRarity.commonPlus,
    4: NiceWarBoardTreasureRarity.rarePlus,
    5: NiceWarBoardTreasureRarity.srarePlus,
    6: NiceWarBoardTreasureRarity.commonPlus2,
    7: NiceWarBoardTreasureRarity.rarePlus2,
    8: NiceWarBoardTreasureRarity.srarePlus2,
    9: NiceWarBoardTreasureRarity.itemIcon,
    10: NiceWarBoardTreasureRarity.itemIconPlus,
    11: NiceWarBoardTreasureRarity.itemIconPlus2,
}


class BattleFieldEnvironmentDataGrantType(IntEnum):
    None_ = 0
    Stage = 1
    Function = 2


class NiceBattleFieldEnvironmentGrantType(StrEnum):
    """Battle Field Environment Grant Type"""

    none = "none"
    stage = "stage"
    function = "function"


BATTLE_ENVIRONMENT_GRANT_TYPE_NAME: dict[int, NiceBattleFieldEnvironmentGrantType] = {
    0: NiceBattleFieldEnvironmentGrantType.none,
    1: NiceBattleFieldEnvironmentGrantType.stage,
    2: NiceBattleFieldEnvironmentGrantType.function,
}


class ServantOverwriteType(IntEnum):
    TREASURE_DEVICE = 1


class NiceServantOverwriteType(StrEnum):
    """Servant Overwrite Type"""

    treasureDevice = "treasureDevice"


SERVANT_OVERWRITE_TYPE_NAME: dict[int, NiceServantOverwriteType] = {
    1: NiceServantOverwriteType.treasureDevice,
}


class GachaFlag(IntEnum):
    PC_MESSAGE = 2
    BONUS_SELECT = 8
    DISPLAY_FEATURED_SVT = 16


class NiceGachaFlag(StrEnum):
    """Gacha Flag"""

    pcMessage = "pcMessage"
    bonusSelect = "bonusSelect"
    displayFeaturedSvt = "displayFeaturedSvt"


GACHA_FLAG_NAME: dict[int, NiceGachaFlag] = {
    2: NiceGachaFlag.pcMessage,
    8: NiceGachaFlag.bonusSelect,
    16: NiceGachaFlag.displayFeaturedSvt,
}


class EventSvtType(IntEnum):
    NONE = 0
    JOIN = 1
    COND_JOIN = 2
    DIRECT_JOIN = 3


class NiceEventSvtType(StrEnum):
    """Event Svt Type"""

    none = "none"
    join_ = "join"
    condJoin = "condJoin"
    directJoin = "directJoin"


EVENT_SVT_TYPE_NAME: dict[int, NiceEventSvtType] = {
    0: NiceEventSvtType.none,
    1: NiceEventSvtType.join_,
    2: NiceEventSvtType.condJoin,
    3: NiceEventSvtType.directJoin,
}


class SvtDeadType(IntEnum):
    NORMAL = 0
    ESCAPE = 1
    STAND = 2
    EFFECT = 3
    WAIT = 4
    ENERGY = 5
    CRYSTAL = 6
    EXPLOSION = 7


class NiceSvtDeadType(StrEnum):
    """Svt Dead Type"""

    normal = "normal"
    escape = "escape"
    stand = "stand"
    effect = "effect"
    wait = "wait"
    energy = "energy"
    crystal = "crystal"
    explosion = "explosion"


SVT_DEAD_TYPE_NAME: dict[int, NiceSvtDeadType] = {
    0: NiceSvtDeadType.normal,
    1: NiceSvtDeadType.escape,
    2: NiceSvtDeadType.stand,
    3: NiceSvtDeadType.effect,
    4: NiceSvtDeadType.wait,
    5: NiceSvtDeadType.energy,
    6: NiceSvtDeadType.crystal,
    7: NiceSvtDeadType.explosion,
}


class AiAllocationSvtFlag(IntEnum):
    ALL = 0
    OWN = 1
    FRIEND = 2
    NPC = 4


class NiceAiAllocationSvtFlag(StrEnum):
    """AI Allocation Svt Flag"""

    all = "all"
    own = "own"
    friend = "friend"
    npc = "npc"


AI_ALLOCATION_SVT_FLAG_NAME: dict[int, NiceAiAllocationSvtFlag] = {
    0: NiceAiAllocationSvtFlag.all,
    1: NiceAiAllocationSvtFlag.own,
    2: NiceAiAllocationSvtFlag.friend,
    4: NiceAiAllocationSvtFlag.npc,
}


class SvtMultiPortraitSceneOverwriteType(IntEnum):
    NONE = 0
    COMBINE = 1
    LIMIT_UP = 2
    GRAND_SELECT = 3


class NiceSvtMultiPortraitType(StrEnum):
    """Svt Multi Portrait Scene Overwrite Type"""

    none = "none"
    combine = "combine"
    limitUp = "limitUp"
    grandSelect = "grandSelect"


SVT_MULTI_PORTRAIT_SCENE_TYPE_NAME: dict[int, NiceSvtMultiPortraitType] = {
    0: NiceSvtMultiPortraitType.none,
    1: NiceSvtMultiPortraitType.combine,
    2: NiceSvtMultiPortraitType.limitUp,
    3: NiceSvtMultiPortraitType.grandSelect,
}


class NpcFollowerEntityFlag(IntEnum):
    RECOMMENDED_ICON = 1
    IS_MY_SVT_OR_NPC = 2
    FIXED_NPC = 4


class NiceNpcFollowerEntityFlag(StrEnum):
    """NPC Follower Flag"""

    recommendedIcon = "recommendedIcon"
    isMySvtOrNpc = "isMySvtOrNpc"
    fixedNpc = "fixedNpc"


NPC_FOLLOWER_FLAG_NAME: dict[int, NiceNpcFollowerEntityFlag] = {
    1: NiceNpcFollowerEntityFlag.recommendedIcon,
    2: NiceNpcFollowerEntityFlag.isMySvtOrNpc,
    4: NiceNpcFollowerEntityFlag.fixedNpc,
}


class SvtAttribute(IntEnum):
    NONE = 0
    DEFAULT = -1
    HUMAN = 1
    SKY = 2
    GROUND = 3
    STAR = 4
    BEAST = 5
    VOID = 10


class Attribute(StrEnum):
    """Svt Attribute"""

    none = "none"
    default = "default"
    human = "human"
    sky = "sky"
    ground = "earth"
    star = "star"
    beast = "beast"
    void = "void"


ATTRIBUTE_NAME: dict[int, Attribute] = {
    0: Attribute.none,
    -1: Attribute.default,
    1: Attribute.human,
    2: Attribute.sky,
    3: Attribute.ground,
    4: Attribute.star,
    5: Attribute.beast,
    10: Attribute.void,
}


class BattlePointFlag(IntEnum):
    NONE = 0
    NOT_TARGET_OTHER_PLAYER = 1
    HIDE_UI_GAUGE_ALL_TIME = 2
    HIDE_UI_GAUGE_WHEN_CANT_ADD_POINT = 4
    HIDE_UI_GAUGE_WHEN_CANT_ADD_POINT_AND_FOLLOWER_SUPPORT = 8


class NiceBattlePointFlag(StrEnum):
    """Battle Point Flag"""

    none = "none"
    notTargetOtherPlayer = "notTargetOtherPlayer"
    hideUiGaugeAllTime = "hideUiGaugeAllTime"
    hideUiGaugeWhenCantAddPoint = "hideUiGaugeWhenCantAddPoint"
    hideUiGaugeWhenCantAddPointAndFollowerSupport = (
        "hideUiGaugeWhenCantAddPointAndFollowerSupport"
    )


BATTLE_POINT_FLAG_NAME: dict[int, NiceBattlePointFlag] = {
    0: NiceBattlePointFlag.none,
    1: NiceBattlePointFlag.notTargetOtherPlayer,
    2: NiceBattlePointFlag.hideUiGaugeAllTime,
    4: NiceBattlePointFlag.hideUiGaugeWhenCantAddPoint,
    8: NiceBattlePointFlag.hideUiGaugeWhenCantAddPointAndFollowerSupport,
}


class ItemTransitionType(IntEnum):
    NONE = 0
    EVENT_SHOP = 1
    BLANK_EARTH = 2
    CHALDEA_GATE = 3
    FREE_QUEST = 4
    WEEKDAYS_QUEST = 5
    MAIN_SCENARIO = 6
    MISSION = 7
    TRADE_AP = 8
    GRAIL_FRAGMENTS = 9
    COIN_ROOM = 10
    SVT_SELL = 11
    FRIEND = 12
    MANA_PRI = 13
    PURE_PRI = 14
    RARE_PRI = 15
    SUMMON = 16
    REVIVAL_ITEM = 17
    BLANK_EARTH_SCENARIO = 18
    LOGIN_BONUS = 19


class NiceItemTransitionType(StrEnum):
    """Item Transition Type"""

    none = "none"
    eventShop = "eventShop"
    blankEarth = "blankEarth"
    chaldeaGate = "chaldeaGate"
    freeQuest = "freeQuest"
    weekdaysQuest = "weekdaysQuest"
    mainScenario = "mainScenario"
    mission = "mission"
    tradeAp = "tradeAp"
    grailFragments = "grailFragments"
    coinRoom = "coinRoom"
    svtSell = "svtSell"
    friend = "friend"
    manaPri = "manaPri"
    purePri = "purePri"
    rarePri = "rarePri"
    summon = "summon"
    revivalItem = "revivalItem"
    blankEarthScenario = "blankEarthScenario"
    loginBonus = "loginBonus"


ITEM_TRANSITION_TYPE_NAME: dict[int, NiceItemTransitionType] = {
    0: NiceItemTransitionType.none,
    1: NiceItemTransitionType.eventShop,
    2: NiceItemTransitionType.blankEarth,
    3: NiceItemTransitionType.chaldeaGate,
    4: NiceItemTransitionType.freeQuest,
    5: NiceItemTransitionType.weekdaysQuest,
    6: NiceItemTransitionType.mainScenario,
    7: NiceItemTransitionType.mission,
    8: NiceItemTransitionType.tradeAp,
    9: NiceItemTransitionType.grailFragments,
    10: NiceItemTransitionType.coinRoom,
    11: NiceItemTransitionType.svtSell,
    12: NiceItemTransitionType.friend,
    13: NiceItemTransitionType.manaPri,
    14: NiceItemTransitionType.purePri,
    15: NiceItemTransitionType.rarePri,
    16: NiceItemTransitionType.summon,
    17: NiceItemTransitionType.revivalItem,
    18: NiceItemTransitionType.blankEarthScenario,
    19: NiceItemTransitionType.loginBonus,
}


class ItemTransitionTargetValue(IntEnum):
    NONE = 0
    QUEST_ID = 1
    SPOT_ID = 2
    WAR_ID = 3
    EVENT_ID = 4
    MISSION_TYPE = 5
    MANA_PRI_TARGET_ITEM_ID = 6
    PURE_PRI_TARGET_ITEM_ID = 7
    RARE_PRI_TARGET_ITEM_ID = 8
    LEAF_EXCHANGE_TARGET_ITEM_ID = 9


class NiceItemTransitionTargetValue(StrEnum):
    """Item Transition Target Value"""

    none = "none"
    questId = "questId"
    spotId = "spotId"
    warId = "warId"
    eventId = "eventId"
    missionType = "missionType"
    manaPriTargetItemId = "manaPriTargetItemId"
    purePriTargetItemId = "purePriTargetItemId"
    rarePriTargetItemId = "rarePriTargetItemId"
    leafExchangeTargetItemId = "leafExchangeTargetItemId"


ITEM_TRANSITION_TARGET_VALUE: dict[int, NiceItemTransitionTargetValue] = {
    0: NiceItemTransitionTargetValue.none,
    1: NiceItemTransitionTargetValue.questId,
    2: NiceItemTransitionTargetValue.spotId,
    3: NiceItemTransitionTargetValue.warId,
    4: NiceItemTransitionTargetValue.eventId,
    5: NiceItemTransitionTargetValue.missionType,
    6: NiceItemTransitionTargetValue.manaPriTargetItemId,
    7: NiceItemTransitionTargetValue.purePriTargetItemId,
    8: NiceItemTransitionTargetValue.rarePriTargetItemId,
    9: NiceItemTransitionTargetValue.leafExchangeTargetItemId,
}


class WarReleaseDisplayType(IntEnum):
    HIDE = 0
    OPEN = 1
    CLOSE = 2
    ANNOUNCEMENT = 3


class NiceWarReleaseDisplayType(StrEnum):
    """War Release Display Type"""

    hide = "hide"
    open = "open"
    close = "close"
    announcement = "announcement"


WAR_RELEASE_DISPLAY_TYPE_NAME: dict[int, NiceWarReleaseDisplayType] = {
    0: NiceWarReleaseDisplayType.hide,
    1: NiceWarReleaseDisplayType.open,
    2: NiceWarReleaseDisplayType.close,
    3: NiceWarReleaseDisplayType.announcement,
}


class GainNpIndividualSumGainIndividualTarget(IntEnum):
    SELF = 0
    PLAYER = 1
    ENEMY = 2
    ALL = 3
    OTHER_ALL = 4


class NiceGainNpIndividualSumTarget(StrEnum):
    """Gain NP Individual Sum Target"""

    self_ = "self"
    player = "player"
    enemy = "enemy"
    all = "all"
    otherAll = "otherAll"


GAIN_NP_INDIVIDUAL_SUM_TARGET_NAME: dict[int, NiceGainNpIndividualSumTarget] = {
    0: NiceGainNpIndividualSumTarget.self_,
    1: NiceGainNpIndividualSumTarget.player,
    2: NiceGainNpIndividualSumTarget.enemy,
    3: NiceGainNpIndividualSumTarget.all,
    4: NiceGainNpIndividualSumTarget.otherAll,
}


class SvtClassGroupType(IntEnum):
    NORMAL = 1
    OTHER = 2
    ALL = 3


class NiceSvtClassGroupType(StrEnum):
    """Svt Class Group Type"""

    normal = "normal"
    other = "other"
    all = "all"


SVT_CLASS_GROUP_TYPE_NAME: dict[int, NiceSvtClassGroupType] = {
    1: NiceSvtClassGroupType.normal,
    2: NiceSvtClassGroupType.other,
    3: NiceSvtClassGroupType.all,
}


class EventMissionCondDetailType(IntEnum):
    ENEMY_KILL_NUM = 1
    ENEMY_INDIVIDUALITY_KILL_NUM = 2
    ITEM_GET_TOTAL = 3
    BATTLE_SVT_IN_DECK = 4
    BATTLE_SVT_EQUIP_IN_DECK = 5
    TARGET_QUEST_ENEMY_KILL_NUM = 6
    TARGET_QUEST_ENEMY_INDIVIDUALITY_KILL_NUM = 7
    TARGET_QUEST_ITEM_GET_TOTAL = 8
    QUEST_CLEAR = 9
    QUEST_CLEAR_NUM = 10
    SVT_GET_NUM = 11
    ALL_QUEST_ITEM_GET_TOTAL = 12
    ALL_INDIVIDUALITY_IN_ENEMY_KILL_NUM = 13
    TARGET_ENEMY_CLASS_KILL_NUM = 14
    TARGET_SVT_ENEMY_CLASS_KILL_NUM = 15
    TARGET_ENEMY_INDIVIDUALITY_CLASS_KILL_NUM = 16
    BATTLE_SVT_INDIVIDUALITY_SPECIFIC_NUM = 17
    BATTLE_SVT_CLASS_SPECIFIC_NUM = 18
    ALL_QUEST_SVT_GET_TOTAL = 19
    QUEST_GROUP_CLEAR_NUM = 20
    GACHA_DRAW_NUM = 21
    QUEST_CLEAR_WITH_SVT_IN_DEC = 22
    QUEST_CLEAR_WITH_SVT_IN_DECK_NONE_FOLLOWER = 23
    QUEST_PHASE_CLEAR_NUM = 24
    EVENT_ITEM_USE_NUM = 25
    EVENT_BOARD_GAME_CELL_NUM = 26
    FRIEND_AND_FOLLOW_NUM = 27
    QUEST_PHASE_CLEAR_NUM_QUEST_TYPE = 28
    QUEST_PHASE_CLEAR_NUM_QUEST_GROUP = 29
    QUEST_PHASE_CLEAR_NUM_WAR_ID = 30
    QUEST_PHASE_CLEAR_NUM_WITH_WAR_BOARD = 31
    QUEST_CLEAR_WITH_SVT_IN_DECK_ONLY_STARTING_MEMBER = 34
    QUEST_CLEAR_WITH_SVT_IN_DECK_NONE_FOLLOWER_ONLY_STARTING_MEMBER = 35
    BATTLE_EXCHANGE_SVT_IN_DECK = 37
    USE_TREASURE_DEVICE_EXCHANGE_SVT = 38
    PLAY_VOICE_EXCHANGE_SVT = 39
    MAP_GIMMICK_COUNT = 40
    PURCHASE_SHOP_NUM = 41
    ITEM_USE_QUEST_NUM = 42
    BATTLE_MISSION_VALUE = 43


class NiceEventMissionCondDetailType(StrEnum):
    """Event Mission Cond Detail Type"""

    enemyKillNum = "enemyKillNum"
    enemyIndividualityKillNum = "enemyIndividualityKillNum"
    itemGetTotal = "itemGetTotal"
    battleSvtInDeck = "battleSvtInDeck"
    battleSvtEquipInDeck = "battleSvtEquipInDeck"
    targetQuestEnemyKillNum = "targetQuestEnemyKillNum"
    targetQuestEnemyIndividualityKillNum = "targetQuestEnemyIndividualityKillNum"
    targetQuestItemGetTotal = "targetQuestItemGetTotal"
    questClear = "questClear"
    questClearNum = "questClearNum"
    svtGetNum = "svtGetNum"
    allQuestItemGetTotal = "allQuestItemGetTotal"
    allIndividualityInEnemyKillNum = "allIndividualityInEnemyKillNum"
    targetEnemyClassKillNum = "targetEnemyClassKillNum"
    targetSvtEnemyClassKillNum = "targetSvtEnemyClassKillNum"
    targetEnemyIndividualityClassKillNum = "targetEnemyIndividualityClassKillNum"
    battleSvtIndividualitySpecificNum = "battleSvtIndividualitySpecificNum"
    battleSvtClassSpecificNum = "battleSvtClassSpecificNum"
    allQuestSvtGetTotal = "allQuestSvtGetTotal"
    questGroupClearNum = "questGroupClearNum"
    gachaDrawNum = "gachaDrawNum"
    questClearWithSvtInDec = "questClearWithSvtInDec"
    questClearWithSvtInDeckNoneFollower = "questClearWithSvtInDeckNoneFollower"
    questPhaseClearNum = "questPhaseClearNum"
    eventItemUseNum = "eventItemUseNum"
    eventBoardGameCellNum = "eventBoardGameCellNum"
    friendAndFollowNum = "friendAndFollowNum"
    questPhaseClearNumQuestType = "questPhaseClearNumQuestType"
    questPhaseClearNumQuestGroup = "questPhaseClearNumQuestGroup"
    questPhaseClearNumWarId = "questPhaseClearNumWarId"
    questPhaseClearNumWithWarBoard = "questPhaseClearNumWithWarBoard"
    questClearWithSvtInDeckOnlyStartingMember = (
        "questClearWithSvtInDeckOnlyStartingMember"
    )
    questClearWithSvtInDeckNoneFollowerOnlyStartingMember = (
        "questClearWithSvtInDeckNoneFollowerOnlyStartingMember"
    )
    battleExchangeSvtInDeck = "battleExchangeSvtInDeck"
    useTreasureDeviceExchangeSvt = "useTreasureDeviceExchangeSvt"
    playVoiceExchangeSvt = "playVoiceExchangeSvt"
    mapGimmickCount = "mapGimmickCount"
    purchaseShopNum = "purchaseShopNum"
    itemUseQuestNum = "itemUseQuestNum"
    battleMissionValue = "battleMissionValue"


EVENT_MISSION_COND_DETAIL_TYPE_NAME: dict[int, NiceEventMissionCondDetailType] = {
    1: NiceEventMissionCondDetailType.enemyKillNum,
    2: NiceEventMissionCondDetailType.enemyIndividualityKillNum,
    3: NiceEventMissionCondDetailType.itemGetTotal,
    4: NiceEventMissionCondDetailType.battleSvtInDeck,
    5: NiceEventMissionCondDetailType.battleSvtEquipInDeck,
    6: NiceEventMissionCondDetailType.targetQuestEnemyKillNum,
    7: NiceEventMissionCondDetailType.targetQuestEnemyIndividualityKillNum,
    8: NiceEventMissionCondDetailType.targetQuestItemGetTotal,
    9: NiceEventMissionCondDetailType.questClear,
    10: NiceEventMissionCondDetailType.questClearNum,
    11: NiceEventMissionCondDetailType.svtGetNum,
    12: NiceEventMissionCondDetailType.allQuestItemGetTotal,
    13: NiceEventMissionCondDetailType.allIndividualityInEnemyKillNum,
    14: NiceEventMissionCondDetailType.targetEnemyClassKillNum,
    15: NiceEventMissionCondDetailType.targetSvtEnemyClassKillNum,
    16: NiceEventMissionCondDetailType.targetEnemyIndividualityClassKillNum,
    17: NiceEventMissionCondDetailType.battleSvtIndividualitySpecificNum,
    18: NiceEventMissionCondDetailType.battleSvtClassSpecificNum,
    19: NiceEventMissionCondDetailType.allQuestSvtGetTotal,
    20: NiceEventMissionCondDetailType.questGroupClearNum,
    21: NiceEventMissionCondDetailType.gachaDrawNum,
    22: NiceEventMissionCondDetailType.questClearWithSvtInDec,
    23: NiceEventMissionCondDetailType.questClearWithSvtInDeckNoneFollower,
    24: NiceEventMissionCondDetailType.questPhaseClearNum,
    25: NiceEventMissionCondDetailType.eventItemUseNum,
    26: NiceEventMissionCondDetailType.eventBoardGameCellNum,
    27: NiceEventMissionCondDetailType.friendAndFollowNum,
    28: NiceEventMissionCondDetailType.questPhaseClearNumQuestType,
    29: NiceEventMissionCondDetailType.questPhaseClearNumQuestGroup,
    30: NiceEventMissionCondDetailType.questPhaseClearNumWarId,
    31: NiceEventMissionCondDetailType.questPhaseClearNumWithWarBoard,
    34: NiceEventMissionCondDetailType.questClearWithSvtInDeckOnlyStartingMember,
    35: NiceEventMissionCondDetailType.questClearWithSvtInDeckNoneFollowerOnlyStartingMember,
    37: NiceEventMissionCondDetailType.battleExchangeSvtInDeck,
    38: NiceEventMissionCondDetailType.useTreasureDeviceExchangeSvt,
    39: NiceEventMissionCondDetailType.playVoiceExchangeSvt,
    40: NiceEventMissionCondDetailType.mapGimmickCount,
    41: NiceEventMissionCondDetailType.purchaseShopNum,
    42: NiceEventMissionCondDetailType.itemUseQuestNum,
    43: NiceEventMissionCondDetailType.battleMissionValue,
}


class SvtCardPositionDamageRatesSlideType(IntEnum):
    NONE = 0
    FRONT = 1
    BACK = 2


class NiceSvtCardPositionDamageRatesSlideType(StrEnum):
    """Servant Card Position Damage Rates Slide Type"""

    none = "none"
    front = "front"
    back = "back"


SVT_CARD_POSITION_DAMAGE_RATES_SLIDE_TYPE_NAME: dict[
    int, NiceSvtCardPositionDamageRatesSlideType
] = {
    0: NiceSvtCardPositionDamageRatesSlideType.none,
    1: NiceSvtCardPositionDamageRatesSlideType.front,
    2: NiceSvtCardPositionDamageRatesSlideType.back,
}


class QuestExtensionSubType(IntEnum):
    NONE = 0
    SVT_COIN = 1


class NiceQuestExtensionSubType(StrEnum):
    """Quest Extension Sub Type"""

    none = "none"
    svtCoin = "svtCoin"


QUEST_EXTENSION_SUB_TYPE_NAME: dict[int, NiceQuestExtensionSubType] = {
    0: NiceQuestExtensionSubType.none,
    1: NiceQuestExtensionSubType.svtCoin,
}


class BattleBranchSkillCondBranchType(IntEnum):
    None_ = 0
    IsSelfTarget = 1
    Individuality = 2


class NiceBattleBranchSkillCondBranchType(StrEnum):
    """Battle Branch Skill Cond Branch Type"""

    none = "none"
    isSelfTarget = "isSelfTarget"
    individuality = "individuality"


BATTLE_BRANCH_SKILL_COND_BRANCH_TYPE_NAME: dict[
    int, NiceBattleBranchSkillCondBranchType
] = {
    0: NiceBattleBranchSkillCondBranchType.none,
    1: NiceBattleBranchSkillCondBranchType.isSelfTarget,
    2: NiceBattleBranchSkillCondBranchType.individuality,
}


class BuffConditionType(IntEnum):
    HP_HIGHER = 0
    HP_LOWER = 1
    INDIVIDUALITIE = 2
    INDIVIDUALITIE_OR = 3
    INDIVIDUALITIE_AND = 4


class NiceBuffConditionType(StrEnum):
    """Condition Type for Conditional Battle Buff"""

    hpHigher = "hpHigher"
    hpLower = "hpLower"
    individualitie = "individualitie"
    individualitieOr = "individualitieOr"
    individualitieAnd = "individualitieAnd"


BUFF_CONDITION_TYPE: dict[int, NiceBuffConditionType] = {
    0: NiceBuffConditionType.hpHigher,
    1: NiceBuffConditionType.hpLower,
    2: NiceBuffConditionType.individualitie,
    3: NiceBuffConditionType.individualitieOr,
    4: NiceBuffConditionType.individualitieAnd,
}


class BuffConditionTargetType(IntEnum):
    NONE = 0
    PT_ALL = 1
    ENEMY_ALL = 2
    FIELD_ALL = 3
    PT_FULL = 4
    ENEMY_FULL = 5
    PT_OTHER_ALL = 6
    PT_OTHER_FULL = 7
    FIELD_OTHER_ALL = 8


class NiceBuffConditionTargetType(StrEnum):
    """Buff Condition Target Type"""

    none = "none"
    ptAll = "ptAll"
    enemyAll = "enemyAll"
    fieldAll = "fieldAll"
    ptFull = "ptFull"
    enemyFull = "enemyFull"
    ptOtherAll = "ptOtherAll"
    ptOtherFull = "ptOtherFull"
    fieldOtherAll = "fieldOtherAll"


BUFF_CONDITION_TARGET_TYPE: dict[int, NiceBuffConditionTargetType] = {
    0: NiceBuffConditionTargetType.none,
    1: NiceBuffConditionTargetType.ptAll,
    2: NiceBuffConditionTargetType.enemyAll,
    3: NiceBuffConditionTargetType.fieldAll,
    4: NiceBuffConditionTargetType.ptFull,
    5: NiceBuffConditionTargetType.enemyFull,
    6: NiceBuffConditionTargetType.ptOtherAll,
    7: NiceBuffConditionTargetType.ptOtherFull,
    8: NiceBuffConditionTargetType.fieldOtherAll,
}


class QuestAfterActionCommand(IntEnum):
    NONE = 0
    SPOT_HIDE = 100
    SPOT_GRAY = 101
    SPOT_DISP = 102
    SPOT_CHANGE = 103
    SPOT_ANIM = 104
    SPOT_HIDE_QUICK = 110
    SPOT_GRAY_QUICK = 111
    SPOT_DISP_QUICK = 112
    SPOT_CHANGE_QUICK = 113
    SPOT_ANIM_QUICK = 114
    ROAD_HIDE = 200
    ROAD_GRAY = 201
    ROAD_DISP = 202
    ROAD_HIDE_QUICK = 203
    ROAD_GRAY_QUICK = 204
    ROAD_DISP_QUICK = 205
    CAM_MV_SPOT = 300
    CAM_MV_ROAD = 301
    CAM_MV_GIMMICK = 302
    CAM_MV_COORD = 303
    CAM_ZOOM = 304
    CAM_MV_ZOOM_SPOT = 305
    CAM_MV_ZOOM_ROAD = 306
    CAM_MV_ZOOM_GIMMICK = 307
    CAM_MV_ZOOM_COORD = 308
    CAM_3D_MV_LAYER = 350
    CAM_3D_MV_COORD = 351
    CAM_3D_MV_ZOOM_COORD = 352
    GIMMICK_HIDE = 400
    GIMMICK_DISP = 401
    GIMMICK_HIDE_QUICK = 402
    GIMMICK_DISP_QUICK = 403
    GIMMICK_MV_COORD = 404
    GIMMICK_DISP_WITH_FADE = 405
    GIMMICK_TWEEN_COLOR = 406
    GIMMICK_SET_COLOR = 407
    GIMMICK_DISP_UPDATE = 408
    GIMMICK_DISP_PILE_UP = 409
    GIMMICK_MV_SPOT = 410
    GIMMICK_MV_GIMMICK = 411
    GIMMICK_MV_ROAD = 412
    QUEST_FOCUS = 500
    QUEST_UNFOCUS = 501
    PLAYER_FOCUS = 510
    AFTER_FADE_IN = 520
    QUEST_START = 530
    MAP_CHANGE = 540
    START_MAP_CHANGE = 550
    TITLE_INFO_CONTROL = 560
    MESSAGE_WINDOW = 600
    MESSAGE_WINDOW_MST = 601
    MESSAGE_OTHER_WINDOW = 602
    MESSAGE_OTHER_WINDOW_MST = 603
    MESSAGE_OTHER_WINDOW_BOOST_SUPPORT = 604
    EVENT_REWARD = 700
    WHITE_EARTH_TRANS = 701
    TRANSITION_TO_FOLDER = 702
    CLASS_SCORE = 703
    PLAY_VOICE = 800
    PLAY_SE = 801
    BGM_STOP = 850
    BGM_PLAY = 851
    WAIT = 900
    BLANK_EARTH_OBJECT_HIDE = 1000
    BLANK_EARTH_OBJECT_DISP = 1001
    BLANK_EARTH_OBJECT_ANIM = 1002
    BLANK_EARTH_OBJECT_HIDE_QUICK = 1010
    BLANK_EARTH_OBJECT_DISP_QUICK = 1011
    BLANK_EARTH_OBJECT_ANIM_QUICK = 1012
    EVENT_EFFECT_PLAY = 1100
    CHANGE_DISP_STATE_QUEST_BOARD = 1200


class NiceQuestAfterActionCommand(StrEnum):
    """Quest After Action Command"""

    none = "none"
    spotHide = "spotHide"
    spotGray = "spotGray"
    spotDisp = "spotDisp"
    spotChange = "spotChange"
    spotAnim = "spotAnim"
    spotHideQuick = "spotHideQuick"
    spotGrayQuick = "spotGrayQuick"
    spotDispQuick = "spotDispQuick"
    spotChangeQuick = "spotChangeQuick"
    spotAnimQuick = "spotAnimQuick"
    roadHide = "roadHide"
    roadGray = "roadGray"
    roadDisp = "roadDisp"
    roadHideQuick = "roadHideQuick"
    roadGrayQuick = "roadGrayQuick"
    roadDispQuick = "roadDispQuick"
    camMvSpot = "camMvSpot"
    camMvRoad = "camMvRoad"
    camMvGimmick = "camMvGimmick"
    camMvCoord = "camMvCoord"
    camZoom = "camZoom"
    camMvZoomSpot = "camMvZoomSpot"
    camMvZoomRoad = "camMvZoomRoad"
    camMvZoomGimmick = "camMvZoomGimmick"
    camMvZoomCoord = "camMvZoomCoord"
    cam3DMvLayer = "cam3DMvLayer"
    cam3DMvCoord = "cam3DMvCoord"
    cam3DMvZoomCoord = "cam3DMvZoomCoord"
    gimmickHide = "gimmickHide"
    gimmickDisp = "gimmickDisp"
    gimmickHideQuick = "gimmickHideQuick"
    gimmickDispQuick = "gimmickDispQuick"
    gimmickMvCoord = "gimmickMvCoord"
    gimmickDispWithFade = "gimmickDispWithFade"
    gimmickTweenColor = "gimmickTweenColor"
    gimmickSetColor = "gimmickSetColor"
    gimmickDispUpdate = "gimmickDispUpdate"
    gimmickDispPileUp = "gimmickDispPileUp"
    gimmickMvSpot = "gimmickMvSpot"
    gimmickMvGimmick = "gimmickMvGimmick"
    gimmickMvRoad = "gimmickMvRoad"
    questFocus = "questFocus"
    questUnfocus = "questUnfocus"
    playerFocus = "playerFocus"
    afterFadeIn = "afterFadeIn"
    questStart = "questStart"
    mapChange = "mapChange"
    startMapChange = "startMapChange"
    titleInfoControl = "titleInfoControl"
    messageWindow = "messageWindow"
    messageWindowMst = "messageWindowMst"
    messageOtherWindow = "messageOtherWindow"
    messageOtherWindowMst = "messageOtherWindowMst"
    messageOtherWindowBoostSupport = "messageOtherWindowBoostSupport"
    eventReward = "eventReward"
    whiteEarthTrans = "whiteEarthTrans"
    transitionToFolder = "transitionToFolder"
    classScore = "classScore"
    playVoice = "playVoice"
    playSe = "playSe"
    bgmStop = "bgmStop"
    bgmPlay = "bgmPlay"
    wait = "wait"
    blankEarthObjectHide = "blankEarthObjectHide"
    blankEarthObjectDisp = "blankEarthObjectDisp"
    blankEarthObjectAnim = "blankEarthObjectAnim"
    blankEarthObjectHideQuick = "blankEarthObjectHideQuick"
    blankEarthObjectDispQuick = "blankEarthObjectDispQuick"
    blankEarthObjectAnimQuick = "blankEarthObjectAnimQuick"
    eventEffectPlay = "eventEffectPlay"
    changeDispStateQuestBoard = "changeDispStateQuestBoard"


QUEST_AFTER_ACTION_COMMAND: dict[int, NiceQuestAfterActionCommand] = {
    0: NiceQuestAfterActionCommand.none,
    100: NiceQuestAfterActionCommand.spotHide,
    101: NiceQuestAfterActionCommand.spotGray,
    102: NiceQuestAfterActionCommand.spotDisp,
    103: NiceQuestAfterActionCommand.spotChange,
    104: NiceQuestAfterActionCommand.spotAnim,
    110: NiceQuestAfterActionCommand.spotHideQuick,
    111: NiceQuestAfterActionCommand.spotGrayQuick,
    112: NiceQuestAfterActionCommand.spotDispQuick,
    113: NiceQuestAfterActionCommand.spotChangeQuick,
    114: NiceQuestAfterActionCommand.spotAnimQuick,
    200: NiceQuestAfterActionCommand.roadHide,
    201: NiceQuestAfterActionCommand.roadGray,
    202: NiceQuestAfterActionCommand.roadDisp,
    203: NiceQuestAfterActionCommand.roadHideQuick,
    204: NiceQuestAfterActionCommand.roadGrayQuick,
    205: NiceQuestAfterActionCommand.roadDispQuick,
    300: NiceQuestAfterActionCommand.camMvSpot,
    301: NiceQuestAfterActionCommand.camMvRoad,
    302: NiceQuestAfterActionCommand.camMvGimmick,
    303: NiceQuestAfterActionCommand.camMvCoord,
    304: NiceQuestAfterActionCommand.camZoom,
    305: NiceQuestAfterActionCommand.camMvZoomSpot,
    306: NiceQuestAfterActionCommand.camMvZoomRoad,
    307: NiceQuestAfterActionCommand.camMvZoomGimmick,
    308: NiceQuestAfterActionCommand.camMvZoomCoord,
    350: NiceQuestAfterActionCommand.cam3DMvLayer,
    351: NiceQuestAfterActionCommand.cam3DMvCoord,
    352: NiceQuestAfterActionCommand.cam3DMvZoomCoord,
    400: NiceQuestAfterActionCommand.gimmickHide,
    401: NiceQuestAfterActionCommand.gimmickDisp,
    402: NiceQuestAfterActionCommand.gimmickHideQuick,
    403: NiceQuestAfterActionCommand.gimmickDispQuick,
    404: NiceQuestAfterActionCommand.gimmickMvCoord,
    405: NiceQuestAfterActionCommand.gimmickDispWithFade,
    406: NiceQuestAfterActionCommand.gimmickTweenColor,
    407: NiceQuestAfterActionCommand.gimmickSetColor,
    408: NiceQuestAfterActionCommand.gimmickDispUpdate,
    409: NiceQuestAfterActionCommand.gimmickDispPileUp,
    410: NiceQuestAfterActionCommand.gimmickMvSpot,
    411: NiceQuestAfterActionCommand.gimmickMvGimmick,
    412: NiceQuestAfterActionCommand.gimmickMvRoad,
    500: NiceQuestAfterActionCommand.questFocus,
    501: NiceQuestAfterActionCommand.questUnfocus,
    510: NiceQuestAfterActionCommand.playerFocus,
    520: NiceQuestAfterActionCommand.afterFadeIn,
    530: NiceQuestAfterActionCommand.questStart,
    540: NiceQuestAfterActionCommand.mapChange,
    550: NiceQuestAfterActionCommand.startMapChange,
    560: NiceQuestAfterActionCommand.titleInfoControl,
    600: NiceQuestAfterActionCommand.messageWindow,
    601: NiceQuestAfterActionCommand.messageWindowMst,
    602: NiceQuestAfterActionCommand.messageOtherWindow,
    603: NiceQuestAfterActionCommand.messageOtherWindowMst,
    604: NiceQuestAfterActionCommand.messageOtherWindowBoostSupport,
    700: NiceQuestAfterActionCommand.eventReward,
    701: NiceQuestAfterActionCommand.whiteEarthTrans,
    702: NiceQuestAfterActionCommand.transitionToFolder,
    703: NiceQuestAfterActionCommand.classScore,
    800: NiceQuestAfterActionCommand.playVoice,
    801: NiceQuestAfterActionCommand.playSe,
    850: NiceQuestAfterActionCommand.bgmStop,
    851: NiceQuestAfterActionCommand.bgmPlay,
    900: NiceQuestAfterActionCommand.wait,
    1000: NiceQuestAfterActionCommand.blankEarthObjectHide,
    1001: NiceQuestAfterActionCommand.blankEarthObjectDisp,
    1002: NiceQuestAfterActionCommand.blankEarthObjectAnim,
    1010: NiceQuestAfterActionCommand.blankEarthObjectHideQuick,
    1011: NiceQuestAfterActionCommand.blankEarthObjectDispQuick,
    1012: NiceQuestAfterActionCommand.blankEarthObjectAnimQuick,
    1100: NiceQuestAfterActionCommand.eventEffectPlay,
    1200: NiceQuestAfterActionCommand.changeDispStateQuestBoard,
}


class UserSvtStatusFlag(IntEnum):
    LOCK = 1
    EVENT_JOIN = 2
    WITHDRAWAL = 4
    APRIL_FOOL_CANCEL = 8
    CHOICE = 16
    NO_PERIOD = 32
    COND_JOIN = 64
    STATUS_MAX = 128
    UseLevelExceedItemHeroine = 256
    UseFriendshipExceedItemHeroine = 512


class NiceUserSvtStatusFlag(StrEnum):
    """User Servant Status Flag"""

    lock = "lock"
    eventJoin = "eventJoin"
    withdrawal = "withdrawal"
    aprilFoolCancel = "aprilFoolCancel"
    choice = "choice"
    noPeriod = "noPeriod"
    condJoin = "condJoin"
    statusMax = "statusMax"
    useLevelExceedItemHeroine = "useLevelExceedItemHeroine"
    useFriendshipExceedItemHeroine = "useFriendshipExceedItemHeroine"


USER_SVT_STATUS_FLAG: dict[int, NiceUserSvtStatusFlag] = {
    1: NiceUserSvtStatusFlag.lock,
    2: NiceUserSvtStatusFlag.eventJoin,
    4: NiceUserSvtStatusFlag.withdrawal,
    8: NiceUserSvtStatusFlag.aprilFoolCancel,
    16: NiceUserSvtStatusFlag.choice,
    32: NiceUserSvtStatusFlag.noPeriod,
    64: NiceUserSvtStatusFlag.condJoin,
    128: NiceUserSvtStatusFlag.statusMax,
    256: NiceUserSvtStatusFlag.useLevelExceedItemHeroine,
    512: NiceUserSvtStatusFlag.useFriendshipExceedItemHeroine,
}


class FieldBuffApplyTargetType(IntEnum):
    None_ = 0
    Player = 1
    Enemy = 2
    All = 3


class NiceFieldBuffApplyTargetType(StrEnum):
    """Field Buff Apply Target Type"""

    none = "none"
    player = "player"
    enemy = "enemy"
    all = "all"


FIELD_BUFF_APPLY_TARGET_TYPE: dict[int, NiceFieldBuffApplyTargetType] = {
    0: NiceFieldBuffApplyTargetType.none,
    1: NiceFieldBuffApplyTargetType.player,
    2: NiceFieldBuffApplyTargetType.enemy,
    3: NiceFieldBuffApplyTargetType.all,
}
