From ad368150c59e8e7dd2fa1e6894ad1388cce63c8d Mon Sep 17 00:00:00 2001 From: narumi Date: Thu, 17 Oct 2024 08:04:41 +0800 Subject: [PATCH] Add new enums from 2.101.0 --- .../battle/functions/function_executor.dart | 2 + lib/app/battle/functions/gain_np.dart | 25 ++++++++++-- lib/app/descriptors/func/func.dart | 1 + lib/app/descriptors/func/vals.dart | 2 + lib/app/modules/charge/np_charge_page.dart | 6 +++ lib/app/modules/event/detail/campaign.dart | 2 + lib/app/modules/shop/shop_list.dart | 4 +- lib/generated/models/gamedata/buff.g.dart | 2 + .../models/gamedata/const_data.g.dart | 16 ++++++-- lib/generated/models/gamedata/event.g.dart | 4 +- lib/generated/models/gamedata/func.g.dart | 1 + lib/generated/models/gamedata/item.g.dart | 4 +- lib/generated/models/gamedata/quest.g.dart | 1 + lib/models/gamedata/buff.dart | 4 +- lib/models/gamedata/const_data.dart | 12 ++++-- lib/models/gamedata/effect.dart | 3 +- lib/models/gamedata/event.dart | 4 +- lib/models/gamedata/func.dart | 1 + lib/models/gamedata/item.dart | 4 +- lib/models/gamedata/quest.dart | 5 ++- lib/models/gamedata/vals.dart | 38 ++++++++++++++++++- 21 files changed, 115 insertions(+), 26 deletions(-) diff --git a/lib/app/battle/functions/function_executor.dart b/lib/app/battle/functions/function_executor.dart index 8827541ba..e19df4609 100644 --- a/lib/app/battle/functions/function_executor.dart +++ b/lib/app/battle/functions/function_executor.dart @@ -292,6 +292,7 @@ class FunctionExecutor { GainNP.gainNpPerIndividual( battleData, dataVals, + activator, targets, function.traitVals, ); @@ -442,6 +443,7 @@ class FunctionExecutor { AddBattlePoint.addBattlePoint(battleData, dataVals, targets, overchargeState, ignoreBattlePoints); break; case FuncType.updateEnemyEntryMaxCountEachTurn: + case FuncType.gainNpTargetSum: // ↑↑↑ should be implemented ↑↑↑ case FuncType.damageValueSafeOnce: case FuncType.subFieldBuff: diff --git a/lib/app/battle/functions/gain_np.dart b/lib/app/battle/functions/gain_np.dart index 3b4555e3e..4eaeb94cf 100644 --- a/lib/app/battle/functions/gain_np.dart +++ b/lib/app/battle/functions/gain_np.dart @@ -44,6 +44,7 @@ class GainNP { static void gainNpPerIndividual( final BattleData battleData, final DataVals dataVals, + final BattleServantData? actor, final Iterable targets, final List? targetTraits, ) { @@ -61,15 +62,19 @@ class GainNP { target.isPlayer ? battleData.nonnullEnemies : battleData.nonnullPlayers; final List countTargets = []; final targetType = dataVals.Value2 ?? 0; - if (targetType == 0) { + if (targetType == GainNpIndividualSumTarget.self.value) { countTargets.add(target); - } else if (targetType == 1) { + } else if (targetType == GainNpIndividualSumTarget.player.value) { countTargets.addAll(aliveAllies); - } else if (targetType == 2) { + } else if (targetType == GainNpIndividualSumTarget.enemy.value) { countTargets.addAll(aliveEnemies); - } else if (targetType == 3) { + } else if (targetType == GainNpIndividualSumTarget.all.value) { countTargets.addAll(aliveAllies); countTargets.addAll(aliveEnemies); + } else if (targetType == GainNpIndividualSumTarget.otherAll.value) { + countTargets.addAll(aliveAllies); + countTargets.addAll(aliveEnemies); + countTargets.remove(actor); } int count = 0; @@ -119,3 +124,15 @@ class GainNP { } } } + +enum GainNpIndividualSumTarget { + self(0), + player(1), + enemy(2), + all(3), + otherAll(4), + ; + + const GainNpIndividualSumTarget(this.value); + final int value; +} diff --git a/lib/app/descriptors/func/func.dart b/lib/app/descriptors/func/func.dart index f47ffb10f..ec45627d7 100644 --- a/lib/app/descriptors/func/func.dart +++ b/lib/app/descriptors/func/func.dart @@ -585,6 +585,7 @@ class FuncDescriptor extends StatelessWidget { FuncType.gainHpFromTargets, FuncType.absorbNpturn, FuncType.gainNpFromTargets, + FuncType.gainNpTargetSum, ].contains(func.funcType)) { funcText.write(Transl.special.funcAbsorbFrom); } diff --git a/lib/app/descriptors/func/vals.dart b/lib/app/descriptors/func/vals.dart index 276ba73e6..5c1ccd5b3 100644 --- a/lib/app/descriptors/func/vals.dart +++ b/lib/app/descriptors/func/vals.dart @@ -191,6 +191,8 @@ class ValDsc extends StatelessWidget { } } else if (func.funcType == FuncType.gainHpFromTargets) { _addInt(parts, vals.DependFuncVals?.Value, (s) => '$s×N'); + } else if (func.funcType == FuncType.gainNpTargetSum) { + _addInt(parts, vals.DependFuncVals?.Value, (s) => '$s×N'); } else if (func.funcType == FuncType.gainNpFromTargets) { // Absorb Value, charge Value2 _addPercent(parts, vals.DependFuncVals?.Value2 ?? vals.DependFuncVals?.Value, 100, (s) => '$s×N'); diff --git a/lib/app/modules/charge/np_charge_page.dart b/lib/app/modules/charge/np_charge_page.dart index 059fe0eba..05e1756b6 100644 --- a/lib/app/modules/charge/np_charge_page.dart +++ b/lib/app/modules/charge/np_charge_page.dart @@ -578,6 +578,12 @@ class _NpChargePageState extends State { value = '×(1+${sval.Value!.format(base: 10, percent: true)})'; type = NpChargeType.special; } + } else if (func.funcType == FuncType.gainNpTargetSum) { + if (sval.Value != null) { + sortValue = sval.Value!; + value = '${_fmt(sortValue)}×N'; + type = NpChargeType.special; + } } if (sortValue == null || value == null || type == null) return null; if (triggerFunc != null) type = NpChargeType.special; diff --git a/lib/app/modules/event/detail/campaign.dart b/lib/app/modules/event/detail/campaign.dart index d5f259075..07b3dbd04 100644 --- a/lib/app/modules/event/detail/campaign.dart +++ b/lib/app/modules/event/detail/campaign.dart @@ -244,6 +244,8 @@ class EventCampaignDetail extends StatelessWidget { case QuestType.heroballad: case QuestType.warBoard: return S.current.war_board; + case QuestType.autoExecute: + return type!.name; case null: return S.current.unknown; } diff --git a/lib/app/modules/shop/shop_list.dart b/lib/app/modules/shop/shop_list.dart index 82787949c..2fd4e950a 100644 --- a/lib/app/modules/shop/shop_list.dart +++ b/lib/app/modules/shop/shop_list.dart @@ -23,8 +23,8 @@ class _ShopListHomeState extends State { List get _kShownShopTypes => [ ShopType.mana, ShopType.rarePri, - ShopType.shop15, // 巡霊の葉 - ShopType.shop13, // pure prism + ShopType.revivalItem, + ShopType.purePri, ShopType.svtCostume, ShopType.eventSvtEquip, ShopType.startUpSummon, diff --git a/lib/generated/models/gamedata/buff.g.dart b/lib/generated/models/gamedata/buff.g.dart index e6744ded7..6fd72eced 100644 --- a/lib/generated/models/gamedata/buff.g.dart +++ b/lib/generated/models/gamedata/buff.g.dart @@ -213,6 +213,7 @@ Map _$BuffConvertScriptToJson(BuffConvertScript instance) => MasterUserLvDetail( @@ -421,6 +421,7 @@ const _$FuncTypeEnumMap = { FuncType.damageNpBattlePointPhase: 'damageNpBattlePointPhase', FuncType.setNpExecutedState: 'setNpExecutedState', FuncType.hideOverGauge: 'hideOverGauge', + FuncType.gainNpTargetSum: 'gainNpTargetSum', }; BuffTypeDetail _$BuffTypeDetailFromJson(Map json) => BuffTypeDetail( @@ -435,6 +436,7 @@ Map _$BuffTypeDetailToJson(BuffTypeDetail instance) => GameConstantStr( (json['svtExitPtBuffIndivi'] as List?)?.map((e) => (e as num).toInt()).toList() ?? const [3069], playableBeastClassIds: (json['playableBeastClassIds'] as List?)?.map((e) => (e as num).toInt()).toList() ?? const [33, 38], + enableOverwriteClassIds: + (json['enableOverwriteClassIds'] as List?)?.map((e) => (e as num).toInt()).toList() ?? + const [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 23, 25, 28], ); Map _$GameConstantStrToJson(GameConstantStr instance) => { @@ -1265,6 +1271,7 @@ Map _$GameConstantStrToJson(GameConstantStr instance) => SvtLimitHide( @@ -1435,5 +1442,6 @@ const _$BuffActionEnumMap = { BuffAction.pierceSpecialInvincible: 'pierceSpecialInvincible', BuffAction.functionedFunction: 'functionedFunction', BuffAction.donotActCommandcard: 'donotActCommandcard', + BuffAction.npdamageIndividuality: 'npdamageIndividuality', BuffAction.functionClassboardCommandSpellAfter: 'functionClassboardCommandSpellAfter', }; diff --git a/lib/generated/models/gamedata/event.g.dart b/lib/generated/models/gamedata/event.g.dart index a76f682c6..184b6d3a1 100644 --- a/lib/generated/models/gamedata/event.g.dart +++ b/lib/generated/models/gamedata/event.g.dart @@ -452,9 +452,9 @@ const _$ShopTypeEnumMap = { ShopType.grailFragments: 'grailFragments', ShopType.svtCostume: 'svtCostume', ShopType.startUpSummon: 'startUpSummon', - ShopType.shop13: 'shop13', + ShopType.purePri: 'purePri', ShopType.tradeAp: 'tradeAp', - ShopType.shop15: 'shop15', + ShopType.revivalItem: 'revivalItem', ShopType.eventSvtEquip: 'eventSvtEquip', }; diff --git a/lib/generated/models/gamedata/func.g.dart b/lib/generated/models/gamedata/func.g.dart index 9b225fe33..b064ab20c 100644 --- a/lib/generated/models/gamedata/func.g.dart +++ b/lib/generated/models/gamedata/func.g.dart @@ -192,6 +192,7 @@ const _$FuncTypeEnumMap = { FuncType.damageNpBattlePointPhase: 'damageNpBattlePointPhase', FuncType.setNpExecutedState: 'setNpExecutedState', FuncType.hideOverGauge: 'hideOverGauge', + FuncType.gainNpTargetSum: 'gainNpTargetSum', }; const _$FuncTargetTypeEnumMap = { diff --git a/lib/generated/models/gamedata/item.g.dart b/lib/generated/models/gamedata/item.g.dart index 34d9b8276..001e7c598 100644 --- a/lib/generated/models/gamedata/item.g.dart +++ b/lib/generated/models/gamedata/item.g.dart @@ -82,9 +82,9 @@ const _$ItemTypeEnumMap = { ItemType.euqipSkillUseItem: 'euqipSkillUseItem', ItemType.svtCoin: 'svtCoin', ItemType.friendshipUpItem: 'friendshipUpItem', - ItemType.pp: 'pp', + ItemType.purePri: 'purePri', ItemType.tradeAp: 'tradeAp', - ItemType.ri: 'ri', + ItemType.revivalItem: 'revivalItem', ItemType.stormpod: 'stormpod', ItemType.battleItem: 'battleItem', ItemType.aniplexPlusChargeStone: 'aniplexPlusChargeStone', diff --git a/lib/generated/models/gamedata/quest.g.dart b/lib/generated/models/gamedata/quest.g.dart index bc153563c..46c6ea3b9 100644 --- a/lib/generated/models/gamedata/quest.g.dart +++ b/lib/generated/models/gamedata/quest.g.dart @@ -48,6 +48,7 @@ const _$QuestTypeEnumMap = { QuestType.event: 'event', QuestType.heroballad: 'heroballad', QuestType.warBoard: 'warBoard', + QuestType.autoExecute: 'autoExecute', }; const _$QuestAfterClearTypeEnumMap = { diff --git a/lib/models/gamedata/buff.dart b/lib/models/gamedata/buff.dart index f143f0ec7..f42d4ffe1 100644 --- a/lib/models/gamedata/buff.dart +++ b/lib/models/gamedata/buff.dart @@ -281,7 +281,8 @@ class BuffTypeConverter extends JsonConverter { @JsonEnum(alwaysCreate: true) enum BuffType { - unknown(-1), // custom + unknown(-2), // custom + invalid(-1), none(0), upCommandatk(1), upStarweight(2), @@ -476,6 +477,7 @@ enum BuffType { pierceSpecialInvincible(207), functionedFunction(208), donotActCommandcard(209), + upNpdamageIndividualitySum(210), toFieldChangeField(10001), toFieldAvoidBuff(10002), toFieldSubIndividualityField(10003), diff --git a/lib/models/gamedata/const_data.dart b/lib/models/gamedata/const_data.dart index 587bbdeec..fe2da2ec2 100644 --- a/lib/models/gamedata/const_data.dart +++ b/lib/models/gamedata/const_data.dart @@ -1025,6 +1025,7 @@ class GameConstantStr { final List subPtBuffIndivi; // 3055 final List svtExitPtBuffIndivi; // 3069 final List playableBeastClassIds; + final List enableOverwriteClassIds; const GameConstantStr({ this.extendTurnBuffType = const [ @@ -1038,6 +1039,7 @@ class GameConstantStr { this.subPtBuffIndivi = const [3055], this.svtExitPtBuffIndivi = const [3069], this.playableBeastClassIds = const [33, 38], + this.enableOverwriteClassIds = const [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 23, 25, 28], }); factory GameConstantStr.fromJson(Map json) { @@ -1078,10 +1080,10 @@ enum SvtFrameType { bronze, silver, gold, - frame0801, - frame0802, - frame0803, - frame0804, + goldRed, + goldRedGreat, + goldBlack, + goldBlackGreat, } // String or int @@ -1259,6 +1261,7 @@ enum BuffAction { pierceSpecialInvincible(144), functionedFunction(145), donotActCommandcard(146), + npdamageIndividuality(147), functionClassboardCommandSpellAfter(301), ; @@ -1330,6 +1333,7 @@ const kFuncValPercentType = { FuncType.gainNp: 100, FuncType.gainNpBuffIndividualSum: 100, FuncType.gainNpIndividualSum: 100, + FuncType.gainNpTargetSum: 100, FuncType.gainMultiplyNp: 10, FuncType.lossNp: 100, FuncType.damageNp: 10, diff --git a/lib/models/gamedata/effect.dart b/lib/models/gamedata/effect.dart index 80673024d..cf649dce4 100644 --- a/lib/models/gamedata/effect.dart +++ b/lib/models/gamedata/effect.dart @@ -251,7 +251,8 @@ class SkillEffect { FuncType.gainNp, FuncType.gainNpFromTargets, FuncType.gainNpBuffIndividualSum, - FuncType.gainMultiplyNp + FuncType.gainMultiplyNp, + FuncType.gainNpTargetSum, ]); static SkillEffect regainNp = SkillEffect._buff('regainNp', BuffType.regainNp); static SkillEffect upDropnp = SkillEffect._buff('upDropnp', BuffType.upDropnp); diff --git a/lib/models/gamedata/event.dart b/lib/models/gamedata/event.dart index e7681609f..f06a669e7 100644 --- a/lib/models/gamedata/event.dart +++ b/lib/models/gamedata/event.dart @@ -2020,9 +2020,9 @@ enum ShopType { grailFragments, svtCostume, startUpSummon, - shop13, // pure prism + purePri, tradeAp, - shop15, // 巡霊の葉 + revivalItem, // 巡霊の葉 eventSvtEquip, } diff --git a/lib/models/gamedata/func.dart b/lib/models/gamedata/func.dart index 878566d84..9f72cea84 100644 --- a/lib/models/gamedata/func.dart +++ b/lib/models/gamedata/func.dart @@ -602,6 +602,7 @@ enum FuncType { damageNpBattlePointPhase(143), setNpExecutedState(144), hideOverGauge(145), + gainNpTargetSum(146), ; final int value; diff --git a/lib/models/gamedata/item.dart b/lib/models/gamedata/item.dart index 99037087c..258cc2d5b 100644 --- a/lib/models/gamedata/item.dart +++ b/lib/models/gamedata/item.dart @@ -553,9 +553,9 @@ enum ItemType { euqipSkillUseItem, svtCoin, friendshipUpItem, - pp, + purePri, tradeAp, - ri, + revivalItem, stormpod, battleItem, aniplexPlusChargeStone, diff --git a/lib/models/gamedata/quest.dart b/lib/models/gamedata/quest.dart index 31d7b7574..2aa39823f 100644 --- a/lib/models/gamedata/quest.dart +++ b/lib/models/gamedata/quest.dart @@ -2023,6 +2023,7 @@ enum QuestType { event(5), heroballad(6), warBoard(7), + autoExecute(8), ; final int value; @@ -2037,9 +2038,11 @@ enum QuestType { return S.current.interlude; case QuestType.event: return S.current.event; - case QuestType.heroballad: case QuestType.warBoard: return S.current.war_board; + case QuestType.heroballad: + case autoExecute: + return name; } } } diff --git a/lib/models/gamedata/vals.dart b/lib/models/gamedata/vals.dart index 95a925d44..63934c937 100644 --- a/lib/models/gamedata/vals.dart +++ b/lib/models/gamedata/vals.dart @@ -52,7 +52,27 @@ class DataVals { } List? _list(String key) { - return (_vals[key] as List?)?.cast(); + final v = _vals[key]; + return (v as List?)?.cast(); + } + + List>? _2dList(String key) { + final v = _vals[key]; + if (v == null) return null; + if (v is String && T == int) { + try { + List> array = []; + for (String v1 in v.split('|')) { + v1 = v1.trim(); + if (v1.isEmpty) continue; + array.add(v1.split('/').map(int.tryParse).whereType().toList()); + } + return array as List>; + } catch (e) { + return null; + } + } + return (v as List).map((e) => (e as List).cast()).toList(); } /// probability, 1000 -> 100% @@ -295,6 +315,22 @@ class DataVals { List? get TargetFunctionIndividuality => _list('TargetFunctionIndividuality'); List? get TargetBuffIndividuality => _list('TargetBuffIndividuality'); + int? get TargetEnemyClass => _vals['TargetEnemyClass']; + int? get ParamAddIndividualityTargetType => _vals['ParamAddIndividualityTargetType']; + List? get TriggeredFuncIndexAndCheckList => _vals['TriggeredFuncIndexAndCheckList']; + int? get FuncCheckTargetIndividualityTargetType => _vals['FuncCheckTargetIndividualityTargetType']; + int? get FuncCheckTargetIndividualityCountHigher => _vals['FuncCheckTargetIndividualityCountHigher']; + int? get FuncCheckTargetIndividualityCountLower => _vals['FuncCheckTargetIndividualityCountLower']; + int? get FuncCheckTargetIndividualityCountEqual => _vals['FuncCheckTargetIndividualityCountEqual']; + List>? get ParamAddSelfIndividualityAndCheck => _2dList('ParamAddSelfIndividualityAndCheck'); + List>? get ParamAddOpIndividualityAndCheck => _2dList('ParamAddOpIndividualityAndCheck'); + List>? get ParamAddFieldIndividualityAndCheck => _2dList('ParamAddFieldIndividualityAndCheck'); + List>? get SnapShotParamAddSelfIndividualityAndCheck => + _2dList('SnapShotParamAddSelfIndividualityAndCheck'); + List>? get SnapShotParamAddOpIndividualityAndCheck => _2dList('SnapShotParamAddOpIndividualityAndCheck'); + List>? get SnapShotParamAddFieldIndividualityAndCheck => + _2dList('SnapShotParamAddFieldIndividualityAndCheck'); + int? get ApplySupportSvt => _vals['ApplySupportSvt']; int? get Individuality => _vals['Individuality']; int? get EventId => _vals['EventId'];