public static bool isEntityHurt(int EntityID) { bool result = false; EntityAliveSDX myEntity = GameManager.Instance.World.GetEntity(EntityID) as EntityAliveSDX; if (myEntity) { List <String> lstBuffs = new List <string>(); lstBuffs.Add("buffStatusWounded"); lstBuffs.Add("buffInjuryBleeding"); result = CheckIncentive(EntityID, lstBuffs, null); if (result == false) { if (myEntity.Health < (myEntity.GetMaxHealth() * 0.75)) { DisplayLog(" Entity's Health is less than 35%"); result = true; } } } if (result) { DisplayLog(" Is Entity Hurt? "); } return(result); }
public static void ProcessConsumables(int EntityID) { EntityAliveSDX myEntity = GameManager.Instance.World.GetEntity(EntityID) as EntityAliveSDX; if (myEntity == null) { return; } float foodAmount = GetCVarValue(EntityID, "$foodAmountAdd"); if (foodAmount > 0.5f) { myEntity.Health += Utils.Fastfloor(foodAmount); foodAmount -= 0.5f; } if (myEntity.Health > myEntity.GetMaxHealth()) { myEntity.Health = myEntity.GetMaxHealth(); } }
public static string DisplayEntityStats(int EntityID) { EntityAliveSDX myEntity = GameManager.Instance.World.GetEntity(EntityID) as EntityAliveSDX; if (myEntity == null) { return(""); } String FoodAmount = Mathf.RoundToInt(myEntity.Stats.Stamina.ModifiedMax + GetCVarValue(EntityID, "foodAmount")).ToString(); String WaterAmount = Mathf.RoundToInt(myEntity.Stats.Water.Value + GetCVarValue(EntityID, "waterAmount")).ToString(); // string strOutput = myEntity.EntityName + " - ID: " + myEntity.entityId + " Health: " + myEntity.Stats.Health.Value; string strOutput = myEntity.EntityName + " - ID: " + myEntity.entityId + " Health: " + myEntity.Health + "/" + myEntity.GetMaxHealth(); strOutput += " Stamina: " + myEntity.Stats.Stamina.Value + " Thirst: " + myEntity.Stats.Water.Value + " Food: " + FoodAmount + " Water: " + WaterAmount; strOutput += " Sanitation: " + GetCVarValue(EntityID, "solidWasteAmount"); // Read the Food items configured. String strFoodItems = GetStringValue(EntityID, "FoodItems"); if (strFoodItems == String.Empty) { strFoodItems = "All Food Items"; } strOutput += "\n Food Items: " + strFoodItems; // Read the Water Items String strWaterItems = GetStringValue(EntityID, "WaterItems"); if (strWaterItems == String.Empty) { strWaterItems = "All Water Items"; } strOutput += "\n Water Items: " + strWaterItems; strOutput += "\n Food Bins: " + GetStringValue(EntityID, "FoodBins"); strOutput += "\n Water Bins: " + GetStringValue(EntityID, "WaterBins"); if (myEntity.Buffs.HasCustomVar("CurrentOrder")) { strOutput += "\n Current Order: " + GetCurrentOrder(EntityID).ToString(); } if (myEntity.Buffs.HasCustomVar("Leader")) { Entity leader = GetLeader(EntityID); if (leader) { strOutput += "\n Current Leader: " + leader.entityId; } } strOutput += "\n Active Buffs: "; foreach (BuffValue buff in myEntity.Buffs.ActiveBuffs) { strOutput += "\n\t" + buff.BuffName + " ( Seconds: " + buff.DurationInSeconds + " Ticks: " + buff.DurationInTicks + " )"; } strOutput += "\n Active CVars: "; foreach (KeyValuePair <string, float> myCvar in myEntity.Buffs.CVars) { strOutput += "\n\t" + myCvar.Key + " : " + myCvar.Value; } strOutput += "\n Active Quests: "; foreach (Quest quest in myEntity.QuestJournal.quests) { strOutput += "\n\t" + quest.ID + " Current State: " + quest.CurrentState + " Current Phase: " + quest.CurrentPhase; } strOutput += "\n Patrol Points: "; foreach (Vector3 vec in myEntity.PatrolCoordinates) { strOutput += "\n\t" + vec.ToString(); } strOutput += "\n\nCurrency: " + GetHireCurrency(EntityID) + " Faction: " + myEntity.factionId; DisplayLog(strOutput); return(strOutput); }