{$VERSION 3.1.0027}
{$CLEO .cs}

thread 'OEYAMA'

:key
wait 0
0006: 0@ = -229907
008B: 0@ = &0(0@,1i)
0012: 0@ *= 0x10000
if
0039: 0@ == 0x4F450000        //OE
then
    0006: 0@ = -229908
    008B: 0@ = &0(0@,1i)
    if
    8039: not 0@ == 0x59414D41    //YAMA
    then
        jump @key
    end
else
    jump @key
end

0006: 0@ = -229908
0004:&0(0@,1i) = 0x20202020
0A96: 0@ = actor $PLAYER_ACTOR struct
000A: 0@ += 0x42
0A8D: 31@ = read_memory 0@ size 1 virtual_protect 0
03E5: show_text_box 'CHEAT1'
03CF: load_wav 12603 as 4
while 83D0: not  wav 4 loaded
wait 0
end

:main
wait 0
0006: 0@ = -229907
008B: 0@ = &0(0@,1i)
0012: 0@ *= 0x10000
if
0039: 0@ == 0x4F450000        //OE
then
    0006: 0@ = -229908
    008B: 0@ = &0(0@,1i)
    if
    0039: 0@ == 0x59414D41    //YAMA
    then
        0006: 0@ = -229908
        0004:&0(0@,1i) = 0x20202020
        0A96: 0@ = actor $PLAYER_ACTOR struct
        000A: 0@ += 0x42
        0A8C: write_memory 0@ size 1 value 31@ virtual_protect 0
        040D: unload_wav 4
        03E5: show_text_box 'CHEAT8'
        jump @key
    end
end

if or
02D8:   actor $PLAYER_ACTOR current_weapon == 0 
02D8:   actor $PLAYER_ACTOR current_weapon == 1 
then
    if or
    0449: actor $PLAYER_ACTOR in_a_car
    80E1: not player 0 pressed_key 17 //fire
    then
        jump @main
    end
else
    jump @main
end

02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1  
0006: 32@ = 81
0006: 33@ = 0
0006: 2@ = 0
0006: 0@ = 0    // 0@ -- existence flag
0006: 3@ = 0    // 3@ -- speed flag (fast or slow)
////////////////////////////////// main loop /////////////////////////////////////

:create_corona
wait 0

if and
82D8: not  actor $PLAYER_ACTOR current_weapon == 0 
82D8: not  actor $PLAYER_ACTOR current_weapon == 1
then
     01B9: set_actor $PLAYER_ACTOR armed_weapon_to 0 
end

//spell break
if and
80E1: not player 0 pressed_key 17 //fire
0019:   32@ > 1500
then
    jump @main
end    

// set pos & time
if and
0019:   32@ > 50
00E1: player 0 pressed_key 17 //fire
then
    04C4: store_coords_to 6@ 7@ 8@ from_actor $PLAYER_ACTOR with_offset 0.0 25.0 0.0
    03D7: set_wav 4 location 6@ 7@ 8@ 
    03D1: play_wav 4
    if
    88B9: not  test 0@ bit 2@
    then
        08BF: set 0@ bit 2@
        0208: 6@ = random_float_in_ranges 0.0 17.0
        0208: 7@ = random_float_in_ranges 3.0 20.0
        if
        0021:   6@ > 7.0
        then
            08BF: set 3@ bit 2@
        end
        04C4: store_coords_to 6@ 7@ 8@ from_actor $PLAYER_ACTOR with_offset 6@ 7@ 17.0
        gosub @get_pointer
        0085: 13@ = 2@ // (int)
        0012: 13@ *= 12
        005A: 30@ += 13@ // (int)
        0A8C: write_memory 30@ size 4 value 6@ virtual_protect 0
        000A: 30@ += 4
        0A8C: write_memory 30@ size 4 value 7@ virtual_protect 0 
        000A: 30@ += 4 
        0A8C: write_memory 30@ size 4 value 8@ virtual_protect 0
        000E: 30@ -= 8
        0062: 30@ -= 13@ // (int)
        0085: 13@ = 2@ // (int)
        0012: 13@ *= 4
        005A: 30@ += 13@ // (int)
        000A: 30@ += 300
        0A8C: write_memory 30@ size 4 value 33@ virtual_protect 0                        
    end
    000A: 2@ += 1
    if
    0039: 2@ == 25
    then
        0006: 2@ = 0     
    end
    if
    88B9: not  test 0@ bit 2@
    then
        08BF: set 0@ bit 2@
        0208: 6@ = random_float_in_ranges 0.0 17.0
        0208: 7@ = random_float_in_ranges 3.0 20.0
        if
        0021:   6@ > 7.0
        then
            08BF: set 3@ bit 2@
        end
        04C4: store_coords_to 6@ 7@ 8@ from_actor $PLAYER_ACTOR with_offset 6@ 7@ 17.0
        gosub @get_pointer
        0085: 13@ = 2@ // (int)
        0012: 13@ *= 12
        005A: 30@ += 13@ // (int)
        0A8C: write_memory 30@ size 4 value 6@ virtual_protect 0
        000A: 30@ += 4
        0A8C: write_memory 30@ size 4 value 7@ virtual_protect 0 
        000A: 30@ += 4 
        0A8C: write_memory 30@ size 4 value 8@ virtual_protect 0
        000E: 30@ -= 8
        0062: 30@ -= 13@ // (int)
        0085: 13@ = 2@ // (int)
        0012: 13@ *= 4
        005A: 30@ += 13@ // (int)
        000A: 30@ += 300
        0A8C: write_memory 30@ size 4 value 33@ virtual_protect 0                        
    end
    0006: 32@ = 0
    000A: 2@ += 1
    if
    0039: 2@ == 25
    then
        0006: 2@ = 0     
    end    
