mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-03 07:11:49 +00:00
NUVIE: JANITORIAL: Remove trailing whitepaces in Lua scripts
This commit is contained in:
parent
86b42201f4
commit
1bbcf24d40
@ -1,7 +1,7 @@
|
||||
ALIGNMENT_DEFAULT = 0
|
||||
ALIGNMENT_NEUTRAL = 1
|
||||
ALIGNMENT_EVIL = 2
|
||||
ALIGNMENT_GOOD = 3
|
||||
ALIGNMENT_GOOD = 3
|
||||
ALIGNMENT_CHAOTIC = 4
|
||||
|
||||
HEAD = 0
|
||||
@ -35,7 +35,7 @@ end
|
||||
function get_weapon_range(obj_n)
|
||||
|
||||
local range = g_range_weapon_tbl[obj_n]
|
||||
|
||||
|
||||
if range == nil then
|
||||
return 1
|
||||
end
|
||||
@ -48,13 +48,13 @@ function actor_randomise_stat(base_stat)
|
||||
if tmp == 0 then
|
||||
return base_stat
|
||||
end
|
||||
|
||||
|
||||
return math.random(0, tmp) + math.random(0, tmp) + base_stat - tmp
|
||||
end
|
||||
|
||||
function actor_is_holding_obj(actor, obj_n)
|
||||
local hand
|
||||
|
||||
|
||||
hand = Actor.inv_get_readied_obj_n(actor, HAND)
|
||||
if hand == obj_n then
|
||||
return true
|
||||
@ -63,8 +63,8 @@ function actor_is_holding_obj(actor, obj_n)
|
||||
if hand == obj_n then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function actor_has_free_arm(actor)
|
||||
|
@ -8,7 +8,7 @@ DIR_EAST = 1
|
||||
DIR_SOUTH = 2
|
||||
DIR_WEST = 3
|
||||
DIR_NORTHEAST = 4
|
||||
DIR_SOUTHEAST = 5
|
||||
DIR_SOUTHEAST = 5
|
||||
DIR_SOUTHWEST = 6
|
||||
DIR_NORTHWEST = 7
|
||||
DIR_NONE = 8
|
||||
@ -55,7 +55,7 @@ function get_direction(prompt)
|
||||
if prompt ~= nil then
|
||||
print(prompt)
|
||||
end
|
||||
|
||||
|
||||
local dir = coroutine.yield("dir")
|
||||
|
||||
return dir
|
||||
@ -83,7 +83,7 @@ function direction_string(dir)
|
||||
if dir == DIR_WEST then return "west" end
|
||||
if dir == DIR_NORTHWEST then return "northwest" end
|
||||
end
|
||||
|
||||
|
||||
return "unknown"
|
||||
end
|
||||
|
||||
@ -98,7 +98,7 @@ local dir_rev_tbl =
|
||||
[DIR_WEST] = DIR_EAST,
|
||||
[DIR_NORTHWEST] = DIR_SOUTHEAST
|
||||
}
|
||||
|
||||
|
||||
function direction_reverse(dir) return dir_rev_tbl[dir] end
|
||||
|
||||
local g_dir_offset_tbl =
|
||||
@ -122,7 +122,7 @@ function abs(val)
|
||||
if val < 0 then
|
||||
return -val
|
||||
end
|
||||
|
||||
|
||||
return val
|
||||
end
|
||||
|
||||
@ -139,7 +139,7 @@ end
|
||||
|
||||
function play_midgame_sequence(seq_num)
|
||||
local ui_style = game_get_ui_style()
|
||||
|
||||
|
||||
canvas_show()
|
||||
canvas_hide_all_sprites()
|
||||
canvas_set_opacity(0xff);
|
||||
@ -148,10 +148,10 @@ function play_midgame_sequence(seq_num)
|
||||
|
||||
local bg = sprite_new(nil, 8, 16, true)
|
||||
local avatar = sprite_new(nil, 8, 16, false)
|
||||
|
||||
|
||||
local text_sprite
|
||||
--local text_sprite_bg
|
||||
|
||||
|
||||
if ui_style == UI_STYLE_ORIG then
|
||||
canvas_set_solid_bg(false)
|
||||
else
|
||||
@ -172,9 +172,9 @@ function play_midgame_sequence(seq_num)
|
||||
local midgame_data = midgame_load("midgame"..string.format("%x", seq_num)..".lzc")
|
||||
local i = 0
|
||||
local data = midgame_data[i]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
while data ~= nil do
|
||||
bg.image = data.images[0]
|
||||
if data.images[1] ~= nil then
|
||||
@ -184,7 +184,7 @@ function play_midgame_sequence(seq_num)
|
||||
else
|
||||
avatar.visible = false
|
||||
end
|
||||
|
||||
|
||||
local j = 0
|
||||
local text = data.text[j]
|
||||
while text ~= nil do
|
||||
@ -223,17 +223,17 @@ end
|
||||
|
||||
function get_wrapped_dist(pt1, pt2)
|
||||
local diff
|
||||
|
||||
|
||||
if pt2 >= pt1 then
|
||||
diff = pt2 - pt1
|
||||
else
|
||||
diff = pt1 - pt2
|
||||
end
|
||||
|
||||
|
||||
if diff > 512 then
|
||||
diff = 1024 - diff
|
||||
end
|
||||
|
||||
|
||||
return diff
|
||||
end
|
||||
|
||||
@ -244,7 +244,7 @@ function get_anim_index_for_tile(tile_number)
|
||||
return i
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
@ -265,9 +265,9 @@ function altcode_242_set_actor_talk_flag()
|
||||
print(" is "..value_str..".\n")
|
||||
print("New value? ")
|
||||
value = input_select_integer(nil, true)
|
||||
|
||||
|
||||
value_str = "off"
|
||||
|
||||
|
||||
if value == 1 or value == "o" then
|
||||
value_str = "on"
|
||||
Actor.set_talk_flag(actor, bit)
|
||||
@ -286,13 +286,13 @@ function altcode_250_create_object()
|
||||
if tmp_obj ~= nil and tmp_obj.tile_num - obj.tile_num > 1 then
|
||||
print("\nFrame:0x")
|
||||
input = input_select(nil, true)
|
||||
obj.frame_n = tonumber(input, 16)
|
||||
obj.frame_n = tonumber(input, 16)
|
||||
end
|
||||
|
||||
|
||||
print("\nQual:0x")
|
||||
input = input_select(nil, true)
|
||||
obj.quality = tonumber(input, 16)
|
||||
|
||||
|
||||
if obj.stackable or create_object_needs_quan(obj_n) then
|
||||
print("\nQuan:0x")
|
||||
input = input_select(nil, true)
|
||||
@ -395,5 +395,3 @@ lua_file();
|
||||
lang_init("game")
|
||||
|
||||
lua_file = nuvie_load("common/actor.lua"); lua_file();
|
||||
|
||||
|
||||
|
@ -134,7 +134,7 @@ function fade_in(speed)
|
||||
if speed == nil then
|
||||
speed = 3
|
||||
end
|
||||
|
||||
|
||||
local i
|
||||
for i=0x0,0xff,speed do
|
||||
canvas_set_opacity(i)
|
||||
@ -152,7 +152,7 @@ function fade_out(speed)
|
||||
if speed == nil then
|
||||
speed = 3
|
||||
end
|
||||
|
||||
|
||||
local i
|
||||
for i=0xff,0,-speed do
|
||||
canvas_set_opacity(i)
|
||||
@ -178,7 +178,7 @@ local rand = math.random
|
||||
players[7].image = img_tbl[7][rand(0,4)]
|
||||
players[8].image = img_tbl[8][rand(0,4)]
|
||||
players[9].image = img_tbl[9][rand(0,3)]
|
||||
|
||||
|
||||
end
|
||||
|
||||
function create_player_sprite(image, x, y)
|
||||
@ -220,7 +220,7 @@ function fireworks_update(exp_tbl, img_tbl)
|
||||
v[1].image = img_tbl[11][8*v[2]+v[3]]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return exp_finished
|
||||
end
|
||||
|
||||
@ -243,16 +243,16 @@ function fireworks(img_tbl, logo)
|
||||
exp_count = exp_count - num_finished
|
||||
poll_for_esc(1)
|
||||
end
|
||||
|
||||
|
||||
--wait for remaining explosions to finish
|
||||
while exp_count > 0 do
|
||||
local num_finished = fireworks_update(exp_tbl, img_tbl)
|
||||
exp_count = exp_count - num_finished
|
||||
poll_for_esc(1)
|
||||
end
|
||||
|
||||
|
||||
poll_for_esc(10)
|
||||
|
||||
|
||||
-- create final 30 explosions.
|
||||
for i=1,30 do
|
||||
local exp = create_firework(img_tbl)
|
||||
@ -272,21 +272,21 @@ function display_image_table(img_tbl, x, y)
|
||||
if x == nil then
|
||||
x = 160
|
||||
end
|
||||
|
||||
|
||||
if y == nil then
|
||||
y = 100
|
||||
end
|
||||
|
||||
|
||||
local sprite = sprite_new(nil, x, y, true)
|
||||
|
||||
|
||||
local text_sprite = sprite_new(nil, 100, 180, true)
|
||||
|
||||
|
||||
local i = 0
|
||||
for k,v in pairs(img_tbl) do
|
||||
if type(v) == "table" then
|
||||
local j = 0
|
||||
for l,m in pairs(v) do
|
||||
|
||||
|
||||
local img = image_new(50,20)
|
||||
text_sprite.image = img
|
||||
image_print(img, "("..k..","..l..")", 0, 50, 0, 8, 0x6)
|
||||
@ -307,11 +307,11 @@ end
|
||||
|
||||
function about_martian_dreams()
|
||||
canvas_hide_all_sprites()
|
||||
local bg = sprite_new(image_load("mars.lzc", 0), 0, 24, true)
|
||||
|
||||
local bg = sprite_new(image_load("mars.lzc", 0), 0, 24, true)
|
||||
|
||||
local text_tbl = text_load("scenetxt.lzc", 4)
|
||||
music_play("mdd_mus.lzc", 8)
|
||||
|
||||
|
||||
local sprites = {}
|
||||
local i
|
||||
for i=0,81 do
|
||||
@ -319,18 +319,18 @@ function about_martian_dreams()
|
||||
s.text_color = 6
|
||||
s.text = text_tbl[i]
|
||||
table.insert(sprites, s)
|
||||
|
||||
|
||||
s = sprite_new(nil, 12, 152 + i * 14, true)
|
||||
s.text_color = 14
|
||||
s.text = text_tbl[i]
|
||||
table.insert(sprites, s)
|
||||
end
|
||||
|
||||
|
||||
--black bars for the top and bottom of the screen.
|
||||
--These hide the text as it is scrolling in and out.
|
||||
sprite_new(image_new(220, 24, 0), 0, 0, true)
|
||||
sprite_new(image_new(220, 24, 0), 0, 0, true)
|
||||
sprite_new(image_new(220, 48, 0), 0, 152, true)
|
||||
|
||||
|
||||
--scroll the text up the screen
|
||||
for i=0,90*14 do
|
||||
local j
|
||||
@ -345,4 +345,4 @@ function about_martian_dreams()
|
||||
end
|
||||
music_stop()
|
||||
fade_out()
|
||||
end
|
||||
end
|
||||
|
@ -9,7 +9,7 @@ function lang_init(lang_type)
|
||||
if lang_type ~= "intro" then
|
||||
lang_type = "game"
|
||||
end
|
||||
|
||||
|
||||
lang_en = nuvie_load(string.lower(game_type).."/lang/en/"..lang_type..".lua")
|
||||
|
||||
if lang_en == nil then
|
||||
@ -17,7 +17,7 @@ function lang_init(lang_type)
|
||||
else
|
||||
lang_en = lang_en()
|
||||
end
|
||||
|
||||
|
||||
if lang_selected ~= "en" then
|
||||
lang = nuvie_load(string.lower(game_type).."/lang/"..lang_selected.."/"..lang_type..".lua")
|
||||
if lang == nil then
|
||||
|
@ -1,6 +1,6 @@
|
||||
io.stderr:write("actor.lua get here\n")
|
||||
|
||||
--Worktypes
|
||||
--Worktypes
|
||||
WT_NOTHING = 0x0 --do nothing
|
||||
|
||||
WT_FOLLOW = 0x1 --follow avatar (in party)
|
||||
@ -132,25 +132,25 @@ function actor_is_affected_by_purple_berries(actor_num)
|
||||
if actor_num < 16 and timer_get(actor_num*3) > 0 then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function actor_is_affected_by_green_berries(actor_num)
|
||||
|
||||
|
||||
if actor_num < 16 and timer_get(actor_num*3+1) > 0 then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function actor_is_affected_by_brown_berries(actor_num)
|
||||
|
||||
|
||||
if actor_num < 16 and timer_get(actor_num*3+2) > 0 then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -158,7 +158,7 @@ function actor_get_purple_berry_count(actor_num)
|
||||
if actor_num < 16 then
|
||||
return timer_get(actor_num*3)
|
||||
end
|
||||
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
@ -166,7 +166,7 @@ function actor_get_green_berry_count(actor_num)
|
||||
if actor_num < 16 then
|
||||
return timer_get(actor_num*3+1)
|
||||
end
|
||||
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
@ -174,7 +174,7 @@ function actor_get_brown_berry_count(actor_num)
|
||||
if actor_num < 16 then
|
||||
return timer_get(actor_num*3+2)
|
||||
end
|
||||
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
@ -183,12 +183,12 @@ function actor_decrement_berry_counter(actor, berry_type)
|
||||
local count = timer_get(actor_num*3+berry_type)
|
||||
if count > 0 and math.random(1, actor_int_adj(actor) * 4) == 1 then
|
||||
timer_set(actor_num*3+berry_type, count - 1)
|
||||
if (actor_num == 0 and g_in_dream_mode) or
|
||||
if (actor_num == 0 and g_in_dream_mode) or
|
||||
(actor_num ~= 0 and g_in_dream_mode == false) then
|
||||
play_md_sfx(0x32)
|
||||
printl("A_PSYCHIC_POWER_FADES")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function actor_decrement_berry_counters(actor)
|
||||
@ -262,16 +262,16 @@ function actor_init(actor, alignment)
|
||||
actor.level = 1
|
||||
actor.align = ALIGNMENT_CHAOTIC
|
||||
end
|
||||
|
||||
|
||||
if alignment ~= nil and alignment ~= ALIGNMENT_DEFAULT then
|
||||
actor.align = alignment
|
||||
end
|
||||
|
||||
|
||||
actor.wt = 8
|
||||
actor.combat_mode = 8
|
||||
actor.mpts = actor.dex
|
||||
actor.exp = 0
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -660,15 +660,15 @@ function actor_move(actor, direction, flag)
|
||||
end
|
||||
|
||||
local did_move = Actor.move(actor, x, y, z)
|
||||
|
||||
|
||||
--FIXME need more logic here.
|
||||
--footprints, bots etc.
|
||||
|
||||
|
||||
if did_move then
|
||||
subtract_map_movement_pts(actor)
|
||||
----dgb("actor_move() did move actor("..actor.x..","..actor.y..")\n");
|
||||
end
|
||||
|
||||
|
||||
return did_move
|
||||
end
|
||||
|
||||
@ -751,7 +751,7 @@ end
|
||||
|
||||
function avatar_falls_unconscious()
|
||||
printl("OVERCOME_BY_YOUR_WOUNDS_YOU_FALL_UNCONSCIOUS")
|
||||
|
||||
|
||||
fade_out()
|
||||
|
||||
local input
|
||||
@ -772,18 +772,18 @@ function avatar_falls_unconscious()
|
||||
location = i18n("THE_SPACE_CAPSULE")
|
||||
target={x=0x19d,y=0x278,z=0}
|
||||
end
|
||||
|
||||
|
||||
printfl("YOU_AWAKEN_BACK_AT_FEELING_RESTORED", location)
|
||||
|
||||
input_select(nil, true)
|
||||
|
||||
party_resurrect_dead_members()
|
||||
|
||||
|
||||
for actor in party_members() do
|
||||
actor.hp = actor.max_hp
|
||||
actor.mpts = actor_dex_adj(actor)
|
||||
end
|
||||
|
||||
|
||||
party_move(target)
|
||||
local hour = clock_get_hour()
|
||||
local minutes = clock_get_minute()
|
||||
@ -793,15 +793,15 @@ function avatar_falls_unconscious()
|
||||
else
|
||||
hour = 24 - (hour + 1) + 7
|
||||
end
|
||||
|
||||
|
||||
clock_inc(hour * 60 + minutes + math.random(0,59)) --advance time to between 7am and 8am on the next day
|
||||
update_watch_tile()
|
||||
advance_time(0)
|
||||
|
||||
|
||||
party_update_leader()
|
||||
party_set_combat_mode(false)
|
||||
party_set_party_mode()
|
||||
|
||||
|
||||
local blood = Actor.get(0x12)
|
||||
if blood.alive then
|
||||
Actor.set_talk_flag(blood, 5)
|
||||
@ -853,13 +853,13 @@ function party_update()
|
||||
revive_avatar()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function actor_update_all()
|
||||
party_update()
|
||||
--pathfinding here.
|
||||
|
||||
|
||||
local actor
|
||||
local selected_actor
|
||||
repeat
|
||||
@ -870,13 +870,13 @@ function actor_update_all()
|
||||
local player_loc = player_get_location()
|
||||
local var_C = (player_loc.x - 16) - (player_loc.x - 16) % 8
|
||||
local var_A = (player_loc.y - 16) - (player_loc.y - 16) % 8
|
||||
|
||||
|
||||
for actor in party_members() do
|
||||
if actor.wt == WT_FOLLOW and actor.mpts < 0 then
|
||||
actor.mpts = 0
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local player_z = player_loc.z
|
||||
for i=0,0xff do
|
||||
local actor = Actor.get(i)
|
||||
@ -908,7 +908,7 @@ function actor_update_all()
|
||||
di = actor.mpts
|
||||
dex_6 = dex_adjusted
|
||||
end
|
||||
|
||||
|
||||
if dex_adjusted <= actor.mpts then
|
||||
break
|
||||
end
|
||||
@ -916,7 +916,7 @@ function actor_update_all()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if di <= 0 then
|
||||
for i=0,0xff do
|
||||
local actor = Actor.get(i)
|
||||
@ -929,7 +929,7 @@ function actor_update_all()
|
||||
end
|
||||
advance_time(1)
|
||||
end
|
||||
|
||||
|
||||
until di > 0
|
||||
|
||||
if selected_actor.wt ~= WT_PLAYER and selected_actor.wt ~= WT_FOLLOW then
|
||||
@ -941,15 +941,15 @@ function actor_update_all()
|
||||
end
|
||||
end
|
||||
|
||||
until selected_actor.obj_n ~= 0 and selected_actor.wt == WT_PLAYER
|
||||
until selected_actor.obj_n ~= 0 and selected_actor.wt == WT_PLAYER
|
||||
|
||||
if selected_actor ~= nil then --swap player to next party member with 'command' combat worktype.
|
||||
local old_player = Actor.get_player_actor()
|
||||
player_set_actor(selected_actor)
|
||||
old_player.wt = WT_PLAYER --reset worktype to player as it gets changed to follow in Player::set_actor() :-(
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
display_prompt(true)
|
||||
end
|
||||
|
||||
@ -1073,7 +1073,7 @@ function clothing_get_warmth_rating(obj)
|
||||
if rating == nil then
|
||||
rating = 0
|
||||
end
|
||||
|
||||
|
||||
return rating
|
||||
end
|
||||
|
||||
@ -1089,29 +1089,29 @@ function is_lit_lightsource(obj)
|
||||
if lit_lightsource_tbl[obj.obj_n] ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function actor_str_adj(actor)
|
||||
local actor_num = actor.actor_num
|
||||
local str = actor.str
|
||||
|
||||
|
||||
if actor.hypoxia then
|
||||
str = str - 3
|
||||
end
|
||||
|
||||
|
||||
if actor_is_affected_by_purple_berries(actor_num) then
|
||||
str = str - 3
|
||||
end
|
||||
|
||||
|
||||
if actor.frenzy then
|
||||
str = str + 3
|
||||
if str > 30 then
|
||||
str = 30
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if str <= 3 then
|
||||
return 1
|
||||
end
|
||||
@ -1136,23 +1136,23 @@ function actor_dex_adj(actor)
|
||||
dex = 30
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if actor.asleep then
|
||||
dex = 1
|
||||
end
|
||||
|
||||
|
||||
return dex
|
||||
end
|
||||
|
||||
function actor_int_adj(actor)
|
||||
local int = actor.int
|
||||
|
||||
|
||||
if actor.hypoxia == true or (actor.frenzy and actor.actor_num ~= 1) then
|
||||
int = int - 3
|
||||
end
|
||||
|
||||
|
||||
if int < 1 then int = 1 end
|
||||
|
||||
|
||||
return int
|
||||
end
|
||||
|
||||
@ -1216,11 +1216,11 @@ function actor_remove_charm(actor)
|
||||
|
||||
actor.charmed = false;
|
||||
actor.align = actor.old_align
|
||||
|
||||
|
||||
if actor.in_party then
|
||||
actor.align = ALIGNMENT_GOOD
|
||||
end
|
||||
|
||||
|
||||
if party_is_in_combat_mode() then
|
||||
actor.wt = actor.combat_mode
|
||||
else
|
||||
@ -1239,7 +1239,7 @@ function advance_time(num_turns)
|
||||
--FIXME
|
||||
local rand = math.random
|
||||
local hour = clock_get_hour()
|
||||
|
||||
|
||||
local quake = Actor.get_talk_flag(0x46, 3) --rasputin
|
||||
|
||||
if quake then
|
||||
@ -1247,9 +1247,9 @@ function advance_time(num_turns)
|
||||
quake_start(1, 200)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local max_light = 0
|
||||
|
||||
|
||||
local actor_num
|
||||
for actor_num=0,0xff do
|
||||
local actor = Actor.get(actor_num)
|
||||
@ -1267,13 +1267,13 @@ function advance_time(num_turns)
|
||||
printfl("GASPS_FOR_AIR", actor.name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local warmth_rating = 0
|
||||
local obj
|
||||
for obj in actor_inventory(actor) do
|
||||
if obj.readied then
|
||||
warmth_rating = warmth_rating + clothing_get_warmth_rating(obj)
|
||||
|
||||
|
||||
if is_lit_lightsource(obj) then
|
||||
if rand(0, 1) == 1 then
|
||||
if obj.quality <= num_turns then
|
||||
@ -1301,7 +1301,7 @@ function advance_time(num_turns)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if g_party_is_warm or actor.z ~= 0 then
|
||||
if actor.cold then
|
||||
actor.cold = false
|
||||
@ -1309,7 +1309,7 @@ function advance_time(num_turns)
|
||||
end
|
||||
else
|
||||
local cold_status = 0
|
||||
|
||||
|
||||
if hour <= 3 or hour >= 22 then
|
||||
if warmth_rating >= 10 then
|
||||
cold_status = 1
|
||||
@ -1321,11 +1321,11 @@ function advance_time(num_turns)
|
||||
cold_status = 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if actor_num == 6 then
|
||||
cold_status = 0
|
||||
end
|
||||
|
||||
|
||||
if cold_status == 0 then
|
||||
if actor.cold then
|
||||
actor.cold = false
|
||||
@ -1355,9 +1355,9 @@ function advance_time(num_turns)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if num_turns ~= 0 then
|
||||
for i=1,num_turns do
|
||||
--FIXME what does word_4E6FA do?
|
||||
@ -1366,7 +1366,7 @@ function advance_time(num_turns)
|
||||
if actor.frenzy and not party_is_in_combat_mode() then
|
||||
actor.frenzy = false
|
||||
end
|
||||
|
||||
|
||||
if actor.poisoned then
|
||||
if rand(0, 25) == 0 then
|
||||
actor.poisoned = false
|
||||
@ -1376,13 +1376,13 @@ function advance_time(num_turns)
|
||||
if actor.charmed and rand(0, 0x19) == 0 then
|
||||
actor_remove_charm(actor)
|
||||
end
|
||||
|
||||
|
||||
if actor.paralyzed then
|
||||
if actor_num == 6 or (rand(0, 3) == 0 and actor.str >= rand(1, 0x1e)) then --FIXME used adjusted str
|
||||
actor.paralyzed = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if actor.asleep and actor.wt ~= WT_SLEEP and (not g_party_is_warm or not actor.in_party) then
|
||||
--FIXME check sub_2B0EC(actor.x,actor.y,actor.z)
|
||||
if rand(0,0x14) == 0 then
|
||||
@ -1390,14 +1390,14 @@ function advance_time(num_turns)
|
||||
--FIXME bit 3 set on 1af1 flags
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if actor.poisoned and actor_num ~= 6 and rand(0, 7) == 0 then
|
||||
actor_hit(actor, 1)
|
||||
end
|
||||
|
||||
|
||||
if actor_num < 8 then
|
||||
actor_decrement_berry_counters(actor)
|
||||
|
||||
|
||||
for obj in actor_inventory(actor, true) do
|
||||
local obj_n = obj.obj_n
|
||||
if obj_n == 160 and obj.frame_n > 1 then --OBJ_EMPTY_BUCKET with ice
|
||||
@ -1416,9 +1416,9 @@ function advance_time(num_turns)
|
||||
actor.poisoned = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@ -1426,27 +1426,27 @@ function advance_time(num_turns)
|
||||
actor.hit_flag = false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local minute = clock_get_minute()
|
||||
|
||||
clock_inc(num_turns)
|
||||
|
||||
if minute + num_turns >= 60 then
|
||||
|
||||
|
||||
update_watch_tile()
|
||||
|
||||
|
||||
update_actor_schedules()
|
||||
if g_hours_till_next_healing > 0 then
|
||||
g_hours_till_next_healing = g_hours_till_next_healing - 1
|
||||
end
|
||||
|
||||
|
||||
update_lamp_posts()
|
||||
|
||||
|
||||
local blue_berry_counter = actor_get_blue_berry_counter()
|
||||
if blue_berry_counter > 0 then
|
||||
actor_get_blue_berry_counter(blue_berry_counter - 1)
|
||||
end
|
||||
|
||||
|
||||
if not g_party_is_warm and not g_in_dream_mode and Actor.get_talk_flag(0x10, 5) then
|
||||
for actor in party_members() do
|
||||
if actor.actor_num ~= 6 and not actor.asleep then
|
||||
@ -1481,7 +1481,7 @@ function advance_time(num_turns)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@ -1499,7 +1499,7 @@ function subtract_movement_pts(actor, points)
|
||||
if points < 1 then
|
||||
points = 1
|
||||
end
|
||||
|
||||
|
||||
actor.mpts = actor.mpts - points
|
||||
end
|
||||
|
||||
@ -1513,7 +1513,7 @@ function actor_radiation_check(actor, obj)
|
||||
or Actor.inv_get_readied_obj_n(actor, ARM_2) == 136 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
actor.poisoned = true
|
||||
printl("OUCH_IT_IS_VERY_HOT")
|
||||
end
|
||||
@ -1591,11 +1591,11 @@ function actor_get_max_hp(actor)
|
||||
if actor.actor_num == 6 then
|
||||
return 0xf0
|
||||
end
|
||||
|
||||
|
||||
if actor.in_party then
|
||||
return actor.str * 2 + actor.level * 24
|
||||
end
|
||||
|
||||
|
||||
--FIXME return actor max hp from stat table.
|
||||
return 1;
|
||||
end
|
||||
@ -1682,4 +1682,4 @@ function find_rockworm_actor(obj)
|
||||
end
|
||||
|
||||
return obj
|
||||
end
|
||||
end
|
||||
|
@ -526,4 +526,4 @@ function fire_range_based_weapon(attacker, target_x, target_y, weapon)
|
||||
end
|
||||
--FIXME original updated readied weapons here. We might also need to do that.
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -289,4 +289,4 @@ function dreamworld_cleanup_state(obj)
|
||||
g_current_dream_stage = new_stage
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -11,10 +11,10 @@ function play()
|
||||
text.text_color = 4
|
||||
text.text = text_tbl[0]
|
||||
text.text_align = 2
|
||||
|
||||
|
||||
local bg = sprite_new(g_img_tbl[0][0], 0, 24, true)
|
||||
local jack = sprite_new(g_img_tbl[0][gender+1], 155, 151, true)
|
||||
|
||||
|
||||
canvas_set_palette("md_title.pal", 0)
|
||||
canvas_set_opacity(0xff);
|
||||
mouse_cursor_visible(false)
|
||||
@ -22,59 +22,59 @@ function play()
|
||||
|
||||
music_play("mdd_mus.lzc", 11)
|
||||
fade_in()
|
||||
|
||||
|
||||
poll_for_key_or_button(150)
|
||||
if should_exit() then return end
|
||||
|
||||
|
||||
text.text = text_tbl[1]
|
||||
|
||||
poll_for_key_or_button(150)
|
||||
if should_exit() then return end
|
||||
|
||||
--space capsule rockets away from mars
|
||||
|
||||
|
||||
jack.visible = false
|
||||
text.text = text_tbl[2]
|
||||
|
||||
bg.image = g_img_tbl[1][0]
|
||||
|
||||
|
||||
local capsule = create_sprite(g_img_tbl[1][1], 105, 112)
|
||||
capsule.visible = false
|
||||
local smoke = sprite_new(g_img_tbl[1][2], 105, 112, false)
|
||||
|
||||
|
||||
local i
|
||||
for i=-1,39 do
|
||||
bg.y = 23 + ((i + 3) % 4)
|
||||
bg.x = ((i + 2) % 5) - 2
|
||||
|
||||
|
||||
if i > -1 and i < 13 then
|
||||
capsule.visible = true
|
||||
capsule.x = 105 + (i * i * 2) / 3
|
||||
capsule.y = 112 - i * i
|
||||
capsule.image.scale = (i * i) + 16
|
||||
|
||||
|
||||
smoke.image = g_img_tbl[1][2 + math.floor(i/2)]
|
||||
smoke.visible = true
|
||||
else
|
||||
capsule.visible = false
|
||||
smoke.visible = false
|
||||
end
|
||||
|
||||
|
||||
poll_for_key_or_button(3)
|
||||
if should_exit() then return end
|
||||
end
|
||||
|
||||
|
||||
--capsule lands in the ocean.
|
||||
bg.image = g_img_tbl[2][0]
|
||||
bg.x = 0
|
||||
bg.y = 24
|
||||
|
||||
|
||||
capsule.visible = true
|
||||
capsule.x = 170
|
||||
capsule.y = 150
|
||||
|
||||
|
||||
text.text = text_tbl[3]
|
||||
|
||||
|
||||
for i=0,9 do
|
||||
local j
|
||||
for j=0,3 do
|
||||
@ -86,7 +86,7 @@ function play()
|
||||
if should_exit() then return end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--ticket tape parade
|
||||
canvas_set_opacity(0);
|
||||
capsule.visible = false
|
||||
@ -94,29 +94,29 @@ function play()
|
||||
bg.image = g_img_tbl[3][0]
|
||||
local spector = sprite_new(g_img_tbl[3][gender+1], 190, 151, true)
|
||||
text.text = text_tbl[5]
|
||||
|
||||
|
||||
fade_in(6)
|
||||
|
||||
|
||||
poll_for_key_or_button(150)
|
||||
if should_exit() then return end
|
||||
|
||||
|
||||
|
||||
|
||||
--group photo.
|
||||
canvas_set_opacity(0);
|
||||
spector.visible = false
|
||||
|
||||
|
||||
bg.image = g_img_tbl[4][0]
|
||||
|
||||
|
||||
local moongate_tbl = image_load_all("moongate.lzc")
|
||||
local moongate = sprite_new(moongate_tbl[1][0], 35, 135, true)
|
||||
local group = sprite_new(g_img_tbl[4][gender+1], 195, 151, true)
|
||||
|
||||
|
||||
local photographer = sprite_new(g_img_tbl[4][3], 75, 151, true)
|
||||
|
||||
text.text = text_tbl[6]
|
||||
|
||||
fade_in(6)
|
||||
|
||||
|
||||
for i=0,79 do
|
||||
if i == 40 then
|
||||
moongate.visible = false
|
||||
@ -140,37 +140,37 @@ function play()
|
||||
if i == 41 then
|
||||
text.text = text_tbl[7]
|
||||
end
|
||||
|
||||
|
||||
poll_for_key_or_button(3)
|
||||
if should_exit() then return end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--mars dust storm
|
||||
|
||||
|
||||
moongate.visible = false
|
||||
group.visible = false
|
||||
photographer.visible = false
|
||||
|
||||
|
||||
bg.image = g_img_tbl[5]
|
||||
|
||||
|
||||
local sand = sprite_new(nil, 240, 140, true)
|
||||
local tree = sprite_new(nil, 0, 140, true)
|
||||
|
||||
|
||||
local dust = create_sprite(g_img_tbl[6], 0, 24)
|
||||
local dust1 = create_sprite(g_img_tbl[6], 0, 24)
|
||||
local dust2 = create_sprite(g_img_tbl[6], 0, 24)
|
||||
local dust3 = create_sprite(g_img_tbl[6], 0, 24)
|
||||
local dust4 = create_sprite(g_img_tbl[6], 0, 24)
|
||||
|
||||
|
||||
dust.visible = true
|
||||
dust1.visible = true
|
||||
dust2.visible = true
|
||||
dust3.visible = true
|
||||
dust4.visible = true
|
||||
|
||||
|
||||
text.text = text_tbl[8]
|
||||
|
||||
|
||||
for i=0,63 do
|
||||
if math.floor(i / 8) > 4 then
|
||||
sand.image = g_img_tbl[7][4]
|
||||
@ -186,10 +186,10 @@ function play()
|
||||
else
|
||||
tree.visible = false
|
||||
end
|
||||
|
||||
|
||||
dust.x = 340 - (i * 10) - math.random(0, 19)
|
||||
dust.y = 24 - math.random(0, 9)
|
||||
|
||||
|
||||
dust1.x = 420 - (i * 20) - math.random(0, 19)
|
||||
dust1.y = 24 - math.random(0, 9)
|
||||
|
||||
@ -201,11 +201,11 @@ function play()
|
||||
|
||||
dust4.x = 660 - (i * 20) - math.random(0, 19)
|
||||
dust4.y = 24 - math.random(0, 9)
|
||||
|
||||
|
||||
if i == 62 then
|
||||
text.text = text_tbl[9]
|
||||
end
|
||||
|
||||
|
||||
poll_for_key_or_button(2)
|
||||
if should_exit() then return end
|
||||
end
|
||||
@ -217,4 +217,4 @@ function play()
|
||||
end
|
||||
|
||||
|
||||
play()
|
||||
play()
|
||||
|
@ -36,7 +36,7 @@ function load_game()
|
||||
|
||||
objlist_seek(OBJLIST_OFFSET_HOURS_TILL_NEXT_HEALING)
|
||||
g_hours_till_next_healing = objlist_read1()
|
||||
|
||||
|
||||
objlist_seek(OBJLIST_OFFSET_DREAM_MODE_FLAG)
|
||||
g_in_dream_mode = bit32.btest(objlist_read2(), 0x10)
|
||||
map_enable_temp_actor_cleaning(not g_in_dream_mode)
|
||||
@ -63,7 +63,7 @@ end
|
||||
function save_game()
|
||||
objlist_seek(OBJLIST_OFFSET_HOURS_TILL_NEXT_HEALING)
|
||||
objlist_write1(g_hours_till_next_healing)
|
||||
|
||||
|
||||
objlist_seek(OBJLIST_OFFSET_DREAM_MODE_FLAG)
|
||||
local bytes = objlist_read2()
|
||||
if g_in_dream_mode then
|
||||
@ -195,7 +195,7 @@ function search(obj)
|
||||
if obj.on_map == false then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local found_obj = false
|
||||
local child
|
||||
local first_loop = true
|
||||
@ -217,18 +217,18 @@ function search(obj)
|
||||
script_wait(50)
|
||||
first_loop = false
|
||||
end
|
||||
|
||||
|
||||
if prev_obj ~= nil then
|
||||
printfl("SEARCH_LAST_OBJ", prev_obj.look_string)
|
||||
Obj.moveToMap(prev_obj, obj.x, obj.y, obj.z)
|
||||
end
|
||||
|
||||
|
||||
if found_obj == false then
|
||||
printl("SEARCHING_HERE_YOU_FIND_NOTHING")
|
||||
else
|
||||
print(".\n")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--tile_num, readied location
|
||||
@ -374,7 +374,7 @@ function update_lamp_posts()
|
||||
if Actor.get_talk_flag(0x73, 4) and (hour < 6 or hour > 17) then
|
||||
frame_n = 7
|
||||
end
|
||||
|
||||
|
||||
local loc = player_get_location()
|
||||
for obj in find_obj(loc.z, 228) do --OBJ_LAMP_POST
|
||||
if obj ~= nil then
|
||||
@ -437,4 +437,4 @@ player_init = nuvie_load("md/player.lua"); player_init();
|
||||
|
||||
worktype_init = nuvie_load("md/worktype.lua"); worktype_init();
|
||||
|
||||
dreamworld_init = nuvie_load("md/dreamworld.lua"); dreamworld_init();
|
||||
dreamworld_init = nuvie_load("md/dreamworld.lua"); dreamworld_init();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -261,4 +261,4 @@ SPRAY_GUN_WEED_KILLER="The spray gun now contains 10 charges of weed killer.\n",
|
||||
SPRAY_GUN_10_MORE_CHARGES="The spray gun has 10 more charges.\n",
|
||||
THERE_IS_NOTHING_IN_THE_GUN="There is nothing in the gun.\n",
|
||||
YOU_KILLED_THE_PLANT="You killed the plant.\n",
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ TO="A - ",
|
||||
NOTHING="nessuna cosa!\n",
|
||||
NO_EFFECT="\nNessun effetto\n",
|
||||
IT_IS_STUCK="Si e bloccato.\n"
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ function look_pocketwatch(obj)
|
||||
if am == false then
|
||||
time = "TIME_PM"
|
||||
end
|
||||
|
||||
|
||||
printfl(time, hour, minute)
|
||||
end
|
||||
|
||||
@ -28,7 +28,7 @@ function look_barrow(obj)
|
||||
printl("IT_IS_EMPTY")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local quality = obj.quality
|
||||
local material
|
||||
if quality == 1 then
|
||||
@ -40,7 +40,7 @@ function look_barrow(obj)
|
||||
elseif quality == 4 then
|
||||
material = i18n("COAL")
|
||||
end
|
||||
|
||||
|
||||
if obj.qty == 1 then
|
||||
printfl("IT_HAS_1_LOAD_OF", material)
|
||||
else
|
||||
@ -51,10 +51,10 @@ end
|
||||
function get_lat_long_string(x, y)
|
||||
local lat_str = "N"
|
||||
local long_str = "W"
|
||||
|
||||
|
||||
local lat = math.modf(((y - 512) * 240) / 1024)
|
||||
local long = math.modf(((x - 512) * 360) / 1024)
|
||||
|
||||
|
||||
if lat > 0 then
|
||||
lat_str = "S"
|
||||
else
|
||||
@ -62,7 +62,7 @@ function get_lat_long_string(x, y)
|
||||
lat_str = " "
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if long == 180 or long == -180 or long == 0 then
|
||||
long_str = " "
|
||||
else
|
||||
@ -70,10 +70,10 @@ function get_lat_long_string(x, y)
|
||||
long_str = "E"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
lat = math.abs(lat)
|
||||
long = 180 - math.abs(long)
|
||||
|
||||
|
||||
return lat..lat_str.." "..long..long_str
|
||||
end
|
||||
|
||||
@ -132,7 +132,7 @@ end
|
||||
|
||||
function look_sprayer_system(obj)
|
||||
local quality = obj.quality
|
||||
|
||||
|
||||
if bit32.btest(quality, 1) then
|
||||
local actor = Actor.get(0x3e)
|
||||
if Actor.get_talk_flag(actor, 5) == true then
|
||||
@ -163,15 +163,15 @@ end
|
||||
|
||||
function look_tracking_motor(obj)
|
||||
local quality = obj.quality
|
||||
|
||||
|
||||
if bit32.btest(quality, 1) and obj.on_map == true then
|
||||
printl("IT_APPEARS_TO_BE_LOOSE")
|
||||
end
|
||||
|
||||
|
||||
if bit32.btest(quality, 2) then
|
||||
printl("IT_APPEARS_TO_BE_BROKEN")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function look_panel(obj)
|
||||
@ -184,7 +184,7 @@ function look_panel(obj)
|
||||
printl("THESE_APPEAR_TO_BE_VALVE_CONTROLS")
|
||||
elseif frame_n == 2 then
|
||||
printl("THESE_APPEAR_TO_BE_ELECTRICAL_CONTROLS")
|
||||
end
|
||||
end
|
||||
elseif qty == 4 then
|
||||
printl("IT_APPEARS_TO_CONTROL_A_DREAM_MACHINE")
|
||||
elseif qty == 5 then
|
||||
@ -192,16 +192,16 @@ function look_panel(obj)
|
||||
elseif qty == 6 then
|
||||
printl("IT_APPEARS_TO_CONTROL_THE_RUBY_LENS_SYSTEM")
|
||||
elseif qty == 7 then
|
||||
printl("IT_APPEARS_TO_CONTROL_THE_CISTERN_VALVES")
|
||||
printl("IT_APPEARS_TO_CONTROL_THE_CISTERN_VALVES")
|
||||
else
|
||||
printl("YOU_CANNOT_DECIPHER_ITS_PURPOSE")
|
||||
end
|
||||
|
||||
|
||||
local quality = obj.quality
|
||||
if bit32.btest(quality, 1) and obj.on_map == true then
|
||||
printl("THE_PANEL_IS_LOOSE")
|
||||
end
|
||||
|
||||
|
||||
if bit32.btest(quality, 2) then
|
||||
printl("THE_PANEL_IS_BROKEN")
|
||||
end
|
||||
@ -220,9 +220,9 @@ function look_portable_sprayer(obj)
|
||||
if obj.quality == 0 then
|
||||
contents = tile_get_description(649)
|
||||
else
|
||||
contents = tile_get_description(640)
|
||||
contents = tile_get_description(640)
|
||||
end
|
||||
|
||||
|
||||
printfl("IT_IS_LOADED_WITH", contents)
|
||||
print_number_of_charges(obj.qty)
|
||||
end
|
||||
@ -237,7 +237,7 @@ function get_weapon_mode_string(obj)
|
||||
else
|
||||
mode = i18n("SHOTGUN")
|
||||
end
|
||||
|
||||
|
||||
return mode
|
||||
end
|
||||
|
||||
@ -264,11 +264,11 @@ function look_light_source(obj)
|
||||
local obj_n = obj.obj_n
|
||||
local qty = obj.qty
|
||||
local quality = obj.quality
|
||||
|
||||
|
||||
if (obj_n == 109 or obj_n == 110) and qty > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if quality > 30 then
|
||||
printl("PLENTY_OF")
|
||||
elseif quality > 6 and quality <= 30 then
|
||||
@ -280,13 +280,13 @@ function look_light_source(obj)
|
||||
else
|
||||
printl("PLENTY_OF")
|
||||
end
|
||||
|
||||
|
||||
if obj_n == 115 or obj_n == 117 or obj_n == 116 or obj_n == 118 then
|
||||
printl("FUEL")
|
||||
else
|
||||
printl("WICK")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function look_door(obj)
|
||||
@ -305,20 +305,20 @@ function look_obelisk(obj)
|
||||
if obj.quality == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local ui_style = game_get_ui_style()
|
||||
|
||||
|
||||
canvas_show()
|
||||
canvas_hide_all_sprites()
|
||||
canvas_set_opacity(0xff);
|
||||
canvas_set_update_interval(25)
|
||||
canvas_rotate_game_palette(true)
|
||||
|
||||
|
||||
local obelisk = sprite_new(nil, 184, 0, true)
|
||||
|
||||
|
||||
local text_sprite
|
||||
--local text_sprite_bg
|
||||
|
||||
|
||||
if ui_style == UI_STYLE_ORIG then
|
||||
canvas_set_solid_bg(false)
|
||||
else
|
||||
@ -329,9 +329,9 @@ function look_obelisk(obj)
|
||||
obelisk.x = 96
|
||||
obelisk.y = 41
|
||||
end
|
||||
|
||||
|
||||
obelisk.image = image_load("mdream.lzc", obj.quality-1)
|
||||
|
||||
|
||||
local input = nil
|
||||
while input == nil do
|
||||
canvas_update()
|
||||
@ -383,23 +383,23 @@ local look_usecode = {
|
||||
|
||||
function look_obj(obj)
|
||||
printfl("YOU_SEE", obj.look_string);
|
||||
|
||||
|
||||
--FIXME usecode look description should be lua code.
|
||||
if usecode_look(obj) then
|
||||
print("\n")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
print(".\n\n");
|
||||
|
||||
|
||||
if look_usecode[obj.obj_n] ~= nil then
|
||||
look_usecode[obj.obj_n](obj)
|
||||
print("\n")
|
||||
end
|
||||
|
||||
|
||||
if is_container_obj(obj.obj_n) then
|
||||
search(obj)
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
@ -346,4 +346,4 @@ function player_attack_with_weapon(weapon, target_loc)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -6,14 +6,14 @@ function open_gates_at_olympus_mons()
|
||||
else
|
||||
printl("AARGH")
|
||||
end
|
||||
|
||||
|
||||
gate = map_get_obj(0x2c4, 0x1f3, 0, 181) -- OBJ_GATE
|
||||
if gate ~= nil then
|
||||
gate.frame_n = 7
|
||||
else
|
||||
printl("AARGH")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function open_dream_machine_door()
|
||||
@ -181,4 +181,4 @@ function talk_to_obj(obj)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
@ -19,7 +19,7 @@ function use_door(obj, actor)
|
||||
printl("BLOCKED")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
obj.frame_n = bit32.bxor(obj.frame_n, 2)
|
||||
|
||||
end
|
||||
@ -79,7 +79,7 @@ function use_hammer_on_oxium_geode(obj, target_obj, actor)
|
||||
Actor.inv_add_obj(actor, oxium)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function use_prybar_on_hatch(obj, target_obj, actor)
|
||||
@ -88,20 +88,20 @@ function use_prybar_on_hatch(obj, target_obj, actor)
|
||||
printfl("IS_NOT_STRONG_ENOUGH", actor.name)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local tesla = Actor.get(16)
|
||||
if Actor.get_talk_flag(tesla, 4) == false then
|
||||
Actor.set_talk_flag(tesla, 2)
|
||||
Actor.talk(tesla)
|
||||
else
|
||||
play_midgame_sequence(1)
|
||||
|
||||
|
||||
Actor.set_talk_flag(tesla, 5)
|
||||
target_obj.obj_n = 428
|
||||
target_obj.frame_n = 0;
|
||||
target_obj.x = target_obj.x + 1
|
||||
target_obj.y = target_obj.y + 1
|
||||
|
||||
|
||||
local blood = Actor.get(18)
|
||||
Actor.set_talk_flag(blood, 3)
|
||||
Actor.set_talk_flag(blood, 6)
|
||||
@ -117,10 +117,10 @@ function use_sextant(obj, actor)
|
||||
|
||||
local lat_str = "N"
|
||||
local long_str = "W"
|
||||
|
||||
|
||||
local lat = math.modf(((actor.y - 512) * 240) / 1024)
|
||||
local long = math.modf(((actor.x - 512) * 360) / 1024)
|
||||
|
||||
|
||||
if lat > 0 then
|
||||
lat_str = "S"
|
||||
else
|
||||
@ -128,7 +128,7 @@ function use_sextant(obj, actor)
|
||||
lat_str = " "
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if long == 180 or long == -180 or long == 0 then
|
||||
long_str = " "
|
||||
else
|
||||
@ -136,7 +136,7 @@ function use_sextant(obj, actor)
|
||||
long_str = "E"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
lat = math.abs(lat)
|
||||
long = 180 - math.abs(long)
|
||||
printl("YOU_ARE_SOMEWHERE_NEAR")
|
||||
@ -149,11 +149,11 @@ function use_berry(obj, actor)
|
||||
printl("A_MECHANICAL_PERSON_CANT_EAT_BERRIES")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
play_md_sfx(0x32)
|
||||
local berry_type = obj.obj_n - 73 --OBJ_BERRY
|
||||
local first_berry = true
|
||||
|
||||
|
||||
if (berry_type == 0 and actor_is_affected_by_purple_berries(actor_num))
|
||||
or (berry_type == 1 and actor_is_affected_by_green_berries(actor_num))
|
||||
or (berry_type == 2 and actor_is_affected_by_brown_berries(actor_num)) then
|
||||
@ -178,7 +178,7 @@ function use_berry(obj, actor)
|
||||
local counter = actor_get_blue_berry_counter()
|
||||
actor_set_blue_berry_counter(counter + math.random(1, 2))
|
||||
end
|
||||
|
||||
|
||||
if obj.qty == 1 then
|
||||
Obj.removeFromEngine(obj)
|
||||
else
|
||||
@ -221,7 +221,7 @@ function get_pile_obj_num(map_tile)
|
||||
return 256 --OBJ_CHUNK_OF_ICE
|
||||
end
|
||||
|
||||
return 0 --CANNOT DIG HERE
|
||||
return 0 --CANNOT DIG HERE
|
||||
end
|
||||
|
||||
function get_free_location_around_actor(actor)
|
||||
@ -231,7 +231,7 @@ function get_free_location_around_actor(actor)
|
||||
local i
|
||||
|
||||
pos.z = actor.z
|
||||
|
||||
|
||||
for i=1,8 do
|
||||
pos.x = actor.x + x_tbl[i]
|
||||
pos.y = actor.y + y_tbl[i]
|
||||
@ -239,7 +239,7 @@ function get_free_location_around_actor(actor)
|
||||
return pos
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
@ -249,28 +249,28 @@ function use_tool_on_ground(obj, target_obj, actor, target_x, target_y, target_z
|
||||
printl("THE_GROUND_IS_NOT_CLEAR_FOR_DIGGING")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local map_tile = map_get_tile_num(target_x, target_y, target_z)
|
||||
|
||||
|
||||
local pile_obj_num = get_pile_obj_num(map_tile)
|
||||
|
||||
|
||||
if pile_obj_num == 0 then
|
||||
printl("IT_HAS_NO_EFFECT")
|
||||
return
|
||||
end
|
||||
|
||||
local hole_obj_num = 257
|
||||
|
||||
|
||||
if pile_obj_num == 256 then
|
||||
hole_obj_num = 255
|
||||
end
|
||||
|
||||
|
||||
local hole = Obj.new(hole_obj_num)
|
||||
hole.temporary = true
|
||||
Obj.moveToMap(hole, target_x, target_y, target_z)
|
||||
|
||||
local loc = get_free_location_around_actor(actor)
|
||||
|
||||
|
||||
if loc ~= nil then
|
||||
local pile = Obj.new(pile_obj_num)
|
||||
pile.temporary = true
|
||||
@ -327,7 +327,7 @@ function use_shovel_on_ore_to_container(obj, target_obj, to_obj, actor)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -337,11 +337,11 @@ function use_shovel_to_unload_container(obj, target_obj, to_obj, actor)
|
||||
play_md_sfx(5)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local ore = Obj.new(get_obj_num_from_ore_quality(target_obj.quality))
|
||||
|
||||
|
||||
--FIXME if to_obj == nil do something
|
||||
|
||||
|
||||
local success_flag = false
|
||||
if to_obj.obj_n == 268 or to_obj.obj_n == 410 then --OBJ_MARTIAN_WHEEL_BARROW
|
||||
success_flag = use_shovel_on_ore_to_container(obj, ore, to_obj, actor)
|
||||
@ -352,7 +352,7 @@ function use_shovel_to_unload_container(obj, target_obj, to_obj, actor)
|
||||
else
|
||||
--FIXME need to implement burying logic
|
||||
end
|
||||
|
||||
|
||||
if success_flag then
|
||||
target_obj.qty = target_obj.qty - 1
|
||||
if target_obj.obj_n == 410 then --OBJ_RAIL_CAR
|
||||
@ -360,14 +360,14 @@ function use_shovel_to_unload_container(obj, target_obj, to_obj, actor)
|
||||
target_obj.frame_n = target_obj.frame_n - 2
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function use_shovel_on_ore_to_furnace(obj, target_obj, to_obj, actor)
|
||||
local obj_n = target_obj.obj_n
|
||||
|
||||
|
||||
play_md_sfx(0x1b)
|
||||
|
||||
|
||||
Obj.removeFromEngine(target_obj)
|
||||
if obj_n == 444 then --OBJ_PILE_OF_COAL
|
||||
if to_obj.frame_n < 4 then
|
||||
@ -376,7 +376,7 @@ function use_shovel_on_ore_to_furnace(obj, target_obj, to_obj, actor)
|
||||
else
|
||||
printl("IT_HAS_NO_EFFECT")
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -462,7 +462,7 @@ function update_conveyor_belt(can_stop)
|
||||
return
|
||||
end
|
||||
local player_loc = player_get_location()
|
||||
|
||||
|
||||
if player_loc.z ~= 5 then
|
||||
return
|
||||
end
|
||||
@ -473,9 +473,9 @@ function update_conveyor_belt(can_stop)
|
||||
local x = 0x3c
|
||||
local y = 0x63
|
||||
local z = 5
|
||||
|
||||
|
||||
local conveyor = map_get_obj(x, y, z, 188) --OBJ_CONVEYOR_BELT
|
||||
|
||||
|
||||
while conveyor ~= nil do
|
||||
if conveyor.frame_n == 2 then
|
||||
local seam = map_get_obj(x, y, z, 189) --OBJ_CONVEYOR_BELT1
|
||||
@ -490,7 +490,7 @@ function update_conveyor_belt(can_stop)
|
||||
end
|
||||
conveyor.qty = conveyor.qty - 1
|
||||
end
|
||||
|
||||
|
||||
local seam = map_get_obj(x, y, z, 189) --OBJ_CONVEYOR_BELT1
|
||||
if seam ~= nil then
|
||||
seam.x = seam.x + 1
|
||||
@ -510,8 +510,8 @@ function update_conveyor_belt(can_stop)
|
||||
x = x - 1
|
||||
conveyor = map_get_obj(x, y, z, 188) --OBJ_CONVEYOR_BELT
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
if can_stop and Actor.get_talk_flag(0x71, 3) then
|
||||
if math.random(0, 6) == 0 then
|
||||
printl("THE_CONVEYOR_BELT_STOPS")
|
||||
@ -520,24 +520,24 @@ function update_conveyor_belt(can_stop)
|
||||
shutdown_power_update_tiles()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
function midgame_cutscene_2()
|
||||
play_midgame_sequence(2)
|
||||
|
||||
|
||||
for tower in find_obj(0, 201) do --OBJ_TOWER_TOP
|
||||
if tower.x >= 0x3d0 and tower.x <= 0x3f0 and tower.y >= 0x1d0 and tower.y <= 0x1e7 then
|
||||
tower.frame_n = 4 + (tower.frame_n % 4)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
for cable in find_obj(0, 214) do --OBJ_POWER_CABLE
|
||||
if cable.x >= 0x3d0 and cable.x <= 0x3f0 and cable.y >= 0x1d0 and cable.y <= 0x1e7 then
|
||||
cable.obj_n = 215
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function use_fixed_belt_on_bare_rollers(obj, target_obj, actor)
|
||||
@ -550,12 +550,12 @@ function use_fixed_belt_on_bare_rollers(obj, target_obj, actor)
|
||||
end
|
||||
rollers = map_get_obj(rollers.x-1,rollers.y,rollers.z, rollers.obj_n)
|
||||
end
|
||||
|
||||
|
||||
if start_obj == nil then
|
||||
printl("OOOPS_THESE_ROLLERS_CAN_NEVER_BE_FIXED")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
rollers = start_obj
|
||||
local i = 4
|
||||
while rollers ~= nil do
|
||||
@ -569,7 +569,7 @@ function use_fixed_belt_on_bare_rollers(obj, target_obj, actor)
|
||||
end
|
||||
rollers = map_get_obj(rollers.x+1,rollers.y,rollers.z, 192) --OBJ_BARE_ROLLERS
|
||||
end
|
||||
|
||||
|
||||
Obj.removeFromEngine(obj)
|
||||
Actor.set_talk_flag(0x72, 2)
|
||||
end
|
||||
@ -581,7 +581,7 @@ function use_ruby_slippers(obj, actor)
|
||||
Actor.inv_ready_obj(actor, obj)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if obj.quality == 2 then
|
||||
printl("YOU_MAY_USE_THE_RUBY_SLIPPERS_TO_GO_HOME")
|
||||
local input = input_select("yn", false)
|
||||
@ -607,7 +607,7 @@ function foes_are_nearby()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -640,7 +640,7 @@ function is_actor_able_to_talk_to_player(actor)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -661,7 +661,7 @@ function rest_level_up_actor(actor)
|
||||
if actor.actor_num > 15 then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local exp_level_tbl = {
|
||||
[0] = 0,
|
||||
[1] = 100,
|
||||
@ -677,18 +677,18 @@ function rest_level_up_actor(actor)
|
||||
if actor.exp <= exp_level_tbl[actor.level] then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
actor.level = actor.level + 1
|
||||
|
||||
|
||||
local max_hp = actor_get_max_hp(actor)
|
||||
if actor.hp + 30 > max_hp then
|
||||
actor.hp = max_hp
|
||||
else
|
||||
actor.hp = actor.hp + 30
|
||||
end
|
||||
|
||||
|
||||
Actor.show_portrait(actor)
|
||||
|
||||
|
||||
local obj_n = actor.obj_n
|
||||
local gender = math.random(0,1)
|
||||
if obj_n == 342 or obj_n == 343 or obj_n == 345 or (obj_n >= 347 and obj_n <= 353) then
|
||||
@ -696,12 +696,12 @@ function rest_level_up_actor(actor)
|
||||
elseif obj_n == 344 or obj_n == 346 or (obj_n >= 354 and obj_n <= 357) then
|
||||
gender = 1
|
||||
end
|
||||
|
||||
|
||||
local gender_pronoun = "He"
|
||||
if gender == 1 then
|
||||
gender_pronoun = "She"
|
||||
end
|
||||
|
||||
|
||||
printfl("HAS_A_DREAM", actor.name)
|
||||
printfl("SEES_THREE_STONE_OBELISKS", gender_pronoun)
|
||||
printfl("FEELS_DRAWN_TO_ONE_OF_THE_OBELISKS", gender_pronoun)
|
||||
@ -709,7 +709,7 @@ function rest_level_up_actor(actor)
|
||||
printl("WHICH_BHS")
|
||||
|
||||
local answer = input_select("bhs", false)
|
||||
|
||||
|
||||
if answer == "B" then
|
||||
if actor.int < 30 then
|
||||
actor.int = actor.int + 1
|
||||
@ -717,13 +717,13 @@ function rest_level_up_actor(actor)
|
||||
elseif answer == "H" then
|
||||
if actor.dex < 30 then
|
||||
actor.dex = actor.dex + 1
|
||||
end
|
||||
end
|
||||
elseif answer == "S" then
|
||||
if actor.str < 30 then
|
||||
actor.str = actor.str + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function use_tent(obj, actor)
|
||||
@ -738,9 +738,9 @@ function use_tent(obj, actor)
|
||||
play_md_sfx(5)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local tent_loc = {}
|
||||
|
||||
|
||||
if obj.on_map then
|
||||
tent_loc.x = obj.x
|
||||
tent_loc.y = obj.y
|
||||
@ -748,9 +748,9 @@ function use_tent(obj, actor)
|
||||
else
|
||||
tent_loc = player_get_location()
|
||||
end
|
||||
|
||||
|
||||
local x, y
|
||||
|
||||
|
||||
for y = tent_loc.y - 2, tent_loc.y do
|
||||
for x = tent_loc.x - 1, tent_loc.x + 1 do
|
||||
local map_obj = map_get_obj(x,y,tent_loc.z)
|
||||
@ -773,16 +773,16 @@ function use_tent(obj, actor)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
printl("REST")
|
||||
|
||||
|
||||
if party_is_in_combat_mode() then
|
||||
print(" - ")
|
||||
printl("NOT_WHILE_IN_COMBAT_MODE")
|
||||
play_md_sfx(5)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if foes_are_nearby() then
|
||||
printl("NOT_WHILE_FOES_ARE_NEAR")
|
||||
play_md_sfx(5)
|
||||
@ -794,8 +794,8 @@ function use_tent(obj, actor)
|
||||
printfl("IS_TOO_NEAR_TO_SETUP_CAMP", npc.name)
|
||||
play_md_sfx(5)
|
||||
return
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--poison check
|
||||
|
||||
local actor
|
||||
@ -806,7 +806,7 @@ function use_tent(obj, actor)
|
||||
printfl("IS_POISONED", actor.name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if poisoned then
|
||||
printl("DO_YOU_REALLY_WANT_TO_SLEEP")
|
||||
local answer = input_select("yn", false)
|
||||
@ -820,7 +820,7 @@ function use_tent(obj, actor)
|
||||
local actor_num = actor.actor_num
|
||||
local green = actor_is_affected_by_green_berries(actor_num)
|
||||
local brown = actor_is_affected_by_brown_berries(actor_num)
|
||||
|
||||
|
||||
if brown or green then
|
||||
party_is_using_berries = true
|
||||
if brown and green then
|
||||
@ -828,29 +828,29 @@ function use_tent(obj, actor)
|
||||
elseif brown then
|
||||
printfl("COMPLAINS_OF_TOO_MUCH_LIGHT", actor.name)
|
||||
else --green
|
||||
printfl("COMPLAINS_OF_INANIMATE_THINGS_TALKING", actor.name)
|
||||
end
|
||||
printfl("COMPLAINS_OF_INANIMATE_THINGS_TALKING", actor.name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
if party_is_using_berries then
|
||||
if party_get_size() == 1 then
|
||||
printl("YOU_CANT_SLEEP")
|
||||
else
|
||||
printl("NOBODY_CAN_SLEEP")
|
||||
end
|
||||
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local player = Actor.get_player_actor()
|
||||
player.x = tent_loc.x
|
||||
player.y = tent_loc.y
|
||||
|
||||
|
||||
local tent = Obj.new(134, 3)
|
||||
Obj.moveToMap(tent, player.x, player.y-1, player.z)
|
||||
|
||||
|
||||
tent = Obj.new(134, 5)
|
||||
Obj.moveToMap(tent, player.x+1, player.y-1, player.z)
|
||||
|
||||
@ -862,19 +862,19 @@ function use_tent(obj, actor)
|
||||
|
||||
tent = Obj.new(134, 8)
|
||||
Obj.moveToMap(tent, player.x, player.y, player.z)
|
||||
|
||||
|
||||
party_move(player.x, player.y, player.z)
|
||||
|
||||
|
||||
script_wait(500)
|
||||
|
||||
|
||||
party_hide_all()
|
||||
|
||||
|
||||
tent.frame_n = 7
|
||||
|
||||
|
||||
local hour = clock_get_hour()
|
||||
local time
|
||||
local hours_to_rest
|
||||
|
||||
|
||||
if hour < 7 or hour > 16 then
|
||||
time = i18n("SUNRISE")
|
||||
if hour < 7 then
|
||||
@ -886,27 +886,27 @@ function use_tent(obj, actor)
|
||||
time = i18n("SUNSET")
|
||||
hours_to_rest = 18 - hour
|
||||
end
|
||||
|
||||
|
||||
printfl("REST_UNTIL", time)
|
||||
local answer = input_select("yn", false)
|
||||
|
||||
|
||||
if answer == "N" or answer == "n" then
|
||||
printl("HOW_MANY_HOURS")
|
||||
hours_to_rest = input_select_integer("0123456789", true)
|
||||
end
|
||||
|
||||
|
||||
g_party_is_warm = true
|
||||
|
||||
|
||||
if g_hours_till_next_healing == 0 and hours_to_rest > 4 then
|
||||
rest_heal_party(hours_to_rest)
|
||||
g_hours_till_next_healing = 6
|
||||
end
|
||||
|
||||
|
||||
local can_level_up = false
|
||||
if hours_to_rest * 3 > party_get_size() then
|
||||
can_level_up = true
|
||||
end
|
||||
|
||||
|
||||
local i
|
||||
for i=0,hours_to_rest*3-1 do
|
||||
advance_time(20)
|
||||
@ -937,15 +937,15 @@ function use_tent(obj, actor)
|
||||
|
||||
tent.frame_n = 8 --Open the tent flap
|
||||
party_show_all()
|
||||
|
||||
|
||||
party_move(player.x, player.y + 1, player.z)
|
||||
|
||||
script_wait(500)
|
||||
|
||||
|
||||
--remove tent from map
|
||||
local z = player.z
|
||||
for tent in find_obj(z, 134) do
|
||||
if tent ~= nil and
|
||||
if tent ~= nil and
|
||||
((tent.x == tent_loc.x and tent.y == tent_loc.y-1) or
|
||||
(tent.x == wrap_coord(tent_loc.x+1,z) and tent.y == tent_loc.y-1) or
|
||||
(tent.x == wrap_coord(tent_loc.x-1,z) and tent.y == tent_loc.y) or
|
||||
@ -964,16 +964,16 @@ function use_red_berry(obj, actor)
|
||||
printl("THAT_WOULD_BE_A_WASTE_OUTSIDE_OF_COMBAT")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if actor.frenzy == false then
|
||||
printfl("ENTERS_A_BATTLE_FRENZY", actor.name)
|
||||
play_md_sfx(0x32)
|
||||
end
|
||||
|
||||
|
||||
actor.frenzy = true
|
||||
|
||||
|
||||
local qty = obj.qty
|
||||
|
||||
|
||||
if qty > 1 then
|
||||
obj.qty = qty - 1
|
||||
else
|
||||
@ -991,13 +991,13 @@ end
|
||||
|
||||
function use_gong(obj, target_obj, actor)
|
||||
printl("GONG")
|
||||
play_md_sfx(0xf)
|
||||
play_md_sfx(0xf)
|
||||
end
|
||||
|
||||
function use_musical_instrument(obj, actor)
|
||||
|
||||
local obj_n = obj.obj_n
|
||||
|
||||
|
||||
if obj_n == 280 then --OBJ_CYMBALS
|
||||
printl("CHING")
|
||||
play_md_sfx(0x36)
|
||||
@ -1027,7 +1027,7 @@ function use_wrench_on_switchbar(obj, target_obj, actor)
|
||||
printl("THE_SWITCH_IS_FASTENED")
|
||||
play_md_sfx(0x1f)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
printl("THIS_SWITCH_CANNOT_BE_FIXED")
|
||||
play_md_sfx(0x5)
|
||||
@ -1043,7 +1043,7 @@ function use_wrench_on_drill(obj, target_obj, actor)
|
||||
if target_obj.on_map then
|
||||
drill_cart = map_get_obj(target_obj.x, target_obj.y, target_obj.z, 439)
|
||||
end
|
||||
|
||||
|
||||
if drill_cart ~= nil then
|
||||
local drill = Obj.new(441,1) --assembled drill
|
||||
Obj.moveToMap(drill, target_obj.x, target_obj.y, target_obj.z)
|
||||
@ -1061,7 +1061,7 @@ function use_wrench_on_panel(obj, target_obj, actor)
|
||||
printl("IT_HAS_NO_EFFECT")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local quality = target_obj.quality
|
||||
local panel_qty = target_obj.qty
|
||||
if quality == 0 then
|
||||
@ -1096,7 +1096,7 @@ function use_wrench_on_panel(obj, target_obj, actor)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function use_oxium_bin(obj, actor)
|
||||
@ -1104,10 +1104,10 @@ function use_oxium_bin(obj, actor)
|
||||
printl("BLOCKED")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local oxium = Obj.new(131) --OBJ_BLOB_OF_OXIUM
|
||||
oxium.qty = 20
|
||||
|
||||
|
||||
if Actor.can_carry_obj(actor, oxium) then
|
||||
Actor.inv_add_obj(actor, oxium, STACK_OBJECT_QTY)
|
||||
printl("YOU_GET_TWO_HANDFULS_OF_OXIUM_FROM_THE_BIN")
|
||||
@ -1135,7 +1135,7 @@ function use_pliers_on_spool_to_tower(obj, target_obj, to_obj, actor)
|
||||
printl("THE_CABLE_DOES_NOT_NEED_REPLACEMENT")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if actor_is_holding_obj(actor, 38) == false then --OBJ_RUBBER_GLOVES
|
||||
Actor.hit(actor, math.random(0, math.floor(actor.max_hp/2)))
|
||||
local spector = Actor.get(2)
|
||||
@ -1158,7 +1158,7 @@ function use_pliers_on_spool_to_tower(obj, target_obj, to_obj, actor)
|
||||
Obj.removeFromEngine(obj)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function use_gate(obj, actor)
|
||||
@ -1179,8 +1179,8 @@ function use_gate(obj, actor)
|
||||
elseif frame_n == 6 or frame_n == 7 then
|
||||
obj.frame_n = 5
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
function use_switch_bar(obj, actor)
|
||||
@ -1189,20 +1189,20 @@ function use_switch_bar(obj, actor)
|
||||
else
|
||||
obj.frame_n = 0
|
||||
end
|
||||
|
||||
|
||||
if obj.on_map == false or map_get_obj(obj.x-1,obj.y-1,obj.z, 413) == nil then
|
||||
printl("IT_HAS_NO_EFFECT")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if obj.quality == 1 then
|
||||
printl("IT_TURNS_LOOSELY")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local turntable = map_get_obj(obj.x-1,obj.y-1,obj.z, 413)
|
||||
turntable.frame_n = obj.frame_n
|
||||
|
||||
|
||||
local railcar = map_get_obj(obj.x-1,obj.y-1,obj.z, 410)
|
||||
if railcar ~= nil then
|
||||
railcar.frame_n = railcar.frame_n - (railcar.frame_n % 2)
|
||||
@ -1318,11 +1318,11 @@ end
|
||||
function use_assembled_drill(obj, actor)
|
||||
|
||||
play_md_sfx(0x10)
|
||||
|
||||
|
||||
local x = obj.x
|
||||
local y = obj.y
|
||||
local z = obj.z
|
||||
|
||||
|
||||
if obj.frame_n == 1 then
|
||||
x = x - 1
|
||||
elseif obj.frame_n == 3 then
|
||||
@ -1332,7 +1332,7 @@ function use_assembled_drill(obj, actor)
|
||||
else
|
||||
x = x + 1
|
||||
end
|
||||
|
||||
|
||||
local target_obj
|
||||
for obj in objs_at_loc(x, y, z) do
|
||||
if obj.obj_n == 445 --OBJ_IRON_ORE
|
||||
@ -1342,13 +1342,13 @@ function use_assembled_drill(obj, actor)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if target_obj == nil then
|
||||
target_obj = map_get_obj(x, y, z, 213, true)
|
||||
end
|
||||
|
||||
|
||||
local drilled_matterial
|
||||
|
||||
|
||||
if target_obj == nil then
|
||||
if can_drill_at_loc(x, y, z) == true then
|
||||
drilled_matterial = 442 --OBJ_PILE_OF_ROCKS
|
||||
@ -1366,7 +1366,7 @@ function use_assembled_drill(obj, actor)
|
||||
elseif target_obj.obj_n == 446 then --OBJ_VEIN_OF_COAL
|
||||
drilled_matterial = 444 --OBJ_PILE_OF_COAL
|
||||
end
|
||||
|
||||
|
||||
if drilled_matterial ~= nil then
|
||||
local spoil_location = get_free_location_around_drill(obj)
|
||||
if spoil_location ~= nil then
|
||||
@ -1376,19 +1376,19 @@ function use_assembled_drill(obj, actor)
|
||||
printl("THERE_IS_NO_ROOM_LEFT_FOR_THE_ORE")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if target_obj then
|
||||
if target_obj.quality > 1 then
|
||||
target_obj.quality = target_obj.quality - 1
|
||||
else
|
||||
Obj.removeFromEngine(target_obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if drilled_matterial == nil then
|
||||
Obj.removeFromEngine(target_obj)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function get_free_location_around_drill(drill)
|
||||
@ -1398,7 +1398,7 @@ function get_free_location_around_drill(drill)
|
||||
local i
|
||||
|
||||
pos.z = drill.z
|
||||
|
||||
|
||||
for i=1,8 do
|
||||
pos.x = drill.x + x_tbl[i]
|
||||
pos.y = drill.y + y_tbl[i]
|
||||
@ -1409,7 +1409,7 @@ function get_free_location_around_drill(drill)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
@ -1419,8 +1419,8 @@ function get_ore_container_quality(ore_obj_num)
|
||||
if quality == nil then
|
||||
quality = 1
|
||||
end
|
||||
|
||||
return quality
|
||||
|
||||
return quality
|
||||
end
|
||||
|
||||
function get_obj_num_from_ore_quality(ore_quality)
|
||||
@ -1437,11 +1437,11 @@ end
|
||||
|
||||
function can_drill_at_loc(x,y,z)
|
||||
local tile_num = map_get_tile_num(x, y, z)
|
||||
|
||||
|
||||
if tile_num >= 0xf0 and tile_num <= 0xfb then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -1961,8 +1961,8 @@ local usecode_table = {
|
||||
--OBJ_PICK
|
||||
[65]={[255]=use_misc_text,[257]=use_misc_text}, --hole in ice, hole
|
||||
--OBJ_SHOVEL
|
||||
[66]=use_shovel_on_tbl,
|
||||
--OBJ_HOE
|
||||
[66]=use_shovel_on_tbl,
|
||||
--OBJ_HOE
|
||||
[67]={[255]=use_misc_text,[257]=use_misc_text}, --hole in ice, hole
|
||||
--OBJ_BERRY
|
||||
[73]=use_berry,
|
||||
@ -1975,7 +1975,7 @@ local usecode_table = {
|
||||
--OBJ_BERRY4
|
||||
[77]=use_red_berry,
|
||||
--OBJ_CLUMP_OF_ROUGE_BERRIES
|
||||
[78]=use_misc_text,
|
||||
[78]=use_misc_text,
|
||||
[86]=use_container,
|
||||
[87]=use_container,
|
||||
--OBJ_MANUSCRIPT
|
||||
@ -2048,7 +2048,7 @@ local usecode_table = {
|
||||
[148]=use_reading_material,
|
||||
--OBJ_NOTE
|
||||
[151]=use_reading_material,
|
||||
--OBJ_DOOR
|
||||
--OBJ_DOOR
|
||||
[152]=use_door,
|
||||
[181]=use_gate,
|
||||
--OBJ_CAMERA
|
||||
@ -2168,7 +2168,7 @@ function ready_winged_shoes(obj, actor)
|
||||
bridge.temporary = false
|
||||
Obj.moveToMap(bridge, 0xc9, 0x9b, 2)
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -2211,7 +2211,7 @@ function move_drill(obj, rel_x, rel_y)
|
||||
elseif rel_y > 0 then
|
||||
obj.frame_n = 5
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -2219,7 +2219,7 @@ function move_wheelbarrow(obj, rel_x, rel_y)
|
||||
if rel_x ~= 0 and rel_y ~= 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if rel_x < 0 then
|
||||
obj.frame_n = 3
|
||||
elseif rel_x > 0 then
|
||||
@ -2229,7 +2229,7 @@ function move_wheelbarrow(obj, rel_x, rel_y)
|
||||
elseif rel_y > 0 then
|
||||
obj.frame_n = 2
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -2253,13 +2253,13 @@ function move_rail_cart(obj, rel_x, rel_y)
|
||||
end
|
||||
|
||||
move_car_obj(obj, rel_x, rel_y)
|
||||
return false
|
||||
return false
|
||||
end
|
||||
|
||||
function check_for_track(car, rel_x, rel_y)
|
||||
local x = car.x + rel_x
|
||||
local y = car.y + rel_y
|
||||
|
||||
|
||||
for obj in objs_at_loc(x, y, car.z) do
|
||||
if (obj.obj_n >= 412 and obj.obj_n <= 414) or obj.obj_n == 419 or obj.obj_n == 175 or obj.obj_n == 163 then --track object
|
||||
|
||||
@ -2281,12 +2281,12 @@ function check_for_track(car, rel_x, rel_y)
|
||||
if map_get_obj(x, y, car.z, 412, true) then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
local tile_num = map_get_tile_num(x,y, car.z)
|
||||
if is_track_tile(tile_num) then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -2325,7 +2325,7 @@ function has_usecode(obj, usecode_type)
|
||||
elseif usecode_type == USE_EVENT_MOVE and usecode_move_obj_table[obj.obj_n] ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -2335,11 +2335,11 @@ function use_obj_on_to(obj, target_obj, actor, use_to_tbl)
|
||||
printl("NOTHING")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local to_x, to_y = direction_get_loc(dir, actor.x, actor.y)
|
||||
|
||||
|
||||
local to_obj = map_get_obj(to_x, to_y, actor.z)
|
||||
|
||||
|
||||
if to_obj ~= nil then
|
||||
print(to_obj.name.."\n\n")
|
||||
local func = use_to_tbl[to_obj.obj_n]
|
||||
@ -2364,7 +2364,7 @@ function use_obj_on(obj, actor, use_on_tbl)
|
||||
if target_entity == nil then
|
||||
target_entity = map_get_obj(target_x, target_y, actor.z)
|
||||
end
|
||||
|
||||
|
||||
if target_entity ~= nil then
|
||||
print(target_entity.name.."\n\n")
|
||||
local on = use_on_tbl[target_entity.obj_n]
|
||||
@ -2444,7 +2444,7 @@ function ready_obj(obj, actor)
|
||||
return func(obj, actor)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@ -2457,4 +2457,4 @@ end
|
||||
|
||||
function is_ranged_select(operation)
|
||||
return actor_is_affected_by_purple_berries(Actor.get_player_actor().actor_num)
|
||||
end
|
||||
end
|
||||
|
@ -156,7 +156,7 @@ end
|
||||
function worktype_9D_stoker_wait_for_coal(actor)
|
||||
local coal
|
||||
coal = map_get_obj(actor.x, actor.y+1, actor.z, 447) --OBJ_HUGE_LUMP_OF_COAL
|
||||
|
||||
|
||||
if coal ~= nil then
|
||||
while coal ~= nil do
|
||||
Obj.removeFromEngine(coal)
|
||||
@ -164,7 +164,7 @@ function worktype_9D_stoker_wait_for_coal(actor)
|
||||
end
|
||||
actor.wt = 0x9E
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
function worktype_9E_stoker_walk_to_furnace(actor)
|
||||
@ -173,7 +173,7 @@ function worktype_9E_stoker_walk_to_furnace(actor)
|
||||
if furnace == nil then
|
||||
furnace = map_get_obj(actor.x+1, actor.y-1, actor.z, 233)
|
||||
end
|
||||
|
||||
|
||||
if furnace ~= nil then
|
||||
if Actor.get_talk_flag(0x72, 2) == false then
|
||||
activate_power_system()
|
||||
@ -221,7 +221,7 @@ function stoker_blocked(stoker)
|
||||
if map_is_on_screen(stoker.x, stoker.y, stoker.z) then
|
||||
printl("STOKERS_PATH_IS_BLOCKED")
|
||||
play_md_sfx(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function worktype_9C_stoker_return_to_conveyor_belt(actor)
|
||||
@ -252,9 +252,8 @@ function perform_worktype(actor)
|
||||
local func = worktype_tbl[actor.wt]
|
||||
func(actor)
|
||||
end
|
||||
|
||||
|
||||
if mpts == actor.mpts then
|
||||
subtract_movement_pts(actor, 10)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -192,7 +192,7 @@ weapon_dmg_tbl = { --FIXME: all damage is made up
|
||||
[209] = 15, --lit torch
|
||||
--[212] = 1, --fishing pole (says bare handed)
|
||||
[240] = 30, --device (FIXME: explosive gas only hurts Myrmidex)
|
||||
[241] = 30 --activated device (FIXME: explosive gas only hurts Myrmidex)
|
||||
[241] = 30 --activated device (FIXME: explosive gas only hurts Myrmidex)
|
||||
}
|
||||
|
||||
armour_tbl = --FIXME: all armor value is made up
|
||||
@ -255,9 +255,9 @@ end
|
||||
function advance_time(num_turns)
|
||||
--FIXME
|
||||
local minute = clock_get_minute()
|
||||
|
||||
|
||||
clock_inc(num_turns)
|
||||
|
||||
|
||||
if minute + num_turns >= 60 then
|
||||
update_actor_schedules()
|
||||
end
|
||||
@ -273,7 +273,7 @@ function actor_get_obj(actor, obj) -- FIXME need to limit inventory slots
|
||||
print("\nNot possible.")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if Actor.can_carry_obj_weight(actor, obj) == false then
|
||||
print("\nThe total is too heavy.")
|
||||
return false
|
||||
@ -289,4 +289,3 @@ end
|
||||
|
||||
function player_post_move_action(did_move)
|
||||
end
|
||||
|
||||
|
@ -58,7 +58,7 @@ function search(obj)
|
||||
if obj.on_map == false then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local found_obj = false
|
||||
local child
|
||||
local first_loop = true
|
||||
@ -80,18 +80,18 @@ function search(obj)
|
||||
script_wait(50)
|
||||
first_loop = false
|
||||
end
|
||||
|
||||
|
||||
if prev_obj ~= nil then
|
||||
printfl("SEARCH_LAST_OBJ", prev_obj.look_string)
|
||||
Obj.moveToMap(prev_obj, obj.x, obj.y, obj.z)
|
||||
end
|
||||
|
||||
|
||||
if found_obj == false then
|
||||
printl("SEARCHING_HERE_YOU_FIND_NOTHING")
|
||||
else
|
||||
print(".\n")
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
--tile_num, readied location
|
||||
@ -161,8 +161,8 @@ function obj_get_readiable_location(obj)
|
||||
if g_readiable_objs_tbl[obj.tile_num] ~= nil then
|
||||
return g_readiable_objs_tbl[obj.tile_num]
|
||||
end
|
||||
|
||||
return -1
|
||||
|
||||
return -1
|
||||
end
|
||||
|
||||
function create_object_needs_quan(obj_n)
|
||||
|
@ -14,7 +14,7 @@ local function should_exit(input)
|
||||
if input ~=nil and input == SDLK_ESCAPE then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -25,7 +25,7 @@ local function fade_out_sprite(sprite, speed)
|
||||
else
|
||||
speed = -3
|
||||
end
|
||||
|
||||
|
||||
for i=0xff,0,speed do
|
||||
sprite.opacity = i
|
||||
canvas_update()
|
||||
@ -108,18 +108,18 @@ end
|
||||
|
||||
local function origin_fx_sequence()
|
||||
local g_img_tbl = image_load_all("title.lzc")
|
||||
|
||||
|
||||
canvas_set_palette("savage.pal", 2)
|
||||
|
||||
|
||||
|
||||
local stars = sprite_new(g_img_tbl[0][0], 0, 24, true)
|
||||
local logo_image = image_new(282,82)
|
||||
image_blit(logo_image, g_img_tbl[0][1],0,16)
|
||||
image_blit(logo_image, g_img_tbl[0][2],g_img_tbl[0][1].w,14)
|
||||
image_blit(logo_image, g_img_tbl[0][3],g_img_tbl[0][1].w+g_img_tbl[0][2].w,0)
|
||||
|
||||
|
||||
local logo = sprite_new(logo_image, 20, 70, false)
|
||||
|
||||
|
||||
local planet = sprite_new(g_img_tbl[12], 160, 48, true)
|
||||
planet.clip_x = 0
|
||||
planet.clip_y = 0
|
||||
@ -129,25 +129,25 @@ local function origin_fx_sequence()
|
||||
players[1] = create_player_sprite(g_img_tbl[1][0], 58, 118)
|
||||
players[2] = create_player_sprite(g_img_tbl[2][0], 186, 118)
|
||||
players[3] = create_player_sprite(g_img_tbl[3][0], 278, 118)
|
||||
|
||||
|
||||
players[4] = create_player_sprite(g_img_tbl[4][0], 58, 126)
|
||||
players[5] = create_player_sprite(g_img_tbl[5][0], 186, 126)
|
||||
players[6] = create_player_sprite(g_img_tbl[6][0], 278, 126)
|
||||
|
||||
|
||||
players[7] = create_player_sprite(g_img_tbl[7][0], 58, 134)
|
||||
players[8] = create_player_sprite(g_img_tbl[8][0], 186, 134)
|
||||
players[9] = create_player_sprite(g_img_tbl[9][0], 278, 134)
|
||||
|
||||
|
||||
local conductor = sprite_new(g_img_tbl[10][0], 158, 98, true)
|
||||
conductor.clip_x = 0
|
||||
conductor.clip_y = 24
|
||||
conductor.clip_w = 320
|
||||
conductor.clip_h = 128
|
||||
|
||||
|
||||
fade_in()
|
||||
|
||||
music_play("music.lzc", 19)
|
||||
|
||||
|
||||
local i = 0
|
||||
for i=0,6,1 do
|
||||
conductor.image = g_img_tbl[10][i]
|
||||
@ -173,7 +173,7 @@ local function origin_fx_sequence()
|
||||
conductor.image = g_img_tbl[10][j]
|
||||
if poll_for_key_or_button(1) == true then return end
|
||||
end
|
||||
|
||||
|
||||
conductor.image = g_img_tbl[10][14]
|
||||
if poll_for_key_or_button(2) == true then return end
|
||||
conductor.image = g_img_tbl[10][13]
|
||||
@ -183,21 +183,21 @@ local function origin_fx_sequence()
|
||||
if poll_for_key_or_button(1) == true then return end
|
||||
play_sfx(38, false)
|
||||
end
|
||||
|
||||
|
||||
for i=16,20,1 do
|
||||
conductor.image = g_img_tbl[10][i]
|
||||
if poll_for_key_or_button(4) == true then return end
|
||||
end
|
||||
if poll_for_key_or_button(200) == true then return end
|
||||
|
||||
|
||||
play_sfx(12, false)
|
||||
|
||||
|
||||
conductor.image = g_img_tbl[10][6]
|
||||
|
||||
|
||||
for i=1,21,1 do
|
||||
conductor.y = 98 + i * 12
|
||||
conductor.image.scale = 100 + i * 15
|
||||
|
||||
|
||||
for j=1,9,1 do
|
||||
players[j].y = players[j].y + 5
|
||||
players[j].image.scale = 100 + i * 5
|
||||
@ -208,15 +208,15 @@ local function origin_fx_sequence()
|
||||
players[j].x = players[j].x + 2
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if poll_for_esc(4) == true then return end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
logo.visible = true
|
||||
logo.image.scale = 10
|
||||
|
||||
|
||||
logo.image.scale = 10
|
||||
|
||||
|
||||
for i=1,18,1 do
|
||||
planet.y = planet.y + 6
|
||||
|
||||
@ -227,18 +227,18 @@ local function origin_fx_sequence()
|
||||
else
|
||||
logo.y = logo.y + 1
|
||||
end
|
||||
|
||||
|
||||
if poll_for_key_or_button(4) == true then return end
|
||||
end
|
||||
|
||||
|
||||
fireworks(g_img_tbl, logo)
|
||||
end
|
||||
|
||||
local function intro_sequence(g_img_tbl)
|
||||
|
||||
|
||||
canvas_set_palette("savage.pal", 0)
|
||||
music_play("music.lzc", 18)
|
||||
|
||||
|
||||
local logo = sprite_new(g_img_tbl[0][0], 0, 0, true)
|
||||
fade_in()
|
||||
if poll_for_key_or_button(175) == true then return end
|
||||
@ -511,7 +511,7 @@ local function ask_question(q_num, q_ord, sprites, text_image, a_b_border_img, i
|
||||
end
|
||||
end
|
||||
|
||||
local red = 0x04
|
||||
local red = 0x04
|
||||
local black = 0x00
|
||||
local answer = SDLK_a
|
||||
local old_answer = 0
|
||||
@ -599,12 +599,12 @@ local function ask_question(q_num, q_ord, sprites, text_image, a_b_border_img, i
|
||||
next_q = 3
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return next_q
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
g_keycode_tbl =
|
||||
{
|
||||
[32]=" ",
|
||||
@ -698,22 +698,22 @@ local function create_new_character(img_tbl2)
|
||||
create_char_sprites[28] = sprite_new(img_tbl2[3][18], 8, 28, false) -- Yellow
|
||||
create_char_sprites[29] = sprite_new(img_tbl2[3][19], 8, 28, false) -- Blue
|
||||
create_char_sprites[10] = sprite_new(img_tbl2[3][0], 8, 28, false) -- Drop Anim
|
||||
create_char_sprites[11] = sprite_new(img_tbl2[3][1], 8, 28, false) --
|
||||
create_char_sprites[12] = sprite_new(img_tbl2[3][2], 8, 28, false) --
|
||||
create_char_sprites[13] = sprite_new(img_tbl2[3][3], 8, 28, false) --
|
||||
create_char_sprites[14] = sprite_new(img_tbl2[3][4], 8, 28, false) --
|
||||
create_char_sprites[15] = sprite_new(img_tbl2[3][5], 8, 28, false) --
|
||||
create_char_sprites[16] = sprite_new(img_tbl2[3][6], 8, 28, false) --
|
||||
create_char_sprites[17] = sprite_new(img_tbl2[3][7], 8, 28, false) --
|
||||
create_char_sprites[18] = sprite_new(img_tbl2[3][8], 8, 28, false) --
|
||||
create_char_sprites[19] = sprite_new(img_tbl2[3][9], 8, 28, false) --
|
||||
create_char_sprites[20] = sprite_new(img_tbl2[3][10], 8, 28, false) --
|
||||
create_char_sprites[21] = sprite_new(img_tbl2[3][11], 8, 28, false) --
|
||||
create_char_sprites[22] = sprite_new(img_tbl2[3][12], 8, 28, false) --
|
||||
create_char_sprites[23] = sprite_new(img_tbl2[3][13], 8, 28, false) --
|
||||
create_char_sprites[24] = sprite_new(img_tbl2[3][14], 8, 28, false) --
|
||||
create_char_sprites[25] = sprite_new(img_tbl2[3][15], 8, 28, false) --
|
||||
create_char_sprites[26] = sprite_new(img_tbl2[3][16], 8, 28, false) --
|
||||
create_char_sprites[11] = sprite_new(img_tbl2[3][1], 8, 28, false) --
|
||||
create_char_sprites[12] = sprite_new(img_tbl2[3][2], 8, 28, false) --
|
||||
create_char_sprites[13] = sprite_new(img_tbl2[3][3], 8, 28, false) --
|
||||
create_char_sprites[14] = sprite_new(img_tbl2[3][4], 8, 28, false) --
|
||||
create_char_sprites[15] = sprite_new(img_tbl2[3][5], 8, 28, false) --
|
||||
create_char_sprites[16] = sprite_new(img_tbl2[3][6], 8, 28, false) --
|
||||
create_char_sprites[17] = sprite_new(img_tbl2[3][7], 8, 28, false) --
|
||||
create_char_sprites[18] = sprite_new(img_tbl2[3][8], 8, 28, false) --
|
||||
create_char_sprites[19] = sprite_new(img_tbl2[3][9], 8, 28, false) --
|
||||
create_char_sprites[20] = sprite_new(img_tbl2[3][10], 8, 28, false) --
|
||||
create_char_sprites[21] = sprite_new(img_tbl2[3][11], 8, 28, false) --
|
||||
create_char_sprites[22] = sprite_new(img_tbl2[3][12], 8, 28, false) --
|
||||
create_char_sprites[23] = sprite_new(img_tbl2[3][13], 8, 28, false) --
|
||||
create_char_sprites[24] = sprite_new(img_tbl2[3][14], 8, 28, false) --
|
||||
create_char_sprites[25] = sprite_new(img_tbl2[3][15], 8, 28, false) --
|
||||
create_char_sprites[26] = sprite_new(img_tbl2[3][16], 8, 28, false) --
|
||||
create_char_sprites[3] = sprite_new(img_tbl2[1][1], 8, 28, true) -- Weird Border Around Shaman
|
||||
-- TODO BORDER SHADOW (Solid Black)
|
||||
-- TODO Memory Management on Image?
|
||||
@ -884,7 +884,7 @@ local function about_the_savage_empire(img_tbl2)
|
||||
table.insert(about_sprites, create_about_sprite(img_tbl2[6][i], 100, ypos))
|
||||
ypos = ypos + credit_heights[i+1]
|
||||
end
|
||||
|
||||
|
||||
local done = 0
|
||||
|
||||
local k,v
|
||||
@ -899,7 +899,7 @@ local function about_the_savage_empire(img_tbl2)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
destroy_sprites(about_sprites)
|
||||
end
|
||||
|
||||
@ -1113,7 +1113,7 @@ canvas_set_bg_color(0)
|
||||
canvas_set_opacity(0)
|
||||
|
||||
origin_fx_sequence()
|
||||
|
||||
|
||||
--canvas_hide_all_sprites()
|
||||
|
||||
-- Load Graphics for Intro & Main Menu
|
||||
@ -1128,4 +1128,4 @@ end
|
||||
|
||||
music_stop()
|
||||
canvas_hide_all_sprites()
|
||||
canvas_hide()
|
||||
canvas_hide()
|
||||
|
@ -3,23 +3,23 @@ local look_usecode = {
|
||||
|
||||
function look_obj(obj)
|
||||
printfl("YOU_SEE", obj.look_string);
|
||||
|
||||
|
||||
--FIXME usecode look description should be lua code.
|
||||
if usecode_look(obj) then
|
||||
print("\n")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
print(".\n\n");
|
||||
|
||||
|
||||
if look_usecode[obj.obj_n] ~= nil then
|
||||
look_usecode[obj.obj_n](obj)
|
||||
print("\n")
|
||||
end
|
||||
|
||||
|
||||
if is_container_obj(obj.obj_n) then
|
||||
search(obj)
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
@ -253,4 +253,4 @@ end
|
||||
|
||||
function is_ranged_select(operation)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ local function wait_for_input()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return input
|
||||
end
|
||||
|
||||
@ -63,7 +63,7 @@ local function play()
|
||||
canvas_set_palette("endpal.lbm", 0)
|
||||
canvas_set_update_interval(25)
|
||||
sprite_new(g_img_tbl[7], 0, 0, true)--bg
|
||||
|
||||
|
||||
image_set_transparency_colour(g_img_tbl[0], 0)
|
||||
star_field = sprite_new(image_new_starfield(114,94), 106, 0, false)
|
||||
star_field.clip_x = 106
|
||||
@ -80,30 +80,30 @@ local function play()
|
||||
moongate.clip_y = 0
|
||||
moongate.clip_w = 320
|
||||
moongate.clip_h = 0x7e
|
||||
|
||||
|
||||
local characters = sprite_new(g_img_tbl[8], 0, 0, false)
|
||||
characters.clip_x = 0
|
||||
characters.clip_y = 0
|
||||
characters.clip_w = 160
|
||||
characters.clip_h = 200
|
||||
|
||||
|
||||
local characters1 = sprite_new(g_img_tbl[9], 0, 0, false)
|
||||
characters1.clip_x = 0
|
||||
characters1.clip_y = 0
|
||||
characters1.clip_w = 160
|
||||
characters1.clip_h = 200
|
||||
|
||||
|
||||
local blue_lens = sprite_new(g_img_tbl[5], 0x49, 0x57, true)--lens
|
||||
local red_lens = sprite_new(g_img_tbl[6], 0xda, 0x57, true)--lens
|
||||
|
||||
|
||||
local scroll_img = image_load("end.shp", 0xb)
|
||||
|
||||
image_print(scroll_img, "A glowing portal springs from the floor!", 7, 303, 34, 13, 0x3e)
|
||||
local scroll = sprite_new(scroll_img, 1, 0xa0, true)
|
||||
|
||||
|
||||
local input
|
||||
local i
|
||||
|
||||
|
||||
for i=0x7d,-0xc,-1 do
|
||||
stones_rotate_palette()
|
||||
moongate.y = i
|
||||
@ -114,25 +114,25 @@ local function play()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
rotate_and_wait()
|
||||
|
||||
|
||||
characters.visible = true
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
image_print(scroll_img, "From its crimson depths Lord British emerges, trailed by the mage Nystul. Anguish and disbelief prevail on the royal seer's face, but Lord British directs his stony gaze at you and speaks as if to a wayward child.", 8, 303, 7, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x85
|
||||
|
||||
|
||||
rotate_and_wait()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xc)
|
||||
image_print(scroll_img, "\"Thou didst have just cause to burgle our Codex, I trust\127 His Majesty says. \"But for Virtue's sake...", 8, 303, 7, 12, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x97
|
||||
|
||||
|
||||
for i=-0xc,0x7d,1 do
|
||||
stones_rotate_palette()
|
||||
moongate.y = i
|
||||
@ -143,46 +143,46 @@ local function play()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
moongate.visible = false
|
||||
wait_for_input()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xb)
|
||||
image_print(scroll_img, "\"WHAT HAST THOU DONE WITH IT?\127", 8, 303, 63, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x0
|
||||
scroll.y = 0xa0
|
||||
|
||||
|
||||
|
||||
wait_for_input()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
image_print(scroll_img, "You pick up the concave lens and pass it to the King. \"Was the book ever truly ours, Your Majesty? Was it written for Britannia alone? Thou dost no longer hold the Codex, but is its wisdom indeed lost? Look into the Vortex, and let the Codex answer for itself!\127", 8, 303, 7, 8, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x85
|
||||
|
||||
|
||||
wait_for_input()
|
||||
|
||||
|
||||
blue_lens.visible = false
|
||||
|
||||
|
||||
characters.clip_x = 160
|
||||
characters.clip_w = 160
|
||||
characters.visible = false
|
||||
|
||||
|
||||
characters1.visible = true
|
||||
|
||||
|
||||
wait_for_input()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xc)
|
||||
image_print(scroll_img, "As Lord British holds the glass before the wall, the Codex of Ultimate Wisdom wavers into view against a myriad of swimming stars!", 8, 303, 7, 12, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x97
|
||||
|
||||
|
||||
star_field.visible = true
|
||||
wall_transparent.visible = true
|
||||
|
||||
|
||||
for i=0xff,0,-3 do
|
||||
wall.opacity = i
|
||||
image_update_effect(star_field.image)
|
||||
@ -209,26 +209,26 @@ local function play()
|
||||
end
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xb)
|
||||
image_print(scroll_img, "Yet the book remains closed.", 8, 303, 70, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x0
|
||||
scroll.y = 0xa0
|
||||
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
music_play("gargoyle.m")
|
||||
scroll_img = image_load("end.shp", 0xb)
|
||||
image_print(scroll_img, "And waves of heat shimmer in the air, heralding the birth of another red gate!", 8, 303, 7, 9, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x0
|
||||
scroll.y = 0x98
|
||||
|
||||
|
||||
moongate.x = 0xe6
|
||||
moongate.y = 0x7d
|
||||
moongate.visible = true
|
||||
|
||||
|
||||
for i=0x7d,-0xc,-1 do
|
||||
image_update_effect(star_field.image)
|
||||
stones_rotate_palette()
|
||||
@ -240,25 +240,25 @@ local function play()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
rotate_and_wait()
|
||||
|
||||
|
||||
characters.visible = true
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
image_print(scroll_img, "King Draxinusom of the Gargoyles strides forward, flanked by a small army of wingless attendants. Like Lord British, he seems to suppress his rage only through a heroic effort of will. His scaly hand grasps your shoulder, and your Amulet of Submission grows very warm.", 8, 303, 7, 8, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x85
|
||||
|
||||
|
||||
rotate_and_wait()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xb)
|
||||
image_print(scroll_img, "\"Thy time hath come, Thief,\127 he says.", 8, 303, 46, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x0
|
||||
scroll.y = 0xa0
|
||||
|
||||
|
||||
for i=-0xc,0x7d,1 do
|
||||
image_update_effect(star_field.image)
|
||||
stones_rotate_palette()
|
||||
@ -272,9 +272,9 @@ local function play()
|
||||
end
|
||||
|
||||
moongate.visible = false
|
||||
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xb)
|
||||
image_print(scroll_img, "Quickly you reach down to seize the convex lens...", 8, 310, 5, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
@ -282,7 +282,7 @@ local function play()
|
||||
scroll.y = 0x98
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xc)
|
||||
image_print(scroll_img, "...and you press it into the hand of the towering Gargoyle king, meeting his sunken eyes. \"Join my Lord in his search for peace, I beg thee.\127", 8, 303, 7, 12, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
@ -290,11 +290,11 @@ local function play()
|
||||
scroll.y = 0x97
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
characters.visible = false
|
||||
characters1.clip_w = 320
|
||||
red_lens.visible = false
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
image_print(scroll_img, "At your urging, King Draxinusom reluctantly raises his lens to catch the light. As Lord British holds up his own lens, every eye in the room, human and Gargoyle alike, fixes upon the image of the Codex which shines upon the wall.", 8, 303, 7, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
@ -302,17 +302,17 @@ local function play()
|
||||
scroll.y = 0x85
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
music_play("end.m")
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
image_print(scroll_img, "The ancient book opens. Both kings gaze upon its pages in spellbound silence, as the eloquence of Ultimate Wisdom is revealed in the tongues of each lord's domain. You, too, can read the answers the Codex gives...", 8, 303, 7, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x85
|
||||
|
||||
|
||||
codex_opened.opacity = 0
|
||||
codex_opened.visible = true
|
||||
|
||||
|
||||
for i=0,0xff,3 do
|
||||
codex_opened.opacity = i
|
||||
image_update_effect(star_field.image)
|
||||
@ -324,19 +324,19 @@ local function play()
|
||||
end
|
||||
end
|
||||
codex.visible = false
|
||||
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
image_print(scroll_img, "...and when its wisdom is gleaned, when Lord British and King Draxinusom turn to each other as friends, hating no longer, fearing no more, you know that your mission in Britannia has ended at last.", 8, 303, 7, 13, 0x3e)
|
||||
scroll.image = scroll_img
|
||||
scroll.x = 0x1
|
||||
scroll.y = 0x85
|
||||
|
||||
|
||||
update_star_field_and_wait()
|
||||
|
||||
|
||||
scroll.visible = false
|
||||
|
||||
|
||||
for i=0xff,0,-3 do
|
||||
codex_opened.opacity = i
|
||||
image_update_effect(star_field.image)
|
||||
@ -347,9 +347,9 @@ local function play()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
codex_opened.visible = false
|
||||
|
||||
|
||||
wall.opacity = 0
|
||||
wall.visible = true
|
||||
|
||||
@ -363,16 +363,16 @@ local function play()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
star_field.visible=false
|
||||
wait_for_input()
|
||||
|
||||
|
||||
|
||||
for i=0xff,0,-3 do
|
||||
canvas_set_opacity(i)
|
||||
canvas_update()
|
||||
end
|
||||
|
||||
|
||||
canvas_hide_all_sprites()
|
||||
canvas_set_opacity(0xff)
|
||||
|
||||
@ -418,25 +418,25 @@ local function play()
|
||||
local current_days = year * 365 + month * 30 + day
|
||||
local start_days = START_YEAR * 365 + START_MONTH * 30 + START_DAY
|
||||
local time = current_days - start_days
|
||||
|
||||
|
||||
local years = math.floor(time / 365)
|
||||
local months = math.floor((time - years * 365) / 30)
|
||||
local days = time - (years * 365 + months * 30)
|
||||
|
||||
|
||||
local line1 = ""
|
||||
|
||||
|
||||
if years > 0 then
|
||||
if years > 29 then
|
||||
line1 = line1..years.." year"
|
||||
else
|
||||
line1 = line1..num_string[years+1].." year"
|
||||
end
|
||||
|
||||
|
||||
if years > 1 then
|
||||
line1 = line1.."s"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if months > 0 then
|
||||
if line1 ~= "" then
|
||||
line1 = line1..", "
|
||||
@ -453,30 +453,30 @@ local function play()
|
||||
line1 = line1..","
|
||||
line2 = "and "
|
||||
end
|
||||
|
||||
|
||||
line2 = line2..num_string[days+1].." day"
|
||||
if days ~= 1 then
|
||||
line2 = line2.."s"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if line1 == "" then
|
||||
line1 = "Prophet, in"
|
||||
else
|
||||
line1 = "Prophet, in "..line1
|
||||
end
|
||||
|
||||
|
||||
if string.len(line1.." "..line2) <= 38 and line2 ~= "" then
|
||||
line1 = line1.." "..line2
|
||||
line2 = ""
|
||||
end
|
||||
|
||||
|
||||
if line2 == "" then
|
||||
line1 = line1.."."
|
||||
else
|
||||
line2 = line2.."."
|
||||
end
|
||||
|
||||
|
||||
local x, y
|
||||
y=9
|
||||
scroll_img = image_load("end.shp", 0xa)
|
||||
@ -499,7 +499,7 @@ local function play()
|
||||
|
||||
scroll.opacity = 0
|
||||
scroll.visible = true
|
||||
|
||||
|
||||
for i=0,0xff,3 do
|
||||
scroll.opacity = i
|
||||
canvas_update()
|
||||
@ -509,7 +509,7 @@ local function play()
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
wait_for_input()
|
||||
|
||||
end
|
||||
|
@ -68,7 +68,7 @@ function is_avatar_dead()
|
||||
end
|
||||
|
||||
--used with triple crossbow and magic wind spells.
|
||||
g_projectile_offset_tbl =
|
||||
g_projectile_offset_tbl =
|
||||
{
|
||||
{
|
||||
4,5,5,5,5,6,6,6,6,6,6,
|
||||
@ -109,7 +109,7 @@ g_moonstone_loc_tbl =
|
||||
{x=0x147, y=0x336, z=0},
|
||||
{x=0x17, y=0x16, z=1},
|
||||
{x=0x397, y=0x3A6, z=0}
|
||||
}
|
||||
}
|
||||
|
||||
g_show_stealing = config_get_boolean_value("config/ultima6/show_stealing")
|
||||
|
||||
@ -125,7 +125,7 @@ end
|
||||
|
||||
function alignment_is_evil(align)
|
||||
if align == ALIGNMENT_EVIL or align == ALIGNMENT_CHAOTIC then return true end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -157,7 +157,7 @@ end
|
||||
|
||||
function obj_new(obj_n, frame_n, status, qty, quality, x, y, z)
|
||||
local obj = {}
|
||||
|
||||
|
||||
obj["obj_n"] = obj_n or 0
|
||||
obj["frame_n"] = frame_n or 0
|
||||
obj["status"] = status or 0
|
||||
@ -182,14 +182,14 @@ end
|
||||
|
||||
function look_obj(obj)
|
||||
print("Thou dost see " .. obj.look_string);
|
||||
local weight = obj.weight; --FIXME this could be a problem if we want to change Lua_number type to int.
|
||||
local weight = obj.weight; --FIXME this could be a problem if we want to change Lua_number type to int.
|
||||
if weight ~= 0 then
|
||||
if obj.qty > 1 and obj.stackable then
|
||||
print(". They weigh");
|
||||
else
|
||||
print(". It weighs");
|
||||
end
|
||||
|
||||
|
||||
print(string.format(" %.1f", weight).." stones");
|
||||
end
|
||||
|
||||
@ -198,7 +198,7 @@ function look_obj(obj)
|
||||
print("\n")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
local dmg = weapon_dmg_tbl[obj.obj_n];
|
||||
if dmg ~= nil then
|
||||
if weight ~= 0 then
|
||||
@ -206,13 +206,13 @@ function look_obj(obj)
|
||||
else
|
||||
print(". It")
|
||||
end
|
||||
|
||||
|
||||
print(" can do "..dmg.." point")
|
||||
if dmg > 1 then print("s") end
|
||||
print(" of damage")
|
||||
|
||||
end
|
||||
|
||||
|
||||
local ac = armour_tbl[obj.obj_n]
|
||||
if ac ~= nil then
|
||||
if weight ~= 0 or dmg ~= 0 then
|
||||
@ -220,12 +220,12 @@ function look_obj(obj)
|
||||
else
|
||||
print(". It")
|
||||
end
|
||||
|
||||
|
||||
print(" can absorb "..ac.." point")
|
||||
if ac > 1 then print("s") end
|
||||
print(" of damage")
|
||||
end
|
||||
|
||||
|
||||
print(".\n");
|
||||
local player_loc = player_get_location();
|
||||
if g_show_stealing == true and obj.getable == true and player_loc.z == 0 and obj.ok_to_take == false then
|
||||
@ -235,14 +235,14 @@ function look_obj(obj)
|
||||
print("PRIVATE PROPERTY")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function player_subtract_karma(k)
|
||||
local karma = player_get_karma() - k
|
||||
if karma < 0 then karma = 0 end
|
||||
|
||||
|
||||
player_set_karma(karma)
|
||||
end
|
||||
|
||||
@ -257,7 +257,7 @@ function party_heal()
|
||||
for actor in party_members() do
|
||||
actor.asleep = false
|
||||
actor.poisoned = false
|
||||
actor.paralyzed = false
|
||||
actor.paralyzed = false
|
||||
actor_remove_charm(actor)
|
||||
actor.hp = actor.max_hp
|
||||
end
|
||||
@ -271,20 +271,20 @@ end
|
||||
function projectile(tile_num, start_x, start_y, end_x, end_y, speed, spin)
|
||||
|
||||
if spin == nil then spin = 0 end
|
||||
|
||||
|
||||
local rotate_offset = 0
|
||||
local src_tile_y_offset = 0
|
||||
|
||||
|
||||
if tile_num == 547 then --spear
|
||||
rotate_offset = 45
|
||||
elseif tile_num == 566 then --bow
|
||||
rotate_offset = 90
|
||||
src_tile_y_offset = 4
|
||||
elseif tile_num == 567 then --crossbow
|
||||
rotate_offset = 90
|
||||
rotate_offset = 90
|
||||
src_tile_y_offset = 3
|
||||
end
|
||||
|
||||
|
||||
play_sfx(SFX_MISSLE)
|
||||
projectile_anim(tile_num, start_x, start_y, end_x, end_y, speed, false, rotate_offset, spin, src_tile_y_offset)
|
||||
end
|
||||
@ -344,7 +344,7 @@ function actor_is_readiable_obj(actor)
|
||||
if g_readiable_objs_tbl[actor.tile_num] ~= nil then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -358,7 +358,7 @@ end
|
||||
|
||||
function is_time_stopped()
|
||||
if timer_get(TIMER_TIME_STOP) ~= 0 then return true end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -372,15 +372,15 @@ function load_game()
|
||||
frame_n = tmp_obj_dat - 1023
|
||||
obj_n = tmp_obj_dat - frame_n
|
||||
end
|
||||
|
||||
|
||||
g_vanish_obj.obj_n = obj_n
|
||||
g_vanish_obj.frame_n = frame_n
|
||||
|
||||
--Load moonstone locations.
|
||||
objlist_seek(OBJLIST_OFFSET_MOONSTONES)
|
||||
|
||||
|
||||
for i=1,8 do
|
||||
|
||||
|
||||
local x = objlist_read2()
|
||||
local y = objlist_read2()
|
||||
local z = objlist_read2()
|
||||
@ -396,7 +396,7 @@ end
|
||||
|
||||
function save_game()
|
||||
objlist_seek(OBJLIST_OFFSET_VANISH_OBJ)
|
||||
|
||||
|
||||
local tmp_obj_dat = g_vanish_obj.obj_n
|
||||
local frame_n = g_vanish_obj.frame_n
|
||||
|
||||
@ -405,17 +405,17 @@ function save_game()
|
||||
end
|
||||
|
||||
objlist_write2(tmp_obj_dat)
|
||||
|
||||
|
||||
--Save moonstone locations
|
||||
objlist_seek(OBJLIST_OFFSET_MOONSTONES)
|
||||
|
||||
|
||||
for i=1,8 do
|
||||
local loc = g_moonstone_loc_tbl[i]
|
||||
objlist_write2(loc.x)
|
||||
objlist_write2(loc.y)
|
||||
objlist_write2(loc.z)
|
||||
end
|
||||
|
||||
|
||||
objlist_seek(OBJLIST_OFFSET_KEG_TIMER)
|
||||
objlist_write2(g_keg_timer)
|
||||
end
|
||||
@ -429,7 +429,7 @@ end
|
||||
|
||||
function moonstone_get_loc(phase)
|
||||
if phase < 1 or phase > 8 then return nil end
|
||||
|
||||
|
||||
return g_moonstone_loc_tbl[phase]
|
||||
end
|
||||
|
||||
@ -455,7 +455,7 @@ function use_keg(obj)
|
||||
print("\nNo effect\n")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
if g_keg_timer > 0 then
|
||||
print("\nNot now\n")
|
||||
else
|
||||
@ -473,7 +473,7 @@ function explode_keg()
|
||||
explode_obj(obj)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--try to explode lit kegs in the party's inventory
|
||||
local party_actor
|
||||
for party_actor in party_members() do
|
||||
@ -487,7 +487,7 @@ end
|
||||
function explode_obj(obj, actor)
|
||||
dbg("Exploding "..obj.name.."\n")
|
||||
local x, y, z
|
||||
|
||||
|
||||
if actor ~= nil then
|
||||
x = actor.x
|
||||
y = actor.y
|
||||
@ -497,9 +497,9 @@ function explode_obj(obj, actor)
|
||||
y = obj.y
|
||||
z = obj.z
|
||||
end
|
||||
|
||||
|
||||
Obj.removeFromEngine(obj)
|
||||
|
||||
|
||||
local hit_items = explosion(0x189, x, y)
|
||||
local random = math.random
|
||||
local k, v
|
||||
@ -513,11 +513,11 @@ function explode_obj(obj, actor)
|
||||
return -- don't keep exploding once Avatar is dead
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
explode_surrounding_objects(x, y, z)
|
||||
end
|
||||
|
||||
function explode_surrounding_objects(x, y, z)
|
||||
function explode_surrounding_objects(x, y, z)
|
||||
--blow up doors and other kegs
|
||||
for x = x - 2,x + 2 do
|
||||
for y = y - 2,y + 2 do
|
||||
@ -525,7 +525,7 @@ function explode_surrounding_objects(x, y, z)
|
||||
if map_obj ~= nil then
|
||||
explode_obj(map_obj)
|
||||
end
|
||||
|
||||
|
||||
map_obj = map_get_obj(x, y, z, 0x12c) --steel door
|
||||
if map_obj == nil or map_obj.frame_n == 0xc then
|
||||
map_obj = map_get_obj(x, y, z, 0x129) --oaken door
|
||||
@ -536,7 +536,7 @@ function explode_surrounding_objects(x, y, z)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if map_obj ~= nil and map_obj.frame_n <= 0xc then
|
||||
Obj.removeFromEngine(map_obj)
|
||||
print("\nThe door is blown up!\n")
|
||||
@ -572,4 +572,3 @@ magic_init = nuvie_load("u6/magic.lua"); magic_init();
|
||||
usecode_init = nuvie_load("u6/usecode.lua"); usecode_init();
|
||||
|
||||
player_init = nuvie_load("u6/player.lua"); player_init();
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@ magic_invocations = {}
|
||||
function magic_print_invocation_string(spell_num)
|
||||
local i
|
||||
local invocation = magic_spell_invocation(spell_num)
|
||||
|
||||
|
||||
for i = 1,#invocation do
|
||||
if i ~= 1 then
|
||||
print(" ")
|
||||
@ -26,7 +26,7 @@ run_magic_script = function(invocation)
|
||||
end
|
||||
|
||||
--io.stderr:write("Running script \"" .. magic_invocations[invocation].script .."\"\n");
|
||||
|
||||
|
||||
--run_script(magic_invocations[invocation].script)
|
||||
magic_cast_spell(spell_num, nil, nil)
|
||||
return
|
||||
@ -54,7 +54,7 @@ function magic_spell_name(spell_num)
|
||||
if magic[spell_num+1] ~= nil then
|
||||
return magic[spell_num+1].name
|
||||
end
|
||||
|
||||
|
||||
return "Unknown"
|
||||
end
|
||||
|
||||
@ -73,12 +73,12 @@ function magic_get_spell_list()
|
||||
for k,v in pairs(magic) do
|
||||
insert(list, v)
|
||||
end
|
||||
|
||||
|
||||
return list
|
||||
end
|
||||
|
||||
magic_init = function(name, invocation, reagents, circle, num, script)
|
||||
local spell_num = (circle-1) * 16 + (num-1);
|
||||
local spell_num = (circle-1) * 16 + (num-1);
|
||||
local spell = {name=name,invocation=invocation,reagents=reagents,circle=circle,spell_num=spell_num,script=script}
|
||||
|
||||
magic[spell_num+1] = spell
|
||||
@ -100,16 +100,16 @@ end
|
||||
|
||||
select_actor = function()
|
||||
if g_magic_target ~= nil then return map_get_actor(g_magic_target) end
|
||||
|
||||
|
||||
print("On whom: ");
|
||||
|
||||
local loc = get_target()
|
||||
local actor
|
||||
|
||||
|
||||
if loc ~= nil then
|
||||
actor = map_get_actor(loc)
|
||||
end
|
||||
|
||||
|
||||
if actor == nil then
|
||||
print("nothing\n");
|
||||
else
|
||||
@ -122,11 +122,11 @@ end
|
||||
|
||||
select_obj = function()
|
||||
if g_magic_target ~= nil then return map_get_obj(g_magic_target) end
|
||||
|
||||
|
||||
print("On what: ");
|
||||
|
||||
local obj = get_obj()
|
||||
|
||||
|
||||
if obj == nil then
|
||||
print("nothing\n");
|
||||
else
|
||||
@ -134,7 +134,7 @@ select_obj = function()
|
||||
if obj.on_map and out_of_spell_range(obj.x, obj.y) then return end
|
||||
end
|
||||
|
||||
return obj
|
||||
return obj
|
||||
end
|
||||
|
||||
function select_actor_or_obj()
|
||||
@ -171,7 +171,7 @@ function select_actor_with_projectile(projectile_tile, caster)
|
||||
if caster == nil then caster = magic_get_caster() end
|
||||
|
||||
local is_player = caster_is_player()
|
||||
|
||||
|
||||
local loc = select_location_with_prompt("On Whom: ")
|
||||
local actor = map_get_actor(loc)
|
||||
if actor == nil then
|
||||
@ -186,7 +186,7 @@ function select_actor_with_projectile(projectile_tile, caster)
|
||||
elseif is_player == true then
|
||||
print(actor.name.."\n")
|
||||
end
|
||||
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
if loc == nil then magic_no_effect() return end
|
||||
if out_of_spell_range(loc.x, loc.y) then return end
|
||||
@ -210,7 +210,7 @@ function select_actor_or_obj_with_projectile(projectile_tile, caster)
|
||||
if item == nil then
|
||||
item = map_get_obj(loc)
|
||||
end
|
||||
|
||||
|
||||
if item ~= nil then
|
||||
print(item.name)
|
||||
else
|
||||
@ -291,11 +291,11 @@ function out_of_spell_range(target_x, target_y)
|
||||
end
|
||||
end
|
||||
|
||||
function caster_get_location()
|
||||
function caster_get_location()
|
||||
if g_magic_caster ~= nil then
|
||||
return {x = g_magic_caster.x, y = g_magic_caster.y, z = g_magic_caster.z}
|
||||
end
|
||||
|
||||
|
||||
return player_get_location()
|
||||
end
|
||||
|
||||
@ -307,7 +307,7 @@ end
|
||||
|
||||
function caster_is_player()
|
||||
if g_magic_caster == nil then return true end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
@ -321,7 +321,7 @@ end
|
||||
|
||||
function magic_casting_fade_effect(caster)
|
||||
if caster == nil then caster = magic_get_caster() end
|
||||
|
||||
|
||||
Actor.black_fade_effect(caster, 12, 20) -- 12 = colour red. 20 = fade_speed
|
||||
end
|
||||
|
||||
@ -364,7 +364,7 @@ function magic_wind(tile_num, caster, target_x, target_y)
|
||||
local targets = {
|
||||
{x=target_x,
|
||||
y=target_y,
|
||||
z=target_z},
|
||||
z=target_z},
|
||||
{x=target_x + offset_x_low,
|
||||
y=target_y + offset_y_low,
|
||||
z=target_z},
|
||||
@ -400,19 +400,19 @@ function magic_wind_spell(spell_num, tile_num)
|
||||
if v.luatype == "actor" and v.actor_num ~= caster.actor_num then
|
||||
if spell_num == 83 then --flame wind
|
||||
spell_take_fire_dmg(caster, v)
|
||||
|
||||
|
||||
elseif spell_num == 87 then --poison wind
|
||||
spell_poison_actor(caster, v)
|
||||
|
||||
|
||||
elseif spell_num == 98 then --energy wind
|
||||
local exp = actor_hit(v, math.random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
|
||||
actor_yell_for_help(caster, v, 1)
|
||||
actor_hit_msg(v)
|
||||
|
||||
|
||||
elseif spell_num == 113 then --death wind
|
||||
spell_kill_actor(caster, v)
|
||||
end
|
||||
|
@ -8,4 +8,3 @@ local obj = Obj.new(129,0,0,qty)
|
||||
Obj.moveToInv(obj, magic_get_caster())
|
||||
|
||||
print("\nCreate " .. obj.qty .. " food.\n")
|
||||
|
||||
|
@ -28,7 +28,7 @@ local potion_name = {
|
||||
}
|
||||
|
||||
fade_obj_blue(obj)
|
||||
|
||||
|
||||
if magical_tiles[obj.tile_num] ~= nil then
|
||||
--magical object.
|
||||
if obj.obj_n == 0x113 then
|
||||
@ -44,16 +44,15 @@ else
|
||||
--not magical
|
||||
local has_charge = false
|
||||
local child
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
if child.obj_n == 0x150 then --charge
|
||||
has_charge = true
|
||||
print("\nIt shows a charge of " .. magic_spell_name(child.quality) .. ".\n")
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if has_charge == false then
|
||||
print("\nIt's not magical.\n")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -13,7 +13,7 @@ local actor_int = actor_int_adj(caster)
|
||||
|
||||
if actor_int >= dice_roll then
|
||||
local child
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
if child.obj_n == 337 then --effect
|
||||
found = true
|
||||
print("\nIt's trapped.\n");
|
||||
|
@ -19,4 +19,3 @@ if obj.obj_n == 122 or --candle
|
||||
end
|
||||
|
||||
return magic_no_effect()
|
||||
|
||||
|
@ -8,14 +8,14 @@ fade_actor_blue(actor)
|
||||
if actor.alive == true then
|
||||
local hp = actor.hp
|
||||
local max_hp = actor.max_hp
|
||||
|
||||
|
||||
hp = hp + math.random(1, 0x1e)
|
||||
if hp > max_hp then
|
||||
hp = max_hp
|
||||
end
|
||||
|
||||
|
||||
actor.hp = hp
|
||||
|
||||
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
|
@ -7,4 +7,4 @@ party_heal()
|
||||
player_move(0x133, 0x160, 0, true)
|
||||
get_LB_to_throne()
|
||||
|
||||
fade_in() --FIXME the original fades from current location. We fade from black.
|
||||
fade_in() --FIXME the original fades from current location. We fade from black.
|
||||
|
@ -14,7 +14,7 @@ if obj.obj_n == 122 or --candle
|
||||
else
|
||||
obj.frame_n = obj.frame_n + 1;
|
||||
end
|
||||
|
||||
|
||||
return magic_success()
|
||||
end
|
||||
elseif obj.obj_n == 0xdf and obj.frame_n == 0 then --unlit keg
|
||||
|
@ -1,3 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_INFRAVISION, 0x14)
|
||||
timer_set(TIMER_INFRAVISION, 0x14)
|
||||
|
@ -6,17 +6,17 @@ if actor == nil then return end
|
||||
local random = math.random
|
||||
|
||||
if (((actor_dex_adj(actor) / 2) + 0x1e) - actor_int_adj(caster)) / 2 <= random(1, 0x1e) then
|
||||
|
||||
|
||||
print("\n")
|
||||
|
||||
|
||||
local dmg = random(1, 0xa)
|
||||
local exp = actor_hit(actor, dmg)
|
||||
if exp ~= 0 then
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
|
||||
actor_hit_msg(actor)
|
||||
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
|
||||
else
|
||||
|
@ -22,4 +22,4 @@ else
|
||||
g_vanish_obj.obj_n = 0
|
||||
g_vanish_obj.frame_n = 0
|
||||
magic_success()
|
||||
end
|
||||
end
|
||||
|
@ -1,12 +1,12 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17d, caster)
|
||||
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
|
||||
local ret = spell_put_actor_to_sleep(caster,actor)
|
||||
|
||||
|
||||
if ret == 1 then
|
||||
magic_failed()
|
||||
elseif ret == 2 then
|
||||
magic_no_effect()
|
||||
end
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ magic_casting_fade_effect()
|
||||
if obj == nil then magic_no_effect() return end
|
||||
|
||||
fade_obj_blue(obj)
|
||||
|
||||
|
||||
if (obj.obj_n >= 297 and obj.obj_n <= 300) or obj.obj_n == 98 then -- if door or chest
|
||||
|
||||
-- find existing effect in obj container.
|
||||
|
@ -10,7 +10,7 @@ fade_obj_blue(obj)
|
||||
|
||||
if (obj.obj_n >= 297 and obj.obj_n <= 300) or obj.obj_n == 98 then -- if door or chest
|
||||
local child
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
for child in container_objs(obj) do -- look through container for effect object.
|
||||
if child.obj_n == 337 then --effect
|
||||
found = true
|
||||
Obj.removeFromCont(child)
|
||||
|
@ -1,16 +1,16 @@
|
||||
local caster = magic_get_caster()
|
||||
local obj = select_obj_with_projectile(0x17f, caster)
|
||||
|
||||
|
||||
if obj == nil then return end
|
||||
|
||||
if tile_get_flag(obj.tile_num, 3, 3) == true then
|
||||
g_vanish_obj.obj_n = obj.obj_n
|
||||
g_vanish_obj.frame_n = obj.frame_n
|
||||
|
||||
|
||||
fade_obj_out(obj)
|
||||
map_remove_obj(obj)
|
||||
|
||||
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
end
|
||||
|
@ -1,9 +1,9 @@
|
||||
local actor = select_actor_with_projectile(0x17f)
|
||||
|
||||
|
||||
if actor == nil then return end
|
||||
if is_god_mode_enabled() and actor.in_party then
|
||||
return
|
||||
end
|
||||
actor.cursed = true
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -20,4 +20,3 @@ end
|
||||
|
||||
obj = nil
|
||||
magic_no_effect()
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local caster = magic_get_caster()
|
||||
local actor = select_actor_with_projectile(0x17e, caster)
|
||||
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
spell_take_fire_dmg(caster, actor)
|
||||
|
||||
spell_take_fire_dmg(caster, actor)
|
||||
|
@ -23,4 +23,3 @@ elseif obj.obj_n == 0x62 and (obj.frame_n == 1 or obj.frame_n == 2) then
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
local loc = select_location_with_projectile(0x18b)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
|
||||
local hit_items = explosion(0x17f,loc.x,loc.y)
|
||||
|
||||
|
||||
local k,v
|
||||
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
v.asleep = false
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -4,7 +4,7 @@ local loc = select_location_with_projectile(0x18b, caster)
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17d,loc.x,loc.y)
|
||||
|
||||
|
||||
local k,v
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
@ -13,4 +13,4 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -1,6 +1,6 @@
|
||||
local actor = select_actor_with_projectile(0x17f)
|
||||
|
||||
|
||||
if actor == nil then return end
|
||||
|
||||
|
||||
actor.protected = true
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -8,4 +8,4 @@ if obj_is_readiable(obj) then
|
||||
magic_success()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
end
|
||||
|
@ -10,7 +10,7 @@ local obj_n = 0
|
||||
|
||||
if i <= 3 then
|
||||
obj_n = 0x173 --troll
|
||||
elseif i <= 6 then
|
||||
elseif i <= 6 then
|
||||
obj_n = 0x156 --giant rat
|
||||
elseif i <= 9 then
|
||||
obj_n = 0x169 --giant spider
|
||||
@ -39,4 +39,4 @@ for i=1,8 do
|
||||
end
|
||||
end
|
||||
|
||||
magic_failed()
|
||||
magic_failed()
|
||||
|
@ -7,4 +7,4 @@ if actor == nil then magic_no_effect() return end
|
||||
|
||||
if spell_hit_actor(caster, actor, 50) == false then -- 50 = disable spell number
|
||||
magic_failed()
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,7 @@
|
||||
loc = select_location_with_projectile(0x17e)
|
||||
|
||||
if loc == nil then return end
|
||||
|
||||
|
||||
if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
obj = Obj.new(317); --fire field
|
||||
obj.temporary = true
|
||||
@ -11,4 +11,4 @@
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
end
|
||||
|
@ -11,4 +11,4 @@ if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
end
|
||||
|
@ -11,4 +11,4 @@ if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
magic_success()
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
local dir = get_direction("Direction-")
|
||||
print("`"..direction_string(dir).."\n")
|
||||
|
||||
wind_set_dir(dir)
|
||||
wind_set_dir(dir)
|
||||
|
@ -12,4 +12,3 @@ if map_can_put_obj(loc) and map_is_water(loc.x,loc.y,loc.z) == false then
|
||||
else
|
||||
magic_not_possible()
|
||||
end
|
||||
|
||||
|
@ -4,7 +4,7 @@ local loc = select_location_with_projectile(0x189, caster)
|
||||
if loc == nil then return end
|
||||
|
||||
local hit_items = explosion(0x17e, loc.x,loc.y)
|
||||
|
||||
|
||||
for k,v in pairs(hit_items) do
|
||||
if v.luatype == "actor" then
|
||||
spell_take_fire_dmg(caster, v)
|
||||
@ -14,4 +14,4 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
end
|
||||
|
||||
explode_surrounding_objects(loc.x, loc.y, loc.z)
|
||||
explode_surrounding_objects(loc.x, loc.y, loc.z)
|
||||
|
@ -23,4 +23,4 @@ for i=1,8 do
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -10,4 +10,3 @@ if actor.visible == true and actor_can_turn_invisible(actor.obj_n) == true then
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
|
||||
|
@ -6,12 +6,12 @@ if actor == nil then return end
|
||||
if caster_is_player() then
|
||||
print("\n")
|
||||
end
|
||||
|
||||
|
||||
local exp = actor_hit(actor, math.random(1, 30))
|
||||
if exp ~= 0 then
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
|
||||
actor_hit_msg(actor)
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
|
@ -14,4 +14,3 @@ print(actor.name.." is paralyzed.\n")
|
||||
if actor.in_party == true then
|
||||
party_update_leader()
|
||||
end
|
||||
|
||||
|
@ -30,4 +30,4 @@ for i=1,8 do
|
||||
end
|
||||
end
|
||||
|
||||
magic_no_effect()
|
||||
magic_no_effect()
|
||||
|
@ -1 +1 @@
|
||||
magic_wind_spell(83, 0x18d)
|
||||
magic_wind_spell(83, 0x18d)
|
||||
|
@ -8,4 +8,4 @@ print("\n")
|
||||
|
||||
hail_storm_effect(loc)
|
||||
|
||||
print("\nSuccess\n")
|
||||
print("\nSuccess\n")
|
||||
|
@ -14,4 +14,3 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
|
||||
magic_success()
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_STORM, 0x14)
|
||||
|
||||
|
@ -6,21 +6,21 @@ if obj == nil then return end
|
||||
if tile_get_flag(obj.tile_num, 3, 3) == true then
|
||||
|
||||
local replicated_obj = Obj.new(obj.obj_n, obj.frame_n)
|
||||
|
||||
|
||||
replicated_obj.qty = 1
|
||||
replicated_obj.status = 0x21 --OK, TEMP
|
||||
|
||||
|
||||
local loc = {}, i
|
||||
local random = math.random
|
||||
local caster_x = caster.x
|
||||
local caster_y = caster.y
|
||||
|
||||
|
||||
loc.z = caster.z
|
||||
|
||||
|
||||
for i=1,8 do
|
||||
loc.x = caster_x + random(0, 10) - 5
|
||||
loc.y = caster_y + random(0, 10) - 5
|
||||
|
||||
|
||||
if map_can_put_obj(loc) == true then
|
||||
Obj.moveToMap(replicated_obj, loc)
|
||||
fade_obj_in(replicated_obj)
|
||||
@ -28,8 +28,8 @@ if tile_get_flag(obj.tile_num, 3, 3) == true then
|
||||
return magic_success()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
magic_failed()
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
end
|
||||
|
@ -35,4 +35,4 @@ for k,v in ipairs(targets) do
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -6,7 +6,7 @@ if actor == nil then return end
|
||||
local random = math.random
|
||||
|
||||
local exp = actor_hit(actor, random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
@ -47,20 +47,20 @@ for i=0,6 do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if new_target == nil then
|
||||
break
|
||||
end
|
||||
|
||||
|
||||
projectile(0x188, actor.x, actor.y, new_target.x, new_target.y, 2, 0)
|
||||
|
||||
|
||||
actor = new_target
|
||||
|
||||
|
||||
local exp = actor_hit(actor, random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
|
||||
actor_yell_for_help(caster, actor, 1)
|
||||
actor_hit_msg(actor)
|
||||
end
|
||||
end
|
||||
|
@ -18,13 +18,13 @@ if spell_num ~= nil then
|
||||
for child in container_objs(obj) do
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
|
||||
if i >= 10 then
|
||||
print("\nIt's full\n")
|
||||
play_sfx(SFX_FAILURE)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
magic_casting_fade_effect(caster)
|
||||
local charge = Obj.new(336,0, spell_num)
|
||||
charge.invisible = true
|
||||
|
@ -25,4 +25,4 @@ for x = x - 5,loc_x + 5 do
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -10,5 +10,3 @@ if ret == 2 then
|
||||
elseif ret == 1 then
|
||||
magic_failed()
|
||||
end
|
||||
|
||||
|
||||
|
@ -16,4 +16,3 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
|
||||
magic_success()
|
||||
|
||||
|
@ -16,4 +16,4 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -16,7 +16,7 @@ for i=1,0xff do
|
||||
|
||||
local target_x = actor.x
|
||||
local target_y = actor.y
|
||||
|
||||
|
||||
if actor.z == player_z and target_x > player_x - 5 and target_x < player_x + 5 and target_y > player_y - 5 and target_y < player_y + 5 then
|
||||
wing_strike_effect(actor)
|
||||
foes_present = true
|
||||
@ -31,4 +31,3 @@ if foes_present == false then
|
||||
print("\nNo foes.\n")
|
||||
play_sfx(SFX_FAILURE)
|
||||
end
|
||||
|
||||
|
@ -5,4 +5,4 @@ local loc = caster_get_location()
|
||||
|
||||
wizard_eye_effect(0x28, loc)
|
||||
|
||||
print("\nDone\n")
|
||||
print("\nDone\n")
|
||||
|
@ -6,4 +6,4 @@ for i=1,0xff do
|
||||
if i ~= 1 and i ~= 5 and actor ~= nil and actor.alive then --don't kill the Avatar or Lord British.
|
||||
Actor.kill(actor, false) --false = don't create body
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,2 +1 @@
|
||||
magic_wind_spell(113, 0x18c)
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_ECLIPSE, 0x14)
|
||||
|
||||
|
@ -13,4 +13,4 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
end
|
||||
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -17,4 +17,4 @@ for k,v in pairs(hit_items) do
|
||||
end
|
||||
|
||||
explode_surrounding_objects(loc.x, loc.y, loc.z)
|
||||
magic_success()
|
||||
magic_success()
|
||||
|
@ -23,5 +23,3 @@ if obj ~= nil and g_armageddon == false then
|
||||
else
|
||||
magic_no_effect()
|
||||
end
|
||||
|
||||
|
||||
|
@ -12,10 +12,10 @@ for x = loc.x - 5,loc.x + 5 do
|
||||
|
||||
if actor ~= nil then
|
||||
local actor_type = actor_tbl[actor.obj_n]
|
||||
|
||||
|
||||
if actor.align == ALIGNMENT_EVIL and (actor_type == nil or actor_type[12] == 0) then
|
||||
if actor_int_check(actor, caster) == false then
|
||||
|
||||
|
||||
local old_tile_num = actor.tile_num
|
||||
actor.base_obj_n = 0x177 --convert actor into slime
|
||||
local new_tile_num = actor.tile_num
|
||||
@ -28,7 +28,7 @@ for x = loc.x - 5,loc.x + 5 do
|
||||
local obj
|
||||
for obj in actor_inventory(actor) do
|
||||
Actor.inv_remove_obj(actor, obj)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -1,4 +1,3 @@
|
||||
local caster = magic_get_caster()
|
||||
loc = player_get_location()
|
||||
actor = Actor.new(367, loc.x, loc.y-1, loc.z, caster.align, 8)
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
magic_casting_fade_effect()
|
||||
magic_casting_effect()
|
||||
timer_set(TIMER_TIME_STOP, 0xa)
|
||||
|
||||
|
@ -22,7 +22,7 @@ for x = x - 5,loc_x + 5 do
|
||||
local actor_base = actor_tbl[actor.obj_n]
|
||||
if actor_base == nil or actor_base[13] == 0 then -- 13 is immune to tremor
|
||||
local exp = actor_hit(actor, random(1, 0x1e))
|
||||
if exp ~= 0 then
|
||||
if exp ~= 0 then
|
||||
caster.exp = caster.exp + exp
|
||||
end
|
||||
|
||||
@ -37,4 +37,3 @@ for x = x - 5,loc_x + 5 do
|
||||
end
|
||||
|
||||
print("\nSuccess\n")
|
||||
|
||||
|
@ -16,26 +16,26 @@ function use_telescope(obj, actor)
|
||||
local dir_string = direction_string(dir)
|
||||
dir_string = dir_string:gsub("^%l", string.upper)
|
||||
print(dir_string..".\n")
|
||||
|
||||
|
||||
local loc = mapwindow_get_location()
|
||||
|
||||
|
||||
--FIXME need to fade out blacking.
|
||||
|
||||
|
||||
mapwindow_set_enable_blacking(false)
|
||||
|
||||
|
||||
for i=0,40 do
|
||||
loc.x,loc.y = direction_get_loc(dir,loc.x, loc.y)
|
||||
mapwindow_set_location(loc.x, loc.y, loc.z)
|
||||
script_wait(50)
|
||||
end
|
||||
|
||||
|
||||
script_wait(600)
|
||||
|
||||
|
||||
mapwindow_set_enable_blacking(true)
|
||||
|
||||
|
||||
mapwindow_center_at_location(actor.x, actor.y, actor.z)
|
||||
print("\nDone\n")
|
||||
|
||||
|
||||
end
|
||||
|
||||
function use_silver_horn(obj, actor)
|
||||
@ -47,15 +47,15 @@ function use_silver_horn(obj, actor)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local random = math.random
|
||||
|
||||
|
||||
for i=1,3 do
|
||||
local new_x = random(1, 7) + random(1, 7) + actor.x - 8
|
||||
local new_y = random(1, 7) + random(1, 7) + actor.y - 8
|
||||
local snake = Actor.new(413, new_x, new_y, actor.z, ALIGNMENT_CHAOTIC)
|
||||
end
|
||||
|
||||
|
||||
print("Silver snakes are generated!\n")
|
||||
end
|
||||
|
||||
@ -91,4 +91,4 @@ end
|
||||
|
||||
function is_ranged_select(operation)
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user