   Turn Based Rpg Game (Stat Boosts)
  I am making a turned based rpg game for my comp sci class. I have pretty much everything working, except I need a way to do stat boosts. I'm am programming in C#, just to let you know. There are 2 different types of attacks, strikes and throws. Throws are supposed to give a boost in any combination of strength (affects damage), defense (affects amt. of damage taken), and technique (affects accuracy). Also, I would like some throws to apply a deficit to your opponent's stats as well. Unfortunately, I have no idea how to do this. I think if this problem was solved, I could start making equipment that boost player stats. Or should I maybe start by making equipment first?   
  Can you describe how you have your stats set up now? The approach will involve adding a layer of abstraction on top of what you already have, so that's where we should start.In C#, you can use properties to provide this abstraction, for example:private int m_strength;private int m_strength_spell_bonus;private int m_strength_armor_bonus;public int Strength{    get { return m_strength + m_strength_spell_bonus + m_strength_armor_bonus; }};  There are various ways to tackle this, depending on what exactly you need. You could create a Modifier class, for example, and give each Player a list of Modifier instances (with list, I mean a container, not necessarily a linker list). You'd then create functions to retrieve the strength, accuracy and such of a player - these functions would check the base property and run through the list of modifiers to check how much that value should be modified.Which is similar to what epicar suggests. Function or property, the idea is the same. Modifier variables or stored instances of some modifier class, the idea is the same.How is your current system set up bytheway?   ;  What do you mean by system? Like how does the attack system work? Or like how my classes are sey up? Oh and for stats, I have a  Fighter class, and a player class which inherits from the fighter class. Fighter has three properties for stats which Player inherits from.   ;  Bump. I really could use some help   ;  Bump again. If no one replies, I'll just put this in the game programming thread   ;  You don't need to bump multiple times in one day. If people don't respond, perhaps you should think about clarifying your question instead of just bumping your post.There are many ways this could be implemented, the method that Captain P highlighted is probably the one I would choose. You have a Modifier class, which looks something like this:class Modifier{  public string StatName; // stat we're modifying  public int Amount; // e.g. +1 or -3 etc}class Fighter{  private IDictionary<string, int> stats;  public List<Modifier> Modifiers;  public int Strength  {    get    { return GetStat("Strength");    }  }  private int GetStat(string name)  {    int baseStat = stats[name];    foreach(var modifier in Modifiers) { if (modifier.StatName == name) {   baseState += modifier.Amount; }    }  }}And so on. That's obviously pretty basic, has no error checking and is probably not very smart (for example, rather than using strings to name stats, you could have an enumeration which would provide you with a bit of type safety; you could also make your stat type a complex class rather than just an int and store the modifiers in that class itself rather than as a list in your Fighter class; there's plenty of variations).   ;  That might work. The only problem I see with that is that the stat modifier is a temporary thing. So, I would need base strength without mods too. I'm not really sure how to implement this. Because, equipment is would be more permanant while equipped but the boost from certain moves would actually only last a certain amount of "turns" while in a battle. So I guess i would need to do this modifier check during every attack?   ;  I'm having no luck trying to figure this out. I just don't get how to do it. Could someone explain to me what I need to do step by step? I'm just confused out of my mind.   ;Quote:Original post by t11I'm having no luck trying to figure this out. I just don't get how to do it. Could someone explain to me what I need to do step by step? I'm just confused out of my mind.I'm sorry but there's not "step-by-step". There are lotsof ways to do what you are trying and it's your job as a programmer to make decisions.I have, however, found  this  and  this , which seems quite interesting.Hope you find it useful.   