/*
 * EarthBound Text Dump
 * Time: 15:39:19 - 22/06/2022
 * Generated using CCScriptWriter.
 */

command e(label) "{long label}"
import cc_asmcall

// Text Data
l_0xc575f8:
    "@I stayed here the whole time you were gone." next
    "@But now I don't know why I did." end

l_0xc5762c:
    "[06 50 01 {e(l_0xc576e0)}]@I am not sure if it was the <Dungeon Man,> but..." next
    "@there is a strange looking tower to the northwest." next
    "@...This key I picked up a little while ago shall maybe open the tower." next
    "@You may have it, I do not need it.[1D 03 FF][1B 02 {e(l_0xc57718)}][03][1D 0E 00 C0][1B 05]" call(data_33.l_0xc7dcb6) "{set(flag 336)}{wait}{window_closeall}{isset(flag 691)}[1B 02 {e(data_50.l_0xc9992f)}]{pause(60)}" call(data_22.l_0xc692f7) eob

l_0xc576e0:
    "@I'm not sure if it was the <Dungeon Man>..." next
    "@There's a strange looking tower to the northwest." end

l_0xc57718:
    next
    "@...But it seems that you have too many things." end

l_0xc57730:
    "[06 5E 02 {e(l_0xc57753)}]@(Looks like you could enter, but it's locked.)" end

l_0xc57753:
    "{window_closeall}{pause(1)}[1F 21 9F]" call(data_52.l_0xc9b112) eob

l_0xc57760:
    "{store_registers}[06 5E 02 {e(l_0xc577c5)}]{load_registers}" call(data_33.l_0xc7dd2c) "{result_is(192)}[1B 02 {e(l_0xc577b2)}]{load_registers}" call(data_33.l_0xc7dd37) newline
    "@(The key worked to open the door." next
    "@You may enter.){wait}{wait}{set(flag 606)}{sound(119)}{window_closeall}[1F 21 9F]" call(data_52.l_0xc9b112) eob

l_0xc577b2:
    "@(The key doesn't fit!)" end

l_0xc577c5:
    "@(The door's already opened.)" end

l_0xc577d8:
    "[06 DA 00 {e(l_0xc57911)}]@A scary place called Deep Darkness is on the other side of the river." next
    "@The monsters are very strong and you can lose your health" next
    "@just by wandering in the swamp." next
    "@Do you want to cross the river,{pause(15)} even though you know it's a stupid idea?" next
    "[19 02]Yes[02][19 02]No[02][1C 07 02][11]{clearline}[09 02 {e(l_0xc578b3)} {e(l_0xc57878)}]" goto(l_0xc57878)

l_0xc57878:
    "@It was stupid of me to ask." next
    "@Let's watch the sunset over Deep Darkness together from here." end

l_0xc578b3:
    "@The swamp is bottomless." next
    "@Even if you're swimming, you'll be dragged in." next
    "@It is a different story if you have a submarine.{wait}{set(flag 151)}{set(flag 762)}" eob

l_0xc57911:
    "@You returned from exploring the Deep Darkness?" next
    "@I cannot believe you made it back alive." end

l_0xc57947:
    "[06 DA 00 {e(l_0xc57955)}][06 97 00 {e(l_0xc57a26)}]" goto(l_0xc57955)

l_0xc57955:
    "@Welcome![03]{window_closeall}" call(data_44.l_0xc915f4) "{sound(37)}{pause(90)}{window_open(1)}[06 DA 00 {e(l_0xc57ad9)}]@Long time, no see." next
    "@Mr. [1C 02 03], we met in Winters a long time ago." next
    "@I'm Brick Road." next
    "@Dr. Andonuts finally made me Dungeon Man." next
    "@If you want, I'll come with you guys for a while." next
    "@The <Return Hole> is over there." next
    "@Jump in that hole and then walk out.{wait}{set(flag 24)}{set(flag 445)}[1F 66 01 09 81 33 C9 00]{set(flag 507)}" eob

