Skip to content

Commit

Permalink
Hide trigger skill lv if lv depends on OC(Miyu)
Browse files Browse the repository at this point in the history
  • Loading branch information
narumi147 committed Aug 10, 2023
1 parent 0d25f1c commit 161a7ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/app/descriptors/func/func.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,11 @@ class FuncDescriptor extends StatelessWidget {
final trigger = kBuffValueTriggerTypes[func.buff?.type];
if (trigger == null) return null;
final details = func.svals.map((e) => trigger(e)).toList();
final ocDetails = func.ocVals(0).map((e) => trigger(e)).toList();
final detail = details.getOrNull((level ?? -1) - 1) ?? details.firstOrNull;
bool noLevel =
details.isEmpty || ((level == null || level == -1) && details.map((e) => e.level).toSet().length > 1);
bool noLevel = details.isEmpty ||
((level == null || level == -1) && details.map((e) => e.level).toSet().length > 1) ||
(ocDetails.map((e) => e.level).toSet().length > 1);

DataVals? vals;
vals = func.svals.getOrNull((level ?? 1) - 1);
Expand Down
6 changes: 3 additions & 3 deletions lib/models/gamedata/func.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ class NiceFunction with RouteInfo implements BaseFunction {
return valList;
}

List<DataVals> ocVals(int lv) {
assert(lv >= 0 && lv < svals.length, lv);
List<DataVals> ocVals(int index) {
assert(index >= 0 && index < svals.length, index);
return [
for (final sv in [svals, svals2, svals3, svals4, svals5])
if (sv != null) sv[lv]
if (sv != null) sv[index]
];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/models/gamedata/servant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class BasicServant with GameCardMixin {

factory BasicServant.fromJson(Map<String, dynamic> json) {
final id = json["id"] as int;
if (json["rarity"] == null) {
if (json["type"] == null) {
// classId and attribute can be overridden
json = Map.from(GameDataLoader.instance.tmp.gameJson!["entities"][id.toString()])..addAll(json);
}
Expand Down

0 comments on commit 161a7ca

Please sign in to comment.