예제 #1
0
 public void AddThought(Thought.ThoughtType type)
 {
     if (!HasThought(type))
     {
         AddThought(Thought.CreateStandardThought(type, PlayState.Time.CurrentDate), true);
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        /// <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);
        }
예제 #8
0
        /// <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);
                }
            }
        }
예제 #9
0
        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);
        }
예제 #10
0
 public override void OnApply(Creature creature)
 {
     SavedThought = creature.AddThought(Description, new TimeSpan(1, 0, 0, 0), HappinessModifier);
     base.OnApply(creature);
 }
예제 #11
0
 public void AddThought(Thought thought, bool allowDuplicates)
 {
     Physics.GetComponent <DwarfThoughts>()?.AddThought(thought, allowDuplicates);
 }
예제 #12
0
        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);
        }
예제 #13
0
 /// <summary> Remove a standard thought from the creature. </summary>
 public void RemoveThought(Thought Thought)
 {
     Thoughts.Remove(Thought);
 }
예제 #14
0
 public void RemoveThought(Thought.ThoughtType thoughtType)
 {
     Thoughts.RemoveAll(thought => thought.Type == thoughtType);
 }
예제 #15
0
 public bool HasThought(Thought.ThoughtType type)
 {
     return Thoughts.Any(existingThought => existingThought.Type == type);
 }
예제 #16
0
 public ThoughtBuff(float time, Thought.ThoughtType type)
     : base(time)
 {
     ThoughtType = type;
 }
예제 #17
0
 public void AddThought(Thought.ThoughtType type)
 {
     if (!HasThought(type))
     {
         AddThought(Thought.CreateStandardThought(type, PlayState.Time.CurrentDate), true);
     }
 }