l_0xc57a26:
    "@There's an old submarine at the back of the dungeon." next
    "@It can be used to cross the river." next
    "@There's a <Goodbye Exit> ...over there." next
    "@It will take you to the submarine." next
    "@Don't make a mistake on which exit you take." next
    "@You need to take the <Goodbye Exit!>{pause(20)}  Hope to see you again!" end

l_0xc57ad9:
    "@I don't know how, but my homemade dungeon helped you out." next
    "@I'm glad.{wait}{window_closeall}" eob

l_0xc57b04:
    "[06 DA 00 {e(l_0xc57b3e)}]@<Goodbye Exit>" next
    "@Some day, you should enter with courage." next
    "@...Brick Road." end

l_0xc57b3e:
    "@This path is closed." next
    "@...Brick Road.{wait}" linebreak
    eob

l_0xc57b5c:
    call(l_0xc57bdc) call(data_44.l_0xc90f7d) call(l_0xc57c10) call(data_44.l_0xc915d6) call(data_44.l_0xc91582) "[1F 21 38]{unset(flag 383)}" eob

l_0xc57b7c:
    call(l_0xc57bdc) call(data_44.l_0xc90f7d) call(l_0xc57c10) call(data_44.l_0xc915d6) call(data_44.l_0xc91582) "[1F 21 37]{unset(flag 383)}" eob

l_0xc57b9c:
    call(l_0xc57bdc) call(data_44.l_0xc90f7d) call(l_0xc57c10) call(data_44.l_0xc915d6) call(data_44.l_0xc91582) "[1F 21 39]{unset(flag 383)}" eob

l_0xc57bbc:
    call(l_0xc57bdc) call(data_44.l_0xc90f7d) call(l_0xc57c10) call(data_44.l_0xc915d6) call(data_44.l_0xc91582) "[1F 21 3A]{unset(flag 383)}" eob

l_0xc57bdc:
    "@<Good Night Bench.>" next
    "@May you relax and recover your health and spirits.{wait}" end

l_0xc57c10:
    "{window_open(1)}@" call(data_33.l_0xc7e6d7) "'s health is restored.{wait}{window_closeall}" eob

l_0xc57c2c:
    "{counter(3)}" call(data_33.l_0xc7dc7f) "[1B 03 {e(l_0xc57c6f)}]@([1C 02 03] checked the broken submarine.)" next
    "@Yes!{pause(20)}  It can still work.{wait}{window_closeall}" goto(data_46.l_0xc934ed)

l_0xc57c6f:
    "@(No one can repair the submarine except [1C 02 03].)" end

l_0xc57c96:
    "@Oh, be careful where you walk.  It's filthy." next
    "@A chubby kid did his business out here somewhere..." end

l_0xc57cd4:
    "@(Porky's stink still hangs in the air...)" end

l_0xc57cf3:
    "@You need to be able to read hieroglyphs to solve the mystery of the Pyramid." next
    "@...I couldn't solve it, although I read it." next
    "@Didn't you read the hieroglyphs at the museum in Summers?" next
    "[19 02]Yes[02][19 02]No[02][1C 07 02][11]{clearline}[09 02 {e(l_0xc57da9)} {e(l_0xc57d85)}]" goto(l_0xc57d85)

l_0xc57d85:
    "@Well, that means that you must go back, read it and then come back here." end

l_0xc57da9:
    "@Then, you should be able to solve the mystery somehow." end

l_0xc57dc6:
    "@Hassan's Shop" next
    "@($ dollars acceptable.)" end

l_0xc57dea:
    "@That face is mine.{pause(20)}  (Feel free to talk to it.)" next
    "@...Brick Road." end

l_0xc57e1c:
    "@[1C 02 01]!{pause(20)}  Are you surprised?" next
    "@It's me, Pokey." next
    "@I assist only the strong and able!" next
    "@That's Pokey." next
    "@You guys look pathetic!" next
    "@The Apple of Enlightenment has already made a prediction." next
    "@...But I won't let what the Apple of Enlightenment predicted take place." next
    "@You guys will be beaten by Giygas." next
    "@Giygas will be stronger, a more powerful entity than any other!" next
    "@Why?" next
    "@'Cause of me." next
    "@I was led by Giygas, and now I'm here." next
    "@The Apple of Enlightenment couldn't predict this." next
    "@Master Giygas.{pause(20)}  No,{pause(15)} Giygas is no longer the wielder of Evil." next
    "@He has become the embodiment of Evil itself..." next
    "@which he cannot control on his own." next
    "@He is the Evil Power.[03]" eob
	
