shithub: pokecrystal

ref: 2354c41a96bdf80861338add2f0b3a67b18f160e
dir: /engine/battle/move_effects/thunder.asm/

View raw version
BattleCommand_ThunderAccuracy:
; thunderaccuracy

	ld a, BATTLE_VARS_MOVE_TYPE
	call GetBattleVarAddr
	inc hl
	ld a, [wBattleWeather]
	cp WEATHER_RAIN
	jr z, .rain
	cp WEATHER_SUN
	ret nz
	ld [hl], 50 percent + 1
	ret

.rain
	; Redundant with CheckHit guranteeing hit
	ld [hl], 100 percent
	ret