Ejemplo n.º 1
0
        public TriggerAfterTimeEllapsed(MagicUserParams Params, double SecondsToWait)
            : base("Time Ellapsed", false, 40, Params)
        {
            SetAttributes(new MagicElementAttributeSlider("Seconds to wait", SecondsToWait, 0d, 100d, (NewValue) => this.SecondsToWait = NewValue));

            this.SecondsToWait = SecondsToWait;
        }
Ejemplo n.º 2
0
        public Fireball(MagicUserParams MagicParams, ProjectileParams Params, IMagicUser Parent)
            : base(MagicParams, 500)
        {
            this.Params = Params;
            this.Parent = Parent;

            Damage = 5;
            Speed = new Vector2(-(float)Math.Cos(Params.SharedParams.OwnerAngle) * 6, (float)Math.Sin(Params.SharedParams.OwnerAngle) * 6);

            Rectangle CollisionBox = new Rectangle(0, 0, 50, 32);

            float MinX = Params.SharedParams.OwnerPosition.X - CollisionBox.Width / 2f;
            float MinY = Params.SharedParams.OwnerPosition.Y - CollisionBox.Height / 2f;
            float MaxX = MinX + CollisionBox.Width;
            float MaxY = MinY + CollisionBox.Height;

            Polygon NewPolygon = new Polygon();
            NewPolygon.ArrayVertex = new Vector2[4];
            NewPolygon.ArrayVertex[0] = new Vector2(MinX, MinY);
            NewPolygon.ArrayVertex[1] = new Vector2(MinX, MaxY);
            NewPolygon.ArrayVertex[2] = new Vector2(MaxX, MaxY);
            NewPolygon.ArrayVertex[3] = new Vector2(MaxX, MinY);

            NewPolygon.ComputePerpendicularAxis();
            NewPolygon.ComputerCenter();

            Collision.ListCollisionPolygon = new List<Polygon>(1) { NewPolygon };
            MagicParams.SetMagicUser(Parent);
        }
 public MagicRequirement(string SkillRequirementName, MagicUserParams MagicParams)
     : base(SkillRequirementName)
 {
     if (MagicParams != null)
     {
         this.MagicParams = new MagicUserParams(MagicParams);
     }
 }
Ejemplo n.º 4
0
 public OffsetEffect(MagicUserParams MagicParams, ProjectileParams AttackParams, MagicCoreOffset Owner, Vector2 Offset)
     : base("Offset Effect " + Key++, false, MagicParams)
 {
     IsStacking = true;
     MaximumStack = -1;//Allow a user to have more than one effect.
     this.AttackParams = new ProjectileParams(AttackParams);
     this.Owner = Owner;
     this.Offset = Offset;
 }
Ejemplo n.º 5
0
        public MagicCoreOffset(MagicUserParams Params, ProjectileParams AttackParams, float OffsetX, float OffsetY)
            : base("Offset Core", 0, 0, 40, Params, AttackParams)
        {
            SetAttributes(
                  new MagicElementAttributeSlider("Offset X", OffsetX, -100d, 100d, (X) => this.OffsetX = (float)X),
                  new MagicElementAttributeSlider("Offset Y", OffsetY, -100d, 100d, (Y) => this.OffsetY = (float)Y));

            this.OffsetX = OffsetX;
            this.OffsetY = OffsetY;
        }
Ejemplo n.º 6
0
        public CreateFireballEffect(double ExtraAngleInDegrees, MagicUserParams MagicParams, ProjectileParams Params, MagicCoreFireball Owner)
            : base("Fireball Effect", false, MagicParams)
        {
            this.ExtraAngleInDegrees = ExtraAngleInDegrees;
            this.Params = new ProjectileParams(Params);
            this.Owner = Owner;

            IsStacking = true;
            MaximumStack = -1;//Allow a user to have more than one fireball.
        }
Ejemplo n.º 7
0
            public TimeEllapsedRequirement(MagicUserParams Params, double TimeToWait)
                : base(Name)
            {
                this.Params = Params;

                this.TimeToWait = TimeToWait;
                MaxExecutions = 1;
                Delay = 0d;
                CreateTime = Constants.TotalGameTime;
            }
Ejemplo n.º 8
0
        public MagicUserParams(MagicUserParams Clone)
        {
            GlobalContext = Clone.GlobalContext;
            LocalContext  = new MagicUserContext();

            LocalContext.ActiveUser   = Clone.LocalContext.ActiveUser;
            LocalContext.ActiveTarget = Clone.LocalContext.ActiveTarget;

            CopyGlobalIntoLocal();
        }
        public MagicEffect(string EffectTypeName, bool IsPassive, MagicUserParams MagicParams)
            : base(EffectTypeName, IsPassive)
        {
            Effects        = new EffectHolder();
            ListLinkedUser = new List <IMagicUser>();

            if (MagicParams != null)
            {
                this.MagicParams = new MagicUserParams(MagicParams);
            }
        }
