# FF-TCG Digital

A digital implementation of the Final Fantasy Trading Card Game (FF-TCG) for Linux, featuring an isometric 3D two-player tabletop view.

## Overview

This project aims to create a faithful digital recreation of the FF-TCG, allowing two players to play on the same machine with a visually appealing isometric 3D presentation.

## Features (Planned)

### MVP Features
- Local two-player gameplay on the same machine
- Isometric 3D game board with fixed camera angle
- Core game mechanics:
  - Turn phases (Active, Draw, Main 1, Attack, Main 2, End)
  - CP (Crystal Points) generation system
  - Character deployment (Forwards and Backups)
  - Summon casting
  - Combat system (attack, block, damage resolution)
  - Win condition tracking (7 damage)

### Future Features
- Keyword abilities (Haste, Brave, First Strike, Freeze, Back Attack)
- EX Burst system
- Limit Break / LB Deck mechanics
- Priming mechanic
- AI opponent
- Network multiplayer
- Deck builder
- Card collection management

## Requirements

- **Operating System**: Linux (Ubuntu 22.04+ recommended)
- **Engine**: Godot 4.2+
- **Display**: 1920x1080 minimum resolution recommended

## Installation

### Installing Godot 4.x

#### Option 1: Download from Official Website
1. Visit https://godotengine.org/download/linux/
2. Download the Godot 4.x standard version
3. Extract and run

#### Option 2: Using Flatpak
```bash
flatpak install flathub org.godotengine.Godot
```

#### Option 3: Using Snap
```bash
sudo snap install godot-4
```

### Running the Game

1. Clone the repository:
   ```bash
   git clone https://git.lazypugs.com/ckoch/FFCardGame.git
   cd FFCardGame
   ```

2. Open in Godot Editor:
   ```bash
   godot4 --editor project.godot
   ```

3. Run the game:
   - Press F5 in the Godot editor, or
   - Run from command line:
     ```bash
     godot4 --path . scenes/main/Main.tscn
     ```

## Project Structure

```
FFCardGame/
├── assets/
│   ├── cards/          # Card image textures
│   ├── ui/             # UI elements and icons
│   └── table/          # Table/playmat textures
├── data/
│   └── cards.json      # Card database
├── docs/
│   ├── DESIGN.md       # Architecture documentation
│   ├── CARD_FORMAT.md  # Card data specification
│   └── RULES.md        # Implemented game rules
├── scenes/
│   ├── main/           # Main game scene
│   ├── table/          # 3D table setup
│   ├── card/           # Card visual prefab
│   └── ui/             # UI scenes
├── scripts/
│   ├── autoload/       # Singleton scripts
│   ├── game/           # Core game logic
│   ├── visual/         # Visual/rendering scripts
│   └── ui/             # UI controller scripts
├── project.godot       # Godot project file
└── README.md           # This file
```

## Game Rules Reference

This implementation follows the official FF-TCG Comprehensive Rules v3.2.1. Key mechanics:

### Elements
- Fire, Ice, Wind, Lightning, Water, Earth, Light, Dark
- Light and Dark cards cannot be discarded for CP
- Maximum 1 Light OR Dark card on field at a time

### Card Types
- **Forward**: Attack and block, have Power values
- **Backup**: Generate CP when dulled, max 5 on field
- **Summon**: One-time effects, go to Break Zone after use

### Turn Structure
1. **Active Phase**: Activate all your dull characters
2. **Draw Phase**: Draw 2 cards (1 on first turn)
3. **Main Phase 1**: Play cards and use abilities
4. **Attack Phase**: Declare attacks and resolve combat
5. **Main Phase 2**: Play cards and use abilities
6. **End Phase**: Discard to hand limit (5), cleanup

### Win Condition
- Deal 7 points of damage to your opponent
- Each unblocked attack deals 1 damage

## Controls

| Action | Input |
|--------|-------|
| Select card/target | Left Click |
| Cancel/Details | Right Click / Escape |
| Pass priority | Spacebar |

## Development

### Building for Distribution

```bash
# Export for Linux
godot4 --headless --export-release "Linux/X11" build/fftcg-linux.x86_64
```

### Running Tests

```bash
# Run from project directory
godot4 --headless --script tests/run_tests.gd
```

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request

## License

This is a fan project for educational purposes. Final Fantasy and related content are trademarks of Square Enix.

## Acknowledgments

- Square Enix for the original Final Fantasy Trading Card Game
- The Godot Engine community
- FF-TCG community for rule clarifications
