36 lines
1.9 KiB
Plaintext
36 lines
1.9 KiB
Plaintext
import { Inventory } from @zelda1:inventory;
|
|
import { Stage } from @zelda1:stage;
|
|
import { Gfx } from @sdk:gfx;
|
|
import { Color } from @core:color;
|
|
declare global check_phase: int=0;
|
|
declare global check_error: int=0;
|
|
declare service TemporaryBombChecks {
|
|
fn tick() -> void {
|
|
if check_phase==0 {
|
|
game.boot(); game.new_game(); for i: int from 0 until 76 { game.update(false,false,false,false,false,false,false,false); }
|
|
let count=Inventory.read_slot(1); if count!=0 { check_error=1; }
|
|
} else if check_phase==1 {
|
|
for i: int from 0 until 22 { game.update(true,false,false,false,false,false,false,false); }
|
|
let count=Inventory.read_slot(1); if count!=4 { check_error=2; }
|
|
} else if check_phase==2 {
|
|
game.update(false,false,false,false,false,true,false,false);
|
|
let count=Inventory.read_slot(1); if count!=3 { check_error=3; }
|
|
} else if check_phase==3 {
|
|
game.update(false,false,false,false,false,false,true,false);
|
|
for i: int from 0 until 66 { game.update(false,false,false,false,false,false,false,false); }
|
|
let count=Inventory.read_slot(1); if count!=3 { check_error=4; }
|
|
} else if check_phase==4 {
|
|
game.update(false,false,false,false,false,false,true,false);
|
|
for i: int from 0 until 59 { game.update(false,false,false,false,false,false,false,false); }
|
|
Stage.return_to_start(); Stage.update_test_pickups(152,138,true);
|
|
let count=Inventory.read_slot(1); if count!=3 { check_error=5; }
|
|
} else if check_phase==5 {
|
|
game.new_game(); for i: int from 0 until 76 { game.update(false,false,false,false,false,false,false,false); }
|
|
for i: int from 0 until 22 { game.update(true,false,false,false,false,false,false,false); }
|
|
let count=Inventory.read_slot(1); if count!=4 { check_error=6; }
|
|
}
|
|
if check_phase<6 { check_phase+=1; }
|
|
game.draw(); Gfx.fill_rect(0,0,3,3,if check_error==0 { Color.rgb(0,255,0) } else { Color.rgb(check_error as long,0,0) });
|
|
}
|
|
}
|