l_0xc58000: //Here comes the New Debug Menu
	window_open(1) newline
	"@What shall ya do?{pause(5)}"
		"[18 02]"
		window_close(2) //This re-arrangement of these codes makes sure everything opens properly, and the window is actually in the foreground
		window_close(7)
		window_open(1)
		window_open(2)
	"[19 02]Party edit[02]"
	"[19 02]Goods edit[02]"
	"[19 02]Status effects[02]"
	"[19 02]Warp Zone[02]"
	"[19 02]Money edit[02]"
	"[19 02]Level up[02]"
	"[19 02]Services[02]"
	"[19 02]Progression Rift[02]"
	"[19 02]Hint Archives[02]"
	"[19 02]Jukebox[02]"
	"[19 02]Descriptions[02]"
	"[19 02]Teleport types[02]"
	"[19 02]Event Center[02]"
	"[19 02]The Arena[02]"
		"[1C 0C 02][11][1B 05]"
		window_closetop
		window_switch(1)
		clearline
		newline
		"[1B 06]"
		"[09 0E {e(l_0xc58103)} {e(l_0xc58262)} {e(l_0xc58718)} {e(data_07.l_0xc588cd)} {e(data_07.l_0xc58afb)} {e(data_07.l_0xc58a36)} {e(data_07.l_0xc58c88)} {e(data_08.l_0xc59895)} {e(data_07.l_0xc58e13)} {e(data_07.l_0xc58d09)} {e(data_09.l_0xc5a57f)} {e(data_07.l_0xc58e73)} {e(l_0xc580da)} {e(data_07.l_0xc58dbf)}]@Catch ya later!" end

