1 QuestHelper_File
["collect_warp.lua"] = "Development Version"
2 QuestHelper_Loadtime
["collect_warp.lua"] = GetTime()
4 local debug_output
= false
5 if QuestHelper_File
["collect_warp.lua"] == "Development Version" then debug_output
= true end
14 local last_delayed
, last_rc
, last_rz
, last_rx
, last_ry
19 local function valid(d
, rc
, rz
, rx
, ry
)
20 return not d
and rc
and rz
and rx
and ry
23 local function OnUpdate()
24 local bolus
= GetLoc()
25 local now_delayed
, now_rc
, now_rz
, now_rx
, now_ry
= RawLocation()
26 local now_valid
= valid(RawLocation())
28 if last_valid
and now_valid
then
30 if last_rc
~= now_rc
or last_rz
~= now_rz
then
33 local dx
, dy
= last_rx
- now_rx
, last_ry
- now_ry
34 dx
, dy
= dx
* dx
, dy
* dy
35 if dx
+ dy
> 0.01 * 0.01 then
41 if debug_output
then QuestHelper
:TextOut("Warpy!") end
44 if last_warp
+ 10 < GetTime() and leapy
then
45 if debug_output
then QuestHelper
:TextOut("REAL Warpy!") end
46 Merger
.Add(QHCW
, lastloc_bolus
.. bolus
)
53 last_delayed
, last_rc
, last_rz
, last_rx
, last_ry
, last_valid
= now_delayed
, now_rc
, now_rz
, now_rx
, now_ry
, now_valid
56 function QH_Collect_Warp_Init(QHCData
, API
)
57 if not QHCData
.warp
then QHCData
.warp
= {} end
60 API
.Registrar_OnUpdateHook(OnUpdate
)
62 GetLoc
= API
.Callback_LocationBolusCurrent
63 QuestHelper
: Assert(GetLoc
)
65 RawLocation
= API
.Callback_Location_Raw
66 QuestHelper
: Assert(RawLocation
)
68 Merger
= API
.Utility_Merger
69 QuestHelper
: Assert(Merger
)