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.

Simple Script Request

guy

Member

I see under the scripts there's one for battles/change max SP.

I want it to work so when I change maximum SP with a custom state in battle, it fills it up the maximum SP it is increased to. If the SP is n/500 for example, and I increase it by 200%, I want it to go, 1000/1000 not n/1000.

I want it to end after the battle. PLEASE PLEASE PLEASE help me with this.
 

guy

Member

I'm not using a script. I was just talking about the default script.

I just want it to fill up the SP when the max SP is increased.

Edit:

This is what's under Game_Battler 1

#--------------------------------------------------------------------------
# * Set Maximum SP
# maxsp : new maximum SP
#--------------------------------------------------------------------------
def maxsp=(maxsp)
@maxsp_plus += maxsp - self.maxsp
@maxsp_plus = [[@maxsp_plus, -9999].max, 9999].min
@sp = [@sp, self.maxsp].min
end
 
Here ya go, this does one of two main functions; when inflicted with a state that increases Max HP/SP then the current HP/SP will be modified to fit the increase. For instance, if Aluxes has 500/1000 HP then inflicted with a state that increases MaxHP by 200% his HP will be 1000/2000.

Also, you'll notice the constants States_FufillMaxHP/SP, put IDs of states that you want to completely fill HP/SP in the array(s). When inflicted with these states, your current HP/SP will fill entirely reguardless of if they increase Max HP/SP.

Code:
#===============================================================================

# ** States : Max HP/SP Refill

#===============================================================================

 

#-------------------------------------------------------------------------------

# * When these states are inflicted, HP is filled to 100% Max HP

#-------------------------------------------------------------------------------

States_FufillMaxHP = []

#-------------------------------------------------------------------------------

# * When these states are inflicted, SP is filled to 100% Max SP

#-------------------------------------------------------------------------------

States_FufillMaxSP = []

 

#===============================================================================

# ** Game_Battler 

#===============================================================================

 

class Game_Battler

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :statesmaxhpsprefill_gmbtlr_addstate, :add_state

  #-----------------------------------------------------------------------------

  # * Add State

  #-----------------------------------------------------------------------------

  def add_state(id)

    pre_hp = self.maxhp

    pre_sp = self.maxsp

    statesmaxhpsprefill_gmbtlr_addstate(id)

    mod_hp = self.maxhp - pre_hp

    mod_sp = self.maxsp - pre_sp

    States_FufillMaxHP.include?(id) ? self.hp = self.maxhp : self.hp += mod_hp

    States_FufillMaxSP.include?(id) ? self.sp = self.maxsp : self.sp += mod_sp

  end

end

 

