shithub: pokered

Download patch

ref: fd2b4b6c74e324f423cd3a5aac0428eae12b7620
parent: fcab935a0f449246380480613ac0896e0b90a0d8
author: YamaArashi <shadow962@live.com>
date: Mon Jul 20 15:41:23 EDT 2015

gym leader events

--- a/constants/event_constants.asm
+++ b/constants/event_constants.asm
@@ -80,8 +80,8 @@
 	const EVENT_04D
 	const EVENT_04E
 	const EVENT_04F
-	const EVENT_050
-	const EVENT_051
+	const EVENT_GOT_TM27
+	const EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
 	const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_0
 	const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_1
 	const EVENT_BEAT_VIRIDIAN_GYM_TRAINER_2
@@ -118,8 +118,8 @@
 	const EVENT_073
 	const EVENT_074
 	const EVENT_075
-	const EVENT_076
-	const EVENT_077
+	const EVENT_GOT_TM34
+	const EVENT_BEAT_BROCK
 	const EVENT_078
 	const EVENT_079
 	const EVENT_07A
@@ -190,8 +190,8 @@
 	const EVENT_BEAT_CERULEAN_GYM_TRAINER_1
 	const EVENT_0BC
 	const EVENT_0BD
-	const EVENT_0BE
-	const EVENT_0BF
+	const EVENT_GOT_TM11
+	const EVENT_BEAT_MISTY
 	const EVENT_0C0
 	const EVENT_0C1
 	const EVENT_0C2
@@ -358,8 +358,8 @@
 	const EVENT_BEAT_VERMILION_GYM_TRAINER_1
 	const EVENT_BEAT_VERMILION_GYM_TRAINER_2
 	const EVENT_165
-	const EVENT_166
-	const EVENT_167
+	const EVENT_GOT_TM24
+	const EVENT_BEAT_LT_SURGE
 	const EVENT_168
 	const EVENT_169
 	const EVENT_16A
@@ -424,8 +424,8 @@
 	const EVENT_1A5
 	const EVENT_1A6
 	const EVENT_1A7
-	const EVENT_1A8
-	const EVENT_1A9
+	const EVENT_GOT_TM21
+	const EVENT_BEAT_ERIKA
 	const EVENT_BEAT_CELADON_GYM_TRAINER_0
 	const EVENT_BEAT_CELADON_GYM_TRAINER_2
 	const EVENT_BEAT_CELADON_GYM_TRAINER_3
@@ -600,8 +600,8 @@
 	const EVENT_255
 	const EVENT_256
 	const EVENT_257
-	const EVENT_258
-	const EVENT_259
+	const EVENT_GOT_TM06
+	const EVENT_BEAT_KOGA
 	const EVENT_BEAT_FUCHSIA_GYM_TRAINER_0
 	const EVENT_BEAT_FUCHSIA_GYM_TRAINER_2
 	const EVENT_BEAT_FUCHSIA_GYM_TRAINER_3
@@ -664,8 +664,8 @@
 	const EVENT_295
 	const EVENT_296
 	const EVENT_297
-	const EVENT_298
-	const EVENT_299
+	const EVENT_GOT_TM38
+	const EVENT_BEAT_BLAINE
 	const EVENT_29A
 	const EVENT_29B
 	const EVENT_29C
@@ -864,8 +864,8 @@
 	const EVENT_35D
 	const EVENT_35E
 	const EVENT_35F
-	const EVENT_360
-	const EVENT_361
+	const EVENT_GOT_TM46
+	const EVENT_BEAT_SABRINA
 	const EVENT_BEAT_SAFFRON_GYM_TRAINER_0
 	const EVENT_BEAT_SAFFRON_GYM_TRAINER_1
 	const EVENT_BEAT_SAFFRON_GYM_TRAINER_2
--- a/macros.asm
+++ b/macros.asm
@@ -428,7 +428,7 @@
 		ELSE
 			IF ((\2) % 8) != 7
 				ld a, [wEventFlags + event_end_byte]
-				and ~((1 << (((\2) % 8) + 1)) - 1) $ ff
+				and ~((1 << (((\2) % 8) + 1)) - 1) & $ff
 				ld [wEventFlags + event_end_byte], a
 			ENDC
 		ENDC
--- a/scripts/celadongamecorner.asm
+++ b/scripts/celadongamecorner.asm
@@ -283,7 +283,7 @@
 
 CeladonGameCornerText7: ; 48db6 (12:4db6)
 	TX_ASM
-	CheckEvent EVENT_1A9
+	CheckEvent EVENT_BEAT_ERIKA
 	ld hl, CeladonGameCornerText_48dca
 	jr z, .asm_48dc4
 	ld hl, CeladonGameCornerText_48dcf
