Original Source
- Original title: How to check for criticals in Yanfly Battle Engine?
- Original author: ZServ
- Original date: January 15, 2017
- Source thread: https://forums.rpgmakerweb.com/threads/how-to-check-for-criticals-in-yanfly-battle-engine.73633/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSSx Script Support
Summary
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
Archived First Post
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.
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadCreator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...