private void Setup() { Name = "Fragment Missile"; Kind = "Primary"; energyCostPerSecond = 12f; delay = 450; Weight = 500; ActivatedSoundID = SoundEffects.ClickLaser; displaySprite = Game.spriteSheetItemDisplay.GetSubSprite(new Rectangle(800, 0, 100, 100)); bullet = new RegularMissile(Game, spriteSheet); bullet.Initialize(); MissileFragment fragment = new MissileFragment(Game, spriteSheet); fragment.Initialize(); damage = fragment.Damage; duration = Bullet.Duration; speed = Bullet.Speed; Value = 1000; Tier = TierType.Great; numberOfShots = 23; }
private void Explode() { for (int n = 0; n < fragments; n++) { MissileFragment fragment = new MissileFragment(Game, spriteSheet); fragment.Initialize(); fragment.Position = Position; fragment.Duration = 400; fragment.Direction = MathFunctions.SpreadDir(new Vector2(0, -1), Math.PI / 3); float fragmentBaseSpeed = 0.6f; fragment.Speed = (float)(random.NextDouble() * fragmentBaseSpeed + fragmentBaseSpeed); fragment.Speed *= 0.5f; Game.stateManager.shooterState.gameObjects.Add(fragment); } }