예제 #1
0
 public Unit(ShipTypes ShipType, string Name, GameVector Position, GameVector Size, DerivativeControlledParameter Speed,
     DerivativeControlledParameter RotationSpeed,
     DerivativeControlledParameter RotationAngle, Gun Gun, float HP, int team, Shots shots, float BlowDamage, float BlowRadius)
 {
     shipType = ShipType;
     blowDamage = BlowDamage;
     blowRadius = BlowRadius;
     name = Name;
     position = Position;
     size = Size;
     speed = Speed;
     rotationSpeed = RotationSpeed;
     rotationAngle = RotationAngle;
     gun = Gun;
     gun.owner = this;
     this.hp = HP;
     this.team = team;
     maxTimeAfterDeath = 5 * 0.2f;
     timeAfterDeath = 0;
     IsAliveInPrevLoop = true;
     this.shots = Core.shots;
 }
예제 #2
0
 public Unit(ShipTypes ShipType, int Player, GameVector Position, float Angle, string Name)
 {
     shipType = ShipType;
     switch (shipType)
     {
         case ShipTypes.Destroyer:
             blowDamage = 70;
             blowRadius = 40;
             name = Name;
             position = Position;
             size = Core.DestroyerSize;
             speed = new DerivativeControlledParameter(0, 0, 20 * TimingClass.SpeedsMultiplier, 9 * TimingClass.SpeedsMultiplier, false);
             rotationSpeed = new DerivativeControlledParameter(0, -0.22f * TimingClass.SpeedsMultiplier, 0.22f * TimingClass.SpeedsMultiplier, 0.5f * TimingClass.SpeedsMultiplier, false);
             rotationAngle = new DerivativeControlledParameter(Angle, -MathHelper.Pi, MathHelper.Pi, 1000, true);
             gun = new Gun(1, 50 * TimingClass.SpeedsMultiplier, 9 / TimingClass.SpeedsMultiplier, 15);
             gun.owner = this;
             this.hp = 80;
             this.team = Player;
             maxTimeAfterDeath = 5 * 0.2f;
             timeAfterDeath = 0;
             IsAliveInPrevLoop = true;
             this.shots = Core.shots;
             break;
         case ShipTypes.Corvette:
             blowDamage = 150;
             blowRadius = 120;
             maxTimeAfterDeath = 5 * 0.2f;
             speed = new DerivativeControlledParameter(0, 0, 5 * TimingClass.SpeedsMultiplier, 1 * TimingClass.SpeedsMultiplier, false);
             rotationSpeed = new DerivativeControlledParameter(0, -0.12f * TimingClass.SpeedsMultiplier, 0.12f * TimingClass.SpeedsMultiplier, 0.39f * TimingClass.SpeedsMultiplier, false);
             gun = new Gun(1, 50 * TimingClass.SpeedsMultiplier, 18 / TimingClass.SpeedsMultiplier, 40);
             this.hp = 400;
             this.team = Player;
             IsAliveInPrevLoop = true;
             this.shots = Core.shots;
             timeAfterDeath = 0;
             name = Name;
             position = Position;
             size = Core.CorvetteSize;
             //size.Y *= 0.9f; //real object size (see texture)
             rotationAngle = new DerivativeControlledParameter(
                 Angle
                 , -MathHelper.Pi, MathHelper.Pi, 1000, true);
             gun.owner = this;
             break;
         case ShipTypes.Cruiser:
             blowDamage = 300;
             blowRadius = 150;
             maxTimeAfterDeath = 8 * 0.2f;
             speed = new DerivativeControlledParameter(0, 0, 2 * TimingClass.SpeedsMultiplier, 1.0f * TimingClass.SpeedsMultiplier, false);
             rotationSpeed = new DerivativeControlledParameter(0, -0.05f * TimingClass.SpeedsMultiplier, 0.05f * TimingClass.SpeedsMultiplier, 0.2f * TimingClass.SpeedsMultiplier, false);
             gun = new Gun(4, 50 * TimingClass.SpeedsMultiplier, 27 / TimingClass.SpeedsMultiplier, 200);
             this.hp = 800;
             this.team = Player;
             IsAliveInPrevLoop = true;
             this.shots = Core.shots;
             timeAfterDeath = 0;
             name = Name;
             position = Position;
             size = Core.CruiserSize;
             //size.X *= 0.7f; //real object size (see texture)
             //size.Y *= 0.9f; //real object size (see texture)
             rotationAngle = new DerivativeControlledParameter(
                 Angle
                 , -MathHelper.Pi, MathHelper.Pi, 1000, true);
             gun.owner = this;
             break;
     }
 }