Beispiel #1
0
        public static void checkForProgress(GameLocation location, SheetMusic sheet)
        {
            if (sheet.sheetMusicID == "birthday" && (sheet.magic as BirthdayMagic).lastBirthday != null && (sheet.magic as BirthdayMagic).lastBirthday.Name == "Wizard")
            {
                if (Instrument.allAdditionalSaveData.ContainsKey("wizard"))
                {
                    Instrument.allAdditionalSaveData["wizard"] = "true";
                }
                else
                {
                    Instrument.allAdditionalSaveData.Add("wizard", "true");
                }
            }

            if (location is Beach && Game1.isRaining && (location as Beach).bridgeFixed.Value && Game1.player.getTileX() > 70 && Game1.player.getTileY() < 15)
            {
                if (Instrument.allAdditionalSaveData.ContainsKey("mariner"))
                {
                    List <string> played = new List <string>(Instrument.allAdditionalSaveData["mariner"].Split(' '));
                    if (played.Contains(sheet.sheetMusicID) || played.Count >= 5)
                    {
                        return;
                    }

                    played.Add(sheet.sheetMusicID);
                    Instrument.allAdditionalSaveData["mariner"] = String.Join(" ", played.ToArray());
                }
                else
                {
                    Instrument.allAdditionalSaveData.Add("mariner", sheet.sheetMusicID);
                }

                Game1.playSound("crystal");
            }

            if (location is Farm && Game1.player.getTileX() < 15 && Game1.player.getTileY() < 15)
            {
                if (Instrument.allAdditionalSaveData.ContainsKey("granpa"))
                {
                    List <string> played = new List <string>(Instrument.allAdditionalSaveData["granpa"].Split(' '));
                    if (played.Contains(sheet.sheetMusicID) || played.Count >= 2)
                    {
                        return;
                    }

                    played.Add(sheet.sheetMusicID);
                    Instrument.allAdditionalSaveData["granpa"] = String.Join(" ", played.ToArray());
                }
                else
                {
                    Instrument.allAdditionalSaveData.Add("granpa", sheet.sheetMusicID);
                }

                Game1.playSound("crystal");
            }
        }
        private static Letter checkForLetter()
        {
            Dictionary <string, string> stats = Instrument.allAdditionalSaveData;

            if (!Instrument.hasInstument("harp"))
            {
                return(DataLoader.getLetter("hoy_birthday"));
            }

            if (Game1.player.isMarried() && !SheetMusic.hasSheet("yoba"))
            {
                return(DataLoader.getLetter("hoy_yoba"));
            }

            if (Game1.player.eventsSeen.Contains(2) && !SheetMusic.hasSheet("thunder"))
            {
                return(DataLoader.getLetter("hoy_thunder"));
            }

            if (Game1.player.eventsSeen.Contains(14) && !SheetMusic.hasSheet("animals"))
            {
                return(DataLoader.getLetter("hoy_animals"));
            }

            if (Game1.stats.monstersKilled >= 100 && !SheetMusic.hasSheet("adventure"))
            {
                return(DataLoader.getLetter("hoy_adventure"));
            }

            if (Game1.player.eventsSeen.Contains(191393) && !SheetMusic.hasSheet("wanderer"))
            {
                return(DataLoader.getLetter("hoy_wanderer"));
            }

            if (stats.ContainsKey("wizard") && stats["wizard"] == "true" && !SheetMusic.hasSheet("dark"))
            {
                return(DataLoader.getLetter("hoy_dark"));
            }

            if (stats.ContainsKey("mariner") && stats["mariner"].Split(' ').Length >= 5 && !SheetMusic.hasSheet("fisher"))
            {
                return(DataLoader.getLetter("hoy_mariner"));
            }

            if (stats.ContainsKey("granpa") && stats["granpa"].Split(' ').Length >= 2 && !SheetMusic.hasSheet("granpa"))
            {
                return(DataLoader.getLetter("hoy_granpa"));
            }

            if (Game1.player.eventsSeen.Contains(18) && !SheetMusic.hasSheet("time"))
            {
                return(DataLoader.getLetter("hoy_time"));
            }

            return(null);
        }
