Skip to content

Commit

Permalink
Added targetBuffs and targetIndividualities to buff convert script
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Apr 27, 2024
1 parent bd62ccc commit dd1b81c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/core/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@
BasicTdReverse,
BasicWar,
)
from ..schemas.common import BuffScript, Language, MCAssets, Region, ReverseDepth
from ..schemas.common import (
BuffScript,
Language,
MCAssets,
NiceTrait,
Region,
ReverseDepth,
)
from ..schemas.enums import (
ATTRIBUTE_NAME,
FUNC_APPLYTARGET_NAME,
Expand Down Expand Up @@ -155,17 +162,24 @@ def get_nice_buff_script(
if "convert" in mstBuff.script:
convert = mstBuff.script["convert"]

targetBuffs: list[Any] = []
targetIndividualities: list[NiceTrait] = []

if convert["convertType"] == BuffConvertType.BUFF:
targets = [raw_to_out(buff) for buff in convert["targetBuffs"]]
targetBuffs = targets
elif convert["convertType"] == BuffConvertType.INDIVIDUALITY:
targets = get_traits_list(convert["targetIds"])
targetIndividualities = targets
else:
targets = []

script["convert"] = {
"targetLimit": BUFF_CONVERT_LIMIT_TYPE_NAME[convert["targetLimit"]],
"convertType": BUFF_CONVERT_TYPE_NAME[convert["convertType"]],
"targets": targets,
"targetBuffs": targetBuffs,
"targetIndividualities": targetIndividualities,
"convertBuffs": [raw_to_out(buff) for buff in convert["convertBuffs"]],
"script": convert["script"],
"effectId": convert["effectId"],
Expand Down
2 changes: 2 additions & 0 deletions app/schemas/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class BuffConvert(BaseModel):
targetLimit: NiceBuffConvertLimitType
convertType: NiceBuffConvertType
targets: list[int] | list[NiceTrait] | list[dict[str, Any]]
targetBuffs: list[dict[str, Any]]
targetIndividualities: list[NiceTrait]
convertBuffs: list[dict[str, Any]]
script: BuffConvertScript
effectId: int
Expand Down

0 comments on commit dd1b81c

Please sign in to comment.