-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstone_giant.lua
79 lines (71 loc) · 1.61 KB
/
stone_giant.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
--[[
Copyright (c) 2016-2019 - Auke Kok <[email protected]>
* entity_ai is licensed as follows:
- All code is: LGPL-2.1
- All artwork is: CC-BY-SA-4.0
--]]
--
-- stone giant entity AI script
--
local stone_giant_script = {
-- the start driver. Should be able to spawn a monster with a different driver!
driver = "roam",
-- default properties
properties = {
speed = 0.666,
hp_max = 20,
habitatnodes = {
"group:stone",
"group:cracky",
"default:sand"
,}
},
-- defined animation sets:
-- "name" = { animationspec1, animationspec2, animationspec3 .. }
-- each must be present -> 'nil' required
-- last animation should have 'frame_loop = true'
--FIXME handle repeats (running animation 5x ?)
animations = {
move = {
{{x = 216, y = 240}, frame_speed = 24, frame_loop = false},
{{x = 240, y = 320}, frame_speed = 24, frame_loop = true},
},
idle = {
{{x = 120, y = 216}, frame_speed = 24, frame_loop = true},
},
punch = {
{{x = 329, y = 367}, frame_speed = 24, frame_loop = false},
},
smash = {
{{x = 367, y = 420}, frame_speed = 24, frame_loop = false},
},
death = {
{{x = 420, y = 453}, frame_speed = 24, frame_loop = false},
},
},
-- sound samples
sounds = {
},
-- monster script states:
roam = {
finders = {
"find_habitat",
},
factors = {},
},
idle = {
factors = {},
},
death = {
sounds = {
start = "hurt",
},
},
}
entity_ai.register_entity("entity_ai:stone_giant", {
script = stone_giant_script,
mesh = "stone_giant.b3d",
textures = {"stone_giant.png"},
makes_footstep_sound = true,
collisionbox = {-1/2, -1/2, -1/2, 1/2, 1, 1/2},
})