-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathomg_player.verse
85 lines (69 loc) · 2.74 KB
/
omg_player.verse
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
using { /Fortnite.com/Characters }
using { /Verse.org/Simulation }
using { /Fortnite.com/Devices }
omg_player := class<unique>():
var MaxHealth :float = 100.0;
var MaxMana :float = 100.0;
var CurrentHealth :float = 100.0;
var Eliminated: logic = false
@editable var VFXSpawner : vfx_spawner_device = vfx_spawner_device{}
@editable var DamageDevice: damage_volume_device = damage_volume_device{}
@editable var DeviceMover: creative_prop = creative_prop{}
# @editable var SuperButton: button_device = button_device{}
@editable var SFXPlayer:audio_player_device = audio_player_device{}
Player:player;
FortChar : fort_character
# Parameters for `fort_character.PutInStasis` function.
Setup():void = {
Print("Setting up omg player...")
# TODO create magic related devices
# VFXSpawner = SpawnProp(Asset:creative_prop_asset, Position:vector3, Rotation:rotation)(vfx_spawner_device)
# TODO subscribe to duck and jump, sprint events
# FortChar.PutInStasis(stasis_args{AllowTurning:= false, AllowFalling:=true, AllowEmotes:=true })
FortChar.SprintedEvent().Subscribe(OnSprinted)
FortChar.JumpedEvent().Subscribe(OnJumped)
FortChar.CrouchedEvent().Subscribe(OnCrouched)
# set up timers to poll player states
# show combo UI
# take over damage handling
spawn:
PrintStateCoroutine()
}
PrintStateCoroutine()<suspends> :void = {
loop:
if (FortChar.IsActive[])
then:
var IsCrouching: logic = false
Print("FortChar is active")
if (FortChar.IsCrouching[]){ set IsCrouching = true;}
if (FortChar.IsFalling[])
then:
Print("FortChar is falling")
else:
Print("FortChar is not falling")
Print("is crouching: {IsCrouching.ToString()}")
else:
Print("FortChar is not active")
Sleep(1.0)
}
OnSprinted(SprintChar:fort_character, OnOff:logic):void = {
# TODO play sprint one-time vfx
Print("Sprinted event triggered...")
# TODO play sprint loop vfx
Transform:= SprintChar.GetTransform
Print("Sprint transform:")
}
OnJumped(JumpChar:fort_character):void = {
# TODO play jump one-time vfx
Print("Jumped event triggered...")
# TODO play jump loop vfx
}
OnCrouched(CrouchChar:fort_character, OnOff:logic):void = {
# TODO play crouch one-time vfx
Print("Crouched event triggered...")
# TODO play crouch loop vfx
}
Dispose():void = {
# TODO clean all the omg vfx
}
# set Eliminated := true