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.

[Resolved] Raising stats by a percentage?

Status
Not open for further replies.
I want to make it so that my character has a skill called uh... I dunno, for lack of a better term, 'Suit up'. Let's just say my character is spider man.

How would I make it so that everytime Peter Parker uses Suit Up, he changes classes to Spider-man(I know how to do this part), and then all or some of his stats raise by a certain percentage? Let's say.. 15% in this case.

Also, the reverse would be true. When he 'Goes Normal', how would I make it so his stats all DECREASE by 15% once more?

and no, I don't want to just make it a state if at all possible, I'd like his actual base stats to increase...

What I'm actually trying to do is make a project about a shape-shifter who gains new 'shapes' as he fights them, in the form of new classes. I'm considering making it a leveless game and just increasing/decreasing the stats by a set number if there isn't a way to increase/decrease by a percentage.
 
Well, I haven't tested it, but it should work without the SDK.

Code:
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Actor Bonuses', 'SephirothSpawn', 2.1, '2006-11-30')

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Actor Bonuses')

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

Find and delete those lines, but I am not guarnteeing anything.

If you are wanting it for class, you can just use the class based percent modifer.

Code:
  #--------------------------------------------------------------------------
  # * Stat Bonuses
  #
  #  ~ Normal Stat Modifers
  #    'maxhp', 'maxsp', 'str', 'dex', 'agi', 'int', 'atk', 'pdef', 'mdef',
  #    'eva', 'exp', 'gold'
  #  
  #  ~ Special Modifers (Note that there is no % bonus for element & states)
  #    'element' => { element_id => bonus }
  #    'state'   => { state_id   => bonus }
  #--------------------------------------------------------------------------  #--------------------------------------------------------------------------
  # * Class Bonuses
  #
  #  ~ class_id => { stat_bonus => bonus, ... }
  #--------------------------------------------------------------------------  ClassBonuses_Percent = {
  }

So, for example you want a 15% maxhp bonus when class 2.

Code:
  ClassBonuses_Percent = {
    2 => {'maxhp' => 15}
  }

That would be your constant setup.
 
Status
Not open for further replies.

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