public HitscanBox(float Damage, Weapon.ExplosionOptions ExplosionAttributes, RobotAnimation Owner, Vector2 Position, float Angle)
            : base(Damage, ExplosionAttributes, Owner, false)
        {
            this.Angle = Angle;
            Lifetime   = 50;

            Owner.SetAttackContext(this, Owner, Angle, Position);

            float CosA = (float)Math.Cos(Angle);
            float SinA = (float)Math.Sin(Angle);
            float MinX = Position.X;
            float MinY = Position.Y;
            float MaxX = MinX + CosA * HitscanLength;
            float MaxY = MinY + SinA * HitscanLength;

            Speed = new Vector2(CosA * 100000, SinA * 100000);

            Polygon NewPolygon = new Polygon();

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

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

            ListCollisionPolygon = new List <Polygon>(1)
            {
                NewPolygon
            };
        }
示例#2
0
        public AttackBox(float Damage, Weapon.ExplosionOptions ExplosionAttributes, RobotAnimation Owner, double Lifetime, bool FollowOwner)
            : base(Lifetime)
        {
            ListAttackedRobots = new List <RobotAnimation>();

            this.Owner  = Owner;
            this.Damage = Damage;
            this.ExplosionAttributes = ExplosionAttributes;
            this.FollowOwner         = FollowOwner;
            ListAttackedRobots.Add(Owner);
        }
            public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
            {
                IWindowsFormsEditorService svc = (IWindowsFormsEditorService)
                                                 provider.GetService(typeof(IWindowsFormsEditorService));

                if (svc != null)
                {
                    Weapon.ExplosionOptions   ActiveParams = (Weapon.ExplosionOptions)value;
                    ExplosionAttributesEditor NewEditor    = new ExplosionAttributesEditor(ActiveParams);
                    if (NewEditor.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        value = NewEditor.ExplosionAttributes;
                    }
                }
                return(value);
            }
示例#4
0
        public ExplosionAttributesEditor(Weapon.ExplosionOptions ExplosionAttributes)
            : this()
        {
            this.ExplosionAttributes = ExplosionAttributes;

            txtExplosionRadius.Value = (decimal)ExplosionAttributes.ExplosionRadius;

            txtExplosionWindPowerAtCenter.Value         = (decimal)ExplosionAttributes.ExplosionWindPowerAtCenter;
            txtExplosionWindPowerAtEdge.Value           = (decimal)ExplosionAttributes.ExplosionWindPowerAtEdge;
            txtExplosionWindPowerToSelfMultiplier.Value = (decimal)ExplosionAttributes.ExplosionWindPowerToSelfMultiplier;

            txtExplosionDamageAtCenter.Value         = (decimal)ExplosionAttributes.ExplosionDamageAtCenter;
            txtExplosionDamageAtEdge.Value           = (decimal)ExplosionAttributes.ExplosionDamageAtEdge;
            txtExplosionDamageToSelfMultiplier.Value = (decimal)ExplosionAttributes.ExplosionDamageToSelfMultiplier;

            txtProjectilePath.Text = ExplosionAttributes.ExplosionAnimation.Path;
            txtSoundPath.Text      = ExplosionAttributes.sndExplosionPath;
        }
        public ProjectileBox(float Damage, Weapon.ExplosionOptions ExplosionAttributes, RobotAnimation Owner,
                             Vector2 Position, Vector2 Size, float Angle, ProjectileInfo ActiveProjectileInfo)
            : base(Damage, ExplosionAttributes, Owner, false)
        {
            this.ActiveProjectileInfo = ActiveProjectileInfo;
            this.Position             = Position;
            this.Angle             = Angle;
            this.AffectedByGravity = ActiveProjectileInfo.AffectedByGravity;

            this.Speed = new Vector2((float)Math.Cos(Angle) * ActiveProjectileInfo.ProjectileSpeed, (float)Math.Sin(Angle) * ActiveProjectileInfo.ProjectileSpeed);

            ProjectileAnimation          = ActiveProjectileInfo.ProjectileAnimation.Copy();
            ProjectileAnimation.Position = Position;

            if (ActiveProjectileInfo.TrailAnimation != null)
            {
                TrailAnimation          = ActiveProjectileInfo.TrailAnimation.Copy();
                TrailAnimation.Position = Position;
            }

            Owner.SetAttackContext(this, Owner, Angle, Position);

            float MinX = Position.X - Size.X / 2f;
            float MinY = Position.Y - Size.Y / 2f;
            float MaxX = MinX + Size.X;
            float MaxY = MinY + Size.Y;


            Polygon NewPolygon = new Polygon();

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

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

            ListCollisionPolygon = new List <Polygon>(1)
            {
                NewPolygon
            };
        }
示例#6
0
        protected override void DoCopyMembers(BaseEffect Copy)
        {
            CreateExplosionEffect NewEffect = (CreateExplosionEffect)Copy;

            _ExplosionAttributes = NewEffect._ExplosionAttributes;
        }
示例#7
0
 protected override void Load(BinaryReader BR)
 {
     _ExplosionAttributes = new Weapon.ExplosionOptions(BR);
 }
示例#8
0
 public CreateExplosionEffect(TripleThunderAttackParams Params)
     : base(Name, false, Params)
 {
     _ExplosionAttributes = new Weapon.ExplosionOptions();
     _ExplosionAttributes.ExplosionAnimation = new SimpleAnimation();
 }