Usecode pseudocode

This commit is contained in:
MaddoScientisto 2026-03-26 00:37:17 +01:00
commit c12bb39437
1362 changed files with 71072 additions and 38056 deletions

View file

@ -10,127 +10,72 @@ function elevator_gotHit() /* entry=124 class_id=0x021E slot=0x06 */
n, /* [BP-08h] type=0x24 */
nT; /* [BP-0Ah] type=0x69 */
entry:
set_info(0x020C, *(arg_06));
process_exclude();
if ((ref != 1) || (Intrinsic0070() != 1)) goto block_010E;
block_0108:
goto block_04FA;
block_010E:
set_info(0x020C, *(arg_06));
process_exclude();
if ((ref == 1) || (Ultima8Engine.getUnkCrusaderFlag() != 1)) {
return;
}
else {
class_0A0C_slot_33(0x0220, 0);
block_0136:
/* global_address global_id=0x3C */
if Intrinsic0033() goto block_016F;
block_0146:
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
goto block_0136;
block_016F:
while (!Actor.isBusy()) {
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
}
/* global_address global_id=0x3C */
if Intrinsic0035() goto block_01AF;
block_017F:
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
block_01AF:
if (!Actor.getSomeFlagProbablyCrouch()) {
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
}
item = ref;
lowQuality = Item.fall(arg_06);
direction = Intrinsic009C(arg_06);
lowQuality = Item.getQLo(arg_06);
direction = Item.getQHi(arg_06);
/* loopscr value_u8=0x24 */
/* loop current_var=0xFE string_bytes=0x1 loop_type=0x6 */
block_01E2:
if condition goto block_0395;
block_01E5:
if (item != *(arg_06)) goto block_0391;
block_01F8:
if Item.isNpc(item) goto block_0235;
block_0207:
if (item != 1) goto block_0232;
block_0215:
n = item;
block_0232:
goto block_0391;
block_0235:
nT = Intrinsic0016(item);
if (((((((((((((((((((((((((nT != 0x0194) && (nT != 0x04D0)) && (nT != 17)) && (nT != 0x04B1)) && (nT != 0x0476)) && (nT != 0x01C6)) && (nT != 0x018D)) && (nT != 0x0193)) && (nT != 0x01C7)) && (nT != 0x028A)) && (nT != 0x018C)) && (nT != 0x0192)) && (nT != 0x0288)) && (nT != 0x028B)) && (nT != 0x018B)) && (nT != 0x0191)) && (nT != 0x028C)) && (nT != 0x028D)) && (nT != 0x018A)) && (nT != 0x0190)) && (nT != 0x0287)) && (nT != 0x028E)) && (nT != 0x0187)) && (nT != 0x0189)) && (nT != 0x0289)) goto block_0391;
block_0386:
block_0391:
/* loopnext */
goto block_01E2;
block_0395:
while (!condition) {
if (item == *(arg_06)) {
if (!Actor.isNPC(item)) {
if (item == 1) {
n = item;
}
}
else {
nT = Item.getShape(item);
}
}
/* loopnext */
}
set_info(0x0220, 0);
if (direction != 0) goto block_03B1;
block_03AE:
goto block_03BB;
block_03B1:
direction = (direction - 1);
block_03BB:
if (lowQuality < 16) goto block_03FB;
block_03C9:
if (direction == 0) {
}
else {
direction = (direction - 1);
}
if (lowQuality >= 16) {
/* global_address global_id=0x3C */
spawn class_021E_slot_20(Actor.getMap(pid, lowQuality), direction, arg_06);
suspend;
}
else if (lowQuality == 16) {
/* global_address global_id=0x3C */
spawn class_021E_slot_20(Actor.getMap(pid, 4), direction, arg_06);
suspend;
}
else if (lowQuality == 17) {
spawn class_021E_slot_20(pid, 17, 10, direction, arg_06);
suspend;
}
else if (lowQuality == 18) {
spawn class_021E_slot_20(pid, 18, 24, direction, arg_06);
suspend;
}
/* global_address global_id=0x3C */
spawn class_021E_slot_20(Item.getType(pid, lowQuality), direction, arg_06);
suspend;
goto block_0499;
block_03FB:
if (lowQuality != 16) goto block_0435;
block_0403:
/* global_address global_id=0x3C */
spawn class_021E_slot_20(Item.getType(pid, 4), direction, arg_06);
suspend;
goto block_0499;
block_0435:
if (lowQuality != 17) goto block_0467;
block_043D:
spawn class_021E_slot_20(pid, 17, 10, direction, arg_06);
suspend;
goto block_0499;
block_0467:
if (lowQuality != 18) goto block_0499;
block_046F:
spawn class_021E_slot_20(pid, 18, 24, direction, arg_06);
suspend;
goto block_0499;
block_0499:
/* global_address global_id=0x3C */
if Intrinsic0033() goto block_04D2;
block_04A9:
spawn class_0A0C_slot_32(pid, 5, 0x00000000);
suspend;
goto block_0499;
block_04D2:
while (!Actor.isBusy()) {
spawn class_0A0C_slot_32(pid, 5, 0x00000000);
suspend;
}
class_0A0C_slot_33(0x0220, 0);
block_04FA:
return;
}
return;
}

