Date: 2017/05/02 10:28:15 UTC-07:00
Type: Denizen Script
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
lama:
type: world
debug: false
events:
on player tames llama:
- flag player lamaridbar
on player right clicks llama:
- if <player.has_flag[lamaridbar]> {
- mount <player>|<context.entity> <context.entity.location>
- adjust <context.entity> has_ai:false
}
on player steers llama:
- if <context.jump> {
- flag player llamaj.ShouldJump:true
}
- flag player ridallama.JumpCooldown:--
- flag player ridallama.TickCooldown:--
- if <player.flag[ridallama.TickCooldown]||0> > 0 {
- flag player ridallama.Forward:+:<context.forward>
- flag player ridallama.Sideways:+:<context.sideways>
- if <context.dismount> {
- adjust <context.entity> has_ai:true
}
- queue clear
}
- flag player ridallama.TickCooldown:5
- define dividing <tern[<context.entity.is_on_ground>]:8||64>
- if <context.dismount> {
- define dividing <def[dividing].div[10]>
- determine passively cancelled
}
- define forward <context.forward.add[<player.flag[ridallama.Forward]||0>].div[<def[dividing]>]>
- define sideways <context.sideways.add[<player.flag[ridallama.Sideways]||0>].div[<def[dividing]>]>
- define looking <player.location.direction.vector.sub[0,<player.location.direction.vector.y>,0]>
- define velocity <def[looking].mul[<def[forward]>].add[<def[looking].rotate_around_y[<el@90.to_radians>].mul[<def[sideways]>]>]>
- flag player ridallama.Forward:0
- flag player ridallama.Sideways:0
- if <player.flag[ridallama.ShouldJump]||false> {
- if <context.entity.is_on_ground> && <player.flag[ridallama.JumpCooldown]||0> <= 0 {
- define velocity <def[velocity].add[0,0.5,0]>
- flag player ridallama.JumpCooldown:10
}
- flag player ridallama.ShouldJump:false
}
- define length <def[velocity].vector_length>
- if <def[length]> > 0.01 {
- look <context.entity> <context.entity.location.add[<def[velocity]>]>
- adjust <context.entity> velocity:<context.entity.velocity.add[<def[velocity]>]>
- flag server ridallama.TotalDistance:+:<def[length]>
}