Генератор колоды Beta

This commit is contained in:
2026-03-26 19:19:00 +05:00
parent d16af289fe
commit 112d101f54
15 changed files with 1362 additions and 110 deletions

View File

@@ -1,21 +1,765 @@
{
"_meta": {
"version": 1,
"description": "Card roles mapping for deck generation"
"description": "Card roles mapping for deck generation",
"generated_from_db": true,
"cards_count": 166,
"available_roles": [
"anti_air",
"building",
"building_hate",
"control",
"cycle",
"defense",
"finisher",
"spell",
"splash",
"support",
"tank",
"win_condition"
]
},
"cards": {
"Knight": ["tank", "defense"],
"Archers": ["support", "anti_air", "cycle"],
"Musketeer": ["support", "anti_air"],
"Tesla": ["building", "defense", "anti_air"],
"Fireball": ["spell", "splash"],
"Zap": ["spell", "cycle"],
"Hog Rider": ["win_condition"],
"Royal Giant": ["win_condition", "tank"],
"Goblin Barrel": ["win_condition"],
"Balloon": ["win_condition"],
"Giant": ["win_condition", "tank"],
"P.E.K.K.A": ["tank", "defense"],
"Baby Dragon": ["support", "anti_air", "splash"]
"Archer Queen": [
"support"
],
"Archers": [
"anti_air",
"cycle",
"support"
],
"Archers Evolution": [
"anti_air",
"cycle",
"support"
],
"Arrows": [
"spell",
"splash"
],
"Baby Dragon": [
"anti_air",
"splash",
"support"
],
"Baby Dragon Evolution": [
"anti_air",
"splash",
"support"
],
"Balloon": [
"support",
"win_condition"
],
"Bandit": [
"support"
],
"Barbarian Barrel Hero": [
"cycle",
"defense",
"spell"
],
"Barbarian Hut": [
"building",
"defense"
],
"Barbarians": [
"support"
],
"Barbarians Evolution": [
"support"
],
"Bats": [
"anti_air",
"cycle",
"support"
],
"Bats Evolution": [
"anti_air",
"cycle",
"support"
],
"Battle Healer": [
"support",
"tank"
],
"Battle Ram": [
"support",
"win_condition"
],
"Battle Ram Evolution": [
"support",
"win_condition"
],
"Berserker": [
"support"
],
"Bomb Tower": [
"building",
"defense",
"splash"
],
"Bomber": [
"cycle",
"splash",
"support"
],
"Bomber Evolution": [
"cycle",
"splash",
"support"
],
"Boss Bandit": [
"support"
],
"Bowler": [
"defense",
"splash",
"support"
],
"Cannon": [
"building",
"defense"
],
"Cannon Cart": [
"defense",
"support"
],
"Cannon Evolution": [
"building",
"defense"
],
"Clone": [
"spell",
"support"
],
"Dark Prince": [
"splash",
"support",
"tank"
],
"Dart Goblin": [
"anti_air",
"support"
],
"Dart Goblin Evolution": [
"anti_air",
"support"
],
"Earthquake": [
"building_hate",
"spell"
],
"Electro Dragon": [
"anti_air",
"splash",
"support"
],
"Electro Dragon Evolution": [
"anti_air",
"splash",
"support"
],
"Electro Giant": [
"support",
"tank",
"win_condition"
],
"Electro Spirit": [
"cycle",
"support"
],
"Electro Wizard": [
"anti_air",
"defense",
"support"
],
"Elite Barbarians": [
"support"
],
"Elixir Collector": [
"building",
"defense",
"support"
],
"Elixir Golem": [
"support",
"tank",
"win_condition"
],
"Executioner": [
"anti_air",
"splash",
"support"
],
"Executioner Evolution": [
"anti_air",
"splash",
"support"
],
"Fire Spirit": [
"cycle",
"splash",
"support"
],
"Fireball": [
"finisher",
"spell",
"splash"
],
"Firecracker": [
"anti_air",
"splash",
"support"
],
"Firecracker Evolution": [
"anti_air",
"splash",
"support"
],
"Fisherman": [
"control",
"defense",
"support"
],
"Freeze": [
"control",
"spell"
],
"Furnace": [
"building",
"defense",
"splash",
"support"
],
"Furnace Evolution": [
"building",
"defense",
"splash"
],
"Giant": [
"support",
"tank",
"win_condition"
],
"Giant Hero": [
"support",
"tank",
"win_condition"
],
"Giant Skeleton": [
"splash",
"support",
"tank"
],
"Giant Snowball": [
"cycle",
"spell"
],
"Giant Snowball Evolution": [
"cycle",
"spell"
],
"Goblin Barrel": [
"spell",
"win_condition"
],
"Goblin Barrel Evolution": [
"spell",
"win_condition"
],
"Goblin Cage": [
"building",
"defense"
],
"Goblin Cage Evolution": [
"building",
"defense"
],
"Goblin Demolisher": [
"splash",
"support"
],
"Goblin Drill": [
"building",
"support",
"win_condition"
],
"Goblin Drill Evolution": [
"building",
"defense",
"win_condition"
],
"Goblin Gang": [
"support"
],
"Goblin Giant": [
"support",
"tank",
"win_condition"
],
"Goblin Giant Evolution": [
"support",
"tank",
"win_condition"
],
"Goblin Giantess": [
"support",
"tank"
],
"Goblin Hut": [
"building",
"defense"
],
"Goblin Machine": [
"support"
],
"Goblins": [
"cycle",
"defense",
"support"
],
"Goblins Hero": [
"cycle",
"defense",
"support"
],
"Goblinstein": [
"support"
],
"Golden Knight": [
"support",
"tank"
],
"Golem": [
"support",
"tank",
"win_condition"
],
"Graveyard": [
"spell",
"win_condition"
],
"Guards": [
"defense",
"support"
],
"Heal Spirit": [
"cycle",
"support"
],
"Hog Rider": [
"support",
"win_condition"
],
"Hunter": [
"anti_air",
"defense",
"support"
],
"Hunter Evolution": [
"anti_air",
"defense",
"support"
],
"Ice Golem": [
"cycle",
"defense",
"support",
"tank"
],
"Ice Golem Hero": [
"cycle",
"defense",
"support",
"tank"
],
"Ice Spirit": [
"cycle",
"support"
],
"Ice Spirit Evolution": [
"cycle",
"support"
],
"Ice Wizard": [
"defense",
"splash",
"support"
],
"Inferno Dragon": [
"anti_air",
"defense",
"support"
],
"Inferno Dragon Evolution": [
"anti_air",
"defense",
"support"
],
"Inferno Tower": [
"building",
"defense"
],
"Knight": [
"defense",
"support",
"tank"
],
"Knight Evolution": [
"defense",
"support",
"tank"
],
"Knight Hero": [
"defense",
"support",
"tank"
],
"Lava Hound": [
"anti_air",
"support",
"tank",
"win_condition"
],
"Lightning": [
"finisher",
"spell"
],
"Little Prince": [
"anti_air",
"support"
],
"Lumberjack": [
"support",
"tank"
],
"Lumberjack Evolution": [
"support",
"tank"
],
"Magic Archer": [
"anti_air",
"support"
],
"Magic Archer Hero": [
"anti_air",
"support"
],
"Mega Knight": [
"defense",
"splash",
"support",
"tank"
],
"Mega Knight Evolution": [
"defense",
"splash",
"support",
"tank"
],
"Mega Minion": [
"anti_air",
"support"
],
"Mega Minion Hero": [
"anti_air",
"support"
],
"Mighty Miner": [
"defense",
"support",
"tank"
],
"Miner": [
"support",
"win_condition"
],
"Mini P.E.K.K.A": [
"defense",
"support",
"tank"
],
"Mini P.E.K.K.A Hero": [
"defense",
"support",
"tank"
],
"Minion Horde": [
"anti_air",
"support"
],
"Minions": [
"anti_air",
"support"
],
"Mirror": [
"spell",
"support"
],
"Monk": [
"defense",
"support",
"tank"
],
"Mortar": [
"building",
"defense",
"win_condition"
],
"Mortar Evolution": [
"building",
"defense",
"win_condition"
],
"Mother Witch": [
"anti_air",
"support"
],
"Musketeer": [
"anti_air",
"support"
],
"Musketeer Evolution": [
"anti_air",
"support"
],
"Musketeer Hero": [
"anti_air",
"support"
],
"Night Witch": [
"support"
],
"P.E.K.K.A": [
"defense",
"support",
"tank"
],
"P.E.K.K.A Evolution": [
"defense",
"support",
"tank"
],
"Phoenix": [
"anti_air",
"support"
],
"Poison": [
"finisher",
"spell",
"splash"
],
"Prince": [
"support",
"tank"
],
"Princess": [
"splash",
"support"
],
"Rage": [
"spell",
"support"
],
"Ram Rider": [
"support",
"win_condition"
],
"Rascals": [
"anti_air",
"defense",
"support"
],
"Rocket": [
"finisher",
"spell"
],
"Royal Delivery": [
"defense",
"spell",
"splash"
],
"Royal Ghost": [
"splash",
"support",
"tank"
],
"Royal Ghost Evolution": [
"splash",
"support",
"tank"
],
"Royal Giant": [
"support",
"tank",
"win_condition"
],
"Royal Giant Evolution": [
"support",
"tank",
"win_condition"
],
"Royal Hogs": [
"support",
"win_condition"
],
"Royal Hogs Evolution": [
"support",
"win_condition"
],
"Royal Recruits": [
"defense",
"support"
],
"Royal Recruits Evolution": [
"defense",
"support"
],
"Skeleton Army": [
"defense",
"support"
],
"Skeleton Army Evolution": [
"defense",
"support"
],
"Skeleton Barrel": [
"support",
"win_condition"
],
"Skeleton Barrel Evolution": [
"support",
"win_condition"
],
"Skeleton Dragons": [
"anti_air",
"splash",
"support"
],
"Skeleton King": [
"support",
"tank"
],
"Skeletons": [
"cycle",
"defense",
"support"
],
"Skeletons Evolution": [
"cycle",
"defense",
"support"
],
"Sparky": [
"defense",
"support"
],
"Spear Goblins": [
"cycle",
"support"
],
"Spirit Empress": [
"support"
],
"Suspicious Bush": [
"support"
],
"Tesla": [
"anti_air",
"building",
"defense"
],
"Tesla Evolution": [
"anti_air",
"building",
"defense"
],
"The Log": [
"cycle",
"defense",
"spell"
],
"Three Musketeers": [
"anti_air",
"support",
"win_condition"
],
"Tombstone": [
"building",
"defense"
],
"Tornado": [
"control",
"defense",
"spell"
],
"Valkyrie": [
"defense",
"splash",
"support",
"tank"
],
"Valkyrie Evolution": [
"defense",
"splash",
"support",
"tank"
],
"Void": [
"finisher",
"spell"
],
"Wall Breakers": [
"cycle",
"support",
"win_condition"
],
"Wall Breakers Evolution": [
"cycle",
"support",
"win_condition"
],
"Witch": [
"splash",
"support"
],
"Witch Evolution": [
"splash",
"support"
],
"Wizard": [
"anti_air",
"splash",
"support"
],
"Wizard Evolution": [
"anti_air",
"splash",
"support"
],
"Wizard Hero": [
"anti_air",
"splash",
"support"
],
"X-Bow": [
"building",
"defense",
"win_condition"
],
"Zap": [
"cycle",
"spell"
],
"Zap Evolution": [
"cycle",
"spell"
],
"Zappies": [
"anti_air",
"defense",
"support"
]
}
}

