Skip to content

Commit

Permalink
Updated Acid animation
Browse files Browse the repository at this point in the history
  • Loading branch information
SoupPotato committed Jan 20, 2024
1 parent 27c20c3 commit 8abde79
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 11 deletions.
5 changes: 4 additions & 1 deletion constants/battle_anim_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ DEF BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture
const BATTLE_ANIM_OBJ_DAZZLE ; c4
const BATTLE_ANIM_OBJ_SHOOTING_TRIANGLE ; c5
const BATTLE_ANIM_OBJ_SPINNING_TRIANGLE ; c6
const BATTLE_ANIM_OBJ_POISON_DROPLET ; c7
DEF NUM_BATTLE_ANIM_OBJS EQU const_value

; DoBattleAnimFrame arguments (see engine/battle_anims/functions.asm)
Expand Down Expand Up @@ -314,6 +315,7 @@ DEF NUM_BATTLE_ANIM_OBJS EQU const_value
const BATTLE_ANIM_FUNC_ROCK_SMASH ; 4e
const BATTLE_ANIM_FUNC_COTTON ; 4f
const BATTLE_ANIM_FUNC_BUBBLE_SPLASH ; 50
const BATTLE_ANIM_FUNC_RADIAL_MOVE_OUT_SLOW ; 51
DEF NUM_BATTLE_ANIM_FUNCS EQU const_value

; BattleAnimFrameData indexes (see data/battle_anims/framesets.asm)
Expand Down Expand Up @@ -348,7 +350,7 @@ DEF NUM_BATTLE_ANIM_FUNCS EQU const_value
const BATTLE_ANIM_FRAMESET_STRENGTH ; 1b
const BATTLE_ANIM_FRAMESET_SKULL_CROSSBONE ; 1c
const BATTLE_ANIM_FRAMESET_ACID ; 1d
const BATTLE_ANIM_FRAMESET_POISON_DROPLET_UNUSED ; 1e
const BATTLE_ANIM_FRAMESET_POISON_DROPLET ; 1e
const BATTLE_ANIM_FRAMESET_SLUDGE_BUBBLE ; 1f
const BATTLE_ANIM_FRAMESET_SLUDGE_BUBBLE_BURST ; 20
const BATTLE_ANIM_FRAMESET_SMALL_BUBBLE ; 21
Expand Down Expand Up @@ -918,6 +920,7 @@ DEF NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects
const PAL_BTLCUSTOM_HP_STEEL ; 1a
const PAL_BTLCUSTOM_HP_PSYCHIC ; 1b
const PAL_BTLCUSTOM_HP_GHOST ; 1c
const PAL_BTLCUSTOM_ACID ; 1d

DEF NUM_CUSTOM_BATTLE_PALETTES EQU const_value

Expand Down
8 changes: 4 additions & 4 deletions data/battle_anims/framesets.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BattleAnimFrameData:
dw .Frameset_Strength ; BATTLE_ANIM_FRAMESET_STRENGTH
dw .Frameset_SkullCrossbone ; BATTLE_ANIM_FRAMESET_SKULL_CROSSBONE
dw .Frameset_Acid ; BATTLE_ANIM_FRAMESET_ACID
dw .Frameset_PoisonDropletUnused ; BATTLE_ANIM_FRAMESET_POISON_DROPLET_UNUSED
dw .Frameset_PoisonDroplet ; BATTLE_ANIM_FRAMESET_POISON_DROPLET
dw .Frameset_SludgeBubble ; BATTLE_ANIM_FRAMESET_SLUDGE_BUBBLE
dw .Frameset_SludgeBubbleBurst ; BATTLE_ANIM_FRAMESET_SLUDGE_BUBBLE_BURST
dw .Frameset_SmallBubble ; BATTLE_ANIM_FRAMESET_SMALL_BUBBLE
Expand Down Expand Up @@ -458,9 +458,9 @@ BattleAnimFrameData:
oamframe BATTLE_ANIM_OAMSET_1D, 8
oamend