I didn't test this with states that reduce your max HP/SP but if you have any problems or need any modification don't hesitate to PM me (since I probably won't be watching this topic).

Enjoy :thumb:

Edit : Yes, there is a problem with states that reduce Max HP/SP that cause a Stack Level Too Deep but it always pops up in a weird spot in the MACL so I'm not sure if its going to affect you. I'll fix it up later tonight but there it is for now.
 

guy

Member

Ok thanks a million, but I don't understand how I implement this... I paste it in a new script block and it just works automatically? I want it to just fill up the SP to the increased MAXSP regardless of what the SP was before.

I'm new to scripting and I'm really confused by what you wrote.

Edit:

Do I simply place the state name within these brackets?

States_FufillMaxSP = []

Like: States_FufillMaxSP = ["doubledspstatename"]
 
Actually you don't really have to do anything with the script, it does it automatically whenever a state that increases Max HP/SP is inflicted. Say you have a state with MaxHP + 200% it'll adjust your current HP accordingly. So 500/1000 HP => 1000/2000 HP.

I can edit the script to read either the states name or ID but for now its just the ID. I made a state called Bubble (id # 17), which increases HP 200% so I want it to fully fill the HP not just modify it I just put its ID in the array (brackets)

States_FufillMaxHP = [17]

If you want I'll make it so you can put either the ID or the name of the state in the array and it'll work. I still need to fix the silly Stack Level Too Deep I'm getting when I try to apply a state that reduces MaxHP/SP so I'll be back tomorrow hopefully with an update for ya ;)
 

guy

Member

Ok thanks again, that all makes sense. So if my SP increasing state is #17 on the state database (and I want it to work like 500/1000 SP => 2000/2000 SP) I just put "17" in there like this:

States_FufillMaxSP = [17]

What if I want to do it with two states? Would it go like this?

States_FufillMaxSP = [17, 18]

Also, I don't really have a use for the *decreasing* MAXHP/SP states, so I'm not really worried about the bug at this point. Semi-related: I would like to make skill attacks that damage SP instead of HP (like the monsters who drain your magic in Final Fantasy) incase you know how to do that....
 
I re-wrote the script, setup is a little bit different as it uses hashes instead of arrays. Its up to you if you want to use the first or the second version, whatever you feel more comfortable with but let me post the new version for you real quick...

Code:
#===============================================================================

# ** States : Max HP/SP Refill

#-------------------------------------------------------------------------------

# Written by  : Kain Nobel

# Version     : 2.0

# Last Update : 04.01.2009

#===============================================================================

 

#-------------------------------------------------------------------------------

# * SDK Log

#-------------------------------------------------------------------------------

if Object.const_defined?(:SDK)

  SDK.log("States.MaxHP/SPRefill", "Kain Nobel", 2.0, "04.01.2009")

end

 

#===============================================================================

# * RPG::State::FillRate

#===============================================================================

 

module RPG::State::FillRate

  #-----------------------------------------------------------------------------

  # * The Direct HP filled when this state is inflicted.

  #-----------------------------------------------------------------------------

  HP_Direct  = {}

  #-----------------------------------------------------------------------------

  # * The Percent HP filled when this state is inflicted.

  #-----------------------------------------------------------------------------

  HP_Percent = {}

  #-----------------------------------------------------------------------------

  # * The Direct SP filled when this state is inflicted.

  #-----------------------------------------------------------------------------

  SP_Direct  = {}

  #-----------------------------------------------------------------------------

  # * The Percent SP filled when this state is inflicted.

  #-----------------------------------------------------------------------------

  SP_Percent = {}

  #-----------------------------------------------------------------------------

  # * Default Settings (DON'T TOUCH : Will affect all states not defined.)

  #-----------------------------------------------------------------------------

  HP_Direct.default  = 0

  HP_Percent.default = 0

  SP_Direct.default  = 0

  SP_Percent.default = 0

end

 

#===============================================================================

# ** RPG::State

#===============================================================================

 

class RPG::State

  #-----------------------------------------------------------------------------

  # * MaxHP Rate Fill

  #-----------------------------------------------------------------------------

  def hp_fill_rate(old, new)

    new -= old

    new *= FillRate::HP_Percent[@id] / 100.0

    new += FillRate::HP_Direct[@id]

    return Integer(new)

  end

  #-----------------------------------------------------------------------------

  # * MaxSP Rate Fill

  #-----------------------------------------------------------------------------

  def sp_fill_rate(old, new)

    new -= old

    new *= FillRate::SP_Percent[@id] / 100.0

    new += FillRate::SP_Direct[@id]

    return Integer(new)

  end

end

 

#===============================================================================

# ** Game_Battler 

#===============================================================================

 

class Game_Battler

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :statesmaxhpsprefill_gmbtlr_addstate, :add_state

  #-----------------------------------------------------------------------------

  # * Add State

  #-----------------------------------------------------------------------------

  def add_state(id)

    if self.states.include?(id)

      statesmaxhpsprefill_gmbtlr_addstate(id)

      return

    end

    old_maxhp, old_maxsp = self.maxhp, self.maxsp

    statesmaxhpsprefill_gmbtlr_addstate(id)

    new_maxhp, new_maxsp = self.maxhp, self.maxsp

    unless self.hp.zero?

      self.hp += $data_states[id].hp_fill_rate(old_maxhp, new_maxhp)

    end

    self.sp += $data_states[id].sp_fill_rate(old_maxsp, new_maxsp)

  end

end

 

Incase you're unfamiliar with using hashes, I'll give you some quick instructions for the new version. You still setup your States in the database the normal way you always do, but in the script you'll be setting the Direct and/or Percent of how much HP/SP is filled when a certain state is inflicted.

Lets say you want his HP to fill all the way when he is inflicted with "Bubble", you'd just simply do...

Code:
HP_Direct = {17 => 9999}

...meaning whenever he gets "Bubble" state added, his HP will be maxed out directly.

Another example of setup I'll show you... Aluxes HP and MaxHP are 500/1000 and "Bubble" increases MaxHP by 200% (doubles MaxHP in other words)

Code:
HP_Direct = {17 => 10}

HP_Percent = {17 => 100}

That means that when Aluxes gets inflicted with "Bubble", his HP will go from 500/1000 to 1510/2000 because we've had a Direct modifier, then a Percentage added to it.

And you can setup multiple states with the hash settings almost as easy as you did with an array, just be sure to not forget your commas between keys => values. Remember, your FIRST value is always the state's ID and the SECOND value is the ammount of HP/SP you want to fill when it is inflicted.

Code:
HP_Direct = {17 => 25, 18 => 50, 19 => 75, 20 => 100}

Enjoy :thumb:

PS: If I find some time I'll go ahead and do that second request for you. I need something like that in my script library anyways so I'll do that next.
 

guy

Member

Awesome. I comprehend all that. Could this script be used to, say, create a spell that *lowers* somebody to 1hp?

Like it could be an invisible (Rating 0) state that lasts one turn and hmm... well maybe you could lower HP by 99% at least... Basically I'm asking, do negative numbers work with this?

Also if it's Rating 0 does would the state still take affect if there was another state (w/ a rating greater than 0) in place? It would right?
 
I donno, you can run your own tests and see what happens, you can PM me any results or bugs if you'd like/need.

I've finished another small request you made, I thought it was going to be simple but as you can see it took alot of mashing and testing to perfect this one, nevertheless I enjoyed every minute of it. Again, it has alot of flexible and easy-to-understand settings, PM me if you have any questions or bugs to report, or if you want anything else done to this script. I'll be doing another one similiar to this for weapons later.

Code:
#===============================================================================

# ** Skills : Drain/Osmosis

#===============================================================================

 

#-------------------------------------------------------------------------------

# * SDK Log

#-------------------------------------------------------------------------------

SDK.log('Skills.Drain/Osmosis', 'Kain Nobel', 2.0, '04.01.2009')

SDK.check_requirements(2.4, [1, 2])

#-------------------------------------------------------------------------------

# * SDK Enabled Test : Begin

#-------------------------------------------------------------------------------

if SDK.enabled?('Skills.Drain/Osmosis')

  

#===============================================================================

# ** RPG::Skill

#===============================================================================

 

class RPG::Skill

  #=============================================================================

  # ** RPG::Skill::Drain

  #=============================================================================

  module Drain

    #---------------------------------------------------------------------------

    # * HP Drain Element Tag ID (set inside Database/System tab).

    #---------------------------------------------------------------------------

    HP_Element_Tag = nil

    #---------------------------------------------------------------------------

    # * SP Drain Element Tag ID (set inside Database/System tab).

    #---------------------------------------------------------------------------

    SP_Element_Tag = nil

    #---------------------------------------------------------------------------

    # * Font Name for Drain Damage String.

    #---------------------------------------------------------------------------

    DamageFontName = "Arial Black"

    #---------------------------------------------------------------------------

    # * Font Size for Drain Damage String.

    #---------------------------------------------------------------------------

    DamageFontSize = 28

    #---------------------------------------------------------------------------

    # * Damage font for drain damage is bolded?

    #---------------------------------------------------------------------------

    DamageFontBold = false

    #---------------------------------------------------------------------------

    # * Damage font for drain damage is italicized?

    #---------------------------------------------------------------------------

    DamageFontItal = false

    #---------------------------------------------------------------------------

    # * Color for text outline displaying HP drain value.

    #---------------------------------------------------------------------------

    HP_ColorBack = Color.new(0, 160, 0)

    #---------------------------------------------------------------------------

    # * Color for main text color displaying HP drain value.

    #---------------------------------------------------------------------------

    HP_ColorMain = Color.new(0, 255, 0)

    #---------------------------------------------------------------------------

    # * Color for text outline displaying SP drain value.

    #---------------------------------------------------------------------------

    SP_ColorBack = Color.new(160, 0, 160)

    #---------------------------------------------------------------------------

    # * Color for main text color displaying SP drain value.

    #---------------------------------------------------------------------------

    SP_ColorMain = Color.new(255, 0, 255)

    #---------------------------------------------------------------------------

    # * Reformat the Damage String for draining HP    (ie "HP +[x]") [x] = value

    #---------------------------------------------------------------------------

    HP_DamageFormat = "HP +[x]"

    #---------------------------------------------------------------------------

    # * Reformat the Damage String for draining SP    (ie "HP +[x]") [x] = value

    #---------------------------------------------------------------------------

    SP_DamageFormat = "SP +[x]"

    #---------------------------------------------------------------------------

    # * Animation played to the reciever of drained HP/SP.      (skill_id => n)

    #---------------------------------------------------------------------------

    Animation   = {7 => 15}

    #---------------------------------------------------------------------------

    # * The percent to drain from damage inflicted on HP.       (skill_id => n)

    #---------------------------------------------------------------------------

    HP_Percent  = {7 => 100, 9 => 100}

    #---------------------------------------------------------------------------

    # * A direct value to drain from damage inflicted on HP.    (skill_id => n)

    #---------------------------------------------------------------------------

    HP_Direct   = {}

    #---------------------------------------------------------------------------

    # * Allowed variance to +/- from sub total HP drained.      (skill_id => n)

    #---------------------------------------------------------------------------

    HP_Variance = {}

    #---------------------------------------------------------------------------

    # * The percent to drain from damage inflicted on SP.       (skill_id => n)

    #---------------------------------------------------------------------------

    SP_Percent   = {}

    #---------------------------------------------------------------------------

    # * A direct value to drain from damage inflicted on SP.    (skill_id => n)

    #---------------------------------------------------------------------------

    SP_Direct    = {}

    #---------------------------------------------------------------------------

    # * Allowed variance to +/- from sub total SP drained.      (skill_id => n)

    #---------------------------------------------------------------------------

    SP_Variance = {}

    #---------------------------------------------------------------------------

    # * Critical Flag to be set when draining (this is an scripter thing...)

    #---------------------------------------------------------------------------

    Critical_Flag = "Drain/Osmosis"

    #---------------------------------------------------------------------------

    # * Default Settings (You might not want to modify these...)

    #---------------------------------------------------------------------------

    Animation.default   = 0

    HP_Percent.default  = 0

    HP_Direct.default   = 0

    HP_Variance.default = 0

    SP_Percent.default  = 0

    SP_Direct.default   = 0

    SP_Variance.default = 0

  end

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :drainskill_rpgskill_initialize, :initialize

  #-----------------------------------------------------------------------------

  # * Object Initialization

  #-----------------------------------------------------------------------------

  def initialize

    drainskill_rpgskill_initialize

    if self.drain_hp? && !@element_set.include?(Drain::HP_Element_Tag)

      unless Drain::HP_Element_Tag.nil?

        @element_set << Drain::HP_Element_Tag

      end

    end

    if self.drain_sp? && !@element_set.include?(Drain::SP_Element_Tag)

      unless Drain::SP_Element_Tag.nil?

        @element_set << Drain::SP_Element_Tag

      end

    end

  end

  #-----------------------------------------------------------------------------

  # * Drain Animation

  #-----------------------------------------------------------------------------

  def drain_animation

    return Drain::Animation[@id]

  end

  #-----------------------------------------------------------------------------

  # * HP Drain Percent

  #-----------------------------------------------------------------------------

  def hp_drain_percent

    return Drain::HP_Percent[@id]

  end

  #-----------------------------------------------------------------------------

  # * HP Drain Direct

  #-----------------------------------------------------------------------------

  def hp_drain_direct

    return Drain::HP_Direct[@id]

  end

  #-----------------------------------------------------------------------------

  # * HP Drain Variance

  #-----------------------------------------------------------------------------

  def hp_drain_variance

    return Drain::HP_Variance[@id]

  end

  #-----------------------------------------------------------------------------

  # * SP Drain Percent

  #-----------------------------------------------------------------------------

  def sp_drain_percent

    return Drain::SP_Percent[@id]

  end

  #-----------------------------------------------------------------------------

  # * SP Drain Direct

  #-----------------------------------------------------------------------------

  def sp_drain_direct

    return Drain::SP_Direct[@id]

  end

  #-----------------------------------------------------------------------------

  # * SP Drain Variance

  #-----------------------------------------------------------------------------

  def sp_drain_variance

    return Drain::SP_Variance[@id]

  end

  #-----------------------------------------------------------------------------

  # * HP Drain

  #-----------------------------------------------------------------------------

  def hp_drain(value)

    unless hp_drain_percent.zero?

      value *= hp_drain_percent / 100.0

    end

    value += hp_drain_direct

    value += rand(2).zero? ? -hp_drain_variance : hp_drain_variance

    return Integer(value)

  end

  #-----------------------------------------------------------------------------

  # * SP Drain

  #-----------------------------------------------------------------------------

  def sp_drain(value)

    unless sp_drain_percent.zero?

      value *= sp_drain_percent / 100.0

    end

    value += sp_drain_direct

    value += rand(2).zero? ? -sp_drain_variance : sp_drain_variance

    return Integer(value)

  end

  #-----------------------------------------------------------------------------

  # * Drain?

  #-----------------------------------------------------------------------------

  def drain?

    return (hp_drain? || sp_drain?)

  end

  #-----------------------------------------------------------------------------

  # * HP Drain?

  #-----------------------------------------------------------------------------

  def hp_drain?

    return (!hp_drain_percent.zero? || !hp_drain_direct.zero?)

  end

  #-----------------------------------------------------------------------------

  # * SP Drain?

  #-----------------------------------------------------------------------------

  def sp_drain?

    return (!sp_drain_percent.zero? || !sp_drain_direct.zero?)

  end

end

 

#===============================================================================

# ** Game_BattleAction

#===============================================================================

 

class Game_BattleAction

  #-----------------------------------------------------------------------------

  # * Public Instance Variables

  #-----------------------------------------------------------------------------

  attr_accessor :drain_hp

  attr_accessor :drain_sp

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :drainskill_gmbtlact_clear, :clear

  #-----------------------------------------------------------------------------

  # * Clear

  #-----------------------------------------------------------------------------

  def clear

    drainskill_gmbtlact_clear

    @drain_hp = 0

    @drain_sp = 0

  end

end

 

#===============================================================================

# ** Game_Battler

#===============================================================================

 

class Game_Battler

  #-----------------------------------------------------------------------------

  # * Public Instance Variables

  #-----------------------------------------------------------------------------

  attr_accessor :drain_animation

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :drainskill_gmbtlr_skilleffect, :skill_effect

  #-----------------------------------------------------------------------------

  # * Skill Effect

  #-----------------------------------------------------------------------------

  def skill_effect(user, skill)

    unless skill.drain?

      return drainskill_gmbtlr_skilleffect(user, skill)

    end

    old_hp, old_sp = self.hp, self.sp

    effective = drainskill_gmbtlr_skilleffect(user, skill)

    last_damage = self.damage

    self.damage = 0

    self.critical = [RPG::Skill::Drain::Critical_Flag, self.critical]

    hit, hit_result = skill_effect_first_hit_result(user, skill)

    effective = skill_effect_effective_correction(effective, hit)

    if hit_result

      power = skill_effect_power(user, skill)

      rate = skill_effect_rate(user, skill)

      skill_effect_base_damage(power, rate)

      skill_effect_element_correction(skill)

      if self.damage > 0

        skill_effect_guard_correction

      end

      skill_effect_disperation(skill)

      hit, hit_result = skill_effect_second_hit_result(user, skill)

      effective = skill_effect_effective_correction(effective, hit)

    end

    if hit_result

      effective = true if skill_effect_physical_hit_result(skill)

      last_sp = self.sp

      self.sp -= self.damage

      effective = self.sp != last_sp

      @state_changed = false

      effective |= states_plus(skill.plus_state_set)

      effective |= states_minus(skill.minus_state_set)

      skill_effect_power0(skill)

    else

      skill_effect_miss

    end

    skill_effect_damagefix

    hp_drain = skill.hp_drain(old_hp - self.hp)

    sp_drain = skill.sp_drain(old_sp - self.sp)

    user.hp += hp_drain

    user.sp += sp_drain

    self.damage   = last_damage

    user.critical = RPG::Skill::Drain::Critical_Flag

    user.current_action.drain_hp ||= 0

    user.current_action.drain_sp ||= 0

    user.current_action.drain_hp += hp_drain

    user.current_action.drain_sp += sp_drain

    user.damage = Array.new

    user.damage << user.current_action.drain_hp

    user.damage << user.current_action.drain_sp

    unless skill.drain_animation.zero? || skill.drain_animation.nil?

      user.drain_animation = skill.drain_animation

    end

    return effective

  end

end

 

#===============================================================================

# ** Scene_Battle

#===============================================================================

 

class Scene_Battle < SDK::Scene_Base

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :drainskill_scnbtl_updatep4s6,       :update_phase4_step6

  #-----------------------------------------------------------------------------

  # * Update Phase 4 : Step 6

  #-----------------------------------------------------------------------------

  def update_phase4_step6

    draining_battlers.each do |battler|

      battler.damage_pop = true

      unless battler.drain_animation == 0 || battler.drain_animation.nil?

        battler.animation_id = battler.drain_animation

        battler.animation_hit = true

        battler.drain_animation = nil

      end

    end

    drainskill_scnbtl_updatep4s6

  end

  #-----------------------------------------------------------------------------

  # * Draining Battlers

  #-----------------------------------------------------------------------------

  def draining_battlers

    battlers = Array.new

    $game_party.actors.each do |actor|

      if actor.current_action.drain_hp || actor.current_action.drain_sp

        battlers << actor

      end

    end

    $game_troop.enemies.each do |enemy|

      if enemy.current_action.drain_hp || enemy.current_action.drain_sp

        battlers << enemy

      end

    end

    battlers.each {|battler|

      battler.current_action.drain_hp = nil

      battler.current_action.drain_sp = nil

    }

    return battlers

  end

end

 

#===============================================================================

# ** RPG::Sprite

#===============================================================================

 

class RPG::Sprite < ::Sprite

  #-----------------------------------------------------------------------------

  # * Alias Listings

  #-----------------------------------------------------------------------------

  alias_method :drainskill_RPGsprite_damage, :damage

  #-----------------------------------------------------------------------------

  # * Damage

  #-----------------------------------------------------------------------------

  def damage(value, critical)

    unless value.is_a?(Array) || critical == RPG::Skill::Drain::Critical_Flag

      drainskill_RPGsprite_damage(value, critical)

      return

    end

    dispose_damage

    hp_drain = RPG::Skill::Drain::HP_DamageFormat.dup

    hp_drain.gsub!("[x]", "#{value[0]}")

    hp_drain.gsub!("+", "-") if value[0] < 0

    sp_drain = RPG::Skill::Drain::SP_DamageFormat.dup

    sp_drain.gsub!("[x]", "#{value[1]}")

    sp_drain.gsub!("+", "-") if value[1] < 0

    bitmap = Bitmap.new(160, 8 + (RPG::Skill::Drain::DamageFontSize * 2))

    bitmap.font.name    = RPG::Skill::Drain::DamageFontName

    bitmap.font.size    = RPG::Skill::Drain::DamageFontSize

    bitmap.font.bold    = RPG::Skill::Drain::DamageFontBold

    bitmap.font.italic  = RPG::Skill::Drain::DamageFontItal

    bitmap.font.color = RPG::Skill::Drain::HP_ColorBack

    bitmap.draw_text(-1, 12-1, 160, 40, hp_drain, 1)

    bitmap.draw_text(+1, 12-1, 160, 40, hp_drain, 1)

    bitmap.draw_text(-1, 12+1, 160, 40, hp_drain, 1)

    bitmap.draw_text(+1, 12+1, 160, 40, hp_drain, 1)

    bitmap.font.color = RPG::Skill::Drain::HP_ColorMain

    bitmap.draw_text(0, 12, 160, 40, hp_drain, 1)

    bitmap.font.color = RPG::Skill::Drain::SP_ColorBack

    y = bitmap.font.size + 2

    bitmap.draw_text(-1, y-1, 160, 40, sp_drain, 1)

    bitmap.draw_text(+1, y-1, 160, 40, sp_drain, 1)

    bitmap.draw_text(-1, y+1, 160, 40, sp_drain, 1)

    bitmap.draw_text(+1, y+1, 160, 40, sp_drain, 1)

    bitmap.font.color = RPG::Skill::Drain::SP_ColorMain

    bitmap.draw_text(0, y, 160, 40, sp_drain, 1)

    @_damage_sprite = ::Sprite.new(self.viewport)

    @_damage_sprite.bitmap = bitmap

    @_damage_sprite.ox = 80

    @_damage_sprite.oy = 20

    @_damage_sprite.x = self.x

    @_damage_sprite.y = self.y - self.oy / 2

    @_damage_sprite.z = 3000

    @_damage_duration = 40

  end

end

 

#-------------------------------------------------------------------------------

# * SDK Enabled Test : End

#-------------------------------------------------------------------------------

end

Enjoy :thumb:

PS: This was coded on SDK 2.4 Parts 1 and 2 but I can non-SDK this one easily if you need.
 

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