summaryrefslogtreecommitdiff
path: root/example/scripts/npcs/shaker.lua
diff options
context:
space:
mode:
Diffstat (limited to 'example/scripts/npcs/shaker.lua')
-rw-r--r--example/scripts/npcs/shaker.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/example/scripts/npcs/shaker.lua b/example/scripts/npcs/shaker.lua
index ac6b152a..768fc126 100644
--- a/example/scripts/npcs/shaker.lua
+++ b/example/scripts/npcs/shaker.lua
@@ -15,8 +15,8 @@ function shaker_update(npc)
if shake_count > 20 then
shake_count = 0
- center_x = mana.posX(npc)
- center_y = mana.posY(npc)
+ center_x = posX(npc)
+ center_y = posY(npc)
tremor(center_x, center_y, 300)
end
end
@@ -28,17 +28,17 @@ function square(x)
end
function tremor (center_x, center_y, intensity)
- for dummy, object in ipairs(mana.get_beings_in_circle(center_x, center_y, intensity)) do
- if mana.being_type(object) == TYPE_CHARACTER then
- object_x = mana.posX(object)
- object_y = mana.posY(object)
+ for dummy, object in ipairs(get_beings_in_circle(center_x, center_y, intensity)) do
+ if being_type(object) == TYPE_CHARACTER then
+ object_x = posX(object)
+ object_y = posY(object)
dist_x = object_x - center_x
dist_y = object_y - center_y
dist = math.sqrt(square(dist_x) + square(dist_y))
intensity_local = intensity - dist
intensity_x = (intensity - dist) * (dist_x / dist) / 5
intensity_y = (intensity - dist) * (dist_y / dist) / 5
- mana.chr_shake_screen(object, intensity_x, intensity_y)
+ chr_shake_screen(object, intensity_x, intensity_y)
end
end
end