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.

actor element resistance

bukai

Member

I added a window to the status window and failed to display an expression.. depending on the element_set of the actor.
this is how it looks. ->
Code:
class Game_Actor < Game_Battler
# element value
 def ele(element_id)
   value = element_rate(element_id)
   value+= self.class.element_ranks[element_id]
      for armor in armors.compact
      if armor.element_set.include?(element_id)
         armor.element_set.each do |element|
      value+=   element.to_i
      end
      
 end
 end
    for state in states
      if state.element_set.include?(element_id)
   value+= state.element_set.to_i
 end
end
return value
end
end

now i'm displaying it with @actor.ele(9) and ingame will pop up a number.
but i don't know how to display a string depending on the element_set.
e.g.
Element Fire => 100   
now ingame there should be Fire: Normal
when Element Fire => 150
ingame: Fire: Good
when Element Fire =< 75
ingame: Fire: Bad

i hope you get what my problem is...

thanks!
 

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