Exemplo n.º 1
0
 private int GetOrderSet99(StatOperation op)
 {
     if (op == StatOperation.Set)
     {
         return(99);
     }
     return(GetOrder(op));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Applies the same operation to all stats
 /// </summary>
 /// <param name="op">The operation to apply to all stats</param>
 public StatOperations(StatOperation op)
 {
     Hp.Value = op;
     Mp.Value = op;
     Attack.Value = op;
     Defense.Value = op;
     MagicAttack.Value = op;
     MagicDefense.Value = op;
     Speed.Value = op;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Modifies a stat according to an operation
 /// </summary>
 /// <param name="get">The current value of the stat</param>
 /// <param name="modifier">The modification</param>
 /// <param name="operation">How to modify</param>
 /// <param name="set">Sets the new value of the stat</param>
 private void Modify(Long get, Long modifier, StatOperation operation, Action<Long> set)
 {
     switch (operation)
     {
     case StatOperation.Add:
         set(get + modifier);
         break;
     case StatOperation.Subtract:
         set(get - modifier);
         break;
     case StatOperation.Multiply:
         set(get * modifier);
         break;
     case StatOperation.Divide:
         set(get / modifier);
         break;
     case StatOperation.AddPercent:
         set(get + (get * modifier) / 100);
         break;
     case StatOperation.SubtractPercent:
         set(get - (100 <= get ? (get / 100) * modifier : (get * modifier) / 100));
         break;
     }
 }
Exemplo n.º 4
0
 private int GetOrder(StatOperation op)
 {
     return(Array.IndexOf(Settings.Order, op));
 }