- Joined
- Jun 16, 2014
- Messages
- 260
- Reaction score
- 71
- Primarily Uses
Hey there! I'm using a version of Yanfly's Battle Engine, with small modifications for my project. Nothing that would change how this in particular would work, anyhow. So, what I'm curious about, is how can I check if a hit is critical? I've used his screen shake snippet for some minor stuff, like this snippet below:
def perform_damage_effect
$game_troop.screen.start_shake(3, 13, 10) if YEA::BATTLE::SCREEN_SHAKE
@sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
Sound.play_enemy_damage
end
But I'd like to potentially spruce up critical hits a bit by making it a more vigorous shake if a critical hit is done. I know that he pushes a critical flag, and I can only assume that's because whether or not a hit is critical is only kept in memory for so long. So, I tried this, to no avail:
def perform_damage_effect
if @flags.include?("critical")
$game_troop.screen.start_shake(3, 5, 200) if YEA::BATTLE::SCREEN_SHAKE
else
$game_troop.screen.start_shake(3, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
@sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
Sound.play_enemy_damage
end
Here is a link To the YBE. Any help would be appreciated, but I'm aware that it's a lengthy script to comb through.
def perform_damage_effect
$game_troop.screen.start_shake(3, 13, 10) if YEA::BATTLE::SCREEN_SHAKE
@sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
Sound.play_enemy_damage
end
But I'd like to potentially spruce up critical hits a bit by making it a more vigorous shake if a critical hit is done. I know that he pushes a critical flag, and I can only assume that's because whether or not a hit is critical is only kept in memory for so long. So, I tried this, to no avail:
def perform_damage_effect
if @flags.include?("critical")
$game_troop.screen.start_shake(3, 5, 200) if YEA::BATTLE::SCREEN_SHAKE
else
$game_troop.screen.start_shake(3, 5, 10) if YEA::BATTLE::SCREEN_SHAKE
@sprite_effect_type = :blink if YEA::BATTLE::BLINK_EFFECTS
Sound.play_enemy_damage
end
Here is a link To the YBE. Any help would be appreciated, but I'm aware that it's a lengthy script to comb through.