.Frameset_PoisonDropletUnused:
oamframe BATTLE_ANIM_OAMSET_17, 8
oamend
.Frameset_PoisonDroplet:
oamframe BATTLE_ANIM_OAMSET_17, 24
oamdelete

.Frameset_SludgeBubble:
oamframe BATTLE_ANIM_OAMSET_0F, 3
Expand Down
4 changes: 3 additions & 1 deletion data/battle_anims/objects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ BattleAnimObjects:
; BATTLE_ANIM_OBJ_EXPLOSION2
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_EXPLOSION, BATTLE_ANIM_FUNC_NULL, PAL_BATTLE_OB_RED, BATTLE_ANIM_GFX_EXPLOSION
; BATTLE_ANIM_OBJ_ACID
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_ACID, BATTLE_ANIM_FUNC_THROW_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, BATTLE_ANIM_GFX_POISON
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_ACID, BATTLE_ANIM_FUNC_THROW_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, BATTLE_ANIM_GFX_POISON
; BATTLE_ANIM_OBJ_SLUDGE
battleanimobj RELATIVE_X, $b4, BATTLE_ANIM_FRAMESET_SLUDGE_BUBBLE, BATTLE_ANIM_FUNC_SLUDGE, PAL_BATTLE_OB_GRAY, BATTLE_ANIM_GFX_POISON
; BATTLE_ANIM_OBJ_BETA_BALL_POOF
Expand Down Expand Up @@ -417,4 +417,6 @@ BattleAnimObjects:
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_SPINNING_TRIANGLE, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, PAL_BATTLE_OB_GRAY, BATTLE_ANIM_GFX_TRIANGLE
; BATTLE_ANIM_OBJ_SHOOTING_TRIANGLE
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_SPINNING_TRIANGLE_SLOW, BATTLE_ANIM_FUNC_NULL, PAL_BATTLE_OB_GRAY, BATTLE_ANIM_GFX_TRIANGLE
; BATTLE_ANIM_OBJ_POISON_DROPLET
battleanimobj RELATIVE_X, $6e, BATTLE_ANIM_FRAMESET_POISON_DROPLET, BATTLE_ANIM_FUNC_RADIAL_MOVE_OUT_SLOW, PAL_BATTLE_OB_GRAY, BATTLE_ANIM_GFX_POISON
assert_table_length NUM_BATTLE_ANIM_OBJS
16 changes: 12 additions & 4 deletions data/moves/animations.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1399,10 +1399,19 @@ BattleAnim_Explosion:
anim_ret

BattleAnim_Acid:
anim_setobjpal PAL_BATTLE_OB_GRAY, PAL_BTLCUSTOM_YELLOW
anim_setobjpal PAL_BATTLE_OB_GRAY, PAL_BTLCUSTOM_ACID
anim_1gfx BATTLE_ANIM_GFX_POISON
anim_call BattleAnimSub_Acid
anim_wait 64
anim_obj BATTLE_ANIM_OBJ_POISON_DROPLET, 128, 36, $11
anim_wait 4
anim_obj BATTLE_ANIM_OBJ_POISON_DROPLET, 144, 36, $0f
anim_wait 4
anim_obj BATTLE_ANIM_OBJ_POISON_DROPLET, 124, 36, $11
anim_wait 4
anim_obj BATTLE_ANIM_OBJ_POISON_DROPLET, 148, 36, $0f
anim_wait 4
anim_obj BATTLE_ANIM_OBJ_POISON_DROPLET, 120, 36, $11
anim_wait 48
anim_ret

