-
Notifications
You must be signed in to change notification settings - Fork 1
/
annotations.lua
1167 lines (972 loc) · 50.3 KB
/
annotations.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- luacheck: ignore
---@class ActionInstance
---@field _is_deferred boolean desc
---@field _is_every_frame boolean desc
---@field _is_periodic boolean desc
---@field _name string The action instance name
---@field _periodic_timer number desc
---@field _periodic_timer_current number desc
---@field _release_callback function(ActionInstance) desc
---@field _state_instance StateInstance desc
---@field _trigger_callback function(ActionInstance) desc
---@field context table Action context table
---@field static ActionInstance.static Submodule
local ActionInstance = {}
--- Trigger event to action's FSM
---@param event_name string Name of trigger event
function ActionInstance.event(event_name) end
--- Function called when action is done.
---@param trigger_event string Event to trigger before finish call
function ActionInstance.finish(trigger_event) end
--- Force finish action, even with "is_every_frame" or "is_periodic".
---@param trigger_event string Event to trigger before finish call
function ActionInstance.force_finish(trigger_event) end
--- Return the name of the action
---@return string The action name
function ActionInstance.get_name() end
--- Check if param value is from FSM variables.
---@param param any
---@return any
function ActionInstance.get_param(param) end
--- Return variable value from FSM variables
---@param variable_name string The name of variable in FSM
function ActionInstance.get_value(variable_name) end
--- Action Instance constructor function
---@param trigger_callback function The main action function
---@param release_callback function The release function. Clean up stuff, it you need
function ActionInstance.initialize(trigger_callback, release_callback) end
--- Return action deferred state.
---@return boolean Action deferred state
function ActionInstance.is_deferred() end
--- Set debug state of action.
---@param state boolean The debug state
---@return ActionInstance Self
function ActionInstance.set_debug(state) end
--- Set action to deferred state.
---@param state boolean The deferred state
function ActionInstance.set_deferred(state) end
--- Add delay before action is triggered.
---@param seconds number|variable|nil Action delay
---@return ActionInstance Self
function ActionInstance.set_delay(seconds) end
--- Set action triggered every frame.
---@return ActionInstance Self
function ActionInstance.set_every_frame() end
--- Set the name of the action
---@param name string The action name
---@return ActionInstance Self
function ActionInstance.set_name(name) end
--- Set periodic trigger of action.
---@param seconds number The time between triggers
---@param skip_initial_call boolean If true, skip first initial call on state enter
---@return ActionInstance Self
function ActionInstance.set_periodic(seconds, skip_initial_call) end
--- Set variable value in action's FSM
---@param variable_name string The name of variable in FSM
---@param value any New value for variable
function ActionInstance.set_value(variable_name, value) end
--- Add context to this actions.
---@return ActionInstance Self
function ActionInstance.set_with_context() end
---@class ActionInstance.static
local ActionInstance__static = {}
--- Copy constructor
---@param prefab ActionInstance The action to copy
---@return ActionInstance Copy of prefab action
function ActionInstance__static.copy(prefab) end
---@class AdamInstance
local AdamInstance = {}
--- Add Adam Instance to current as nested FSM.
---@param adam_instance AdamInstance The nested Adam Instance
---@return AdamInstance Self
function AdamInstance.add(adam_instance) end
--- Change the self context instante (the go instante instead of "." in all of action) also set the game object id as FSM id.
---@param game_object hash The game object to bind
---@return AdamInstance Self
function AdamInstance.bind(game_object) end
--- Check available to make transition from current state with event
---@param event_name string The trigger event
---@return boolean True, if FSM will make transition on this event
function AdamInstance.can_transition(event_name) end
--- Trigger event in Adam FSM.
---@param event_name string The trigger event name
---@param event_context table The event data
function AdamInstance.event(event_name, event_context) end
--- Adam final function.
function AdamInstance.final() end
--- Forward incoming events to other adam instance
---@param adam_instance AdamInstance The adam instance to get events
---@param events table|string The name of event[s] to forward
---@param is_consume boolean Is event should be consumed on forward
---@param Self AdamInstance
function AdamInstance.forward_events(adam_instance, events, is_consume, Self) end
--- Return current adam state
---@return StateInstance The current State Instance
function AdamInstance.get_current_state() end
--- Get id of current Adam instance
---@return hash The Adam Instance id
function AdamInstance.get_id() end
--- Get name of current Adam Instance
---@return string The Adam Instance name
function AdamInstance.get_name() end
--- Return current game object binded to Adam (default ".")
---@return url The game object id
function AdamInstance.get_self() end
--- Get context url, where Adam Instance was started.
---@return url|nil The Adam Instance url
function AdamInstance.get_url() end
--- Return variable value from Adam instance
---@param variable_name string|variable The name of variable in FSM
---@return variable
function AdamInstance.get_value(variable_name) end
--- Adam Instance constructor function.
---@param initial_state StateInstance The initial FSM state. It will be triggered on start
---@param transitions StateInstance[] The array of next structure: {state_instance, state_instance, [event]}, describe transitiom from first state to second on event. By default event is adam.FINISHED
---@param variables table Defined FSM variables. All variables should be defined before use
---@param final_state StateInstance This state should contains only instant actions, execute on adam:final, transitions are not required
---@return AdamInstance
function AdamInstance.initialize(initial_state, transitions, variables, final_state) end
--- Return true if Adam Instance is now working
---@return boolean Is active state
function AdamInstance.is_active() end
--- Return true, if Adam Instance was started
---@return boolean The Adam Instance inited state
function AdamInstance.is_inited() end
--- Adam on_input function.
---@param action_id hash The input action_id
---@param action table The input action info
function AdamInstance.on_input(action_id, action) end
--- Adam on_message function.
---@param message_id hash The message_id
---@param message table The message info
---@param sender hash The message sender id
function AdamInstance.on_message(message_id, message, sender) end
--- Pause the execution of Adam Instance.
---@return AdamInstance
function AdamInstance.pause() end
--- Resume the execution of Adam Instance.
---@return AdamInstance
function AdamInstance.resume() end
--- Set debug state of state.
---@param is_debug boolean The debug state
---@return AdamInstance Self
function AdamInstance.set_debug(is_debug) end
--- Set id for Adam instance.
---@param hash hash The Adam Instance id
function AdamInstance.set_id(hash) end
--- Set name for Adam Instance.
---@param name string The Adam Instance name
function AdamInstance.set_name(name) end
--- Set variable value in Adam instance
---@param variable_name string|variable The name of variable in FSM
---@param value any New value for variable
function AdamInstance.set_value(variable_name, value) end
--- Start the Adam Instance.
---@return AdamInstance
function AdamInstance.start() end
--- Adam update functions.
---@param dt numbet The delta time
function AdamInstance.update(dt) end
---@class StateInstance
local StateInstance = {}
--- Trigger event to FSM.
---@param event_name string The event to send
function StateInstance.event(event_name) end
--- Get the current AdamInstance, attached to this state
---@return AdamInstance
function StateInstance.get_adam_instance() end
--- Return current State Instance id.
function StateInstance.get_id() end
--- Get name of current State Instance
---@return string The State Instance name
function StateInstance.get_name() end
--- State Instance constructor function
---@param ... ActionInstance The any amount of ActionInstance for this State
---@return StateInstance
function StateInstance.initialize(...) end
--- Check is State can run in one frame.
---@return boolean True, if state triggers in one frame
function StateInstance.is_instant() end
--- Set debug state of state.
---@param state boolean The debug state
---@return StateInstance Self
function StateInstance.set_debug(state) end
--- Set name for State Instance.
---@param name string The State Instance name
function StateInstance.set_name(name) end
---@class actions
---@field debug actions.debug Submodule
---@field fsm actions.fsm Submodule
---@field go actions.go Submodule
---@field input actions.input Submodule
---@field logic actions.logic Submodule
---@field math actions.math Submodule
---@field msg actions.msg Submodule
---@field sprite actions.sprite Submodule
---@field time actions.time Submodule
---@field transform actions.transform Submodule
---@field vmath actions.vmath Submodule
local actions = {}
---@class actions.debug
local actions__debug = {}
--- Call callback on event trigger
---@param callback function The callback to call
---@param delay number Time in seconds
---@return ActionInstance
function actions__debug.callback(callback, delay) end
--- Instantly trigger event.
---@param event_name string The event to send
---@return ActionInstance
function actions__debug.event(event_name) end
--- Print text to console
---@param text string The log message
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second bool Repeat this action every second
---@return ActionInstance
function actions__debug.print(text, is_every_frame, is_every_second) end
---@class actions.fsm
local actions__fsm = {}
--- Broadcast event to all active FSM.
---@param event_name string The event to send
---@param is_exclude_self bool Don't send the event to self
---@param delay number Time delay in seconds
---@return ActionInstance
function actions__fsm.broadcast_event(event_name, is_exclude_self, delay) end
--- Finalize the Adam Instance
---@param string target |adam target The target instance to finish
---@param delay number Time delay in seconds
function actions__fsm.final(string, delay) end
--- Get adam from adam_id
---@param string adam_id The adam_id for search
---@param store_value string The name of variable in current FSM to store get value
---@param is_every_frame boolean Repeat this action every frame
function actions__fsm.get_adam(string, store_value, is_every_frame) end
--- Get variable from FSM.
---@param string target |adam target The target instance to get value
---@param variable variable Name of variable to get from target FSM
---@param store_value string The name of variable in current FSM to store get value
---@param is_every_frame boolean Repeat this action every frame
function actions__fsm.get_value(string, variable, store_value, is_every_frame) end
--- Pause the Adam Instance
---@param string target |adam target The target instance to pause
---@param delay number Time delay in seconds
function actions__fsm.pause(string, delay) end
--- Resume the Adam Instance
---@param string target |adam target The target instance to resume
---@param delay number Time delay in seconds
function actions__fsm.resume(string, delay) end
--- Send event to target Adam instance.
---@param target string|adam The target instance for send event. If there are several instances with equal ID, event will be delivered to all of them.
---@param event_name string The event to send
---@param delay number Time delay in seconds
---@param is_every_frame bool Repeat every frame
---@return ActionInstance
function actions__fsm.send_event(target, event_name, delay, is_every_frame) end
--- Set variable from FSM.
---@param string target |adam target The target instance to set value
---@param variable variable Name of variable to set value on target FSM
---@param source string The variable in current FSM to set the variable to
---@param is_every_frame boolean Repeat this action every frame
function actions__fsm.set_value(string, variable, source, is_every_frame) end
---@class actions.go
local actions__go = {}
--- Spawn game object via factory
---@param factory_url url The factory component to be used
---@param position vector3 The position to set
---@param variable variable The variable to store created game object id
---@param delay number The Time delay in seconds
---@param scale vector3 The scale to set
---@param rotation vector3 The rotation to set
---@param properties table The properties to set
---@return ActionInstance
function actions__go.create_object(factory_url, position, variable, delay, scale, rotation, properties) end
--- Spawn game objects via collection factory
---@param collection_factory_url url The colection factory component to be used
---@param position vector3 The position to set
---@param variable variable The variable to store created game object id
---@param delay number The Time delay in seconds
---@param scale vector3 The scale to set
---@param rotation vector3 The rotation to set
---@param properties table The properties to set
---@return ActionInstance
function actions__go.create_objects(collection_factory_url, position, variable, delay, scale, rotation, properties) end
--- Delete the game object
---@param target url The game object to delete, self by default
---@param delay number Delay before delete
---@param not_recursive boolean Set true to not delete children of deleted go
---@return ActionInstance
function actions__go.delete_object(target, delay, not_recursive) end
--- Delete the game objects
---@param target_ids table The game objects to delete
---@param delay number Delay before delete
---@param not_recursive boolean Set true to not delete children of deleted go
---@return ActionInstance
function actions__go.delete_objects(target_ids, delay, not_recursive) end
--- Delete the current game object Useful for game objects that need to kill themselves, for example a projectile that explodes on impact.
---@param delay number Delay before delete
---@param not_recursive boolean Set true to not delete children of deleted go
---@return ActionInstance
function actions__go.delete_self(delay, not_recursive) end
--- Disable the receiving component
---@param target url The game object to delete, self by default
---@param delay number Delay before delete
---@return ActionInstance
function actions__go.disable(target, delay) end
--- Enable the receiving component
---@param target url The game object to delete, self by default
---@param delay number Delay before delete
---@return ActionInstance
function actions__go.enable(target, delay) end
---@class actions.input
local actions__input = {}
--- Check is action_id is active now.
---@param action_id string The key to check
---@param variable string Variable to set
---@param in_update_only boolean Repeat this action every frame, skip initial call
---@param trigger_event string The event to trigger on true condition
---@return ActionInstance
function actions__input.get_action(action_id, variable, in_update_only, trigger_event) end
--- Check is action_id was pressed.
---@param action_id string The key to check
---@param variable string Variable to set
---@param in_update_only boolean Repeat this action every frame, skip initial call
---@param trigger_event string The event to trigger on true condition
---@return ActionInstance
function actions__input.get_action_pressed(action_id, variable, in_update_only, trigger_event) end
--- Check is action_id was released.
---@param action_id string The key to check
---@param variable string Variable to set
---@param in_update_only boolean Repeat this action every frame, skip initial call
---@param trigger_event string The event to trigger on true condition
---@return ActionInstance
function actions__input.get_action_released(action_id, variable, in_update_only, trigger_event) end
--- Imitate two keys as axis.
---@param negative_action string The action_id to negative check
---@param positive_action string The action_id to positive check
---@param variable string Variable to set
---@param is_every_frame boolean Repeat this action every frame, skip initial call
---@param multiplier number The value to multiply result
---@return ActionInstance
function actions__input.get_axis_actions(negative_action, positive_action, variable, is_every_frame, multiplier) end
--- Check is action_id is active now on sprite_url
---@param action_id string The key to check
---@param sprite_url url The sprite url to check input action
---@param variable string Variable to set
---@param in_update_only boolean Repeat this action every frame, skip initial call
---@param trigger_event string The event to trigger on true condition
---@return ActionInstance
function actions__input.get_sprite_action(action_id, sprite_url, variable, in_update_only, trigger_event) end
--- Check is action_id is active now on sprite_url
---@param action_id string The key to check
---@param sprite_url url The sprite url to check input action
---@param variable string Variable to set
---@param in_update_only boolean Repeat this action every frame, skip initial call
---@param trigger_event string The event to trigger on true condition
---@return ActionInstance
function actions__input.get_sprite_action_pressed(action_id, sprite_url, variable, in_update_only, trigger_event) end
--- Check is action_id is active now on sprite_url
---@param action_id string The key to check
---@param sprite_url url The sprite url to check input action
---@param variable string Variable to set
---@param in_update_only boolean Repeat this action every frame, skip initial call
---@param trigger_event string The event to trigger on true condition
---@return ActionInstance
function actions__input.get_sprite_action_released(action_id, sprite_url, variable, in_update_only, trigger_event) end
---@class actions.logic
local actions__logic = {}
--- Sends an event if all the variables are false
---@param variables_array variables[] Array of variables. Can be FSM or usual variable
---@param trigger_event string The event to send if all variables are false
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__logic.all_false(variables_array, trigger_event, is_every_frame) end
--- Sends an event if all the variables are true
---@param variables_array variables[] Array of variables. Can be FSM or usual variable
---@param trigger_event string The event to send if all variables are true
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__logic.all_true(variables_array, trigger_event, is_every_frame) end
--- Sends an event if any of the variables are true
---@param variables_array variables[] Array of variables. Can be FSM or usual variable
---@param trigger_event string The event to send if any of variables are true
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__logic.any_true(variables_array, trigger_event, is_every_frame) end
--- Tests if the value of a variable has changed.
---@param variable variable The variable to test on changed
---@param trigger_event string The event to send on variable change
---@param store_result string Save true to this variable, if variable has changed
---@return ActionInstance
function actions__logic.changed(variable, trigger_event, store_result) end
--- Send events based on the variables comparsion (numbers)
---@param variable_a variable The first variable to compare
---@param variable_b variable The second variable to compare
---@param event_equal string The event to send if variable_a equals to variable_b (within tolerance)
---@param event_less string The event to send if variable_a less than variable_b
---@param event_greater string The event to send if variable_a greater than variable_b
---@param is_every_frame boolean Repeat this action every frame
---@param tolerance number The tolerance for comparsion
---@return ActionInstance
function actions__logic.compare(variable_a, variable_b, event_equal, event_less, event_greater, is_every_frame, tolerance) end
--- Check equals on two variables
---@param variable_a variable The first variable to compare
---@param variable_b variable The second variable to compare
---@param event_equal string The event to send if variable_a equals to variable_b
---@param event_not_equal string The event to send if variable_a not equals variable_b
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__logic.equals(variable_a, variable_b, event_equal, event_not_equal, is_every_frame) end
--- Send events based on the value of a variable.
---@param variable variable The variable to test
---@param event_on_true string The event to send if variable is true
---@param event_on_false string The event to send if variable is false
---@param store_result string Save true to this variable, if variable has changed
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__logic.test(variable, event_on_true, event_on_false, store_result, is_every_frame) end
---@class actions.math
local actions__math = {}
--- Sets a float variable to its absolute value.
---@param source string Variable to abs
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.abs(source, is_every_frame) end
--- Get a acos value
---@param value variable Variable to take acos
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.acos(value, store_variable, is_degrees, is_every_frame) end
--- Adds a value to a variable
---@param source string Variable to add
---@param value variable The value to add
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.add(source, value, is_every_frame, is_every_second) end
--- Get a asin value
---@param value variable Variable to take asin
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.asin(value, store_variable, is_degrees, is_every_frame) end
--- Get a atan value
---@param value variable Variable to take atan
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.atan(value, store_variable, is_degrees, is_every_frame) end
--- Get a atan2 value
---@param value variable Variable to take atan2
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.atan2(value, store_variable, is_degrees, is_every_frame) end
--- Clamps the value of a variable to a min/max range.
---@param source string Variable to clamp
---@param min variable The minimum value allowed.
---@param max variable The maximum value allowed.
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.clamp(source, min, max, is_every_frame, is_every_second) end
--- Get a cos value
---@param value variable Variable to take cos
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.cos(value, store_variable, is_degrees, is_every_frame) end
--- Divides a value by another value
---@param source string Variable to divide
---@param value variable Divide by this value
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.divide(source, value, is_every_frame) end
--- Loop value in range.
---@param source string Variable to loop
---@param min number The minimum value to loop.
---@param max number The maximum value to loop.
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.loop(source, min, max, is_every_frame, is_every_second) end
--- Choose max value
---@param source string Variable to compare
---@param min variable|number Another variable
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.max(source, min, is_every_frame, is_every_second) end
--- Choose min value
---@param source string Variable to compare
---@param min variable|number Another variable
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.min(source, min, is_every_frame, is_every_second) end
--- Multiplies a variable by another value
---@param source string Variable to multiply
---@param value variable The multiplier
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.multiply(source, value, is_every_frame) end
--- Apply a math function (a, b, adam_instance)=>c to source variable.
---@param source_variable_a variable First variable A
---@param variable_b variable Second variable B
---@param operator function The callback function
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.operator(source_variable_a, variable_b, operator, is_every_frame) end
--- Sets a variable to a random value between min/max.
---@param source string Variable to set
---@param min variable Minimum value of the random number
---@param max variable Maximum value of the random number.
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.random(source, min, max, is_every_frame, is_every_second) end
--- Sets a variable to a random value true or false
---@param source string Variable to set
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.random_boolean(source, is_every_frame, is_every_second) end
--- Set a value to a variable
---@param source string Variable to set
---@param value variable The value to set
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.set(source, value, is_every_frame, is_every_second) end
--- Get a sin value
---@param value variable Variable to take sin
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.sin(value, store_variable, is_degrees, is_every_frame) end
--- Subtracts a value from a variable
---@param source string Variable to subtract from
---@param value variable The value to subtract
---@param is_every_frame boolean Repeat this action every frame
---@param is_every_second boolean Repeat this action every second
---@return ActionInstance
function actions__math.subtract(source, value, is_every_frame, is_every_second) end
--- Get a tan value
---@param value variable Variable to take tan
---@param store_variable variable Variable to set
---@param is_degrees boolean Check true, if using degrees instead of radians
---@param is_every_frame boolean Repeat this action every frame
---@return ActionInstance
function actions__math.tan(value, store_variable, is_degrees, is_every_frame) end
---@class actions.msg
local actions__msg = {}
--- Post message via msg.post
---@param target url The receiver url
---@param message_id string The message id to send
---@param message table A lua table with message parameters to send
---@param delay number Time in seconds
---@return ActionInstance
function actions__msg.post(target, message_id, message, delay) end
---@class actions.sprite
local actions__sprite = {}
--- Add the alpha to the sprite component
---@param alpha number The sprite alpha value
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.add_alpha(alpha, is_every_frame, delay, The, target_url) end
--- Add the tint to the sprite component
---@param tint vector4 The tint vector
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.add_tint(tint, is_every_frame, delay, The, target_url) end
--- Animate the alpha to the sprite component
---@param alpha number The sprite alpha value
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.animate_alpha(alpha, time, finish_event, delay, ease_function, The, target_url) end
--- Animate the alpha of the sprite component with relative alpha vector
---@param alpha number The sprite alpha value
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.animate_alpha_by(alpha, time, finish_event, delay, ease_function, The, target_url) end
--- Animate the tint to the sprite component
---@param tint vector4 The tint vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.animate_tint(tint, time, finish_event, delay, ease_function, The, target_url) end
--- Animate the tint of the sprite component with relative tint vector
---@param tint vector4 The tint vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.animate_tint_by(tint, time, finish_event, delay, ease_function, The, target_url) end
--- Get the alpha property of a game object and store to variable
---@param variable string The variable to store result
---@param is_every_frame boolean Repeat this action every frame
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.get_alpha(variable, is_every_frame, The, target_url) end
--- Get the tint property of a game object and store to variable
---@param variable string The variable to store result
---@param is_every_frame boolean Repeat this action every frame
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.get_tint(variable, is_every_frame, The, target_url) end
--- Play the flipbook for target url.
---@param image string The image to play
---@param The target_url name sprite component, by default - all sprite components in object
---@param finish_event string Name of trigger event
---@param delay number The Time delay in seconds
---@param The target_component name sprite component, by default - all sprite components in object
---@return ActionInstance
function actions__sprite.play_flipbook(image, The, finish_event, delay, The) end
--- Set the alpha to the sprite component
---@param alpha number The sprite alpha value
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.set_alpha(alpha, is_every_frame, delay, The, target_url) end
--- Set horizontal flip for the sprite
---@param is_flip boolean The boolean flag for flip
---@param The target_url name sprite component, by default - all sprite components in object
---@param is_every_frame boolean Repeat this action every frame
---@param delay number The Time delay in seconds
---@param The target_component name sprite component, by default - all sprite components in object
---@return ActionInstance
function actions__sprite.set_hflip(is_flip, The, is_every_frame, delay, The) end
--- Set the tint to the sprite component
---@param tint vector4 The tint vector
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param The target_component name sprite component
---@param target_url url The object to apply sprite
---@return ActionInstance
function actions__sprite.set_tint(tint, is_every_frame, delay, The, target_url) end
--- Set vertical flip for the sprite
---@param is_flip boolean The boolean flag for flip
---@param The target_url name sprite component, by default - all sprite components in object
---@param is_every_frame boolean Repeat this action every frame
---@param delay number The Time delay in seconds
---@param The target_component name sprite component, by default - all sprite components in object
---@return ActionInstance
function actions__sprite.set_vflip(is_flip, The, is_every_frame, delay, The) end
---@class actions.time
local actions__time = {}
--- Trigger event after time elapsed.
---@param seconds number|variable Amount of seconds for delay
---@param trigger_event string Name of trigger event
---@return ActionInstance
function actions__time.delay(seconds, trigger_event) end
--- Trigger event after amount of frames.
---@param frames number Amount of frames to wait
---@param trigger_event string Name of trigger event
---@return ActionInstance
function actions__time.frames(frames, trigger_event) end
--- Trigger event after random time elapsed.
---@param min_seconds number|variable Minimum amount of seconds for delay
---@param max_seconds number|variable Maximum amount of seconds for delay
---@param trigger_event string Name of trigger event
---@return ActionInstance
function actions__time.random_delay(min_seconds, max_seconds, trigger_event) end
---@class actions.transform
local actions__transform = {}
--- Add the euler of a game object
---@param target_euler vector3 The euler vector
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.add_euler(target_euler, is_every_frame, delay, target_url) end
--- Add the position to a game object
---@param delta_vector vector3 Vector with x/y/z params to translate
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.add_position(delta_vector, is_every_frame, delay, target_url) end
--- Add the rotation of a game object
---@param target_quaternion quaternion Rotation quatenion
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.add_rotation(target_quaternion, is_every_frame, delay, target_url) end
--- Add scale to a game object
---@param target_scale vector3 Scale vector
---@param is_every_frame boolean Repeat this action every frame
---@param delay number Delay before translate in seconds
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.add_scale(target_scale, is_every_frame, delay, target_url) end
--- Animate the euler of a game object with euler vector
---@param target_euler vector3 The euler vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_euler(target_euler, time, finish_event, delay, ease_function, target_url) end
--- Animate the euler of a game object with relative euler vector
---@param target_euler vector3 Rotation quaternion
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_euler_by(target_euler, time, finish_event, delay, ease_function, target_url) end
--- Animate the position of a game object
---@param target_vector vector3 Position vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_position(target_vector, time, finish_event, delay, ease_function, target_url) end
--- Animate the position of a game object by a delta vector
---@param target_vector vector3 Delta position vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_position_by(target_vector, time, finish_event, delay, ease_function, target_url) end
--- Animate the rotation of a game object
---@param target_quaternion quaternion Rotation quaternion
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_rotation(target_quaternion, time, finish_event, delay, ease_function, target_url) end
--- Animate the rotation of a game object with a delta quaternion
---@param target_quaternion quaternion Delta rotation quaternion
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_rotation_by(target_quaternion, time, finish_event, delay, ease_function, target_url) end
--- Animate scale to a game object
---@param target_scale vector3 Scale vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_scale(target_scale, time, finish_event, delay, ease_function, target_url) end
--- Animate scale to a game object with relative vector
---@param target_scale vector3 Add scale vector
---@param time number The time to animate
---@param finish_event string Name of trigger event
---@param delay number Delay before animate in seconds
---@param ease_function ease The ease function to animate. Default in settings.get_default_easing
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.animate_scale_by(target_scale, time, finish_event, delay, ease_function, target_url) end
--- Get the euler property of a game object and store to variable
---@param variable string The variable to store result
---@param is_every_frame boolean Repeat this action every frame
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.get_euler(variable, is_every_frame, target_url) end
--- Get the position property of a game object and store to variable
---@param variable string The variable to store result
---@param is_every_frame boolean Repeat this action every frame
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.get_position(variable, is_every_frame, target_url) end
--- Get the rotation property of a game object and store to variable
---@param variable string The variable to store result
---@param is_every_frame boolean Repeat this action every frame
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.get_rotation(variable, is_every_frame, target_url) end
--- Get the scale property of a game object and store to variable
---@param variable string The variable to store result
---@param is_every_frame boolean Repeat this action every frame
---@param target_url url The object to apply transform
---@return ActionInstance
function actions__transform.get_scale(variable, is_every_frame, target_url) end
--- Sets the euler of a game object
---@param target_euler vector3 The euler vector
---@param is_every_frame boolean Repeat this action every frame