Beispiel #1
0
 internal Cue(string name, Microsoft.Xna.Framework.Audio.Cue innerCue)
 {
     InnerCue = innerCue;
     Name = name;
     InnerCue.Disposing += new System.EventHandler<System.EventArgs>(DoDispose);
     MasterIsPaused = innerCue.IsPaused;
 }
Beispiel #2
0
 private void PlayBGM()
 {
     if (bgm == null || bgm.IsStopped)
     {
         bgm = AudioManager.GetCue("soccer_life_97");
         bgm.Play();
     }
 }
        public override void DoFunction(GameLocation location, int x, int y, int power, StardewValley.Farmer who)
        {
            base.DoFunction(location, x, y, power, who);
            who.Stamina -= ((float)4f - (float)who.FarmingLevel * 0.2f);
            if (this._animal != null && this._animal.type.Value == "Dinosaur" && DataLoader.ModConfig.DisableMeatFromDinosaur)
            {
                return;
            }

            if (this._animal != null && this._animal.age.Value >= (int)this._animal.ageWhenMature.Value)
            {
                (this._animal.home.indoors.Value as AnimalHouse)?.animalsThatLiveHere.Remove(this._animal.myID.Value);
                this._animal.health.Value = -1;
                int numClouds   = this._animal.frontBackSourceRect.Width / 2;
                int cloudSprite = !DataLoader.ModConfig.Softmode ? 5 : 10;
                for (int i = 0; i < numClouds; i++)
                {
                    int   nonRedness = Game1.random.Next(0, 80);
                    Color cloudColor = new Color(255, 255 - nonRedness, 255 - nonRedness);;

                    Game1.currentLocation.temporarySprites.Add
                    (
                        new TemporaryAnimatedSprite
                        (
                            cloudSprite
                            , this._animal.position + new Vector2(Game1.random.Next(-Game1.tileSize / 2, this._animal.frontBackSourceRect.Width * 3)
                                                                  , Game1.random.Next(-Game1.tileSize / 2, this._animal.frontBackSourceRect.Height * 3))
                            , cloudColor
                            , 8
                            , false,
                            Game1.random.NextDouble() < .5 ? 50 : Game1.random.Next(30, 200), 0, Game1.tileSize
                            , -1
                            , Game1.tileSize, Game1.random.NextDouble() < .5 ? 0 : Game1.random.Next(0, 600)
                        )
                    {
                        scale  = Game1.random.Next(2, 5) * .25f,
                        alpha  = Game1.random.Next(2, 5) * .25f,
                        motion = new Vector2(0, (float)-Game1.random.NextDouble())
                    }
                    );
                }
                Color animalColor;
                float alfaFade;
                if (!DataLoader.ModConfig.Softmode)
                {
                    animalColor = Color.LightPink;
                    alfaFade    = .025f;
                }
                else
                {
                    animalColor = Color.White;
                    alfaFade    = .050f;
                }
                Game1.currentLocation.temporarySprites.Add
                (
                    new TemporaryAnimatedSprite
                    (
                        this._animal.Sprite.textureName.Value
                        , this._animal.Sprite.SourceRect
                        , this._animal.position
                        , this._animal.FacingDirection == Game1.left
                        , alfaFade
                        , animalColor
                    )
                {
                    scale = 4f
                }
                );
                if (!DataLoader.ModConfig.Softmode)
                {
                    Game1.playSound("killAnimal");
                }
                else
                {
                    Microsoft.Xna.Framework.Audio.Cue warptSound = Game1.soundBank.GetCue("wand");
                    warptSound.SetVariable("Pitch", 1800);
                    warptSound.Play();
                }

                MeatController.ThrowItem(MeatController.CreateMeat(this._animal), this._animal);
                who.gainExperience(0, 5);
                this._animal     = (FarmAnimal)null;
                this._tempAnimal = (FarmAnimal)null;
            }
        }
Beispiel #4
0
 public override void Start()
 {
     Util.Actors.AddRing(this);
     cue = Util.Sequencer.StartCue(position, Sounds.Select(Sounds.SingingBowl));
 }