BattleAnim_RockThrow:
Expand Down Expand Up @@ -3122,7 +3131,6 @@ BattleAnim_Sludge:
BattleAnim_Toxic:
anim_setobjpal PAL_BATTLE_OB_GRAY, PAL_BTLCUSTOM_PURPLE
anim_1gfx BATTLE_ANIM_GFX_POISON
anim_obp0 $fc
anim_bgeffect BATTLE_BG_EFFECT_BLACK_HUES, $0, $8, $0
anim_call BattleAnimSub_Acid
anim_wait 32
Expand Down Expand Up @@ -4918,7 +4926,7 @@ BattleAnimSub_Sludge:
BattleAnimSub_Acid:
.loop
anim_sound 6, 2, SFX_BUBBLEBEAM
anim_obj BATTLE_ANIM_OBJ_ACID, 64, 92, $10
anim_obj BATTLE_ANIM_OBJ_ACID, 64, 84, $10
anim_wait 5
anim_loop 8, .loop
anim_ret
Expand Down
59 changes: 59 additions & 0 deletions engine/battle_anims/functions.asm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ DoBattleAnimFrame:
dw BattleAnimFunc_RockSmash
dw BattleAnimFunc_Cotton
dw BattleAnimFunc_BubbleSplash
dw BattleAnimFunction_RadialMoveOut_Slow
assert_table_length NUM_BATTLE_ANIM_FUNCS

BattleAnimFunc_Null:
Expand Down Expand Up @@ -4217,6 +4218,64 @@ BattleAnimFunc_AncientPower:
call DeinitBattleAnimation
ret

BattleAnimFunction_RadialMoveOut_Slow:
call BattleAnim_AnonJumptable

dw InitRadial
dw Step_Slow

InitRadial:
ld hl, BATTLEANIMSTRUCT_VAR2
add hl, bc
xor a
ld [hld], a
ld [hl], a ; initial position = 0
call BattleAnim_IncAnonJumptableIndex

Step_Slow:
call Get_Rad_Pos
ld hl, 1.5 ; speed
call Set_Rad_Pos
cp 120 ; final position
jmp nc, DeinitBattleAnimation
jr Rad_Move

Get_Rad_Pos:
ld hl, BATTLEANIMSTRUCT_VAR1
add hl, bc
ld a, [hli]
ld e, [hl]
ld d, a
ret

Set_Rad_Pos:
add hl, de
ld a, h
ld e, l
ld hl, BATTLEANIMSTRUCT_VAR1
add hl, bc
ld [hli], a
ld [hl], e
ret

Rad_Move:
ld hl, BATTLEANIMSTRUCT_PARAM
add hl, bc
ld e, [hl]
push de
ld a, e
call BattleAnim_Sine
ld hl, BATTLEANIMSTRUCT_YOFFSET
add hl, bc
ld [hl], a
pop de
ld a, e
call BattleAnim_Cosine
ld hl, BATTLEANIMSTRUCT_XOFFSET
add hl, bc
ld [hl], a
ret

BattleAnim_StepCircle:
; Inches object in a circular movement where its height is 1/4 the width
push af
Expand Down
5 changes: 5 additions & 0 deletions gfx/battle_anims/custom.pal
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,10 @@ INCLUDE "gfx/battle_anims/battle_anims.pal"
RGB 19, 16, 22
RGB 10, 08, 13
RGB 00, 00, 00
; acid
RGB 31, 31, 31
RGB 31, 31, 07
RGB 31, 23, 04
RGB 31, 16, 01
rept NUM_CUSTOM_BATTLE_PALETTES - 6
endr
Binary file modified gfx/battle_anims/poison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ INCLUDE "engine/events/treemons.asm"
INCLUDE "engine/events/fishing_gfx.asm"
INCLUDE "engine/pokegear/radio.asm"
INCLUDE "engine/pokemon/mail_2.asm"
INCLUDE "engine/events/poisonstep_pals.asm"


SECTION "Phone Scripts 2", ROMX
Expand Down Expand Up @@ -467,7 +468,6 @@ SECTION "bank32", ROMX

INCLUDE "engine/battle_anims/bg_effects.asm"
INCLUDE "data/moves/animations.asm"
INCLUDE "engine/events/poisonstep_pals.asm"


SECTION "Move Animations", ROMX
Expand Down

0 comments on commit 8abde79

Please sign in to comment.