Pack logic cleanup

This commit is contained in:
gamer147
2026-05-24 09:27:10 -04:00
parent 79209bd70b
commit d9ef9fe1fc
33 changed files with 71175 additions and 245 deletions

View File

@@ -84,6 +84,8 @@ public class CardImporter
DustReward = ParseInt(c.GetRedEther, 0)
};
bool isFoil = c.IsFoil == "1";
if (existingCards.TryGetValue(id, out var card))
{
card.Rarity = (Rarity)rarity;
@@ -92,6 +94,7 @@ public class CardImporter
card.Defense = ParseNullableInt(c.Life);
card.Class = classEntry;
card.CollectionInfo = collection;
card.IsFoil = isFoil;
updated++;
}
else
@@ -105,7 +108,8 @@ public class CardImporter
Attack = ParseNullableInt(c.Atk),
Defense = ParseNullableInt(c.Life),
Class = classEntry,
CollectionInfo = collection
CollectionInfo = collection,
IsFoil = isFoil
};
set.Cards.Add(card);
existingCards[id] = card;
@@ -145,4 +149,5 @@ public class CardInput
public string? Rarity { get; set; }
public string? GetRedEther { get; set; }
public string? UseRedEther { get; set; }
public string? IsFoil { get; set; } // cards.json `is_foil` = "0" or "1"
}

View File

@@ -99,18 +99,19 @@ public class GlobalsImporter
return 0;
}
cfg.TsRotationId = GetString(loadIndex, "ts_rotation_id");
cfg.IsBattlePassPeriod = GetBool(loadIndex, "is_battle_pass_period");
cfg.IsBeginnerMission = GetBool(loadIndex, "is_beginner_mission");
cfg.CardSetIdForResourceDlView = GetInt(loadIndex, "card_set_id_for_resource_dl_view");
// TODO: fixed in Task 6 — writes through Config tree after RefactorGameConfigurationToJsonb
cfg.Config.Rotation.TsRotationId = GetString(loadIndex, "ts_rotation_id");
cfg.Config.Rotation.IsBattlePassPeriod = GetBool(loadIndex, "is_battle_pass_period");
cfg.Config.Rotation.IsBeginnerMission = GetBool(loadIndex, "is_beginner_mission");
cfg.Config.Rotation.CardSetIdForResourceDlView = GetInt(loadIndex, "card_set_id_for_resource_dl_view");
if (loadIndex.TryGetProperty("challenge_config", out var cc))
{
cfg.ChallengeUseTwoPickPremiumCard = GetBool(cc, "use_challenge_two_pick_premium_card");
cfg.ChallengeTwoPickSleeveId = GetLong(cc, "challenge_two_pick_sleeve_id");
cfg.Config.Challenge.UseTwoPickPremiumCard = GetBool(cc, "use_challenge_two_pick_premium_card");
cfg.Config.Challenge.TwoPickSleeveId = GetLong(cc, "challenge_two_pick_sleeve_id");
}
Console.WriteLine($"[GlobalsImporter] GameConfiguration extensions: ts_rotation_id={cfg.TsRotationId}");
Console.WriteLine($"[GlobalsImporter] GameConfiguration extensions: ts_rotation_id={cfg.Config.Rotation.TsRotationId}");
return 1;
}