Skip to content

Instantly share code, notes, and snippets.

@nicholatian
Created February 8, 2016 04:30
Show Gist options
  • Save nicholatian/ecfd6b054ec8a639c990 to your computer and use it in GitHub Desktop.
Save nicholatian/ecfd6b054ec8a639c990 to your computer and use it in GitHub Desktop.
Citrite's dynamic PokéScript assembly
//
// +-------------------------------------------------------------------------+
// | This file has been hand-written by Alexander Nicholi |
// | and is a bytecode disassembly of all PokeScript code and data |
// | for Pokemon Citrite Version |
// +-------------------------------------------------------------------------+
//
// Processor: Game Freak PokeScript Engine
// Architecture: Proprietary bytecode
// Target assembler: PKSV-UI
// Byte sex: Little endian
//
// ===========================================================================
//
// Defines class
// Holds preprocessor definitions for the assembly.
#class DEFINES
#define __ORIGIN__ 0x1A00000
#define CANARYBATTLE_ZIGZAGOON 0x3
#define CANARYBATTLE_TRAINER 0x2
#endclass
// End defines class
// Hooks class
// Injects dynamic offsets from the assembly into other places in the ROM.
#class HOOKS
// Introduction sequence
#org 0x309C4
#dword :introduction_1
#org 0x39A64
#dword :introduction_2
#org 0x30C0C
#dword :introduction_3
#org 0x30DFC
#dword :introduction_4
#org 0x31008
#dword :introduction_5
#org 0x31138
#dword :introduction_6
#org 0x31334
#dword :introduction_7
#org 0x314BC
#dword :introduction_8
// Running shoes
#org 0x1200955
#dword :set_runningshoes
// OW0@1.0
#org 0x1200948
#dword :traveling_bag
#endclass
// End hooks class
// Main class
// Holds all of the code and data for the assembly.
#class MAIN
// ASSEMBLY ORIGIN
#org __ORIGIN__
// void traveling_bag()
:traveling_bag
lock
message :traveling_bag-foundbag
disappear 0x1
fanfare 0x174
showmsg
waitfanfare
msgbox :traveling_bag-contents
callstd MSG_LOCK
additem FRESHWATER 6
additem POKEBALL 20
additem STARDUST 10
setflag 0x100
release
end
:traveling_bag-foundbag
= \v\h01 found a traveling bag!
:traveling_bag-contents
= Let's see what's inside...\c\h08\h30 hey!\p\v\h01 found a six-pack of waters,\ntwenty Pok\e Balls, and ten bags of\lStardust!\c\h08\h18 Neat!
//
:introduction_1
= Hello, and welcome back.\nIt's good I got you when I did.\pDo you...\c\h08\h18 feel okay?\c\h08\h38 Alright. Good.\nMy name is Hinkage. Nice to meet you!\pYour angle from the blast may have\nmade your memory a bit faded...\p
:introduction_2
= That's right, Zangoose. Good, you're\non-track. That's splendid.\pSo um, would you mind giving me\na few details about you? I'm having\la hard time seeing in the dark.\p
:introduction_3
= So.
:introduction_4
= Are you male, or female?
:introduction_5
= Have a name to go with that?
:introduction_6
= So that's all correct, then?
:introduction_7
= Well, \v\h01. I know I may not have\nexplained much in this dark room,\lbut all will unfold in due time.\lTrust me on that.\p
:introduction_8
= When you arrive at your destination,\nthere'll be a bag with some supplies.\lDon't forget them.\pAnd squadalah, you're off!\p
:set_runningshoes
setflag 0x8C0
end
// void groundzero_warn_sign()
:groundzero_warn_sign
msgbox :groundzero_warn_sign-text
callstd MSG_SIGN
end
:groundzero_warn_sign-text
= "WARNING!\p"The soot-covered area beyond here is\nradioactive!\p"Harmful levels of radiation have been\nmeasured in the form of gamma rays\las well as X-rays.\c\h08\h38 KEEP OUT!"\p...this notice posted by the Tohjo Branch\nof the Greatker Kanto Int'l Police
// void rudyhouse_sign()
:rudyhouse_sign
msgbox :rudyhouse_sign-text
callstd MSG_SIGN
end
:rudyhouse_sign-text
= Rudy's Cottage
// void tb_canarymeadow_camper()
:tb_canary_camper
trainerbattle 0x1 0x1 0x0 :tb_canary_camper-intro :tb_canary_camper-defeat :tb_canary_camper-after
:tb_canary_camper-after
msgbox :tb_canary_camper-aftermsg
callstd MSG_NORMAL
end
:tb_canary_camper-intro
= Yo man! Sup?
:tb_canary_camper-defeat
= Dangit! Down and out!
:tb_canary_camper-aftermsg
= I like going camping near danger.\pThe soot from Ground Zero is\nso close by! I can smell it!
// void tb_canarymeadow_pokefan()
:tb_canary_pokefan
trainerbattle 0x1 0x2 0x0 :tb_canary_pokefan-intro :tb_canary_pokefan-defeat :tb_canary_pokefan-after
:tb_canary_pokefan-after
msgbox :tb_canary_pokefan-aftermsg
callstd MSG_NORMAL
end
:tb_canary_pokefan-intro
= Nothing compares to the absolute cuteness\nof my Azurill!
:tb_canary_pokefan-defeat
= But you've got toughness on your side,\nahahahaha!
:tb_canary_pokefan-aftermsg
= Sometimes I like to take baths with my\nAzurill.\pShe can't stay below the water all\nthat much because of her tail!
// void canarymeadow_itemball_1()
:canary_itemball_1
copyvarifnotzero 0x8000 POTION
copyvarifnotzero 0x8001 1
callstd MSG_FIND
end
// void canarymeadow_itemball_2()
:canary_itemball_2
copyvarifnotzero 0x8000 POKEBALL
copyvarifnotzero 0x8001 1
callstd MSG_FIND
end
// void canarymeadow_itemball_3()
:canary_itemball_3
copyvarifnotzero 0x8000 PEARL
copyvarifnotzero 0x8001 1
callstd MSG_FIND
end
// void canarybattle()
:canarybattle
lockall
applymovement PLAYER :canarybattle-moveback
pauseevent 0x0
msgbox :canarybattle-usetackle
callstd MSG_STANDARD
pause 0x28
applymovement CANARYBATTLE_ZIGZAGOON :canarybattle-tackle
pause 0x18
setvar 0x8000 CANARYBATTLE_TRAINER
call :do_exclamation
// void do_exclamation(person_id)
:do_exclamation
sound 0x15
applymovement 0x8000 :do_exclamation-move
pauseevent 0x0
return
:do_exclamation-move
M raw_56 raw_FE
#endclass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment