Continues implementation

This commit is contained in:
2025-05-20 22:05:16 +02:00
parent 38ada274e3
commit dd1697902a
365 changed files with 142568 additions and 122351 deletions

View File

@@ -0,0 +1,71 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
import static java.util.Objects.requireNonNull;
public abstract class AbstractCard {
private final int id;
private final String name;
private final CardInfo cardInfo;
private final CardTechnicalInfo technicalInfo;
private final int manaCost;
private final Keywords keywords;
private final Immunity immunity;
protected AbstractCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo info,
final int manaCost, final Keywords keywords, final Immunity immunity) {
this.id = id;
this.name = requireNonNull(name);
this.cardInfo = requireNonNull(cardInfo);
this.technicalInfo = requireNonNull(info);
this.manaCost = manaCost;
this.keywords = requireNonNull(keywords);
this.immunity = requireNonNull(immunity);
}
public int id() {
return id;
}
public String name() {
return name;
}
public CardInfo cardInfo() {
return cardInfo;
}
public CardTechnicalInfo technicalInfo() {
return technicalInfo;
}
public int manaCost() {
return manaCost;
}
public Keywords keywords() {
return keywords;
}
public Immunity immunity() {
return immunity;
}
@Override
public boolean equals(final Object obj) {
if (obj == null || getClass() != obj.getClass()) return false;
final var card = (AbstractCard) obj;
return id == card.id && Objects.equals(cardInfo, card.cardInfo) &&
Objects.equals(technicalInfo, card.technicalInfo) &&
Objects.equals(name, card.name) && manaCost == card.manaCost &&
Objects.equals(keywords, card.keywords) && Objects.equals(immunity, card.immunity);
}
@Override
public int hashCode() {
return Objects.hash(id, name, cardInfo, technicalInfo, manaCost, keywords, immunity);
}
}

View File

@@ -0,0 +1,38 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public class ActionCard extends AbstractCard {
private final boolean betray;
private final boolean empower;
public ActionCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo technicalInfo,
final int manaCost, final Keywords keywords, final Immunity immunity,
final boolean betray, final boolean empower) {
super(id, name, cardInfo, technicalInfo, manaCost, keywords, immunity);
this.betray = betray;
this.empower = empower;
}
public boolean betray() {
return betray;
}
public boolean empower() {
return empower;
}
@Override
public boolean equals(final Object o) {
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
final var that = (ActionCard) o;
return betray == that.betray && empower == that.empower;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), betray, empower);
}
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.card;
public record AttackHealth(int attack, int health) {
}

View File

