Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Added 4 decks + more cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Tikidoodlep1 committed May 1, 2024
1 parent 220c013 commit 31bb680
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 21 deletions.
115 changes: 97 additions & 18 deletions src/engine/CardMap.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
LandscapeType
} from "../model.ts";
import { Card, Creature } from "./card.ts";
import { Card, Creature, Landscape } from "./card.ts";

var cardMap: Map<string, Card> = new Map<string, Card>();

Expand All @@ -27,10 +27,22 @@ export function get(name: string): Card {
}
}

class Deck {
name: string;
landscapes: Landscape[];
cards: Card[];

constructor(name: string, lands: Landscape[], cards: Card[]) {
this.name = name;
this.landscapes = lands;
this.cards = cards;
}
}

//WRITE CARDS BELOW

//=====================================================================================================================================================
// CREATURES
// SWAMP
//=====================================================================================================================================================

//Swamp Creatures
Expand Down Expand Up @@ -74,12 +86,12 @@ put(
);

put(
"Unicylops",
new Creature("Unicylops", "", 2, LandscapeType.Swamp, 7, 3,""),
"Unicyclops",
new Creature("Unicyclops", "", 2, LandscapeType.Swamp, 7, 3,""),
);
put(
"Man Witch",
new Creature("Man Witch", "", 2, LandscapeType.Swamp, 4, 4,""),
"Man-Witch",
new Creature("Man-Witch", "", 2, LandscapeType.Swamp, 4, 4,""),
);


Expand Down Expand Up @@ -163,9 +175,11 @@ put(
"Green Merman",new Creature("Green Merman","",1,LandscapeType.Swamp,0,10,"")
);

put("Bog Frog Bomb", new Creature("Bog Frog Bomb", "", 2, LandscapeType.Swamp, 16, 18, ""));


//CandyLand Creatures
//=====================================================================================================================================================
// CANDYLANDS
//=====================================================================================================================================================

put(
"Furious Hen",
Expand Down Expand Up @@ -200,13 +214,17 @@ put(
),
);

put("Dr. Stuffenstein", new Creature("Dr. Stuffenstein", "", 0, LandscapeType.Candylands, 0, 1, ""));

put("Furious Chick", new Creature("Furious Chick", "", 1, LandscapeType.Candylands, 7, 8, ""));

//=====================================================================================================================================================
// SANDYLANDS
// SANDYLANDS
//=====================================================================================================================================================

put(
"Beach Mum",
new Creature("Beach Mum", "", 2, LandscapeType.Desert, 9, 11,"")
"Beach Mummy",
new Creature("Beach Mummy", "", 2, LandscapeType.Desert, 9, 11,"")
);

