{$CLEO}

0000: "Doom E1M1 DYOM helper"

wait 0

//Nukage damage
$NUKAGE_TMR = 250
$NUKAGE_ACT = 0

//This crashes the game, so I had to merge it into the main thread
//create_thread @DOOM_NU

:DOOM
wait 0

//Nukage
if
00A4:   actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 378.3076 -1312.824 100.84 in_cube_cornerB 400.4193 -1299.8192 103.04 
then
    if
    $NUKAGE_ACT == 0
    then
        $NUKAGE_ACT = 1
    end
    0226: $PLAYER_HP = actor $PLAYER_ACTOR health
    if and
    $NUKAGE_ACT == 2
    $PLAYER_HP > 0
    then
        $PLAYER_HP -= 5 
        0223: set_actor $PLAYER_ACTOR health_to $PLAYER_HP
        //00A0: store_actor $PLAYER_ACTOR position_to $PLAYER_X $PLAYER_Y $PLAYER_Z
        $NUKAGE_ACT = 0
    end  
end

if and
00A4:   actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 330.0006 -1315.765 100.36 in_cube_cornerB 356.9557 -1293.4813 104.16
80A4:   not actor $PLAYER_ACTOR sphere 0 in_cube_cornerA 328.8683 -1298.2092 100.36 in_cube_cornerB 336.0606 -1292.7712 104.16 
then
    if
    $NUKAGE_ACT == 0
    then
        $NUKAGE_ACT = 1
    end
    0226: $PLAYER_HP = actor $PLAYER_ACTOR health
    if and
    $NUKAGE_ACT == 2
    $PLAYER_HP > 0
    then
        $PLAYER_HP -= 5 
        0223: set_actor $PLAYER_ACTOR health_to $PLAYER_HP
        //00A0: store_actor $PLAYER_ACTOR position_to $PLAYER_X $PLAYER_Y $PLAYER_Z
        $NUKAGE_ACT = 0
    end
end

//Nukage damage timer thread
//:DOOM_NU
if $NUKAGE_ACT == 1
then
    wait $NUKAGE_TMR
    $NUKAGE_ACT = 2
else $NUKAGE_ACT == 2
    wait $NUKAGE_TMR
    $NUKAGE_ACT = 0
end
//jump @DOOM_NU

jump @DOOM

end_thread