Token: added check for required token's class, fixed outdated sets

This commit is contained in:
Oleg Agafonov 2023-04-20 23:33:51 +04:00
parent 8b7558b78e
commit df96b89610
5 changed files with 33 additions and 47 deletions

View file

@ -454,7 +454,7 @@ public enum GrabbagImageSource implements CardImageSource {
singleLinks.put("SWS/Emblem Obi-Wan Kenobi", "Qyc10aT.png"); singleLinks.put("SWS/Emblem Obi-Wan Kenobi", "Qyc10aT.png");
singleLinks.put("SWS/Aurra Sing", "BLWbVJC.png"); singleLinks.put("SWS/Aurra Sing", "BLWbVJC.png");
singleLinks.put("SWS/Yoda", "zH0sYxg.png"); singleLinks.put("SWS/Yoda", "zH0sYxg.png");
singleLinks.put("SWS/Emblem Skywalker", "kHELZDJ.jpg"); singleLinks.put("SWS/Emblem Luke Skywalker", "kHELZDJ.jpg");
// Tokens // Tokens
singleLinks.put("SWS/Ewok", "N2MvJyr.png"); singleLinks.put("SWS/Ewok", "N2MvJyr.png");

View file

@ -610,6 +610,10 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
if (params.size() > 7 && !params.get(6).isEmpty()) { if (params.size() > 7 && !params.get(6).isEmpty()) {
tokenClassName = params.get(6); tokenClassName = params.get(6);
} }
if (tokenClassName.isEmpty()) {
errorsList.add("Tokens database: miss class name: " + line);
continue;
}
// object type // object type
String objectType = params.get(2); String objectType = params.get(2);

View file

@ -172,7 +172,6 @@
# 8ED # 8ED
|Generate|TOK:8ED|Bird|||RukhEggBirdToken| |Generate|TOK:8ED|Bird|||RukhEggBirdToken|
|Generate|TOK:8ED|Rukh||
# 9ED # 9ED
|Generate|TOK:9ED|Bird|||RukhEggBirdToken| |Generate|TOK:9ED|Bird|||RukhEggBirdToken|
@ -194,21 +193,21 @@
|Generate|TOK:AKH|Wurm|||Wurm55Token| |Generate|TOK:AKH|Wurm|||Wurm55Token|
|Generate|TOK:AKH|Zombie|||ZombieToken| |Generate|TOK:AKH|Zombie|||ZombieToken|
#TOK:AKH - some tokens from real cards (see Embalm ability) #TOK:AKH - some tokens from real cards (see Embalm ability)
|Generate|TOK:AKH|Angel of Sanctions|| #|Generate|TOK:AKH|Angel of Sanctions||
|Generate|TOK:AKH|Anointer Priest|| #|Generate|TOK:AKH|Anointer Priest||
|Generate|TOK:AKH|Aven Initiate|| #|Generate|TOK:AKH|Aven Initiate||
|Generate|TOK:AKH|Aven Wind Guide|| #|Generate|TOK:AKH|Aven Wind Guide||
|Generate|TOK:AKH|Glyph Keeper|| #|Generate|TOK:AKH|Glyph Keeper||
|Generate|TOK:AKH|Heart-Piercer Manticore|| #|Generate|TOK:AKH|Heart-Piercer Manticore||
|Generate|TOK:AKH|Honored Hydra|| #|Generate|TOK:AKH|Honored Hydra||
|Generate|TOK:AKH|Labyrinth Guardian|| #|Generate|TOK:AKH|Labyrinth Guardian||
|Generate|TOK:AKH|Oketra's Attendant|| #|Generate|TOK:AKH|Oketra's Attendant||
|Generate|TOK:AKH|Sacred Cat|| #|Generate|TOK:AKH|Sacred Cat||
|Generate|TOK:AKH|Tah-Crop Skirmisher|| #|Generate|TOK:AKH|Tah-Crop Skirmisher||
|Generate|TOK:AKH|Temmet, Vizier of Naktamun|| #|Generate|TOK:AKH|Temmet, Vizier of Naktamun||
|Generate|TOK:AKH|Trueheart Duelist|| #|Generate|TOK:AKH|Trueheart Duelist||
|Generate|TOK:AKH|Unwavering Initiate|| #|Generate|TOK:AKH|Unwavering Initiate||
|Generate|TOK:AKH|Vizier of Many Faces|| #|Generate|TOK:AKH|Vizier of Many Faces||
|Generate|TOK:ALA|Beast|||GodSireBeastToken| |Generate|TOK:ALA|Beast|||GodSireBeastToken|
|Generate|TOK:ALA|Dragon|||DragonToken| |Generate|TOK:ALA|Dragon|||DragonToken|
@ -435,7 +434,7 @@
|Generate|TOK:CNS|Construct|||DarettiConstructToken| |Generate|TOK:CNS|Construct|||DarettiConstructToken|
|Generate|TOK:CNS|Demon|||DemonFlyingToken| |Generate|TOK:CNS|Demon|||DemonFlyingToken|
|Generate|TOK:CNS|Elephant|||ElephantToken| |Generate|TOK:CNS|Elephant|||ElephantToken|
|Generate|TOK:CNS|Ogre|| #un-implemented card|Generate|TOK:CNS|Ogre||
|Generate|TOK:CNS|Spirit|||SpiritWhiteToken| |Generate|TOK:CNS|Spirit|||SpiritWhiteToken|
|Generate|TOK:CNS|Squirrel|||SquirrelToken| |Generate|TOK:CNS|Squirrel|||SquirrelToken|
|Generate|TOK:CNS|Wolf|||WolfToken| |Generate|TOK:CNS|Wolf|||WolfToken|
@ -447,20 +446,9 @@
|Generate|TOK:CSP|Marit Lage|||MaritLageToken| |Generate|TOK:CSP|Marit Lage|||MaritLageToken|
|Generate|TOK:CSP|Soldier|||SoldierToken| |Generate|TOK:CSP|Soldier|||SoldierToken|
|Generate|TOK:DD2|Elemental Shaman|||ElementalShamanToken| |Generate|TOK:DD2|Elemental Shaman|||ElementalShamanToken|
|Generate|TOK:DD3A|Demon||
|Generate|TOK:DD3A|Spirit||
|Generate|TOK:DD3A|Thrull||
|Generate|TOK:DD3B|Elemental||
|Generate|TOK:DD3B|Elf Warrior||
|Generate|TOK:DD3B|Goblin||
|Generate|TOK:DD3C|Bat||
|Generate|TOK:DD3C|Beast|1|
|Generate|TOK:DD3C|Beast|2|
|Generate|TOK:DD3C|Elephant||
|Generate|TOK:DVD|Demon|||DemonFlyingToken| |Generate|TOK:DVD|Demon|||DemonFlyingToken|
|Generate|TOK:DVD|Spirit|||SpiritWhiteToken| |Generate|TOK:DVD|Spirit|||SpiritWhiteToken|
|Generate|TOK:DVD|Thrull|||BreedingPitThrullToken| |Generate|TOK:DVD|Thrull|||BreedingPitThrullToken|
|Generate|TOK:DD3D|Elemental Shaman||
|Generate|TOK:GVL|Bat|||BatToken| |Generate|TOK:GVL|Bat|||BatToken|
|Generate|TOK:GVL|Beast|1||BeastToken| |Generate|TOK:GVL|Beast|1||BeastToken|
|Generate|TOK:GVL|Beast|2||BeastToken2| |Generate|TOK:GVL|Beast|2||BeastToken2|
@ -530,7 +518,6 @@
|Generate|TOK:DTK|Djinn Monk|||DjinnMonkToken| |Generate|TOK:DTK|Djinn Monk|||DjinnMonkToken|
|Generate|TOK:DTK|Dragon|||DragonToken| |Generate|TOK:DTK|Dragon|||DragonToken|
|Generate|TOK:DTK|Goblin|||GoblinToken| |Generate|TOK:DTK|Goblin|||GoblinToken|
|Generate|TOK:DTK|Morph||
|Generate|TOK:DTK|Warrior|||WarriorToken| |Generate|TOK:DTK|Warrior|||WarriorToken|
|Generate|TOK:DTK|Zombie Horror|||CorpseweftZombieToken| |Generate|TOK:DTK|Zombie Horror|||CorpseweftZombieToken|
|Generate|TOK:DTK|Zombie|||ZombieToken| |Generate|TOK:DTK|Zombie|||ZombieToken|
@ -583,8 +570,6 @@
|Generate|TOK:FEM|Goblin|||GoblinToken| |Generate|TOK:FEM|Goblin|||GoblinToken|
|Generate|TOK:FEM|Saproling|||SaprolingToken| |Generate|TOK:FEM|Saproling|||SaprolingToken|
|Generate|TOK:FEM|Thrull|||BreedingPitBlackInsectToken| |Generate|TOK:FEM|Thrull|||BreedingPitBlackInsectToken|
|Generate|TOK:FNMP|Human||
|Generate|TOK:FNMP|Wolf||
|Generate|TOK:FRF|Monk|||MonasteryMentorToken| |Generate|TOK:FRF|Monk|||MonasteryMentorToken|
|Generate|TOK:FRF|Spirit|||SpiritWhiteToken| |Generate|TOK:FRF|Spirit|||SpiritWhiteToken|
|Generate|TOK:FRF|Warrior|||MarduStrikeLeaderWarriorToken| |Generate|TOK:FRF|Warrior|||MarduStrikeLeaderWarriorToken|
@ -609,15 +594,15 @@
|Generate|TOK:HOU|Snake|||RhonassLastStandToken| |Generate|TOK:HOU|Snake|||RhonassLastStandToken|
#TOK:HOU - some tokens from real cards (see Eternalize ability) #TOK:HOU - some tokens from real cards (see Eternalize ability)
#TOK:HOU - Cat, Warrior and Zombie tokens from AKH set #TOK:HOU - Cat, Warrior and Zombie tokens from AKH set
|Generate|TOK:HOU|Adorned Pouncer|||| #|Generate|TOK:HOU|Adorned Pouncer||||
|Generate|TOK:HOU|Champion of Wits|||| #|Generate|TOK:HOU|Champion of Wits||||
|Generate|TOK:HOU|Dreamstealer|||| #|Generate|TOK:HOU|Dreamstealer||||
|Generate|TOK:HOU|Earthshaker Khenra|||| #|Generate|TOK:HOU|Earthshaker Khenra||||
|Generate|TOK:HOU|Proven Combatant|||| #|Generate|TOK:HOU|Proven Combatant||||
|Generate|TOK:HOU|Resilient Khenra|||| #|Generate|TOK:HOU|Resilient Khenra||||
|Generate|TOK:HOU|Sinuous Striker|||| #|Generate|TOK:HOU|Sinuous Striker||||
|Generate|TOK:HOU|Steadfast Sentinel|||| #|Generate|TOK:HOU|Steadfast Sentinel||||
|Generate|TOK:HOU|Sunscourge Champion|||| #|Generate|TOK:HOU|Sunscourge Champion||||
|Generate|TOK:ICE|Caribou|||CaribouToken| |Generate|TOK:ICE|Caribou|||CaribouToken|
|Generate|TOK:INV|Bird|||BlueBirdToken| |Generate|TOK:INV|Bird|||BlueBirdToken|
|Generate|TOK:INV|Elephant|||ElephantToken| |Generate|TOK:INV|Elephant|||ElephantToken|
@ -640,7 +625,7 @@
|Generate|TOK:JOU|Snake|||PharikaSnakeToken| |Generate|TOK:JOU|Snake|||PharikaSnakeToken|
|Generate|TOK:JOU|Sphinx|||HourOfNeedSphinxToken| |Generate|TOK:JOU|Sphinx|||HourOfNeedSphinxToken|
|Generate|TOK:JOU|Spider|||RenownedWeaverSpiderToken| |Generate|TOK:JOU|Spider|||RenownedWeaverSpiderToken|
|Generate|TOK:JOU|Zombie||RitualOfTheReturnedZombieToken| |Generate|TOK:JOU|Zombie|||RitualOfTheReturnedZombieToken|
|Generate|TOK:JUD|Bear|||BearToken| |Generate|TOK:JUD|Bear|||BearToken|
|Generate|TOK:JUD|Bird|||BirdToken| |Generate|TOK:JUD|Bird|||BirdToken|
|Generate|TOK:JUD|Elemental Cat|||ElementalCatToken| |Generate|TOK:JUD|Elemental Cat|||ElementalCatToken|

View file

@ -21,7 +21,7 @@ public final class BeastToken extends TokenImpl {
toughness = new MageInt(3); toughness = new MageInt(3);
availableImageSetCodes = Arrays.asList("C14", "C16", "C19", "CMA", "CN2", "GVL", availableImageSetCodes = Arrays.asList("C14", "C16", "C19", "CMA", "CN2", "GVL",
"DD3C", "DD3GVL", "DDD", "DDL", "DST", "E01", "EVE", "LRW", "M10", "M11", "M12", "DD3GVL", "DDD", "DDL", "DST", "E01", "EVE", "LRW", "M10", "M11", "M12",
"M13", "M14", "M15", "MM3", "NPH", "PC2", "USG", "M19", "IKO", "M21", "CMR", "C21", "M13", "M14", "M15", "MM3", "NPH", "PC2", "USG", "M19", "IKO", "M21", "CMR", "C21",
"AFC", "MIC", "NEC", "2XM", "NCC", "BBD", "PCA", "CLB", "DMU", "ONC", "30A"); "AFC", "MIC", "NEC", "2XM", "NCC", "BBD", "PCA", "CLB", "DMU", "ONC", "30A");
} }
@ -39,9 +39,6 @@ public final class BeastToken extends TokenImpl {
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("C19")) { if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("C19")) {
this.setTokenType(1); this.setTokenType(1);
} }
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("DD3C")) {
setTokenType(RandomUtil.nextInt(2) + 1);
}
if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("MM3")) { if (getOriginalExpansionSetCode() != null && getOriginalExpansionSetCode().equals("MM3")) {
setTokenType(1); setTokenType(1);
} }

View file

@ -21,7 +21,7 @@ public final class DemonToken extends TokenImpl {
toughness = new MageInt(5); toughness = new MageInt(5);
addAbility(FlyingAbility.getInstance()); addAbility(FlyingAbility.getInstance());
availableImageSetCodes.addAll(Arrays.asList("AVR", "C14", "DD3A", "ISD", "ORI", "M20", "M21", "2XM", "DDR", "GN3", "30A")); availableImageSetCodes.addAll(Arrays.asList("AVR", "C14", "ISD", "ORI", "M20", "M21", "2XM", "DDR", "GN3", "30A"));
} }
public DemonToken(final DemonToken token) { public DemonToken(final DemonToken token) {