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.

Element Mastery system

Here what i need,

You have the Element Fire, Water, Wind and Earth and they all start at lvl 1. At the end of each battle, you gain Element XP (1, 2 or maybe 3). When it reach 100 or maybe 200 (or higher), you gain an Element Lvl-up. When this happen, you have one point to place from one of the element available.

When a certain element reach a certain lvl, you gain a spell of that element. Let say the maximum lvl is 50.
I want it so that we can add or remove elements.

If needed of more info, i can try to put more.
Thank you in advance.
 

Anonymous

Guest

But it would be better if when the element that levels up icreases the resistance of that element from enemies that use that type too
 
Increase Various attributes to the element such as Str and Def, Make is so that You cannot raise the opposite element (Fire can be maxed but Ice takes a toll such as lowering the resistance, Elemental Fusion where two elements can create a new technique by fusing the elements at a certain lvl... this is all I can think of atm
 
Those are great ideas. I have some things to add. I always do.

Ideas:
1.Element points are affected by your equipment in battle and the skills you use.

Ex. You have an armor equipped that has fire resistance. At the end of battle you would gain 1 Fire point for having it equipped, but for every 2 points of fire earned, you would lose 1 ice point and if you have 0, it would go to -1 ice points, lowering the resistance to ice.

Ex. You have a weapon with fire as an element. You would gain 1 Fire point for having this equipped, and with the fire resistance armor equipped, you would gain 2 fire points at the end of battle.

Ex. You have a fire skill. If you use that skill a certain amount of times, you will gain 1 Fire point to add at the end of battle.

2.For every two points(or whatever amount) you earn, you are increasing the skill's power by 1 for every two points earned for 1 element, the opposite element's skill power will decrease by 1.

3.Each element has a curve for its points to level up just like exp with characters, except the numbers will not increase as much.

Ex. It takes 20 points of Fire to increase its first level by 1.
It takes 30 more points of Fire to increase it to its next level.

For every level, you learn a new skill to that element.

4.If Two elements have reached a certain level, new skills with both types will be learned, raising points in both element types.
 
Ideas:
1.Element points are affected by your equipment in battle and the skills you use.

Ex. You have an armor equipped that has fire resistance. At the end of battle you would gain 1 Fire point for having it equipped, but for every 2 points of fire earned, you would lose 1 ice point and if you have 0, it would go to -1 ice points, lowering the resistance to ice.

Ex. You have a weapon with fire as an element. You would gain 1 Fire point for having this equipped, and with the fire resistance armor equipped, you would gain 2 fire points at the end of battle.

Ex. You have a fire skill. If you use that skill a certain amount of times, you will gain 1 Fire point to add at the end of battle.

2.For every two points(or whatever amount) you earn, you are increasing the skill's power by 1 for every two points earned for 1 element, the opposite element's skill power will decrease by 1.

3.Each element has a curve for its points to level up just like exp with characters, except the numbers will not increase as much.

Ex. It takes 20 points of Fire to increase its first level by 1.
It takes 30 more points of Fire to increase it to its next level.

For every level, you learn a new skill to that element.

4.If Two elements have reached a certain level, new skills with both types will be learned, raising points in both element types.
Increase Various attributes to the element such as Str and Def, Make is so that You cannot raise the opposite element (Fire can be maxed but Ice takes a toll such as lowering the resistance, Elemental Fusion where two elements can create a new technique by fusing the elements at a certain lvl... this is all I can think of atm

These are all good ideas, but if i can get my way of using this system, i dont mine the rest. :D

Which is:
After each battle, you gain Element XP (EX: 1xp for each monster). When it reach 100, you gain 1 point and the XP is reset to 0. The point can now be put in one of the element possible (Fire, Water, Wind or Earth (more if can be customize)). When a element reach a certain lvl, the actor gain a skill from that element.

If i can get this, i dont mind about the rest :D

Edit: If you ever played Quest 64, you'll know what im talking about. :P
 
I'm working on it (just the one for Earthor) how many points (which you killed 100 enemies for) to a level? I need a maximum level aswell.
Also do you want to be able to set differant amounts of elemental xp for each enemy (won't take long I have my old ap system which I can use)?
 

Kest

Member

Fomar0153":1ssq9xku said:
I'm working on it (just the one for Earthor) how many points (which you killed 100 enemies for) to a level? I need a maximum level aswell.
Just set it as something temporary users can change to what they want later?
 
How's this?
Code:
class Game_Actor < Game_Battler
  
  attr_accessor :elem_xp
  attr_accessor :elem_points
  attr_accessor :elem_fire
  attr_accessor :elem_water
  attr_accessor :elem_wind
  attr_accessor :elem_earth
  
  
  alias old_setup setup
  def setup(actor_id)
    old_setup(actor_id)
    @elem_xp = 0
    @elem_points = 0
    @elem_fire = 0
    @elem_water = 0
    @elem_wind = 0
    @elem_earth = 0
  end
  
end




class Scene_Battle
  
  alias old_start_phase5 start_phase5
  def start_phase5
    old_start_phase5
    elem_xp = 0
    for enemy in $game_troop.enemies
      unless enemy.hidden
        elem_xp += 1
      end
    end
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        actor.elem_xp += elem_xp
        if actor.elem_xp >= 100
          actor.elem_points += 1
          actor.elem_xp -= 100
          actor.damage = 'Element Point Gained'
          actor.damage_pop = true
        end
      end
    end
  end
end

class Window_Elem_Levels < Window_Base
  
  def initialize(actor_pos)
    super(0, 64, 640, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor_pos = actor_pos
    @actor = $game_party.actors[actor_pos]
    @window_elem_levels_adjust = Window_Elem_Levels_Adjust.new(actor_pos)
    @window_elem_levels_adjust.active = true
    @window_elem_levels_adjust.opacity = 0
    refresh
  end
  
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(0, 0, 640, 32, "Please edit your mastery of elements here:")
    self.contents.draw_text(0, 32, 90, 32, "You have ")
    self.contents.draw_text(90, 32, 40, 32,@actor.elem_points.to_s)
    self.contents.draw_text(130, 32, 300, 32, "elemental points to distribute.")
    self.contents.draw_text(0, 64, 90, 32, "You have ")
    x = @actor.elem_points
    x -= (@actor.elem_fire + @actor.elem_water + @actor.elem_wind + @actor.elem_earth)
    self.contents.draw_text(90, 64, 40, 32, x.to_s)
    self.contents.draw_text(130, 64, 400, 32, "elemental points remaining to distribute.")
    x = 100 - @actor.elem_xp
    x = x.to_s
    x = x + ' elemental experience to next element point'
    self.contents.draw_text(200, 106, 440, 32, x)
    
    for i in 0...4
      string = ''
      case i
      when 0
        string = string + @actor.elem_fire.to_s
      when 1
        string = string + @actor.elem_water.to_s
      when 2
        string = string + @actor.elem_wind.to_s
      when 3
        string = string + @actor.elem_earth.to_s
      end
      string = string + '/50'
      self.contents.draw_text(120, (106 + 32 * i) , 150, 32, string)
    end
  end
  
  def update
    super
    @window_elem_levels_adjust.update
    
  end
  
  def help_window_text
    return @window_elem_levels_adjust.help_window_text
  end
  
  def index
    return @window_elem_levels_adjust.index
  end
  
  def dispose
    @window_elem_levels_adjust.dispose
    super
  end
  
end


class Window_Elem_Levels_Adjust < Window_Selectable
  
  def initialize(actor_pos)
    super(15, 170, 100, 314)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor_pos = actor_pos
    @actor = $game_party.actors[actor_pos]
    @item_max = 5
    @column_max = 1
    @commands = ['Fire', 'Water', 'Wind', 'Earth', 'Exit']
    @index = 0
    for i in 0...5
      rect = Rect.new(4, 32 * i, self.contents.width - 8, 32)
      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
      self.contents.draw_text(rect, @commands[i])
    end
  end
  
  def help_window_text
    case @index
    when 0
      return 'Press Left/Right to fine tune your mastery of Fire'
    when 1
      return 'Press Left/Right to fine tune your mastery of Water'
    when 2
      return 'Press Left/Right to fine tune your mastery of Wind'
    when 3
      return 'Press Left/Right to fine tune your mastery of Earth'
    when 4
      return 'Exit'
    end
  
  end
end


class Scene_Elem_Levels
  
  def initialize(actor_index = 0)
    @actor_index = actor_index
  end
  
  def main
    # Get actor
    @actor = $game_party.actors[@actor_index]
    @help_window = Window_Help.new
    @elem_window = Window_Elem_Levels.new(@actor_index)
    
    Graphics.transition
    
    loop do
      
      Graphics.update
      
      Input.update
      
      update
      
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @elem_window.dispose
  end
  
  def update
    @elem_window.update
    @help_window.set_text(@elem_window.help_window_text)
    
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      exit_element_mastery
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      if @elem_window.index == 4
        # Switch to map screen
        exit_element_mastery
        return
      end
    end
    
    if Input.trigger?(Input::LEFT)
      case @elem_window.index
      when 0
        @actor.elem_fire -= 1
        if @actor.elem_fire < 0
          @actor.elem_fire = 0
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      when 1
        @actor.elem_water -= 1
        if @actor.elem_water < 0
          @actor.elem_water = 0
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      when 2
        @actor.elem_wind -= 1
        if @actor.elem_wind < 0
          @actor.elem_wind = 0
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      when 3
        @actor.elem_earth -= 1
        if @actor.elem_earth < 0
          @actor.elem_earth = 0
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      end
      
        @elem_window.refresh
    end
    
    if Input.trigger?(Input::RIGHT)
      
      if @actor.elem_points > (@actor.elem_fire + @actor.elem_water + 
         @actor.elem_wind + @actor.elem_earth)
         
      case @elem_window.index
      when 0
        @actor.elem_fire += 1
        if @actor.elem_fire > 50
          @actor.elem_fire = 50
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      when 1
        @actor.elem_water += 1
        if @actor.elem_water > 50
          @actor.elem_water = 50
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      when 2
        @actor.elem_wind += 1
        if @actor.elem_wind > 50
          @actor.elem_wind = 50
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      when 3
        @actor.elem_earth += 1
        if @actor.elem_earth > 50
          @actor.elem_earth = 50
          $game_system.se_play($data_system.buzzer_se)
        else
          $game_system.se_play($data_system.decision_se)
        end
      end
         
        @elem_window.refresh
         
         
       else
         $game_system.se_play($data_system.buzzer_se)
         return
       end
     end
     
    # If R button was pressed
    if Input.trigger?(Input::R)
      exit_element_mastery(false)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different status screen
      $scene = Scene_Elem_Levels.new(@actor_index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      exit_element_mastery(false)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different status screen
      $scene = Scene_Elem_Levels.new(@actor_index)
      return
    end
     
     
  end
  
    def exit_element_mastery(exit = true)
      for i in 0...4
      x = []
      for j in 0...50
        x.push(0)
      end
      
      case i
      when 0 # Fire
        mastery = @actor.elem_fire
        x[0] = 7 # Means 1 point in fire mastery lets you learn fire
        x[20] = 8 # Means 21 point in fire mastery lets you learn greater fire
        x[49] = 9 # Means 50 point in fire mastery lets you learn mass fire
      when 1 # Water
        mastery = @actor.elem_water
        x[0] = 16
        x[14] = 17
        x[29] = 18
      when 2 # Wind
        mastery = @actor.elem_wind
        x[0] = 22
        x[14] = 23
        x[29] = 24
      when 3 # Earth
        mastery = @actor.elem_earth
        x[0] = 19
        x[14] = 20
        x[29] = 21
      end
      
      if mastery > 0
      for k in 0...mastery
        @actor.learn_skill(x[k])
      end
      end
      
      if mastery < 50
      for k in mastery...50
        @actor.forget_skill(x[k])
      end
      end
      
      
      end
    
      if exit == true
      $scene = Scene_Menu.new
      end
    end
    
end

Just starting
http://i4.photobucket.com/albums/y139/F ... ster01.png[/IMG]

Lot's of battlers (99 enemies) later
http://i4.photobucket.com/albums/y139/F ... ster02.png[/IMG]

Another battle (2 enemies) later
http://i4.photobucket.com/albums/y139/F ... ster03.png[/IMG]

And now a calculation
50 * 4 * 100 = 20000 enemies before elemental experience becomes useless.

To call it use:
$scene = Scene_Elem_Levels.new

and you can put the actor's position in the party in brackets for default it is the first person in the party.

I assumed you have a cms, so I didn't write a mod for the dms, if you want one just ask.
 
Oh I forgot to mention how to set spells to learn.
In the bottom bit:
def exit_element_mastery(exit = true)
for i in 0...4
x = []
for j in 0...50
x.push(0)
end

case i
when 0 # Fire
mastery = @actor.elem_fire
x[0] = 7 # Means 1 point in fire mastery lets you learn fire
x[20] = 8 # Means 21 point in fire mastery lets you learn greater fire
x[49] = 9 # Means 50 point in fire mastery lets you learn mass fire
when 1 # Water
mastery = @actor.elem_water
x[0] = 16
x[14] = 17
x[29] = 18
when 2 # Wind
mastery = @actor.elem_wind
x[0] = 22
x[14] = 23
x[29] = 24
when 3 # Earth
mastery = @actor.elem_earth
x[0] = 19
x[14] = 20
x[29] = 21
end

if mastery > 0
for k in 0...mastery
@actor.learn_skill(x[k])
end
end

if mastery < 50
for k in mastery...50
@actor.forget_skill(x[k])
end
end


end

if exit == true
$scene = Scene_Menu.new
end
end

Is where you set the spells you learn, I think the comments make it understandable, if not make me write some proper instrucions.
 
i already understand most of the script how its work, thx a lot. But since i was using "Real time active battle (RTAB) Ver 1.15", i got a bug at the end when all the monster are kill (100 of them). I think i'll remove that Rtab and try to find another.

Edit: I've look in the script and i though of some things.

Code:
unless enemy.hidden
        elem_xp += 1
Can we put like 1..3?

Code:
if actor.cant_get_exp? == false
        actor.elem_xp += elem_xp
        if actor.elem_xp >= 100
          actor.elem_points += 1
          actor.elem_xp -= 100
          actor.damage = 'Element Point Gained'
          actor.damage_pop = true
100 is good, but what if we start low, like 50 or 60 and then go up by a random number but always between those two. Like, 15 to 25, so that way the element xp will be different.

These are just suggestion. :D
 

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