Esempio n. 1
0
 public void AddAshleyToFestival(string festival)
 {
     if (festival == "Luau")
     {
         Vector2   ashleyPos    = new Vector2((float)(14 * Game1.tileSize), (float)(39 * Game1.tileSize));
         int       ashleyFacing = 1;
         AshleyNPC ashley       = new AshleyNPC(new AnimatedSprite(Game1.content.Load <Texture2D>("Characters\\Ashley"), 0, 24, Game1.tileSize * 2 / 4), ashleyPos, "WizardHouse", ashleyFacing, "Ashley", false, null, Game1.content.Load <Texture2D>("Portraits\\Ashley"));
         ashley.CurrentDialogue.Push(new Dialogue("The wizard made me come here... why should I care?$a#$e#Merpeople are weird.$a", ashley));
         Game1.CurrentEvent.actors.Add(ashley);
     }
     else if (festival == "Dance Of The Moonlight Jellies")
     {
         Vector2   ashleyPos    = new Vector2((float)(90 * Game1.tileSize), (float)(4 * Game1.tileSize));
         int       ashleyFacing = 2;
         AshleyNPC ashley       = new AshleyNPC(new AnimatedSprite(Game1.content.Load <Texture2D>("Characters\\Ashley"), 0, 24, Game1.tileSize * 2 / 4), ashleyPos, "WizardHouse", ashleyFacing, "Ashley", false, null, Game1.content.Load <Texture2D>("Portraits\\Ashley"));
         ashley.CurrentDialogue.Push(new Dialogue("Lunaloos, huh?#$b#They'd probably make a good ingredient.$h#$e#The wizard would kill me.$u", ashley));
         Game1.CurrentEvent.actors.Add(ashley);
     }
     else if (festival == "Spirit's Eve")
     {
         Vector2   ashleyPos    = new Vector2((float)(39 * Game1.tileSize), (float)(13 * Game1.tileSize));
         int       ashleyFacing = 2;
         AshleyNPC ashley       = new AshleyNPC(new AnimatedSprite(Game1.content.Load <Texture2D>("Characters\\Ashley"), 0, 24, Game1.tileSize * 2 / 4), ashleyPos, "WizardHouse", ashleyFacing, "Ashley", false, null, Game1.content.Load <Texture2D>("Portraits\\Ashley"));
         ashley.CurrentDialogue.Push(new Dialogue("This is my element.$h", ashley));
         Game1.CurrentEvent.actors.Add(ashley);
     }
 }
Esempio n. 2
0
 private void GameEvents_UpdateTick(object sender, EventArgs e)
 {
     if (Game1.currentLocation != null)
     {
         if (Game1.getCharacterFromName("Ashley") == null)
         {
             foreach (var i in Game1.locations)
             {
                 if (i.name == "WizardHouse")
                 {
                     var ashley = new AshleyNPC(new AnimatedSprite(Game1.content.Load <Texture2D>("Characters\\Ashley"), 0, 24, Game1.tileSize * 2 / 4), new Vector2((float)(2 * Game1.tileSize), (float)(6 * Game1.tileSize)), "WizardHouse", 3, "Ashley", false, (Dictionary <int, int[]>)null, Game1.content.Load <Texture2D>("Portraits\\Ashley"));
                     i.addCharacter(ashley);
                     ashley.reloadSprite();
                 }
             }
         }
         if (!Game1.NPCGiftTastes.ContainsKey("Ashley"))
         {
             Game1.NPCGiftTastes.Add("Ashley", "Thanks! I needed this!$h/64 336/Thanks. I could use this.$h/-28 420 257 281 107 305 247/What purpose do you expect this to serve for me?$s/80 348 346 303 -74/This is a waste of my time. I'm in the middle of something./390 388 330 571 568 569/Um... thanks?$u// ");
         }
     }
     if (Game1.CurrentEvent != null)
     {
         if (Game1.CurrentEvent.isFestival)
         {
             bool ashleyInFestival = false;
             foreach (var i in Game1.CurrentEvent.actors)
             {
                 if (i.name == "Ashley")
                 {
                     ashleyInFestival = true;
                 }
             }
             if (!ashleyInFestival)
             {
                 AddAshleyToFestival(Game1.CurrentEvent.FestivalName);
             }
             if (Game1.CurrentEvent.FestivalName == "Stardew Valley Fair" && Game1.player.getFriendshipHeartLevelForNPC("Ashley") >= 4 && !megaModifiedWizardDialogue)
             {
                 foreach (var i in Game1.CurrentEvent.actors)
                 {
                     if (i.name == "Wizard")
                     {
                         var oldDialogue = i.CurrentDialogue.Peek();
                         i.CurrentDialogue.Clear();
                         i.CurrentDialogue.Push(new Dialogue("Oh, did you want to speak to Ashley? She didn't want to come.#$b#She's busy working on her brews in the tower.", i));
                         i.CurrentDialogue.Push(oldDialogue);
                         megaModifiedWizardDialogue = true;
                     }
                 }
             }
         }
         else
         {
             NPC ashleyNPC = null;
             foreach (var i in Game1.CurrentEvent.actors)
             {
                 if (i.name == "Ashley" && !(i is AshleyNPC))
                 {
                     ashleyNPC = i;
                 }
             }
             if (ashleyNPC != null)
             {
                 Game1.CurrentEvent.actors.Remove(ashleyNPC);
                 Game1.CurrentEvent.actors.Add(new AshleyNPC(new AnimatedSprite(Game1.content.Load <Texture2D>("Characters\\Ashley"), 0, 24, Game1.tileSize * 2 / 4), ashleyNPC.position, "WizardHouse", ashleyNPC.facingDirection, ashleyNPC.name, false, null, Game1.content.Load <Texture2D>("Portraits\\Ashley")));
             }
         }
         if (AshleyEvents.IsCustomEvent())
         {
             AshleyEvents.CheckCustomCommands();
         }
     }
     else
     {
         megaModifiedWizardDialogue = false;
     }
     this.ModifyWizardDialogue();
 }