animo - A rpg platformer

Instructions: please leave constructive criticism!\n\n*--game guide--*\nthis game has a tutorial for everything you should need to know, however this is  along game so I wanted to list all of the controls here in case you forget. if you run into something you don't understand, check back here!\n\n*--controls--*\n--arrow keys to move and jump\n--X key to attack\n--C to heal (if you have the necessary willpower)\n--spacebar to interact with npcs, pylons, and to buy items and advance dialog. \n\n*--abilitys; you can only do those actions once you unlock them!--*\n--double click a direction to dash in that direction.\n--double click UP key while in the air to double jump\n--hold a direction and press C to cast a spell (if you have the willpower to use the spell.\n\n*--pylons--*\nthe pylons are the spinning, floating white star things. press space while touching one to access their menu. at the top right corner, there are five menus you can click on to access;\n--in the map menu (the one with a pylon on it) you can view the map of the world, and teleport anywhere you have already been. to teleport, click on the piece of the map you want to go to!\n--in the weapons menu, you can equipt any weapon you have already unlocked.\n--in the charms menu, you can equipt charms you have found. please note that if it won't let you put one on, you may have to take some other ones off to free up power.

@Stage\n\n@titleSprite1\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@ground\n\ndefine set_enemy_spawning (room_x) (room_y) (location_x) (location_y) (enemy_type) (enemy_numer_id)\nadd (room_x) to [enemy_spawn_list v]\nadd (room_y) to [enemy_spawn_list v]\nadd (location_x) to [enemy_spawn_list v]\nadd (location_y) to [enemy_spawn_list v]\nadd (enemy_type) to [enemy_spawn_list v]\nadd (enemy_numer_id) to [enemy_spawn_list v]\n\nwhen flag clicked\ndelete all of [enemy_spawn_list v]\nset_enemy_spawning [3] [0] [114] [-50] [weak_slime] [1]\nset_enemy_spawning [4] [0] [4] [-50] [weak_slime] [2]\nset_enemy_spawning [4] [0] [134] [3] [weak_slime] [3]\nset_enemy_spawning [7] [0] [-4.4] [-90] [weak_slime] [4]\nset_enemy_spawning [7] [0] [-23] [-90] [weak_slime] [5]\nset_enemy_spawning [7] [0] [109] [-30] [weak_slime] [6]\nset_enemy_spawning [8] [0] [114] [-80] [knight_ranged] [7]\nset_enemy_spawning [10] [-7] [-103.3] [-40] [weak_slime] [8]\nset_enemy_spawning [10] [-7] [94] [-20] [weak_slime] [9]\nset_enemy_spawning [13] [-7] [120] [31] [weak_slime] [10]\nset_enemy_spawning [14] [-7] [-53] [31] [big_slime] [11]\nset_enemy_spawning [7] [-7] [-66] [-22] [big_slime] [12]\nset_enemy_spawning [6] [-7] [55] [31] [weak_slime] [13]\nset_enemy_spawning [5] [-8] [138] [-60] [boss_slime] [14]\nset_enemy_spawning [3] [-7] [0] [0] [weak_moss] [15]\nset_enemy_spawning [1] [-6] [-159] [146] [weak_moss] [16]\nset_enemy_spawning [1] [-6] [9] [21] [weak_moss] [17]\nset_enemy_spawning [2] [-7] [-50] [-17] [weak_moss] [18]\nset_enemy_spawning [0] [-7] [-50] [-90] [weak_moss] [19]\nset_enemy_spawning [-1] [-7] [12] [72] [weak_moss] [20]\nset_enemy_spawning [-3] [-7] [-130] [-80] [boss_hornet] [21]\nset_enemy_spawning [20] [-12] [0] [-80] [weak_bee] [22]\nset_enemy_spawning [20] [-12] [40] [-80] [weak_bee] [23]\nset_enemy_spawning [20] [-13] [0] [0] [boss_bee] [24]\nset_enemy_spawning [20] [-9] [-107] [-7] [weak_bee] [25]\nset_enemy_spawning [20] [-10] [66] [10] [weak_bee] [26]\nset_enemy_spawning [19] [-12] [38] [-12] [weak_bee] [27]\nset_enemy_spawning [19] [-11] [75] [52] [weak_bee] [28]\nset_enemy_spawning [19] [-11] [-34] [142] [weak_bee] [29]\nset_enemy_spawning [18] [-13] [-34] [142] [weak_bee] [30]\n\nwhen flag clicked\nwait (0.2) seconds\nif <(editing_game) = [0]> then\n    set [world_map_ground_x v] to [0]\n    set [world_map_ground_y v] to [0]\n    set [pylon_cave v] to [0]\n    set [pylon_city v] to [0]\n    set [pylon_green v] to [0]\n    set [pylon_cave_2 v] to [0]\n    set [pylon_town v] to [0]\nelse\n    set [world_map_ground_x v] to [19]\n    set [world_map_ground_y v] to [-13]\n    set [weapon_id_selected v] to [1]\n    set [pylon_cave v] to [1]\n    set [pylon_city v] to [1]\n    set [pylon_cave_2 v] to [1]\n    set [pylon_green v] to [1]\nend\nset [world_area_name v] to [void]\nbroadcast (enter_new_room v)\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (5) layers\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nset [editing_game v] to [0]\n\nif <(username) = [Mcnatty]> then\n    set [editing_game v] to [1]\nend\n\nwhen flag clicked\nforever\n    switch costume to (join [x] (join (world_map_ground_X) (join [-y] (world_map_ground_Y))))\nend\n\ndefine area_scenery (x) (y) (area)\nadd (x) to [area_scenery_list v]\nadd (y) to [area_scenery_list v]\nadd (area) to [area_scenery_list v]\n\nwhen I receive [enter_new_room v]\nset [area_old_name v] to (world_area_name)\nset [area_scenery_counter v] to [0]\nrepeat ((length of [area_scenery_list v]) / (3))\n    change [area_scenery_counter v] by (1)\n    if <<(item (((area_scenery_counter) * (3)) - (2)) of [area_scenery_list v]) = (world_map_ground_X)> and <(item (((area_scenery_counter) * (3)) - (1)) of [area_scenery_list v]) = (world_map_ground_Y)>> then\n        set [world_area_name v] to (item ((area_scenery_counter) * (3)) of [area_scenery_list v])\n    end\nend\nif <not <(world_area_name) = (area_old_name)>> then\n    stop all sounds\n    if <(world_area_name) = [city]> then\n        set [music_disk v] to [1]\n        set [subtitle_send v] to [city]\n    end\n    if <(world_area_name) = [cave]> then\n        set [music_disk v] to [2]\n        set [subtitle_send v] to [cave]\n    end\n    if <(world_area_name) = [town]> then\n        set [music_disk v] to [3]\n        set [subtitle_send v] to [town]\n    end\n    if <(world_area_name) = [bar]> then\n        set [music_disk v] to [4]\n        set [subtitle_send v] to [bar]\n    end\n    if <(world_area_name) = [boss_1]> then\n        set [music_disk v] to [5]\n        set [subtitle_send v] to [boss_1]\n    end\n    if <(world_area_name) = [green]> then\n        set [music_disk v] to [6]\n        set [subtitle_send v] to [green road]\n    end\n    if <(world_area_name) = [boss_2]> then\n        set [subtitle_send v] to [boss_2]\n        set [music_disk v] to [7]\n    end\n    if <(world_area_name) = [hive]> then\n        set [subtitle_send v] to [hive]\n        set [music_disk v] to [8]\n    end\n    if <(world_area_name) = [boss_3]> then\n        set [subtitle_send v] to [boss_3]\n        set [music_disk v] to [9]\n    end\n    if <(world_area_name) = [mind]> then\n        set [subtitle_send v] to [none]\n        set [music_disk v] to [10]\n    end\nend\n\nwhen flag clicked\ndelete all of [area_scenery_list v]\narea_scenery [0] [0] [city]\narea_scenery [6] [0] [city]\narea_scenery [8] [-2] [city]\narea_scenery [8] [-3] [cave]\narea_scenery [8] [-4] [cave]\narea_scenery [8] [-2] [cave]\narea_scenery [8] [-7] [cave]\narea_scenery [15] [-7] [cave]\narea_scenery [16] [-7] [town]\narea_scenery [18] [-7] [town]\narea_scenery [19] [-7] [town]\narea_scenery [19] [-8] [bar]\narea_scenery [5] [-7] [cave]\narea_scenery [5] [-8] [boss_1]\narea_scenery [4] [-8] [cave]\narea_scenery [4] [-7] [cave]\narea_scenery [3] [-7] [green]\narea_scenery [-1] [-7] [green]\narea_scenery [-4] [-7] [green]\narea_scenery [-3] [-7] [boss_2]\narea_scenery [-2] [-7] [green]\narea_scenery [20] [-10] [cave]\narea_scenery [20] [-11] [hive]\narea_scenery [19] [-13] [hive]\narea_scenery [20] [-13] [boss_3]\narea_scenery [21] [-13] [hive]\narea_scenery [-1] [0] [mind]\n\nwhen flag clicked\nset [music_disk v] to [0]\nforever\n    if <(Music_disk) = [1]> then\n        play sound [Forgotten Crossroads v] until done\n    end\n    if <(Music_disk) = [2]> then\n        play sound [Kingdom's Edge v] until done\n    end\n    if <(Music_disk) = [3]> then\n        play sound [Dirtmouth v] until done\n    end\n    if <(Music_disk) = [4]> then\n        play sound [bar v] until done\n    end\n    if <(Music_disk) = [5]> then\n        play sound [04 - False Knight v] until done\n    end\n    if <(Music_disk) = [6]> then\n        play sound [Greenpath v] until done\n    end\n    if <(Music_disk) = [7]> then\n        play sound [Hornet v] until done\n    end\n    if <(Music_disk) = [8]> then\n        play sound ["the hive" v] until done\n    end\n    if <(Music_disk) = [9]> then\n        play sound [04 - False Knight v] until done\n    end\n    if <(Music_disk) = [10]> then\n        play sound [Hollow Knight v] until done\n    end\nend\n\n@shopkeeper_npc\n\nwhen flag clicked\ndelete all of [items_locations_purchased_list v]\nforever\n    if <(shopkeeper_active) = [0]> then\n        set [ghost v] effect to (100)\n        go to x: (-1000) y: (-1000)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nset [coins v] to [0]\n\nadd [x-6-y0] to [items_locations_purchased_list v]\n\nwhen flag clicked\nforever\n    if <[items_locations_purchased_list v] contains [x9-y0]?> then\n        if <not <[charms_collected_list v] contains [heartstrong]?>> then\n            add [heartstrong] to [charms_collected_list v]\n        end\n    end\n    if <[items_locations_purchased_list v] contains [x17-y-8]?> then\n        if <not <[charms_collected_list v] contains [steadfast]?>> then\n            add [steadfast] to [charms_collected_list v]\n        end\n    end\n    if <[items_locations_purchased_list v] contains [x4-y-8]?> then\n        if <not <[charms_collected_list v] contains [fail]?>> then\n            add [fail] to [charms_collected_list v]\n        end\n    end\n    if <[items_locations_purchased_list v] contains [x1-y-5]?> then\n        if <not <[charms_collected_list v] contains [moss]?>> then\n            add [moss] to [charms_collected_list v]\n        end\n    end\n    if <[items_locations_purchased_list v] contains [x-4-y-7]?> then\n        set [ability_dash_unlocked v] to [1]\n    end\n    if <[items_locations_purchased_list v] contains [x21-y-13]?> then\n        set [ability_double_jump_unlocked v] to [1]\n    end\nend\n\ndefine spawn_shopkeeper (room_x) (room_y) (location_x) (location_y) (sprite_1) (sprite_2) (text_1) (text_2) (item_price) (face_hero?)\nif <not <[shopkeeper_exist_list v] contains (join (room_x) (join [-] (room_y)))?>> then\n    add (join (room_x) (join [-] (room_y))) to [shopkeeper_exist_list v]\nend\nif <<(world_map_ground_X) = (room_x)> and <(world_map_ground_Y) = (room_y)>> then\n    set [shopkeeper_active v] to [1]\n    if <(face_hero?) = [0]> then\n        point in direction (90)\n    else\n        point towards (player v)\n    end\n    set [shopkeeper_active v] to [1]\n    set [price v] to (item_price)\n    go to x: (location_x) y: (location_y)\n    if <touching (player v)?> then\n        if <(item_location_bought) = [0]> then\n            set [atext_output v] to (text_1)\n            broadcast (Atext_output v)\n        else\n            set [atext_output v] to (text_2)\n            broadcast (Atext_output v)\n        end\n    end\n    if <(item_location_bought) = [0]> then\n        switch costume to (sprite_1)\n    else\n        switch costume to (sprite_2)\n    end\n    if <not <touching (player v)?>> then\n        say []\n    end\n    if <<<touching (player v)?> and <(item_location_bought) = [0]>> and <(coins) > (price)>> then\n        if <key (space v) pressed?> then\n            add (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y))))) to [items_locations_purchased_list v]\n            change [coins v] by ((price) * (-1))\n        end\n    end\n    if <[items_locations_purchased_list v] contains (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y)))))?> then\n        set [item_location_bought v] to [1]\n    else\n        set [item_location_bought v] to [0]\n    end\n    change [shopkeeper_spawning_loop v] by (1)\nend\n\nwhen I receive [enter_new_room v]\n\nwhen flag clicked\nforever\n    spawn_shopkeeper [6] [0] [-104] [23] [sword_shrine_1] [sword_shrine_2] [click_space_to_loot_the_sword.] [now_go_equipt_it_at_the_pylon!] [-1] [0]\n    spawn_shopkeeper [15] [-7] [33] [-50] [guard_1] [sprite_2] [you_look_a_lot_like_the_monsters_out_there...all_slimey_and_dark...but_you_don't_act_like_one._I_will_let_you_into_town,_but_I_am_watching_you!] [text_2] [9999] [1]\n    spawn_shopkeeper [9] [0] [157] [53] [item] [item] [press_spacebar_to_take_the_charm.] [equipt_the_charm_at_a_pylon!] [-1] [0]\n    spawn_shopkeeper [16] [-7] [76] [-60] [old_man_1] [old_man_1] [A_long_time_ago,_after_the_great_war,_many_of_us_survivors_came_to_this_cave,_and_built_ourselves_a_new_home._however,_since_that_time,_many_have_left,_and_none_of_come_back._very_few_remain_here.] [text_2] [999999] [1]\n    spawn_shopkeeper [17] [-8] [0] [-60] [young_man] [young_man] [when_I_was_a_kid,_the_dark_slimes_outside_the_village_used_to_bully_me._so_my_father_gave_me_this_charm_that_helps_me_fight_back!_however,_I_am_old,_and_have_no_need_for_it._would_you_like_to_buy_it_for_50_coins?_\(press_spacebar_to_buy\)] [use it wisely! you can equipt it at a pylon.] [50] [1]\n    spawn_shopkeeper [19] [-8] [-100] [-63] [bartender] [bartender] [ho_ho_ho!_welcome_to_the_weapons_bar!_this_bar_used_to_be_a_regular_bar,_until_people_got_paranoid_of_a_slime_invasion._now_it's_a_weapons_bar!_would_like_to_buy_today's_special,_an_iron_sword,_for_a_low_price_of_200_coins?_press_spacebar_to_buy.] [ho ho ho! drink up! er, wait, nevermind...] [100] [1]\n    spawn_shopkeeper [4] [-8] [110] [0] [item] [item] [press_spacebar_to_take_the_charm.] [equipt_the_charm_at_a_pylon!] [-1] [0]\n    spawn_shopkeeper [11] [-9] [142] [-20] [young_man] [young_man] [hello there! I happen to know a spell that you might want to learn. do you want me to teach it to you? this defeninintly won't result in a trap or somthing that will kill you. \(press space to accept.\)] [great! to use the spell, walk with left or right arrow, and press C key to use it! you will need some will, of course. fun fact about the skulls; I have no clue how they got there.  I had nothing to do with them, I swear.] [-1] [1]\n    spawn_shopkeeper [1] [-5] [142] [-4] [item] [item] [press spacebar to loot chest.] [you got the mosshate charm; this charm was formed from the hatrid of the mosslings and thier anoying attacks. it allows the user to destroy enemy projectiles with a sword.] [-1] [0]\n    spawn_shopkeeper [-4] [-7] [-165] [-82] [item] [item] [press_spacebar_to_take_the_ability.] [you_got_the_wind_cloak;_double_click_left_or_right_to_dash_in_that_direection!_there_is_also_a_not_attached;_"if_you_think_that_you_are_so_daring,_then_meet_me_at_the_city_below_us._you_might_need_a_wind_cloak_to_get_there,_so_I_left_you_one.] [-1] [0]\n    spawn_shopkeeper [21] [-13] [138] [-120] [item] [item] [press_spacebar_to_take_the_ability.] [you_got_the_bee_wings;_double_tap_up_to_jump_again_mid_air!_sorry,_I_will_change_it_to_single_tap_later.] [-1] [0]\nend\n\nspawn_shopkeeper [room_X] [room_Y] [location_X] [location_Y] [sprite_1] [sprite_2] [text_1] [text_2] [item_price] [face_hero?]\n\nset rotation style [left-right v]\nforever\n    if <<(world_map_ground_X) = [6]> and <(world_map_ground_Y) = [0]>> then\n        point in direction (90)\n        set [shopkeeper_active v] to [1]\n        set [price v] to [-1]\n        go to x: (-104) y: (23)\n        if <touching (player v)?> then\n            if <(item_location_bought) = [0]> then\n                set [atext_output v] to [c]\n                broadcast (Atext_output v)\n            else\n                set [atext_output v] to [now_go_equipt_it_at_the_pylon!]\n                broadcast (Atext_output v)\n            end\n        end\n        if <(item_location_bought) = [0]> then\n            switch costume to (sword_shrine_1 v)\n        else\n            switch costume to (sword_shrine_2 v)\n        end\n    else\n        if <<(world_map_ground_X) = [15]> and <(world_map_ground_Y) = [-7]>> then\n            point towards (player v)\n            set [shopkeeper_active v] to [1]\n            set [price v] to [99999999]\n            go to x: (33) y: (-50)\n            if <touching (player v)?> then\n                if <(item_location_bought) = [0]> then\n                    say [you look a lot like the monsters out there...all slimey and dark...but you don't act like one. I will let you into town, but I am watching you!]\n                end\n            end\n            switch costume to (guard_1 v)\n            if <(item_location_bought) = [0]> then\n        else\n            if <<(world_map_ground_X) = [9]> and <(world_map_ground_Y) = [0]>> then\n                point in direction (90)\n                set [shopkeeper_active v] to [1]\n                set [price v] to [-1]\n                go to x: (157) y: (53)\n                if <touching (player v)?> then\n                    if <(item_location_bought) = [0]> then\n                        say [press spacebar to loot the chest.]\n                    else\n                        say [you got the heartstrong charm; equipt this charm at  a pylon to triple invonerability time after being hit!]\n                    end\n                end\n                switch costume to (item v)\n                if <(item_location_bought) = [0]> then\n            else\n                if <<(world_map_ground_X) = [16]> and <(world_map_ground_Y) = [-7]>> then\n                    point towards (player v)\n                    set [shopkeeper_active v] to [1]\n                    set [price v] to [9999999]\n                    go to x: (76) y: (-60)\n                    if <touching (player v)?> then\n                        if <(item_location_bought) = [0]> then\n                            say [A long time ago, after the great war, many of us survivors came to this  cave, and built ourselves a new home. however, since that time, many have left, and none of come back. very few remain here.]\n                        else\n                            say [you got the heartstrong charm; equipt this charm at  a pylon to triple invonerability time after being hit!]\n                        end\n                    end\n                    switch costume to (old_man_1 v)\n                    if <(item_location_bought) = [0]> then\n                else\n                    if <<(world_map_ground_X) = [17]> and <(world_map_ground_Y) = [-8]>> then\n                        point towards (player v)\n                        set [shopkeeper_active v] to [1]\n                        set [price v] to [49]\n                        go to x: (0) y: (-60)\n                        if <touching (player v)?> then\n                            if <(item_location_bought) = [0]> then\n                                say [when I was a kid, the dark slimes outside the village used to bully me. so my father gave me this charm that helps me fight back! however, I am old, and have no need for it. would you like to buy it for 50 coins? \(press spacebar to buy\)]\n                            else\n                                say [use it wisely! you can equipt it at a pylon.]\n                            end\n                        end\n                        switch costume to (young_man v)\n                        if <(item_location_bought) = [0]> then\n                    else\n                        if <<(world_map_ground_X) = [19]> and <(world_map_ground_Y) = [-8]>> then\n                            point towards (player v)\n                            set [shopkeeper_active v] to [1]\n                            set [price v] to [200]\n                            go to x: (-100) y: (-63)\n                            if <touching (player v)?> then\n                                if <(item_location_bought) = [0]> then\n                                    say [ho ho ho! welcome to the weapons bar! this bar used to be a regular bar, until people got paranoid of a slime invasion. now it's a weapons bar! would like to buy today's special, an iron sword, for a low price of 200 coins? press spacebar to buy.]\n                                else\n                                    say [ho ho ho! drink up! er, wait, nevermind...]\n                                end\n                            end\n                            switch costume to (bartender v)\n                            if <(item_location_bought) = [0]> then\n                        else\n                            if <<(world_map_ground_X) = [4]> and <(world_map_ground_Y) = [-8]>> then\n                                point towards (ground v)\n                                set [shopkeeper_active v] to [1]\n                                set [price v] to [-1]\n                                go to x: (110) y: (-0)\n                                if <touching (player v)?> then\n                                    if <(item_location_bought) = [0]> then\n                                        say [spacebar to loot item.]\n                                    else\n                                        say [you got the failed will charm; it is an inprintation of a failed will, which has joined with other failed wills to forma more powerfull one. this charm aloows you to get more willpower when dammaging enemys.]\n                                    end\n                                end\n                                switch costume to (item v)\n                                if <(item_location_bought) = [0]> then\n                            else\n                                if <<(world_map_ground_X) = [11]> and <(world_map_ground_Y) = [-9]>> then\n                                    point towards (ground v)\n                                    set [shopkeeper_active v] to [1]\n                                    set [price v] to [-1]\n                                    go to x: (142) y: (-20)\n                                    if <touching (player v)?> then\n                                        if <(item_location_bought) = [0]> then\n                                            say [hello there! I happen to know a spell that you might want to learn. do you want me to teach it to you? this defeninintly won't result in a trap or somthing that will kill you. \(press space to accept.\)]\n                                        else\n                                            say [great! to use the spell, walk with left or right arrow, and press C key to use it! you will need some will, of course. fun fact about the skulls; I have no clue how they got there.  I had nothing to do with them, I swear.]\n                                        end\n                                    end\n                                    switch costume to (young_man v)\n                                    if <(item_location_bought) = [0]> then\n                                else\n                                    if <<(world_map_ground_X) = [1]> and <(world_map_ground_Y) = [-5]>> then\n                                        point towards (ground v)\n                                        set [shopkeeper_active v] to [1]\n                                        set [price v] to [-1]\n                                        go to x: (142) y: (-4)\n                                        if <touching (player v)?> then\n                                            if <(item_location_bought) = [0]> then\n                                                say [press spacebar to loot chest.]\n                                            else\n                                                say [you got the mosshate charm; this charm was formed from the hatrid of the mosslings and thier anoying attacks. it allows the user to destroy enemy projectiles with a sword.]\n                                            end\n                                        end\n                                        switch costume to (item v)\n                                        if <(item_location_bought) = [0]> then\n                                    else\n                                        if <<(world_map_ground_X) = [-4]> and <(world_map_ground_Y) = [-7]>> then\n                                            point towards (ground v)\n                                            set [shopkeeper_active v] to [1]\n                                            set [price v] to [-1]\n                                            go to x: (-165) y: (-82)\n                                            if <touching (player v)?> then\n                                                if <(item_location_bought) = [0]> then\n                                                    say [press spacebar to loot chest.]\n                                                else\n                                                    say [you got the windwing cloak; double click left or right key quickly to dash. dash while in the air to span vast gaps!]\n                                                end\n                                            end\n                                            switch costume to (item v)\n                                            if <(item_location_bought) = [0]> then\n                                        else\n                                            set [shopkeeper_active v] to [0]\n                                            go to x: (-200) y: (-200)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n                if <not <touching (player v)?>> then\n                    say []\n                end\n                if <<<touching (player v)?> and <(item_location_bought) = [0]>> and <(coins) > (price)>> then\n                    if <key (space v) pressed?> then\n                        add (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y))))) to [items_locations_purchased_list v]\n                        change [coins v] by ((price) * (-1))\n                    end\n                end\n                if <[items_locations_purchased_list v] contains (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y)))))?> then\n                    set [item_location_bought v] to [1]\n                else\n                    set [item_location_bought v] to [0]\n                end\n            end\n            if <not <touching (player v)?>> then\n                say []\n            end\n            if <<<touching (player v)?> and <(item_location_bought) = [0]>> and <(coins) > (price)>> then\n                if <key (space v) pressed?> then\n                    add (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y))))) to [items_locations_purchased_list v]\n                    change [coins v] by ((price) * (-1))\n                end\n            end\n            if <[items_locations_purchased_list v] contains (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y)))))?> then\n                set [item_location_bought v] to [1]\n            else\n                set [item_location_bought v] to [0]\n            end\n        end\n        if <not <touching (player v)?>> then\n            say []\n        end\n        if <<<touching (player v)?> and <(item_location_bought) = [0]>> and <(coins) > (price)>> then\n            if <key (space v) pressed?> then\n                add (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y))))) to [items_locations_purchased_list v]\n                change [coins v] by ((price) * (-1))\n            end\n        end\n        if <[items_locations_purchased_list v] contains (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y)))))?> then\n            set [item_location_bought v] to [1]\n        else\n            set [item_location_bought v] to [0]\n        end\n    end\n    if <not <touching (player v)?>> then\n        say []\n    end\n    if <<<touching (player v)?> and <(item_location_bought) = [0]>> and <(coins) > (price)>> then\n        if <key (space v) pressed?> then\n            add (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y))))) to [items_locations_purchased_list v]\n            change [coins v] by ((price) * (-1))\n        end\n    end\n    if <[items_locations_purchased_list v] contains (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y)))))?> then\n        set [item_location_bought v] to [1]\n    else\n        set [item_location_bought v] to [0]\n    end\nend\n\nspawn_shopkeeper [room_X] [room_Y] [location_X] [location_Y] [sprite_1] [sprite_2] [text_1] [text_2] [item_price] [face_hero?]\n\nwhen flag clicked\nforever\n    if <not <[shopkeeper_exist_list v] contains (join (world_map_ground_X) (join [-] (world_map_ground_Y)))?>> then\n        go to x: (200) y: (-225)\n        set [ghost v] effect to (100)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\ndelete all of [shopkeeper_exist_list v]\n\nspawn_shopkeeper [room_X] [room_Y] [location_X] [location_Y] [sprite_1] [sprite_2] [text_1] [text_2] [item_price] [face_hero?]\n\nset [zplayer_active v] to [1]\n\n@enemy\n\nwhen I start as a clone\nset [speed_x v] to [0]\nset [speed_y v] to [0]\nset [personal_max_speed_x v] to [3]\nset [enemy_personal_acceleration v] to [1]\nset [enemy_ai_type v] to (enemy_ai_transfer_type)\nset [enemy_id_number v] to (enemy_ID_transfer_type_Value)\nset [personal_argo_distance v] to [150]\nif <(enemy_ai_type) = [weak_slime]> then\n    set rotation style [left-right v]\n    set [personal_health v] to [4]\n    set [enemy_movement_type v] to [crawler]\n    switch costume to (weak_slime v)\nelse\n    if <(enemy_ai_type) = [big_slime]> then\n        set rotation style [left-right v]\n        set [personal_health v] to [8]\n        set [enemy_movement_type v] to [crawler]\n        switch costume to (big_slime v)\n    else\n        if <(enemy_ai_type) = [weak_bee]> then\n            set rotation style [left-right v]\n            set [personal_health v] to [5]\n            set [enemy_movement_type v] to [flying]\n            switch costume to (weak_bee v)\n        else\n            if <(enemy_ai_type) = [spikes]> then\n                set [personal_health v] to [99]\n                set [enemy_movement_type v] to [none]\n                switch costume to (spikes v)\n            else\n                if <(enemy_ai_type) = [knight]> then\n                    set rotation style [left-right v]\n                    set [personal_health v] to [16]\n                    set [enemy_movement_type v] to [crawler]\n                    set [personal_max_speed_x v] to [5]\n                    set [personal_argo_distance v] to [200]\n                    switch costume to (knight v)\n                else\n                    if <(enemy_ai_type) = [knight_ranged]> then\n                        set [personal_health v] to [25]\n                        set [enemy_movement_type v] to [crawler]\n                        set [personal_max_speed_x v] to [2]\n                        set [personal_argo_distance v] to [300]\n                        switch costume to (knight_ranged v)\n                    else\n                        if <(enemy_ai_type) = [fast_slime]> then\n                            set [personal_health v] to [6]\n                            set [enemy_movement_type v] to [crawler]\n                            set [enemy_personal_acceleration v] to [6]\n                            set [personal_max_speed_x v] to [10]\n                            switch costume to (fast_slime v)\n                        else\n                            if <(enemy_ai_type) = [boss_hornet]> then\n                                set [personal_health v] to [115]\n                                set [enemy_movement_type v] to [custom_boss]\n                                set [personal_max_speed_x v] to [20]\n                                set [personal_argo_distance v] to [720]\n                                set [enemy_personal_acceleration v] to [1]\n                                switch costume to (boss_slime v)\n                                set [music v] to [2]\n                                wait (1) seconds\n                                stop all sounds\n                            else\n                                if <(enemy_ai_type) = [weak_moss]> then\n                                    set [personal_health v] to [4]\n                                    set [enemy_movement_type v] to [crawler]\n                                    set [personal_max_speed_x v] to [2]\n                                    set [personal_argo_distance v] to [200]\n                                    set [enemy_personal_acceleration v] to [4]\n                                    switch costume to (weak_moss v)\n                                else\n                                    if <(enemy_ai_type) = [boss_slime]> then\n                                        set [personal_health v] to [25]\n                                        set [enemy_movement_type v] to [crawler]\n                                        set [personal_max_speed_x v] to [20]\n                                        set [personal_argo_distance v] to [720]\n                                        set [enemy_personal_acceleration v] to [1]\n                                        switch costume to (boss_slime v)\n                                        set [music v] to [2]\n                                        wait (1) seconds\n                                        stop all sounds\n                                    else\n                                        if <(enemy_ai_type) = [boss_bee]> then\n                                            set [personal_health v] to [20]\n                                            set [enemy_movement_type v] to [custom_boss]\n                                            set [personal_max_speed_x v] to [20]\n                                            set [personal_argo_distance v] to [720]\n                                            set [enemy_personal_acceleration v] to [1]\n                                            switch costume to (boss_bee v)\n                                            set [music v] to [2]\n                                            wait (1) seconds\n                                            stop all sounds\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <not <(enemy_movement_type) = [custom_boss]>> then\n        point towards (player v)\n        if <<(enemy_movement_type) = [crawler]> or <(enemy_movement_type) = [rusher]>> then\n            if <(tracking_player) = [1]> then\n                if <(Z_hero_location_reference_x) > (x position)> then\n                    change [speed_x v] by (enemy_personal_acceleration)\n                else\n                    change [speed_x v] by ((enemy_personal_acceleration) * (-1))\n                end\n            end\n            if <not <(enemy_ai_type) = [rusher]>> then\n                set [speed_x v] to ((speed_X) * (0.8))\n                if <(speed_X) > (personal_max_speed_x)> then\n                    change [speed_x v] by (((enemy_personal_acceleration) + (0.1)) * (-1))\n                else\n                    if <(speed_X) < ((personal_max_speed_x) * (-1))> then\n                        change [speed_x v] by ((enemy_personal_acceleration) + (0.1))\n                    end\n                end\n            end\n        end\n        if <not <<(enemy_movement_type) = [flying]> or <(enemy_movement_type) = [none]>>> then\n            change [speed_y v] by (-1)\n        end\n        if <not <(enemy_movement_type) = [none]>> then\n            change x by (speed_X)\n        end\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (1)\n                            if <touching (ground v)?> then\n                                change y by (1)\n                                if <touching (ground v)?> then\n                                    change y by (1)\n                                    if <touching (ground v)?> then\n                                        change y by (1)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        if <touching (ground v)?> then\n            change y by (-8)\n            repeat until <not <touching (ground v)?>>\n                change x by ((speed_X) * (-1))\n            end\n            set [speed_x v] to [0]\n        end\n        if <not <(enemy_movement_type) = [none]>> then\n            change y by (speed_Y)\n        end\n        if <touching (ground v)?> then\n            repeat until <not <touching (ground v)?>>\n                change y by ((speed_Y) * (-1))\n            end\n            set [speed_y v] to [0]\n        end\n        change y by (-1)\n        if <<(enemy_movement_type) = [crawler]> or <(enemy_movement_type) = [rusher]>> then\n            if <(tracking_player) = [1]> then\n                if <<touching (ground v)?> and <((Z_hero_location_reference_y) - (20)) > (y position)>> then\n                    set [speed_y v] to [8]\n                end\n            end\n            change y by (1)\n        else\n            if <(enemy_movement_type) = [flying]> then\n                if <(tracking_player) = [1]> then\n                    if <(x position) < (Z_hero_location_reference_x)> then\n                        change [speed_x v] by (1)\n                    else\n                        change [speed_x v] by (-1)\n                    end\n                    if <(speed_X) > [3]> then\n                        change [speed_x v] by (-1.1)\n                    else\n                        if <(speed_X) < [-3]> then\n                            change [speed_x v] by (1.1)\n                        end\n                    end\n                    if <((y position) + (-30)) < (Z_hero_location_reference_y)> then\n                        change [speed_y v] by (1)\n                    else\n                        change [speed_y v] by (-1)\n                    end\n                    if <(speed_Y) > [4]> then\n                        change [speed_y v] by (-1.1)\n                    else\n                        if <(speed_Y) < [-4]> then\n                            change [speed_y v] by (1.1)\n                        end\n                    end\n                end\n            end\n        end\n        if <(enemy_ai_type) = [arrow]> then\n            change y by (1)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<touching (player_attack_hitbox v)?> or <touching (player_magic v)?>> then\n        if <(personal_attack_cooldown_immunity) > [3]> then\n            if <((Z_hero_location_reference_y) + (-5)) > (x position)> then\n                set [speed_y v] to ((pick random (2) to (15)) * (-1))\n            else\n                set [speed_y v] to ((pick random (2) to (15)) * (1))\n            end\n            start sound [Hit v]\n            if <touching (player_attack_hitbox v)?> then\n                broadcast (successful_hit v)\n                if <not <(enemy_ai_type) = [boss_bee]>> then\n                    if <(Z_hero_location_reference_x) > (x position)> then\n                        broadcast (small_hero_knockback_left v)\n                    else\n                        broadcast (small_hero_knockback_right v)\n                    end\n                end\n            end\n            set [personal_attack_cooldown_immunity v] to [0]\n            if <touching (player_attack_hitbox v)?> then\n                change [personal_health v] by ((hero_sword_dammage) * (-1))\n            else\n                if <touching (player_magic v)?> then\n                    change [personal_health v] by (-4)\n                end\n            end\n            set [brightness v] effect to (100)\n            if <not <(enemy_ai_type) = [boss_slime]>> then\n                if <(Z_hero_location_reference_x) > (x position)> then\n                    set [speed_x v] to ((pick random (2) to (10)) * (-1))\n                else\n                    set [speed_x v] to ((pick random (2) to (10)) * (1))\n                end\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nforever\n    change [invunerability_frames v] by (1)\n    if <<<touching (player v)?> and <(invererability_frames_count) < (invunerability_frames)>> and <not <(enemy_ai_type) = [boss_bee]>>> then\n        if <((hero_attack_reference_y) + (-5)) > (x position)> then\n            set [speed_y v] to ((1) * (-1))\n        else\n            set [speed_y v] to ((1) * (1))\n        end\n        if <(Z_hero_location_reference_x) > (x position)> then\n            set [speed_x v] to ((pick random (15) to (17)) * (-1))\n        else\n            set [speed_x v] to ((pick random (15) to (17)) * (1))\n        end\n        set [invunerability_frames v] to [0]\n        broadcast (hero_hurt v)\n        if <(Z_hero_location_reference_x) > (x position)> then\n            broadcast (hero_knockback_left v)\n        else\n            broadcast (hero_knockback_right v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    wait (0.1) seconds\n    change [personal_attack_cooldown_immunity v] by (1)\n    change [enemy_action_timer_1 v] by (1)\nend\n\nwhen flag clicked\ngo to x: (-1000) y: (-1000)\nset [ghost v] effect to (100)\n\ndefine clone_enemy (x) (y) (enemy_type) (enemy_id_number)\ngo to x: (x) y: (y)\nset [ghost v] effect to (0)\nset [enemy_ai_transfer_type v] to (enemy_type)\nset [enemy_id_transfer_type_value v] to (enemy_id_number)\ncreate clone of (_myself_ v)\ngo to x: (-1000) y: (-1000)\nset [ghost v] effect to (100)\n\nwhen I start as a clone\nforever\n    set [distance_from_hero_y v] to ([abs v] of ((Z_hero_location_reference_y) - (y position)) )\n    set [distance_from_hero_x v] to ([abs v] of ((Z_hero_location_reference_x) - (x position)) )\n    if <(distance_from_hero_X) < (personal_argo_distance)> then\n        set [tracking_player v] to [1]\n    else\n        set [tracking_player v] to [0]\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(personal_health) < [0]> or <(personal_health) = [0]>> then\n        start sound [Punch Sound Effect-heChAOTiC v]\n        add (enemy_ID_number) to [enemys_dead_list v]\n        set [dead_enemy_x v] to (x position)\n        set [dead_enemy_y v] to (y position)\n        set [dead_enemy_type v] to (enemy_ai_type)\n        broadcast (dead_enemy v)\n        set [lockdoors v] to [0]\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(enemy_ai_type) = [knight]> and <(tracking_player) = [1]>> then\n        if <(enemy_action_timer_1) > [4]> then\n            set [enemy_action_timer_1 v] to [0]\n            if <(pick random (1) to (4)) = [1]> then\n                repeat until <(costume [name v]) = [knight5]>\n                    next costume\n                    wait (0.001) seconds\n                    set [personal_attack_cooldown_immunity v] to [0]\n                end\n                switch costume to (knight v)\n            else\n                if <(pick random (1) to (2)) = [1]> then\n                    switch costume to (knight6 v)\n                    repeat until <(costume [name v]) = [knight10]>\n                        next costume\n                        wait (0.001) seconds\n                        set [personal_attack_cooldown_immunity v] to [0]\n                    end\n                    switch costume to (knight v)\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(enemy_ai_type) = [knight_ranged]> and <(tracking_player) = [1]>> then\n        if <(enemy_action_timer_1) > [1]> then\n            set [enemy_action_timer_1 v] to [0]\n            if <[1] = (pick random (1) to (6))> then\n                set [enemy_attack_x v] to (x position)\n                set [enemy_attack_y v] to (y position)\n                set [enemy_attack_type_transfer_value v] to [1]\n                if <(Z_hero_location_reference_x) > (x position)> then\n                    set [enemy_attack_speed_x_transfer v] to [3]\n                else\n                    set [enemy_attack_speed_x_transfer v] to [-3]\n                end\n                if <(Z_hero_location_reference_y) > (y position)> then\n                    set [enemy_attack_speed_y_transfer v] to (((distance_from_hero_Y) / (distance_from_hero_X)) * (1))\n                else\n                    set [enemy_attack_speed_y_transfer v] to (((distance_from_hero_Y) / (distance_from_hero_X)) * (-1))\n                end\n                set [enemy_ranged_attacking v] to [1]\n            end\n        end\n    end\nend\n\nwhen I receive [enter_new_room v]\nset [delete_all_clones v] to [1]\nwait (0.01) seconds\nset [delete_all_clones v] to [0]\nset [enemy_spawn_system_counter_list v] to [0]\nrepeat ((length of [enemy_spawn_list v]) / (5))\n    change [enemy_spawn_system_counter_list v] by (1)\n    if <<(world_map_ground_X) = (item (((enemy_spawn_system_counter_list) * (6)) - (5)) of [enemy_spawn_list v])> and <(world_map_ground_Y) = (item (((enemy_spawn_system_counter_list) * (6)) + (-4)) of [enemy_spawn_list v])>> then\n        clone_enemy (item (((enemy_spawn_system_counter_list) * (6)) + (-3)) of [enemy_spawn_list v]) (item (((enemy_spawn_system_counter_list) * (6)) + (-2)) of [enemy_spawn_list v]) (item (((enemy_spawn_system_counter_list) * (6)) + (-1)) of [enemy_spawn_list v]) (item (((enemy_spawn_system_counter_list) * (6)) + (0)) of [enemy_spawn_list v])\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(delete_all_clones) = [1]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    go [forward v] (4) layers\nend\n\nwhen flag clicked\ndelete all of [enemys_dead_list v]\n\nwhen I start as a clone\nforever\n    if <<(enemy_ai_type) = [weak_moss]> and <(tracking_player) = [1]>> then\n        if <(enemy_action_timer_1) > [2]> then\n            set [enemy_action_timer_1 v] to [0]\n            if <[1] = (pick random (1) to (8))> then\n                set [enemy_attack_x v] to (x position)\n                set [enemy_attack_y v] to (y position)\n                set [enemy_attack_type_transfer_value v] to [2]\n                if <(Z_hero_location_reference_x) > (x position)> then\n                    set [enemy_attack_speed_x_transfer v] to ((distance_from_hero_X) * (0.03))\n                else\n                    set [enemy_attack_speed_x_transfer v] to ((distance_from_hero_X) * (-0.03))\n                end\n                set [enemy_attack_speed_y_transfer v] to [15]\n                set [enemy_ranged_attacking v] to [1]\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <[enemys_dead_list v] contains (enemy_ID_number)?> then\n        delete this clone\n    end\n    if <(enemy_ai_type) = [boss_slime]> then\n        set [lockdoors v] to [1]\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy_movement_type) = [custom_boss]> then\n        if <(enemy_ai_type) = [boss_hornet]> then\n            switch costume to (hornet_idle_1 v)\n            if <(x position) > (enemy_custom_boss_target_X)> then\n                change [speed_x v] by (-2)\n            else\n                change [speed_x v] by (2)\n            end\n            if <(speed_X) > [10]> then\n                change [speed_x v] by (-2.1)\n            else\n                if <[-10] > (speed_X)> then\n                    change [speed_x v] by (2.1)\n                end\n            end\n            change x by (speed_X)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (1)\n                            if <touching (ground v)?> then\n                                change y by (1)\n                                if <touching (ground v)?> then\n                                    change y by (1)\n                                    if <touching (ground v)?> then\n                                        change y by (1)\n                                        if <touching (ground v)?> then\n                                            change y by (1)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            if <touching (ground v)?> then\n                change y by (-8)\n                repeat until <not <touching (ground v)?>>\n                    change x by ((speed_X) * (-1))\n                end\n                set [speed_x v] to [0]\n            end\n            change [speed_y v] by (-1)\n            change y by (speed_Y)\n            if <touching (ground v)?> then\n                repeat until <not <touching (ground v)?>>\n                    change y by ((speed_Y) * (-1))\n                end\n                set [speed_y v] to [0]\n            end\n            change y by (-1)\n            if <(tracking_player) = [1]> then\n                if <<((enemy_custom_boss_target_Y) - (20)) > (y position)> and <((x position) + (100)) > ([abs v] of (enemy_custom_boss_target_X) )>> then\n                    change [speed_y v] by (3)\n                end\n            end\n            change y by (1)\n        end\n    end\nend\n\npoint towards (player v)\nif <(Z_hero_location_reference_x) > (x position)> then\n    change [speed_x v] by (enemy_personal_acceleration)\nelse\n    change [speed_x v] by ((enemy_personal_acceleration) * (-1))\nend\nif <(speed_X) > (personal_max_speed_x)> then\n    change [speed_x v] by (((enemy_personal_acceleration) + (0.1)) * (-1))\nelse\n    if <(speed_X) < ((personal_max_speed_x) * (-1))> then\n        change [speed_x v] by ((enemy_personal_acceleration) + (0.1))\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy_ai_type) = [boss_hornet]> then\n        set [enemy_custom_boss_attack_type v] to (pick random (1) to (4))\n        if <(enemy_custom_boss_attack_type) = [1]> then\n            set [enemy_custom_boss_target_x v] to [-179]\n            set [enemy_custom_boss_target_y v] to [-90]\n            wait until <(enemy_custom_boss_target_X) > ((x position) + (-10))>\n            wait (0.5) seconds\n        end\n        if <(enemy_custom_boss_attack_type) = [2]> then\n            set [enemy_custom_boss_target_x v] to [164]\n            set [enemy_custom_boss_target_y v] to [-90]\n            wait until <((x position) + (10)) > (enemy_custom_boss_target_X)>\n            wait (0.5) seconds\n        end\n        if <(enemy_custom_boss_attack_type) = [3]> then\n            set [enemy_custom_boss_target_x v] to [164]\n            set [enemy_custom_boss_target_y v] to [0]\n            wait until <((x position) + (10)) > (enemy_custom_boss_target_X)>\n        end\n        if <(enemy_custom_boss_attack_type) = [4]> then\n            set [enemy_custom_boss_target_x v] to [-197]\n            set [enemy_custom_boss_target_y v] to [0]\n            wait until <(enemy_custom_boss_target_X) > ((x position) + (-10))>\n        end\n        repeat (pick random (1) to (3))\n            set [enemy_attack_x v] to (x position)\n            set [enemy_attack_y v] to (y position)\n            set [enemy_attack_type_transfer_value v] to [2]\n            if <(Z_hero_location_reference_x) > (x position)> then\n                set [enemy_attack_speed_x_transfer v] to ((distance_from_hero_X) * (0.03))\n            else\n                set [enemy_attack_speed_x_transfer v] to ((distance_from_hero_X) * (-0.03))\n            end\n            set [enemy_attack_speed_y_transfer v] to [15]\n            set [enemy_ranged_attacking v] to [1]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<(enemy_ai_type) = [boss_hornet]> and <[5] < (personal_health)>> then\n        set [lockdoors v] to [1]\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy_ai_type) = [boss_hornet]> then\n        point towards (player v)\n        if <(personal_health) < [100]> then\n            set [enemy_custom_boss_target_x v] to [50]\n            set [enemy_custom_boss_target_y v] to [300]\n            if <touching (_edge_ v)?> then\n                wait (1) seconds\n                set [lockdoors v] to [0]\n                add (enemy_ID_number) to [enemys_dead_list v]\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy_ai_type) = [boss_bee]> then\n        point towards (player v)\n        if <(enemy_custom_boss_target_X) > (x position)> then\n            change x by (3)\n        end\n        if <(x position) > (enemy_custom_boss_target_X)> then\n            change x by (-3)\n        end\n        if <(enemy_custom_boss_target_Y) > (y position)> then\n            change y by (3)\n        end\n        if <(y position) > (enemy_custom_boss_target_Y)> then\n            change y by (-3)\n        end\n    end\nend\n\nrepeat (pick random (1) to (3))\n    set [enemy_attack_x v] to (x position)\n    set [enemy_attack_y v] to (y position)\n    set [enemy_attack_type_transfer_value v] to [2]\n    if <(Z_hero_location_reference_x) > (x position)> then\n        set [enemy_attack_speed_x_transfer v] to ((distance_from_hero_X) * (0.03))\n    else\n        set [enemy_attack_speed_x_transfer v] to ((distance_from_hero_X) * (-0.03))\n    end\n    set [enemy_attack_speed_y_transfer v] to [15]\n    set [enemy_ranged_attacking v] to [1]\nend\n\nset [enemy_custom_boss_target_x v] to [0]\nset [enemy_custom_boss_target_y v] to [-14]\n\nwhen I start as a clone\nforever\n    if <(enemy_ai_type) = [boss_bee]> then\n        point towards (player v)\n        if <(enemy_custom_boss_target_X) > (x position)> then\n            change x by (3)\n        end\n        if <(x position) > (enemy_custom_boss_target_X)> then\n            change x by (-3)\n        end\n        if <(enemy_custom_boss_target_Y) > (y position)> then\n            change y by (3)\n        end\n        if <(y position) > (enemy_custom_boss_target_Y)> then\n            change y by (-3)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy_ai_type) = [boss_bee]> then\n        set [enemy_custom_boss_attack_type v] to (pick random (1) to (4))\n        if <(enemy_custom_boss_attack_type) = [1]> then\n            set [enemy_custom_boss_target_x v] to [-179]\n            set [enemy_custom_boss_target_y v] to [-90]\n            wait until <(enemy_custom_boss_target_X) > ((x position) + (-10))>\n            wait (0.5) seconds\n        end\n        if <(enemy_custom_boss_attack_type) = [2]> then\n            set [enemy_custom_boss_target_x v] to [164]\n            set [enemy_custom_boss_target_y v] to [-90]\n            wait until <((x position) + (10)) > (enemy_custom_boss_target_X)>\n            wait (0.5) seconds\n        end\n        if <(enemy_custom_boss_attack_type) = [3]> then\n            set [enemy_custom_boss_target_x v] to [164]\n            set [enemy_custom_boss_target_y v] to [90]\n            wait until <((x position) + (10)) > (enemy_custom_boss_target_X)>\n        end\n        if <(enemy_custom_boss_attack_type) = [4]> then\n            set [enemy_custom_boss_target_x v] to [-197]\n            set [enemy_custom_boss_target_y v] to [90]\n            wait until <(enemy_custom_boss_target_X) > ((x position) + (-10))>\n        end\n        if <(pick random (1) to (2)) = [1]> then\n            repeat (3)\n                set [enemy_attack_x v] to (x position)\n                set [enemy_attack_y v] to ((y position) + (20))\n                set [enemy_attack_type_transfer_value v] to [1]\n                if <(Z_hero_location_reference_x) > (x position)> then\n                    set [enemy_attack_speed_x_transfer v] to [4]\n                else\n                    set [enemy_attack_speed_x_transfer v] to [-4]\n                end\n                if <(Z_hero_location_reference_y) > (y position)> then\n                    set [enemy_attack_speed_y_transfer v] to (((distance_from_hero_Y) / (distance_from_hero_X)) * (1))\n                else\n                    set [enemy_attack_speed_y_transfer v] to (((distance_from_hero_Y) / (distance_from_hero_X)) * (-1))\n                end\n                set [enemy_ranged_attacking v] to [1]\n                wait (0.5) seconds\n            end\n        else\n            repeat (5)\n                set [enemy_attack_x v] to (x position)\n                set [enemy_attack_y v] to ((y position) + (20))\n                set [enemy_attack_type_transfer_value v] to [1]\n                if <(Z_hero_location_reference_x) > (x position)> then\n                    set [enemy_attack_speed_x_transfer v] to [2]\n                else\n                    set [enemy_attack_speed_x_transfer v] to [-2]\n                end\n                if <(Z_hero_location_reference_y) > (y position)> then\n                    set [enemy_attack_speed_y_transfer v] to (((distance_from_hero_Y) / (distance_from_hero_X)) * (pick random (1) to (5)))\n                else\n                    set [enemy_attack_speed_y_transfer v] to (((distance_from_hero_Y) / (distance_from_hero_X)) * (pick random (-1) to (-5)))\n                end\n                set [enemy_ranged_attacking v] to [1]\n                wait (0.5) seconds\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(enemy_ai_type) = [boss_bee]> then\n        if <[1] < (player_health)> then\n            set [lockdoors v] to [1]\n        else\n            set [lockdoors v] to [0]\n        end\n    end\nend\n\n@scenery_front\n\nwhen flag clicked\nforever\n    switch costume to (join [x] (join (world_map_ground_X) (join [-y] (world_map_ground_Y))))\n    if <(costume [name v]) = (join [x] (join (world_map_ground_X) (join [-y] (world_map_ground_Y))))> then\n        set [ghost v] effect to (0)\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen flag clicked\nforever\n    set x to (0)\n    set y to (0)\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (6) layers\nend\n\n@scenery_back\n\nwhen flag clicked\nbroadcast (enter_new_room v)\nforever\n    go to [back v] layer\n    go [forward v] (2) layers\nend\n\nwhen flag clicked\nforever\n    set x to (0)\n    set y to (0)\nend\n\nwhen I receive [enter_new_room v]\nswitch costume to (join [x] (join (world_map_ground_X) (join [-y] (world_map_ground_Y))))\nif <(costume [name v]) = (join [x] (join (world_map_ground_X) (join [-y] (world_map_ground_Y))))> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (100)\nend\n\n@backround1\n\nwhen flag clicked\nset [world_area v] to [1]\nforever\n    go to [back v] layer\n    go [forward v] (0) layers\nend\n\nwhen flag clicked\nforever\n    set x to ((Z_hero_location_reference_x) * (0.05))\n    set y to ((Z_hero_location_reference_y) * (0.05))\nend\n\nif <(world_area) = [1]> then\n\nwhen flag clicked\nforever\n    switch costume to (world_area_name)\nend\n\n@foreground\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (9) layers\n    if <(world_area_name) = [city]> then\n        switch costume to (city v)\n    end\n    if <(world_area_name) = [cave]> then\n        switch costume to (cave v)\n    end\n    if <(world_area_name) = [town]> then\n        switch costume to (cave v)\n    end\n    if <(world_area_name) = [bar]> then\n        switch costume to (bar v)\n    end\n    if <(world_area_name) = [green]> then\n        switch costume to (city v)\n    end\n    if <(world_area_name) = [hive]> then\n        switch costume to (hive v)\n    end\n    if <(world_area_name) = [mind]> then\n        switch costume to (empty v)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (5)\nforever\n    set x to ((Z_hero_location_reference_x) * (0.15))\n    set y to ((Z_hero_location_reference_y) * (0.15))\nend\n\n@player\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [speed_x v] to [0]\nset [speed_y v] to [0]\nset [hero_attack_position v] to [0]\ngo to x: (-100) y: (-100)\nset rotation style [left-right v]\nforever\n    run_game\nend\n\ndefine run_game\nif <(Zplayer_active) = [1]> then\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(hero_movement) = [1]>> then\n        set [hero_player_dirrection v] to [0]\n        change [speed_x v] by (-0.25)\n        if <[2] < (speed_X)> then\n            change [speed_x v] by (-0.7)\n        end\n    else\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(hero_movement) = [1]>> then\n            set [hero_player_dirrection v] to [1]\n            change [speed_x v] by (0.25)\n            if <[-2] > (speed_X)> then\n                change [speed_x v] by (0.7)\n            end\n        else\n            set [speed_x v] to ((speed_X) * (0.8))\n        end\n    end\n    if <(speed_X) < [-5.1]> then\n        change [speed_x v] by (1)\n    end\n    if <(speed_X) > [5.1]> then\n        change [speed_x v] by (-1)\n    end\n    change [speed_y v] by (-1)\n    if <(speed_Y) < [-30]> then\n        set [speed_y v] to [-30]\n    end\n    change x by (speed_X)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (1)\n                            if <touching (ground v)?> then\n                                change y by (1)\n                                if <touching (ground v)?> then\n                                    change y by (1)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <touching (ground v)?> then\n        change y by (-8)\n        repeat until <not <touching (ground v)?>>\n            change x by ((speed_X) * (-1))\n        end\n        if <(ability_wall_jump_unlocked) = [1]> then\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                set [speed_y v] to [12]\n                set [pitch v] effect to (((speed_X) * (10)) + (30))\n                start sound [Low Whoosh v]\n                if <(speed_X) < [0]> then\n                    set [speed_x v] to [8]\n                else\n                    set [speed_x v] to [-8]\n                end\n            end\n        end\n    end\n    change y by (speed_Y)\n    if <touching (ground v)?> then\n        repeat until <not <touching (ground v)?>>\n            change y by ((speed_Y) * (-1))\n        end\n        set [speed_y v] to [0]\n    end\n    change y by (-1)\n    if <<<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (k v) pressed?>>> and <(hero_movement) = [1]>> then\n        set [speed_y v] to [14]\n        set [pitch v] effect to ((speed_X) * (10))\n        start sound [Low Whoosh v]\n    end\n    change y by (1)\n    set [z_hero_location_reference_x v] to (x position)\n    set [z_hero_location_reference_y v] to (y position)\nend\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <(hero_player_dirrection) = [1]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\nend\n\nwhen I receive [hero_knockback_right v]\nset [speed_x v] to [-15]\nchange [speed_y v] by (7)\n\nwhen I receive [hero_knockback_left v]\nset [speed_x v] to [15]\nset [speed_y v] to [7]\n\nwhen I receive [hero_boosted_upwards v]\nset [speed_y v] to [11]\n\nwhen flag clicked\nforever\n    if <(invunerability_frames) < [5]> then\n        set [brightness v] effect to (100)\n    else\n        set [brightness v] effect to (player_heal_time)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(lockdoors) = [0]> then\n        if <(x position) > [235]> then\n            set x to (-230)\n            change [world_map_ground_x v] by (1)\n            broadcast (enter_new_room v)\n        end\n        if <(x position) < [-235]> then\n            set x to (230)\n            change [world_map_ground_x v] by (-1)\n            broadcast (enter_new_room v)\n        end\n        if <(y position) < [-175]> then\n            set y to (170)\n            change [world_map_ground_y v] by (-1)\n            broadcast (enter_new_room v)\n        end\n        if <(y position) > [175]> then\n            set y to (-170)\n            set [speed_y v] to [12]\n            change [world_map_ground_y v] by (1)\n            broadcast (enter_new_room v)\n        end\n    end\nend\n\nwhen I receive [hero_hurt v]\nchange [player_health v] by (-1)\n\nwhen I receive [go_to_plylon v]\nwait (0.12) seconds\ngo to x: (pylon_x) y: (pylon_y)\nbroadcast (enter_new_room v)\nwait (4) seconds\nset [lockdoors v] to [0]\n\nwhen flag clicked\nforever\n    if <[-0.1] > (speed_Y)> then\n        set [hero_jumping v] to [-1]\n    else\n        if <(speed_Y) > [1.0]> then\n            set [hero_jumping v] to [1]\n        else\n            set [hero_jumping v] to [0]\n        end\n    end\nend\n\nwhen I receive [small_hero_knockback_right v]\nif <(hero_jumping) = [0]> then\n    change [speed_x v] by (-10)\n    change [speed_y v] by (1)\nend\n\nwhen I receive [small_hero_knockback_left v]\nif <(hero_jumping) = [0]> then\n    change [speed_x v] by (10)\n    change [speed_y v] by (1)\nend\n\nwhen flag clicked\nforever\n    change [dash_meter_right v] by (-1)\n    if <(dash_meter_right) < [0]> then\n        change [dash_meter_right v] by (2)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(ability_dash_unlocked) = [1]> then\n        if <key (right arrow v) pressed?> then\n            wait until <not <key (right arrow v) pressed?>>\n            if <[-1] < (dash_meter_right)> then\n                change [dash_meter_right v] by (10)\n            end\n        end\n        if <[11] < (dash_meter_right)> then\n            repeat (4)\n                set [invunerability_frames v] to [7]\n                set [speed_x v] to [25]\n                set [speed_y v] to [0]\n                broadcast (clone_hero_sprite v)\n            end\n            set [speed_x v] to [2]\n            set [dash_meter_right v] to [-20]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(ability_dash_unlocked) = [1]> then\n        if <key (left arrow v) pressed?> then\n            wait until <not <key (left arrow v) pressed?>>\n            if <[-1] < (dash_meter_left)> then\n                change [dash_meter_left v] by (10)\n            end\n        end\n        if <[11] < (dash_meter_left)> then\n            repeat (4)\n                set [invunerability_frames v] to [7]\n                set [speed_x v] to [-25]\n                set [speed_y v] to [0]\n                broadcast (clone_hero_sprite v)\n            end\n            set [speed_x v] to [-2]\n            set [dash_meter_left v] to [-20]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    change [dash_meter_left v] by (-1)\n    if <(dash_meter_left) < [0]> then\n        change [dash_meter_left v] by (2)\n    end\nend\n\nwhen flag clicked\nforever\n    change [dash_meter_up v] by (-1)\n    if <(dash_meter_up) < [0]> then\n        change [dash_meter_up v] by (2)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(ability_double_jump_unlocked) = [1]> then\n        if <key (up arrow v) pressed?> then\n            wait until <not <key (up arrow v) pressed?>>\n            if <[-1] < (dash_meter_up)> then\n                change [dash_meter_up v] by (10)\n            end\n        end\n        if <[11] < (dash_meter_up)> then\n            repeat (4)\n                set [speed_y v] to [9]\n                broadcast (clone_hero_sprite v)\n            end\n            set [dash_meter_up v] to [-40]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<(cling_hitbox_touching_ground) = [1]> and <key (down arrow v) pressed?>> and <(dash_super) < [100]>> then\n        broadcast (hero_clinging v)\n        set [speed_y v] to [0]\n        set [speed_x v] to [0]\n        set [clinging! v] to [1]\n        go to x: (clinging_target_X) y: (clinging_target_Y)\n    else\n        broadcast (hero_stop_clinging v)\n        set [clinging! v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(ability_super_dash_unlocked) = [1]> then\n        if <(clinging!) = [1]> then\n            if <key (left arrow v) pressed?> then\n                change [dash_super v] by (2)\n                if <<(dash_super) > [100]> or <[100] = (dash_super)>> then\n                    repeat (3)\n                        broadcast (clone_hero_sprite v)\n                        set [clinging! v] to [0]\n                        set [speed_x v] to [-20]\n                        set [speed_y v] to [4]\n                    end\n                    repeat (40)\n                        if <(cling_hitbox_touching_ground) = [0]> then\n                            broadcast (clone_hero_sprite v)\n                            set [speed_x v] to [-20]\n                            set [speed_y v] to [1]\n                        else\n                            set [speed_x v] to [0]\n                            set [speed_y v] to [0]\n                        end\n                    end\n                end\n            end\n            if <key (right arrow v) pressed?> then\n                change [dash_super v] by (2)\n                if <<(dash_super) > [100]> or <[100] = (dash_super)>> then\n                    repeat (3)\n                        broadcast (clone_hero_sprite v)\n                        set [clinging! v] to [0]\n                        set [speed_x v] to [20]\n                        set [speed_y v] to [4]\n                    end\n                    repeat (40)\n                        if <(cling_hitbox_touching_ground) = [0]> then\n                            broadcast (clone_hero_sprite v)\n                            set [speed_x v] to [20]\n                            set [speed_y v] to [1]\n                        else\n                            set [speed_x v] to [0]\n                            set [speed_y v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<not <key (right arrow v) pressed?>> and <not <key (left arrow v) pressed?>>> then\n        set [dash_super v] to [0]\n    end\nend\n\nwhen flag clicked\nset [ability_dash_unlocked v] to [0]\nset [ability_double_jump_unlocked v] to [0]\nset [ability_super_dash_unlocked v] to [0]\nset [ability_wall_jump_unlocked v] to [0]\n\nwhen flag clicked\nforever\n    if <<not <touching (shopkeeper_npc v)?>> and <not <touching (pylon v)?>>> then\n        set [atext_active v] to [0]\n        set [atext_output v] to [void]\n    else\n        set [atext_active v] to [1]\n    end\nend\n\n@player_attack_hitbox\n\nwhen flag clicked\nforever\n    change [hero_sword_attack_cooldown v] by (1)\n    if <(hero_player_dirrection) = [1]> then\n        if <<key (x v) pressed?> and <(hero_sword_attack_cooldown) > [10]>> then\n            set [hero_sword_attack_cooldown v] to [0]\n            set [hero_attacking v] to [1]\n            set [pitch v] effect to (pick random (0) to (30))\n            start sound [High Whoosh v]\n            if <(hero_jumping) = [0]> then\n                point in direction (-90)\n                repeat (6)\n                    turn right (30) degrees\n                    create clone of (_myself_ v)\n                end\n                repeat (6)\n                    turn left (30) degrees\n                end\n            else\n                set [attacking_upwards v] to [1]\n                point in direction (-90)\n                repeat (12)\n                    turn left (-30) degrees\n                    create clone of (_myself_ v)\n                end\n            end\n            set [attacking_upwards v] to [0]\n            set [hero_attacking v] to [0]\n        end\n    end\n    if <(hero_player_dirrection) = [0]> then\n        if <<key (x v) pressed?> and <(hero_sword_attack_cooldown) > [10]>> then\n            set [hero_sword_attack_cooldown v] to [0]\n            set [hero_attacking v] to [1]\n            set [pitch v] effect to (pick random (0) to (30))\n            start sound [High Whoosh v]\n            if <(hero_jumping) = [0]> then\n                point in direction (90)\n                repeat (6)\n                    turn right (-30) degrees\n                    create clone of (_myself_ v)\n                end\n                repeat (6)\n                    turn left (-30) degrees\n                end\n            else\n                set [attacking_upwards v] to [1]\n                point in direction (90)\n                repeat (12)\n                    turn left (30) degrees\n                    create clone of (_myself_ v)\n                end\n            end\n            set [attacking_upwards v] to [0]\n            set [hero_attacking v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [all around v]\nforever\n    if <(hero_attacking) = [1]> then\n        go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\n    end\n    if <(hero_attacking) = [0]> then\n        go to x: (-1000) y: (-1000)\n    end\nend\n\nwhen I start as a clone\nrepeat (4)\n    change [brightness v] effect by (25)\n    change [ghost v] effect by (15)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    if <<touching (enemy v)?> and <(attacking_upwards) = [1]>> then\n        broadcast (hero_boosted_upwards v)\n    end\nend\n\nwhen I start as a clone\nforever\n    go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\nend\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    go [forward v] (3) layers\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (3) layers\nend\n\nwhen flag clicked\nforever\n    if <(weapon_ID_selected) = [1]> then\n        switch costume to (copper_sword v)\n        set [hero_sword_dammage v] to [0.75]\n    else\n        if <(weapon_ID_selected) = [2]> then\n            switch costume to (bronze_sword v)\n            set [hero_sword_dammage v] to [1]\n        else\n            switch costume to (iron_sword v)\n            set [hero_sword_dammage v] to [1.25]\n        end\n    end\nend\n\n@death_effects \n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (-1000) y: (-1000)\n\nwhen I receive [dead_enemy v]\ngo to x: (dead_enemy_X) y: (dead_enemy_Y)\nswitch costume to (leave empty!!! v)\nset [ghost v] effect to (0)\nif <<(dead_enemy_type) = [weak_slime]> or <(dead_enemy_type) = [fast_slime]>> then\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nelse\n    if <<(dead_enemy_type) = [big_slime]> or <(dead_enemy_type) = [chest]>> then\n        repeat (20)\n            create clone of (_myself_ v)\n        end\n    else\n        if <<(dead_enemy_type) = [knight]> or <(dead_enemy_type) = [knight_ranged]>> then\n            repeat (1)\n                create clone of (_myself_ v)\n            end\n        else\n            if <(dead_enemy_type) = [hero]> then\n                repeat (1)\n                    create clone of (_myself_ v)\n                end\n            else\n                if <(dead_enemy_type) = [broken_mask]> then\n                    repeat (1)\n                        switch costume to (mask_1 v)\n                        create clone of (_myself_ v)\n                        switch costume to (mask_2 v)\n                        create clone of (_myself_ v)\n                        switch costume to (mask_3 v)\n                        create clone of (_myself_ v)\n                        switch costume to (mask_4 v)\n                        create clone of (_myself_ v)\n                        switch costume to (mask_5 v)\n                        create clone of (_myself_ v)\n                        switch costume to (mask_6 v)\n                        create clone of (_myself_ v)\n                    end\n                end\n            end\n        end\n    end\nend\nset [ghost v] effect to (100)\ngo to x: (-1000) y: (-1000)\n\nwhen I start as a clone\nif <<<<(dead_enemy_type) = [weak_slime]> or <(dead_enemy_type) = [big_slime]>> or <(dead_enemy_type) = [fast_slime]>> or <(dead_enemy_type) = [weak_moss]>> then\n    set [ran_1 v] to (pick random (1) to (3))\n    if <(ran_1) = [1]> then\n        switch costume to (slime_1 v)\n    end\n    if <(ran_1) = [2]> then\n        switch costume to (slime_2 v)\n    end\n    if <(ran_1) = [3]> then\n        switch costume to (slime_3 v)\n    end\nelse\n    if <<(dead_enemy_type) = [knight]> or <(dead_enemy_type) = [ranged_knight]>> then\n        switch costume to (costume1 v)\n    else\n        if <(dead_enemy_type) = [chest]> then\n            set [ran_1 v] to (pick random (1) to (2))\n            if <(ran_1) = [1]> then\n                switch costume to (wood_1 v)\n            end\n            if <(ran_1) = [2]> then\n                switch costume to (wood_2 v)\n            end\n        end\n    end\nend\nif <not <(dead_enemy_type) = [broken_mask]>> then\n    set [death_animation_speed_y v] to (pick random (4) to (7))\n    set [death_animation_speed_x v] to (pick random (-10) to (10))\nelse\n    set [death_animation_speed_y v] to (pick random (0) to (-5))\n    set [death_animation_speed_x v] to (pick random (-3) to (3))\nend\nforever\n    if <not <(dead_enemy_type) = [broken_mask]>> then\n        repeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n            set [death_animation_speed_x v] to ((death_animation_speed_X) * (0.8))\n            change [death_animation_speed_y v] by (-0.5)\n            change x by (death_animation_speed_X)\n            change y by (death_animation_speed_Y)\n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        delete this clone\n    else\n        repeat (20)\n            change [ghost v] effect by (5)\n            change [death_animation_speed_y v] by (-0.5)\n            change x by (death_animation_speed_X)\n            change y by (death_animation_speed_Y)\n        end\n        delete this clone\n    end\nend\n\n@coin_1\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (-1000) y: (-1000)\n\nwhen I receive [dead_enemy v]\nif <(dead_enemy_loot_cooldown) > [50]> then\n    set [dead_enemy_loot_cooldown v] to [0]\n    go to x: (dead_enemy_X) y: (dead_enemy_Y)\n    switch costume to (empty v)\n    set [ghost v] effect to (0)\n    if <(dead_enemy_type) = [broken_mask]> then\n    else\n        if <(dead_enemy_type) = [chest]> then\n            repeat (50)\n                create clone of (_myself_ v)\n            end\n        else\n            repeat (5)\n                create clone of (_myself_ v)\n            end\n        end\n    end\n    set [ghost v] effect to (100)\n    go to x: (-1000) y: (-1000)\nend\n\nwhen I start as a clone\nswitch costume to (coin v)\ngo to [front v] layer\nset [death_animation_speed_x v] to (pick random (-10) to (10))\nset [death_animation_speed_y v] to (pick random (6) to (11))\nforever\n    repeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n        set [death_animation_speed_x v] to ((death_animation_speed_X) * (0.9))\n        change [death_animation_speed_y v] by (-0.5)\n        change x by (death_animation_speed_X)\n        change y by (death_animation_speed_Y)\n    end\n    wait (5) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        change [coins v] by (1)\n        start sound [Coin v]\n        delete this clone\n    end\nend\n\nwhen flag clicked\nforever\n    change [dead_enemy_loot_cooldown v] by (1)\nend\n\n@loot_chest\n\nwhen flag clicked\nforever\n    if <<touching (player v)?> and <(chest_active) = [1]>> then\n        add (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y))))) to [chests_looted_list v]\n        set [chest_active v] to [0]\n        set [dead_enemy_type v] to [chest]\n        set [dead_enemy_x v] to (x position)\n        set [dead_enemy_y v] to ((20) + (y position))\n        broadcast (dead_enemy v)\n        go to x: (-1000) y: (-1000)\n    end\nend\n\nwhen flag clicked\ngo to x: (-1000) y: (-1000)\nset [chest_active v] to [0]\ndelete all of [chests_looted_list v]\nforever\n    if <not <[chests_looted_list v] contains (join [x] (join (world_map_ground_X) (join [-] (join [y] (world_map_ground_Y)))))?>> then\n        if <<(world_map_ground_X) = [11]> and <(world_map_ground_Y) = [-8]>> then\n            go to x: (150) y: (-45)\n            set [chest_active v] to [1]\n        else\n            if <<(world_map_ground_X) = [6]> and <(world_map_ground_Y) = [-6]>> then\n                go to x: (-129) y: (33)\n                set [chest_active v] to [1]\n            else\n                if <<(world_map_ground_X) = [-1]> and <(world_map_ground_Y) = [-6]>> then\n                    go to x: (-165) y: (-23)\n                    set [chest_active v] to [1]\n                else\n                    go to x: (-1000) y: (-1000)\n                    set [chest_active v] to [0]\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(chest_active) = [0]> then\n        go to x: (-1000) y: (-1000)\n        set [ghost v] effect to (100)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@health_bar\n\nwhen flag clicked\nwait (0.001) seconds\nset [player_maxhealth v] to [9]\nset [player_health v] to (player_maxhealth)\nforever\n    switch costume to (player_health)\nend\n\nwhen flag clicked\nset [lockdoors v] to [0]\nforever\n    if <(player_health) < [1]> then\n        set [lockdoors v] to [0]\n        set [world_map_ground_x v] to [6]\n        set [world_map_ground_y v] to [0]\n        clear sound effects\n        wait (0.1) seconds\n        set [delete_all_clones v] to [1]\n        set [music v] to [1]\n        broadcast (enter_new_room v)\n        set [delete_all_clones v] to [0]\n        set [player_health v] to (player_maxhealth)\n    end\n    if <(player_health) > (player_maxhealth)> then\n        set [player_health v] to (player_maxhealth)\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <<<(Z_hero_location_reference_x) < [74]> and <[60] < (Z_hero_location_reference_y)>> or <(world_pylon_open) = [1]>> then\n        set [ghost v] effect to (90)\n    else\n        set [ghost v] effect to (10)\n    end\nend\n\nwhen I receive [hero_hurt v]\nstart sound [hero_damage v]\nrepeat ((10) - (player_health))\n    go to x: ((x position) + (pick random (2) to (-2))) y: ((y position) + (pick random (2) to (-2)))\nend\ngo to x: (102) y: (7)\nif <(player_health) = [0]> then\n    set [dead_enemy_y v] to [123]\n    set [dead_enemy_x v] to [-96]\n    set [dead_enemy_type v] to [broken_mask]\n    broadcast (dead_enemy v)\nend\nif <(player_health) = [3]> then\n    set [dead_enemy_y v] to [123]\n    set [dead_enemy_x v] to [-50]\n    set [dead_enemy_type v] to [broken_mask]\n    broadcast (dead_enemy v)\nend\nif <(player_health) = [6]> then\n    set [dead_enemy_y v] to [123]\n    set [dead_enemy_x v] to [5]\n    set [dead_enemy_type v] to [broken_mask]\n    broadcast (dead_enemy v)\nend\nif <[charms_equipted_list v] contains [steadfast]?> then\n    change [player_magic v] by (10)\nend\n\nwhen flag clicked\nforever\n    if <(player_health) < [2]> then\n        go to x: ((x position) + (pick random (3) to (-3))) y: ((y position) + (pick random (4) to (-4)))\n        wait (0.001) seconds\n        go to x: (102) y: (7)\n    else\n        if <(player_health) < [3]> then\n            go to x: ((x position) + (pick random (2) to (-2))) y: ((y position) + (pick random (2.5) to (-2.5)))\n            wait (0.001) seconds\n            go to x: (102) y: (7)\n        else\n            if <(player_health) < [4]> then\n                go to x: ((x position) + (pick random (1) to (-1))) y: ((y position) + (pick random (1.5) to (-1.5)))\n                wait (0.001) seconds\n                go to x: (102) y: (7)\n            end\n        end\n    end\nend\n\n@magic_bar\n\nwhen flag clicked\nforever\n    go to x: (-182) y: (125)\n    if <(player_magic) > [90]> then\n        switch costume to (10 v)\n    else\n        if <(player_magic) > [80]> then\n            switch costume to (9 v)\n        else\n            if <(player_magic) > [70]> then\n                switch costume to (8 v)\n            else\n                if <(player_magic) > [60]> then\n                    switch costume to (7 v)\n                else\n                    if <(player_magic) > [50]> then\n                        switch costume to (6 v)\n                    else\n                        if <(player_magic) > [40]> then\n                            switch costume to (5 v)\n                        else\n                            if <(player_magic) > [30]> then\n                                switch costume to (4 v)\n                            else\n                                if <(player_magic) > [20]> then\n                                    switch costume to (3 v)\n                                else\n                                    if <(player_magic) > [10]> then\n                                        switch costume to (2 v)\n                                    else\n                                        switch costume to (1 v)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ncreate clone of (_myself_ v)\n\nwhen I receive [successful_hit v]\nif <(player_magic) < [100]> then\n    change [player_magic v] by (6)\n    set [brightness v] effect to (100)\n    repeat (10)\n        wait (0.0001) seconds\n        change [brightness v] effect by (-10)\n    end\n    set [brightness v] effect to (0)\nend\nif <[charms_equipted_list v] contains [fail]?> then\n    change [player_magic v] by (6)\nend\n\nwhen flag clicked\nforever\n    if <(player_magic) > [100]> then\n        set [player_magic v] to [100]\n    end\n    if <(player_magic) < [0]> then\n        set [player_magic v] to [0]\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    go [forward v] (9) layers\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\n    set x to (-181)\n    set y to ((89) + ((player_magic) * (0.5)))\nend\n\nwhen I start as a clone\nforever\n    if <<(Z_hero_location_reference_x) < [74]> and <[60] < (Z_hero_location_reference_y)>> then\n        set [ghost v] effect to (75)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (bubbles1 v)\nforever\n    repeat until <(costume [name v]) = [bubbles6]>\n        next costume\n        wait ((0.0015) * ((100) - (player_magic))) seconds\n    end\n    switch costume to (bubbles1 v)\nend\n\nwhen flag clicked\ngo to [front v] layer\nset [player_magic v] to [0]\nset [player_health v] to [5]\nforever\n    if <<<(Z_hero_location_reference_x) < [74]> and <[60] < (Z_hero_location_reference_y)>> or <(world_pylon_open) = [1]>> then\n        set [ghost v] effect to (90)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@player_magic\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        if <<<<key (c v) pressed?> and <(hero_magic_attack_cooldown) > [50]>> and <(player_magic) > [45]>> and <[items_locations_purchased_list v] contains [x11-y-9]?>> then\n            set [hero_magic_attack_cooldown v] to [0]\n            change [player_magic v] by (-45)\n            go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\n            set [velocity_x v] to [20]\n            point in direction (90)\n            broadcast (hero_knockback_right v)\n        end\n    else\n        if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n            if <<<<key (c v) pressed?> and <(hero_magic_attack_cooldown) > [50]>> and <(player_magic) > [45]>> and <[items_locations_purchased_list v] contains [x11-y-9]?>> then\n                set [hero_magic_attack_cooldown v] to [0]\n                change [player_magic v] by (-45)\n                go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\n                set [velocity_x v] to [-20]\n                point in direction (-90)\n                broadcast (hero_knockback_left v)\n            end\n        else\n            if <key (c v) pressed?> then\n                if <<(player_magic) > [10]> and <(player_health) < (player_maxhealth)>> then\n                    set [hero_movement v] to [0]\n                    change [player_heal_time v] by (12)\n                end\n            else\n                set [hero_movement v] to [1]\n                set [player_heal_time v] to [0]\n            end\n            if <[99] < (player_heal_time)> then\n                start sound [focus_health_heal v]\n                set [player_heal_time v] to [0]\n                change [player_health v] by (1)\n                change [player_magic v] by (-10)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    change x by (velocity_X)\n    change y by (velocity_Y)\n    change [hero_magic_attack_cooldown v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [320]> then\n        set [ghost v] effect to (100)\n    else\n        if <[-320] > (x position)> then\n            set [ghost v] effect to (100)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\nset [player_magic v] to [100]\n\n@door_down\n\nwhen flag clicked\nforever\n    if <<(world_map_ground_X) = [17]> and <(world_map_ground_Y) = [-7]>> then\n        go to x: (80) y: (-60)\n        set [door_1_active v] to [1]\n    else\n        if <<(world_map_ground_X) = [19]> and <(world_map_ground_Y) = [-7]>> then\n            go to x: (120) y: (-60)\n            set [door_1_active v] to [1]\n        else\n            set [door_1_active v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(door_1_active) = [1]> then\n        set [ghost v] effect to (0)\n    else\n        set [ghost v] effect to (100)\n        go to x: (-1000) y: (-1000)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (player v)?> and <(door_1_active) = [1]>> then\n        if <key (down arrow v) pressed?> then\n            change [world_map_ground_y v] by (-1)\n            broadcast (enter_new_room v)\n        end\n    end\nend\n\n@door_up\n\nwhen flag clicked\nforever\n    if <<(world_map_ground_X) = [17]> and <(world_map_ground_Y) = [-8]>> then\n        go to x: (80) y: (-60)\n        set [door_1_active v] to [1]\n    else\n        if <<(world_map_ground_X) = [19]> and <(world_map_ground_Y) = [-8]>> then\n            go to x: (120) y: (-60)\n            set [door_1_active v] to [1]\n        else\n            set [door_1_active v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(door_1_active) = [1]> then\n        set [ghost v] effect to (0)\n    else\n        set [ghost v] effect to (100)\n        go to x: (-1000) y: (-1000)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (player v)?> and <(door_1_active) = [1]>> then\n        if <key (up arrow v) pressed?> then\n            change [world_map_ground_y v] by (1)\n            broadcast (enter_new_room v)\n        end\n    end\nend\n\n@pylon\n\nwhen flag clicked\nif <(editing_game) = [0]> then\n    set [pylon_city v] to [0]\n    set [pylon_town v] to [0]\n    set [pylon_cave v] to [0]\n    set [pylon_green v] to [0]\n    set [pylon_hive v] to [0]\nelse\n    set [pylon_city v] to [1]\n    set [pylon_town v] to [1]\n    set [pylon_cave v] to [1]\n    set [pylon_green v] to [1]\nend\nforever\n    turn right (1) degrees\n    if <<(world_map_ground_X) = [6]> and <(world_map_ground_Y) = [0]>> then\n        go to x: (100) y: (-60)\n        set [pylon_active v] to [1]\n        if <touching (player v)?> then\n            set [pylon_city v] to [1]\n        end\n    else\n        if <<(world_map_ground_X) = [8]> and <(world_map_ground_Y) = [-7]>> then\n            go to x: (0) y: (-40)\n            set [pylon_active v] to [1]\n            if <touching (player v)?> then\n                set [pylon_cave v] to [1]\n            end\n        else\n            if <<(world_map_ground_X) = [18]> and <(world_map_ground_Y) = [-7]>> then\n                go to x: (0) y: (-40)\n                set [pylon_active v] to [1]\n                if <touching (player v)?> then\n                    set [pylon_town v] to [1]\n                end\n            else\n                if <<(world_map_ground_X) = [4]> and <(world_map_ground_Y) = [-7]>> then\n                    go to x: (0) y: (30)\n                    set [pylon_active v] to [1]\n                    if <touching (player v)?> then\n                        set [pylon_town v] to [1]\n                    end\n                else\n                    if <<(world_map_ground_X) = [-4]> and <(world_map_ground_Y) = [-7]>> then\n                        go to x: (100) y: (-50)\n                        set [pylon_active v] to [1]\n                        if <touching (player v)?> then\n                            set [pylon_town v] to [1]\n                        end\n                    else\n                        if <<(world_map_ground_X) = [19]> and <(world_map_ground_Y) = [-13]>> then\n                            go to x: (100) y: (-50)\n                            set [pylon_active v] to [1]\n                            if <touching (player v)?> then\n                                set [pylon_hive v] to [1]\n                            end\n                        else\n                            go to x: (-1000) y: (-1000)\n                            set [pylon_active v] to [1]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    set [pylon_x v] to (x position)\n    set [pylon_y v] to (y position)\n    if <(pylon_active) = [1]> then\n        set [ghost v] effect to (0)\n    else\n        set [ghost v] effect to (100)\n        go to x: (-1000) y: (-1000)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (player v)?> and <key (space v) pressed?>> then\n        broadcast (open_map v)\n    end\n    if <not <touching (player v)?>> then\n        broadcast (close_map v)\n    end\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <not <touching (player v)?>> then\n        set [world_pylon_open v] to [0]\n        set [world_pylon_button_selected v] to [0]\n    end\n    if <<touching (player v)?> and <key (space v) pressed?>> then\n        set [world_pylon_open v] to [1]\n        set [world_pylon_button_selected v] to [1]\n    end\nend\n\n@multiplayer 1.0\n\nwhen flag clicked\nforever\n    set [multiplayer_hero_location_x v] to (round ((Z_hero_location_reference_x) + (1000)))\n    repeat until <(length of (multiplayer_hero_location_X)) = [5]>\n        set [multiplayer_hero_location_x v] to (join [0] (multiplayer_hero_location_X))\n    end\n    set [multiplayer_hero_location_y v] to (round ((Z_hero_location_reference_y) + (1000)))\n    repeat until <(length of (multiplayer_hero_location_Y)) = [5]>\n        set [multiplayer_hero_location_y v] to (join [0] (multiplayer_hero_location_Y))\n    end\n    set [multiplayer_hero_room_x v] to ((world_map_ground_X) + (1000))\n    repeat until <(length of (multiplayer_hero_room_X)) = [5]>\n        set [multiplayer_hero_room_x v] to (join [0] (multiplayer_hero_room_X))\n    end\n    set [multiplayer_hero_room_y v] to ((world_map_ground_Y) + (1000))\n    repeat until <(length of (multiplayer_hero_room_Y)) = [5]>\n        set [multiplayer_hero_room_y v] to (join [0] (multiplayer_hero_room_Y))\n    end\n    set [multiplayer_hero_facing v] to (hero_player_dirrection)\n    if <(player_ID) = [1]> then\n        set [☁ player_1 v] to (join (multiplayer_hero_room_X) (join (multiplayer_hero_room_Y) (join (multiplayer_hero_location_X) (join (multiplayer_hero_location_Y) (multiplayer_hero_facing)))))\n    end\n    if <(player_ID) = [2]> then\n        set [☁ player_2 v] to (join (multiplayer_hero_room_X) (join (multiplayer_hero_room_Y) (join (multiplayer_hero_location_X) (join (multiplayer_hero_location_Y) (multiplayer_hero_facing)))))\n    end\nend\n\nwhen flag clicked\nset [☁ players_active v] to (join (players_active_letter_1) (join (players_active_letter_2) (join (players_active_letter_3) (players_active_letter_4))))\nset [player_id v] to (pick random (1) to (4))\n\nwhen flag clicked\nwait (0.2) seconds\ncreate clone of (_myself_ v)\nset [clone_id v] to [1]\nwait (0.2) seconds\ncreate clone of (_myself_ v)\nset [clone_id v] to [2]\nwait (0.2) seconds\ncreate clone of (_myself_ v)\nset [clone_id v] to [3]\nwait (0.2) seconds\ncreate clone of (_myself_ v)\nset [clone_id v] to [4]\nset [ghost v] effect to (100)\n\nwhen I start as a clone\nset rotation style [left-right v]\nforever\n    if <(clone_ID) = [1]> then\n        set [clone_personal_location_value v] to (☁ player_1)\n    else\n        if <(clone_ID) = [2]> then\n            set [clone_personal_location_value v] to (☁ player_2)\n        else\n            if <(clone_ID) = [3]> then\n                set [clone_personal_location_value v] to (☁ player_3)\n            else\n                if <(clone_ID) = [4]> then\n                    set [clone_personal_location_value v] to (☁ player_4)\n                end\n            end\n        end\n    end\n    if <<not <(clone_ID) = (player_ID)>> and <<((multiplayer_hero_room_X) - (1000)) = ((join (letter (1) of (clone_personal_location_value)) (join (letter (2) of (clone_personal_location_value)) (join (letter (3) of (clone_personal_location_value)) (join (letter (4) of (clone_personal_location_value)) (letter (5) of (clone_personal_location_value)))))) - (1000))> and <((multiplayer_hero_room_Y) - (1000)) = ((join (letter (6) of (clone_personal_location_value)) (join (letter (7) of (clone_personal_location_value)) (join (letter (8) of (clone_personal_location_value)) (join (letter (9) of (clone_personal_location_value)) (letter (10) of (clone_personal_location_value)))))) - (1000))>>> then\n        set x to ((join (letter (11) of (clone_personal_location_value)) (join (letter (12) of (clone_personal_location_value)) (join (letter (13) of (clone_personal_location_value)) (join (letter (14) of (clone_personal_location_value)) (letter (15) of (clone_personal_location_value)))))) - (1000))\n        set y to ((join (letter (16) of (clone_personal_location_value)) (join (letter (17) of (clone_personal_location_value)) (join (letter (18) of (clone_personal_location_value)) (join (letter (19) of (clone_personal_location_value)) (letter (20) of (clone_personal_location_value)))))) - (1000))\n        set [ghost v] effect to (0)\n        if <(letter (21) of (clone_personal_location_value)) = [1]> then\n            point in direction (90)\n        else\n            point in direction (-90)\n        end\n    else\n        go to x: (-1000) y: (-1000)\n        set [ghost v] effect to (100)\n    end\nend\n\nif <(letter (1) of (☁ players_active)) = [0]> then\n    set [players_active_letter_1 v] to [1]\n    set [player_id v] to [1]\nelse\n    if <(letter (2) of (☁ players_active)) = [0]> then\n        set [players_active_letter_2 v] to [1]\n        set [player_id v] to [2]\n    else\n        if <(letter (3) of (☁ players_active)) = [0]> then\n            set [players_active_letter_3 v] to [1]\n            set [player_id v] to [3]\n        else\n            if <(letter (4) of (☁ players_active)) = [0]> then\n                set [players_active_letter_4 v] to [1]\n                set [player_id v] to [4]\n            end\n        end\n    end\nend\nset [☁ players_active v] to (join (players_active_letter_1) (join (players_active_letter_2) (join (players_active_letter_3) (players_active_letter_4))))\n\nwhen flag clicked\nreset timer\nforever\n    set [stop_sense_timer v] to ((timer) + (0.01))\nend\n\nset [players_active_letter_1 v] to [0]\nset [players_active_letter_2 v] to [0]\nset [players_active_letter_3 v] to [0]\nset [players_active_letter_4 v] to [0]\n\nwhen [timer v] > (stop_sense_timer)\nif <(player_ID) = [1]> then\n    set [players_active_letter_1 v] to [0]\nelse\n    if <(player_ID) = [2]> then\n        set [players_active_letter_2 v] to [0]\n    else\n        if <(player_ID) = [3]> then\n            set [players_active_letter_3 v] to [0]\n        else\n            if <(player_ID) = [4]> then\n                set [players_active_letter_4 v] to [0]\n            end\n        end\n    end\nend\nset [player_id v] to [0]\nset [☁ players_active v] to (join (players_active_letter_1) (join (players_active_letter_2) (join (players_active_letter_3) (players_active_letter_4))))\n\n@player_sprite\n\nwhen flag clicked\nforever\n    set rotation style [left-right v]\n    if <(multiplayer_hero_facing) = [1]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    if <<(hero_jumping) = [1]> or <(hero_jumping) = [-1]>> then\n        repeat until <(costume [name v]) = [jump6]>\n            next costume\n        end\n    else\n        if <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> then\n            next costume\n            if <(costume [name v]) = [costume8]> then\n                switch costume to (costume1 v)\n            end\n        else\n            wait (0.05) seconds\n            next costume\n            if <(costume [name v]) = [costume10]> then\n                switch costume to (costume1 v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go [forward v] (3) layers\nend\n\nwhen I receive [clone_hero_sprite v]\n\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [ghost v] effect to (20)\nrepeat (4)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\nend\n\n@enemy_attack\n\nwhen I start as a clone\nset [☁ player_1 v] to [0]\nset [☁ player_1 v] to [0]\nset [enemy_attack_type v] to (enemy_attack_type_transfer_value)\nset [enemy_attack_speed_x v] to (enemy_attack_speed_X_transfer)\nset [enemy_attack_speed_y v] to (enemy_attack_speed_Y_transfer)\ngo to x: (enemy_attack_X) y: (enemy_attack_Y)\nif <(enemy_attack_type) = [2]> then\n    switch costume to (ninja_star v)\nelse\n    switch costume to (costume1 v)\nend\nforever\n    change x by (enemy_attack_speed_X)\n    change y by (enemy_attack_speed_Y)\n    if <(enemy_attack_type) = [2]> then\n        change [enemy_attack_speed_y v] by (-1)\n        turn right (15) degrees\n    end\n    if <<touching (player v)?> and <(invererability_frames_count) < (invunerability_frames)>> then\n        set [invunerability_frames v] to [0]\n        broadcast (hero_hurt v)\n        if <(x position) > (Z_hero_location_reference_x)> then\n            broadcast (hero_knockback_right v)\n        else\n            broadcast (hero_knockback_left v)\n        end\n        delete this clone\n    end\n    if <touching (ground v)?> then\n        delete this clone\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    if <touching (player_attack_hitbox v)?> then\n        if <[charms_equipted_list v] contains [moss]?> then\n            delete this clone\n        end\n    end\n    if <(delete_all_clones) = [1]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\ngo to x: (-1000) y: (-1000)\nset [ghost v] effect to (100)\nforever\n    if <(enemy_ranged_attacking) = [1]> then\n        set [ghost v] effect to (0)\n        set [enemy_ranged_attacking v] to [0]\n        create clone of (_myself_ v)\n        set [ghost v] effect to (100)\n    end\nend\n\n@player_cling_hitbox\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\nend\n\nwhen flag clicked\nforever\n    if <touching (ground v)?> then\n        set [cling_hitbox_touching_ground v] to [1]\n    else\n        set [cling_hitbox_touching_ground v] to [0]\n    end\nend\n\n@hero_cling_target\n\nwhen flag clicked\nforever\n    set [ghost v] effect to ((100) - (dash_super))\n    set size to ((100) - (dash_super)) %\n    set [clinging_target_x v] to (x position)\n    set [clinging_target_y v] to (y position)\n    if <(clinging!) = [0]> then\n        go to x: (Z_hero_location_reference_x) y: (Z_hero_location_reference_y)\n    end\nend\n\n@area_effects\n\nwhen flag clicked\nset [ghost v] effect to (100)\nswitch costume to (leave empty v)\nforever\n    if <(world_area_name) = [city]> then\n        wait (pick random (0.25) to (1)) seconds\n        create clone of (_myself_ v)\n        set [effect_type v] to [fire_gas]\n        set [time_existing v] to [0]\n    end\n    if <(world_area_name) = [cave]> then\n        wait (pick random (0.25) to (0.75)) seconds\n        create clone of (_myself_ v)\n        set [effect_type v] to [light_orb]\n        set [time_existing v] to [0]\n    end\n    if <(world_area_name) = [green]> then\n        wait (pick random (1) to (7)) seconds\n        create clone of (_myself_ v)\n        set [effect_type v] to [light_beam]\n        set [time_existing v] to [0]\n    end\nend\n\nwhen I start as a clone\nif <(effect_type) = [star]> then\n    go to x: (pick random (-225) to (225)) y: (pick random (175) to (145))\n    switch costume to (star v)\n    set size to (pick random (10) to (100)) %\n    forever\n        change [time_existing v] by (1)\n        set [ghost v] effect to ([abs v] of (time_existing) )\n        if <[100] < (time_existing)> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(effect_type) = [fire_gas]> then\n    go to x: (pick random (-225) to (225)) y: (-160)\n    set size to (pick random (50) to (100)) %\n    set [speed_x v] to (pick random (-5) to (0))\n    set [speed_y v] to (pick random (1) to (4))\n    forever\n        change [speed_x v] by (0.1)\n        change [time_existing v] by (1)\n        change size by (-0.1)\n        switch costume to (fire_gas v)\n        set [ghost v] effect to ([abs v] of (time_existing) )\n        if <[100] < (time_existing)> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    go [forward v] (8) layers\n    change x by (speed_X)\n    change y by (speed_Y)\n    if <<<(x position) > [225]> or <[-225] > (x position)>> or <<(y position) > [175]> or <[-175] > (y position)>>> then\n        change [time_existing v] by (1)\n    end\nend\n\nwhen I start as a clone\nif <(effect_type) = [light_orb]> then\n    go to x: (pick random (-225) to (225)) y: (160)\n    set size to (pick random (50) to (100)) %\n    set [speed_x v] to (pick random (-6) to (6))\n    set [speed_y v] to (pick random (-1) to (-4))\n    forever\n        set [speed_x v] to ((speed_X) * (0.99))\n        change [time_existing v] by (1)\n        change size by (-0.1)\n        switch costume to (light_orb v)\n        set [ghost v] effect to ([abs v] of (time_existing) )\n        if <[100] < (time_existing)> then\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nif <(effect_type) = [light_beam]> then\n    go to x: (pick random (-225) to (225)) y: (50)\n    set size to (pick random (50) to (100)) %\n    set [time_existing v] to [-100]\n    set [speed_x v] to ((pick random (0) to (100)) * (0.01))\n    set [speed_y v] to [0.2]\n    forever\n        set [speed_x v] to ((speed_X) * (0.99))\n        change [time_existing v] by (1)\n        change size by (-0.1)\n        switch costume to (light_beam v)\n        set [ghost v] effect to ([abs v] of (time_existing) )\n        if <[100] < (time_existing)> then\n            delete this clone\n        end\n    end\nend\n\n@map\n\nwhen I start as a clone\nforever\n    if <not <(world_pylon_button_selected) = [1]>> then\n        delete this clone\n    end\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (100)\n        if <mouse down?> then\n            if <(costume [name v]) = [pylon_central]> then\n                broadcast (close_map v)\n                set [world_map_ground_x v] to [6]\n                set [world_map_ground_y v] to [0]\n                broadcast (go_to_plylon v)\n            else\n                if <touching (mouse-pointer v)?> then\n                    set [brightness v] effect to (100)\n                    if <mouse down?> then\n                        if <(costume [name v]) = [pylon_cave]> then\n                            broadcast (close_map v)\n                            set [world_map_ground_x v] to [8]\n                            set [world_map_ground_y v] to [-7]\n                            broadcast (go_to_plylon v)\n                        else\n                            if <touching (mouse-pointer v)?> then\n                                set [brightness v] effect to (100)\n                                if <mouse down?> then\n                                    if <(costume [name v]) = [pylon_town]> then\n                                        broadcast (close_map v)\n                                        set [world_map_ground_x v] to [18]\n                                        set [world_map_ground_y v] to [-7]\n                                        broadcast (go_to_plylon v)\n                                    else\n                                        if <touching (mouse-pointer v)?> then\n                                            set [brightness v] effect to (100)\n                                            if <mouse down?> then\n                                                if <(costume [name v]) = [pylon_cave_2]> then\n                                                    broadcast (close_map v)\n                                                    set [world_map_ground_x v] to [4]\n                                                    set [world_map_ground_y v] to [-7]\n                                                    broadcast (go_to_plylon v)\n                                                else\n                                                    if <touching (mouse-pointer v)?> then\n                                                        set [brightness v] effect to (100)\n                                                        if <mouse down?> then\n                                                            if <(costume [name v]) = [pylon_green]> then\n                                                                broadcast (close_map v)\n                                                                set [world_map_ground_x v] to [-4]\n                                                                set [world_map_ground_y v] to [-7]\n                                                                broadcast (go_to_plylon v)\n                                                            else\n                                                                if <touching (mouse-pointer v)?> then\n                                                                    set [brightness v] effect to (100)\n                                                                    if <mouse down?> then\n                                                                        if <(costume [name v]) = [pylon_hive]> then\n                                                                            broadcast (close_map v)\n                                                                            set [world_map_ground_x v] to [19]\n                                                                            set [world_map_ground_y v] to [-13]\n                                                                            broadcast (go_to_plylon v)\n                                                                        end\n                                                                    end\n                                                                else\n                                                                    set [brightness v] effect to (0)\n                                                                end\n                                                            end\n                                                        end\n                                                    else\n                                                        set [brightness v] effect to (0)\n                                                    end\n                                                end\n                                            end\n                                        else\n                                            set [brightness v] effect to (0)\n                                        end\n                                    end\n                                end\n                            else\n                                set [brightness v] effect to (0)\n                            end\n                        end\n                    end\n                else\n                    set [brightness v] effect to (0)\n                end\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen flag clicked\nforever\n    if <(world_pylon_button_selected) = [1]> then\n        set [ghost v] effect to (0)\n        if <(pylon_city) = [1]> then\n            switch costume to (pylon_central v)\n            create clone of (_myself_ v)\n        end\n        if <(pylon_cave) = [1]> then\n            switch costume to (pylon_cave v)\n            create clone of (_myself_ v)\n        end\n        if <(pylon_town) = [1]> then\n            switch costume to (pylon_town v)\n            create clone of (_myself_ v)\n        end\n        if <(pylon_cave_2) = [1]> then\n            switch costume to (pylon_cave_2 v)\n            create clone of (_myself_ v)\n        end\n        if <(pylon_green) = [1]> then\n            switch costume to (pylon_green v)\n            create clone of (_myself_ v)\n        end\n        if <(pylon_hive) = [1]> then\n            switch costume to (pylon_hive v)\n            create clone of (_myself_ v)\n        end\n    end\n    if <not <(world_pylon_button_selected) = [1]>> then\n        set [ghost v] effect to (100)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@pylon_UI\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nset [button_id v] to [1]\ncreate clone of (_myself_ v)\nset [button_id v] to [2]\ncreate clone of (_myself_ v)\nset [button_id v] to [3]\nwait (1) seconds\ngo to x: (-100) y: (-100)\nswitch costume to (leave empty v)\n\nwhen I start as a clone\nforever\n    if <(world_pylon_open) = [1]> then\n        set [ghost v] effect to (0)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            if <(button_ID) = [1]> then\n                set [world_pylon_button_selected v] to [1]\n            else\n                if <(button_ID) = [2]> then\n                    set [world_pylon_button_selected v] to [2]\n                end\n            end\n            if <(button_ID) = [3]> then\n                set [world_pylon_button_selected v] to [3]\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(button_ID) = [1]> then\n        go to x: (200) y: (160)\n        if <(world_pylon_button_selected) = [1]> then\n            switch costume to (map_on v)\n        else\n            switch costume to (map_off v)\n        end\n    else\n        if <(button_ID) = [2]> then\n            go to x: (150) y: (160)\n            if <(world_pylon_button_selected) = [2]> then\n                switch costume to (weapons_on v)\n            else\n                switch costume to (weapons_off v)\n            end\n        end\n    end\n    if <(button_ID) = [3]> then\n        go to x: (110) y: (150)\n        if <(world_pylon_button_selected) = [3]> then\n            switch costume to (charms_on v)\n        else\n            switch costume to (charms_off v)\n        end\n    end\nend\n\n@weapons menu\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nset [button_id v] to [1]\ncreate clone of (_myself_ v)\nset [button_id v] to [2]\ncreate clone of (_myself_ v)\nset [button_id v] to [3]\nswitch costume to (leave_empty v)\ngo to x: (-100) y: (-100)\nwait (1) seconds\nif <(editing_game) = [1]> then\n    add [x19-y-8] to [items_locations_purchased_list v]\nend\ndelete all of [items_locations_purchased_list v]\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(world_pylon_button_selected) = [2]> then\n        set [ghost v] effect to (0)\n        if <(button_ID) = [1]> then\n            go to x: (-100) y: (0)\n            set [ghost v] effect to (0)\n            if <(weapon_ID_selected) = [1]> then\n                switch costume to (copper_sword_on v)\n            else\n                switch costume to (copper_sword_off v)\n            end\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                set [adelete_all_text v] to [1]\n                wait (0.1) seconds\n                set [adelete_all_text v] to [0]\n                set [weapon_id_selected v] to [1]\n                set [atext_output v] to [A_rusty_copper_blade._dose_0.75_dammage.]\n            end\n        end\n        if <(button_ID) = [2]> then\n            if <[items_locations_purchased_list v] contains [x6-y0]?> then\n                go to x: (-20) y: (0)\n                set [ghost v] effect to (0)\n                if <(weapon_ID_selected) = [2]> then\n                    switch costume to (bronze_sword_on v)\n                else\n                    switch costume to (bronze_sword_off v)\n                end\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    set [adelete_all_text v] to [1]\n                    wait (0.1) seconds\n                    set [adelete_all_text v] to [0]\n                    set [weapon_id_selected v] to [2]\n                    set [atext_output v] to [A_rusty_bronze_blade._not_as_bad_as_copper_but_still_not_very_good._does_1_dammage.]\n                end\n            else\n                set [ghost v] effect to (100)\n            end\n        end\n        if <(button_ID) = [3]> then\n            if <[items_locations_purchased_list v] contains [x19-y-8]?> then\n                go to x: (60) y: (0)\n                set [ghost v] effect to (0)\n                if <(weapon_ID_selected) = [3]> then\n                    switch costume to (iron_sword_on v)\n                else\n                    switch costume to (iron_sword_off v)\n                end\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    set [adelete_all_text v] to [1]\n                    wait (0.1) seconds\n                    set [adelete_all_text v] to [0]\n                    set [weapon_id_selected v] to [3]\n                    set [atext_output v] to [A_well_made_iron_blade._does_1.25_dammage.]\n                end\n            else\n                set [ghost v] effect to (100)\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\n@chrams menu\n\nwhen flag clicked\ndelete all of [charms_collected_list v]\ndelete all of [charms_equipted_list v]\nset [charms_max_power v] to [5]\nset [charms_power_used v] to [0]\ncreate clone of (_myself_ v)\nset [button_id v] to [heartstrong]\ncreate clone of (_myself_ v)\nset [button_id v] to [steadfast]\ncreate clone of (_myself_ v)\nset [button_id v] to [moss]\ncreate clone of (_myself_ v)\nset [button_id v] to [fail]\nswitch costume to (leave_empty v)\ngo to x: (-100) y: (-100)\nif <(editing_game) = [1]> then\n    add [heartstrong] to [charms_collected_list v]\n    add [steadfast] to [charms_collected_list v]\n    add [fail] to [charms_collected_list v]\n    add [moss] to [charms_collected_list v]\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(world_pylon_button_selected) = [3]> then\n        set [ghost v] effect to (0)\n        if <(button_ID) = [heartstrong]> then\n            go to x: (-100) y: (0)\n            if <[charms_collected_list v] contains [heartstrong]?> then\n                set [ghost v] effect to (0)\n                if <[charms_equipted_list v] contains [heartstrong]?> then\n                    switch costume to (heartstrong_on v)\n                else\n                    switch costume to (heartstrong_off v)\n                end\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    wait (0.01) seconds\n                    set [atext_output v] to [the_heartstrong_charm_triples_the_amount_of_inveneribiliy_time_you_have_after_getting_hit._power_cost;2]\n                    set [adelete_all_text v] to [1]\n                    wait (0.01) seconds\n                    set [adelete_all_text v] to [0]\n                    if <[charms_equipted_list v] contains [heartstrong]?> then\n                        delete (item # of [heartstrong] in [charms_equipted_list v]) of [charms_equipted_list v]\n                        change [charms_power_used v] by (-2)\n                    else\n                        if <<((charms_power_used) + (2)) < (charms_max_power)> or <((charms_power_used) + (2)) = (charms_max_power)>> then\n                            add [heartstrong] to [charms_equipted_list v]\n                            change [charms_power_used v] by (2)\n                        end\n                    end\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(world_pylon_button_selected) = [3]> then\n        set [ghost v] effect to (0)\n        if <(button_ID) = [steadfast]> then\n            go to x: (-50) y: (0)\n            if <[charms_collected_list v] contains [steadfast]?> then\n                set [ghost v] effect to (0)\n                if <[charms_equipted_list v] contains [steadfast]?> then\n                    switch costume to (steadfast_on v)\n                else\n                    switch costume to (steadfast_off v)\n                end\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    wait (0.01) seconds\n                    set [atext_output v] to [the_steadfast_charm_lets_you_get_willpower_when_you_are_dammaged._power_cost;3]\n                    set [adelete_all_text v] to [1]\n                    wait (0.01) seconds\n                    set [adelete_all_text v] to [0]\n                    if <[charms_equipted_list v] contains [steadfast]?> then\n                        delete (item # of [steadfast] in [charms_equipted_list v]) of [charms_equipted_list v]\n                        change [charms_power_used v] by (-3)\n                    else\n                        if <<((charms_power_used) + (3)) < (charms_max_power)> or <((charms_power_used) + (3)) = (charms_max_power)>> then\n                            add [steadfast] to [charms_equipted_list v]\n                            change [charms_power_used v] by (3)\n                        end\n                    end\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen flag clicked\nforever\n    if <[charms_equipted_list v] contains [heartstrong]?> then\n        set [invererability_frames_count v] to [30]\n    else\n        set [invererability_frames_count v] to [10]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(world_pylon_button_selected) = [3]> then\n        set [charms_display_value v] to ((charms_max_power) - (charms_power_used))\n        show variable [charms_display_value v]\n    else\n        hide variable [charms_display_value v]\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(world_pylon_button_selected) = [3]> then\n        set [ghost v] effect to (0)\n        if <(button_ID) = [fail]> then\n            go to x: (0) y: (0)\n            if <[charms_collected_list v] contains [fail]?> then\n                set [ghost v] effect to (0)\n                if <[charms_equipted_list v] contains [fail]?> then\n                    switch costume to (fail_on v)\n                else\n                    switch costume to (fail_off v)\n                end\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    wait (0.01) seconds\n                    set [atext_output v] to [the_failed_will_charm_allows_you_to_get_more_energy_when_attacking_an_enemy._power_cost;3]\n                    set [adelete_all_text v] to [1]\n                    wait (0.01) seconds\n                    set [adelete_all_text v] to [0]\n                    if <[charms_equipted_list v] contains [fail]?> then\n                        delete (item # of [fail] in [charms_equipted_list v]) of [charms_equipted_list v]\n                        change [charms_power_used v] by (-3)\n                    else\n                        if <<((charms_power_used) + (3)) < (charms_max_power)> or <((charms_power_used) + (3)) = (charms_max_power)>> then\n                            add [fail] to [charms_equipted_list v]\n                            change [charms_power_used v] by (3)\n                        end\n                    end\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(world_pylon_button_selected) = [3]> then\n        set [ghost v] effect to (0)\n        if <(button_ID) = [moss]> then\n            go to x: (50) y: (0)\n            if <[charms_collected_list v] contains [moss]?> then\n                set [ghost v] effect to (0)\n                if <[charms_equipted_list v] contains [moss]?> then\n                    switch costume to (moss_on v)\n                else\n                    switch costume to (moss_off v)\n                end\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    wait (0.01) seconds\n                    set [atext_output v] to [the_mosshate_charm_allows_you_to_destroy_enemy_projectiles_With_your_sword._power_cost;4]\n                    set [adelete_all_text v] to [1]\n                    wait (0.01) seconds\n                    set [adelete_all_text v] to [0]\n                    if <[charms_equipted_list v] contains [moss]?> then\n                        delete (item # of [moss] in [charms_equipted_list v]) of [charms_equipted_list v]\n                        change [charms_power_used v] by (-4)\n                    else\n                        if <<((charms_power_used) + (4)) < (charms_max_power)> or <((charms_power_used) + (4)) = (charms_max_power)>> then\n                            add [moss] to [charms_equipted_list v]\n                            change [charms_power_used v] by (4)\n                        end\n                    end\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (mouse-pointer v)?> then\n        set [viewing_charm v] to [1]\n    else\n        set [viewing_charm v] to [0]\n    end\nend\n\nset [atext_output v] to [heartstrong]\nset [adelete_all_text v] to [1]\nwait (0.01) seconds\nset [adelete_all_text v] to [0]\n\n@subtitles\n\nwhen flag clicked\nset [subtitle_old v] to [void]\nforever\n    if <not <(subtitle_send) = (subtitle_old)>> then\n        if <(subtitle_send) = [town]> then\n            switch costume to (the hidden town v)\n        end\n        if <(subtitle_send) = [cave]> then\n            switch costume to (the caverns  v)\n        end\n        if <(subtitle_send) = [city]> then\n            switch costume to (the dying city v)\n        end\n        if <(subtitle_send) = [bar]> then\n            switch costume to (weapons bar v)\n        end\n        if <(subtitle_send) = [boss_1]> then\n            switch costume to (failed will v)\n        end\n        if <(subtitle_send) = [green road]> then\n            switch costume to (green road v)\n        end\n        if <(subtitle_send) = [boss_2]> then\n            switch costume to (dark watcher v)\n        end\n        if <(subtitle_send) = [boss_3]> then\n            switch costume to (boss_3 v)\n        end\n        if <(subtitle_send) = [hive]> then\n            switch costume to (hive v)\n        end\n        if <(subtitle_send) = [none]> then\n            switch costume to (none v)\n        end\n        broadcast (fade in then out v)\n        set [subtitle_old v] to (subtitle_send)\n    end\nend\n\nwhen I receive [fade in then out v]\nset [ghost v] effect to (100)\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\nwait (3) seconds\nrepeat (25)\n    change [ghost v] effect by (4)\nend\n\n@hornet_dummy\n\nwhen flag clicked\nset [hornet_dummy_used v] to [0]\nset [ghost v] effect to (100)\nset rotation style [left-right v]\ngo to x: (-60) y: (39)\nwait (1) seconds\nforever\n    if <(hornet_dummy_used) = [0]> then\n        if <<(world_map_ground_X) = [-2]> and <(world_map_ground_Y) = [-7]>> then\n            set [ghost v] effect to (0)\n            if <[100] > (Z_hero_location_reference_x)> then\n                point in direction (90)\n                say [don't think I have not been watching you. I know who you are, and where your aligince lies. come, and prove yourself...]\n                if <[25] > (Z_hero_location_reference_x)> then\n                    say []\n                    point in direction (-90)\n                    change x by (-10)\n                end\n            end\n            if <touching (_edge_ v)?> then\n                set [hornet_dummy_used v] to [1]\n            end\n        else\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\n@Text Box\n\nwhen flag clicked\nforever\n    if <(Atext_active) = [0]> then\n        set [ghost v] effect to (100)\n    else\n        if <(Atext_active) = [1]> then\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\n@Text2\n\nwhen I start as a clone\nif <(Atext_active) = [1]> then\n    start sound [Blip_Select v]\nend\nshow\nforever\n    if <[1] = (Adelete_all_text)> then\n        delete this clone\n    end\n    if <[1] = (AAdelete_all_text_2)> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset [aold_text v] to [ ]\nset [atext_output v] to []\nforever\n    if <not <(Atext_output) = (Aold_text)>> then\n        set [atext_completed_compling v] to [0]\n        set [adelete_all_text v] to [1]\n        wait (0.01) seconds\n        set [adelete_all_text v] to [0]\n        set [text v] to (Atext_output)\n        set [aold_text v] to (Atext_output)\n        set [space v] to [1]\n        set [skip v] to [0]\n        hide\n        go to x: (-226) y: (-94)\n        repeat until <(letter (Space) of (Text)) = []>\n            if <(letter (Space) of (Text)) = [']> then\n                switch costume to (' v)\n            end\n            if <(letter (Space) of (Text)) = [1]> then\n                switch costume to (1 v)\n            end\n            if <(letter (Space) of (Text)) = [2]> then\n                switch costume to (2 v)\n            end\n            if <(letter (Space) of (Text)) = [3]> then\n                switch costume to (3 v)\n            end\n            if <(letter (Space) of (Text)) = [4]> then\n                switch costume to (4 v)\n            end\n            if <(letter (Space) of (Text)) = [5]> then\n                switch costume to (5 v)\n            end\n            if <(letter (Space) of (Text)) = [6]> then\n                switch costume to (6 v)\n            end\n            if <(letter (Space) of (Text)) = [7]> then\n                switch costume to (7 v)\n            end\n            if <(letter (Space) of (Text)) = [8]> then\n                switch costume to (8 v)\n            end\n            if <(letter (Space) of (Text)) = [9]> then\n                switch costume to (9 v)\n            end\n            if <(letter (Space) of (Text)) = [0]> then\n                switch costume to (0 v)\n            end\n            if <(letter (Space) of (Text)) = [\(]> then\n                set [caps v] to [1]\n            end\n            if <(letter (Space) of (Text)) = [\)]> then\n                set [caps v] to [0]\n            end\n            if <(letter (Space) of (Text)) = [_]> then\n                switch costume to (_ v)\n            end\n            if <(letter (Space) of (Text)) = [.]> then\n                switch costume to (. v)\n            end\n            if <(letter (Space) of (Text)) = [,]> then\n                switch costume to (, v)\n            end\n            if <(letter (Space) of (Text)) = [!]> then\n                switch costume to (! v)\n            end\n            if <(letter (Space) of (Text)) = [?]> then\n                switch costume to (? v)\n            end\n            if <(letter (Space) of (Text)) = [:]> then\n                switch costume to (: v)\n            end\n            if <(letter (Space) of (Text)) = [;]> then\n                switch costume to (; v)\n            end\n            if <(letter (Space) of (Text)) = [/]> then\n                switch costume to (/ v)\n            end\n            if <(letter (Space) of (Text)) = [-]> then\n                switch costume to (- v)\n            end\n            if <(letter (Space) of (Text)) = [A]> then\n                if <(Caps) = [1]> then\n                    switch costume to (a, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (a v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [B]> then\n                if <(Caps) = [1]> then\n                    switch costume to (b, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (b v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [C]> then\n                if <(Caps) = [1]> then\n                    switch costume to (c, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (c v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [D]> then\n                if <(Caps) = [1]> then\n                    switch costume to (d, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (d v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [E]> then\n                if <(Caps) = [1]> then\n                    switch costume to (e, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (e v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [F]> then\n                if <(Caps) = [1]> then\n                    switch costume to (f, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (f v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [G]> then\n                if <(Caps) = [1]> then\n                    switch costume to (g, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (g v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [H]> then\n                if <(Caps) = [1]> then\n                    switch costume to (h, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (h v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [I]> then\n                if <(Caps) = [1]> then\n                    switch costume to (i, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (i v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [J]> then\n                if <(Caps) = [1]> then\n                    switch costume to (j, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (j v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [K]> then\n                if <(Caps) = [1]> then\n                    switch costume to (k, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (k v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [L]> then\n                if <(Caps) = [1]> then\n                    switch costume to (l, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (l v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [M]> then\n                if <(Caps) = [1]> then\n                    switch costume to (m, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (m v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [N]> then\n                if <(Caps) = [1]> then\n                    switch costume to (n, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (n v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [O]> then\n                if <(Caps) = [1]> then\n                    switch costume to (o, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (o v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [P]> then\n                if <(Caps) = [1]> then\n                    switch costume to (p, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (p v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [Q]> then\n                if <(Caps) = [1]> then\n                    switch costume to (q, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (q v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [R]> then\n                if <(Caps) = [1]> then\n                    switch costume to (r, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (r v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [S]> then\n                if <(Caps) = [1]> then\n                    switch costume to (s, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (s v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [T]> then\n                if <(Caps) = [1]> then\n                    switch costume to (t, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (t v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [U]> then\n                if <(Caps) = [1]> then\n                    switch costume to (u, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (u v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [V]> then\n                if <(Caps) = [1]> then\n                    switch costume to (v, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (v v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [W]> then\n                if <(Caps) = [1]> then\n                    switch costume to (w, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (w v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [X]> then\n                if <(Caps) = [1]> then\n                    switch costume to (x, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (x v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [Y]> then\n                if <(Caps) = [1]> then\n                    switch costume to (y, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (y v)\n                end\n            end\n            if <(letter (Space) of (Text)) = [Z]> then\n                if <(Caps) = [1]> then\n                    switch costume to (z, v)\n                end\n                if <(Caps) = [0]> then\n                    switch costume to (z v)\n                end\n            end\n            if <<not <(letter (Space) of (Text)) = [\(]>> and <not <(letter (Space) of (Text)) = [\)]>>> then\n                create clone of (_myself_ v)\n                if <(Atext_active) = [1]> then\n                    change x by (12)\n                end\n                if <(x position) > [226]> then\n                    set x to (-226)\n                    change y by (-22)\n                end\n            end\n            change [space v] by (1)\n            if <[-161] > (y position)> then\n                wait until <key (space v) pressed?>\n                set [aadelete_all_text_2 v] to [1]\n                wait until <not <key (space v) pressed?>>\n                go to x: (-226) y: (-94)\n                set [aadelete_all_text_2 v] to [0]\n            end\n        end\n    end\n    wait (0.01) seconds\n    set [atext_completed_compling v] to [1]\nend\n\nwhen flag clicked\nforever\n    if <(Atext_active) = [1]> then\n        if <[-161] < (y position)> then\n            set [adelete_all_text v] to [0]\n        else\n            if <key (space v) pressed?> then\n                set [adelete_all_text v] to [1]\n                wait (0.1) seconds\n                set [adelete_all_text v] to [0]\n            end\n        end\n    end\n    if <(Atext_active) = [0]> then\n        go to x: (-226) y: (-94)\n        set [adelete_all_text v] to [1]\n        set [aold_text v] to [void]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Atext_active) = [0]> then\n        set [text v] to []\n        set [space v] to [1]\n        set [skip v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Atext_completed_compling) = [1]> then\n        if <key (space v) pressed?> then\n            set [atext_output v] to [void]\n            set [adelete_all_text v] to [1]\n            wait (0.1) seconds\n            set [adelete_all_text v] to [0]\n        end\n    else\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(x position) = [-226]> and <(y position) = [-94]>> then\n    end\nend\n\nwhen I receive [enter_new_room v]\nset [aold_text v] to [void]\nset [atext_output v] to [ ]\nset [adelete_all_text v] to [1]\nset [text v] to []\nwait (0.1) seconds\nset [adelete_all_text v] to [0]\n\nwhen flag clicked\nforever\n    if <<key (space v) pressed?> and <(y position) < [-161]>> then\n        set [adelete_all_text v] to [1]\n        wait (0.1) seconds\n        set [adelete_all_text v] to [0]\n    end\nend\n\nwhen I receive [delete_all_text v]\ndelete this clone\n\n