protected override void Action() { int currentlvl = 1; int expreq = ExpReq; soldakobj.Dict.Add("BaseXpNeededEachLevel", new List <string>() { ExpReq + "" }); for (var i = 1; i <= maxlvl; i++) { if (LevelAndCurveDict.ContainsKey(i)) { currentlvl = i; } if (i > 1) { expreq = Convert.ToInt32(expreq * LevelAndCurveDict[currentlvl]); } Debug.Log(i + " " + expreq); soldakobj.Dict.Add("XpMultEachLevel" + i, new List <string>() { LevelAndCurveDict[currentlvl] + " // " + expreq.ToString("N") + " Exp Required to Levelup" }); } FileManager.SaveOutputToFile(soldakobj.GetTextRepresentation()); }
public void GenerateModFile() { string s = ""; OverridenObjects.Values.ToList().ForEach(x => s += x.GetTextRepresentation()); FileManager.SaveOutputToFile(s); }
protected override void Action() { var list = new List <string>(); foreach (var obj in FileManager.GetObjectsFromAllFilesInPath(Save.Instance.FilesToEditPath)) { list.Add(obj.GetTextRepresentation(obj.Dict, Save.Instance.ModName, Modifiers.overrides)); } FileManager.SaveOutputToFile(string.Join("\n", list.ToArray())); }
protected override void Action() { var list = new List <string>(); foreach (var obj in FileManager.GetObjectsFromAllFilesInPath(Save.Instance.FilesToEditPath, false, true)) { list.Add(obj.Name); } var duplicates = list.GroupBy(x => x) .Where(group => group.Count() > 1) .Select(group => group.Key); FileManager.SaveOutputToFile(string.Join("\n", duplicates.ToArray())); }
protected override void Action() { List <SoldakObject> objects = new List <SoldakObject>(); foreach (var item in FileManager.GetObjectsFromAllFilesInPath(Save.Instance.GamePath) .ToList().GetDerivedFrom("BaseSkill") .Where(x => x.Name.Contains("SkillModification") && x.Modifier == Modifiers.none)) { int num = -1; for (var i = 0; i < OnHitKill.Count; i++) { var str = OnHitKill[i]; if (item.Dict.ContainsKey(str)) { num = i; } } if (num > -1) { var obj = SoldakObject.GenerateOverrideObject(item.Name); float oldval = float.Parse(item.Dict[OnHitKill[num]][0]); float newval; if (OnHitKill[num] == "UseOnHitChance") { newval = (float)(oldval / 2.5); } else { newval = (float)(oldval / 1.5); } obj.Dict.Add(OnHitKill[num], new List <string>() { (oldval / 2).ToString() }); objects.Add(obj); } } FileManager.SaveOutputToFile(string.Join("\n", objects.ToStringList())); }
protected override void Action() { var set = new HashSet <string>(); string str = Save.Instance.InputCommand; foreach (var obj in FileManager.GetObjectsFromAllFilesInPath(Save.Instance.GamePath)) { if (obj.Name.Contains(str) || (!string.IsNullOrEmpty(obj.ModdedName) && obj.ModdedName.Contains(str)) || (obj.Dict.Count > 0 && obj.Dict.Any(x => x.Key.Contains(str) || (x.Value.Count > 0 && x.Value.Any(y => y.Contains(str)))))) { set.Add(obj.GetTextRepresentation(obj.Dict, obj.ModdedName, obj.Modifier)); } } FileManager.SaveOutputToFile(string.Join("\n", set)); }
protected override void Action() { string file = FileManager.GetObjectsFromAllFilesInPath(Save.Instance.GamePath, true).ToList().GetDerivedFrom(Save.Instance.InputCommand).JoinIntoString(); FileManager.SaveOutputToFile(file); }
protected override void Action() { var list = new List <string>(); var min = new string[] { "ProjRadiusMinDamage", "ProjMinDamage", "MinDamage" }; var max = new string[] { "ProjRadiusMaxDamage", "ProjMaxDamage", "MaxDamage" }; int number; foreach (var obj in GetDerived.GetDerivedFrom(FileManager.GetObjectsFromAllFilesInPath(Save.Instance.GamePath, true).ToList(), "BaseSkill")) { number = -1; for (var i = 0; i < min.Length; i++) { if (obj.Dict.Any(x => x.Key.Equals(min[i]))) { number = i; } } if (number > -1) { float AverageDmg = (float.Parse(obj.Dict[min[number]][0]) + float.Parse(obj.Dict[max[number]][0])) / 2F; if (!obj.Dict["Base"][0].Contains("PerLevel")) // if its a skill (should be) { float DmgMult = ConvertSpellDamageIntoWeaponDmgMultipliers(AverageDmg); Dictionary <string, List <string> > Dict = new Dictionary <string, List <string> > { { min[number], new List <string>() { "0" } }, { max[number], new List <string>() { "0" } }, { "DamageMultAll", new List <string>() { DmgMult.ToString() } }, { "ProjectileDamage", new List <string>() { "1" } }, }; list.Add(obj.GetTextRepresentation(Dict, Save.Instance.ModName, Modifiers.overrides)); } else if (obj.Dict["Base"][0].Contains("PerLevel")) // if per level { float DmgMult = GetPerLevelMult(AverageDmg); Dictionary <string, List <string> > Dict = new Dictionary <string, List <string> > { { min[number], new List <string>() { "0" } }, { max[number], new List <string>() { "0" } }, { "DamageMultAll", new List <string>() { DmgMult.ToString() } }, }; list.Add(obj.GetTextRepresentation(Dict, Save.Instance.ModName, Modifiers.overrides)); } } } FileManager.SaveOutputToFile(string.Join("\n", list.ToArray())); }