private static Dictionary <ETalkLevel, Item> GetPlyerHealthCase() { Dictionary <ETalkLevel, Item> items = new Dictionary <ETalkLevel, Item>(); items[ETalkLevel.Medium] = NpcRandomTalkDb.Get((int)ENpcTalkType.MainPlayer_health_medium); items[ETalkLevel.Low] = NpcRandomTalkDb.Get((int)ENpcTalkType.MainPlayer_health_low); return(items); }
public AgentInfo(ENpcTalkType type, ENpcSpeakType spType, bool canLoop = false) { _type = type; _spType = spType; _startTime = Time.time; _canLoop = canLoop; _loopTime = NpcRandomTalkDb.Get(type)._interval; }
private static Dictionary <ETalkLevel, Item> GetHungerCase() { Dictionary <ETalkLevel, Item> items = new Dictionary <ETalkLevel, Item>(); items[ETalkLevel.Medium] = NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_hunger_medium); items[ETalkLevel.Low] = NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_hunger_low); return(items); }
private static Dictionary <ETalkLevel, Item> GetPlyerComfortCase() { Dictionary <ETalkLevel, Item> items = new Dictionary <ETalkLevel, Item>(); items[ETalkLevel.Common] = NpcRandomTalkDb.Get((int)ENpcTalkType.MainPlayer_comfort_common); items[ETalkLevel.Medium] = NpcRandomTalkDb.Get((int)ENpcTalkType.MainPlayer_comfort_medium); items[ETalkLevel.Low] = NpcRandomTalkDb.Get((int)ENpcTalkType.MainPlayer_comfort_low); return(items); }
public static int GetTalkCase(int id) { NpcRandomTalkDb.Item item = NpcRandomTalkDb.Get(id); if (item == null) { return(-1); } if (UnityEngine.Random.value <= item._probability) { return(item.Scenario.RandCase()); } return(-1); }
public static int GetTalkCase(int id, out float time) { time = 0.0f; NpcRandomTalkDb.Item item = NpcRandomTalkDb.Get(id); if (item == null) { return(-1); } if (UnityEngine.Random.value <= item._probability) { time = item._interval; return(item.Scenario.RandCase()); } return(-1); }
public static int CheckAttrbCase(PESkEntity peskentity) { RandomAttrChoce attr = new RandomAttrChoce(); AttribType type = attr.RandType(); float curvalue = peskentity.GetAttribute(type); switch (type) { case AttribType.Hunger: { float maxHunger = peskentity.GetAttribute(AttribType.HungerMax); if (curvalue <= maxHunger * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_hunger_medium)._value && curvalue > maxHunger * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_hunger_low)._value) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_hunger_medium).Scenario.RandCase()); } else if (curvalue <= maxHunger * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_health_low)._value) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_hunger_low).Scenario.RandCase()); } else { return(-1); } } // break; case AttribType.Hp: { float maxHp = peskentity.GetAttribute(AttribType.HpMax); if (curvalue <= maxHp * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_health_medium)._value && curvalue > maxHp * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_health_low)._value) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_health_medium).Scenario.RandCase()); } else if (curvalue <= maxHp * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_health_low)._value) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_health_low).Scenario.RandCase()); } else { return(-1); } } // break; case AttribType.Comfort: { float maxcomfort = peskentity.GetAttribute(AttribType.ComfortMax); if (curvalue <= maxcomfort * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_common)._value && curvalue > maxcomfort * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_medium)._value) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_common).Scenario.RandCase()); } else if (curvalue <= maxcomfort * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_medium)._value && curvalue > maxcomfort * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_low)._value ) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_medium).Scenario.RandCase()); } else if (curvalue <= maxcomfort * NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_low)._value) { return(NpcRandomTalkDb.Get((int)ENpcTalkType.Follower_comfort_low).Scenario.RandCase()); } else { return(-1); } } // break; default: break; } return(-1); }