View File

@@ -6,21 +6,21 @@ EPIC_CARDS = [
{ name: "Guards", elixir_cost: 3, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Dark Prince", elixir_cost: 4, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Hunter", elixir_cost: 4, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Baby Dragon", elixir_cost: 4, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Goblin Drill", elixir_cost: 4, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Prince", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Baby Dragon", elixir_cost: 4, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Goblin Drill", elixir_cost: 4, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Prince", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Balloon", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Witch", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Bowler", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Cannon Cart", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Bowler", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Cannon Cart", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Electro Dragon", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Giant Skeleton", elixir_cost: 6, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Goblin Giant", elixir_cost: 6, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "P.E.K.K.A", elixir_cost: 7, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Golem", elixir_cost: 8, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Golem", elixir_cost: 8, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Electro Giant", elixir_cost: 7, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Goblin Giantess", elixir_cost: 6, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Skeleton Army", elixir_cost: 3, rarity: "epic", type: "troop", is_meta: 1 },
{ name: "Skeleton Army", elixir_cost: 3, rarity: "epic", type: "troop", is_meta: 0 },
{ name: "Executioner", elixir_cost: 5, rarity: "epic", type: "troop", is_meta: 0 },
# Заклинания
@@ -28,12 +28,12 @@ EPIC_CARDS = [
{ name: "Rage", elixir_cost: 2, rarity: "epic", type: "spell", is_meta: 0 },
{ name: "Clone", elixir_cost: 3, rarity: "epic", type: "spell", is_meta: 0 },
{ name: "Freeze", elixir_cost: 4, rarity: "epic", type: "spell", is_meta: 1 },
{ name: "Poison", elixir_cost: 4, rarity: "epic", type: "spell", is_meta: 1 },
{ name: "Lightning", elixir_cost: 6, rarity: "epic", type: "spell", is_meta: 0 },
{ name: "Poison", elixir_cost: 4, rarity: "epic", type: "spell", is_meta: 0 },
{ name: "Lightning", elixir_cost: 6, rarity: "epic", type: "spell", is_meta: 1 },
{ name: "Void", elixir_cost: 3, rarity: "epic", type: "spell", is_meta: 0 },
{ name: "Goblin Barrel", elixir_cost: 3, rarity: "epic", type: "spell", is_meta: 1 },
{ name: "Goblin Barrel", elixir_cost: 3, rarity: "epic", type: "spell", is_meta: 0 },
{ name: "Tornado", elixir_cost: 3, rarity: "epic", type: "spell", is_meta: 1 },
# Здания
{ name: "X-Bow", elixir_cost: 6, rarity: "epic", type: "building", is_meta: 0 }
{ name: "X-Bow", elixir_cost: 6, rarity: "epic", type: "building", is_meta: 1 }
].freeze

View File

@@ -2,12 +2,12 @@
HERO_CARDS = [
{ name: "Goblins Hero", elixir_cost: 2, rarity: "hero", type: "troop", is_meta: 1 },
{ name: "Knight Hero", elixir_cost: 3, rarity: "hero", type: "troop", is_meta: 1 },
{ name: "Knight Hero", elixir_cost: 3, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Ice Golem Hero", elixir_cost: 2, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Mega Minion Hero", elixir_cost: 3, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Mini P.E.K.K.A Hero", elixir_cost: 4, rarity: "hero", type: "troop", is_meta: 1 },
{ name: "Musketeer Hero", elixir_cost: 4, rarity: "hero", type: "troop", is_meta: 1 },
{ name: "Giant Hero", elixir_cost: 5, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Mega Minion Hero", elixir_cost: 3, rarity: "hero", type: "troop", is_meta: 1 },
{ name: "Mini P.E.K.K.A Hero", elixir_cost: 4, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Musketeer Hero", elixir_cost: 4, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Giant Hero", elixir_cost: 5, rarity: "hero", type: "troop", is_meta: 1 },
{ name: "Wizard Hero", elixir_cost: 5, rarity: "hero", type: "troop", is_meta: 0 },
{ name: "Barbarian Barrel Hero", elixir_cost: 2, rarity: "hero", type: "spell", is_meta: 1 },
{ name: "Magic Archer Hero", elixir_cost: 4, rarity: "hero", type: "troop", is_meta: 1 }

View File

@@ -2,27 +2,27 @@
LEGENDARY_CARDS = [
# Юниты
{ name: "Miner", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Princess", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Miner", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Princess", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Ice Wizard", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Royal Ghost", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Royal Ghost", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Bandit", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Fisherman", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Fisherman", elixir_cost: 3, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Electro Wizard", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Inferno Dragon", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Inferno Dragon", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Phoenix", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Magic Archer", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Lumberjack", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Night Witch", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Mother Witch", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Magic Archer", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Lumberjack", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Night Witch", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Mother Witch", elixir_cost: 4, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Ram Rider", elixir_cost: 5, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Goblin Machine", elixir_cost: 5, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Sparky", elixir_cost: 6, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Spirit Empress", elixir_cost: 6, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Mega Knight", elixir_cost: 7, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Lava Hound", elixir_cost: 7, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Spirit Empress", elixir_cost: 6, rarity: "legendary", type: "troop", is_meta: 1 },
{ name: "Mega Knight", elixir_cost: 7, rarity: "legendary", type: "troop", is_meta: 0 },
{ name: "Lava Hound", elixir_cost: 7, rarity: "legendary", type: "troop", is_meta: 1 },
# Заклинания
{ name: "The Log", elixir_cost: 2, rarity: "legendary", type: "spell", is_meta: 1 },
{ name: "The Log", elixir_cost: 2, rarity: "legendary", type: "spell", is_meta: 0 },
{ name: "Graveyard", elixir_cost: 5, rarity: "legendary", type: "spell", is_meta: 1 }
].freeze

View File

@@ -2,6 +2,7 @@
module ClashDeckGenerator2
class Routes < Hanami::Routes
# Add your routes here. See https://guides.hanamirb.org/routing/overview/ for details.
root to: "home.index"
post "/decks/generate", to: "decks.generate"
end
end
end