mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
split out some more move effects
This commit is contained in:
parent
d7bf70f3c9
commit
d7cdd0ac73
File diff suppressed because it is too large
Load Diff
24
battle/effects/foresight.asm
Normal file
24
battle/effects/foresight.asm
Normal file
@ -0,0 +1,24 @@
|
||||
BattleCommand57: ; 376a0
|
||||
; foresight
|
||||
|
||||
ld a, [AttackMissed]
|
||||
and a
|
||||
jr nz, .failed
|
||||
|
||||
call CheckHiddenOpponent
|
||||
jr nz, .failed
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call _GetBattleVar
|
||||
bit SUBSTATUS_IDENTIFIED, [hl]
|
||||
jr nz, .failed
|
||||
|
||||
set SUBSTATUS_IDENTIFIED, [hl]
|
||||
call Function0x37e01
|
||||
ld hl, IdentifiedText
|
||||
jp StdBattleTextBox
|
||||
|
||||
.failed
|
||||
jp Function0x37354
|
||||
; 376c2
|
||||
|
62
battle/effects/metronome.asm
Normal file
62
battle/effects/metronome.asm
Normal file
@ -0,0 +1,62 @@
|
||||
BattleCommand34: ; 37418
|
||||
; metronome
|
||||
|
||||
call Function0x372d8
|
||||
call Function0x34548
|
||||
jr nz, .asm_3742b
|
||||
|
||||
ld a, [$c689]
|
||||
push af
|
||||
call BattleCommand0a
|
||||
pop af
|
||||
ld [$c689], a
|
||||
|
||||
.asm_3742b
|
||||
call Function0x37e36
|
||||
|
||||
.GetMove
|
||||
call BattleRandom
|
||||
|
||||
; No invalid moves.
|
||||
cp NUM_ATTACKS + 1
|
||||
jr nc, .GetMove
|
||||
|
||||
; None of the moves in MetronomeExcepts.
|
||||
push af
|
||||
ld de, 1
|
||||
ld hl, MetronomeExcepts
|
||||
call IsInArray
|
||||
pop bc
|
||||
jr c, .GetMove
|
||||
|
||||
; No moves the user already has.
|
||||
ld a, b
|
||||
call CheckUserMove
|
||||
jr z, .GetMove
|
||||
|
||||
|
||||
ld a, BATTLE_VARS_MOVE
|
||||
call _GetBattleVar
|
||||
ld [hl], b
|
||||
call UpdateMoveData
|
||||
jp ResetTurn
|
||||
; 37454
|
||||
|
||||
|
||||
MetronomeExcepts: ; 37454
|
||||
db NO_MOVE
|
||||
db METRONOME
|
||||
db STRUGGLE
|
||||
db SKETCH
|
||||
db MIMIC
|
||||
db COUNTER
|
||||
db MIRROR_COAT
|
||||
db PROTECT
|
||||
db DETECT
|
||||
db ENDURE
|
||||
db DESTINY_BOND
|
||||
db SLEEP_TALK
|
||||
db THIEF
|
||||
db -1
|
||||
; 37462
|
||||
|
53
battle/effects/mirror_move.asm
Normal file
53
battle/effects/mirror_move.asm
Normal file
@ -0,0 +1,53 @@
|
||||
BattleCommand1b: ; 373c9
|
||||
; mirrormove
|
||||
|
||||
call Function0x372d8
|
||||
|
||||
ld a, BATTLE_VARS_MOVE
|
||||
call _GetBattleVar
|
||||
|
||||
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
||||
call GetBattleVar
|
||||
and a
|
||||
jr z, .failed
|
||||
|
||||
call CheckUserMove
|
||||
jr nz, .use
|
||||
|
||||
.failed
|
||||
call Function0x37e77
|
||||
|
||||
ld hl, MirrorMoveFailedText
|
||||
call StdBattleTextBox
|
||||
jp EndMoveEffect
|
||||
|
||||
.use
|
||||
ld a, b
|
||||
ld [hl], a
|
||||
ld [$d265], a
|
||||
|
||||
push af
|
||||
ld a, BATTLE_VARS_MOVE_ANIM
|
||||
call _GetBattleVar
|
||||
ld d, h
|
||||
ld e, l
|
||||
pop af
|
||||
|
||||
dec a
|
||||
call GetMoveData
|
||||
call GetMoveName
|
||||
call CopyName1
|
||||
call Function0x34548
|
||||
jr nz, .done
|
||||
|
||||
ld a, [$c689]
|
||||
push af
|
||||
call BattleCommand0a
|
||||
pop af
|
||||
ld [$c689], a
|
||||
|
||||
.done
|
||||
call BattleCommandaa
|
||||
jp ResetTurn
|
||||
; 37418
|
||||
|
39
battle/effects/nightmare.asm
Normal file
39
battle/effects/nightmare.asm
Normal file
@ -0,0 +1,39 @@
|
||||
BattleCommand52: ; 37536
|
||||
; nightmare
|
||||
|
||||
; Can't hit an absent opponent.
|
||||
|
||||
call CheckHiddenOpponent
|
||||
jr nz, .failed
|
||||
|
||||
; Can't hit a substitute.
|
||||
|
||||
call CheckSubstituteOpp
|
||||
jr nz, .failed
|
||||
|
||||
; Only works on a sleeping opponent.
|
||||
|
||||
ld a, BATTLE_VARS_STATUS_OPP
|
||||
call _GetBattleVar
|
||||
and SLP
|
||||
jr z, .failed
|
||||
|
||||
; Bail if the opponent is already having a nightmare.
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1_OPP
|
||||
call _GetBattleVar
|
||||
bit SUBSTATUS_NIGHTMARE, [hl]
|
||||
jr nz, .failed
|
||||
|
||||
; Otherwise give the opponent a nightmare.
|
||||
|
||||
set SUBSTATUS_NIGHTMARE, [hl]
|
||||
call Function0x37e01
|
||||
ld hl, StartedNightmareText
|
||||
jp StdBattleTextBox
|
||||
|
||||
.failed
|
||||
call Function0x37e77
|
||||
jp PrintButItFailed
|
||||
; 37563
|
||||
|
41
battle/effects/perish_song.asm
Normal file
41
battle/effects/perish_song.asm
Normal file
@ -0,0 +1,41 @@
|
||||
BattleCommand58: ; 376c2
|
||||
; perishsong
|
||||
|
||||
|
||||
ld hl, PlayerSubStatus1
|
||||
ld de, EnemySubStatus1
|
||||
bit SUBSTATUS_PERISH, [hl]
|
||||
jr z, .ok
|
||||
|
||||
ld a, [de]
|
||||
bit SUBSTATUS_PERISH, a
|
||||
jr nz, .failed
|
||||
|
||||
.ok
|
||||
bit SUBSTATUS_PERISH, [hl]
|
||||
jr nz, .enemy
|
||||
|
||||
set SUBSTATUS_PERISH, [hl]
|
||||
ld a, 4
|
||||
ld [PlayerPerishCount], a
|
||||
|
||||
.enemy
|
||||
ld a, [de]
|
||||
bit SUBSTATUS_PERISH, a
|
||||
jr nz, .done
|
||||
|
||||
set SUBSTATUS_PERISH, a
|
||||
ld [de], a
|
||||
ld a, 4
|
||||
ld [EnemyPerishCount], a
|
||||
|
||||
.done
|
||||
call Function0x37e01
|
||||
ld hl, StartPerishText
|
||||
jp StdBattleTextBox
|
||||
|
||||
.failed
|
||||
call Function0x37e77
|
||||
jp PrintButItFailed
|
||||
; 376f8
|
||||
|
97
battle/effects/rollout.asm
Normal file
97
battle/effects/rollout.asm
Normal file
@ -0,0 +1,97 @@
|
||||
BattleCommand5b: ; 37718
|
||||
; checkcurl
|
||||
|
||||
ld de, PlayerRolloutCount
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_37723
|
||||
ld de, EnemyRolloutCount
|
||||
|
||||
.asm_37723
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call GetBattleVar
|
||||
bit SUBSTATUS_ENCORED, a
|
||||
jr z, .asm_37731
|
||||
|
||||
ld b, $4 ; doturn
|
||||
jp SkipToBattleCommand
|
||||
|
||||
.asm_37731
|
||||
xor a
|
||||
ld [de], a
|
||||
ret
|
||||
; 37734
|
||||
|
||||
|
||||
BattleCommand5c: ; 37734
|
||||
; rolloutpower
|
||||
|
||||
ld a, BATTLE_VARS_STATUS
|
||||
call GetBattleVar
|
||||
and 7
|
||||
ret nz
|
||||
|
||||
ld hl, PlayerRolloutCount
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr z, .asm_37747
|
||||
ld hl, EnemyRolloutCount
|
||||
|
||||
.asm_37747
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr nz, .asm_37750
|
||||
ld a, 1
|
||||
ld [$c73e], a
|
||||
|
||||
.asm_37750
|
||||
ld a, [AttackMissed]
|
||||
and a
|
||||
jr z, .hit
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
res 6, [hl]
|
||||
ret
|
||||
|
||||
.hit
|
||||
inc [hl]
|
||||
ld a, [hl]
|
||||
ld b, a
|
||||
cp $5
|
||||
jr c, .asm_3776e
|
||||
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
res 6, [hl]
|
||||
jr .asm_37775
|
||||
|
||||
.asm_3776e
|
||||
ld a, BATTLE_VARS_SUBSTATUS1
|
||||
call _GetBattleVar
|
||||
set 6, [hl]
|
||||
|
||||
.asm_37775
|
||||
ld a, BATTLE_VARS_SUBSTATUS2
|
||||
call GetBattleVar
|
||||
bit 0, a
|
||||
jr z, .asm_3777f
|
||||
inc b
|
||||
.asm_3777f
|
||||
dec b
|
||||
jr z, .asm_37790
|
||||
|
||||
ld hl, CurDamage + 1
|
||||
sla [hl]
|
||||
dec hl
|
||||
rl [hl]
|
||||
jr nc, .asm_3777f
|
||||
|
||||
ld a, $ff
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
|
||||
.asm_37790
|
||||
ret
|
||||
; 37791
|
||||
|
20
battle/effects/sandstorm.asm
Normal file
20
battle/effects/sandstorm.asm
Normal file
@ -0,0 +1,20 @@
|
||||
BattleCommand59: ; 376f8
|
||||
; startsandstorm
|
||||
|
||||
ld a, [Weather]
|
||||
cp WEATHER_SANDSTORM
|
||||
jr z, .failed
|
||||
|
||||
ld a, WEATHER_SANDSTORM
|
||||
ld [Weather], a
|
||||
ld a, 5
|
||||
ld [WeatherCount], a
|
||||
call Function0x37e01
|
||||
ld hl, SandstormBrewedText
|
||||
jp StdBattleTextBox
|
||||
|
||||
.failed
|
||||
call Function0x37e77
|
||||
jp PrintButItFailed
|
||||
; 37718
|
||||
|
117
battle/effects/thief.asm
Normal file
117
battle/effects/thief.asm
Normal file
@ -0,0 +1,117 @@
|
||||
BattleCommand50: ; 37492
|
||||
; thief
|
||||
|
||||
ld a, [hBattleTurn]
|
||||
and a
|
||||
jr nz, .enemy
|
||||
|
||||
; The player needs to be able to steal an item.
|
||||
|
||||
call .playeritem
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret nz
|
||||
|
||||
; The enemy needs to have an item to steal.
|
||||
|
||||
call .enemyitem
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret z
|
||||
|
||||
; Can't steal mail.
|
||||
|
||||
ld [$d265], a
|
||||
ld d, a
|
||||
callba ItemIsMail
|
||||
ret c
|
||||
|
||||
ld a, [EffectFailed]
|
||||
and a
|
||||
ret nz
|
||||
|
||||
ld a, [InLinkBattle]
|
||||
and a
|
||||
jr z, .stealenemyitem
|
||||
|
||||
ld a, [IsInBattle]
|
||||
dec a
|
||||
ret z
|
||||
|
||||
.stealenemyitem
|
||||
call .enemyitem
|
||||
xor a
|
||||
ld [hl], a
|
||||
ld [de], a
|
||||
|
||||
call .playeritem
|
||||
ld a, [$d265]
|
||||
ld [hl], a
|
||||
ld [de], a
|
||||
jr .stole
|
||||
|
||||
|
||||
.enemy
|
||||
|
||||
; The enemy can't already have an item.
|
||||
|
||||
call .enemyitem
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret nz
|
||||
|
||||
; The player must have an item to steal.
|
||||
|
||||
call .playeritem
|
||||
ld a, [hl]
|
||||
and a
|
||||
ret z
|
||||
|
||||
; Can't steal mail!
|
||||
|
||||
ld [$d265], a
|
||||
ld d, a
|
||||
callba ItemIsMail
|
||||
ret c
|
||||
|
||||
ld a, [EffectFailed]
|
||||
and a
|
||||
ret nz
|
||||
|
||||
; If the enemy steals your item,
|
||||
; it's gone for good if you don't get it back.
|
||||
|
||||
call .playeritem
|
||||
xor a
|
||||
ld [hl], a
|
||||
ld [de], a
|
||||
|
||||
call .enemyitem
|
||||
ld a, [$d265]
|
||||
ld [hl], a
|
||||
ld [de], a
|
||||
|
||||
|
||||
.stole
|
||||
call GetItemName
|
||||
ld hl, StoleText
|
||||
jp StdBattleTextBox
|
||||
|
||||
|
||||
.playeritem
|
||||
ld a, 1
|
||||
call BattlePartyAttr
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld hl, BattleMonItem
|
||||
ret
|
||||
|
||||
.enemyitem
|
||||
ld a, 1
|
||||
call OTPartyAttr
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld hl, EnemyMonItem
|
||||
ret
|
||||
; 37517
|
||||
|
Loading…
x
Reference in New Issue
Block a user