shithub: pokered

Download patch

ref: 29aff84107a6463a94f0d7d81de8a1603e0d741f
parent: 342791a001cecbfd8192ced7dd2478485d98fa45
author: yenatch <yenatch@gmail.com>
date: Wed Sep 17 08:35:51 EDT 2014

Enumerate move constants and add unnamed animation constants.

--- a/constants/move_constants.asm
+++ b/constants/move_constants.asm
@@ -1,184 +1,210 @@
-NUM_ATTACKS  EQU $A4
+const_value = 1
 
-POUND        EQU $01
-KARATE_CHOP  EQU $02
-DOUBLESLAP   EQU $03
-COMET_PUNCH  EQU $04
-MEGA_PUNCH   EQU $05
-PAY_DAY      EQU $06
-FIRE_PUNCH   EQU $07
-ICE_PUNCH    EQU $08
-THUNDERPUNCH EQU $09
-SCRATCH      EQU $0A
-VICEGRIP     EQU $0B
-GUILLOTINE   EQU $0C
-RAZOR_WIND   EQU $0D
-SWORDS_DANCE EQU $0E
-CUT          EQU $0F
-GUST         EQU $10
-WING_ATTACK  EQU $11
-WHIRLWIND    EQU $12
-FLY          EQU $13
-BIND         EQU $14
-SLAM         EQU $15
-VINE_WHIP    EQU $16
-STOMP        EQU $17
-DOUBLE_KICK  EQU $18
-MEGA_KICK    EQU $19
-JUMP_KICK    EQU $1A
-ROLLING_KICK EQU $1B
-SAND_ATTACK  EQU $1C
-HEADBUTT     EQU $1D
-HORN_ATTACK  EQU $1E
-FURY_ATTACK  EQU $1F
-HORN_DRILL   EQU $20
-TACKLE       EQU $21
-BODY_SLAM    EQU $22
-WRAP         EQU $23
-TAKE_DOWN    EQU $24
-THRASH       EQU $25
-DOUBLE_EDGE  EQU $26
-TAIL_WHIP    EQU $27
-POISON_STING EQU $28
-TWINEEDLE    EQU $29
-PIN_MISSILE  EQU $2A
-LEER         EQU $2B
-BITE         EQU $2C
-GROWL        EQU $2D
-ROAR         EQU $2E
-SING         EQU $2F
-SUPERSONIC   EQU $30
-SONICBOOM    EQU $31
-DISABLE      EQU $32
-ACID         EQU $33
-EMBER        EQU $34
-FLAMETHROWER EQU $35
-MIST         EQU $36
-WATER_GUN    EQU $37
-HYDRO_PUMP   EQU $38
-SURF         EQU $39
-ICE_BEAM     EQU $3A
-BLIZZARD     EQU $3B
-PSYBEAM      EQU $3C
-BUBBLEBEAM   EQU $3D
-AURORA_BEAM  EQU $3E
-HYPER_BEAM   EQU $3F
-PECK         EQU $40
-DRILL_PECK   EQU $41
-SUBMISSION   EQU $42
-LOW_KICK     EQU $43
-COUNTER      EQU $44
-SEISMIC_TOSS EQU $45
-STRENGTH     EQU $46
-ABSORB       EQU $47
-MEGA_DRAIN   EQU $48
-LEECH_SEED   EQU $49
-GROWTH       EQU $4A
-RAZOR_LEAF   EQU $4B
-SOLARBEAM    EQU $4C
-POISONPOWDER EQU $4D
-STUN_SPORE   EQU $4E
-SLEEP_POWDER EQU $4F
-PETAL_DANCE  EQU $50
-STRING_SHOT  EQU $51
-DRAGON_RAGE  EQU $52
-FIRE_SPIN    EQU $53
-THUNDERSHOCK EQU $54
-THUNDERBOLT  EQU $55
-THUNDER_WAVE EQU $56
-THUNDER      EQU $57
-ROCK_THROW   EQU $58
-EARTHQUAKE   EQU $59
-FISSURE      EQU $5A
-DIG          EQU $5B
-TOXIC        EQU $5C
-CONFUSION    EQU $5D
-PSYCHIC_M    EQU $5E
-HYPNOSIS     EQU $5F
-MEDITATE     EQU $60
-AGILITY      EQU $61
-QUICK_ATTACK EQU $62
-RAGE         EQU $63
-TELEPORT     EQU $64
-NIGHT_SHADE  EQU $65
-MIMIC        EQU $66
-SCREECH      EQU $67
-DOUBLE_TEAM  EQU $68
-RECOVER      EQU $69
-HARDEN       EQU $6A
-MINIMIZE     EQU $6B
-SMOKESCREEN  EQU $6C
-CONFUSE_RAY  EQU $6D
-WITHDRAW     EQU $6E
-DEFENSE_CURL EQU $6F
-BARRIER      EQU $70
-LIGHT_SCREEN EQU $71
-HAZE         EQU $72
-REFLECT      EQU $73
-FOCUS_ENERGY EQU $74
-BIDE         EQU $75
-METRONOME    EQU $76
-MIRROR_MOVE  EQU $77
-SELFDESTRUCT EQU $78
-EGG_BOMB     EQU $79
-LICK         EQU $7A
-SMOG         EQU $7B
-SLUDGE       EQU $7C
-BONE_CLUB    EQU $7D
-FIRE_BLAST   EQU $7E
-WATERFALL    EQU $7F
-CLAMP        EQU $80
-SWIFT        EQU $81
-SKULL_BASH   EQU $82
-SPIKE_CANNON EQU $83
-CONSTRICT    EQU $84
-AMNESIA      EQU $85
-KINESIS      EQU $86
-SOFTBOILED   EQU $87
-HI_JUMP_KICK EQU $88
-GLARE        EQU $89
-DREAM_EATER  EQU $8A
-POISON_GAS   EQU $8B
-BARRAGE      EQU $8C
-LEECH_LIFE   EQU $8D
-LOVELY_KISS  EQU $8E
-SKY_ATTACK   EQU $8F
-TRANSFORM    EQU $90
-BUBBLE       EQU $91
-DIZZY_PUNCH  EQU $92
-SPORE        EQU $93
-FLASH        EQU $94
-PSYWAVE      EQU $95
-SPLASH       EQU $96
-ACID_ARMOR   EQU $97
-CRABHAMMER   EQU $98
-EXPLOSION    EQU $99
-FURY_SWIPES  EQU $9A
-BONEMERANG   EQU $9B
-REST         EQU $9C
-ROCK_SLIDE   EQU $9D
-HYPER_FANG   EQU $9E
-SHARPEN      EQU $9F
-CONVERSION   EQU $A0
-TRI_ATTACK   EQU $A1
-SUPER_FANG   EQU $A2
-SLASH        EQU $A3
-SUBSTITUTE   EQU $A4
-STRUGGLE     EQU $A5
+	const POUND
+	const KARATE_CHOP
+	const DOUBLESLAP
+	const COMET_PUNCH
+	const MEGA_PUNCH
+	const PAY_DAY
+	const FIRE_PUNCH
+	const ICE_PUNCH
+	const THUNDERPUNCH
+	const SCRATCH
+	const VICEGRIP
+	const GUILLOTINE
+	const RAZOR_WIND
+	const SWORDS_DANCE
+	const CUT
+	const GUST
+	const WING_ATTACK
+	const WHIRLWIND
+	const FLY
+	const BIND
+	const SLAM
+	const VINE_WHIP
+	const STOMP
+	const DOUBLE_KICK
+	const MEGA_KICK
+	const JUMP_KICK
+	const ROLLING_KICK
+	const SAND_ATTACK
+	const HEADBUTT
+	const HORN_ATTACK
+	const FURY_ATTACK
+	const HORN_DRILL
+	const TACKLE
+	const BODY_SLAM
+	const WRAP
+	const TAKE_DOWN
+	const THRASH
+	const DOUBLE_EDGE
+	const TAIL_WHIP
+	const POISON_STING
+	const TWINEEDLE
+	const PIN_MISSILE
+	const LEER
+	const BITE
+	const GROWL
+	const ROAR
+	const SING
+	const SUPERSONIC
+	const SONICBOOM
+	const DISABLE
+	const ACID
+	const EMBER
+	const FLAMETHROWER
+	const MIST
+	const WATER_GUN
+	const HYDRO_PUMP
+	const SURF
+	const ICE_BEAM
+	const BLIZZARD
+	const PSYBEAM
+	const BUBBLEBEAM
+	const AURORA_BEAM
+	const HYPER_BEAM
+	const PECK
+	const DRILL_PECK
+	const SUBMISSION
+	const LOW_KICK
+	const COUNTER
+	const SEISMIC_TOSS
+	const STRENGTH
+	const ABSORB
+	const MEGA_DRAIN
+	const LEECH_SEED
+	const GROWTH
+	const RAZOR_LEAF
+	const SOLARBEAM
+	const POISONPOWDER
+	const STUN_SPORE
+	const SLEEP_POWDER
+	const PETAL_DANCE
+	const STRING_SHOT
+	const DRAGON_RAGE
+	const FIRE_SPIN
+	const THUNDERSHOCK
+	const THUNDERBOLT
+	const THUNDER_WAVE
+	const THUNDER
+	const ROCK_THROW
+	const EARTHQUAKE
+	const FISSURE
+	const DIG
+	const TOXIC
+	const CONFUSION
+	const PSYCHIC_M
+	const HYPNOSIS
+	const MEDITATE
+	const AGILITY
+	const QUICK_ATTACK
+	const RAGE
+	const TELEPORT
+	const NIGHT_SHADE
+	const MIMIC
+	const SCREECH
+	const DOUBLE_TEAM
+	const RECOVER
+	const HARDEN
+	const MINIMIZE
+	const SMOKESCREEN
+	const CONFUSE_RAY
+	const WITHDRAW
+	const DEFENSE_CURL
+	const BARRIER
+	const LIGHT_SCREEN
+	const HAZE
+	const REFLECT
+	const FOCUS_ENERGY
+	const BIDE
+	const METRONOME
+	const MIRROR_MOVE
+	const SELFDESTRUCT
+	const EGG_BOMB
+	const LICK
+	const SMOG
+	const SLUDGE
+	const BONE_CLUB
+	const FIRE_BLAST
+	const WATERFALL
+	const CLAMP
+	const SWIFT
+	const SKULL_BASH
+	const SPIKE_CANNON
+	const CONSTRICT
+	const AMNESIA
+	const KINESIS
+	const SOFTBOILED
+	const HI_JUMP_KICK
+	const GLARE
+	const DREAM_EATER
+	const POISON_GAS
+	const BARRAGE
+	const LEECH_LIFE
+	const LOVELY_KISS
+	const SKY_ATTACK
+	const TRANSFORM
+	const BUBBLE
+	const DIZZY_PUNCH
+	const SPORE
+	const FLASH
+	const PSYWAVE
+	const SPLASH
+	const ACID_ARMOR
+	const CRABHAMMER
+	const EXPLOSION
+	const FURY_SWIPES
+	const BONEMERANG
+	const REST
+	const ROCK_SLIDE
+	const HYPER_FANG
+	const SHARPEN
+	const CONVERSION
+	const TRI_ATTACK
+	const SUPER_FANG
+	const SLASH
+	const SUBSTITUTE
 