Beispiel #3
0
        private void play()
        {
            if (attachments[0] == null)
            {
                return;
            }

            priorMusic    = Game1.currentSong.Name;
            priorLocation = Game1.currentLocation;

            SheetMusic sheet = (SheetMusic)attachments[0];

            PyUtils.setDelayedAction(1000, animation.animate);
            PyUtils.setDelayedAction(sheet.length / 2, doMagic);
            PyUtils.setDelayedAction(sheet.length, resetMusic);
            PyUtils.setDelayedAction(sheet.length + 1000, stop);

            animation.preAnimation();
            sheet.play();
        }
Beispiel #4
0
        private static Letter checkForLetter()
        {
            string      sentLetter            = "none";
            List <Item> items                 = new List <Item>();
            Dictionary <string, string> stats = Instrument.allAdditionalSaveData;

            if (!Instrument.hasInstument("harp") && !SheetMusic.hasSheet("birthday"))
            {
                sentLetter = DataLoader.getLetter("birthday");
                items.Add(new Instrument("harp"));
                items.Add(new SheetMusic("birthday"));
                return(new Letter(sentLetter, items));
            }

            if (!Instrument.hasInstument("harp"))
            {
                sentLetter = DataLoader.getLetter("birthday");
                items.Add(new Instrument("harp"));
                return(new Letter(sentLetter, items));
            }

            if (!SheetMusic.hasSheet("birthday"))
            {
                sentLetter = DataLoader.getLetter("birthday");
                items.Add(new SheetMusic("birthday"));
                return(new Letter(sentLetter, items));
            }

            if (Game1.player.isMarried() && !SheetMusic.hasSheet("yoba"))
            {
                sentLetter = DataLoader.getLetter("yoba");
                items.Add(new SheetMusic("yoba"));

                return(new Letter(sentLetter, items));
            }

            if (Game1.player.eventsSeen.Contains(2) && !SheetMusic.hasSheet("thunder"))
            {
                sentLetter = DataLoader.getLetter("thunder");
                items.Add(new SheetMusic("thunder"));

                return(new Letter(sentLetter, items));
            }

            if (Game1.player.eventsSeen.Contains(14) && !SheetMusic.hasSheet("animals"))
            {
                sentLetter = DataLoader.getLetter("animals");
                items.Add(new SheetMusic("animals"));

                return(new Letter(sentLetter, items));
            }

            if (Game1.stats.monstersKilled >= 100 && !SheetMusic.hasSheet("adventure"))
            {
                sentLetter = DataLoader.getLetter("adventure");
                items.Add(new SheetMusic("adventure"));

                return(new Letter(sentLetter, items));
            }

            if (Game1.player.eventsSeen.Contains(191393) && !SheetMusic.hasSheet("wanderer"))
            {
                sentLetter = DataLoader.getLetter("wanderer");
                items.Add(new SheetMusic("wanderer"));

                return(new Letter(sentLetter, items));
            }

            if (stats.ContainsKey("wizard") && stats["wizard"] == "true" && !SheetMusic.hasSheet("dark"))
            {
                sentLetter = DataLoader.getLetter("dark");
                items.Add(new SheetMusic("dark"));

                return(new Letter(sentLetter, items));
            }

            if (stats.ContainsKey("mariner") && stats["mariner"].Split(' ').Length >= 5 && !SheetMusic.hasSheet("fisher"))
            {
                sentLetter = DataLoader.getLetter("fisher");
                items.Add(new SheetMusic("fisher"));

                return(new Letter(sentLetter, items));
            }

            if (stats.ContainsKey("granpa") && stats["granpa"].Split(' ').Length >= 2 && !SheetMusic.hasSheet("granpa"))
            {
                sentLetter = DataLoader.getLetter("granpa");
                items.Add(new SheetMusic("granpa"));

                return(new Letter(sentLetter, items));
            }

            if (Game1.player.eventsSeen.Contains(18) && !SheetMusic.hasSheet("time"))
            {
                sentLetter = DataLoader.getLetter("time");
                items.Add(new SheetMusic("time"));

                return(new Letter(sentLetter, items));
            }

            return((Letter)null);
        }
Beispiel #5
0
        private void doMagic()
        {
            SheetMusic sheet = (SheetMusic)attachments[0];

            sheet.doMagic();
        }
 private void SaveHandler_BeforeRebuilding2(object sender, EventArgs e)
 {
     Instrument.beforeRebuilding();
     SheetMusic.beforeRebuilding();
 }