public static void AddExp(this ExpTarget target, int exp) { switch (target.TargetType()) { case ExpTargetType.Attribute: //Util.WriteToChat($"Add experience to attribute {target}"); Globals.Host.Actions.AddAttributeExperience(target.AsAttribute(), exp); break; case ExpTargetType.Vital: //Util.WriteToChat($"Add experience to vital {target}"); Globals.Host.Actions.AddVitalExperience(target.AsVital(), exp); break; case ExpTargetType.Specialized: case ExpTargetType.Trained: //Util.WriteToChat($"Add experience to skill {target}"); Globals.Host.Actions.AddSkillExperience(target.AsSkill(), exp); break; default: Util.WriteToChat($"Failed to add {exp} exp to {target.GetName()}"); break; } }
public static int GetTimesLeveled(this ExpTarget target) { switch (target.TargetType()) { case ExpTargetType.Attribute: return(Globals.Host.Actions.AttributeClicks[target.AsAttribute()]); // // Globals.Host.Actions.VitalClicks case ExpTargetType.Vital: return(Globals.Host.Actions.VitalClicks[target.AsVital()]); break; case ExpTargetType.Trained: case ExpTargetType.Specialized: return(Globals.Host.Actions.SkillClicks[target.AsSkill()]); break; } return(-1); }
public static int?CostToLevel(this ExpTarget target, int offset = 0) { var targetLevel = offset + target.GetTimesLeveled(); switch (target.TargetType()) { case ExpTargetType.Attribute: if (ATTRIBUTE_COSTS.Length > targetLevel) { return(ATTRIBUTE_COSTS[targetLevel]); } break; case ExpTargetType.Vital: if (VITAL_COSTS.Length > targetLevel) { return(VITAL_COSTS[targetLevel]); } break; case ExpTargetType.Trained: if (TRAINED_COSTS.Length > targetLevel) { return(TRAINED_COSTS[targetLevel]); } break; case ExpTargetType.Specialized: if (SPECIALIZED_COSTS.Length > targetLevel) { return(SPECIALIZED_COSTS[targetLevel]); } break; } return(null); }