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.

weapon attack = level*2

Hi I would like a VX script for 1 little thing if its possible

I need the weapon to literally level up as you do so weapon is attack something like

main character.level*2 or something on the lines of that

thankyou in advance  :smile:
 
Here, I made 2 of these.

The first one does exactly what you asked, attack = level * 2. The problem with this one is that it entirely skips the weapon's base attack.
Code:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Attack
  #--------------------------------------------------------------------------
  def atk
    return @level * 2
  end
end

The other one multiplies the actor's attack by the actor's level. It's the default RPGVX attack algorithm but multiplied by the actor's level.
Code:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Attack
  #--------------------------------------------------------------------------
  def atk
    n = [[base_atk + @atk_plus, 1].max, 999].min
    for state in states do n *= state.atk_rate / 100.0 end
    n = [[Integer(n) * @level, 1].max, 999].min
    return n
  end
end

Note that this will affect every weapons and every actors.

Enjoy!
-Dargor
 

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