using System; using System.Diagnostics; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.AbilityEffect { /// /// This DataType includes all of the data available to ISXEQ2 that is related to effects that are on the current player character. /// public class Effect : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public Effect(LavishScriptObject copy) : base(copy) { } #endregion #region Members /// /// Cache of BackDropID /// private int? _backDropID; /// /// Back Drop ID of Effect /// public int BackDropIconID { get { Trace.WriteLine(String.Format("Effect:BackDropIconID")); if(!_backDropID.HasValue) _backDropID = this.GetIntFromLSO("BackDropIconID"); return _backDropID.Value; } } /// /// Current Increments on Effect /// public int CurrentIncrements { get { Trace.WriteLine(String.Format("Effect:CurrentIncrements")); return this.GetIntFromLSO("CurrentIncrements"); } } /// /// Cache of Description /// private string _description; /// /// Effect Description /// public string Description { get { Trace.WriteLine(String.Format("Effect:Description")); return _description ?? (_description = this.GetStringFromLSO("Description")); } } /// /// This is the current duration of the effect in seconds. /// public float Duration { get { Trace.WriteLine(String.Format("Effect:Duration")); return this.GetFloatFromLSO("Duration"); } } /// /// Cache of ID /// private int? _iD; /// /// Effect ID /// public int ID { get { Trace.WriteLine(String.Format("Effect:ID")); if(!_iD.HasValue) _iD = this.GetIntFromLSO("ID"); return _iD.Value; } } /// /// Cache of MainIconID /// private int? _mainIconID; /// /// Effect main icon ID /// public int MainIconID { get { Trace.WriteLine(String.Format("Effect:MainIconID")); if(!_mainIconID.HasValue) _mainIconID = this.GetIntFromLSO("MainIconID"); return _mainIconID.Value; } } /// /// Cache of MaxDuration /// private float? _maxDuration; /// /// This is the maximum duration of the effect in seconds. /// Note: If you log off and back on with 'duration' buffs/effects, /// will notice that the 'MaxDuration' will change to reflect that. /// public float MaxDuration { get { Trace.WriteLine(String.Format("Effect:MaxDuration")); if(!_maxDuration.HasValue) _maxDuration = this.GetFloatFromLSO("MaxDuration"); return _maxDuration.Value; } } /// /// Cache of Name /// private string _name; /// /// Effect Name /// public string Name { get { Trace.WriteLine(String.Format("Effect:Name")); return _name ?? (_name = this.GetStringFromLSO("Name")); } } #endregion #region Methods /// /// Cancels the effect, if possible /// /// call success public bool Cancel() { Trace.WriteLine(String.Format("Effect:Cancel()")); return this.ExecuteMethod("Cancel"); } /// /// Examines the effect /// /// call success public bool Examine() { Trace.WriteLine(String.Format("Effect:Examine()")); return this.ExecuteMethod("Examine"); } #endregion } }