public override bool checkIfComplete(NPC n = null, int number1 = -1, int number2 = -1, Item item = null, string monsterName = null)
 {
     if ((bool)completed)
     {
         return(false);
     }
     if (monsterName == null)
     {
         monsterName = "Green Slime";
     }
     if (n == null && monsterName != null && monsterName.Contains(this.monsterName.Value) && (int)numberKilled < (int)numberToKill)
     {
         numberKilled.Value = Math.Min(numberToKill, (int)numberKilled + 1);
         if ((int)numberKilled >= (int)numberToKill)
         {
             if (target.Value == null || target.Value.Equals("null"))
             {
                 questComplete();
             }
             else
             {
                 NPC actualTarget = Game1.getCharacterFromName(target);
                 objective.Value = new DescriptionElement("Strings\\StringsFromCSFiles:FishingQuest.cs.13277", actualTarget);
                 Game1.playSound("jingle1");
             }
         }
         else if (monster.Value == null)
         {
             if (monsterName == "Frost Jelly" || monsterName == "Sludge")
             {
                 monster.Value      = new Monster("Green Slime", Vector2.Zero);
                 monster.Value.Name = monsterName;
             }
             else
             {
                 monster.Value = new Monster(monsterName, Vector2.Zero);
             }
         }
         Game1.dayTimeMoneyBox.moneyDial.animations.Add(new TemporaryAnimatedSprite("LooseSprites\\Cursors", new Rectangle(387, 497, 3, 8), 800f, 1, 0, Game1.dayTimeMoneyBox.position + new Vector2(228f, 244f), flicker: false, flipped: false, 1f, 0.01f, Color.White, 4f, 0.3f, 0f, 0f)
         {
             scaleChangeChange = -0.012f
         });
     }
     else if (n != null && target.Value != null && !target.Value.Equals("null") && (int)numberKilled >= (int)numberToKill && n.Name.Equals(target.Value) && n.isVillager())
     {
         reloadDescription();
         n.CurrentDialogue.Push(new Dialogue(targetMessage, n));
         moneyReward.Value = reward;
         questComplete();
         Game1.drawDialogue(n);
         return(true);
     }
     return(false);
 }
