/* synthesized appendix for WATCHEW */ /* sparse lines above preserve recovered debugger line numbers where available */ /* ===== slot 0x01 use ===== */ function watchew_use() /* entry=284 class_id=0x04DE slot=0x01 */ { set_info(0x0207, *(arg_06)); process_exclude(); if (!(Item.getStatus(arg_06) & 0x1000)) { } else if (Item.getFrame(arg_06) == 1) { spawn FREE.slot_21(pid, 0x01A7, 0x00000000); suspend; } else { ITEM.slot_26((World.getAlertActive() != 1), 4, arg_06); if (retval == 1) { /* free_local_string bp_offset=0xFE target=[BP-02h] */ local_02 = "SECURITY OPS^_____________^^^CODE RED IN PROGRESS.^UNABLE TO ACCESS CENTRAL SECURITY."; spawn TEXTFILE.slot_20(pid, local_02, arg_06); /* free_stack_string value_u8=0x0 target=[SP+00h] */ suspend; } else { spawn WATCHEW.slot_20(arg_06); } } /* free_local_string bp_offset=0xFE target=[BP-02h] */ return; } /* ===== slot 0x0A equip ===== */ function watchew_equip() /* entry=284 class_id=0x04DE slot=0x0A */ { set_info(0x0211, *(arg_06)); process_exclude(); if (!(Item.getStatus(arg_06) & 0x1000)) { return; } else if (arg_0A == 0) { /* global_address global_id=0x1E */ spawn WATCHEW.slot_21(arg_06); return; } else { /* global_address global_id=0x1E */ spawn WATCHEW.slot_20(arg_06); } return; } /* ===== slot 0x20 slot_20 ===== */ function watchew_slot_20() /* entry=284 class_id=0x04DE slot=0x20 */ { entry: set_info(0x021B, 0); local_0A = Item.getQLo(arg_06); if (Item.getMapNum(arg_06) != 0) goto block_034D; block_0292: for local_04 in nearby_items(shape=0x0510, origin=arg_06) { if ((Item.getQLo(local_04) == local_0A) || (local_0A != 0)) { if (!Item.getQHi(local_04)) { TEXTFILE.slot_21(Item.getQHi(local_04), Item.getQLo(local_04), arg_06); /* free_local_string bp_offset=0xFE target=[BP-02h] */ local_02 = retval; spawn TEXTFILE.slot_20(pid, local_02, arg_06); /* free_stack_string value_u8=0x0 target=[SP+00h] */ suspend; } } /* loopnext */ } block_0308: spawn TRIGGER.slot_20(pid, 0, *(arg_06), arg_06); suspend; spawn WATCHEW.slot_21(pid, arg_06); suspend; spawn TRIGGER.slot_20(pid, 1, *(arg_06), arg_06); suspend; goto block_0413; block_034D: local_0B = 0; if Item.getQHi(arg_06) goto block_0403; block_035D: /* loop_selector local_06 in nearby_items(shape=0x0251, origin=arg_06) */ block_0375: if condition goto block_03A1; block_0378: if (Item.getQLo(local_06) != local_0A) goto block_039D; block_0387: VALBOX.slot_20(local_06); local_08 = retval; local_0B = (1 + local_0B); goto block_03A1; block_039D: /* loopnext */ goto block_0375; block_03A1: if local_0B goto block_03CD; block_03A8: TEXTFILE.slot_23(local_08, Item.getQHi(arg_06), Item.getQLo(arg_06), arg_06); /* free_local_string bp_offset=0xFE target=[BP-02h] */ local_02 = retval; goto block_03ED; block_03CD: TEXTFILE.slot_21(Item.getQHi(arg_06), Item.getQLo(arg_06), arg_06); /* free_local_string bp_offset=0xFE target=[BP-02h] */ local_02 = retval; block_03ED: spawn TEXTFILE.slot_20(pid, local_02, arg_06); /* free_stack_string value_u8=0x0 target=[SP+00h] */ suspend; block_0403: spawn WATCHEW.slot_21(pid, arg_06); suspend; block_0413: /* bit_not */ /* free_local_string bp_offset=0xFE target=[BP-02h] */ return; } /* ===== slot 0x21 slot_21 ===== */ function watchew_slot_21() /* entry=284 class_id=0x04DE slot=0x21 */ { entry: local_04 = *(arg_06); set_info(0x021B, 0); spawn FREE.slot_3B(pid, 60, 0x00000000); suspend; local_06 = Camera.getX(); local_08 = Camera.getY(); local_0A = Camera.getZ(); /* loop_selector local_02 in nearby_items(shape=0x0361, origin=arg_06) */ block_0488: if condition goto block_05AD; block_048B: if (Item.getQLo(local_02) != Item.getQLo(arg_06)) goto block_05A9; block_04A1: if (Item.getQLo(arg_06) > 0x00F9) goto block_04CC; block_04B1: spawn WATCHEW.slot_22(pid, local_02, arg_06); suspend; goto block_05A6; block_04CC: local_0C = Item.getX(local_02); local_0E = Item.getY(local_02); local_10 = Item.getZ(local_02); /* global_address global_id=0x1E */ spawn FREE.slot_3B(pid, 10, 0x00000000); suspend; /* pop_global global_id=0x5 size=0x1 */ spawn FREE.slot_3B(1, pid, 60, 0x00000000); suspend; if (Item.getMapNum(local_02) != 0) goto block_0568; block_0552: spawn TRIGGER.slot_20(pid, 0, local_02, arg_06); suspend; block_0568: spawn FREE.slot_3B(pid, 120, 0x00000000); suspend; block_057F: while (Ultima8Engine.moveKeyDownRecently()) { spawn FREE.slot_3B(pid, 2, 0x00000000); suspend; } block_05A2: block_05A6: goto block_05AD; block_05A9: /* loopnext */ goto block_0488; block_05AD: /* global_address global_id=0x1E */ spawn FREE.slot_3B(pid, 10, 0x00000000); suspend; /* pop_global global_id=0x5 size=0x1 */ return; } /* ===== slot 0x22 slot_22 ===== */ function watchew_slot_22() /* entry=284 class_id=0x04DE slot=0x22 */ { set_info(0x020A, 0); /* global_address global_id=0x1E */ spawn FREE.slot_3B(pid, 5, 0x00000000); suspend; /* loopscr value_u8=0x24 */ /* loopscr value_u8=0x44 */ /* loop current_var=0xFE string_bytes=0xA loop_type=0x2 */ while (!condition) { /* global_address global_id=0x1E */ if (Actor.getMap() == 14) { if (!Item.isNpc(local_02)) { local_03 = 1; } else { ITEM.slot_24(2, local_05); suspend; local_03 = 1; } } else if (!Item.isNpc(local_02)) { if (Item.getQLo(arg_06) == Intrinsic000D(local_02)) { ITEM.slot_24(2, local_02); local_03 = 1; } } /* loopnext */ } /* global_address global_id=0x1E */ spawn FREE.slot_3B(pid, 10, 0x00000000); suspend; /* pop_global global_id=0x5 size=0x1 */ if (!local_03) { while (World.getControlledNPCNum() == 1) { spawn FREE.slot_3B(pid, 5, 0x00000000); suspend; } return; } else { spawn FREE.slot_3B(pid, 0x00C8, 0x00000000); suspend; } return; }