--- a/scripts/celadongym.asm
+++ b/scripts/celadongym.asm
@@ -46,7 +46,7 @@
 	ld a, $9
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_1A9
+	SetEvent EVENT_BEAT_ERIKA
 	ld bc, (TM_21 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -53,7 +53,7 @@
 	ld a, $a
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_1A8
+	SetEvent EVENT_GOT_TM21
 	jr .asm_4898c
 .BagFull
 	ld a, $b
@@ -151,9 +151,9 @@
 
 CeladonGymText1: ; 48a11 (12:4a11)
 	TX_ASM
-	CheckEvent EVENT_1A9
+	CheckEvent EVENT_BEAT_ERIKA
 	jr z, .asm_48a2d
-	CheckEventReuseA EVENT_1A8
+	CheckEventReuseA EVENT_GOT_TM21
 	jr nz, .asm_48a25
 	call z, CeladonGymText_48963
 	call DisableWaitingAfterTextDisplay
--- a/scripts/ceruleangym.asm
+++ b/scripts/ceruleangym.asm
@@ -46,7 +46,7 @@
 	ld a, $5
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_0BF
+	SetEvent EVENT_BEAT_MISTY
 	ld bc, (TM_11 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -53,7 +53,7 @@
 	ld a, $6
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_0BE
+	SetEvent EVENT_GOT_TM11
 	jr .asm_5c736
 .BagFull
 	ld a, $7
@@ -102,9 +102,9 @@
 
 CeruleanGymText1: ; 5c771 (17:4771)
 	TX_ASM
-	CheckEvent EVENT_0BF
+	CheckEvent EVENT_BEAT_MISTY
 	jr z, .asm_5c78d
-	CheckEventReuseA EVENT_0BE
+	CheckEventReuseA EVENT_GOT_TM11
 	jr nz, .asm_5c785
 	call z, CeruleanGymScript_5c70d
 	call DisableWaitingAfterTextDisplay
@@ -198,7 +198,7 @@
 
 CeruleanGymText4: ; 5c811 (17:4811)
 	TX_ASM
-	CheckEvent EVENT_0BF
+	CheckEvent EVENT_BEAT_MISTY
 	jr nz, .asm_5c821
 	ld hl, CeruleanGymText_5c82a
 	call PrintText
--- a/scripts/cinnabargym.asm
+++ b/scripts/cinnabargym.asm
@@ -143,7 +143,7 @@
 	ld a, $a
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_299
+	SetEvent EVENT_BEAT_BLAINE
 	ld bc, (TM_38 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -150,7 +150,7 @@
 	ld a, $b
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_298
+	SetEvent EVENT_GOT_TM38
 	jr .asm_75880
 .BagFull
 	ld a, $c
@@ -206,9 +206,9 @@
 
 CinnabarGymText1: ; 758df (1d:58df)
 	TX_ASM
-	CheckEvent EVENT_299
+	CheckEvent EVENT_BEAT_BLAINE
 	jr z, .asm_d9332
-	CheckEventReuseA EVENT_298
+	CheckEventReuseA EVENT_GOT_TM38
 	jr nz, .asm_3012f
 	call z, CinnabarGymScript3_75857
 	call DisableWaitingAfterTextDisplay
@@ -453,7 +453,7 @@
 
 CinnabarGymText9: ; 75aac (1d:5aac)
 	TX_ASM
-	CheckEvent EVENT_299
+	CheckEvent EVENT_BEAT_BLAINE
 	jr nz, .asm_627d9
 	ld hl, CinnabarGymText_75ac2
 	jr .asm_0b11d
--- a/scripts/fuchsiagym.asm
+++ b/scripts/fuchsiagym.asm
@@ -46,7 +46,7 @@
 	ld a, $9
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_259
+	SetEvent EVENT_BEAT_KOGA
 	ld bc, (TM_06 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -53,7 +53,7 @@
 	ld a, $a
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_258
+	SetEvent EVENT_GOT_TM06
 	jr .asm_754c0
 .BagFull
 	ld a, $b
@@ -142,9 +142,9 @@
 
 FuchsiaGymText1: ; 75534 (1d:5534)
 	TX_ASM
-	CheckEvent EVENT_259
+	CheckEvent EVENT_BEAT_KOGA
 	jr z, .asm_181b6
-	CheckEventReuseA EVENT_258
+	CheckEventReuseA EVENT_GOT_TM06
 	jr nz, .asm_adc3b
 	call z, FuchsiaGymScript3_75497
 	call DisableWaitingAfterTextDisplay
@@ -313,7 +313,7 @@
 
 FuchsiaGymText8: ; 7563a (1d:563a)
 	TX_ASM
-	CheckEvent EVENT_259
+	CheckEvent EVENT_BEAT_KOGA
 	ld hl, FuchsiaGymText_75653
 	jr nz, .asm_50671
 	ld hl, FuchsiaGymText_7564e
--- a/scripts/pewtercity.asm
+++ b/scripts/pewtercity.asm
@@ -21,7 +21,7 @@
 	ret
 
 PewterCityScript_1925e: ; 1925e (6:525e)
-	CheckEvent EVENT_077
+	CheckEvent EVENT_BEAT_BROCK
 	ret nz
 	ld hl, CoordsData_19277
 	call ArePlayerCoordsInArray
--- a/scripts/pewtergym.asm
+++ b/scripts/pewtergym.asm
@@ -46,7 +46,7 @@
 	ld a, $4
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_077
+	SetEvent EVENT_BEAT_BROCK
 	ld bc, (TM_34 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -53,7 +53,7 @@
 	ld a, $5
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_076
+	SetEvent EVENT_GOT_TM34
 	jr .asm_5c408
 .BagFull
 	ld a, $6
@@ -101,9 +101,9 @@
 
 PewterGymText1: ; 5c44e (17:444e)
 	TX_ASM
-	CheckEvent EVENT_077
+	CheckEvent EVENT_BEAT_BROCK
 	jr z, .asm_5c46a
-	CheckEventReuseA EVENT_076
+	CheckEventReuseA EVENT_GOT_TM34
 	jr nz, .asm_5c462
 	call z, PewterGymScript_5c3df
 	call DisableWaitingAfterTextDisplay
--- a/scripts/saffrongym.asm
+++ b/scripts/saffrongym.asm
@@ -46,7 +46,7 @@
 	ld a, $a
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_361
+	SetEvent EVENT_BEAT_SABRINA
 	ld bc, (TM_46 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -53,7 +53,7 @@
 	ld a, $b
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_360
+	SetEvent EVENT_GOT_TM46
 	jr .asm_5d091
 .BagFull
 	ld a, $c
@@ -152,9 +152,9 @@
 
 SaffronGymText1: ; 5d118 (17:5118)
 	TX_ASM
-	CheckEvent EVENT_361
+	CheckEvent EVENT_BEAT_SABRINA
 	jr z, .asm_5d134
-	CheckEventReuseA EVENT_360
+	CheckEventReuseA EVENT_GOT_TM46
 	jr nz, .asm_5d12c
 	call z, SaffronGymText_5d068
 	call DisableWaitingAfterTextDisplay
@@ -255,7 +255,7 @@
 
 SaffronGymText9: ; 5d1cd (17:51cd)
 	TX_ASM
-	CheckEvent EVENT_361
+	CheckEvent EVENT_BEAT_SABRINA
 	jr nz, .asm_5d1dd
 	ld hl, SaffronGymText_5d1e6
 	call PrintText
--- a/scripts/vermiliongym.asm
+++ b/scripts/vermiliongym.asm
@@ -65,7 +65,7 @@
 	ld a, $6
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_167
+	SetEvent EVENT_BEAT_LT_SURGE
 	ld bc, (TM_24 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -72,7 +72,7 @@
 	ld a, $7
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_166
+	SetEvent EVENT_GOT_TM24
 	jr .asm_5cad3
 .BagFull
 	ld a, $8
@@ -131,9 +131,9 @@
 
 VermilionGymText1: ; 5cb1d (17:4b1d)
 	TX_ASM
-	CheckEvent EVENT_167
+	CheckEvent EVENT_BEAT_LT_SURGE
 	jr z, .asm_5cb39
-	CheckEventReuseA EVENT_166
+	CheckEventReuseA EVENT_GOT_TM24
 	jr nz, .asm_5cb31
 	call z, VermilionGymScript_5caaa
 	call DisableWaitingAfterTextDisplay
--- a/scripts/viridiancity.asm
+++ b/scripts/viridiancity.asm
@@ -151,7 +151,7 @@
 	cp %01111111
 	ld hl, ViridianCityText_19127
 	jr z, .asm_ae9fe
-	CheckEvent EVENT_051
+	CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
 	jr nz, .asm_ae9fe
 	ld hl, ViridianCityText_19122
 .asm_ae9fe
--- a/scripts/viridiangym.asm
+++ b/scripts/viridiangym.asm
@@ -140,7 +140,7 @@
 	ld a, $c
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_051
+	SetEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
 	ld bc, (TM_27 << 8) | 1
 	call GiveItem
 	jr nc, .BagFull
@@ -147,7 +147,7 @@
 	ld a, $d
 	ld [hSpriteIndexOrTextID], a
 	call DisplayTextID
-	SetEvent EVENT_050
+	SetEvent EVENT_GOT_TM27
 	jr .asm_749be
 .BagFull
 	ld a, $e
@@ -261,9 +261,9 @@
 
 ViridianGymText1: ; 74a69 (1d:4a69)
 	TX_ASM
-	CheckEvent EVENT_051
+	CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
 	jr z, .asm_6de66
-	CheckEventReuseA EVENT_050
+	CheckEventReuseA EVENT_GOT_TM27
 	jr nz, .asm_9fc95
 	call z, ViridianGymScript3_74995
 	call DisableWaitingAfterTextDisplay
@@ -475,7 +475,7 @@
 
 ViridianGymText10: ; 74bbb (1d:4bbb)
 	TX_ASM
-	CheckEvent EVENT_051
+	CheckEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI
 	jr nz, .asm_1abd1
 	ld hl, ViridianGymText_74bd4
 	call PrintText