data format

Guide for data format

Data Format Reference

mantras.json Structure

Complete schema for the magic system data file.

Top-Level Structure

{
  "combat_spells": [ /* array of CombatSpell */ ],
  "utility_spells": [ /* array of UtilitySpell */ ],
  "teleport_recipes": [ /* array of TeleportRecipe */ ]
}

CombatSpell Schema

{
  "spell_id": "air_pulse",           // Unique identifier
  "name": "Air Pulse",               // Display name
  "level_req": 1,                    // Magic level requirement
  "bijas": [                         // Required components
    {
      "bija_id": "air_bija",         // Item ID from items.json
      "quantity": 2                  // Amount consumed per cast
    },
    {
      "bija_id": "chandra_bija",
      "quantity": 1
    }
  ],
  "max_hit": 3,                      // Maximum damage
  "xp": 5.5,                         // Magic XP granted
  "spell_tier": "pulse"              // Tier name (pulse/volley/cascade/cataclysm)
}

UtilitySpell Schema

{
  "spell_id": "life_restoration",
  "name": "Life Restoration",
  "level_req": 20,
  "bijas": [
    {"bija_id": "water_bija", "quantity": 2},
    {"bija_id": "hanuman_bija", "quantity": 1},
    {"bija_id": "kali_bija", "quantity": 1}
  ],
  "effect": "heal",                  // Effect type
  "heal_amount": 10,                 // Effect-specific parameter
  "xp": 12.0
}
Effect Types:
  • "heal": Restore HP (requires heal_amount)
  • "cure_poison": Remove poison status
  • "buff_attack": Increase attack (requires buff_percentage, duration_seconds)
  • "buff_magic_accuracy": Increase magic accuracy (requires buff_percentage, duration_seconds)

TeleportRecipe Schema

{
  "teleport_id": "hastinapur_teleport",
  "name": "Hastinapur Teleport",
  "level_req": 25,
  "coconut_bijas": [                 // 3-eye configuration
    {
      "eye": 1,                      // Eye number (1, 2, or 3)
      "bija_id": "vishnu_bija"       // Required bija for this eye
    },
    {
      "eye": 2,
      "bija_id": "air_bija"
    },
    {
      "eye": 3,
      "bija_id": "earth_bija"
    }
  ],
  "charged_coconut_id": "hastinapur_teleport_coconut",  // Item ID of result
  "destination": "hastinapur_palace",                   // Destination identifier
  "xp": 15.0
}

items.json Additions

Bija Item Format

{
  "item_id": "chandra_bija",
  "name": "Chandra Bija",
  "description": "A catalytic bija of the Moon God, embodying consciousness",
  "stackable": true,
  "weight": 0.001,
  "note_id": null,
  "value": 25
}
All Bija IDs:
  • Elemental: air_bija, water_bija, earth_bija, fire_bija
  • Catalytic: chandra_bija, rahu_bija, yama_bija, rudra_bija, kali_bija, vishnu_bija, hanuman_bija, indra_bija

Coconut Items

Empty Coconut:
{
  "item_id": "coconut",
  "name": "Coconut",
  "description": "A coconut with three eyes, used for teleportation rituals",
  "stackable": false,
  "weight": 0.8,
  "note_id": null,
  "value": 50
}
Charged Teleport:
{
  "item_id": "hastinapur_teleport_coconut",
  "name": "Hastinapur Teleport",
  "description": "A charged coconut. Break to teleport to Hastinapur Palace",
  "stackable": true,
  "weight": 0.1,
  "note_id": null,
  "value": 200
}

Complete Spell List

Tier 1: Pulse (Chandra)

SpellLevelCostMax HitXP
Air Pulse12 Air + 1 Chandra35.5
Water Pulse52 Water + 1 Chandra57.5
Earth Pulse92 Earth + 1 Chandra69.5
Fire Pulse132 Fire + 1 Chandra811.5

Tier 2: Volley (Rahu)

SpellLevelCostMax HitXP
Air Volley253 Air + 1 Rahu915.0
Water Volley293 Water + 1 Rahu1118.0
Earth Volley333 Earth + 1 Rahu1321.0
Fire Volley353 Fire + 1 Rahu1524.0

Tier 3: Cascade (Yama)

SpellLevelCostMax HitXP
Air Cascade414 Air + 1 Yama1730.0
Water Cascade434 Water + 1 Yama1933.0
Earth Cascade454 Earth + 1 Yama2136.0
Fire Cascade474 Fire + 1 Yama2339.0

Tier 4: Cataclysm (Rudra)

SpellLevelCostMax HitXP
Air Cataclysm555 Air + 1 Rudra2545.0
Water Cataclysm605 Water + 1 Rudra2850.0
Earth Cataclysm655 Earth + 1 Rudra3155.0
Fire Cataclysm705 Fire + 1 Rudra3460.0

Utility Spells

SpellLevelCostEffectXP
Life Restoration202 Water + 1 Hanuman + 1 KaliHeal 10 HP12.0
Purification353 Water + 1 Chandra + 1 IndraCure Poison20.0
Warrior's Blessing402 Fire + 2 Hanuman+10% Attack (5min)25.0
Scholar's Focus452 Chandra + 2 Indra+5% Magic Acc (5min)28.0

Teleport Recipes

RecipeLevelEyesDestinationXP
Hastinapur25Vishnu, Air, EarthHastinapur Palace15.0
Forest31Water, Earth, IndraSacred Grove20.0
Mountain38Vishnu, Earth, HanumanMountain Temple25.0

Validation Rules

Combat Spells

  • spell_id must be unique
  • level_req must be 1-99
  • bijas array must have at least 1 entry
  • max_hit must be positive
  • xp must be positive
  • spell_tier should be one of: pulse, volley, cascade, cataclysm

Teleport Recipes

  • coconut_bijas must have exactly 3 entries
  • Each eye value must be 1, 2, or 3 (no duplicates)
  • charged_coconut_id must exist in items.json
  • All bija_id values must exist in items.json

Modding Support

The data-driven design allows players to:
  1. Add new spells by editing mantras.json
  2. Rebalance existing spells (change costs, damage, XP)
  3. Create new teleport destinations
  4. Adjust level requirements
No code changes required for basic spell modifications.