adding missing files

This commit is contained in:
2025-11-03 21:43:13 -06:00
parent efdf3570c5
commit 0443d1553f
36 changed files with 1765 additions and 0 deletions

198
docs/Battle Mechanics.MD Normal file
View File

@@ -0,0 +1,198 @@
# ⚔️ Code of Conquest — Game Mechanics Guide
Welcome to the **Code of Conquest Battle System** — a turn-based, JRPG-inspired combat framework that blends strategy, morality, and fate.
Every action, from sword swings to spellcasting, is influenced by your attributes, alignment, and a touch of luck.
---
## 🧩 Core Attributes
Each hero or enemy has six base attributes that define their natural strengths and weaknesses.
| Attribute | Description |
|------------|--------------|
| **Strength (STR)** | Governs physical power, melee attacks, and endurance. |
| **Dexterity (DEX)** | Controls accuracy, evasion, and proficiency with ranged weapons. |
| **Intelligence (INT)** | Determines magic power and spell accuracy. |
| **Wisdom (WIS)** | Governs magical defense, perception, and resistance to debuffs. |
| **Luck (LCK)** | Influences critical hits, evasion, loot, and unexpected fortune. |
| **Charisma (CHA)** | Affects leadership, morale, and social interactions. |
---
## ⚙️ Derived Combat Stats
These values are automatically calculated from your core attributes, level, and equipment.
| Stat | Formula | Description |
|------|----------|-------------|
| **Attack (ATK)** | `(STR × 2) + WeaponBonus` | Physical damage output. |
| **Magic Power (MAG)** | `(INT × 2) + StaffBonus` | Magical damage output. |
| **Defense (DEF)** | `(STR × 0.5) + ArmorBonus` | Reduces incoming physical damage. |
| **Magic Defense (MDEF)** | `(WIS × 0.5) + GearBonus` | Reduces incoming magical damage. |
| **Accuracy (ACC)** | `(DEX × 2) + (LCK × 0.25)` | Likelihood of hitting your target. |
| **Evasion (EVA)** | `(DEX × 1.5) + (LCK × 0.25)` | Likelihood of dodging attacks. |
| **Critical Chance (CRIT%)** | `(LCK × 0.5)%` | Chance to land a critical hit. |
| **Resistance (RES)** | `(WIS × 2) + (LCK × 0.5)` | Chance to resist magical or status effects. |
---
## ⚔️ Combat Overview
Combat is **turn-based** and **formula-driven**.
Every action follows a consistent, deterministic flow — modified by attributes, skills, and luck.
### Step 1 — Accuracy Check
Before any attack lands, its success is determined by comparing **Accuracy** and **Evasion**.
- **Physical attacks**
```
HitChance = ACC / (ACC + Target.EVA)
```
- **Magical attacks**
```
SpellHitChance = (INT + LCK) / ((INT + LCK) + (Target.WIS + Target.LCK))
```
If the resulting value ≥ a random roll (01), the attack hits.
---
### Step 2 — Damage Calculation
Once a hit lands, the system determines how much damage is dealt.
#### Physical Damage
```
BaseDamage = (ATK - (Target.DEF × 0.5))
Variance = random(0.9, 1.1)
CritModifier = 1.5 if roll ≤ CRIT% else 1.0
Damage = BaseDamage × Variance × CritModifier
```
#### Magical Damage
```
BaseDamage = (MAG - (Target.MDEF × 0.5))
Variance = random(0.9, 1.1)
Damage = BaseDamage × Variance
```
---
## 💫 Alignment Influence
Every character and creature has an **Alignment Score** from **100 (Evil)** to **+100 (Good)**.
The difference between two combatants alignments affects damage output.
```
AlignmentDifference = abs(Attacker.Alignment - Target.Alignment)
AlignmentBonus = (AlignmentDifference / 10) / 100
```
**Example:**
A Paladin (+80) attacks a Necromancer (70).
Difference = 150 → +15% damage.
```
Damage = Damage × (1 + AlignmentBonus)
```
The greater the moral divide, the stronger the opposing strike.
---
## 🍀 Luck in Action
**Luck (LCK)** weaves subtle influence through nearly every mechanic:
| Mechanic | Luck Effect |
|-----------|--------------|
| Hit Accuracy | Boosts ACC slightly. |
| Critical Hits | Directly increases CRIT%. |
| Damage Rolls | Pushes random variance toward higher values. |
| Loot & Rewards | Increases rare drop chances. |
| Status Resistance | Adds to RES for debuff avoidance. |
| Escape & Initiative | Slightly improves odds in initiative rolls. |
Even a low-power adventurer with high luck can turn the tides of battle.
---
## 📈 Level Scaling
As characters grow in level, their core attributes increase according to **class-based growth curves**.
| Class | STR | DEX | INT | WIS | LCK | CHA |
|--------|------|------|------|------|------|------|
| Guardian | High | Low | Low | Medium | Low | Medium |
| Ranger | Medium | High | Low | Low | Medium | Medium |
| Arcanist | Low | Medium | High | Medium | Medium | Low |
| Cleric | Low | Low | Medium | High | Medium | High |
Level growth, combined with equipment bonuses and skills, naturally scales all derived stats.
---
## 🧠 Skill Modifiers
Every ability or spell uses the base formulas but applies **unique multipliers** or special effects.
| Skill | Type | Effects |
|--------|------|----------|
| **Power Slash** | Melee | Damage × 1.5, Accuracy × 0.9 |
| **Piercing Shot** | Ranged | Ignores 25% of target DEF |
| **Fireball** | Magic | Damage × 1.2, chance to Burn (INT + LCK based) |
| **Bless** | Support | Boosts ally ATK × 1.1 for 3 turns |
| **Hex** | Curse | Reduces enemy WIS × 0.8 for 2 turns |
Skills can be enhanced, learned, or combined as your characters progress.
---
## 🧮 Example Combat Resolution
**Scenario:**
A Level 10 Guardian with high STR attacks an evil creature using *Power Slash.*
```
HitChance = ACC / (ACC + Target.EVA)
If hit:
Damage = ((ATK - (Target.DEF × 0.5)) × 1.5)
Damage *= random(0.9, 1.1)
Damage *= (1 + AlignmentBonus)
Damage *= CritModifier
```
**Result:**
The system reports a hit, critical strike, or miss — then narrates the event through the AI Dungeon Master.
---
## 🔮 Design Philosophy
The **Code of Conquest Battle System** emphasizes:
- Predictable, understandable outcomes driven by player stats.
- Minimal dice-roll chaos — randomness exists, but never dominates.
- Moral alignment and luck as storytelling mechanics, not just numbers.
- Clear extensibility for future features like elemental affinities, buffs, and combo attacks.
Every fight is both a **test of numbers** and a **reflection of who your character truly is**.
---
*Last updated:* October 2025
*System version:* 1.0 — “Balance of Fate”

