public void AddThought(Thought.ThoughtType type) { if (!HasThought(type)) { AddThought(Thought.CreateStandardThought(type, PlayState.Time.CurrentDate), true); } }
public static Body GenerateTestSeketon(WorldManager world, Vector3 position) { CreatureDef dwarfDef = ContentPaths.LoadFromJson <CreatureDef>(ContentPaths.Entities.Skeleton.skeleton); Creature toReturn = new Creature(world.ComponentManager, position, dwarfDef, "Skeleton", 0, "Undead"); toReturn.AI.AddThought(Thought.CreateStandardThought(Thought.ThoughtType.JustArrived, world.Time.CurrentDate), false); return(toReturn.Physics); }
public static Body GenerateTestMoleman(Vector3 position) { CreatureDef dwarfDef = ContentPaths.LoadFromJson <CreatureDef>(ContentPaths.Entities.Moleman.moleman); Creature toReturn = new Creature(position, dwarfDef, "Moleman Miner", 0, "Molemen"); toReturn.AI.AddThought(Thought.CreateStandardThought(Thought.ThoughtType.JustArrived, PlayState.Time.CurrentDate), false); return(toReturn.Physics); }
public static GameComponent GenerateDwarf(Vector3 position, ComponentManager componentManager, ContentManager content, GraphicsDevice graphics, ChunkManager chunkManager, Camera camera, Faction faction, PlanService planService, string allies, EmployeeClass dwarfClass, int level) { CreatureStats stats = new CreatureStats(dwarfClass, level); Dwarf toReturn = new Dwarf(stats, allies, planService, faction, "Dwarf", chunkManager, graphics, content, dwarfClass, position); toReturn.AI.AddThought(Thought.CreateStandardThought(Thought.ThoughtType.JustArrived, PlayState.Time.CurrentDate), false); return(toReturn.Physics); }
public Thought AddThought(String Description, TimeSpan TimeLimit, float HappinessModifier) { var r = new Thought { Description = Description, TimeLimit = TimeLimit, HappinessModifier = HappinessModifier, TimeStamp = Manager.World.Time.CurrentDate }; Physics.GetComponent <DwarfThoughts>()?.AddThought(r); return(r); }
public static GameComponent GenerateDwarf( Vector3 Position, ComponentManager Manager, string Allies, EmployeeClass DwarfClass, int Level, Gender gender, int seed) { Dwarf toReturn = new Dwarf(Manager, new CreatureStats(DwarfClass, Level) { Gender = gender, RandomSeed = seed, VoicePitch = CreatureStats.GetRandomVoicePitch(gender) }, Allies, Manager.World.PlanService, Manager.World.PlayerFaction, "Dwarf", DwarfClass, Position); toReturn.AddThought(Thought.CreateStandardThought(Thought.ThoughtType.JustArrived, Manager.World.Time.CurrentDate), false); return(toReturn.Physics); }
/// <summary> Add a custom thought to the creature </summary> public void AddThought(Thought thought) { if (HasThought(thought.Description)) { return; } Thoughts.Add(thought); var good = thought.HappinessModifier > 0; var textColor = good ? GameSettings.Default.Colors.GetColor("Positive", Color.Green) : GameSettings.Default.Colors.GetColor("Negative", Color.Red); var prefix = good ? "+" : ""; var postfix = good ? ":)" : ":("; IndicatorManager.DrawIndicator(prefix + thought.HappinessModifier + " " + postfix, Creature.Physics.Position + Vector3.Up + MathFunctions.RandVector3Cube() * 0.5f, 1.0f, textColor); }
/// <summary> Add a standard thought to the creature. </summary> public void AddThought(Thought.ThoughtType type) { if (!HasThought(type)) { var thought = Thought.CreateStandardThought(type, Manager.World.Time.CurrentDate); AddThought(thought, true); if (thought.HappinessModifier > 0.01) { Creature.NoiseMaker.MakeNoise("Pleased", Position, true); } else { Creature.NoiseMaker.MakeNoise("Tantrum", Position, true); } } }
public void AddThought(Thought thought, bool allowDuplicates) { if (allowDuplicates) { Thoughts.Add(thought); } else { if (HasThought(thought.Type)) { return; } Thoughts.Add(thought); } bool good = thought.HappinessModifier > 0; Color textColor = good ? Color.Yellow : Color.Red; string prefix = good ? "+" : ""; string postfix = good ? ":)" : ":("; IndicatorManager.DrawIndicator(prefix + thought.HappinessModifier + " " + postfix, Position + Vector3.Up + MathFunctions.RandVector3Cube() *0.5f, 1.0f, textColor); }
public override void OnApply(Creature creature) { SavedThought = creature.AddThought(Description, new TimeSpan(1, 0, 0, 0), HappinessModifier); base.OnApply(creature); }
public void AddThought(Thought thought, bool allowDuplicates) { Physics.GetComponent <DwarfThoughts>()?.AddThought(thought, allowDuplicates); }
/// <summary> Remove a standard thought from the creature. </summary> public void RemoveThought(Thought Thought) { Thoughts.Remove(Thought); }
public void RemoveThought(Thought.ThoughtType thoughtType) { Thoughts.RemoveAll(thought => thought.Type == thoughtType); }
public bool HasThought(Thought.ThoughtType type) { return Thoughts.Any(existingThought => existingThought.Type == type); }
public ThoughtBuff(float time, Thought.ThoughtType type) : base(time) { ThoughtType = type; }