public static float ApplyED(Enums.eSchedule iSched, float iVal) { switch (iSched) { case Enums.eSchedule.None: return(0.0f); case Enums.eSchedule.Multiple: return(0.0f); default: float[] ed = new float[3]; for (int index = 0; index <= 2; ++index) { ed[index] = DatabaseAPI.Database.MultED[(int)iSched][index]; } if ((double)iVal <= (double)ed[0]) { return(iVal); } float[] edm = new float[3] { ed[0], ed[0] + (float)((ed[1] - (double)ed[0]) * 0.899999976158142), (float)(ed[0] + (ed[1] - (double)ed[0]) * 0.899999976158142 + (ed[2] - (double)ed[1]) * 0.699999988079071) }; return(iVal > (double)ed[1] ? (iVal > (double)ed[2] ? edm[2] + (float)((iVal - (double)ed[2]) * 0.150000005960464) : edm[1] + (float)((iVal - (double)ed[1]) * 0.699999988079071)) : edm[0] + (float)((iVal - (double)ed[0]) * 0.899999976158142)); } }
public Enhancement(BinaryReader reader) { this.RecipeIDX = -1; this.IsModified = false; this.IsNew = false; this.StaticIndex = reader.ReadInt32(); this.Name = reader.ReadString(); this.ShortName = reader.ReadString(); this.Desc = reader.ReadString(); this.TypeID = (Enums.eType)reader.ReadInt32(); this.SubTypeID = (Enums.eSubtype)reader.ReadInt32(); this.ClassID = new int[reader.ReadInt32() + 1]; for (int index = 0; index < this.ClassID.Length; ++index) { this.ClassID[index] = reader.ReadInt32(); } this.Image = reader.ReadString(); this.nIDSet = reader.ReadInt32(); this.UIDSet = reader.ReadString(); this.EffectChance = reader.ReadSingle(); this.LevelMin = reader.ReadInt32(); this.LevelMax = reader.ReadInt32(); this.Unique = reader.ReadBoolean(); this.MutExID = (Enums.eEnhMutex)reader.ReadInt32(); this.BuffMode = (Enums.eBuffDebuff)reader.ReadInt32(); if (this.MutExID < Enums.eEnhMutex.None) { this.MutExID = Enums.eEnhMutex.None; } this.Effect = new Enums.sEffect[reader.ReadInt32() + 1]; for (int index = 0; index <= this.Effect.Length - 1; ++index) { this.Effect[index].Mode = (Enums.eEffMode)reader.ReadInt32(); this.Effect[index].BuffMode = (Enums.eBuffDebuff)reader.ReadInt32(); this.Effect[index].Enhance.ID = reader.ReadInt32(); this.Effect[index].Enhance.SubID = reader.ReadInt32(); this.Effect[index].Schedule = (Enums.eSchedule)reader.ReadInt32(); this.Effect[index].Multiplier = reader.ReadSingle(); ref Enums.sEffect local = ref this.Effect[index]; Base.Data_Classes.Effect effect; if (!reader.ReadBoolean()) { effect = null; } else { effect = new Base.Data_Classes.Effect(reader) { isEnhancementEffect = true } }; local.FX = effect; } this.UID = reader.ReadString(); this.RecipeName = reader.ReadString(); this.Superior = reader.ReadBoolean(); }
public void Assign(Enums.sEffect effect) { this.Mode = effect.Mode; this.BuffMode = effect.BuffMode; this.Enhance.ID = effect.Enhance.ID; this.Enhance.SubID = effect.Enhance.SubID; this.Schedule = effect.Schedule; this.Multiplier = effect.Multiplier; if (effect.FX == null) { return; } this.FX = (IEffect)effect.FX.Clone(); }
public static float ApplyED(Enums.eSchedule iSched, float iVal) { float num; if (iSched == Enums.eSchedule.None) { num = 0f; } else if (iSched == Enums.eSchedule.Multiple) { num = 0f; } else { float[] numArray = new float[3]; for (int index = 0; index <= 2; index++) { numArray[index] = DatabaseAPI.Database.MultED[(int)iSched][index]; } if (iVal <= numArray[0]) { num = iVal; } else { float[] numArray2 = new float[] { numArray[0], numArray[0] + (numArray[1] - numArray[0]) * 0.9f, numArray[0] + (numArray[1] - numArray[0]) * 0.9f + (numArray[2] - numArray[1]) * 0.7f }; if (iVal <= numArray[1]) { num = numArray2[0] + (iVal - numArray[0]) * 0.9f; } else if (iVal <= numArray[2]) { num = numArray2[1] + (iVal - numArray[1]) * 0.7f; } else { num = numArray2[2] + (iVal - numArray[2]) * 0.15f; } } } return(num); }
public Enhancement(BinaryReader reader) { this.RecipeIDX = -1; this.IsModified = false; this.IsNew = false; this.StaticIndex = reader.ReadInt32(); this.Name = reader.ReadString(); this.ShortName = reader.ReadString(); this.Desc = reader.ReadString(); this.TypeID = (Enums.eType)reader.ReadInt32(); this.SubTypeID = (Enums.eSubtype)reader.ReadInt32(); this.ClassID = new int[reader.ReadInt32() + 1]; for (int index = 0; index < this.ClassID.Length; index++) { this.ClassID[index] = reader.ReadInt32(); } this.Image = reader.ReadString(); this.nIDSet = reader.ReadInt32(); this.UIDSet = reader.ReadString(); this.EffectChance = reader.ReadSingle(); this.LevelMin = reader.ReadInt32(); this.LevelMax = reader.ReadInt32(); this.Unique = reader.ReadBoolean(); this.MutExID = (Enums.eEnhMutex)reader.ReadInt32(); this.BuffMode = (Enums.eBuffDebuff)reader.ReadInt32(); if (this.MutExID < Enums.eEnhMutex.None) { this.MutExID = Enums.eEnhMutex.None; } this.Effect = new Enums.sEffect[reader.ReadInt32() + 1]; for (int index2 = 0; index2 <= this.Effect.Length - 1; index2++) { this.Effect[index2].Mode = (Enums.eEffMode)reader.ReadInt32(); this.Effect[index2].BuffMode = (Enums.eBuffDebuff)reader.ReadInt32(); this.Effect[index2].Enhance.ID = reader.ReadInt32(); this.Effect[index2].Enhance.SubID = reader.ReadInt32(); this.Effect[index2].Schedule = (Enums.eSchedule)reader.ReadInt32(); this.Effect[index2].Multiplier = reader.ReadSingle(); this.Effect[index2].FX = (reader.ReadBoolean() ? new Effect(reader) { isEnahncementEffect = true } : null); } this.UID = reader.ReadString(); this.RecipeName = reader.ReadString(); this.Superior = reader.ReadBoolean(); }
public Enhancement(IEnhancement iEnh) { this.IsModified = false; this.IsNew = false; this.StaticIndex = iEnh.StaticIndex; this.Name = iEnh.Name; this.ShortName = iEnh.ShortName; this.Desc = iEnh.Desc; this.TypeID = iEnh.TypeID; this.SubTypeID = iEnh.SubTypeID; this.Image = iEnh.Image; this.ImageIdx = iEnh.ImageIdx; this.nIDSet = iEnh.nIDSet; this.UIDSet = iEnh.UIDSet; this.EffectChance = iEnh.EffectChance; this.LevelMin = iEnh.LevelMin; this.LevelMax = iEnh.LevelMax; this.Unique = iEnh.Unique; this.MutExID = iEnh.MutExID; this.BuffMode = iEnh.BuffMode; this._power = new Base.Data_Classes.Power(iEnh.GetPower()); this.ClassID = new int[iEnh.ClassID.Length]; for (int index = 0; index <= this.ClassID.Length - 1; ++index) { this.ClassID[index] = iEnh.ClassID[index]; } this.Effect = new Enums.sEffect[iEnh.Effect.Length]; for (int index = 0; index <= this.Effect.Length - 1; ++index) { this.Effect[index].Mode = iEnh.Effect[index].Mode; this.Effect[index].BuffMode = iEnh.Effect[index].BuffMode; this.Effect[index].Enhance.ID = iEnh.Effect[index].Enhance.ID; this.Effect[index].Enhance.SubID = iEnh.Effect[index].Enhance.SubID; this.Effect[index].Schedule = iEnh.Effect[index].Schedule; this.Effect[index].Multiplier = iEnh.Effect[index].Multiplier; if (iEnh.Effect[index].FX != null) { this.Effect[index].FX = iEnh.Effect[index].FX.Clone() as IEffect; } } this.UID = iEnh.UID; this.RecipeName = iEnh.RecipeName; this.RecipeIDX = iEnh.RecipeIDX; this.Superior = iEnh.Superior; }
public static float ApplyED(Enums.eSchedule iSched, float iVal) { float num; switch (iSched) { case Enums.eSchedule.None: num = 0.0f; break; case Enums.eSchedule.Multiple: num = 0.0f; break; default: float[] numArray1 = new float[3]; for (int index = 0; index <= 2; ++index) { numArray1[index] = DatabaseAPI.Database.MultED[(int)iSched][index]; } if ((double)iVal <= (double)numArray1[0]) { num = iVal; } else { float[] numArray2 = new float[3] { numArray1[0], numArray1[0] + (float)(((double)numArray1[1] - (double)numArray1[0]) * 0.899999976158142), (float)((double)numArray1[0] + ((double)numArray1[1] - (double)numArray1[0]) * 0.899999976158142 + ((double)numArray1[2] - (double)numArray1[1]) * 0.699999988079071) }; num = (double)iVal > (double)numArray1[1] ? ((double)iVal > (double)numArray1[2] ? numArray2[2] + (float)(((double)iVal - (double)numArray1[2]) * 0.150000005960464) : numArray2[1] + (float)(((double)iVal - (double)numArray1[1]) * 0.699999988079071)) : numArray2[0] + (float)(((double)iVal - (double)numArray1[0]) * 0.899999976158142); } break; } return(num); }
float GetScheduleMult(Enums.eType iType, Enums.eSchedule iSched) { if (this.Grade < Enums.eEnhGrade.None) { this.Grade = Enums.eEnhGrade.None; } if (this.RelativeLevel < Enums.eEnhRelative.None) { this.RelativeLevel = Enums.eEnhRelative.None; } if (this.Grade > Enums.eEnhGrade.SingleO) { this.Grade = Enums.eEnhGrade.SingleO; } if (this.RelativeLevel > Enums.eEnhRelative.PlusFive) { this.RelativeLevel = Enums.eEnhRelative.PlusFive; } float num1 = 0.0f; if (this.IOLevel <= 0) { this.IOLevel = 0; } if (this.IOLevel > DatabaseAPI.Database.MultIO.Length - 1) { this.IOLevel = DatabaseAPI.Database.MultIO.Length - 1; } if (iSched == Enums.eSchedule.None || iSched == Enums.eSchedule.Multiple) { num1 = 0.0f; } else { switch (iType) { case Enums.eType.Normal: switch (this.Grade) { case Enums.eEnhGrade.None: num1 = 0.0f; break; case Enums.eEnhGrade.TrainingO: num1 = DatabaseAPI.Database.MultTO[0][(int)iSched]; break; case Enums.eEnhGrade.DualO: num1 = DatabaseAPI.Database.MultDO[0][(int)iSched]; break; case Enums.eEnhGrade.SingleO: num1 = DatabaseAPI.Database.MultSO[0][(int)iSched]; break; } break; case Enums.eType.InventO: num1 = DatabaseAPI.Database.MultIO[this.IOLevel][(int)iSched]; break; case Enums.eType.SpecialO: num1 = DatabaseAPI.Database.MultSO[0][(int)iSched]; break; case Enums.eType.SetO: num1 = DatabaseAPI.Database.MultIO[this.IOLevel][(int)iSched]; break; } } float num2 = num1 * this.GetRelativeLevelMultiplier(); if (this.Enh > -1 && DatabaseAPI.Database.Enhancements[this.Enh].Superior) { num2 *= 1.25f; } return(num2); }
private float GetScheduleMult(Enums.eType iType, Enums.eSchedule iSched) { if (Grade < Enums.eEnhGrade.None) { Grade = Enums.eEnhGrade.None; } if (RelativeLevel < Enums.eEnhRelative.None) { RelativeLevel = Enums.eEnhRelative.None; } if (Grade > Enums.eEnhGrade.SingleO) { Grade = Enums.eEnhGrade.SingleO; } if (RelativeLevel > Enums.eEnhRelative.PlusFive) { RelativeLevel = Enums.eEnhRelative.PlusFive; } var num1 = 0.0f; if (IOLevel <= 0) { IOLevel = 0; } if (IOLevel > DatabaseAPI.Database.MultIO.Length - 1) { IOLevel = DatabaseAPI.Database.MultIO.Length - 1; } if (iSched == Enums.eSchedule.None || iSched == Enums.eSchedule.Multiple) { num1 = 0.0f; } else { switch (iType) { case Enums.eType.Normal: num1 = Grade switch { Enums.eEnhGrade.None => 0.0f, Enums.eEnhGrade.TrainingO => DatabaseAPI.Database.MultTO[0][(int)iSched], Enums.eEnhGrade.DualO => DatabaseAPI.Database.MultDO[0][(int)iSched], Enums.eEnhGrade.SingleO => DatabaseAPI.Database.MultSO[0][(int)iSched], _ => num1 }; break; case Enums.eType.InventO: num1 = DatabaseAPI.Database.MultIO[IOLevel][(int)iSched]; break; case Enums.eType.SpecialO: num1 = DatabaseAPI.Database.MultSO[0][(int)iSched]; break; case Enums.eType.SetO: num1 = DatabaseAPI.Database.MultIO[IOLevel][(int)iSched]; break; } } var num2 = num1 * GetRelativeLevelMultiplier(); if (Enh > -1 && DatabaseAPI.Database.Enhancements[Enh].Superior) { num2 *= 1.25f; } return(num2); }