-; these do double duty as animation identifiers
-SHOWPIC_ANIM EQU $A6 ; redraw monster pic
-STATUS_AFFECTED_ANIM EQU $A7 ; effect when monster receives a status aliment
-XSTATITEM_ANIM EQU $AE ; use X Attack/Defense/Speed/Special
-BURN_PSN_ANIM EQU $BA ; Plays when a monster is burned or poisoned
-SLP_ANIM     EQU $BD ; sleeping monster
-CONF_ANIM    EQU $BF ; confused monster
-TOSS_ANIM    EQU $C1 ; toss Poké Ball
-SHAKE_ANIM   EQU $C2 ; shaking Poké Ball when catching monster
-POOF_ANIM    EQU $C3 ; puff of smoke
-BLOCKBALL_ANIM EQU $C4 ; trainer knocks away Poké Ball
-GREATTOSS_ANIM EQU $C5 ; toss Great Ball
-ULTRATOSS_ANIM EQU $C6 ; toss Ultra Ball or Master Ball
-HIDEPIC_ANIM EQU $C8 ; monster disappears
-ROCK_ANIM EQU $C9 ; throw rock
-BAIT_ANIM EQU $CA ; throw bait
+NUM_ATTACKS EQU const_value + -1
+
+	const STRUGGLE
+
+	; Moves do double duty as animation identifiers.
+
+	const SHOWPIC_ANIM
+	const STATUS_AFFECTED_ANIM
+	const ANIM_A8
+	const ANIM_A9
+	const ANIM_AA
+	const ANIM_AB
+	const ANIM_AC
+	const ANIM_AD
+	const XSTATITEM_ANIM ; use X Attack/Defense/Speed/Special
+	const ANIM_AF
+	const ANIM_B0
+	const ANIM_B1
+	const ANIM_B2
+	const ANIM_B3
+	const ANIM_B4
+	const ANIM_B5
+	const ANIM_B6
+	const ANIM_B7
+	const ANIM_B8
+	const ANIM_B9
+	const BURN_PSN_ANIM ; Plays when a monster is burned or poisoned
+	const ANIM_BB
+	const ANIM_BC
+	const SLP_ANIM ; sleeping monster
+	const ANIM_BE
+	const CONF_ANIM ; confused monster
+	const ANIM_C0
+	const TOSS_ANIM ; toss Poké Ball
+	const SHAKE_ANIM ; shaking Poké Ball when catching monster
+	const POOF_ANIM ; puff of smoke
+	const BLOCKBALL_ANIM ; trainer knocks away Poké Ball
+	const GREATTOSS_ANIM ; toss Great Ball
+	const ULTRATOSS_ANIM ; toss Ultra Ball or Master Ball
+	const ANIM_C7
+	const HIDEPIC_ANIM ; monster disappears
+	const ROCK_ANIM ; throw rock
+	const BAIT_ANIM ; throw bait
--- a/macros.asm
+++ b/macros.asm
@@ -14,6 +14,17 @@
 percent EQUS "* $ff / 100"
 
 
+; Constant enumeration is useful for monsters, items, moves, etc.
+const_def: MACRO
+const_value = 0
+ENDM
+
+const: MACRO
+\1 EQU const_value
+const_value = const_value + 1
+ENDM
+
+
 homecall: MACRO
 	ld a, [H_LOADEDROMBANK]
 	push af