end

// control
for 1@ = 0 to 24
    if
    08B9:   test 0@ bit 1@
    then
        //create corona
        gosub @get_pointer
        0085: 13@ = 1@ // (int)
        0012: 13@ *= 12
        005A: 30@ += 13@ // (int)
        0A8D: 6@ = read_memory 30@ size 4 virtual_protect 0
        000A: 30@ += 4
        0A8D: 7@ = read_memory 30@ size 4 virtual_protect 0
        000A: 30@ += 4 
        0A8D: 8@ = read_memory 30@ size 4 virtual_protect 0
        0085: 10@ = 1@ // (int) 
        0012: 10@ *= -0x3A
        000A: 10@ += @corona    
        gosub 10@
        
        //check hit
        0A8D: 27@ = read_memory 0xB74490 size 4 virtual_protect 0
        000A: 27@ += 0x4
        0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
        for 28@ = 0 to 35584 step 0x100
            0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
            000A: 27@ += 0x1
            if and
            0029:   26@ >= 0x00 
            001B:   0x80 > 26@
            then 
                005A: 26@ += 28@ // (int) 
                if and
                8118:   not actor 26@ dead
                803C:   not  $PLAYER_ACTOR == 26@ // (int)
                then 
                    00A0: store_actor 26@ position_to 10@ 11@ 12@ 
                    050A: 15@ = distance_between_XYZ 10@ 11@ 12@ and_XYZ 6@ 7@ 8@
                    0062: 24@ -= 33@ // (int) 
                    if and
                    001B:  0 > 24@                                      
                    0023:   2.5 > 15@
                    then
                        for 13@ = 0 to 2
                            0208: 16@ = random_float_in_ranges -3.0 3.0
                            0208: 17@ = random_float_in_ranges -3.0 3.0                            
                            0208: 18@ = random_float_in_ranges -3.0 3.0
                            08EB: create_sparks_at 10@ 11@ 12@ velocity_direction 16@ 17@ 18@ density 30
                        end
                        018C: play_sound 1190 at 0.0 0.0 0.0
                        0006: 24@ = 200
                    else
                        005A: 24@ += 33@ // (int)
                    end
                    if
                    0023:   1.5 > 15@
                    then
                        020C: create_explosion_with_radius 12 at 6@ 7@ 8@
                    end
                end
            end 
        end
        0A8D: 27@ = read_memory 0xB74494 size 4 virtual_protect 0
        000A: 27@ += 0x4
        0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
        for 28@ = 0 to 27904 step 0x100
            0A8D: 26@ = read_memory 27@ size 1 virtual_protect 0
            000A: 27@ += 0x1
            if and
            0029:   26@ >= 0x00 
            001B:   0x80 > 26@
            then 
                005A: 26@ += 28@ // (int)
                if
                8119: not car 26@ wrecked
                then
                    0A97: 25@ = car 26@ struct
                    000A: 25@ += 0x42
                    0A8D: 25@ = read_memory 25@ size 1 virtual_protect 0
                    if or
                    88B7: not  test 25@ bit 2
                    88B7: not  test 25@ bit 3
                    88B7: not  test 25@ bit 4
                    88B7: not  test 25@ bit 5
                    88B7: not  test 25@ bit 7
                    then
                        00AA: store_car 26@ position_to 10@ 11@ 12@
                        050A: 15@ = distance_between_XYZ 10@ 11@ 12@ and_XYZ 6@ 7@ 8@
                        0062: 24@ -= 33@ // (int) 
                        if and
                        001B:  0 > 24@                                      
                        0023:   3.5 > 15@
                        then
                            for 13@ = 0 to 2
                                0208: 16@ = random_float_in_ranges -3.0 3.0
                                0208: 17@ = random_float_in_ranges -3.0 3.0                            
                                0208: 18@ = random_float_in_ranges -3.0 3.0
                                08EB: create_sparks_at 10@ 11@ 12@ velocity_direction 16@ 17@ 18@ density 30
                            end
                            018C: play_sound 1190 at 0.0 0.0 0.0
                            0006: 24@ = 200
                        else
                            005A: 24@ += 33@ // (int)
                        end
                        if
                        0023:   2.5 > 15@
                        then
                            02AC: set_car 26@ immunities BP 0 FP 0 EP 0 CP 0 MP 0  
                            020B: explode_car 26@ // versionA
                        end
                    end
                end
            end 
        end
        
        //check timer
        gosub @get_pointer
        0085: 13@ = 1@ // (int)
        0012: 13@ *= 4
        005A: 30@ += 13@ // (int)
        000A: 30@ += 300
        0A8D: 9@ = read_memory 30@ size 4 virtual_protect 0
        0062: 9@ -= 33@ // (int)
        02CE: 10@ = ground_z_at 6@ 7@ 8@                
        if
        08B9:   test 3@ bit 1@
        then
            if or
            001B:  -2000 > 9@
            0043:   10@ == 0.0
            then
                08C5: clear 0@ bit 1@
                08C5: clear 3@ bit 1@
            else
                //move corona
                0172: 20@ = actor $PLAYER_ACTOR Z_angle
                000B: 20@ += -90.0 
                if
                0023:   0.0 > 20@
                then
                    000B: 20@ += 360.0
                end
                02F6: 21@ = cosine 20@ // (float) 
                02F7: 22@ = sine 20@ // (float)
                0013: 21@ *= 0.25
                0013: 22@ *= -0.25
                005B: 6@ += 21@ // (float) 
                005B: 7@ += 22@ // (float) 
                000F: 8@ -= 0.4
                gosub @get_pointer
                0085: 13@ = 1@ // (int)
                0012: 13@ *= 12
                005A: 30@ += 13@ // (int)
                0A8C: write_memory 30@ size 4 value 6@ virtual_protect 0
                000A: 30@ += 4
                0A8C: write_memory 30@ size 4 value 7@ virtual_protect 0 
                000A: 30@ += 4 
                0A8C: write_memory 30@ size 4 value 8@ virtual_protect 0 
            end
        else
            if or
            001B:  -1000 > 9@
            0043:   10@ == 0.0
            then
                08C5: clear 0@ bit 1@
            else
                //move corona
                0172: 20@ = actor $PLAYER_ACTOR Z_angle
                000B: 20@ += -90.0 
                if
                0023:   0.0 > 20@
                then
                    000B: 20@ += 360.0
                end
                02F6: 21@ = cosine 20@ // (float) 
                02F7: 22@ = sine 20@ // (float)
                0013: 21@ *= 0.625
                0013: 22@ *= -0.625
                000F: 8@ -= 1.0
                005B: 6@ += 21@ // (float) 
                005B: 7@ += 22@ // (float) 
                gosub @get_pointer
                0085: 13@ = 1@ // (int)
                0012: 13@ *= 12
                005A: 30@ += 13@ // (int)
                0A8C: write_memory 30@ size 4 value 6@ virtual_protect 0
                000A: 30@ += 4
                0A8C: write_memory 30@ size 4 value 7@ virtual_protect 0 
                000A: 30@ += 4 
                0A8C: write_memory 30@ size 4 value 8@ virtual_protect 0 
            end        
        end
    end
end

jump @create_corona


////////////////////////////////// subroutine & storage ///////////////////////////////////// 

:get_pointer
0A9F: 30@ = current_thread_pointer
000A: 30@ += 0x10
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
000E: 30@ -= @pos_pool
return

:corona
{
04D5: create_corona_at 6@ 7@ 8@ radius 0.6 type 9 flare 0 RGB 192 192 192
04D5: create_corona_at 6@ 7@ 8@ radius 0.55 type 9 flare 0 RGB 95 63 255
return
58 , 0x3A byte
}
hex
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100

D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100

D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
D504030600030700030800069A99193F0409040005C00005C00005C000 D50403060003070003080006CDCC0C3F04090400045F043F05FF005100
end

:pos_pool
hex
//pos - 300 , 0x12C byte
00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000
00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000
00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000
00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000
00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000  00000000 00000000 00000000

//timer - 100 , 0x64 byte
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000
end





