wip: 바보 젬3플. type 재정의 준비
This commit is contained in:
@@ -34,31 +34,19 @@ export const createStatItemModule = (options: StatItemOptions): ItemModule => {
|
||||
const name = `${options.rawName}(+${options.statValue})`;
|
||||
const baseInfo = `${statLabel} +${options.statValue}`;
|
||||
const info = options.extraInfo ? `${baseInfo}<br>${options.extraInfo}` : baseInfo;
|
||||
function onCalcStat(
|
||||
_context: GeneralActionContext,
|
||||
statName: GeneralStatName,
|
||||
value: number,
|
||||
_aux?: unknown
|
||||
): number;
|
||||
function onCalcStat(
|
||||
_context: WarActionContext,
|
||||
statName: WarStatName,
|
||||
value: number | [number, number],
|
||||
_aux?: unknown
|
||||
): number | [number, number];
|
||||
function onCalcStat(
|
||||
const onCalcStat = (
|
||||
_context: GeneralActionContext | WarActionContext,
|
||||
statName: GeneralStatName | WarStatName,
|
||||
value: number | [number, number]
|
||||
): number | [number, number] {
|
||||
): number | [number, number] => {
|
||||
if (statName !== options.statName) {
|
||||
return value;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
return value;
|
||||
if (typeof value === 'number') {
|
||||
return value + options.statValue;
|
||||
}
|
||||
return value + options.statValue;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
return {
|
||||
key: options.key,
|
||||
|
||||
Reference in New Issue
Block a user