Esempio n. 1
0
        public static void FireTrigger(Vector2 Position, TriggerTypes trigger, TriggerTarget Target, int Value = 0, int Value2 = 0, float Value3 = 0, float Value4 = 0, float Value5 = 0)
        {
            List <TerraGuardian> tgs = new List <TerraGuardian>();

            foreach (int key in MainMod.ActiveGuardians.Keys)
            {
                bool Run = true;
                if ((trigger == TriggerTypes.Death || trigger == TriggerTypes.Spotted) &&
                    (Target.TargetType == TriggerTarget.TargetTypes.TerraGuardian && Target.TargetID == key))
                {
                    Run = false;
                }
                if (Run && (Position == Vector2.Zero || MainMod.ActiveGuardians[key].InPerceptionRange(Position)))
                {
                    MainMod.ActiveGuardians[key].DoTrigger(trigger, Target, Value, Value2, Value3, Value4, Value5);
                    tgs.Add(MainMod.ActiveGuardians[key]);
                }
            }
            TerraGuardian.DoTriggerGroup(tgs, trigger, Target, Value, Value2, Value3, Value4, Value5);
        }