Skip to content

Commit

Permalink
v0.4.0 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuartero authored Nov 20, 2023
2 parents 87ad607 + c3644d8 commit 56ccdf5
Show file tree
Hide file tree
Showing 161 changed files with 1,716 additions and 1,578 deletions.
16 changes: 10 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added rule-book/build-icn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rule-book/move-icn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rule-book/recruit-icn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 42 additions & 53 deletions src/@types/storming.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type PlayerType =
| "enemy2" /* blue */
| "enemy3" /* green */;

type PlayerHandCardStatus = "available" | "selected" | "played";
type PlayerHandCardStatus = "selected" | "available" | "played";

/**
* ```ts
Expand All @@ -23,11 +23,11 @@ type PlayerHand = { card: Card; status: PlayerHandCardStatus }[];

declare type TileID = import("models/tiles")._TileID;

interface Coordinates {
type Coordinates = {
x: number;
y: number;
str: TileID;
}
};

type Board = Record<TileID, Tile>;

Expand Down Expand Up @@ -63,34 +63,37 @@ interface TileWithStatus extends Tile {
// CARDS
// --------------

type CardId = `${PlayerType}_${ActionCardType | EventCardType}_${number}`;

type ActionCardType = "build" | "diplo" | "move" | "recruit";

type Card = ActionCard | EventCard;

interface ActionCard {
type ActionCard = {
cardType: "actionCard";
action: ActionCardType;
owner: PlayerType;
cardId: string;
}
cardId: CardId;
};

type EventCardType = "even1" | "event2" | "event3";
type EventCardType = "event1" | "event2" | "event3";

interface EventCard {
type EventCard = {
cardType: "eventCard";
event: EventCardType;
playedBy: PlayerType;
cardId: string;
}
cardId: CardId;
};

// --------------
// TIMELINE
// --------------

type Timeline = {
current: Card | undefined;
next: Card[];
future: Card[];
type PhaseType = "setup" | "planification" | "action";

type TimelineCard = {
card: Card;
commited: boolean;
};

// --------------
Expand All @@ -111,59 +114,45 @@ interface GameLogContext {
// GameContext
// --------------

type PhaseType = "setup" | "planification" | "action";

interface BuildAction {
tile: TileID;
building: Building;
}

interface MoveAction {
from: TileID;
to: TileID;
piece: Piece;
}

interface RecruitAction {
tile: TileID;
piece: Piece;
}

interface PlanAction {
player: PlayerType;
nextCard: ActionCard;
futureCard: ActionCard;
eventCard?: EventCard; // TODO !MVP
}

interface PlayerStatus {
type PlayerStatus = {
player: PlayerType;
points: number;
greatestEmpirePoint: boolean;
}
greatestEmpirePoint: boolean; // deprecated
};

interface GameContext {
type GameContext = {
phase: PhaseType;
board: Board;
timeline: Timeline;
activeCard: Card | undefined;
activePlayer: PlayerType | undefined;
next: TimelineCard[];
future: TimelineCard[];
board: Board;
players: PlayerStatus[];

build(action: BuildAction): void;
move(action: MoveAction): void;
recruit(action: RecruitAction): void;
plan(action: PlanAction): void;
firstPlayer(player: PlayerType): void;
// planning phase
plan(action: {
nextActionCard?: ActionCard;
futureActionCard?: ActionCard;
eventCard?: EventCard; // TODO !MVP
}): void;
submitPlanification(): void;

// action phase
build(action: { tile: TileID; building: Building }): void;
move(action: { from: TileID; to: TileID; piece: Piece }): void;
recruit(action: { tile: TileID; piece: Piece }): void;
skip(): void;

loadSavegame(gameContext: GameContext): void
}
firstPlayer(player: PlayerType): void; // deprecated?

// other
loadSavegame(gameContext: GameContext): void;
};

// ----

type Savegame = {
createdAt: string; // ms from Epoch
playerEmpireSize: number;
gameContext: GameContext;
}
};
16 changes: 16 additions & 0 deletions src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@
.ignore-clicks {
pointer-events: none;
}

.player {
background-color: #fffaaf;
}

.enemy1 {
background-color: #ffafaf;
}

.enemy2 {
background-color: #afafff;
}

.enemy3 {
background-color: #afffaf;
}
6 changes: 2 additions & 4 deletions src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
PlayerHand,
TimeLine,
} from "components";
import { GameContextProvider } from "contexts";
import { GameContextProvider } from "game-context";
import { StrictMode } from "react";

import "./app.scss";

function App() {
export function App() {
return (
<StrictMode>
<main className="game">
Expand All @@ -27,5 +27,3 @@ function App() {
</StrictMode>
);
}

export default App;
Loading

0 comments on commit 56ccdf5

Please sign in to comment.