l_0xc580da:
	window_closeall //This was glitching, writing to a window in the background after running once
	window_open(7) //So every time this runs, it'll close everything first
	window_clear
	menu 1 //I decided to add some more options for the Event Center
	{
		"Configure flags":
			{
				window_closeall
				window_open(1)
				window_clear
				"@Which event flag will ya toggle? (1-1024)" newline
				cc_asmcall(0xC13D03, RET_NONE)
				goto(l_0xc580da)
			}
		"Toggle Sanctuary":
			{
				window_clear
				menu 1
				{
					"Giant Step":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of the Giant Step." next
					toggle(182)
					}
					"Lilliput Steps":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of the Lilliput Steps." next
					toggle(183)
					}
					"Milky Well":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of the Milky Well." next
					toggle(185)
					}
					"Rainy Circle":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of the Rainy Circle." next
					toggle(184)
					}
					"Magnet Hill":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of Magnet Hill." next
					toggle(186)
					}
					"Pink Cloud":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of the Pink Cloud." next
					toggle(187)
					}
					"Lumine Hall":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of Lumine Hall." next
					toggle(188)
					}
					"Fire Spring":
					{
					window_clear
					window_closetop
					window_open(1)
					"@[1C 02 01]'s Sound Stone recorded the melody of the Fire Spring." next
					toggle(189)
					}
				}
				goto(l_0xc580da)
			}
			"Enemy Forces":
				{
					window_closeall
					window_open(1)
					window_clear
					"@Connecting to Mothership...{pause(35)}" next
					window_clear
					"  Invasion Commencement Signal recieved..." linebreak
					menu
						{
						"Enable": 
						{
						window_clear
						"  Invasion Signal Completed."
						{prompt}
						unset(flag 11)
						}
						"Disable":
						{
						window_clear
						"  Invasion Signal Terminated."
						{prompt}
						set(flag 11)
						}
					}
					goto(l_0xc580da)
				}
			"Fill photo album":
			{
				window_clear
				window_closetop
				window_open(1)
				set(696) 
				set(697) 
				set(698) 
				set(699) 
				set(700) 
				set(701) 
				set(702) 
				set(703) 
				set(704) 
				set(705) 
				set(706) 
				set(707) 
				set(708) 
				set(709) 
				set(710) 
				set(711) 
				set(712) 
				set(713) 
				set(714) 
				set(715) 
				set(716) 
				set(717) 
				set(718) 
				set(719) 
				set(720) 
				set(721) 
				set(722) 
				set(723) 
				set(724) 
				set(725) 
				set(726) 
				set(727)
				"@Your photo album was filled up with photos from your adventure!{sound(116)}{prompt}" linebreak
				goto(l_0xc580da)
			}
			"Mark hint shops":
			{
				window_clear
				window_closetop
				window_open(1)
			    set(flag 681)
				set(flag 682)
				set(flag 683)
				set(flag 684)
				set(flag 685)
				set(flag 686)
				"@Your map's been marked!{sound(116)}{pause(15)}" linebreak
				"@Now you can find the Hint Guy's shops on it!{prompt}" linebreak
				goto(l_0xc580da)
			}
			"Realize PSI":
			{
				window_clear
				menu 1
				{
				"PSI Teleport [8B]":
				{
					window_clear
					window_closetop
					window_open(1)
					{sound(103)}
					learnpsi (1, 1)
					"@[1C 02 01] realized the power of PSI Teleport [8B]!{prompt}" linebreak
				}
				"PSI Teleport [8C]":
				{
					window_clear
					window_closetop
					window_open(1)
					{sound(103)}
					learnpsi (1, 4)
					"@[1C 02 01] realized the power of PSI Teleport [8C]!{prompt}" linebreak
				}
				"PSI Starstorm [8B]":
				{
					window_clear
					window_closetop
					window_open(1)
					{sound(103)}
					learnpsi (4, 2)
					"@[1C 02 04] realized the power of PSI Starstorm [8B]!{prompt}" linebreak
				}
				"PSI Starstorm [8F]":
				{
					window_clear
					window_closetop
					window_open(1)
					{sound(103)}
					learnpsi (4, 3)
					"@[1C 02 04] realized the power of PSI Starstorm [8F]!{prompt}" linebreak
				}
			}
			goto(l_0xc580da)
			}
			"Coffee break":
			{
				window_clear
				window_closetop
				window_open(1)
				"@Which cup will ya drink?" linebreak
				menu
				{
					"Cup of coffee":
					{
						call(data_33.l_0xc7dd74) "{music(92)}[1F 41 01]"
					}
					"Cup of tea":
					{
						call(data_33.l_0xc7dd74) "{music(92)}[1F 41 02]"
					}
				}
			goto(l_0xc580da)
			}
			"Cast and credits":
			{
			window_clear
			window_closetop
			window_open(1)
			"@Which curtain call will ya roll?" linebreak
			menu
			{
				"Cast":
				{
					"@A{pause(5)}n{pause(5)}n{pause(5)}n{pause(5)}d... cast, roll on out!{prompt}" linebreak
					"[1F 41 0B][1F 21 19]" eob
				}
				"Credits":
				{
					"@A{pause(5)}n{pause(5)}n{pause(5)}n{pause(5)}d... credits, roll!{prompt}" linebreak
					"[1F 41 0C][1F 21 19]" eob
				}
			}
			goto(l_0xc580da)
		}
	}
	window_closetop
	goto(l_0xc58000)

l_0xc58103:
    "@Now what?" linebreak
    "[19 02]Add[02][19 02]Boot[02][1C 07 02][11]{clearline}[09 02 {e(l_0xc5812f)} {e(l_0xc581ee)}]" goto(l_0xc58000)

l_0xc5812f:
    "{open_hp}@Who should be added to the party?" linebreak goto(l_0xc58148)

