Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Poison animation instead of screen flash

Status
Not open for further replies.
The following code snippet is from game party.

Code:
  #--------------------------------------------------------------------
  # * Slip Damage Check (for map)
  #-----------------------------------------------------------------------
  def check_map_slip_damage
    for actor in @actors
      if actor.hp > 0 and actor.slip_damage?
        actor.hp -= [actor.maxhp / 100, 1].max
        if actor.hp == 0
          $game_system.se_play($data_system.actor_collapse_se)
        end
        $game_screen.start_flash(Color.new(255,0,0,128), 4)
        $game_temp.gameover = $game_party.all_dead?
      end
    end
  end

What do I change/add to make the poison animation show on the player when on the map rather than have the screen flash?
 
Try this
Code:
class Game_Party
attr_accessor :slip_animation

alias old_init initialize
def initialize
  old_init
  self.slip_animation = 1
end

  #--------------------------------------------------------------------
  # * Slip Damage Check (for map)
  #-----------------------------------------------------------------------
  def check_map_slip_damage
    for actor in @actors
      if actor.hp > 0 and actor.slip_damage?
        actor.hp -= [actor.maxhp / 100, 1].max
        if actor.hp == 0
          $game_system.se_play($data_system.actor_collapse_se)
        end
        !self.slip_animation.nil? ? $game_player.animation_id = self.slip_animation : $game_screen.start_flash(Color.new(255,0,0,128), 4)
        $game_temp.gameover = $game_party.all_dead?
      end
    end
  end
  
end

To select the animation to be used, call in a script:
Code:
$game_party.slip_animation = <skill_id_here>
I reccomend to change the number at slip_damage because by default it´s set to show the animation 1. Else, if you don´t want to use animations anymore, just use:
Code:
$game_party.slip_animation = nil
It´ll make it show the old flash effect.
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top