put(
Expand Down Expand Up @@ -240,8 +258,8 @@ put(
);

put(
"Green Cactaball",
new Creature("Greem Cactaball", "", 1, LandscapeType.Desert, 4, 3,"")
"Green Cactiball",
new Creature("Green Cactiball", "", 1, LandscapeType.Desert, 4, 3,"")
);

put(
Expand Down Expand Up @@ -325,13 +343,13 @@ put(
);

put(
"Snadsnake",
"Sandsnake",
new Creature("Sandsnake", "", 2, LandscapeType.Desert, 12, 7,"")
);

put(
"Sandwitch",
new Creature("Sandwitch", "", 4, LandscapeType.Desert, 25, 10,"")
"SandWitch",
new Creature("SandWitch", "", 4, LandscapeType.Desert, 25, 10,"")
);

put(
Expand All @@ -349,14 +367,75 @@ put(
new Creature("Wall of Sand", "", 3, LandscapeType.Desert, 0, 26,"")
)

put("The Mariachi", new Creature("The Mariachi", "", 2, LandscapeType.Desert, 5, 20, ""));

put("Sandhorn Devil", new Creature("Sandhorn Devil", "", 1, LandscapeType.Desert, 18, 21, ""));

put("Peach Djinni", new Creature("Peach Djinni", "", 1, LandscapeType.Desert, 2, 8, ""));

//=====================================================================================================================================================
// BUILDINGS
//=====================================================================================================================================================

//=====================================================================================================================================================
// SPELLS
// LANDSCAPES
//=====================================================================================================================================================
var Cornfield: Landscape = new Landscape("Cornfields", "Corny Joke Here!", LandscapeType.Cornfields);
var Hills: Landscape = new Landscape("Hills", "", LandscapeType.Hills);
var Swampland: Landscape = new Landscape("Swamplands", "Goopy!", LandscapeType.Swamp);
var Candyland: Landscape = new Landscape("Candylands", "Sweet!", LandscapeType.Candylands);
var Icyland: Landscape = new Landscape("Icylands", "Cold!", LandscapeType.Icelands);
var Sandyland: Landscape = new Landscape("Sandylands", "", LandscapeType.Desert);

//=====================================================================================================================================================
// LANDSCAPES
// DECKS
//=====================================================================================================================================================
var CornfieldDeck = new Deck("Cornfield Deck", [Cornfield, Cornfield, Cornfield, Cornfield], [get("Husker Worm"), get("Cornataur"), get("Legion of Earlings"),
get("Field Stalker"), get("Patchy the Pumpkin"), get("Corn Ronin"), get("Wall of Ears"), get("Travelin' Farmer"), get("Husker Knight"), get("Archer Dan"), get("Corn Dog"),
get("Corn Lord"), get("Field Reaper"), get("Phyllis"), get("Evil Eye"), get("Big Foot"), get("Husker Worm"), get("Corntaur"), get("Legion of Earlings"),
get("Field Stalker")]);

var HillsDeck = new Deck("Hills Deck", [Hills, Hills, Hills, Hills], [get("Punk Cat"), get("Cool Dog"), get("Embarrassing Bard"), get("Ancient Scholar"), get("Dragon Claw"),
get("Woadic Chief"), get("Struzann Jinn"), get("Psionic Architect"), get("X-Large Spirit Soldier"), get("Heavenly Gazer"), get("Uni-Knight"),
get("Woadic Marauder"), get("The Pig"), get("Punk Cat"), get("Cool Dog"), get("Ancient Scholar"), get("Dragon Claw"), get("Struzann Jinn"),
get("Psionic Architect"), get("X-Large Spirit Soldier")]);

var SwamplandsDeck = new Deck("Swmaplands Deck", [Swampland, Swampland, Candyland, Candyland], [get("Bog Ban-She Angel"), get("Ban-She Princess"), get("Fly Swatter"),
get("Bog Bum"), get("Unicyclops"), get("Man-Witch"), get("Ban-She Queen"), get("Bog Frog Bomb"), get("Furious Rooster"), get("Music Mallard"), get("Cottonpult"),
get("Dr. Stuffenstein"), get("Furious Hen"), get("Papercut Tiger"), get("Furious Chick"), get("Ban-She Princess"), get("Fly Swatter"), get("Bog Bum"),
get("Unicyclops"), get("Man-Witch")]);

var IcelandsDeck = new Deck("Icylands Deck", [Icyland, Icyland, Icyland, Icyland], [get("Cold Soldier"), get("Abdominal Snowman"), get("Icemeister"), get("Sprucy Lucy"),
get("Reign Deer"), get("Frost Dragon"), get("Slay Rider"), get("Frozen Fish"), get("Snow Angel"), get("Emperor Penguin"), get("Snow Bunny"), get("Snow Dog"),
get("Boarder Collie"), get("Cold Soldier"), get("Adbominal Snowman"), get("Icemeister"), get("Reign Deer"), get("Frost Dragon"), get("Slay Rider"),
get("Frozen Fish")])

var SandylandsDeck = new Deck("Sandyland Deck", [Sandyland, Sandyland, Sandyland, Sandyland], [get("Sandsnake"), get("Beach Mummy"), get("The Mariachi"), get("SandWitch"),
get("Sand Eyebat"), get("Green Cactiball"), get("Sandhorn Devil"), get("Wall of Sand"), get("Lost Golem"), get("Sand Knight"), get("Fummy"), get("Sand Angel"),
get("Peach Djinni"), get("Ms. Mummy"), get("Sandsnake"), get("Beach Mummy"), get("The Mariachi"), get("SandWitch"), get("Sand Eyebat"), get("Green Cactiball")]);

//[get(""), get(""), get(""), get(""), get(""), get(""), get(""), get(""), get(""), get(""), get(""),
//get(""), get(""), get(""), get(""), get(""), get(""), get(""), get(""), get("")]

export function seeNonNullDecks() {
var decks = [CornfieldDeck, HillsDeck, SwamplandsDeck, IcelandsDeck, SandylandsDeck];
runner: for(var i = 0; i < decks.length; i++) {
console.log("=====================================================================================");
console.log(" CHECKING " + decks[i].name);
console.log("=====================================================================================")
for(var j = 0; j < decks[i].cards.length; j++) {
console.log("Checking Card " + decks[i].cards[j].name);
if(decks[i].cards[j].equals(Creature.getNull())) {
decks.splice(i, 1);
i--;
continue runner;
}
}
}

console.log();
console.log("=====================================NON-NULL DECKS=====================================");
for(var i = 0; i < decks.length; i++) {
console.log(decks[i].name + " is Non-Null");
}
}
2 changes: 1 addition & 1 deletion src/engine/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class Card {
}

equals(other: Card): boolean {
return this.name == other.name && this.flavorText == other.flavorText && this.cardType == other.cardType && this.cost == other.cost
return this.name == other.name && this.flavorText == other.flavorText && this.cost == other.cost
&& this.landscapeType == other.landscapeType;
}

Expand Down
8 changes: 6 additions & 2 deletions src/model.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect, test, assert } from "vitest";
import { Game, AbstractGame, LandscapeType, BoardPos, CardType, Player } from "./model.ts";
import { Card, Creature, Landscape, GetCardTargetEvent } from "./engine/card.ts";
import { get as getCardFromCardMap } from "./engine/CardMap.ts";
import { GetBoardPosTargetEvent, PlayCardEventName, PlayCardEvent } from "./engine/event.ts";
import { get as getCardFromCardMap, seeNonNullDecks } from "./engine/CardMap.ts";
import { GetBoardPosTargetEvent, PlayCardEventName } from "./engine/event.ts";

test("new game works", () => {
assert(Game.getInstance() instanceof AbstractGame);
Expand Down Expand Up @@ -164,4 +164,8 @@ test("Game is Playable", () => {

Game.getInstance().enterNextPhase();
}
});

test("All Decks are NonNull", () => {
seeNonNullDecks();
});
2 changes: 2 additions & 0 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const LandscapeType = {
Desert: "#b3b179",
Hills: "#468546",
Candylands: "#d192cc",
Cornfields: "#e8b348",
Icelands: "#69a4cf"
};

export const CardType = {
Expand Down

0 comments on commit 31bb680

Please sign in to comment.