l_0xc58148:
	"{window_open(8)}[19 02]Ness[02][19 02]Paula[02][19 02]Jeff[02][19 02]Poo[02][19 02]Pokey[02][19 02]Picky[02][19 02]King[02][19 02]Tony[02][19 02]Bubble Monkey[02][19 02]Dungeon Man[02][19 02]Flying Man 1[02][19 02]Flying Man 2[02][19 02]Flying Man 3[02][19 02]Flying Man 4[02][19 02]Flying Man 5[02][1C 0C 03][11][1B 05][19 04]{window_closetop}{window_switch(1)}[1B 06][1B 02 {e(l_0xc581e7)}]{swap}[1F 11 00]{open_hp}" goto(l_0xc58148)

l_0xc581e7:
    "{window_closetop}" goto(l_0xc58000)

l_0xc581ee:
    "[19 10 02][1B 02 {e(l_0xc58250)}]@Which party member should be booted?" linebreak
    goto(l_0xc58214)

l_0xc58214:
    "[19 10 02][1B 02 {e(l_0xc5824b)}]   [1F 52 01][1B 02 {e(l_0xc5824b)}]{clearline}{swap}[19 10 00][1B 02 {e(l_0xc58214)}]{swap}[1F 12 00]"
	"@[1C 02 00] went back home!" next
	"@Bye bye, [1C 02 00]!" next
    goto(l_0xc581ee)

l_0xc5824b:
    goto(l_0xc58000)

l_0xc58250:
    goto(l_0xc58000)

l_0xc58262:
    newline
    "@Now what?[18 02]{window_open(7)}[19 02]Add items[02][19 02]Key items[02][19 02]Inventory MAX[02][19 02]Trash items[02][19 02]Storage MAX[02][19 02]Empty storage[02][19 02]Broken tools[02][19 02]Equip stuff[02][1C 0C 01][11][1B 05]{window_closetop}[19 04]{window_switch(1)}" newline
    "[1B 06][09 08 {e(l_0xc582f8)} {e(l_0xc58369)} {e(l_0xc58539)} {e(l_0xc58568)} {e(l_0xc585dc)} {e(l_0xc58614)} {e(BrokenTools)} {e(l_0xc5863c)}]" goto(l_0xc58000)

l_0xc582f8:
    "@Which item? (1-253)" linebreak
	goto(Add_items)
	
Add_items:
    "   [1F 52 03]"
	clearline
	"[1B 02 {e(l_0xc58364)}]{swap}[1D 03 FF][1B 02 {e(l_0xc58358)}][18 07 {254} 01][1B 03 {Invalid}]{store_registers}{pause(5)}@The [1C 05 00]?" next
	"@Who is going to carry it?" next call(data_14.l_0xc5e52e)
	"[1B 02 {e(l_0xc582f8)}][1D 0E 00 00]{sound(116)}"
    goto(l_0xc582f8)
	
Invalid:
	goto(Add_items)

l_0xc58358:
    "@Oh, you silly goose!" next
	"@You're carrying too much stuff!" next
	goto(l_0xc58364)

l_0xc58364:
    goto(l_0xc58000)

l_0xc58369:
    "[18 02]{window_open(12)}[19 02]ATM card[02][19 02]Sound Stone[02][19 02]Town map[02][19 02]Key to the shack[02][19 02]Receiver phone[02][19 02]Pencil eraser[02][19 02]Franklin badge[02][19 02]Key to the cabin[02][19 02]Wad of bills[02][19 02]Bad key machine[02][19 02]Zombie paper[02][19 02]Diamond[02][19 02]Yogurt dispenser[02][19 02]Hieroglyph copy[02][19 02]Hawk eye[02][19 02]Pak of bubble gum[02][19 02]Shyness book[02][19 02]Meteorite piece[02][19 02]Signed banana[02][19 02]Eraser eraser[02][19 02]Tendakraut[02][19 02]Carrot key[02][1C 0C 01][11][1B 05]{window_closetop}[19 04]{window_switch(1)}" newline
    "[1B 06][1B 02 {e(l_0xc58364)}]{swap}@Who is going to carry it?" call(data_14.l_0xc5e52e) "[1B 02 {e(l_0xc58369)}]{swap}" "[1F C0 16 {e(ATM_magic)} {e(SoundStone_magic)} {e(TownMap_magic)} {e(l_0xc584b4)} {e(l_0xc584bb)} {e(l_0xc584c2)} {e(l_0xc584c9)} {e(l_0xc584d0)} {e(l_0xc584d7)} {e(l_0xc584de)} {e(l_0xc584e5)} {e(l_0xc584ec)} {e(l_0xc584f3)} {e(l_0xc584fa)} {e(l_0xc58501)} {e(l_0xc58508)} {e(l_0xc5850f)} {e(l_0xc58516)} {e(l_0xc5851d)} {e(l_0xc58524)} {e(l_0xc5852b)} {e(l_0xc58532)}]" goto(l_0xc58369)

