Additions to animations system
This commit is contained in:
parent
74be5f13a1
commit
a372921d35
27
api.lua
27
api.lua
@ -1001,6 +1001,8 @@ minetest.register_entity(name, {
|
|||||||
|
|
||||||
--NSSM parameters
|
--NSSM parameters
|
||||||
|
|
||||||
|
double_melee_attack = def.double_melee_attack or false,
|
||||||
|
|
||||||
on_dist_attack = def.on_dist_attack,
|
on_dist_attack = def.on_dist_attack,
|
||||||
metamorphosis = def.metamorphosis or false,
|
metamorphosis = def.metamorphosis or false,
|
||||||
metatimer = 0,
|
metatimer = 0,
|
||||||
@ -1825,27 +1827,22 @@ minetest.register_entity(name, {
|
|||||||
|
|
||||||
set_velocity(self, 0)
|
set_velocity(self, 0)
|
||||||
|
|
||||||
--NSSM modifications:
|
|
||||||
--modifications to add multiple melee attack animations
|
|
||||||
--ATTACK ANIMATIONS:
|
|
||||||
if self.mele_number>1 then
|
|
||||||
if randattack==1 then
|
|
||||||
set_animation(self, "punch")
|
|
||||||
else
|
|
||||||
local attack = "punch"..(randattack-1)
|
|
||||||
set_animation(self, attack)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
set_animation(self, "punch")
|
|
||||||
end
|
|
||||||
|
|
||||||
--modifications to add special attacks to some monster:
|
--modifications to add special attacks to some monster:
|
||||||
if not def.custom_attack then
|
if not self.custom_attack then
|
||||||
|
|
||||||
if self.timer > 1 then
|
if self.timer > 1 then
|
||||||
|
|
||||||
self.timer = 0
|
self.timer = 0
|
||||||
|
|
||||||
|
--NSSM modifications:
|
||||||
|
--modifications to add multiple melee attack animations
|
||||||
|
|
||||||
|
if self.double_melee_attack and math.random(1,2)==1 then
|
||||||
|
set_animation(self, "punch1")
|
||||||
|
else
|
||||||
|
set_animation(self, "punch")
|
||||||
|
end
|
||||||
|
|
||||||
local p2 = p
|
local p2 = p
|
||||||
local s2 = s
|
local s2 = s
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user