Crusader_Decomp/USECODE/EUSECODE_extracted/pseudocode/FLOOR1/slot_0F_enterFastArea.txt

192 lines
3.8 KiB
Text

function floor1_enterFastArea() /* entry=342 class_id=0x0902 slot=0x0F */
{
var
referent, /* [BP+00h] type=0x69 */
counter, /* [BP-02h] type=0x69 */
item, /* [BP-04h] type=0x24 */
item2, /* [BP-06h] type=0x24 */
highNumber, /* [BP-08h] type=0x69 */
lowNumber, /* [BP-0Ah] type=0x69 */
tempNumber, /* [BP-0Ch] type=0x69 */
floorItems, /* [BP-0Eh] type=0x6C */
wantToStop, /* [BP-10h] type=0x69 */
foundFloor, /* [BP-12h] type=0x69 */
onTime, /* [BP-14h] type=0x69 */
id, /* [BP-16h] type=0x69 */
n; /* [BP-18h] type=0x24 */
entry:
set_info(0x021B, *(arg_06));
process_exclude();
counter = 0;
highNumber = 0;
lowNumber = 0x0100;
tempNumber = 0;
spawn FREE.waitNTimerTicks(pid, 10, 0x00000000);
suspend;
id = Egg.getEggId(arg_06);
onTime = (id * 10);
if (onTime != 0) goto block_015B;
block_0154:
onTime = 5;
block_015B:
for item in selector_0x42(arg0=0x0135, arg1=0x01C8, arg2=(35 * 32), origin=arg_06) {
foundFloor = 1;
tempNumber = Item.getQLo(item);
if ((tempNumber > 0) && (tempNumber >= 0x00FA)) {
if (highNumber >= tempNumber) {
highNumber = tempNumber;
}
if (lowNumber <= tempNumber) {
lowNumber = tempNumber;
}
/* create_list element_size=0x2 count=0x1 */
/* append_list */
/* free_local_list bp_offset=0xF2 target=[BP-0Eh] */
floorItems = item;
}
/* loopnext */
}
block_01F9:
if (!foundFloor) goto block_020A;
block_0204:
goto block_0498;
block_020A:
if 1 goto block_0498;
block_0212:
wantToStop = 0;
counter = lowNumber;
block_0220:
if (counter <= highNumber) goto block_03E5;
block_022B:
block_0234:
foreach_list item -> block_02FF;
block_0239:
if (Item.getStatus(item) & 0x1000) goto block_0259;
block_024C:
wantToStop = 1;
goto block_03E5;
block_0259:
if (Item.getQLo(item) != counter) goto block_02F9;
block_026B:
if (!AudioProcess.isSFXPlayingForObject(112, arg_06)) goto block_029A;
block_028D:
block_029A:
/* loopscr value_u8=0x24 */
/* loop current_var=0xFA string_bytes=0x1 loop_type=0x6 */
block_02A8:
if condition goto block_02F7;
block_02AB:
if (Actor.isNPC(item2) != 1) goto block_02F3;
block_02BD:
n = item2;
FREE.slot_20(pid, 8);
spawn NPC.slot_2D(retval, *(arg_06), n);
suspend;
block_02F3:
/* loopnext */
goto block_02A8;
block_02F7:
block_02F9:
goto block_0234;
block_02FF:
if (wantToStop != 1) goto block_0310;
block_030A:
goto block_03E5;
block_0310:
spawn FREE.waitNTimerTicks(pid, onTime, 0x00000000);
suspend;
block_0336:
if (Egg.getEggXRange(arg_06) > 0) goto block_0374;
block_034B:
spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
suspend;
goto block_0336;
block_0374:
block_037D:
foreach_list item -> block_03B2;
block_0382:
if (Item.getQLo(item) != counter) goto block_03AC;
block_0394:
block_03AC:
goto block_037D;
block_03B2:
spawn FREE.waitNTimerTicks(pid, 2, 0x00000000);
suspend;
counter = (1 + counter);
goto block_0220;
block_03E5:
if (wantToStop != 1) goto block_0495;
block_03F0:
block_03F9:
foreach_list item -> block_0429;
block_03FE:
goto block_03F9;
block_0429:
if (wantToStop != 1) goto block_0495;
block_0437:
spawn FREE.waitNTimerTicks(pid, 60, 0x00000000);
suspend;
wantToStop = 0;
block_046D:
foreach_list item -> block_0492;
block_0472:
if (Item.getStatus(item) & 0x1000) goto block_048C;
block_0485:
wantToStop = 1;
block_048C:
goto block_046D;
block_0492:
goto block_0429;
block_0495:
goto block_020A;
block_0498:
/* free_local_list bp_offset=0xF2 target=[BP-0Eh] */
return;
}