Пример #1
0
        public BaseProjectile(Texture2D txr, Vector2 position, Color tint, Vector2 startSpeed, float scale, int fps, int framesX, int framesY, int damage, float speed, float range, int damageIndex, OffensiveModule parent)
            : base(txr, position, tint, startSpeed, 0, scale, fps, framesX, framesY)
        {
            m_damage          = damage;
            m_dmgTick         = damage / 600;
            m_projectileSpeed = speed;
            m_range           = range;

            m_timer = 0.05f;

            m_startPos = position;

            m_velocity = startSpeed;

            m_collisionCircle     = new Circle(m_position.X, m_position.Y, 18 * scale);
            m_collisionCircleRear = new Circle(m_position.X, m_position.Y, 18 * scale);
            m_rangeCircle         = new Circle(m_position.X, m_position.Y, 36 * range);

            m_currentRange = 0;

            m_projectileIndex = damageIndex;

            m_parentModule = parent;
        }
Пример #2
0
 public FlameProjectile(Texture2D txr, Vector2 position, Color tint, Vector2 startSpeed, float scale, int fps, int framesX, int framesY, int damage, float speed, float range, int damageIndex, OffensiveModule parent)
     : base(txr, position, tint, startSpeed, scale, fps, framesX, framesY, damage, speed, range, damageIndex, parent)
 {
     m_projectileIndex = 4;
 }
Пример #3
0
        public SplashWave(Texture2D txr, Vector2 position, Color tint, Vector2 startSpeed, float scale, int fps, int framesX, int framesY, int damage, float speed, float range, int damageIndex, OffensiveModule parent)
            : base(txr, position, tint, startSpeed, scale, fps, framesX, framesY, damage, speed, range, damageIndex, parent)
        {
            m_srcRect = new Rectangle(0, 0, m_txr.Width, m_txr.Height);

            m_collisionCircle.Centre = m_position;

            m_projectileIndex = 5;
        }
Пример #4
0
        public Laser(Texture2D txr, Vector2 position, Color tint, Vector2 startSpeed, float scale, int fps, int framesX, int framesY, int damage, float speed, float range, int damageIndex, OffensiveModule parent, Vector2 pos, float rotation)
            : base(txr, position, tint, startSpeed, scale, fps, framesX, framesY, damage, speed, range, damageIndex, parent)
        {
            m_projectileIndex = 2;

            m_colours       = new Color[12];
            m_changeTime    = m_parentModule.FinalFireRate / 12;
            m_elapsed       = 0;
            m_nextColour    = 1;
            m_currentColour = 0;

            #region Rainbow Colours
            m_colours[0]  = Color.Red;
            m_colours[1]  = Color.Orange;
            m_colours[2]  = Color.Yellow;
            m_colours[3]  = Color.YellowGreen;
            m_colours[4]  = Color.Green;
            m_colours[5]  = Color.Turquoise;
            m_colours[6]  = Color.Cyan;
            m_colours[7]  = Color.DodgerBlue;
            m_colours[8]  = Color.Blue;
            m_colours[9]  = new Color(128, 0, 255);
            m_colours[10] = Color.Magenta;
            m_colours[11] = new Color(255, 0, 128);
            #endregion

            m_rot = rotation;

            m_timer = 0.25f;

            m_bits = new List <LaserBit>();

            // Lock laser to the weapon
            m_position = m_parentModule.BlastPos();
            Vector2 nextParticlePos = GetRotationVector(m_rot) * 3;
            Vector2 spawnVec        = m_position;

            for (int i = 0; m_parentModule.RangeCircle.Contains(spawnVec); i++)
            {
                spawnVec = m_position + (i * nextParticlePos);
                m_bits.Add(new LaserBit(m_txr, spawnVec, m_colours[0], new Circle(spawnVec.X, spawnVec.X, 2)));
            }
        }