ATM_magic:
	"{swap}[1D 0E 00 B1]{sound(116)}" eob
	
SoundStone_magic:
	"{swap}[1D 0E 00 C4]{sound(116)}" eob
	
TownMap_magic:
	"{swap}[1D 0E 00 CA]{sound(116)}" eob

l_0xc584b4:
    "{swap}[1D 0E 00 AA]{sound(116)}" eob

l_0xc584bb:
    "{swap}[1D 0E 00 B5]{sound(116)}" eob

l_0xc584c2:
    "{swap}[1D 0E 00 B8]{sound(116)}" eob

l_0xc584c9:
    "{swap}[1D 0E 00 01]{sound(116)}" eob

l_0xc584d0:
    "{swap}[1D 0E 00 AB]{sound(116)}" eob

l_0xc584d7:
    "{swap}[1D 0E 00 B4]{sound(116)}" eob

l_0xc584de:
    "{swap}[1D 0E 00 AC]{sound(116)}" eob

l_0xc584e5:
    "{swap}[1D 0E 00 AE]{sound(116)}" eob

l_0xc584ec:
    "{swap}[1D 0E 00 B6]{sound(116)}" eob

l_0xc584f3:
    "{swap}[1D 0E 00 8B]{sound(116)}" eob

l_0xc584fa:
    "{swap}[1D 0E 00 B9]{sound(116)}" eob

l_0xc58501:
    "{swap}[1D 0E 00 AF]{sound(116)}" eob

l_0xc58508:
    "{swap}[1D 0E 00 68]{sound(116)}" eob

l_0xc5850f:
    "{swap}[1D 0E 00 A4]{sound(116)}" eob

l_0xc58516:
    "{swap}[1D 0E 00 C1]{sound(116)}" eob

l_0xc5851d:
    "{swap}[1D 0E 00 B7]{sound(116)}" eob

l_0xc58524:
    "{swap}[1D 0E 00 D2]{sound(116)}" eob

l_0xc5852b:
    "{swap}[1D 0E 00 D3]{sound(116)}" eob

l_0xc58532:
    "{swap}[1D 0E 00 FD]{sound(116)}" eob

l_0xc58539:
    "@Your inventory filled up with items!{sound(116)}" next
    call(l_0xc58555) goto(l_0xc58000)

l_0xc58555:
    "[1D 03 FF][1B 02 {e(l_0xc58567)}][1D 0E 00 E1]" goto(l_0xc58555)

l_0xc58567:
    eob

l_0xc58568: //I modified the inventory clearer system so it no longer gets in the way of the new additions to the Progression Rift
	"@How will ya trash?" linebreak
    "[19 02]"
	"Trash individually"
	"[02][19 02]"
	"Trash all"
	"[02][1C 07 02][11]{clearline}[09 02 {e(l_0xc585c5)} {e(Trash)}]" goto(l_0xc58364)

Trash:
	"{counter(1)}" goto(Trash_3)
	
Trash_2:
	"{inc}" goto(Trash_3)
	
Trash_3:
	"{ctoarg}[1D 19 00][1B 03 {e(Trash_4)}][19 10 00]" goto(Trash_5)
	
Trash_4:
	"@All of the items in your inventory vanished out of nowhere!" next
	goto(l_0xc58000)
	
Trash_5:
	"[19 19 00 01]{swap}[1B 02 {e(Trash_2)}]{swap}[1D 0F 00 01]" goto(Trash_5)
	 
l_0xc58597:
    "{counter(1)}" goto(l_0xc58599)