View file

@ -6,32 +6,21 @@ function elevator_release() /* entry=124 class_id=0x021E slot=0x09 */
item, /* [BP-04h] type=0x24 */
door; /* [BP-06h] type=0x24 */
entry:
set_info(0x020D, *(arg_06));
process_exclude();
w = Intrinsic0057(arg_06);
if (w != 0) goto block_0FB5;
block_0F3C:
set_info(0x020D, *(arg_06));
process_exclude();
w = Item.getSurfaceWeight(arg_06);
if (w == 0) {
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFC string_bytes=0x6 loop_type=0x2 */
block_0F82:
if condition goto block_0FB3;
block_0F85:
door = item;
spawn class_0A06_slot_21(pid, 2, door);
suspend;
/* loopnext */
goto block_0F82;
block_0FB3:
block_0FB5:
return;
while (!condition) {
door = item;
spawn class_0A06_slot_21(pid, 2, door);
suspend;
/* loopnext */
}
}
return;
}

View file

@ -12,30 +12,18 @@ function elevator_slot_20() /* entry=124 class_id=0x021E slot=0x20 */
door, /* [BP-0Ah] type=0x24 */
door1; /* [BP-0Ch] type=0x24 */
entry:
set_info(1, 0);
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_0585:
if condition goto block_0593;
block_0588:
set_info(1, 0);
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
door = item;
/* loopnext */
goto block_0585;
block_0593:
if (!door) goto block_05A4;
block_059E:
goto block_0E9C;
block_05A4:
if (Intrinsic0016(door) != 0x0189) goto block_0656;
block_05BD:
}
if (door) {
return;
}
else if (Item.getShape(door) == 0x0189) {
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
@ -44,9 +32,8 @@ function elevator_slot_20() /* entry=124 class_id=0x021E slot=0x20 */
suspend;
/* global_address global_id=0x3C */
suspend;
goto block_06EC;
block_0656:
}
else {
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
@ -55,237 +42,145 @@ function elevator_slot_20() /* entry=124 class_id=0x021E slot=0x20 */
suspend;
/* global_address global_id=0x3C */
suspend;
block_06EC:
/* global_address global_id=0x3C */
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
spawn class_0A06_slot_21(pid, 2, door);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_0782:
if condition goto block_0790;
block_0785:
}
/* global_address global_id=0x3C */
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
spawn class_0A06_slot_21(pid, 2, door);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
post1 = item;
/* loopnext */
goto block_0782;
block_0790:
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_07B2:
if condition goto block_07C0;
block_07B5:
}
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
post2 = item;
/* loopnext */
goto block_07B2;
block_07C0:
if (post1 && post2) goto block_09BA;
block_07D3:
}
if (!(post1 && post2)) {
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
block_083C:
/* global_address global_id=0x3C */
if Item.touch(0x00F4) goto block_0878;
block_084F:
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
goto block_083C;
block_0878:
while (!AudioProcess.isSFXPlayingForObject(0x00F4)) {
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
}
/* global_address global_id=0x3C */
if dir goto block_094A;
block_088F:
counter = 5;
block_0896:
if (counter <= 7) goto block_08F9;
block_089E:
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
goto block_0896;
block_08F9:
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
goto block_09BA;
block_094A:
counter = 1;
block_0951:
if (counter <= 4) goto block_09BA;
block_0959:
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
goto block_0951;
block_09BA:
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
suspend;
spawn class_0A0C_slot_3C(pid, 0x00000000);
suspend;
/* global_address global_id=0x3C */
if Item.getType(mapNum) goto block_0A39;
block_0A32:
block_0A39:
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x3D */
/* loopscr value_u8=0x40 */
/* loopscr value_u8=0x25 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_0A79:
if condition goto block_0AEB;
block_0A7C:
if (!dir) {
counter = 5;
while (counter > 7) {
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
}
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
}
else {
counter = 1;
while (counter > 4) {
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
}
}
}
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
suspend;
spawn class_0A0C_slot_3C(pid, 0x00000000);
suspend;
/* global_address global_id=0x3C */
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x3D */
/* loopscr value_u8=0x40 */
/* loopscr value_u8=0x25 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
class_0A0C_slot_33(12, item);
/* loopnext */
goto block_0A79;
block_0AEB:
if (eggNum != 18) goto block_0B23;
block_0AFB:
}
if (eggNum == 18) {
/* global_address global_id=0x3C */
suspend;
block_0B23:
suspend;
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_0B83:
if condition goto block_0B91;
block_0B86:
}
suspend;
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
post1 = item;
/* loopnext */
goto block_0B83;
block_0B91:
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_0BB3:
if condition goto block_0BC1;
block_0BB6:
}
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
post2 = item;
/* loopnext */
goto block_0BB3;
block_0BC1:
if (post1 && post2) goto block_0D87;
block_0BD4:
}
if (!(post1 && post2)) {
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
block_0BEF:
/* global_address global_id=0x3C */
if Item.touch(0x00F2) goto block_0C2B;
block_0C02:
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
goto block_0BEF;
block_0C2B:
while (!AudioProcess.isSFXPlayingForObject(0x00F2)) {
spawn class_0A0C_slot_32(pid, 2, 0x00000000);
suspend;
}
/* global_address global_id=0x3C */
if dir goto block_0CC9;
block_0C42:
counter = 1;
block_0C63:
if (counter <= 4) goto block_0CC6;
block_0C6B:
if (!dir) {
counter = 1;
while (counter > 4) {
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
}
}
else {
counter = 0;
while (counter > 3) {
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
}
}
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
goto block_0C63;
block_0CC6:
goto block_0D39;
block_0CC9:
counter = 0;
block_0CD0:
if (counter <= 3) goto block_0D39;
block_0CD8:
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
counter = (1 + counter);
goto block_0CD0;
block_0D39:
spawn class_0A0C_slot_32(pid, 30, 0x00000000);
suspend;
block_0D87:
spawn class_0A0C_slot_32(pid, 120, 0x00000000);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
block_0DCD:
if condition goto block_0DFE;
block_0DD0:
}
spawn class_0A0C_slot_32(pid, 120, 0x00000000);
suspend;
/* loopscr value_u8=0x24 */
/* loopscr value_u8=0x42 */
/* loop current_var=0xFA string_bytes=0x6 loop_type=0x2 */
while (!condition) {
door = item;
spawn class_0A06_slot_21(pid, 1, door);
suspend;
/* loopnext */
goto block_0DCD;
block_0DFE:
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
block_0E9C:
return;
}
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
/* global_address global_id=0x3C */
suspend;
/* global_address global_id=0x3C */
return;
}