示例#2
0
 public virtual void PerformCompleteAnimation()
 {
     if (upgradeName.Contains("Volcano"))
     {
         for (int j = 0; j < 16; j++)
         {
             locationRef.Value.temporarySprites.Add(new TemporaryAnimatedSprite(5, Utility.getRandomPositionInThisRectangle(upgradeRect, Game1.random) * 64f, Color.White)
             {
                 motion                    = new Vector2(Game1.random.Next(-1, 2), -1f),
                 scale                     = 1f,
                 layerDepth                = 1f,
                 drawAboveAlwaysFront      = true,
                 delayBeforeAnimationStart = j * 15
             });
             TemporaryAnimatedSprite t4 = new TemporaryAnimatedSprite("LooseSprites\\Cursors2", new Microsoft.Xna.Framework.Rectangle(65, 229, 16, 6), Utility.getRandomPositionInThisRectangle(upgradeRect, Game1.random) * 64f, Game1.random.NextDouble() < 0.5, 0f, Color.White)
             {
                 motion               = new Vector2(Game1.random.Next(-2, 3), -16f),
                 acceleration         = new Vector2(0f, 0.5f),
                 rotationChange       = (float)Game1.random.Next(-4, 5) * 0.05f,
                 scale                = 4f,
                 animationLength      = 1,
                 totalNumberOfLoops   = 1,
                 interval             = 1000 + Game1.random.Next(500),
                 layerDepth           = 1f,
                 drawAboveAlwaysFront = true,
                 yStopCoordinate      = (upgradeRect.Bottom + 1) * 64
             };
             t4.reachedStopCoordinate = t4.bounce;
             locationRef.Value.TemporarySprites.Add(t4);
             t4 = new TemporaryAnimatedSprite("LooseSprites\\Cursors2", new Microsoft.Xna.Framework.Rectangle(65, 229, 16, 6), Utility.getRandomPositionInThisRectangle(upgradeRect, Game1.random) * 64f, Game1.random.NextDouble() < 0.5, 0f, Color.White)
             {
                 motion               = new Vector2(Game1.random.Next(-2, 3), -16f),
                 acceleration         = new Vector2(0f, 0.5f),
                 rotationChange       = (float)Game1.random.Next(-4, 5) * 0.05f,
                 scale                = 4f,
                 animationLength      = 1,
                 totalNumberOfLoops   = 1,
                 interval             = 1000 + Game1.random.Next(500),
                 layerDepth           = 1f,
                 drawAboveAlwaysFront = true,
                 yStopCoordinate      = (upgradeRect.Bottom + 1) * 64
             };
             t4.reachedStopCoordinate = t4.bounce;
             locationRef.Value.TemporarySprites.Add(t4);
         }
         if (locationRef.Value == Game1.currentLocation)
         {
             Game1.flashAlpha = 1f;
             Game1.playSound("boulderBreak");
         }
     }
     else if ((string)upgradeName == "House")
     {
         for (int i = 0; i < 16; i++)
         {
             locationRef.Value.temporarySprites.Add(new TemporaryAnimatedSprite(5, Utility.getRandomPositionInThisRectangle(upgradeRect, Game1.random) * 64f, Color.White)
             {
                 motion                    = new Vector2(Game1.random.Next(-1, 2), -1f),
                 scale                     = 1f,
                 layerDepth                = 1f,
                 drawAboveAlwaysFront      = true,
                 delayBeforeAnimationStart = i * 15
             });
             TemporaryAnimatedSprite t2 = new TemporaryAnimatedSprite("LooseSprites\\Cursors2", new Microsoft.Xna.Framework.Rectangle(49 + 16 * Game1.random.Next(3), 229, 16, 6), Utility.getRandomPositionInThisRectangle(upgradeRect, Game1.random) * 64f, Game1.random.NextDouble() < 0.5, 0f, Color.White)
             {
                 motion               = new Vector2(Game1.random.Next(-2, 3), -16f),
                 acceleration         = new Vector2(0f, 0.5f),
                 rotationChange       = (float)Game1.random.Next(-4, 5) * 0.05f,
                 scale                = 4f,
                 animationLength      = 1,
                 totalNumberOfLoops   = 1,
                 interval             = 1000 + Game1.random.Next(500),
                 layerDepth           = 1f,
                 drawAboveAlwaysFront = true,
                 yStopCoordinate      = (upgradeRect.Bottom + 1) * 64
             };
             t2.reachedStopCoordinate = t2.bounce;
             locationRef.Value.TemporarySprites.Add(t2);
             t2 = new TemporaryAnimatedSprite("LooseSprites\\Cursors2", new Microsoft.Xna.Framework.Rectangle(49 + 16 * Game1.random.Next(3), 229, 16, 6), Utility.getRandomPositionInThisRectangle(upgradeRect, Game1.random) * 64f, Game1.random.NextDouble() < 0.5, 0f, Color.White)
             {
                 motion               = new Vector2(Game1.random.Next(-2, 3), -16f),
                 acceleration         = new Vector2(0f, 0.5f),
                 rotationChange       = (float)Game1.random.Next(-4, 5) * 0.05f,
                 scale                = 4f,
                 animationLength      = 1,
                 totalNumberOfLoops   = 1,
                 interval             = 1000 + Game1.random.Next(500),
                 layerDepth           = 1f,
                 drawAboveAlwaysFront = true,
                 yStopCoordinate      = (upgradeRect.Bottom + 1) * 64
             };
             t2.reachedStopCoordinate = t2.bounce;
             locationRef.Value.TemporarySprites.Add(t2);
         }
         if (locationRef.Value == Game1.currentLocation)
         {
             Game1.flashAlpha = 1f;
             Game1.playSound("boulderBreak");
         }
     }
     else if (((string)upgradeName == "Resort" || (string)upgradeName == "Trader" || (string)upgradeName == "Obelisk") && locationRef.Value == Game1.currentLocation)
     {
         Game1.flashAlpha = 1f;
     }
     if (locationRef.Value == Game1.currentLocation && (string)upgradeName != "Hut")
     {
         DelayedAction.playSoundAfterDelay("secret1", 800);
     }
 }