{
 "format": "hellarena.project/1",
 "name": "Ruínas de Sal",
 "description": "O ciclo de extração como projeto de criador: refúgio, expedição, pressão, dois portais, perda ao cair.",
 "license": "hellarena-credito",
 "assets": [
  {
   "kind": "spell",
   "key": "folego_de_sal",
   "name": "Fôlego de Sal",
   "draft": {
    "v": 1,
    "name": "Fôlego de Sal",
    "school": "nature",
    "target": "self",
    "delivery": "instant",
    "effects": [
     {
      "kind": "heal",
      "power": "strong"
     }
    ],
    "cast": 1.5,
    "cooldown": 20,
    "range": 0,
    "icon": "renew.png"
   }
  },
  {
   "kind": "item",
   "key": "moeda_antiga",
   "name": "Moeda Antiga",
   "draft": {
    "v": 1,
    "name": "Moeda Antiga",
    "kind": "material",
    "quality": "common",
    "icon": "🪙",
    "sell": 5,
    "description": "Vale alguma coisa no refúgio."
   }
  },
  {
   "kind": "item",
   "key": "reliquia",
   "name": "Lâmina Relíquia",
   "draft": {
    "v": 1,
    "name": "Lâmina Relíquia",
    "kind": "weapon",
    "quality": "rare",
    "icon": "🗡️",
    "slot": "onehand",
    "weaponType": "sword",
    "damage": [
     22,
     34
    ],
    "speed": 2.2,
    "stats": {
     "agi": 6,
     "sta": 4
    },
    "level": 8,
    "sell": 250,
    "color": "#9fe0ff",
    "description": "Rara. Vale arriscar a volta por ela."
   }
  },
  {
   "kind": "item",
   "key": "pocao_folego",
   "name": "Poção de Fôlego",
   "draft": {
    "v": 1,
    "name": "Poção de Fôlego",
    "kind": "consumable",
    "quality": "uncommon",
    "icon": "🧪",
    "use": "spell:folego_de_sal@1.0.0",
    "stack": 5,
    "sell": 10
   }
  },
  {
   "kind": "item",
   "key": "runa_mare",
   "name": "Runa da Maré",
   "draft": {
    "v": 1,
    "name": "Runa da Maré",
    "kind": "component",
    "quality": "rare",
    "icon": "🔷",
    "socket": {
     "type": "rune",
     "school": "frost",
     "power": "normal"
    },
    "description": "Arraste sobre uma arma com encaixe: cada golpe também gela."
   }
  },
  {
   "kind": "item",
   "key": "selo_guarda",
   "name": "Selo da Guarda",
   "draft": {
    "v": 1,
    "name": "Selo da Guarda",
    "kind": "component",
    "quality": "rare",
    "icon": "🔶",
    "socket": {
     "type": "seal",
     "seal": "cura_aparo"
    },
    "description": "Arraste sobre uma arma com encaixe: aparar cura."
   }
  },
  {
   "kind": "item",
   "key": "chave_portal",
   "name": "Chave do Portal Oculto",
   "draft": {
    "v": 1,
    "name": "Chave do Portal Oculto",
    "kind": "key",
    "quality": "rare",
    "icon": "🗝️",
    "description": "Abre o portal selado das ruínas."
   }
  },
  {
   "kind": "creature",
   "key": "saqueador",
   "name": "Saqueador das Ruínas",
   "draft": {
    "v": 1,
    "abilities": [
     "charge"
    ],
    "powers": [],
    "lore": {
     "where": "Ruínas de Sal",
     "why": "Guardam o que restou da cidade afundada."
    },
    "name": "Saqueador das Ruínas",
    "family": "sorrak",
    "look": "sorrak",
    "level": 6,
    "rank": "normal",
    "role": "balanced",
    "temper": "guerreiro",
    "drops": [
     {
      "item": "item:moeda_antiga@1.0.0",
      "chance": 0.7,
      "count": [
       1,
       3
      ]
     },
     {
      "item": "item:pocao_folego@1.0.0",
      "chance": 0.15
     }
    ],
    "money": [
     2,
     8
    ]
   }
  },
  {
   "kind": "creature",
   "key": "fera",
   "name": "Fera das Marés",
   "draft": {
    "v": 1,
    "abilities": [
     "leap"
    ],
    "powers": [],
    "lore": {
     "where": "Ruínas de Sal",
     "why": "Guardam o que restou da cidade afundada."
    },
    "name": "Fera das Marés",
    "family": "lince",
    "look": "beast_lynx",
    "level": 7,
    "rank": "normal",
    "role": "swift",
    "temper": "predador",
    "drops": [
     {
      "item": "item:moeda_antiga@1.0.0",
      "chance": 0.4
     }
    ]
   }
  },
  {
   "kind": "creature",
   "key": "guardiao",
   "name": "Guardião Afundado",
   "draft": {
    "v": 1,
    "abilities": [
     "heavy"
    ],
    "powers": [],
    "lore": {
     "where": "Ruínas de Sal",
     "why": "Guardam o que restou da cidade afundada."
    },
    "name": "Guardião Afundado",
    "family": "escorpiao",
    "look": "beast_scorpid_dark",
    "level": 9,
    "rank": "elite",
    "role": "tank",
    "temper": "territorial",
    "drops": [
     {
      "item": "item:reliquia@1.0.0",
      "chance": 0.25
     },
     {
      "item": "item:moeda_antiga@1.0.0",
      "chance": 1,
      "count": [
       3,
       6
      ]
     },
     {
      "item": "item:runa_mare@1.0.0",
      "chance": 0.5
     }
    ],
    "money": [
     10,
     30
    ]
   }
  },
  {
   "kind": "map",
   "key": "expedicao",
   "name": "Expedição às Ruínas de Sal",
   "draft": {
    "v": 1,
    "name": "Expedição às Ruínas de Sal",
    "start": "refugio",
    "rooms": [
     {
      "id": "refugio",
      "name": "Refúgio",
      "w": 16,
      "h": 12,
      "cells": "#################..............##..............##..............##..............##..............##..............##..............##..............##..............##..............#################",
      "props": [
       {
        "kind": "table",
        "x": 3,
        "y": 2
       },
       {
        "kind": "torch",
        "x": 7,
        "y": 1
       },
       {
        "kind": "crates",
        "x": 2,
        "y": 9
       },
       {
        "kind": "barrel",
        "x": 12,
        "y": 9
       }
      ],
      "doors": [
       {
        "x": 14,
        "y": 6,
        "to": "ruinas",
        "label": "Ruínas de Sal"
       }
      ],
      "spawns": [
       {
        "x": 4,
        "y": 6,
        "ref": "player"
       }
      ],
      "regions": [],
      "gates": [],
      "chests": [],
      "look": "refugio",
      "stash": {
       "x": 6,
       "y": 2
      },
      "npcs": [
       {
        "id": "cartografa",
        "name": "Cartógrafa Ivra",
        "x": 9,
        "y": 3
       }
      ]
     },
     {
      "id": "ruinas",
      "name": "Ruínas de Sal",
      "w": 36,
      "h": 24,
      "cells": "#####################################...........##.....................##...........##.....................##...........##.....................##...........##.....................##...........##.....................##...........##............#######..##...........##............#######..##...........##.....................##...........##.....................##..................................##..................................##..................................##..................................##.....................##.....########.....................##.....########.....................##...........##.....................##...........##.....................##...........##.....................##...........##.....................##...........##.....................##...........##.....................##...........#####################################",
      "props": [
       {
        "kind": "rubble",
        "x": 15,
        "y": 15
       },
       {
        "kind": "support",
        "x": 10,
        "y": 12
       },
       {
        "kind": "torch",
        "x": 2,
        "y": 10
       },
       {
        "kind": "torch",
        "x": 31,
        "y": 18
       }
      ],
      "doors": [
       {
        "x": 1,
        "y": 12,
        "to": "refugio",
        "label": "Refúgio (saída aberta)"
       },
       {
        "x": 34,
        "y": 3,
        "to": "cripta",
        "label": "Cripta"
       },
       {
        "x": 33,
        "y": 20,
        "to": "refugio",
        "label": "Portal oculto"
       }
      ],
      "spawns": [
       {
        "x": 9,
        "y": 5,
        "ref": "creature:saqueador@1.0.0",
        "respawn": "never",
        "tag": "ruina"
       },
       {
        "x": 18,
        "y": 12,
        "ref": "creature:saqueador@1.0.0",
        "respawn": "never",
        "tag": "ruina"
       },
       {
        "x": 20,
        "y": 19,
        "ref": "creature:fera@1.0.0",
        "respawn": "never",
        "tag": "ruina"
       },
       {
        "x": 30,
        "y": 10,
        "ref": "creature:saqueador@1.0.0",
        "respawn": "never",
        "tag": "ruina"
       },
       {
        "x": 3,
        "y": 8,
        "ref": "team"
       },
       {
        "x": 18,
        "y": 21,
        "ref": "team"
       },
       {
        "x": 33,
        "y": 10,
        "ref": "team"
       }
      ],
      "regions": [
       {
        "name": "norte",
        "x": 15,
        "y": 2,
        "w": 10,
        "h": 4
       },
       {
        "name": "sul",
        "x": 4,
        "y": 17,
        "w": 12,
        "h": 5
       },
       {
        "name": "selo",
        "x": 25,
        "y": 16,
        "w": 3,
        "h": 7
       }
      ],
      "gates": [
       {
        "id": "portal_oculto",
        "x": 28,
        "y": 16,
        "w": 1,
        "h": 7,
        "locked": true
       }
      ],
      "chests": [
       {
        "x": 6,
        "y": 3,
        "drops": [
         {
          "item": "item:moeda_antiga@1.0.0",
          "chance": 1,
          "count": [
           2,
           4
          ]
         }
        ],
        "money": [
         5,
         15
        ]
       },
       {
        "x": 17,
        "y": 21,
        "drops": [
         {
          "item": "item:moeda_antiga@1.0.0",
          "chance": 1,
          "count": [
           1,
           3
          ]
         },
         {
          "item": "item:reliquia@1.0.0",
          "chance": 0.2
         }
        ]
       },
       {
        "x": 25,
        "y": 3,
        "drops": [
         {
          "item": "item:pocao_folego@1.0.0",
          "chance": 1
         }
        ]
       }
      ],
      "fresh": true,
      "look": "ruinas"
     },
     {
      "id": "cripta",
      "name": "Cripta",
      "w": 20,
      "h": 14,
      "cells": "#####################.......##.........##.......##.........##.......##.........##.......##.........##.......##.........##.......##.........##.......##.........##.......##.........##..................##..................##..................##..................#####################",
      "props": [
       {
        "kind": "torch",
        "x": 12,
        "y": 1
       },
       {
        "kind": "rubble",
        "x": 4,
        "y": 11
       }
      ],
      "doors": [
       {
        "x": 1,
        "y": 7,
        "to": "ruinas",
        "label": "Ruínas de Sal"
       }
      ],
      "spawns": [
       {
        "x": 14,
        "y": 7,
        "ref": "creature:guardiao@1.0.0",
        "respawn": "never",
        "tag": "guardiao"
       }
      ],
      "regions": [],
      "gates": [],
      "chests": [
       {
        "x": 17,
        "y": 3,
        "drops": [
         {
          "item": "item:chave_portal@1.0.0",
          "chance": 1
         },
         {
          "item": "item:selo_guarda@1.0.0",
          "chance": 1
         }
        ]
       }
      ],
      "fresh": true,
      "look": "cripta"
     }
    ],
    "rules": {
     "vars": {
      "em_expedicao": false,
      "onda": 0,
      "extracoes": 0,
      "encomenda": 0
     },
     "rules": [
      {
       "id": "inicio",
       "on": {
        "kind": "start"
       },
       "do": [
        {
         "kind": "showText",
         "text": "Seu refúgio. Entre nas ruínas, pegue o que puder e volte vivo. Saia do cone vermelho, role (espaço) ou apare (E) na hora do golpe."
        },
        {
         "kind": "setObjective",
         "id": "extrair",
         "text": "Extrair com algo de valor (extrações: {extracoes})"
        }
       ]
      },
      {
       "id": "partida",
       "on": {
        "kind": "enterRoom",
        "arg": "ruinas"
       },
       "if": [
        {
         "kind": "var",
         "name": "em_expedicao",
         "value": false
        }
       ],
       "do": [
        {
         "kind": "setVar",
         "name": "em_expedicao",
         "value": true
        },
        {
         "kind": "setVar",
         "name": "onda",
         "value": 0
        },
        {
         "kind": "startTimer",
         "id": "pressao",
         "seconds": 45
        },
        {
         "kind": "showText",
         "text": "A expedição começou. O perigo cresce com o tempo."
        }
       ]
      },
      {
       "id": "pressao",
       "on": {
        "kind": "timer",
        "arg": "pressao"
       },
       "if": [
        {
         "kind": "var",
         "name": "em_expedicao",
         "value": true
        }
       ],
       "do": [
        {
         "kind": "setVar",
         "name": "onda",
         "add": 1
        },
        {
         "kind": "spawnGroup",
         "creature": "creature:saqueador@1.0.0",
         "count": 2,
         "region": "ruinas/norte",
         "tag": "onda"
        },
        {
         "kind": "if",
         "if": [
          {
           "kind": "var",
           "name": "onda",
           "op": ">=",
           "value": 3
          }
         ],
         "then": [
          {
           "kind": "spawnGroup",
           "creature": "creature:guardiao@1.0.0",
           "count": 1,
           "region": "ruinas/sul",
           "tag": "onda"
          },
          {
           "kind": "showText",
           "text": "Algo mais forte acordou nas ruínas."
          }
         ],
         "else": [
          {
           "kind": "showText",
           "text": "Passos ecoam: mais saqueadores chegaram."
          }
         ]
        },
        {
         "kind": "startTimer",
         "id": "pressao",
         "seconds": 45
        }
       ]
      },
      {
       "id": "cartografa",
       "on": {
        "kind": "talk",
        "arg": "cartografa"
       },
       "do": [
        {
         "kind": "if",
         "if": [
          {
           "kind": "var",
           "name": "encomenda",
           "value": 0
          }
         ],
         "then": [
          {
           "kind": "dialog",
           "npc": "cartografa",
           "text": "As ruínas guardam moedas da cidade afundada. Traga três e eu pago pelo mapa que elas desenham.",
           "options": [
            {
             "label": "Eu trago.",
             "do": [
              {
               "kind": "setVar",
               "name": "encomenda",
               "value": 1
              },
              {
               "kind": "setObjective",
               "id": "moedas",
               "text": "Levar 3 Moedas Antigas à Cartógrafa Ivra"
              }
             ]
            },
            {
             "label": "Agora não.",
             "do": []
            }
           ]
          }
         ],
         "else": [
          {
           "kind": "if",
           "if": [
            {
             "kind": "var",
             "name": "encomenda",
             "value": 1
            },
            {
             "kind": "hasItem",
             "item": "item:moeda_antiga@1.0.0",
             "count": 3
            }
           ],
           "then": [
            {
             "kind": "takeItem",
             "item": "item:moeda_antiga@1.0.0",
             "count": 3
            },
            {
             "kind": "giveXp",
             "amount": 300
            },
            {
             "kind": "giveMoney",
             "amount": 40
            },
            {
             "kind": "completeObjective",
             "id": "moedas"
            },
            {
             "kind": "setVar",
             "name": "encomenda",
             "value": 2
            },
            {
             "kind": "dialog",
             "npc": "cartografa",
             "text": "É isso. O mapa fica mais claro a cada moeda. Tome, você mereceu."
            }
           ],
           "else": [
            {
             "kind": "dialog",
             "npc": "cartografa",
             "text": "Ainda faltam moedas. Três, das ruínas."
            }
           ]
          }
         ]
        }
       ]
      },
      {
       "id": "chave",
       "on": {
        "kind": "itemTaken",
        "arg": "item:chave_portal@1.0.0"
       },
       "do": [
        {
         "kind": "showText",
         "text": "Uma chave antiga. Deve abrir algo nas ruínas."
        }
       ]
      },
      {
       "id": "selo",
       "on": {
        "kind": "enterRegion",
        "arg": "ruinas/selo"
       },
       "do": [
        {
         "kind": "if",
         "if": [
          {
           "kind": "hasItem",
           "item": "item:chave_portal@1.0.0"
          }
         ],
         "then": [
          {
           "kind": "openGate",
           "gate": "portal_oculto"
          },
          {
           "kind": "takeItem",
           "item": "item:chave_portal@1.0.0"
          },
          {
           "kind": "showText",
           "text": "A chave gira: o portal escondido se abre."
          }
         ],
         "else": [
          {
           "kind": "showText",
           "text": "Um portal selado. Falta uma chave."
          }
         ]
        }
       ]
      },
      {
       "id": "extraiu",
       "on": {
        "kind": "enterRoom",
        "arg": "refugio"
       },
       "if": [
        {
         "kind": "var",
         "name": "em_expedicao",
         "value": true
        }
       ],
       "do": [
        {
         "kind": "setVar",
         "name": "em_expedicao",
         "value": false
        },
        {
         "kind": "stopTimer",
         "id": "pressao"
        },
        {
         "kind": "setVar",
         "name": "extracoes",
         "add": 1
        },
        {
         "kind": "showText",
         "text": "Você extraiu! O que carrega é seu."
        }
       ]
      },
      {
       "id": "caiu",
       "on": {
        "kind": "playerDies"
       },
       "if": [
        {
         "kind": "var",
         "name": "em_expedicao",
         "value": true
        }
       ],
       "do": [
        {
         "kind": "takeAllItems"
        },
        {
         "kind": "setVar",
         "name": "em_expedicao",
         "value": false
        },
        {
         "kind": "stopTimer",
         "id": "pressao"
        },
        {
         "kind": "showText",
         "text": "Você caiu. O que carregava ficou nas ruínas."
        },
        {
         "kind": "startTimer",
         "id": "volta",
         "seconds": 4
        }
       ]
      },
      {
       "id": "volta",
       "on": {
        "kind": "timer",
        "arg": "volta"
       },
       "do": [
        {
         "kind": "goToRoom",
         "room": "refugio"
        }
       ]
      }
     ]
    },
    "combat": "active",
    "inventory": {
     "cols": 8,
     "rows": 5
    },
    "weight": 25,
    "pvp": true,
    "deathDrop": true,
    "teams": {
     "size": 3,
     "max": 3,
     "stagger": 20
    }
   }
  }
 ]
}
