[Suggestion] Pattern for try/catch
Robotgiggle opened this issue · 3 comments
Mishaps forcibly ending a spell can be annoying, especially if your spell has a lot of error cases that need to be dealt with. To remedy this, a try/catch pattern could be introduced. It would act initially like Hermes' Gambit, running a provided code list, but upon encountering a mishap it would just end the execution of the provided list and return a value of 1. If the list runs fully without mishaps, it would instead return 0. Alternatively, it could return -1 if no mishaps occur and return the list index of the offending pattern if a mishap does occur. For balance reasons, using this pattern should probably incur a small media cost.
Some name suggestions from the discord: Odin's Gambit, Loki's Gambit, Mercury's Gambit, Anubis' Gambit
yes, not released yet but soon ™️
https://hexgloop.hexxy.media/v/latest/#patterns/gloopmisc@hexgloop:catchy_eval
@SamsTheNerd HexGloop implements this, right?