# marcus0104/vampiro-jogo architecture

> Architecture diagram of the GitHub repository marcus0104/vampiro-jogo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/marcus0104/vampiro-jogo
- Repository: https://github.com/marcus0104/vampiro-jogo

## Overview

Vampiro-Jogo is a PHP terminal RPG. The player names a vampire, fights four sequential phases using turn-based actions, and wins by defeating the King or loses if the vampire dies; victories before the King trigger leveling. The graph separates the game loop, player progression, enemy behaviors, and shared combat model. Edges reflect calls visible in excerpts or the README; unsampled interface and enemy implementation details are not expanded.

Main entry points: [`execucao.php`](https://github.com/marcus0104/vampiro-jogo/blob/main/execucao.php) (Game Loop), [`modelo/Personagem.php`](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Personagem.php) (Character Combat), [`modelo/Magico.php`](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Magico.php) (Magic Base), [`modelo/Clerigo.php`](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Clerigo.php) (Cleric Support)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game Flow"]
  node_loop["Game Loop<br/>[execucao.php]"]
  node_progress["Phase Progression<br/>[execucao.php]"]
end

subgraph group_player["Player Character"]
  node_vampire["Vampire Abilities<br/>[Vampiro.php]"]
end

subgraph group_enemies["Enemy Roster"]
  node_templar["Templar<br/>[Templario.php]"]
  node_cleric["Cleric Support<br/>[Clerigo.php]"]
  node_wizard["Attack Mage<br/>[MagoAtk.php]"]
  node_demon["Demon<br/>[Demonio.php]"]
  node_king["King<br/>[Rei.php]"]
end

subgraph group_combat["Combat Model"]
  node_magical["Magic Base<br/>[Magico.php]"]
  node_character["Character Combat<br/>[Personagem.php]"]
  node_weapon["Weapons<br/>[Arma.php]"]
  node_interface["Character Interface<br/>[IPersonagem.php]"]
end

node_player_actor(("Player"))

node_player_actor -->|"enters"| node_loop
node_loop -->|"creates and calls"| node_vampire
node_loop -->|"creates and dispatches"| node_templar
node_loop -->|"creates and dispatches"| node_cleric
node_loop -->|"creates and dispatches"| node_wizard
node_loop -->|"creates and dispatches"| node_demon
node_loop -->|"creates and dispatches"| node_king
node_loop -->|"runs phases"| node_progress
node_progress -->|"levels after wins"| node_vampire
node_vampire -->|"extends"| node_magical
node_magical -->|"extends"| node_character
node_character -->|"uses damage and name"| node_weapon
node_character -->|"implements"| node_interface
node_templar -->|"extends"| node_character
node_cleric -->|"extends"| node_magical
node_cleric -->|"heals and buffs allies"| node_templar
node_wizard -->|"extends"| node_magical
node_demon -->|"extends"| node_magical
node_king -->|"extends"| node_character

click node_loop "https://github.com/marcus0104/vampiro-jogo/blob/main/execucao.php"
click node_progress "https://github.com/marcus0104/vampiro-jogo/blob/main/execucao.php"
click node_vampire "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Vampiro.php"
click node_magical "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Magico.php"
click node_character "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Personagem.php"
click node_weapon "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Arma.php"
click node_interface "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/IPersonagem.php"
click node_templar "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Templario.php"
click node_cleric "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Clerigo.php"
click node_wizard "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/MagoAtk.php"
click node_demon "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Demonio.php"
click node_king "https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Rei.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_loop,node_progress toneBlue
class node_vampire toneAmber
class node_templar,node_cleric,node_wizard,node_demon,node_king toneMint
class node_magical,node_character,node_weapon,node_interface toneRose
class node_player_actor toneIndigo
```

## Components

### Game Flow

- [Game Loop](https://github.com/marcus0104/vampiro-jogo/blob/main/execucao.php): `execucao.php`
- [Phase Progression](https://github.com/marcus0104/vampiro-jogo/blob/main/execucao.php): `execucao.php`

### Player Character

- [Vampire Abilities](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Vampiro.php): `modelo/Vampiro.php`

### Enemy Roster

- [Templar](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Templario.php): `modelo/Templario.php`
- [Cleric Support](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Clerigo.php): `modelo/Clerigo.php`
- [Attack Mage](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/MagoAtk.php): `modelo/MagoAtk.php`
- [Demon](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Demonio.php): `modelo/Demonio.php`
- [King](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Rei.php): `modelo/Rei.php`

### Combat Model

- [Magic Base](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Magico.php): `modelo/Magico.php`
- [Character Combat](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Personagem.php): `modelo/Personagem.php`
- [Weapons](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/Arma.php): `modelo/Arma.php`
- [Character Interface](https://github.com/marcus0104/vampiro-jogo/blob/main/modelo/IPersonagem.php): `modelo/IPersonagem.php`

### Other components

- **Player**

## Connections

- Player → Game Loop: enters (evidence: `README.md`)
- Game Loop → Vampire Abilities: creates and calls (evidence: `execucao.php`)
- Game Loop → Templar: creates and dispatches (evidence: `execucao.php`)
- Game Loop → Cleric Support: creates and dispatches (evidence: `execucao.php`)
- Game Loop → Attack Mage: creates and dispatches (evidence: `execucao.php`)
- Game Loop → Demon: creates and dispatches (evidence: `execucao.php`)
- Game Loop → King: creates and dispatches (evidence: `execucao.php`)
- Game Loop → Phase Progression: runs phases (evidence: `execucao.php`)
- Phase Progression → Vampire Abilities: levels after wins (evidence: `execucao.php`)
- Vampire Abilities → Magic Base: extends (evidence: `modelo/Vampiro.php`)
- Magic Base → Character Combat: extends (evidence: `modelo/Magico.php`)
- Character Combat → Weapons: uses damage and name (evidence: `modelo/Personagem.php`)
- Character Combat → Character Interface: implements (evidence: `modelo/Personagem.php`)
- Templar → Character Combat: extends (evidence: `modelo/Templario.php`)
- Cleric Support → Magic Base: extends (evidence: `modelo/Clerigo.php`)
- Cleric Support → Templar: heals and buffs allies (evidence: `modelo/Clerigo.php`)
- Attack Mage → Magic Base: extends (evidence: `modelo/MagoAtk.php`)
- Demon → Magic Base: extends (evidence: `modelo/Demonio.php`)
- King → Character Combat: extends (evidence: `modelo/Rei.php`)
