loathers / grimoire

Apache License 2.0
3 stars 8 forks source link

Let tasks use a () => Location for do #77

Closed horrible-little-slime closed 1 year ago

horrible-little-slime commented 1 year ago

I have for this two warnings:

  1. Using a () => Location will not perfectly replicate the behavior of using a Location; there are several places where we check task.do instanceof Location for making decisions. Most notably, setting Location before dressing, and deciding whether to repeat ourselves. I could work around this by making Task be, like, BaseTask & ( { target: Delayed<Location>, do?: () => void} | { target?: Delayed<Location>, do: () => void }), but that would be a breaking change for some existing scripts. I think?
  2. I switched from 0 to -1 in adv1, because I feel like I never see people use 0 and always see people use -1. This was an accident, but one I won't revert unless told to do so.