@@ -0,0 +1,18 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public class AvatarCard extends AbstractCard {
private final AvatarValues values;
public AvatarCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo info,
final int manaCost, final Keywords keywords, final Immunity immunity, final AvatarValues values) {
super(id, name, cardInfo, info, manaCost, keywords, immunity);
this.values = Objects.requireNonNull(values);
}
public AvatarValues values() {
return values;
}
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.card;
public record AvatarHealthValues(boolean doubleHealing, int gainHealthFromRuneBreaks, boolean noHealing,
int percentDamageTaken, int startingHealth) {
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.card;
public record AvatarValues(boolean blockDrawsFromRuneBreak, boolean cannotCounterattack, boolean extraManaPlayRules,
int maxMana, AvatarHealthValues healthValues) {
}

View File

@@ -0,0 +1,19 @@
package ch.gtache.elderscrollslegends.card;
import ch.gtache.elderscrollslegends.service.profile.CollectionName;
import ch.gtache.elderscrollslegends.service.profile.Rarity;
import java.util.Collection;
import java.util.Objects;
import java.util.Set;
public record CardInfo(CollectionName collection, boolean unique, Rarity rarity, CardType type,
Collection<CardSubtype> subtypes) {
public CardInfo {
Objects.requireNonNull(collection);
Objects.requireNonNull(rarity);
Objects.requireNonNull(type);
subtypes = Set.copyOf(subtypes);
}
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.card;
public enum CardSource {
Normal,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.card;
public enum CardSubtype {
Intelligence,

View File

@@ -0,0 +1,18 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public record CardTechnicalInfo(CardSource source, int season, boolean production,
boolean premiumOnly, boolean invalidArenaPick, boolean canBeFirstEverSoloPick,
int maxCopies, String exportCode) {
public CardTechnicalInfo {
Objects.requireNonNull(source);
if (season < 0) {
throw new IllegalArgumentException("season must be >= 0");
}
if (maxCopies < 0) {
throw new IllegalArgumentException("maxCopies must be >= 0");
}
}
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.card;
public enum CardType {
Creature, Support, Action, Item, Avatar, Double

View File

@@ -0,0 +1,12 @@
package ch.gtache.elderscrollslegends.card;
public record CreatureAttackInfo(boolean canAttackFriendFace, boolean canAttackFriendlies,
boolean canAttackOtherLane, boolean canBeAttackedFromAnyLane,
boolean canOnlyAttackCreatures, boolean cannotAttack,
boolean damageAvatarOfAttackedCreature, boolean ignoreTaunt,
int numAttacksPerTurn, boolean moveToAttackOtherLane) {
public CreatureAttackInfo(final int numAttacksPerTurn) {
this(false, false, false, false, false, false, false, false, numAttacksPerTurn, false);
}
}

View File

@@ -0,0 +1,59 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public class CreatureCard extends AbstractCard {
private final CreatureStats stats;
private final CreatureAttackInfo attackInfo;
private final Exalt exalt;
private final FreezeInfo freezeInfo;
private final CreatureFlags flags;
public CreatureCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo technicalInfo,
final int manaCost, final Keywords keywords, final Immunity immunity,
final CreatureStats stats, final CreatureAttackInfo attackInfo,
final Exalt exalt, final FreezeInfo freezeInfo, final CreatureFlags flags) {
super(id, name, cardInfo, technicalInfo, manaCost, keywords, immunity);
this.stats = Objects.requireNonNull(stats);
this.attackInfo = Objects.requireNonNull(attackInfo);
this.exalt = Objects.requireNonNull(exalt);
this.freezeInfo = Objects.requireNonNull(freezeInfo);
this.flags = Objects.requireNonNull(flags);
}
public CreatureStats stats() {
return stats;
}
public CreatureAttackInfo attackInfo() {
return attackInfo;
}
public Exalt exalt() {
return exalt;
}
public FreezeInfo freezeInfo() {
return freezeInfo;
}
public CreatureFlags flags() {
return flags;
}
@Override
public boolean equals(final Object o) {
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
final var that = (CreatureCard) o;
return Objects.equals(stats, that.stats) && Objects.equals(attackInfo, that.attackInfo) &&
Objects.equals(exalt, that.exalt) && Objects.equals(freezeInfo, that.freezeInfo) &&
Objects.equals(flags, that.flags);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), stats, attackInfo, exalt, freezeInfo, flags);
}
}

View File

@@ -0,0 +1,7 @@
package ch.gtache.elderscrollslegends.card;
public record CreatureFlags(boolean boardSplash, boolean colossal, boolean cover, boolean drainOnBothTurns,
boolean firstStrike, boolean guardsBothLanes, int oblivionGateLevel,
int preventOpponentManaPlay, boolean reanimated, boolean slayOnBothTurns,
boolean unstoppable, boolean untouchable) {
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.card;
public record CreatureStats(AttackHealth attackHealth, int maxHealth, boolean wounded) {
}

View File

@@ -0,0 +1,46 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public class DoubleCard extends AbstractCard {
private final CreatureStats stats;
private final CreatureAttackInfo attackInfo;
private final DoubleInfo doubleInfo;
public DoubleCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo technicalInfo,
final int manaCost, final Keywords keywords, final Immunity immunity,
final CreatureStats stats, final CreatureAttackInfo attackInfo,
final DoubleInfo doubleInfo) {
super(id, name, cardInfo, technicalInfo, manaCost, keywords, immunity);
this.stats = Objects.requireNonNull(stats);
this.attackInfo = Objects.requireNonNull(attackInfo);
this.doubleInfo = Objects.requireNonNull(doubleInfo);
}
public CreatureStats stats() {
return stats;
}
public CreatureAttackInfo attackInfo() {
return attackInfo;
}
public DoubleInfo doubleInfo() {
return doubleInfo;
}
@Override
public boolean equals(final Object o) {
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
final var that = (DoubleCard) o;
return Objects.equals(stats, that.stats) && Objects.equals(attackInfo, that.attackInfo) &&
Objects.equals(doubleInfo, that.doubleInfo);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), stats, attackInfo, doubleInfo);
}
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.card;
public record DoubleInfo(AbstractCard card1, AbstractCard card2, boolean betray) {
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.card;
public record Exalt(boolean canExalt, boolean exalted, int exaltCost) {
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.card;
public record FreezeInfo(boolean hasFreeze, boolean iceFreeze, boolean permanentFreeze, boolean webFreeze) {
}

View File

@@ -0,0 +1,23 @@
package ch.gtache.elderscrollslegends.card;
public record Immunity(boolean immune, boolean immuneToActionDamage, boolean immuneToBanish,
boolean immuneToCover, boolean immuneToEnemyActionTargeting,
boolean immuneToEnemyCliffCreatures, boolean immuneToEnemyDragons,
boolean immuneToEnemyKeywords, boolean immuneToFreeze, boolean immuneToLethal,
boolean immuneMusic, boolean immuneToSilence, boolean immuneToSteal,
boolean immuneToSupportDamage, boolean immuneToWounded) {
public Immunity(final boolean immuneToBanish, final boolean immuneToSteal) {
this(false, false, immuneToBanish, false, false,
false, false, false, false,
false, false, false, immuneToSteal, false,
false);
}
public Immunity(final boolean immuneToBanish, final boolean immuneToSilence, final boolean immuneToSteal) {
this(false, false, immuneToBanish, false, false,
false, false, false, false,
false, false, immuneToSilence, immuneToSteal, false,
false);
}
}

View File

@@ -0,0 +1,52 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public class ItemCard extends AbstractCard {
private final boolean amuletOfMara;
private final boolean canOnlyAttackCreatures;
private final boolean mobilize;
private final AttackHealth attackHealth;
public ItemCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo technicalInfo,
final int manaCost, final Keywords keywords, final Immunity immunity, final boolean amuletOfMara,
final boolean canOnlyAttackCreatures, final boolean mobilize, final AttackHealth attackHealth) {
super(id, name, cardInfo, technicalInfo, manaCost, keywords, immunity);
this.amuletOfMara = amuletOfMara;
this.canOnlyAttackCreatures = canOnlyAttackCreatures;
this.mobilize = mobilize;
this.attackHealth = Objects.requireNonNull(attackHealth);
}
public boolean amuletOfMara() {
return amuletOfMara;
}
public boolean canOnlyAttackCreatures() {
return canOnlyAttackCreatures;
}
public boolean isMobilize() {
return mobilize;
}
public AttackHealth attackHealth() {
return attackHealth;
}
@Override
public boolean equals(final Object o) {
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
final var itemCard = (ItemCard) o;
return amuletOfMara == itemCard.amuletOfMara && canOnlyAttackCreatures == itemCard.canOnlyAttackCreatures &&
mobilize == itemCard.mobilize &&
Objects.equals(attackHealth, itemCard.attackHealth);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), amuletOfMara, canOnlyAttackCreatures, mobilize, attackHealth);
}
}

View File

@@ -0,0 +1,6 @@
package ch.gtache.elderscrollslegends.card;
public record Keywords(boolean breakthrough, boolean charge, boolean drain, boolean guard,
boolean lethal, boolean mobilize, boolean prophecy, int rally, boolean regenerate,
boolean taunt, boolean ward) {
}

View File

@@ -0,0 +1,38 @@
package ch.gtache.elderscrollslegends.card;
import java.util.Objects;
public class SupportCard extends AbstractCard {
private final boolean indestructible;
private final SupportUseInfo useInfo;
public SupportCard(final int id, final String name, final CardInfo cardInfo, final CardTechnicalInfo technicalInfo,
final int manaCost, final Keywords keywords, final Immunity immunity,
final boolean indestructible, final SupportUseInfo useInfo) {
super(id, name, cardInfo, technicalInfo, manaCost, keywords, immunity);
this.indestructible = indestructible;
this.useInfo = Objects.requireNonNull(useInfo);
}
public boolean indestructible() {
return indestructible;
}
public SupportUseInfo useInfo() {
return useInfo;
}
@Override
public boolean equals(final Object o) {
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
final var that = (SupportCard) o;
return indestructible == that.indestructible && Objects.equals(useInfo, that.useInfo);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), indestructible, useInfo);
}
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.card;
public record SupportUseInfo(int abilityUsesPerTurn, int totalUsesAllowed, boolean unlimitedUses, int usesLeft) {
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.client;
public record AITargetRules(AllyRule AllyRule) {
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum AllowedDeck {
PlayerAny
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum AllyRule {
TargetBoth
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum Are {
Friends
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum AttributeMethod {
CardAttribute,

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public record AttributeModification(ModificationType ModificationType, AttributeName AttributeName,
int Value, int DynamicValue, boolean LockedDynamicValue) {
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum AttributeName {
ManaCost
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum CardAttribute {
Attack,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum CardMechanic {
Summon,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum CardRareAttribute {
None,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.annotation.JsonAlias;

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum CardRole {
Self
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum ClientTargetingType {
NoTarget
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum CompletionType {
Placeholder,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum CountIs {
GreaterThan,

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum CountingType {
Events
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum CustomUIType {
None
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum EffectTriggerType {
AbilityEffect,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum EmoteType {
Hello,

View File

@@ -0,0 +1,16 @@
package ch.gtache.elderscrollslegends.client;
import java.util.List;
public record Enchantment(String NameForEditor, JSONRawKey DisplayTitle, JSONRawKey DisplayText,
int MaxTurns, boolean DeferApplication, boolean DeferApplicationLast,
boolean BasicItemEnchantment, boolean KeepWhenMovesOffBoard, boolean ExpiresAtStartOfTurn,
boolean ExpiresAtStartOfSourcesTurn, boolean ExpiresAtEndOfTurn, boolean ExpiresAtEndOfFight,
boolean ExpiresOnAttack, boolean ExpiresOnIncomingDamage, boolean ExpiresAtEndOfProphecy,
boolean ExpiresAtEndOfTurnAfterNotAttacking, boolean ExpiresAfterRuneBreak,
boolean PermanentExpiresOnLeavingBoard, boolean PermanentExpiresOnChange,
boolean ResetWoundedState, List<AttributeModification> AttributeModifications,
List<Object> GrantedEffects, List<Object> GrantedAuras, List<Object> AddedCreatureSubtypes,
List<Object> NewColorSubtypes, List<Object> SubcardDistributionSubtypes,
List<Object> MechanicEntries, List<Object> CardReferences, List<Object> TagReferences) {
}

View File

@@ -0,0 +1,7 @@
package ch.gtache.elderscrollslegends.client;
import java.util.List;
public record Enchantments(String Name, boolean UseBuffFx, boolean UseDebuffFx, List<JSONSelector> Selectors,
StackCount StackCount, Enchantment Enchantment) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum FXAction {
TriggeredEffect,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum HuntType {
None,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -0,0 +1,8 @@
package ch.gtache.elderscrollslegends.client;
import java.util.List;
public record JSONAura(String NameForEditor, boolean ExclusiveAura, boolean HideStatusFx,
List<CardRequirements> CardRequirements, List<PlayerRequirements> playerRequirements,
List<Enchantments> EnchantmentsToApply) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONAvatar(JSONResourceId ResourceId, JSONResource RaceId, JSONResource EmotePackage, String Image,
String CircularImage, int ContentPackIndex) {

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,5 +1,8 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import ch.gtache.elderscrollslegends.card.CardSource;
import ch.gtache.elderscrollslegends.card.CardSubtype;
import ch.gtache.elderscrollslegends.card.CardType;
import ch.gtache.elderscrollslegends.service.profile.Rarity;
import java.util.List;
@@ -30,4 +33,8 @@ public record JSONCard(JSONResourceId ResourceId, boolean Production, String Nam
boolean AllowContentPackOverride,
List<JSONEntityAttribute> EntityAttributes
) {
public String getAttribute(final String name) {
return EntityAttributes.stream().filter(attr -> attr.Name().equals(name)).findFirst().map(JSONEntityAttribute::Value).map(String::valueOf).orElse(null);
}
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,6 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import ch.gtache.elderscrollslegends.card.CardType;
import java.util.List;

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public record JSONCardFX(int AssetHash, FXAction FXAction, EffectTriggerType EffectTriggerType,
String CardFxDefinition) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONDialogueDataEvent(String CoinImage, JSONRawKey DialogueTextKey,
String DialogueAudio, int ContentPackIndex, boolean EndConversationBranch,

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,6 +1,6 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONDynamicText(long Tag, AttributeMethod Method, CardAttribute CardAttribute,
public record JSONDynamicText(int Tag, AttributeMethod Method, CardAttribute CardAttribute,
PlayerAttribute PlayerAttribute, CardRareAttribute CardRareAttribute,
PlayerRareAttribute PlayerRareAttribute, HuntType HuntType, int HuntIndex) {
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.client;
public record JSONEffect() {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONEmoteData(EmoteType EmoteType, JSONRawKey EmoteString, String EmoteAudio, int ContentPackIndex) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.annotation.JsonAlias;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONHanger(JSONRawKey DisplayTitle, JSONRawKey DisplayText) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONKeyValue(String Key, int Value) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONMechanic(CardMechanic MechanicType, boolean DisplayHanger, boolean DisplayIcon) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.StreamReadFeature;

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.client;
public record JSONPosition(double x, double y) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record JSONRace(JSONResourceId ResourceId, JSONRawKey Name, JSONRawKey Description,
JSONRawKey Bonus, JSONRawKey GuestPlayerName) {

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.client;
public record JSONRawKey(String RawKey) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import ch.gtache.elderscrollslegends.service.campaign.DialogModalType;

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.client;
public record JSONResource(int resourceId) {
}

View File

@@ -0,0 +1,4 @@
package ch.gtache.elderscrollslegends.client;
public record JSONResourceId(int Id, String UniqueName, CompletionType CompletionType) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.annotation.JsonAlias;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import ch.gtache.elderscrollslegends.service.profile.Rarity;

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import javax.swing.*;
import java.util.List;

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum JournalType {
Played
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public record LaneConditional(SelectorCheck Check, boolean IgnoreDuringBetrayPrep) {
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.annotation.JsonAlias;

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum LhsCard {
Inciter
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum LhsLane {
Self
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum LhsPlayer {
Self
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum ModificationType {
Add
}

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum OtherCard {
Self
}

View File

@@ -0,0 +1,19 @@
package ch.gtache.elderscrollslegends.client;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Collectors;
public class ParseAvatars {
public static void main(final String[] args) throws IOException {
final var parser = new JSONParser();
final var content = Files.readString(Paths.get("client-config/AvatarCollection.json"));
final var avatars = parser.parse(content, JSONAvatarCollection.class);
System.out.println(avatars.Races().stream().map(r -> "(" + r.ResourceId().Id() + ",'" + r.ResourceId().UniqueName() + "')").collect(Collectors.joining(",\n")) + ";");
System.out.println();
System.out.println(avatars.Avatars().stream().map(a -> "(" + a.ResourceId().Id() + ",'" + a.ResourceId().UniqueName() + "'," + a.RaceId().resourceId() + ")").collect(Collectors.joining(",\n")) + ";");
System.out.println(avatars.FallbackAvatar());
}
}

View File

@@ -0,0 +1,27 @@
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
public class ParseCampaigns {
public static void main(final String[] args) throws IOException {
final var parser = new JSONParser();
final var content = Files.readString(Paths.get("client-config/Campaigns.json"));
final var campaigns = parser.parse(content, new CampaignsReference());
final var atomicInteger = new AtomicInteger(0);
System.out.println(campaigns.stream().flatMap(c -> c.Acts().stream().flatMap(a -> {
atomicInteger.set(0);
return a.Chapters().stream().map(chap -> "(" + a.ResourceId().Id() + "," + chap.ResourceId().Id() + "," + atomicInteger.getAndIncrement() + ",'" + chap.ResourceId().UniqueName() + "','')");
})).collect(Collectors.joining(",\n")) + ";");
}
private static final class CampaignsReference extends TypeReference<List<JSONCampaign>> {
}
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -11,9 +11,9 @@ public class ParseCardDefinitions {
public static void main(final String[] args) throws IOException {
final var parser = new JSONParser();
final var content = Files.readString(Paths.get("client-config\\CardDefinitions.json"));
final var campaigns = parser.parse(content, new CardsReference());
System.out.println(campaigns);
final var content = Files.readString(Paths.get("client-config/CardDefinitions.json"));
final var cards = parser.parse(content, new CardsReference());
System.out.println(cards);
}
private static final class CardsReference extends TypeReference<List<JSONCardDefinition>> {

View File

@@ -0,0 +1,79 @@
package ch.gtache.elderscrollslegends.client;
import ch.gtache.elderscrollslegends.card.CardType;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
public class ParseCards {
public static void main(final String[] args) throws IOException {
final var parser = new JSONParser();
final var content = Files.readString(Paths.get("client-config/CardCollection.json"));
final var cards = parser.parse(content, new CardsReference());
// System.out.println(cards.stream().flatMap(cc -> cc.Cards().stream()
// .map(c -> "(" +
// c.ResourceId().Id() + ",'" +
// c.ResourceId().UniqueName().replace("'", "''") + "'," +
// c.Production() + "," +
// c.Unique() + "," +
// c.IsPremiumOnly() + "," +
// c.CanBeFirstEverSoloPick() + "," +
// c.InvalidArenaPick() + "," +
// c.MaxCopies() + "," +
// "(SELECT id FROM collection WHERE name='" + cc.Name() + "')," +
// "(SELECT id FROM rarity WHERE name='" + c.Rarity().name() + "')," +
// c.SeasonId() + "," +
// "(SELECT id FROM card.type WHERE name='" + c.Definition().name() + "')," +
// "(SELECT id FROM card.source WHERE name='" + c.Source().name() + "'),'" +
// c.ExportCode() + "')")).collect(Collectors.joining(",\n")) + ";");
// System.out.println();
// System.out.println(cards.stream().flatMap(cc -> cc.Cards().stream()
// .flatMap(c -> c.Subtypes().stream().map(s -> "(" +
// c.ResourceId().Id() + "," +
// "(SELECT id FROM subtype WHERE name='" + s.name() + "'))")
// )).collect(Collectors.joining(",\n")) + ";");
final var map = new HashMap<CardType, List<String>>();
cards.forEach(cc -> cc.Cards().forEach(c -> {
final var list = map.computeIfAbsent(c.Definition(), k -> new ArrayList<>());
final var string = switch (c.Definition()) {
case Action -> {
final var attributes = List.of("Betray", "Breakthrough", "Drain", "HasEmpower", "ImmuneToBanish", "ImmuneToSteal", "Deathtouch", "ManaCost", "Prophecy");
yield "(" + c.ResourceId().Id() + "," + attributes.stream().map(c::getAttribute).collect(Collectors.joining(",")) + ")";
}
case Avatar -> {
final var attributes = List.of("BlockDrawsFromRuneBreak", "CannotCounterattack", "DoubleHealing", "ExtraManaPlayRules", "GainHealthFromRuneBreak", "MaxMana", "NoHealing", "PercentDamageTaken", "StartingHealth");
yield "(" + c.ResourceId().Id() + "," + attributes.stream().map(c::getAttribute).collect(Collectors.joining(",")) + ")";
}
case Creature -> {
final var attributes = List.of("Attack", "BoardSplash", "Breakthrough", "CanAttackFriendFace", "CanAttackFriendlies", "CanAttackOtherLane", "CanBeAttackedFromAnyLane", "CanOnlyAttackCreatures", "CannotAttack", "Charge", "Colossal", "Cover", "DamageAvatarOfAttackedCreature", "Drain", "DrainOnBothTurns", "ExaltCost", "Exalted", "FirstStrike", "Freeze", "GuardsBothLanes", "IceFreeze", "IgnoreTaunt", "Immune", "ImmuneMusic", "ImmuneToActionDamage", "ImmuneToBanish", "ImmuneToCover", "ImmuneToEnemyActionTargeting", "ImmuneToEnemyCliffCreatures", "ImmuneToEnemyDragons", "ImmuneToEnemyKeywords", "ImmuneToFreeze", "ImmuneToLethal", "ImmuneToSilence", "ImmuneToSteal", "ImmuneToSupportDamage", "ImmuneToWounded", "Deathtouch", "ManaCost", "MaxHealth", "MoveToAttackOtherLane", "NumAttacksPerTurn", "OblivionGateLevel", "PermFreeze", "PreventOpponentManaPlay", "Prophecy", "Rally", "Reanimated", "Regenerate", "SlayOnBothTurns", "Taunt", "Unstoppable", "Untouchable", "Ward", "WebFreeze", "Wounded");
yield "(" + c.ResourceId().Id() + "," + attributes.stream().map(c::getAttribute).collect(Collectors.joining(",")) + ")";
}
case Double -> {
final var attributes = List.of("Attack", "Betray", "Breakthrough", "Charge", "Drain", "ImmuneToBanish", "ImmuneToSteal", "Deathtouch", "ManaCost", "MaxHealth", "NumAttacksPerTurn", "Prophecy", "Rally", "Regenerate", "Taunt", "Ward");
yield "(" + c.ResourceId().Id() + "," + c.DoubleCardReferences().getFirst().resourceId() + "," + c.DoubleCardReferences().getLast().resourceId() + "," + attributes.stream().map(c::getAttribute).collect(Collectors.joining(",")) + ")";
}
case Item -> {
final var attributes = List.of("AmuletOfMaraFog", "Attack", "Breakthrough", "CanOnlyAttackCreatures", "Charge", "Drain", "ImmuneToBanish", "ImmuneToSilence", "ImmuneToSteal", "Deathtouch", "ManaCost", "MaxHealth", "Mobilize", "Prophecy", "Rally", "Regenerate", "Taunt", "Ward");
yield "(" + c.ResourceId().Id() + "," + attributes.stream().map(c::getAttribute).collect(Collectors.joining(",")) + ")";
}
case Support -> {
final var attributes = List.of("AbilityUsesPerTurn", "ImmuneToBanish", "ImmuneToSteal", "Indestructible", "ManaCost", "TotalUsesAllowed", "UnlimitedUses");
yield "(" + c.ResourceId().Id() + "," + attributes.stream().map(c::getAttribute).collect(Collectors.joining(",")) + ")";
}
};
list.add(string);
}));
map.forEach((s, list) -> System.out.println("\n" + s + "\n" + String.join(",\n", list)));
}
private static final class CardsReference extends TypeReference<List<JSONCardCollection>> {
}
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -6,14 +6,15 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
public class ParseTitles {
public static void main(final String[] args) throws IOException {
final var parser = new JSONParser();
final var content = Files.readString(Paths.get("client-config\\Titles.json"));
final var campaigns = parser.parse(content, new TitlesReference());
System.out.println(campaigns);
final var content = Files.readString(Paths.get("client-config/Titles.json"));
final var titles = parser.parse(content, new TitlesReference());
System.out.println(titles.stream().map(t -> "(" + t.ResourceId().Id() + ",'" + t.ResourceId().UniqueName() + "',(SELECT id FROM rarity WHERE name='" + t.Rarity().name() + "')," + t.Hidden() + ")").collect(Collectors.joining(",\n")));
}
private static final class TitlesReference extends TypeReference<List<JSONTitle>> {

View File

@@ -0,0 +1,5 @@
package ch.gtache.elderscrollslegends.client;
public enum PlayerAttribute {
None
}

View File

@@ -1,4 +1,4 @@
package ch.gtache.elderscrollslegends.service.utils;
package ch.gtache.elderscrollslegends.client;
public enum PlayerRareAttribute {
None,

Some files were not shown because too many files have changed in this diff Show More