/// <summary> /// プレイヤ情報をリフレッシュする /// </summary> public static void RefreshPlayer() { var list = FF14PluginHelper.GetCombatantList(); if (list.Count > 0) { player = list[0]; lastPlayerDateTime = DateTime.Now; } }
public float GetHorizontalDistance(Combatant target) => (float)Math.Sqrt( Math.Pow(this.PosX - target.PosX, 2) + Math.Pow(this.PosY - target.PosY, 2));
public static List<Combatant> GetCombatantList() { Initialize(); var result = new List<Combatant>(); if (plugin == null) { return result; } if (GetFFXIVProcess == null) { return result; } if (pluginScancombat == null) { return result; } dynamic list = pluginScancombat.GetCombatantList(); foreach (dynamic item in list.ToArray()) { if (item == null) { continue; } var combatant = new Combatant(); combatant.ID = (uint)item.ID; combatant.OwnerID = (uint)item.OwnerID; combatant.Job = (int)item.Job; combatant.Name = (string)item.Name; combatant.type = (byte)item.type; combatant.Level = (int)item.Level; combatant.CurrentHP = (int)item.CurrentHP; combatant.MaxHP = (int)item.MaxHP; combatant.CurrentMP = (int)item.CurrentMP; combatant.MaxMP = (int)item.MaxMP; combatant.CurrentTP = (int)item.CurrentTP; result.Add(combatant); } return result; }