Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,291 @@
--Actor stats table
--[objnum] = {str,dex,int,hp,dmg,alignment,can talk,drops blood,?,?,?,lives in water,flies-immune to tremor,repel undead (not used anymore),poisonous,strength_based,double dmg from fire,immune to magic (fire only),immune to poison,undead and immune to death spells,immune to sleep spell,{spell table},{weapon table},{armor table},{treasure table},exp_related see actor_hit()}
actor_tbl = {
--carnivorous orchid
[282] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--serpent woman
[283] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--baby apatosaurus
[284] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--baby apatosaurus
[285] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--apatosaurus
[286] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--apatosaurus
[287] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--pteranodon
[288] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--allosaurus
[289] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--allosaurus
[290] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--wisp
[291] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--carnivorous orchid
[292] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--tyrannosaurus
[293] = {30, 28, 255, 3, 255, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--tyrannosaurus
[294] = {30, 28, 255, 3, 255, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--tyrannosaurus
[295] = {30, 28, 255, 3, 255, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--gorilla
[296] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--robosaurus
[297] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--robosaurus
[298] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--baby pteranodon
[299] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--plesiosaur
[300] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--argent sergeant
[301] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--turtle
[302] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--stegosaurus
[303] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--stegosaurus
[304] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--triceratops
[305] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--triceratops
[306] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--party member on turtle
[307] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--snake
[308] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--alphadon
[309] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--modern man
[310] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--professor
[311] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--reporter
[312] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--woman
[313] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--shaman
[314] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--chieftain
[315] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--man
[316] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--parrot
[317] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--Sakkhra
[318] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--automaton
[319] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--man
[320] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--woman
[321] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--noble
[322] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--myrmidex drone
[323] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--woman
[324] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--neanderthal
[325] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--man
[326] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--ankylosaurus
[327] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--Myrmidex queen
[328] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--dancer
[329] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--deinonychus
[330] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--sabretooth tiger
[331] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--sloth
[332] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--jaguar
[333] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--dimetrodon
[334] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--bear
[335] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--giant spider
[336] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0},
--eohippus
[337] = {1, 28, 4, 3, 1, ALIGNMENT_NEUTRAL, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {}, {}, {}, {}, 0}
}
function actor_map_dmg(actor, map_x, map_y, map_z)
--FIXME
end
function actor_update_all()
--FIXME
end
-- [objectnum] = range
g_range_weapon_tbl = {
[1] = 5, -- spear of shamap
[21] = 4, --black staff --FIXME: only ranged weapon when Myrmidex are near
[26] = 6, -- spear
[27] = 4, -- throwing axe
[31] = 5, -- bow
[32] = 4, -- blowgun
[37] = 7, -- atl atl better than spear (whole screen)
[3] = 4, -- boomerang
[44] = 4, -- knife
[40] = 7, --modern rifle (whole screen)
[50] = 7, --bamboo flintlock (whole screen)
[138] = 6, --grenade
[139] = 6, --lit grenade
[240] = 6, --device
[241] = 6 --activated device
}
local projectile_weapon_tbl =
{
--obj_n = {tile_num, initial_tile_rotation, speed, rotation_amount}
[1] = {512, 45, 3, 0}, -- spear of shamap
[21] = {266, 90,4, 0}, --black staff --FIXME: rot, speed, amount
[26] = {547, 45,3, 0}, -- spear
[27] = {548, 0, 2, 10}, -- throwing axe
[31] = {566, 90,4, 0}, -- bow
[32] = {557, 90,4, 0}, --blowgun --CHECKME: rot, speed, amount
[37] = {547, 45,3, 0}, --atl atl
[39] = {560, 0, 4, 10}, -- boomerang
[44] = {565, 0, 2, 10}, -- knife
[40] = {562, 90,4, 0}, --modern rifle --FIXME: tile_num, rot, speed, amount
[50] = {562, 90,4, 0}, --bamboo flintlock --FIXME: tile_num, rot, speed, amount
[137] = {701, 90,4, 0}, --grenade --FIXME: tile_num, rot, speed, amount
[138] = {701, 90,4, 0}, --grenade --FIXME: tile_num, rot, speed, amount
[240] = {1029, 90,4, 0}, --device --FIXME: tile_num, rot, speed, amount
[241] = {1029, 90,4, 0} --activated device --FIXME: tile_num, rot, speed, amount
}
weapon_dmg_tbl = { --FIXME: all damage is made up
[1] = 15, -- spear of shamap (causes sleep)
[21] = 8, --black staff (extra damage vs Myrmidex)
[24] = 10, --club
[25] = 6, --obsidian knife
[26] = 15, --spear
[27] = 10, --throwing axe
[28] = 15, --axe
[29] = 15, --rock hammer
[31] = 15, --bow
[32] = 2, --blowgun (poisons)
[33] = 25, --obsidian sword
[34] = 20, --two-handed hammer
[37] = 25, --atl atl
[39] = 8, --boomerang
[40] = 20, --modern rifle
[44] = 10, --knife
[50] = 12, --bamboo flintlock
--[52] = 1, --scissors (says bare handed)
[94] = 15, --fire extingisher
[118] = 30, --fire axe
[119] = 15, --metal hammer
[128] = 4, --bamboo pole
--[131] = 1, --digging stick (says bare handed)
[137] = 30, --grenade
[138] = 30, --lit grenade
--[208] = 1, --torch (says bare handed)
[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)
}
armour_tbl = --FIXME: all armor value is made up
{
[2] = 7, --shield of Krukk
[7] = 1, --cloth armor
[8] = 5, --leather armour
[9] = 2, --bark armor
[13] = 1, --bark shield
[14] = 3, --leather shield
[15] = 5, --stegosaurus shield
[67] = 10, --kotl shield (better vs Myrmidex?)
--[84] = 0, --tooth necklace
--[85] = 0, --jade necklace
--[135] = 0, --lei
--[600] = 0, --ring
}
function out_of_ammo(attacker, weapon, print_message) -- untest function
local weapon_obj_n = weapon.obj_n
if weapon_obj_n == 32 and Actor.inv_has_obj_n(attacker, 36) == false then --blowgun, poisoned darts
if(print_message) then
print("Out of darts!\n")
end
return true
end
if weapon_obj_n == 31 and Actor.inv_has_obj_n(attacker, 45) == false then --bow, arrows
if(print_message) then
print("Out of arrows!\n")
end
return true
end
if weapon_obj_n == 37 and Actor.inv_has_obj_n(attacker, 26) == false then --atl atl, spear
if(print_message) then
print("Out of spears!\n")
end
return true
end
if weapon_obj_n == 40 and Actor.inv_has_obj_n(attacker, 41) == false then --modern rifle, rifle bullet
if(print_message) then
print("Out of ammunition!\n")
end
return true
end
if weapon_obj_n == 50 and weapon.frame_n == 0 then --unloaded bamboo flintlock (frame 1 is loaded)
if(print_message) then
print("Flintlock not loaded!\n")
end
return true
end
return false
end
function actor_update_all()
dbg("actor_update_all()\n")
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
end
function can_get_obj_override(obj)
return false
end
function actor_get_obj(actor, obj) -- FIXME need to limit inventory slots
if obj.getable == false then
print("\nNot possible.")
return false
end
if Actor.can_carry_obj_weight(actor, obj) == false then
print("\nThe total is too heavy.")
return false
end
-- print("\nYou are carrying too much already.");
Obj.moveToInv(obj, actor.actor_num)
subtract_movement_pts(actor, 3)
return true
end
function player_post_move_action(did_move)
end

View File

@@ -0,0 +1,68 @@
local lua_file = nil
lua_file = nuvie_load("common/intro_common.lua"); lua_file();
function play()
local g_img_tbl = image_load_all("endgame.lzc")
-- 0,0 Party
-- 0,1 Lord British
-- 0,2 Aiela
-- 0,3 Tristia
-- 0,4 Leaving Savage Empire
local bg = sprite_new(g_img_tbl[0][0], 0, 0, true)
canvas_set_palette("savage.pal", 1)
canvas_set_opacity(0xff);
mouse_cursor_visible(false)
canvas_set_update_interval(25)
local txt = sprite_new(nil, 28, 135, true)
txt.text_color = 0
txt.text = i18n("IMG1_TXT1_END")
txt.text_align = 1
fade_in()
wait_for_input()
txt.text = i18n("IMG1_TXT2_END")
wait_for_input()
txt.text = i18n("IMG1_TXT3_END")
wait_for_input()
bg.image = g_img_tbl[0][1]
txt.text = i18n("IMG2_TXT1_END")
wait_for_input()
txt.text = i18n("IMG2_TXT2_END")
wait_for_input()
-- TODO: Add Check for Love with Aiela
bg.image = g_img_tbl[0][2]
txt.text = i18n("IMG3_TXT1_END")
wait_for_input()
txt.text = i18n("IMG3_TXT2_END")
wait_for_input()
txt.text = i18n("IMG3_TXT3_END")
wait_for_input()
-- TODO: Add Check for Love with Tristia
bg.image = g_img_tbl[0][3]
txt.text = i18n("IMG4_TXT1_END")
wait_for_input()
txt.text = i18n("IMG4_TXT2_END")
wait_for_input()
bg.image = g_img_tbl[0][4]
txt.text = i18n("IMG5_TXT1_END")
wait_for_input()
txt.text = i18n("IMG5_TXT2_END")
wait_for_input()
txt.text = i18n("IMG5_TXT3_END")
wait_for_input()
txt.text = i18n("IMG5_TXT4_END")
wait_for_input()
bg.image = g_img_tbl[0][1]
txt.text = i18n("IMG2_TXT3_END")
-- TODO - Add Years, Months, Days to String
wait_for_input()
end
play()

View File

@@ -0,0 +1,193 @@
local lua_file = nil
--load common functions
lua_file = nuvie_load("common/common.lua"); lua_file();
function dbg(msg_string)
--io.stderr:write(msg_string)
end
function load_game()
end
function save_game()
end
local g_tile_to_object_map = {
-- Trees
[50] = 5000, [51] = 5000, [64] = 5000, [65] = 5000, [66] = 5000,
[67] = 5000, [68] = 5000, [69] = 5000, [70] = 5000, [71] = 5000,
[72] = 5000, [192] = 5000, [193] = 5000, [194] = 5000, [195] = 5000,
[198] = 5000, [179] = 5000, [180] = 5000, [130] = 5000,
-- Oven Fire
[16] = 5001, [17] = 5001, [18] = 5001, [19] = 5001, [20] = 5001,
[21] = 5001, [22] = 5001, [23] = 5001, [24] = 5001, [25] = 5001,
[26] = 5001, [27] = 5001, [170] = 5001, [171] = 5001,
-- Yucca Plant
[52] = 5002,
}
function get_tile_to_object_mapping(tile_num)
return g_tile_to_object_map[tile_num]
end
local g_is_object_a_tile = {
[5000] = true, [5001] = true, [5002] = true
}
function is_tile_object(obj_num)
if g_is_object_a_tile[obj_num] ~= nil then
return true
end
return false
end
local g_container_obj_tbl = {
[59] = 1, [60] = 1, [97] = 1,
[182] = 1, [183] = 1, [184] = 1
}
function is_container_obj(obj_num)
if g_container_obj_tbl[obj_num] ~= nil then
return true
end
return false
end
function search(obj)
if obj.on_map == false then
return
end
local found_obj = false
local child
local first_loop = true
local prev_obj = nil
for child in container_objs(obj) do
if prev_obj ~= nil then
printfl("SEARCH_NEXT_OBJ", prev_obj.look_string)
Obj.moveToMap(prev_obj, obj.x, obj.y, obj.z)
end
if first_loop == true then
found_obj = true
printfl("SEARCHING_HERE_YOU_FIND", child.look_string)
Obj.moveToMap(child, obj.x, obj.y, obj.z)
else
prev_obj = child
end
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
local g_readiable_objs_tbl = {
-- 0 = head
-- 1 = neck
[630] = 1, --tooth necklace
[631] = 1, --jade necklace
[696] = 1, --lei
-- 3 = 1 handed
[512] = 3, --spear of shamap
[541] = 3, --black staff
[545] = 3, --club
[546] = 3, --obsidian knife
[547] = 3, --spear
[548] = 3, --throwing axe
[549] = 3, --axe
[550] = 3, --rock hammer
[554] = 3, --obsidian sword
[558] = 3, --atl atl
[560] = 3, --boomerang
[565] = 3, --knife
[574] = 3, --scissors
[677] = 3, --metal hammer
[700] = 3, --grenade
[701] = 3, --lit grenade
[900] = 3, --torch
[901] = 3, --lit torch
[1028] = 3, --device
[1029] = 3, --activated device
-- 2 = torso
[518] = 2, --cloth armor
[519] = 2, --leather armour
[520] = 2, --bark armor
-- 3 = shield hand
[513] = 3, --shield of krukk
[524] = 3, --bark shield
[525] = 3, --leather shield
[526] = 3, --stegosaurus shield
[606] = 3, --kotl shield
-- 7 = feet
-- 4 = two handed - FIXME: guns (561, 571, 572) can't be equipped by natives
[552] = 4, --bow
[553] = 4, --blowgun
[553] = 4, --two handed hammer
[561] = 4, --modern rifle
[571] = 4, --bamboo flintlock
[572] = 4, --loaded bamboo flintlock
[640] = 4, --fire extinguisher
[676] = 4, --fire axe
[689] = 4, --bamboo pole
[692] = 4, --digging stick
[904] = 4, --fishing pole
-- 9 = finger
[600] = 9, --ring (not equipable in original)
}
function obj_is_readiable(obj)
if g_readiable_objs_tbl[obj.tile_num] ~= nil then
return true
end
return false
end
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
end
function create_object_needs_quan(obj_n)
-- obj.stackable is already checked
return false
end
function talk_to_obj(obj)
printl("NOTHING")
return false
end
--load actor functions
local actor_load = nuvie_load("se/actor.lua");
if type(actor_load) == "function" then
actor_load()
else
if type(actor_load) == "string" then
--io.stderr:write(actor_load);
end
end
look_init = nuvie_load("se/look.lua"); look_init();
-- init usecode
usecode_init = nuvie_load("se/usecode.lua"); usecode_init();
player_init = nuvie_load("se/player.lua"); player_init();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
return {
PASS="Pass!\n",
YOU_SEE="you see %s",
NOTHING="nothing!\n",
SEARCHING_HERE_YOU_FIND="Searching here, you find %s",
SEARCHING_HERE_YOU_FIND_NOTHING="Searching here, you find nothing.\n",
SEARCH_NEXT_OBJ=", %s",
SEARCH_LAST_OBJ=" and %s",
OUT_OF_RANGE="Out of Range!\n",
BLAH="Blah",
CARRY_TOO_MUCH="You are carrying too much already.\n",
GOT_CORN="You got some corn from the plant.\n",
USE_CLAY="You shaped a small, soft pot from the clay.\n",
USE_FISHING_POLE_NO_WATER="You need to stand next to deep water.\n",
USE_FISHING_POLE_FAIL="You didn't get a fish.\n",
USE_FISHING_POLE_SUCCESS="You caught a fish!\n",
USE_DIGGING_STICK_NO_WATER="There is nothing to dig!\n",
USE_DIGGING_STICK="You get some clay.\n",
USE_YUCCA_PLANT="You got some flax from the yucca plant.\n",
USE_TREE="You pulled a branch from the tree.\n",
IMG1_TXT1_END="Members of all the tribes come for the feast... the largest and most important feast ever held in the Valley of Eodon.",
IMG1_TXT2_END="Kurak sits beside Yolaru, Pindiro beside Barako, Haakur beside Sakkhra, and peace is sworn between the tribes.",
IMG1_TXT3_END="You know this peace isn't for you. Soon enough, you will hear the call to action again. But tonight, there is time for music and dance, friendship and love.",
IMG2_TXT1_END="At dawn, your past catches up with you... and your future beckons. A vision of Lord British appears before you.",
IMG2_TXT2_END="\"You have done well,\" he says. \"But now I must take you where you are needed. For the sake of the friends you leave behind, I am sorry. Prepare yourself.\"",
IMG3_TXT1_END="You say farewell to Aiela. \"Aiela does not know your world. Take her there,\" she pleads. \"Teach her of your world.",
IMG3_TXT2_END="You shake your head. \"My world would strangle you. You must stay. My heart remains with you. But my duty is elsewhere... with him.\"",
IMG3_TXT3_END="Tears roll down her cheeks. \"Abandon duty, and you will not be warrior Aiela loves. Choose duty, and you must leave. Either way, Aiela loses all... Farewell.\"",
IMG4_TXT1_END="You say farewell to Tristia. \"I must go with Lord British,\" you say. \"My duty lies with him, though it breaks my heart.\"",
IMG4_TXT2_END="Tristia laughs sweetly. \"Tristia does not mind,\" she says. \"Tristia has found another loves: handsome Botorok. Botorok is so much better than you. Go with your chief. Go.\"",
IMG5_TXT1_END="You are joined by Spector's former assistant, Fritz, who came out of hiding to fight the Myrmidex, and bears their scars.",
IMG5_TXT2_END="The moongate appears, summoned by the shade of Lord British. Jimmy, Spector and Fritz gather their belongs...",
IMG5_TXT3_END="But Rafkin does not. \"I'm staying, my friend,\" he says, \"Someone must. I will stay here... and hope other scientists come. Farewell.\"",
IMG5_TXT4_END="Saddened, you follow your friends and allies into the moongate, leaving the Valley of Eodon. Perhaps someday you will return to those you have left behind.",
IMG2_TXT3_END="CONGRATULATIONS. You have completed THE SAVAGE EMPIRE in XXTIMESTRXX. Communicate your success to Lord British at Origin!",
}

View File

@@ -0,0 +1,25 @@
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

View File

@@ -0,0 +1,16 @@
function player_pass()
printl("PASS")
end
--returns true if the player can move to rel_x, rel_y
function player_before_move_action(rel_x, rel_y)
return true
end
function player_post_move_action(did_move)
end
function player_attack()
--FIXME
end

View File

@@ -0,0 +1,256 @@
local USE_EVENT_USE = 0x01
-- Returns true if the actor has the item or a container with the item
function actor_has_item(actor, obj)
local tobj = obj
while tobj.in_container do
tobj = tobj.parent
end
if tobj.on_map == false and
tobj.parent.luatype == "actor" and
tobj.parent.actor_num == actor.actor_num then
return true
end
return false
end
-- Check Reachable
-- A) Next to actor passed in
-- B) In inventory of any party member
-- Return actor that can reach object or nil
-- Optionally automatically print "Out of Range!" message
function check_can_reach(obj, actor, print_msg)
if math.abs(obj.x - actor.x) <= 1 and
math.abs(obj.y - actor.y) <= 1 and
obj.z == actor.z then
return actor
end
for party_member in party_members() do
if actor_has_item(party_member, obj) == true then
return party_member
end
end
if print_msg then
printl("OUT_OF_RANGE")
end
return nil
end
-- delete an object from inventory or remove it from the map
function delete_or_remove_object(actor, obj, qty)
-- FIXME: Remove the exact object from the Actor
if Actor.inv_has_obj_n(actor, obj.obj_n) then
if qty ~= nil then
Actor.inv_remove_obj_qty(actor, obj.obj_n, qty)
else
Actor.inv_remove_obj(actor, obj)
end
-- Remove the object from the map
else
if qty ~= nil then
map_remove_obj(obj, qty)
else
map_remove_obj(obj)
end
end
end
-- create and add item to actor, qty if stackable, drop if required to create the item,
-- obj_n: Item Code to Create
-- actor: actor to get the object
-- qty: how many (or nil)
-- drop_if_fail: if true, object gets put on the map on failure
-- print_msg: if true, prints the carry too much message on failure
function add_item_to_actor(obj_n, actor, qty, drop_if_fail, print_msg)
local new_obj = Obj.new(obj_n)
if qty ~= nil then
new_obj.qty = qty
else
new_obj.qty = 1
end
if Actor.can_carry_obj(actor, new_obj) then
if qty ~= nil then
Actor.inv_add_obj(actor, new_obj, STACK_OBJECT_QTY)
else
Actor.inv_add_obj(actor, new_obj, false)
end
else
if print_msg then
printl("CARRY_TOO_MUCH")
end
return false
end
return true
end
function use_corn_stalk(obj, actor)
local use_actor = check_can_reach(obj, actor, true)
if use_actor == nil then
return
end
if add_item_to_actor(108, use_actor, 1, false, true) == true then
printl("GOT_CORN")
end
end
function use_tree(obj, actor)
local use_actor = check_can_reach(obj, actor, true)
if use_actor == nil then
return
end
if add_item_to_actor(206, use_actor, 1, false, true) == true then
printl("USE_TREE")
end
end
function use_yucca_plant(obj, actor)
local use_actor = check_can_reach(obj, actor, true)
if use_actor == nil then
return
end
if add_item_to_actor(210, use_actor, 1, false, true) == true then
printl("USE_YUCCA_PLANT")
end
end
function use_clay(obj, actor)
local use_actor = check_can_reach(obj, actor, true)
if use_actor == nil then
return
end
-- delete clay
local location_code = delete_or_remove_object(use_actor, obj, nil)
if add_item_to_actor(132, use_actor, nil, false, false) == true then
printl("USE_CLAY")
end
-- TODO: IF ADD FAILED, PUT CLAY BACK WHERE IT WAS
end
function use_fishing_pole(obj, actor)
local use_actor = check_can_reach(obj, actor, true)
if use_actor == nil then
return
end
-- Check Deep Water
-- if <<Standing Next to Deep Water>> then
printl("USE_FISHING_POLE_NO_WATER")
-- end
-- Check Success
-- if random() == SUCCESS then
if add_item_to_actor(192, use_actor, nil, false, false) == true then
-- add_item without print
-- if SUCCESS then
printl("USE_FISHING_POLE_SUCCESS")
end
-- end
printl("USE_FISHING_POLE_FAIL")
end
function use_digging_stick(obj, actor)
local use_actor = check_can_reach(obj, actor, true)
if use_actor == nil then
return
end
-- Check Water
-- if <<Standing Next to Water>> then
printl("USE_DIGGING_STICK_NO_WATER")
-- end
if add_item_to_actor(192, use_actor, 1, false, true) == true then
printl("USE_DIGGING_STICK")
end
end
local usecode_table = {
[61]=use_corn_stalk,
[131]=use_digging_stick,
[192]=use_clay,
[212]=use_fishing_pole,
[5000]=use_tree,
[108]=use_tree,
[5001]=use_oven_or_fire,
[5002]=use_yucca_plant,
--[[
[62]=use_bean_stalk,
--[127]=use_bamboo_plant, -- confirmed
[132]=use_soft_clay_pot, -- confirmed
[133]=use_fired_clay_pot, -- confirmed
[134]=use_cloth_strip, -- confirmed
[191]=use_tarred_cloth_strip, -- confirmed
[210]=use_flax, -- confirmed
]]--
--[[
[10]=use_magnesium_ribbon, -- confirmed
[12]=use_paddle, -- confirmed
[20]={["on"]=use_rope},
[25]={["on"]=use_cutting_tool}, -- confirmed (obsidian knife)
[29]=use_rock_hammer, -- confirmed (rock hammer)
[42]=use_vine, -- confirmed (vine)
[44]={["on"]=use_cutting_tool}, -- confirmed (knife)
[47]=use_turtle_bait,
[51]=use_camera,
[52]={["on"]=use_cutting_tool}, -- confirmed (scissors)
[54]={["on"]=use_chocolatl}, --Original required using totem on reagent
[55]={["on"]=use_pinde}, -- confirmed
[56]={["on"]=use_yopo}, -- confirmed
[59]=use_grinding_stone, -- confirmed (mortar)
[60]=use_grinding_stone, -- confirmed (grinding stone)
[63]=use_jug_of_platcha,
[64]=use_torch,
[75]=standing_torch, -- confirmed (almost certainly can't use)
[86]=use_heluzz, -- confirmed
[87]=use_motazz, -- confirmed
[88]=use_aphazz, -- confirmed
[93]=use_corn_meal,
[94]=use_fire_extinguisher, -- confirmed
[102]=use_tortilla, -- confirmed
[108]=use_corn, -- confirmed
[118]=use_fire_axe, -- confirmed
[119]=use_metal_hammer, -- confirmed
[128]=use_bamboo_pole, -- confirmed
[136]=use_metal_bucket, -- confirmed
[137]=use_grenade, -- confirmed
[153]=use_vine(corn_stalk)???, -- confirmed
[206]=use_tree_branch, -- confirmed
[208]=use_torch,
[240]=use_device, -- confirmed Explosive Device
[267]=use_device2 -- confirmed Compass Device? USE?
]]--
}
function has_usecode(obj, usecode_type)
if usecode_type == USE_EVENT_USE and usecode_table[obj.obj_n] ~= nil then
return true
end
return false
end
function use_obj(obj, actor)
if type(usecode_table[obj.obj_n]) == "function" then
local func = usecode_table[obj.obj_n]
if func ~= nil then
print("\n")
func(obj, actor)
end
else
use_obj_on(obj, actor, usecode_table[obj.obj_n])
end
end
function move_obj(obj, rel_x, rel_y)
return false
end
function is_ranged_select(operation)
return false
end