Skip to content

Commit

Permalink
Added new enums
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Oct 16, 2024
1 parent 61f844b commit d48f580
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 12 deletions.
3 changes: 3 additions & 0 deletions app/schemas/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class NiceSkillType(StrEnum):
FuncType.EVENT_DROP_UP,
FuncType.GAIN_NP_BUFF_INDIVIDUAL_SUM,
FuncType.GAIN_NP_INDIVIDUAL_SUM,
FuncType.GAIN_NP_TARGET_SUM,
}


Expand Down Expand Up @@ -1027,6 +1028,7 @@ class Trait(StrEnum):
notProtectedByBBDubai = "notProtectedByBBDubai"
canFlyInSpace = "canFlyInSpace"
buffSpecialInvinciblePierce = "buffSpecialInvinciblePierce"
sakuraSeries = "sakuraSeries"


TRAIT_NAME: dict[int, Trait] = {
Expand Down Expand Up @@ -1240,6 +1242,7 @@ class Trait(StrEnum):
2922: Trait.hasSupereffectiveNPAgainstAlignmentGood,
2923: Trait.hasSupereffectiveNPAgainstAlignmentEvil,
2924: Trait.canFlyInSpace,
2925: Trait.sakuraSeries,
# 2xxx: CQ or Story quests buff
3000: Trait.attackPhysical, # Normal attack, including NP
3001: Trait.attackProjectile,
Expand Down
72 changes: 60 additions & 12 deletions app/schemas/gameenums.py
Original file line number Diff line number Diff line change
Expand Up @@ -1954,9 +1954,9 @@ class ItemType(IntEnum):
EUQIP_SKILL_USE_ITEM = 28
SVT_COIN = 29
FRIENDSHIP_UP_ITEM = 30
PP = 31
PURE_PRI = 31
TRADE_AP = 32
RI = 33
REVIVAL_ITEM = 33
STORMPOD = 34
BATTLE_ITEM = 35
ANIPLEX_PLUS_CHARGE_STONE = 36
Expand Down Expand Up @@ -1996,9 +1996,9 @@ class NiceItemType(StrEnum):
euqipSkillUseItem = "euqipSkillUseItem"
svtCoin = "svtCoin"
friendshipUpItem = "friendshipUpItem"
pp = "pp"
purePri = "purePri"
tradeAp = "tradeAp"
ri = "ri"
revivalItem = "revivalItem"
stormpod = "stormpod"
battleItem = "battleItem"
aniplexPlusChargeStone = "aniplexPlusChargeStone"
Expand Down Expand Up @@ -2036,9 +2036,9 @@ class NiceItemType(StrEnum):
28: NiceItemType.euqipSkillUseItem,
29: NiceItemType.svtCoin,
30: NiceItemType.friendshipUpItem,
31: NiceItemType.pp,
31: NiceItemType.purePri,
32: NiceItemType.tradeAp,
33: NiceItemType.ri,
33: NiceItemType.revivalItem,
34: NiceItemType.stormpod,
35: NiceItemType.battleItem,
36: NiceItemType.aniplexPlusChargeStone,
Expand Down Expand Up @@ -2120,9 +2120,9 @@ class ShopType(IntEnum):
GRAIL_FRAGMENTS = 10
SVT_COSTUME = 11
START_UP_SUMMON = 12
SHOP13 = 13
PURE_PRI = 13
TRADE_AP = 14
SHOP15 = 15
REVIVAL_ITEM = 15
EVENT_SVT_EQUIP = 16


Expand All @@ -2142,9 +2142,9 @@ class NiceShopType(StrEnum):
grailFragments = "grailFragments"
svtCostume = "svtCostume"
startUpSummon = "startUpSummon"
shop13 = "shop13"
purePri = "purePri"
tradeAp = "tradeAp"
shop15 = "shop15"
revivalItem = "revivalItem"
eventSvtEquip = "eventSvtEquip"


Expand All @@ -2162,9 +2162,9 @@ class NiceShopType(StrEnum):
10: NiceShopType.grailFragments,
11: NiceShopType.svtCostume,
12: NiceShopType.startUpSummon,
13: NiceShopType.shop13,
13: NiceShopType.purePri,
14: NiceShopType.tradeAp,
15: NiceShopType.shop15,
15: NiceShopType.revivalItem,
16: NiceShopType.eventSvtEquip,
}

Expand Down Expand Up @@ -6227,3 +6227,51 @@ class NiceWarReleaseDisplayType(StrEnum):
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,
}
14 changes: 14 additions & 0 deletions scripts/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2130,3 +2130,17 @@ export enum NiceWarReleaseDisplayType {
CLOSE = "close",
ANNOUNCEMENT = "announcement",
}

export enum NiceGainNpIndividualSumTarget {
SELF = "self",
PLAYER = "player",
ENEMY = "enemy",
ALL = "all",
OTHER_ALL = "otherAll",
}

export enum NiceSvtClassGroupType {
NORMAL = "normal",
OTHER = "other",
ALL = "all",
}
14 changes: 14 additions & 0 deletions scripts/extract_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,20 @@ def cs_enum_to_ts(cs_enums: list[str], raw_class: str, nice_class: str) -> list[
"War Release Display Type",
"WAR_RELEASE_DISPLAY_TYPE_NAME",
),
(
"GainNpIndividualSum.GainIndividualTarget",
"GainNpIndividualSumGainIndividualTarget",
"NiceGainNpIndividualSumTarget",
"Gain NP Individual Sum Target",
"GAIN_NP_INDIVIDUAL_SUM_TARGET_NAME",
),
(
"SvtClassGroupType.TYPE",
"SvtClassGroupType",
"NiceSvtClassGroupType",
"Svt Class Group Type",
"SVT_CLASS_GROUP_TYPE_NAME",
),
]


Expand Down

0 comments on commit d48f580

Please sign in to comment.