Skip to content

Commit 6c6049f

Browse files
committed
Added buff script condBuffValue
1 parent b33945c commit 6c6049f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

app/core/basic.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
)
4848
from ..schemas.gameenums import (
4949
ATTRIBUTE_NAME,
50+
BUFF_CONDITION_TARGET_TYPE,
5051
BUFF_CONVERT_LIMIT_TYPE_NAME,
5152
BUFF_CONVERT_TYPE_NAME,
5253
BUFF_TYPE_NAME,
@@ -204,6 +205,19 @@ def get_nice_buff_script(
204205
"effectId": convert["effectId"],
205206
}
206207

208+
if "condBuffValue" in mstBuff.script:
209+
script["condBuffValue"] = [
210+
{
211+
"buffType": BUFF_TYPE_NAME[cond["buffType"]],
212+
"condValue": cond["condValue"],
213+
"buffIndividualities": get_traits_list(cond["buffIndividualitie"]),
214+
"valueCondTargetType": BUFF_CONDITION_TARGET_TYPE[
215+
cond["valueCondTargetType"]
216+
],
217+
}
218+
for cond in mstBuff.script["condBuffValue"]
219+
]
220+
207221
return script
208222

209223

app/schemas/common.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .base import BaseModelORJson
77
from .enums import SvtClass, Trait
88
from .gameenums import (
9+
NiceBuffConditionTargetType,
910
NiceBuffConvertLimitType,
1011
NiceBuffConvertType,
1112
NiceBuffType,
@@ -124,6 +125,18 @@ class BuffConvert(BaseModel):
124125
effectId: int
125126

126127

128+
class CondBuffValue(BaseModel):
129+
"""Conditional Buff Value
130+
131+
Defines a condition for a buff based on another buff's value
132+
"""
133+
134+
buffType: NiceBuffType
135+
condValue: str
136+
buffIndividualities: list[NiceTrait]
137+
valueCondTargetType: NiceBuffConditionTargetType
138+
139+
127140
class BuffScript(BaseModel):
128141
checkIndvType: Optional[int] = None
129142
CheckOpponentBuffTypes: Optional[list[NiceBuffType]] = None
@@ -156,6 +169,7 @@ class BuffScript(BaseModel):
156169
fromCommandSpell: int | None = None
157170
fromMasterEquip: int | None = None
158171
NotPierceIndividuality: list[list[NiceTrait]] | None = None
172+
condBuffValue: list[CondBuffValue] | None = None
159173

160174

161175
class ScriptLink(BaseModelORJson):

0 commit comments

Comments
 (0)