File: reappear.lua

package info (click to toggle)
scummvm 2.7.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 363,784 kB
  • sloc: cpp: 3,622,060; asm: 27,410; python: 10,528; sh: 10,241; xml: 6,752; java: 5,579; perl: 2,570; yacc: 1,635; javascript: 1,016; lex: 539; makefile: 398; ansic: 378; awk: 275; objc: 82; sed: 11; php: 1
file content (25 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (4)
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
local caster = magic_get_caster()

local loc = select_location_with_prompt("Location: ")

magic_casting_fade_effect(caster)

if loc == nil or g_vanish_obj.obj_n == 0 then magic_no_effect() return end

local hit_x, hit_y =  map_line_hit_check(caster.x, caster.y, loc.x, loc.y, loc.z)
projectile(0x17f, caster.x, caster.y, hit_x, hit_y, 2)

if hit_x ~= loc.x or hit_y ~= loc.y then magic_blocked() return end

local obj = Obj.new(g_vanish_obj.obj_n, g_vanish_obj.frame_n)
obj.qty = 1
obj.status = 0x21 --OK, TEMP
if map_can_put_obj(loc) == false then
	magic_no_effect()
else
	Obj.moveToMap(obj, loc)
	fade_obj_in(obj)
	g_vanish_obj.obj_n = 0
	g_vanish_obj.frame_n = 0
	magic_success()
end