Ejemplo n.º 10
0
        protected MagicElement(string Name, bool CanRotate, int Radius, MagicUserParams MagicParams)
        {
            _ArrayAttributes = new MagicElementAttribute[0];

            this.Name      = Name;
            this.CanRotate = CanRotate;
            this.Radius    = Radius;

            if (MagicParams != null)
            {
                this.MagicParams = new MagicUserParams(MagicParams);
            }

            ListLinkedMagicElement = new List <MagicElement>();
            ManaCost = 0;
            IsValid  = true;
        }
Ejemplo n.º 11
0
        public static Dictionary <string, MagicElement> LoadElements(MagicUserParams Params)
        {
            Dictionary <string, MagicElement> DicMagicCoreByType = new Dictionary <string, MagicElement>();

            string[] Files = Directory.GetFiles("Magic", "*.dll");
            for (int F = 0; F < Files.Length; F++)
            {
                Assembly            ActiveAssembly = Assembly.LoadFile(Path.GetFullPath(Files[F]));
                List <MagicElement> ListMagicCore  = ReflectionHelper.GetObjectsFromTypes <MagicElement>(typeof(MagicElement), ActiveAssembly.GetTypes(), Params);

                foreach (MagicElement Instance in ListMagicCore)
                {
                    DicMagicCoreByType.Add(Instance.Name, Instance);
                }
            }

            return(DicMagicCoreByType);
        }
 public ChannelInternalManaEffect(MagicUserParams MagicParams)
     : base(Name, true, MagicParams)
 {
 }
Ejemplo n.º 13
0
 public MagicProjectile(MagicUserParams MagicParams, double Lifetime)
     : base(Lifetime)
 {
     this.MagicParams = MagicParams;
 }
Ejemplo n.º 14
0
 public MagicCoreFireball(MagicUserParams MagicParams, ProjectileParams Params)
     : base("Fireball Core", 1, 10, 40, MagicParams, Params)
 {
     SetAttributes(new MagicElementAttribute[] { new MagicElementAttributeSlider("Extra Angle", 0, -180, 180, (NewAngle) => ExtraAngleInDegrees = NewAngle) });
 }
Ejemplo n.º 15
0
 public TriggerAfterTimeEllapsed(MagicUserParams Params)
     : this(Params, 0d)
 {
 }
Ejemplo n.º 16
0
 public MagicCoreOffset(MagicUserParams Params, ProjectileParams AttackParams)
     : this(Params, AttackParams, 0, 0)
 {
 }
Ejemplo n.º 17
0
        public OffsetSpawnLocation(MagicUserParams Params)
            : base("Offset Spawn", false, 40, Params)
        {

        }
Ejemplo n.º 18
0
        public IncreasePower(MagicUserParams Params)
            : base("Increase Power", false, 40, Params)
        {

        }
Ejemplo n.º 19
0
        public StopOnCollision(MagicUserParams Params)
            : base("Stop On Collision", false, 40, Params)
        {

        }
Ejemplo n.º 20
0
        public AlignWithParent(MagicUserParams Params)
            : base("Align With Parent", false, 40, Params)
        {

        }
Ejemplo n.º 21
0
        public IncreaseResistance(MagicUserParams Params)
            : base("Increase Resistance", false, 40, Params)
        {

        }
 public ManaChanneledRequirement(float ManaRequired, MagicUserParams MagicParams)
     : base(Name, MagicParams)
 {
     this.ManaRequired = 10;
 }
Ejemplo n.º 23
0
        public SetRotation(MagicUserParams Params)
            : base("Set Rotation", false, 40, Params)
        {

        }
Ejemplo n.º 24
0
        public IncreaseRotationSpeed(MagicUserParams Params)
            : base("Increase Rotation Speed", false, 40, Params)
        {

        }
 public EmptyChanneledManaEffect(MagicUserParams Params)
     : base(Name, false, Params)
 {
 }
Ejemplo n.º 26
0
        public MagicCoreEnchantlLevel1(MagicUserParams Params)
            : base("Enchant", 1, 1, 1, Params)
        {

        }
Ejemplo n.º 27
0
        public IncreaseLaunchSpeed(MagicUserParams Params)
            : base("Increase Launch Speed", false, 40, Params)
        {

        }
Ejemplo n.º 28
0
 public ChannelInternalManaSource(MagicUserParams Params)
     : base("Channel Internal Mana Source", false, 40, Params)
 {
 }
 public ChannelExternalManaEffect(MagicUserParams Params)
     : base(Name, true, Params)
 {
 }
Ejemplo n.º 30
0
        public IncreaseDuration(MagicUserParams Params)
            : base("Increase Duration", false, 40, Params)
        {

        }