Пример #1
0
 public static void AddComponents(Entity subject)
 {
     SequentialMobBase.AddComponents(subject,
                                     Algos.EnemyAlgo,
                                     new Step
     {
         action = Compose(Attacking.Action, Moving.Action),
         movs   = Movs.Basic
     },
                                     new Step()
                                     );
 }
Пример #2
0
        public static void AddComponents(Entity subject)
        {
            var steps = new Step[]
            {
                // 0: move. if near player, start exploding
                new Step
                {
                    successFunction = IsPlayerClose(fail: 1, success: 2),
                    action          = Moving.Action,
                    movs            = Movs.Basic,
                    algo            = Algos.EnemyAlgo
                },
                // 1: wait 1 bit. if near player, start exploding
                new Step
                {
                    successFunction = IsPlayerClose(fail: -1, success: 1)
                },
                // 2: exploding, possibly not explode if the player is gone
                new Step
                {
                    successFunction = IsPlayerClose(fail: -1, success:  1),
                },
                // 3: 1 bit delay before the inevitable explosion
                new Step
                {
                    relativeStepIndexSuccess = 1
                },
                // 4: die and explode
                new Step
                {
                    action = DieAndExplodeAction,
                    algo   = Algos.SimpleAlgo
                }
            };

            SequentialMobBase.AddComponents(subject, Algos.StepBased, steps);
        }
Пример #3
0
 public static void AddComponents(Entity subject)
 {
     SequentialMobBase.AddComponents(subject, Algos.EnemyAlgo, Steps);
     Binding.AddTo(subject, Layers.REAL, BoundEntityModifierDefault.Hookable);
 }
Пример #4
0
 public static void AddComponents(Entity subject)
 {
     SequentialMobBase.AddComponents(subject, Algos.EnemyAlgo, Steps);
 }