l_0xc58599:
    "{ctoarg}[1D 19 00][1B 03 {e(l_0xc585c4)}][19 10 00]" goto(l_0xc585a7)

l_0xc585a7:
    "[19 19 00 01]{swap}[1B 02 {e(l_0xc585be)}]{swap}[1D 0F 00 01]" goto(l_0xc585a7)

l_0xc585be:
    "{inc}" goto(l_0xc58599)

l_0xc585c4:
	eob

l_0xc585c5:
    "{open_hp}" goto(l_0xc585c7)

l_0xc585c7:
    call(data_14.l_0xc5e456) "[1B 02 {e(l_0xc585db)}][1D 0F 00 00]" goto(l_0xc585c7)

l_0xc585db:
    goto(l_0xc58000)

l_0xc585dc:
    "@Your storage was filled up with items!{sound(116)}"
	"{counter(20)}" goto(l_0xc585f2)

l_0xc585f2:
    "{ctoarg}[1D 0C 01 01][18 07 02 00 00 00 00][1B 03 {e(l_0xc5860e)}][1D 18 00]{inc}" goto(l_0xc585f2)

l_0xc5860e:
    next goto(l_0xc58000)

l_0xc58614:
    "@All of the items in your storage vanished out of nowhere!" next
	goto(l_0xc58624)

l_0xc58624:
    "[19 1A 01][1B 02 {e(l_0xc58636)}][19 1C FF 01]" goto(l_0xc58624)

l_0xc58636:
    goto(l_0xc58000)
	
BrokenTools_return:
	goto(BrokenTools)
	
BrokenTools: ////This handles the selection menu for the broken tools
	"[18 02]{window_open(12)}[19 02]Broken machine[02][19 02]Broken gadget[02][19 02]Broken air gun[02][19 02]Broken spray can[02][19 02]Broken laser[02][19 02]Broken iron[02][19 02]Broken pipe[02][19 02]Broken cannon[02][19 02]Broken tube[02][19 02]Broken bazooka[02][19 02]Broken trumpet[02][19 02]Broken harmonica[02][19 02]Broken antenna[02][1C 0C 01][11][1B 05]{window_closetop}[19 04]{window_switch(1)}" newline
	"[1B 06][1B 02 {e(l_0xc58364)}]{swap}@Who is going to carry it?" call(data_14.l_0xc5e52e) "[1B 02 {e(BrokenTools)}]{swap}[1F C0 12 {e(BrokenMachine_magic)} {e(BrokenGadget_magic)} {e(BrokenAirGun_magic)} {e(BrokenSprayCan_magic)} {e(BrokenLaser_magic)} {e(BrokenIron_magic)} {e(BrokenPipe_magic)} {e(BrokenCannon_magic)} {e(BrokenTube_magic)} {e(BrokenBazooka_magic)} {e(BrokenTrumpet_magic)} {e(BrokenHarmonica_magic)} {e(BrokenAntenna_magic)} {e(BrokenPlaceholder_magic)} {e(BrokenPlaceholder_magic)} {e(BrokenPlaceholder_magic)} {e(BrokenPlaceholder_magic)} {e(BrokenPlaceholder_magic)}]" goto(BrokenTools)

BrokenPlaceholder_magic: //This is a placeholder for the fixed variants of the broken tools
	"{swap}[1D 0E 00 04]{sound(116)}" eob

BrokenMachine_magic:
	"{swap}[1D 0E 00 04]{sound(116)}" eob
	
BrokenGadget_magic:
	"{swap}[1D 0E 00 05]{sound(116)}" eob
	
BrokenAirGun_magic:
	"{swap}[1D 0E 00 06]{sound(116)}" eob
	
BrokenSprayCan_magic:
	"{swap}[1D 0E 00 07]{sound(116)}" eob

BrokenLaser_magic:
	"{swap}[1D 0E 00 08]{sound(116)}" eob

BrokenIron_magic:
	"{swap}[1D 0E 00 09]{sound(116)}" eob

BrokenPipe_magic:
	"{swap}[1D 0E 00 0A]{sound(116)}" eob

