示例#1
0
 public MountedTurret(IReal wielder, Specs payload, float depth,
                      float turnSpeed, float eleSpeed)
     : base(wielder, payload, depth)
 {
     TurnSpeed = turnSpeed;
     EleSpeed  = eleSpeed;
 }
示例#2
0
 public MountedTurret(IReal wielder, Specs payload, Vector3 offset,
                      float turnSpeed, float eleSpeed)
     : base(wielder, payload, offset)
 {
     TurnSpeed = turnSpeed;
     EleSpeed  = eleSpeed;
 }
示例#3
0
 public Weapon(IReal wielder, Specs payload, Vector3 offset)
     : this(wielder, payload)
 {
     Angle  = (float)Math.Atan2(offset.Y, offset.X);
     Length = new Vector2(offset.X, offset.Y).Length();
     Depth  = offset.Z;
 }
示例#4
0
 public Weapon(IReal wielder, Specs payload, float depth)
     : this(wielder, payload)
 {
     Angle  = 0.0f;
     Length = 0.0f;
     Depth  = depth;
 }
示例#5
0
 static Specs()
 {
     Shrapnel = new Specs(Munition.Cat.KE, 25.0f, 0.65f, 2);
     Grenade  = new Specs(Munition.Cat.KE, 40.0f, 0.95f, true, true, 60, true, 3, 0.9f, 0, Shrapnel);
     Bullet   = new Specs(Munition.Cat.KE, 40.0f, 40);
     Pulse    = new Specs(Munition.Cat.EM, 32.0f, 20);
 }
示例#6
0
        protected void Fire(IReal shooter, Vector3 pos, Vector3 vel, Specs spec)
        {
            Shooter       = shooter;
            Position      = pos;
            Velocity      = vel;
            Specification = spec;

            Gravitized = spec.Gravitized;
            Elasticity = spec.Elasticity;
            Aero       = spec.Aero;
            Active     = true;
            Bounces    = 0;
        }
示例#7
0
 public Specs(Munition.Cat enType, float mv, float aero, bool grav, bool complex,
              int dam, bool bouncy, int maxBounce, float elas, int subNum, Specs submun)
 {
     EnType      = enType;
     MuzzleVel   = mv;
     Aero        = aero;
     Gravitized  = grav;
     Complex     = complex;
     Damage      = dam;
     Bouncy      = bouncy;
     MaxBounces  = maxBounce;
     Elasticity  = elas;
     SubNumber   = subNum;
     Submunition = submun;
 }
示例#8
0
 protected Weapon(IReal wielder, Specs payload)
 {
     Wielder = wielder;
     Payload = payload;
 }
示例#9
0
        public static void Fire(IReal shooter, Vector3 pos, float angle, float elevation, Specs spec)
        {
            // TODO: really wish this could be implemented in the manager somehow
            Munition toFire;

            if (Registry.MunMan.Stored.Count > 0)
            {
                toFire = Registry.MunMan.Stored[0];
            }
            else
            {
                toFire = new Munition();
            }

            toFire.Fire(shooter, pos, Gizmo.VectorFromAngles(angle, elevation, spec.MuzzleVel), spec);
            Registry.MunMan.Add(toFire);
        }