363 lines
10 KiB
Text
363 lines
10 KiB
Text
|
|
/* synthesized appendix for ELEVATOR */
|
|
/* sparse lines above preserve recovered debugger line numbers where available */
|
|
|
|
/* ===== slot 0x06 gotHit ===== */
|
|
function elevator_gotHit() /* entry=83 class_id=0x0190 slot=0x06 */
|
|
{
|
|
set_info(0x020C, *(arg_06));
|
|
process_exclude();
|
|
if (arg_0A >= 0x0100) {
|
|
local_02 = arg_0A;
|
|
NPC.slot_2A(local_02);
|
|
if (!retval) {
|
|
spawn ITEM.slot_2A(pid, 0, 2, local_02);
|
|
suspend;
|
|
while (Actor.isDead(local_02)) {
|
|
}
|
|
}
|
|
}
|
|
if ((arg_0A == 1) || (Ultima8Engine.getUnkCrusaderFlag() != 1)) {
|
|
return;
|
|
}
|
|
else if (Item.getQLo(arg_06) >= 100) {
|
|
/* str_to_ptr */
|
|
/* free_stack_string value_u8=0x4 target=[SP+04h] */
|
|
suspend;
|
|
return;
|
|
}
|
|
else {
|
|
/* pop_global global_id=0x9 size=0x1 */
|
|
FREE.slot_3C(0x0220, 0);
|
|
/* global_address global_id=0x1E */
|
|
while (!Actor.isBusy()) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
if (!Actor.isDead()) {
|
|
return;
|
|
}
|
|
else {
|
|
/* global_address global_id=0x1E */
|
|
if (!Intrinsic0061()) {
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
}
|
|
local_04 = arg_0A;
|
|
local_06 = Item.getQLo(arg_06);
|
|
local_08 = Item.getQHi(arg_06);
|
|
/* loopscr value_u8=0x24 */
|
|
/* loop current_var=0xFC string_bytes=0x1 loop_type=0x6 */
|
|
while (!condition) {
|
|
if (local_04 == *(arg_06)) {
|
|
if (!Item.isNpc(local_04)) {
|
|
if (local_04 == 1) {
|
|
local_0A = local_04;
|
|
}
|
|
}
|
|
else {
|
|
local_0C = Item.getShape(local_04);
|
|
}
|
|
}
|
|
/* loopnext */
|
|
}
|
|
set_info(0x0220, 0);
|
|
if (local_08 == 0) {
|
|
}
|
|
else {
|
|
local_08 = (local_08 - 1);
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
if (!Actor.isDead()) {
|
|
return;
|
|
}
|
|
else if (local_06 >= 0x00C8) {
|
|
/* global_address global_id=0x1E */
|
|
spawn ELEVATOR.slot_20(Actor.getMap(pid, local_06), local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00C8) {
|
|
spawn ELEVATOR.slot_20(pid, 18, 24, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00C9) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00C9, 5, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00CA) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00CA, 10, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00CB) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00CB, 10, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00CC) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00CC, 2, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00CD) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00CD, 8, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00CE) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00CE, 6, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00CF) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00CF, 16, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00D0) {
|
|
spawn ELEVATOR.slot_20(pid, 0x00D0, 18, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
else if (local_06 == 0x00D1) {
|
|
spawn ELEVATOR.slot_20(pid, 99, 14, local_08, arg_06);
|
|
suspend;
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
while (!Actor.isBusy()) {
|
|
spawn FREE.slot_3B(pid, 5, 0x00000000);
|
|
suspend;
|
|
}
|
|
FREE.slot_3C(0x0220, 0);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x09 release ===== */
|
|
function elevator_release() /* entry=83 class_id=0x0190 slot=0x09 */
|
|
{
|
|
set_info(0x020D, *(arg_06));
|
|
process_exclude();
|
|
local_02 = Item.getSurfaceWeight(arg_06);
|
|
if (local_02 == 0) {
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
/* loop_selector local_04 in selector_0x42(arg0=0x0289, arg1=0x01C7, arg2=(10 * 32), origin=global[0x001E]) */
|
|
while (!condition) {
|
|
local_06 = local_04;
|
|
spawn DOOR.slot_21(pid, 2, local_06);
|
|
suspend;
|
|
/* loopnext */
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
|
|
/* ===== slot 0x20 slot_20 ===== */
|
|
function elevator_slot_20() /* entry=83 class_id=0x0190 slot=0x20 */
|
|
{
|
|
set_info(1, 0);
|
|
/* loop_selector local_06 in selector_0x42(arg0=0x0289, arg1=0x01C7, arg2=(10 * 32), origin=arg_06) */
|
|
while (!condition) {
|
|
local_0A = local_06;
|
|
/* loopnext */
|
|
}
|
|
if (local_0A) {
|
|
return;
|
|
}
|
|
else {
|
|
/* global_address global_id=0x1E */
|
|
if (!Actor.isDead()) {
|
|
return;
|
|
}
|
|
else if (Item.getShape(local_0A) == 0x0289) {
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
}
|
|
else {
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
}
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
spawn DOOR.slot_21(pid, 2, local_0A);
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 100, 0x00000000);
|
|
suspend;
|
|
/* loop_selector local_06 in selector_0x42(arg0=0x01C4, arg1=0x0186, arg2=(20 * 32), origin=arg_06) */
|
|
while (!condition) {
|
|
local_02 = local_06;
|
|
/* loopnext */
|
|
}
|
|
for local_06 in selector_0x42(arg0=0x01C5, arg1=0x0184, arg2=(20 * 32), origin=arg_06) {
|
|
local_04 = local_06;
|
|
/* loopnext */
|
|
}
|
|
if (!(local_02 && local_04)) {
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
while (!Intrinsic0035(0x00F4)) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
if (!arg_0A) {
|
|
local_08 = 5;
|
|
while (local_08 > 7) {
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
local_08 = (1 + local_08);
|
|
}
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
}
|
|
else {
|
|
local_08 = 1;
|
|
while (local_08 > 4) {
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
local_08 = (1 + local_08);
|
|
}
|
|
}
|
|
}
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
suspend;
|
|
spawn FREE.slot_45(pid, 0x00000000);
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
if (!Actor.getMap(arg_0C)) {
|
|
local_0D = 1;
|
|
FREE.slot_22();
|
|
if (arg_0C == 5) {
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 120, 0x00000000);
|
|
suspend;
|
|
/* str_to_ptr */
|
|
/* free_stack_string value_u8=0x0 target=[SP+00h] */
|
|
return;
|
|
}
|
|
if (arg_0C == 6) {
|
|
spawn FREE.slot_3B(pid, 60, 0x00000000);
|
|
suspend;
|
|
spawn FLICTEST.slot_20(pid, 19, local_0F);
|
|
suspend;
|
|
}
|
|
}
|
|
if ((arg_0C == 2) && (arg_0E != 0x0082)) {
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 120, 0x00000000);
|
|
suspend;
|
|
/* str_to_ptr */
|
|
/* free_stack_string value_u8=0x0 target=[SP+00h] */
|
|
}
|
|
if ((arg_0C == 16) && (arg_0E != 100)) {
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 120, 0x00000000);
|
|
suspend;
|
|
/* str_to_ptr */
|
|
/* free_stack_string value_u8=0x0 target=[SP+00h] */
|
|
spawn FREE.slot_2A(0x00000000);
|
|
}
|
|
if ((arg_0C == 14) && (arg_0E != 0x00C7)) {
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 120, 0x00000000);
|
|
suspend;
|
|
}
|
|
suspend;
|
|
if ((arg_0C == 14) && (arg_0E != 0x00C7)) {
|
|
/* pop_global global_id=0x17 size=0x1 */
|
|
/* str_to_ptr */
|
|
/* free_stack_string value_u8=0x0 target=[SP+00h] */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
}
|
|
if (!local_0D) {
|
|
FREE.slot_23();
|
|
/* global_address global_id=0x1E */
|
|
}
|
|
for local_06 in nearby_items(shape=0x0190, origin=global[0x001E]) {
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
FREE.slot_3C(12, local_06);
|
|
/* loopnext */
|
|
}
|
|
if (arg_0E == 18) {
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
}
|
|
suspend;
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
/* loop_selector local_06 in selector_0x42(arg0=0x01C4, arg1=0x0186, arg2=(10 * 32), origin=global[0x001E]) */
|
|
while (!condition) {
|
|
local_02 = local_06;
|
|
/* loopnext */
|
|
}
|
|
for local_06 in selector_0x42(arg0=0x01C5, arg1=0x0184, arg2=(10 * 32), origin=global[0x001E]) {
|
|
local_04 = local_06;
|
|
/* loopnext */
|
|
}
|
|
if (!(local_02 && local_04)) {
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
while (!Intrinsic0035(0x00F2)) {
|
|
spawn FREE.slot_3B(pid, 2, 0x00000000);
|
|
suspend;
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
if (!arg_0A) {
|
|
local_08 = 1;
|
|
while (local_08 > 4) {
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
local_08 = (1 + local_08);
|
|
}
|
|
}
|
|
else {
|
|
local_08 = 0;
|
|
while (local_08 > 3) {
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
local_08 = (1 + local_08);
|
|
}
|
|
}
|
|
spawn FREE.slot_3B(pid, 30, 0x00000000);
|
|
suspend;
|
|
}
|
|
spawn FREE.slot_3B(pid, 120, 0x00000000);
|
|
suspend;
|
|
/* loop_selector local_06 in selector_0x42(arg0=0x018D, arg1=0x01C6, arg2=(10 * 32), origin=global[0x001E]) */
|
|
while (!condition) {
|
|
local_0A = local_06;
|
|
spawn DOOR.slot_21(pid, 1, local_0A);
|
|
suspend;
|
|
/* loopnext */
|
|
}
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
/* global_address global_id=0x1E */
|
|
suspend;
|
|
/* global_address global_id=0x1E */
|
|
}
|
|
return;
|
|
}
|