Skip to content

Commit

Permalink
Add new enums from 2.101.0
Browse files Browse the repository at this point in the history
  • Loading branch information
narumi147 committed Oct 17, 2024
1 parent 21696f8 commit ad36815
Show file tree
Hide file tree
Showing 21 changed files with 115 additions and 26 deletions.
2 changes: 2 additions & 0 deletions lib/app/battle/functions/function_executor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class FunctionExecutor {
GainNP.gainNpPerIndividual(
battleData,
dataVals,
activator,
targets,
function.traitVals,
);
Expand Down Expand Up @@ -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:
Expand Down
25 changes: 21 additions & 4 deletions lib/app/battle/functions/gain_np.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class GainNP {
static void gainNpPerIndividual(
final BattleData battleData,
final DataVals dataVals,
final BattleServantData? actor,
final Iterable<BattleServantData> targets,
final List<NiceTrait>? targetTraits,
) {
Expand All @@ -61,15 +62,19 @@ class GainNP {
target.isPlayer ? battleData.nonnullEnemies : battleData.nonnullPlayers;
final List<BattleServantData> 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;
Expand Down Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions lib/app/descriptors/func/func.dart
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ class FuncDescriptor extends StatelessWidget {
FuncType.gainHpFromTargets,
FuncType.absorbNpturn,
FuncType.gainNpFromTargets,
FuncType.gainNpTargetSum,
].contains(func.funcType)) {
funcText.write(Transl.special.funcAbsorbFrom);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/app/descriptors/func/vals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 6 additions & 0 deletions lib/app/modules/charge/np_charge_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ class _NpChargePageState extends State<NpChargePage> {
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;
Expand Down
2 changes: 2 additions & 0 deletions lib/app/modules/event/detail/campaign.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/app/modules/shop/shop_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class _ShopListHomeState extends State<ShopListHome> {
List<ShopType> get _kShownShopTypes => [
ShopType.mana,
ShopType.rarePri,
ShopType.shop15, // 巡霊の葉
ShopType.shop13, // pure prism
ShopType.revivalItem,
ShopType.purePri,
ShopType.svtCostume,
ShopType.eventSvtEquip,
ShopType.startUpSummon,
Expand Down
2 changes: 2 additions & 0 deletions lib/generated/models/gamedata/buff.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions lib/generated/models/gamedata/const_data.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/generated/models/gamedata/event.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/generated/models/gamedata/func.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/generated/models/gamedata/item.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/generated/models/gamedata/quest.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion lib/models/gamedata/buff.dart
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ class BuffTypeConverter extends JsonConverter<BuffType, String> {

@JsonEnum(alwaysCreate: true)
enum BuffType {
unknown(-1), // custom
unknown(-2), // custom
invalid(-1),
none(0),
upCommandatk(1),
upStarweight(2),
Expand Down Expand Up @@ -476,6 +477,7 @@ enum BuffType {
pierceSpecialInvincible(207),
functionedFunction(208),
donotActCommandcard(209),
upNpdamageIndividualitySum(210),
toFieldChangeField(10001),
toFieldAvoidBuff(10002),
toFieldSubIndividualityField(10003),
Expand Down
12 changes: 8 additions & 4 deletions lib/models/gamedata/const_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,7 @@ class GameConstantStr {
final List<int> subPtBuffIndivi; // 3055
final List<int> svtExitPtBuffIndivi; // 3069
final List<int> playableBeastClassIds;
final List<int> enableOverwriteClassIds;

const GameConstantStr({
this.extendTurnBuffType = const [
Expand All @@ -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<String, dynamic> json) {
Expand Down Expand Up @@ -1078,10 +1080,10 @@ enum SvtFrameType {
bronze,
silver,
gold,
frame0801,
frame0802,
frame0803,
frame0804,
goldRed,
goldRedGreat,
goldBlack,
goldBlackGreat,
}

// String or int
Expand Down Expand Up @@ -1259,6 +1261,7 @@ enum BuffAction {
pierceSpecialInvincible(144),
functionedFunction(145),
donotActCommandcard(146),
npdamageIndividuality(147),
functionClassboardCommandSpellAfter(301),
;

Expand Down Expand Up @@ -1330,6 +1333,7 @@ const kFuncValPercentType = <FuncType, int>{
FuncType.gainNp: 100,
FuncType.gainNpBuffIndividualSum: 100,
FuncType.gainNpIndividualSum: 100,
FuncType.gainNpTargetSum: 100,
FuncType.gainMultiplyNp: 10,
FuncType.lossNp: 100,
FuncType.damageNp: 10,
Expand Down
3 changes: 2 additions & 1 deletion lib/models/gamedata/effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lib/models/gamedata/event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2020,9 +2020,9 @@ enum ShopType {
grailFragments,
svtCostume,
startUpSummon,
shop13, // pure prism
purePri,
tradeAp,
shop15, // 巡霊の葉
revivalItem, // 巡霊の葉
eventSvtEquip,
}

Expand Down
1 change: 1 addition & 0 deletions lib/models/gamedata/func.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@ enum FuncType {
damageNpBattlePointPhase(143),
setNpExecutedState(144),
hideOverGauge(145),
gainNpTargetSum(146),
;

final int value;
Expand Down
4 changes: 2 additions & 2 deletions lib/models/gamedata/item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@ enum ItemType {
euqipSkillUseItem,
svtCoin,
friendshipUpItem,
pp,
purePri,
tradeAp,
ri,
revivalItem,
stormpod,
battleItem,
aniplexPlusChargeStone,
Expand Down
5 changes: 4 additions & 1 deletion lib/models/gamedata/quest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,7 @@ enum QuestType {
event(5),
heroballad(6),
warBoard(7),
autoExecute(8),
;

final int value;
Expand All @@ -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;
}
}
}
Expand Down
Loading

0 comments on commit ad36815

Please sign in to comment.