The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: thanatos2k1 on June 23, 2011, 04:53:40 PM

Title: [REQUEST VX] Showing poison damage?
Post by: thanatos2k1 on June 23, 2011, 04:53:40 PM
What bothers me is that I can't see how much damage poison is doing to actors or enemies..  Is there any way to do this?
Title: Re: [REQUEST VX] Showing poison damage?
Post by: Mushu on June 23, 2011, 08:26:06 PM
On map, in battle, or both?
Title: Re: [REQUEST VX] Showing poison damage?
Post by: pacdiggity on June 23, 2011, 08:39:36 PM
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
#  This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :slip_damage_message # message for slip damage
  #--------------------------------------------------------------------------
  # * Application of Slip Damage Effects
  #--------------------------------------------------------------------------
  def slip_damage_effect
    if slip_damage? and @hp > 0
      @hp_damage = apply_variance(maxhp / 20, 10)
      @hp_damage = @hp - 1 if @hp_damage >= @hp
      self.hp -= @hp_damage
      @slip_damage_message = "#{self.name} took #{self.hp_damage}" + " damage due to slip damage!"
    end
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * End Turn
  #--------------------------------------------------------------------------
  def turn_end
    $game_troop.turn_ending = true
    $game_party.slip_damage_effect
    for i in 0...$game_party.members.size
      for state in $game_party.members[i].states
        if state.slip_damage
          unless $game_party.members[i].dead?
            $game_troop.screen.start_shake(5, 5, 10)
            @message_window.replace_instant_text($game_party.members[i].slip_damage_message)
            Sound.play_actor_damage
            wait(90)
          end
        end
      end
    end
    $game_troop.slip_damage_effect
    for i in 0...$game_troop.members.size
      for state in $game_troop.members[i].states
        if state.slip_damage
          unless $game_troop.members[i].dead?
            $game_troop.members[i].blink = true
            @message_window.replace_instant_text($game_troop.members[i].slip_damage_message)
            Sound.play_enemy_damage
            wait(90)
            $game_troop.members[i].slip_damage_message = nil
          end
        end
      end
    end
    $game_party.do_auto_recovery
    $game_troop.preemptive = false
    $game_troop.surprise = false
    process_battle_event
    $game_troop.turn_ending = false
    start_party_command_selection
  end
end

Will show it in battle.
Title: Re: [REQUEST VX] Showing poison damage?
Post by: thanatos2k1 on June 24, 2011, 05:52:52 AM
That's exactly what I needed, it works great. Thank you very much!!
Title: Re: [REQUEST VX] Showing poison damage?
Post by: J. Moreno on June 27, 2011, 09:44:56 AM
Great idea! who made the script? it was you pacman? (i ask because for the credits)
Title: Re: [REQUEST VX] Showing poison damage?
Post by: pacdiggity on June 27, 2011, 09:51:36 AM
No, I wrote a similar script, but it's not as good as Cozziekuns'. Which is the one I posted.

http://rmrk.net/index.php/topic,42968.0.html
Title: Re: [REQUEST VX] Showing poison damage?
Post by: J. Moreno on June 27, 2011, 11:31:19 AM
Okey, thank you very much! oh and just a comment, i realize that the script should be posted above the battle script (i use tankentai) because if not its kinda weird (sorry, my english skills are not good enough to explain D; )