BrokenCannon_magic:
	"{swap}[1D 0E 00 0B]{sound(116)}" eob

BrokenTube_magic:
	"{swap}[1D 0E 00 0C]{sound(116)}" eob

BrokenBazooka_magic:
	"{swap}[1D 0E 00 0D]{sound(116)}" eob

BrokenTrumpet_magic:
	"{swap}[1D 0E 00 0E]{sound(116)}" eob

BrokenHarmonica_magic:
	"{swap}[1D 0E 00 0F]{sound(116)}" eob

BrokenAntenna_magic:
	"{swap}[1D 0E 00 10]{sound(116)}" eob
	
l_0xc5863c:
    "{pause(20)}@WHOAAAAAAAAAAH!" next
	"@Some powerful equippable items appeared out of nowhere!" next
	"@You take them.{sound(116)}" next call(l_0xc58659) goto(l_0xc58000)

l_0xc58659:
    "{counter(1)}" goto(l_0xc5865b)

l_0xc5865b:
    "{ctoarg}[1D 19 00][1B 03 {e(l_0xc5869b)}][19 10 00]" goto(l_0xc58669)

l_0xc58669:
    "[19 19 00 07]{swap}[1B 02 {e(l_0xc58680)}]{swap}[1D 0F 00 07]" goto(l_0xc58669)

l_0xc58680:
    "{swap}[1F C0 04 {e(l_0xc5869c)} {e(l_0xc586bd)} {e(l_0xc586de)} {e(l_0xc586ff)}]{inc}" goto(l_0xc5865b)

l_0xc5869b:
    eob

l_0xc5869c:
    "[1D 0E 01 19][1F 83 00 00][1D 0E 01 3D][1F 83 00 00][1D 0E 01 48][1F 83 00 00][1D 0E 01 56][1F 83 00 00]" eob

l_0xc586bd:
    "[1D 0E 02 22][1F 83 00 00][1D 0E 02 C2][1F 83 00 00][1D 0E 02 47][1F 83 00 00][1D 0E 02 DC][1F 83 00 00]" eob

l_0xc586de:
    "[1D 0E 03 2F][1F 83 00 00][1D 0E 03 3C][1F 83 00 00][1D 0E 03 46][1F 83 00 00][1D 0E 03 55][1F 83 00 00]" eob

l_0xc586ff:
    "[1D 0E 04 3F][1F 83 00 00][1D 0E 04 49][1F 83 00 00][1D 0E 04 57][1F 83 00 00]" eob

l_0xc58718:
    newline
    "@To whom?[1A 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01][1B 02 {e(l_0xc587ee)}]{store_registers}" linebreak
    "@Now what?" linebreak
    "[18 02]{open_hp}{window_open(12)}[19 02]Heal 100%[02][19 02]Unconscious[02][19 02]Diamondize[02][19 02]Paralysis[02][19 02]Nausea[02][19 02]Poison[02][19 02]Sunstroke[02][19 02]Sniffling[02][19 02]Mushroomize[02][19 02]Possession[02][19 02]Homesick[02][19 02]HP rolldown[02][19 02]PP rolldown[02][1C 0C 02][11][1B 05]{window_closetop}{window_switch(1)}[1B 06][09 0D {e(l_0xc587f3)} {e(data_07.l_0xc58813)} {e(data_07.l_0xc5882f)} {e(data_07.l_0xc58841)} {e(data_07.l_0xc5884e)} {e(data_07.l_0xc5885b)} {e(data_07.l_0xc58868)} {e(data_07.l_0xc58875)} {e(data_07.l_0xc58882)} {e(data_07.l_0xc5888f)} {e(data_07.l_0xc5889c)} {e(data_07.l_0xc588a9)} {e(data_07.l_0xc588bb)}]" goto(l_0xc58718)

l_0xc587ee:
    goto(l_0xc58000)

l_0xc587f3: //This heals the selected party member to 100% tip top shape
    "{load_registers}[19 05 00 01 01][19 05 00 02 01][19 05 00 06 01]{swap}[1E 00 00 64][1E 04 00 64]{sound(37)}" goto(l_0xc58718)

