BareGit
# Scoundrel Web

A web-based implementation of Scoundrel, a solo dungeon crawler card game played with a standard poker deck. This project is a single-page application (SPA) built with modern, lightweight web technologies.

## Game Rules

The goal is to traverse the entire dungeon (the deck) without your HP dropping to zero.

*   **Setup**: The deck (minus Red Face cards and Red Aces) represents the dungeon. You start with 20 HP.
*   **The Room**: You are presented with 4 cards. You must resolve (play) at least 3 of them to advance.
*   **Card Types**:
    *   **Monsters (Clubs ♣ and Spades ♠)**: Deal damage equal to their rank (2-10, J=11, Q=12, K=13, A=14).
    *   **Weapons (Diamonds ♦)**: Equip to fight monsters. Attack Power = Rank.
        *   *Durability*: You can only kill monsters *weaker* than the last monster you killed with the current weapon.
    *   **Potions (Hearts ♥)**: Heal HP equal to their rank. Max HP is 20. Only one potion per room.
*   **Fleeing**: You can run away from a room once per turn (shuffling the cards back into the deck), but you cannot flee twice in a row.

## How to Play

### Online
<https://mws.rocks/scoundrel/>

### Local Development
This is a static site with no build steps required.

1.  **Clone the repository:**
    ```bash
    git clone https://git.xeno.darksair.org/scoundrel-web.git
    cd scoundrel-web
    ```
2.  **Serve the files:**
    You can use any static file server. For example:
    *   **Python:** `python3 -m http.server`
    *   **Node:** `npx serve`
3.  **Open in Browser:** Navigate to `http://localhost:8000` (or whatever port your server uses).

## Tech Stack

*   **Core**: HTML5, CSS3, ES6+ JavaScript.
*   **Libraries**:
    *   [Preact](https://preactjs.com/): Fast, 3kB alternative to React.
    *   [HTM](https://github.com/developit/htm): Hyperscript Tagged Markup (JSX-like syntax in plain JS).
*   **Architecture**: No build tools (Webpack/Vite/Babel) required. Uses ES Modules directly in the browser.

## Themes and Customization

The game supports custom card themes!

*   **Classic (Text)**: Default Unicode rendering.
*   **Simple SVG**: A clean vector-based card set (included).

**Adding a New Theme:**

1.  Add your images to `assets/themes/YourThemeName/`.
2.  Ensure filenames are lower-case (e.g., `10h.png`, `kc.jpg`).
3.  Register the theme in `game.js`:
    ```javascript
    'YourThemeName': { label: 'My Theme', ext: 'png', path: 'assets/themes/YourThemeName' }
    ```

## Features

*   **Local Persistence**: Your game state (including theme) is saved automatically. Resume anytime!
*   **Undo System**: You can undo your last move.
*   **Mobile Friendly**: Responsive design for dungeon crawling on the go.

## License
[WTFPL](http://www.wtfpl.net/)