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.

dots

dmdh

Member

hello,

l made states which deal damage each turn or so they are supposed to do.
however, it only works in the first turn the state applied.
it works similar like slip_damage.

scene_battle:
Code:
    if @active_battler.hp > 0 and @active_battler.any_dots?

      # p @active_battler.dots

      for i in @active_battler.dots

      @active_battler.dot_effect(i)

      @active_battler.damage_pop = true

      end

    end
and game_battler:
Code:
class Game_Battler 

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

  DOT_LIST = ["Boneplague"]

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

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

  # * DoT damage

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

  def dot_effect(i)

    # Set damage

    case i

     when "Boneplague"

       self.damage = 200

     else 

       self.damage = 0

     end       

    # Subtract damage from HP

    self.hp -= self.damage

    # End Method

    return true

    end

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

  # * Determine [DoT] States

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

  def any_dots?

    for i in @states

      #p "State: #{@states}"

      #p "$State: #{$data_states[i].name}"

      if DOT_LIST.include?($data_states[i].name) and not @dots.include?($data_states[i].name)

        @dots << $data_states[i].name

       # p "@dots #{@dots}" ; p "#{@states}"

        return true

      end

    end   

    return false

   end 

 

l hope anyone can help me :)
sorry for my bad englsih
 

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