206
docs/Battle-Dev-Notes.MD Normal file
View File

@@ -0,0 +1,206 @@
## 🧰 Developer Notes — System Architecture & Implementation
This section explains how the **Code of Conquest Battle System** is structured behind the scenes for developers and modders.
---
### 🧮 1. Formula Layers
Combat calculations occur in **three distinct layers**, each responsible for a specific part of the logic:
| Layer | Purpose | Example |
|--------|----------|----------|
| **Base Layer** | Core attributes and level-based growth. | STR, DEX, INT, etc. |
| **Derived Layer** | Recalculates combat-ready stats from base values and equipment. | ATK, DEF, ACC, etc. |
| **Resolution Layer** | Executes battle outcomes using deterministic formulas. | Damage, Crit, AlignmentBonus, etc. |
Each layer feeds cleanly into the next.
This modular approach ensures stats can be recalculated at any time without breaking the combat state.
---
### ⚙️ 2. Suggested Class Structure
The system can be built around **data-driven classes**:
```python
class Character:
name: str
level: int
alignment: int
attributes: Attributes # STR, DEX, INT, etc.
equipment: Equipment
derived_stats: DerivedStats
class Attributes:
str: int
dex: int
int: int
wis: int
lck: int
cha: int
class DerivedStats:
atk: int
mag: int
def_: int
mdef: int
acc: float
eva: float
crit: float
res: float
````
All formulas (like ATK = STR × 2 + WeaponBonus) live inside the `DerivedStats.recalculate()` method.
Skills and combat outcomes can then safely reference `character.derived_stats`.
---
### 📜 3. Skill Definitions
Skills should be stored as **external data files** (YAML or JSON) for easy modification and expansion.
Example:
```yaml
# skills/power_slash.yaml
id: power_slash
name: Power Slash
type: melee
description: A strong physical strike with reduced accuracy.
modifiers:
damage_multiplier: 1.5
accuracy_multiplier: 0.9
crit_bonus: 0.0
conditions:
requires_weapon_type: sword
```
When combat is resolved, the system loads the skill data dynamically:
```python
damage *= skill.damage_multiplier
accuracy *= skill.accuracy_multiplier
```
This keeps gameplay logic **data-driven** and **easily expandable**.
---
### 🧠 4. Combat Resolution Flow
A full attack resolves in five modular steps:
1. **Precheck Phase** — confirm turn order, skill requirements, status effects.
2. **Accuracy Phase** — roll for hit using `ACC` vs target `EVA`.
3. **Damage Phase** — calculate raw damage using formulas.
4. **Modifier Phase** — apply critical hits, alignment bonus, buffs/debuffs.
5. **Finalize Phase** — subtract HP, trigger effects, narrate outcome.
Each step can be represented by its own method or even subclass (useful for custom battle systems later).
---
### ⚖️ 5. Alignment & Morality Hooks
Alignment is stored as a simple integer between 100 and +100.
When calculating damage:
```python
alignment_difference = abs(attacker.alignment - target.alignment)
alignment_bonus = (alignment_difference / 10) / 100
damage *= 1 + alignment_bonus
```
Later expansions might include:
* **Morality events** that shift alignment based on choices.
* **Faction modifiers** (e.g., “Paladin vs Undead” adds extra scaling).
* **Spells** that interact directly with alignment (“Smite Evil,” “Corrupt Heart”).
---
### 🍀 6. Luck Integration Strategy
Luck is treated as a *global adjustment factor* that nudges probability outcomes and variance rolls upward slightly.
Instead of directly changing RNG, it *biases* existing rolls.
```python
def apply_luck_bias(base_value: float, luck: int) -> float:
bias = 1 + (luck * 0.002) # +0.2% per point of Luck
return base_value * bias
```
This keeps outcomes unpredictable yet fair — luckier characters simply lean toward better odds over time.
---
### 📈 7. Level Scaling Curves
Scaling should be **class-specific** and controlled via external tables:
```yaml
# growth_curves/guardian.yaml
str_growth: high
dex_growth: low
int_growth: low
wis_growth: medium
lck_growth: low
cha_growth: medium
```
When leveling up:
```python
new_value = old_value + growth_table.get(attribute).calculate(level)
```
You can easily balance or tweak these tables without touching core logic.
---
### 🧩 8. Extensibility Hooks
Future systems can layer naturally on top of this design:
* **Elemental Affinities:** Fire, Ice, Lightning resistances.
* **Buff & Debuff States:** stored as timed modifiers.
* **Equipment Enchantments:** simple additive multipliers.
* **Status Effects:** stored as objects (e.g., `Status("Burning", duration=3, dot=5)`).
Each additional system only needs to plug into the Resolution Phase as a pre/post modifier.
---
### 🧱 9. Design Philosophy for Developers
1. **Transparency over randomness** — deterministic math first, variance second.
2. **Data before code** — YAML or JSON defines skills, growth, and buffs.
3. **Layered structure** — base → derived → resolution → output.
4. **Alignment matters** — every moral choice has mechanical consequence.
5. **Luck is universal** — a soft bias across all rolls, never a chaos driver.
6. **Readable outputs** — easy for AI or human narrators to describe battle results.
---
### 🧾 10. Future Expansion Notes
* **Elemental Damage Types** (`fire`, `ice`, `holy`, `dark`).
* **Combo Systems** (chain attacks between party members).
* **Morale System** (CHA and WIS affecting group performance).
* **Dynamic Battle Narration** (AI-driven storytelling from combat logs).
* **Procedural Skill Fusion** (merge abilities to create new ones).
---
> **Implementation Tip:**
> Keep every formula centralized in a single `Formulas` or `BattleMath` class.
> This ensures balancing changes never require refactoring gameplay code.
---
*Developer Reference Version:* 1.0
*Author:* Code of Conquest Systems Design Team
*Document Last Updated:* October 2025

292
docs/hero_classes.md Normal file
View File

@@ -0,0 +1,292 @@
Perfect — these class archetypes are strong foundations.
Below is a **fully fleshed-out design document** that expands each of your 10 hero classes with:
1. A **generalized backstory** (broad enough for players to personalize).
2. Two **skill trees** per class (with flavor and functional intent).
3. For **spellcasting classes**, a **spell tree** by level (tiers of progression).
All designed to feel consistent across your Strength, Dexterity, Intelligence, Wisdom, and Charisma archetypes.
---
# 🛡️ Strength-Based Characters
## **GUARDIAN**
**Alignment:** Good
**Description:**
Guardians are stalwart defenders of light and justice. Whether serving as city protectors, temple champions, or wandering peacekeepers, their code of honor binds them to defend the weak. Each Guardians story is their own—a farmer turned hero, a knight fallen from grace, or a soldier seeking redemption.
**Skill Trees:**
* **Bulwark Tree (Defense Focus)**
* *Iron Will* Reduces damage taken.
* *Deflect* Chance to block ranged or magic attacks.
* *Last Stand* Gain armor and regen HP when below 25%.
* *Fortress* Party-wide defense aura.
* **Valor Tree (Offense Focus)**
* *Precision Strike* Bonus damage with melee weapons.
* *Riposte* Counter-attack when blocking.
* *Holy Challenge* Taunts enemies, increasing their aggression toward you.
* *Guardians Oath* Boosts allies morale (buff to nearby allies).
---
## **BLOODBORN**
**Alignment:** Evil
**Description:**
Bloodborn are forged in the crucible of agony. They believe power is born from suffering, and that mercy weakens the spirit. Some were enslaved warriors, others mad experiment victims—now unleashed vengeance given form.
**Skill Trees:**
* **Crimson Path (Offense Focus)**
* *Rend Flesh* Bleed enemies for lasting damage.
* *Frenzy* Gain attack speed as HP lowers.
* *Bloodlust* Restore HP per kill.
* *Executioners Rite* Huge critical hit chance when target <30% HP.
* **Tortured Flesh (Endurance Focus)**
* *Pain Tolerance* Reduces incoming damage when bleeding.
* *Sanguine Shield* Converts damage taken into temporary HP.
* *Undying Rage* Survive fatal blow with 1 HP once per combat.
* *Blood Feast* Heal massively after killing an enemy.
---
# 🏹 Dexterity-Based Characters
## **RANGER**
**Alignment:** Good or Neutral
**Description:**
Rangers are masters of the wilderness—trackers, scouts, and hunters. They thrive in solitude, guided by the rhythm of nature. Some defend forests from civilizations encroachment; others serve as elite archers for noble causes.
**Skill Trees:**
* **Beastmaster Tree (Companion Focus)**
* *Call of the Wild* Summon a loyal beast.
* *Pack Instinct* Boosts pet attack and defense.
* *Shared Survival* Heal your pet when you heal yourself.
* *Alpha Bond* Merge senses with your pet for heightened awareness.
* **Sharpshooter Tree (Marksmanship Focus)**
* *Quickdraw* Increased attack speed with bows.
* *Piercing Arrow* Arrows ignore partial armor.
* *Rain of Arrows* Multi-shot area attack.
* *Eagle Eye* Doubles critical hit chance when undetected.
---
## **ASSASSIN**
**Alignment:** Evil
**Description:**
Born from the underbelly of cities or raised by shadowy guilds, Assassins live for precision and silence. Every kill is an art form, and every targets final breath is their masterpiece.
**Skill Trees:**
* **Shadow Arts Tree (Stealth Focus)**
* *Fade Step* Become briefly invisible.
* *Backstab* Massive critical from stealth.
* *Smoke Veil* Escape combat, dropping enemy aggro.
* *Phantom Edge* Shadow clone attacks alongside you.
* **Venomcraft Tree (Poison Focus)**
* *Toxin Coating* Coat blades with poison.
* *Virulent Strike* Poisons spread between enemies.
* *Deaths Kiss* Bonus damage to poisoned foes.
* *Noxious Cloud* Area poison that slows and weakens.
---
# 📚 Intelligence-Based Characters
## **ARCANIST**
**Alignment:** Good or Neutral
**Description:**
Arcanists are scholars of the arcane, shaping elemental forces through study and sheer intellect. Each Arcanists past is different—some taught in grand academies, others self-taught hermits obsessed with understanding creation.
**Skill Trees:**
* **Elementalist Tree (Damage Focus)**
* *Fireball* AoE fire attack.
* *Frost Lance* Slows targets.
* *Thunderstrike* Chance to stun.
* *Elemental Mastery* Boosts all elemental damage.
* **Chronomancer Tree (Utility Focus)**
* *Haste* Increase speed.
* *Time Warp* Rewind health and position briefly.
* *Mana Surge* Restore MP faster.
* *Temporal Collapse* Massive AoE time distortion (endgame).
**Spell Tree by Level:**
* **Novice (Lv 15)** Spark, Frost Bite, Ember Bolt
* **Adept (Lv 610)** Fireball, Ice Shard, Lightning Arc
* **Expert (Lv 1115)** Chain Lightning, Cone of Cold, Meteor Fall
* **Master (Lv 16+)** Elemental Storm, Time Stop, Arcane Nova
---
## **HEXIST**
**Alignment:** Evil
**Description:**
Hexists wield forbidden knowledge—grimoires of curses and decay. They manipulate life energy to cripple foes and empower themselves, believing pain and entropy are the universes true constants.
**Skill Trees:**
* **Malefic Arts Tree (Curse Focus)**
* *Wither* Reduces targets defense.
* *Hex of Misery* Deals damage over time and reduces healing.
* *Soul Rot* Spreads curses between enemies.
* *Dark Empowerment* Boosts damage per active curse.
* **Necrotic Path Tree (Summoning Focus)**
* *Raise Dead* Summon weak undead.
* *Soul Leech* Regain HP when minions attack.
* *Grave Tide* Summon undead horde temporarily.
* *Lich Form* Become undead temporarily for massive boosts.
**Spell Tree by Level:**
* **Novice (Lv 15)** Rot Touch, Curse of Weakness
* **Adept (Lv 610)** Wither, Soul Leech
* **Expert (Lv 1115)** Bone Spear, Plague Cloud
* **Master (Lv 16+)** Death Coil, Summon Lich, Unholy Blight
---
# ✨ Wisdom-Based Characters
## **CLERIC**
**Alignment:** Good
**Description:**
Clerics channel divine power through prayer and unwavering faith. Whether from temples, shrines, or hidden monasteries, their power comes from devotion to benevolent deities and their eternal struggle against darkness.
**Skill Trees:**
* **Sanctity Tree (Healing & Support)**
* *Healing Light* Restore HP to ally.
* *Cleanse* Remove curses/debuffs.
* *Guardian Angel* Revive ally with portion of HP.
* *Divine Radiance* Heal over time aura.
* **Retribution Tree (Battle Cleric)**
* *Smite* Holy damage attack.
* *Holy Ward* Boost defense for allies.
* *Blessed Weapon* Adds radiant damage to melee attacks.
* *Judgment* Massive single-target divine strike.
**Spell Tree by Level:**
* **Novice (Lv 15)** Light Heal, Smite, Bless
* **Adept (Lv 610)** Greater Heal, Holy Fire, Purify
* **Expert (Lv 1115)** Sanctuary, Revive, Divine Shield
* **Master (Lv 16+)** Resurrection, Wrath of the Heavens
---
## **WARLOCK**
**Alignment:** Evil
**Description:**
Warlocks forge pacts with dark entities to channel forbidden power. Each contract comes with a price—often their soul or sanity—but grants terrifying might that rivals even the gods.
**Skill Trees:**
* **Pact Magic Tree (Damage Focus)**
* *Eldritch Blast* Signature ranged spell.
* *Corrupting Ray* Reduces targets resistances.
* *Soul Drain* Steal HP and MP.
* *Abyssal Eruption* Large AoE shadow explosion.
* **Infernal Pact Tree (Summoning Focus)**
* *Summon Imp* Small demon ally.
* *Hellfire Aura* Damages nearby enemies.
* *Dark Bargain* Sacrifice HP for mana.
* *Infernal Legion* Summon multiple demons.
**Spell Tree by Level:**
* **Novice (Lv 15)** Dark Bolt, Drain Life
* **Adept (Lv 610)** Shadow Grasp, Corrupting Ray
* **Expert (Lv 1115)** Infernal Gate, Soul Drain
* **Master (Lv 16+)** Abyssal Rift, Summon Demon Lord
---
# 💋 Charisma-Based Characters
## **LUSTWRAITH**
**Alignment:** Evil or Chaotic Neutral
**Description:**
Lustwraiths wield allure as their weapon. They charm, dominate, and collect humanoids as companions or slaves. Legends say their very touch can bind minds. Their origin is shrouded in desire and corruption—some were succubi, others mortals consumed by vanity and power.
**Skill Trees:**
* **Seduction Tree (Control Focus)**
* *Charm* Temporarily turn enemies into allies.
* *Enthrall* Extend charm duration.
* *Obsession* Charmed allies deal more damage.
* *Dominion* Permanently enslave a weak-willed target.
* **Soul Feast Tree (Empowerment Focus)**
* *Essence Drain* Gain HP/MP from dominated followers.
* *Mirror Desire* Redirect damage to charmed ally.
* *Ecstatic Pulse* AoE charm with reduced duration.
* *Heartbreaker* Sacrifice a follower to regain full HP/MP.
---
## **TAMER**
**Alignment:** Neutral or Good
**Description:**
Tamers form bonds with beasts and magical creatures, commanding their loyalty through compassion, strength, or song. They serve as guardians of the wilds and mediators between man and monster.
**Skill Trees:**
* **Bondmaster Tree (Companion Focus)**
* *Beast Call* Summon a captured creature.
* *Empathic Link* Share damage between you and your beast.
* *Group Command* Control multiple beasts.
* *Soulbond* Permanent synergy buff to your primary beast.
* **Warden Tree (Nature Control)**
* *Thorn Lash* Vine-based attack.
* *Wild Regeneration* Heal both you and nearby beasts.
* *Territorial Howl* Buffs allies, intimidates enemies.
* *Verdant Storm* AoE nature attack that roots foes.
---
## ✅ Summary Table
| Attribute | Good Class | Evil Class | Primary Role | Spellcaster |
| ------------ | ---------- | ---------- | --------------------------- | ----------------- |
| Strength | Guardian | Bloodborn | Tank / Melee DPS | No |
| Dexterity | Ranger | Assassin | Ranged / Stealth DPS | No |
| Intelligence | Arcanist | Hexist | Elemental Mage / Curse Mage | Yes |
| Wisdom | Cleric | Warlock | Healer / Dark Caster | Yes |
| Charisma | Tamer | Lustwraith | Beast / Human Controller | No (Hybrid Magic) |
---
Would you like me to format this as a **YAML or JSON schema** next, so your game can load class metadata dynamically (e.g., backstory, skill_trees, spell_trees, alignment tags, etc.)? Thats ideal if you plan to store these in `/data/classes/` for procedural generation and easy balancing.