Beispiel #1
0
 public override void OnChatButtonClicked(bool firstButton, ref bool shop)
 {
     if (firstButton)
     {
         if (HasBrutusRecruited)
         {
             NpcMod.AddGuardianMet(6);
             WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianBase.Brutus);
         }
         else
         {
             npc.target = Main.myPlayer;
             StartDamageTest();
             //Main.player[Main.myPlayer].talkNPC = -1;
         }
     }
     else
     {
         if (Main.player[Main.myPlayer].BuyItem(Item.buyPrice(0, HirePrice)))
         {
             Main.npcChatText = "*I accept the offer. I, " + Base.Name + ", will protect you until the end of my contract.*";
             PlayerMod.AddPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID);
             PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID).IncreaseFriendshipProgress(1);
             NpcMod.AddGuardianMet(6);
             Main.NewText("You bought " + Base.Name + "'s help.", MainMod.RecruitColor);
             WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianBase.Brutus);
         }
         else
         {
             Main.npcChatText = "*He's saying that the only ways of hiring his blade is by either showing how strong you are, or how deep your pocket is.*";
         }
     }
 }
 public static void TrySpawningMichelle()
 {
     if (NpcMod.HasMetGuardian(GuardianBase.Michelle) || WorldMod.IsGuardianNpcInWorld(GuardianBase.Michelle))
     {
         return;
     }
     if (Main.fastForwardTime || Main.eclipse || !Main.dayTime || Main.time >= 27000 || Main.time % 60 > 0)
     {
         return;
     }
     if (Main.invasionType > 0 && Main.invasionDelay == 0 && Main.invasionSize > 0)
     {
         return;
     }
     if (Main.rand.Next(17) == 0)
     {
         bool HasPlayerWithDefense = false;
         for (int p = 0; p < 255; p++)
         {
             if (Main.player[p].active && Main.player[p].statDefense > 0)
             {
                 HasPlayerWithDefense = true;
                 break;
             }
         }
         if (HasPlayerWithDefense)
         {
             NpcMod.SpawnGuardianNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, GuardianBase.Michelle);
             //NPC.NewNPC(Main.spawnTileX * 16, Main.spawnTileY * 16, ModContent.NPCType<MichelleGuardian>());
             Main.NewText("Michelle has logged in.", 255, 255, 0);
         }
     }
 }
Beispiel #3
0
        public override string HomelessMessage(Player player, TerraGuardian guardian)
        {
            List <string> Mes = new List <string>();

            Mes.Add("*I think It is safe for me to build a shop here, but there is nowhere I can build it...*");
            Mes.Add("*It's no good to do business in the open, with slimes trying to eat my feet, and zombies trying to eat my brain.*");
            Mes.Add("*There is no kind of laws here, right? Then It's the best place for me to open a shop. If I had somewhere to open it.*");
            if (Main.raining)
            {
                Mes.Add("*A-a-a-aCHOOOOOO~!! This is horrible, have some dry place I can stay?*");
                Mes.Add("*My goods will all be ruined by the rain, and I think I blew a vein in my nose because of all the sneezing. Do you have some place I can stay?*");
            }
            if (!Main.dayTime)
            {
                Mes.Add("*I swear I saw something sneaking around me. Do you have a way safer place for me to stay?*");
                if (Main.bloodMoon)
                {
                    Mes.Add("*Look, I'm used to have a life of adrenaline, but this is way too much! *");
                }
            }
            if (NpcMod.HasGuardianNPC(Brutus))
            {
                Mes.Add("*Did [gn:" + Brutus + "] told you not to give me a house? Just don't listen to him. I can't open a shop without a shop.*");
            }
            return(Mes[Main.rand.Next(Mes.Count)]);
        }
        public override Action ImportantDialogueMessage(QuestData rawdata, TerraGuardian tg, int GuardianID, string GuardianModID)
        {
            PigQuestData data = (PigQuestData)rawdata;

            if (GuardianModID == MainMod.mod.Name)
            {
                if (NpcMod.HasGuardianNPC(GuardianBase.Leopold))
                {
                    switch (GuardianID)
                    {
                    case GuardianBase.Wrath:
                        data.MetPigs[WrathID] = true;
                        if (tg.FriendshipLevel >= 5 && !data.SolidificationRequestGiven[WrathID])
                        {
                            QuestStartedNotification(rawdata);
                            data.SolidificationRequestGiven[WrathID] = true;
                            //Wrath speaks about trying to find a way of solidifying his body.
                            return(new Action(WrathTellingYouAboutFormChanging));
                        }
                        break;

                    case GuardianBase.Joy:
                        data.MetPigs[HappinessID] = true;

                        /*if (tg.FriendshipLevel >= 5 && !data.SolidificationRequestGiven[HappinessID])
                         * {
                         *  QuestStartedNotification(rawdata);
                         *  data.SolidificationRequestGiven[HappinessID] = true;
                         *  //Solidifying quest
                         *  return new Action(WrathTellingYouAboutFormChanging);
                         * }*/
                        break;

                    case GuardianBase.Sadness:
                        data.MetPigs[SadnessID] = true;

                        /*if (tg.FriendshipLevel >= 5 && !data.SolidificationRequestGiven[SadnessID])
                         * {
                         *  QuestStartedNotification(rawdata);
                         *  data.SolidificationRequestGiven[SadnessID] = true;
                         *  //Solidifying quest
                         *  return new Action(WrathTellingYouAboutFormChanging);
                         * }*/
                        break;

                    case GuardianBase.Fear:
                        data.MetPigs[FearID] = true;
                        if (tg.FriendshipLevel >= 5 && !data.SolidificationRequestGiven[FearID])
                        {
                            QuestStartedNotification(rawdata);
                            data.SolidificationRequestGiven[FearID] = true;
                            //Solidifying quest
                            return(new Action(FearTellingYouAboutFormChanging));
                        }
                        break;
                    }
                }
            }
            return(base.ImportantDialogueMessage(data, tg, GuardianID, GuardianModID));
        }
        public override string QuestNpcDialogue(NPC npc)
        {
            ZacksOutfitQuestData data = (ZacksOutfitQuestData)Data;

            if (PlayerMod.PlayerHasGuardianSummoned(Terraria.Main.LocalPlayer, GuardianBase.Blue))
            {
                if ((data.QuestStep == 4 || data.QuestStep == 5) && npc.type == Terraria.ID.NPCID.Clothier)
                {
                    data.QuestStep += 2;
                    PlayerMod.GetPlayerSummonedGuardian(Main.player[Main.myPlayer], GuardianBase.Blue).
                    SaySomethingCanSchedule("*This one! This one is perfect. I'll take It. Thank you. Let's give It to Zacks.*", true, 90);
                    if (PlayerMod.PlayerHasGuardianSummoned(Main.player[Main.myPlayer], GuardianBase.Zacks))
                    {
                        data.ZacksKnowsWhoPickedShirt = 1;
                        PlayerMod.GetPlayerSummonedGuardian(Main.player[Main.myPlayer], GuardianBase.Zacks).
                        SaySomethingCanSchedule("*I hope you picked something cool for me.*", true, 90 + 150);
                    }
                    return("So, you want a shirt for " + NpcMod.GetGuardianNPCName(GuardianBase.Zacks) + "? I have quite a selection, feel free to browse.");
                }
                if ((data.QuestStep == 2 || data.QuestStep == 3) && npc.type == Terraria.ID.NPCID.Nurse)
                {
                    data.QuestStep += 2;
                    PlayerMod.GetPlayerSummonedGuardian(Main.player[Main.myPlayer], GuardianBase.Blue).
                    SaySomethingCanSchedule("*That's perfect! Thanks " + npc.GivenOrTypeName + ". Now we should visit the Clothier.*", true, 90);
                    if (PlayerMod.PlayerHasGuardianSummoned(Main.player[Main.myPlayer], GuardianBase.Zacks))
                    {
                        PlayerMod.GetPlayerSummonedGuardian(Main.player[Main.myPlayer], GuardianBase.Zacks).
                        SaySomethingCanSchedule("*That's a lot of bandages! Just how wounded am I? I could even use some to wipe myself.*", true, 90 + 150);
                    }
                    return("You want some bandages for " + NpcMod.GetGuardianNPCName(GuardianBase.Zacks) + "? Gladly I have an extra number of them. Feel free to take them.");
                }
            }
            return(base.QuestNpcDialogue(npc));
        }
Beispiel #6
0
        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            bool PlayerHasDomino = PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], GuardianBase.Domino);

            if (PlayerHasDomino || (DominoDismissed && !PlayerMod.PlayerHasGuardianSummoned(Main.player[Main.myPlayer], BrutusID)))
            {
                Main.npcChatText = "*Thanks mate.*";
                PlayerMod.AddPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID);
                if (!PlayerHasDomino)
                {
                    PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID).IncreaseFriendshipProgress(1);
                }
                NpcMod.AddGuardianMet(GuardianID, GuardianModID);
                WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianID, GuardianModID);
                //npc.Transform(ModContent.NPCType<GuardianNPC.List.DogGuardian>());
            }
            if (DialogueStep == 10)
            {
                AcceptedIn   = firstButton;
                DialogueTime = DialogueDelay;
                if (firstButton)
                {
                    Main.npcChatText = "*Wise choice, Terrarian.*";
                }
                else
                {
                    Main.npcChatText = "*Eh... Alright... Go Team Brutus... Happy now?*";
                }
            }
        }
Beispiel #7
0
        public override string TalkMessage(Player player, TerraGuardian guardian)
        {
            List <string> Mes = new List <string>();

            Mes.Add("*It fills me with joy, when I see people happy when eating my food.*");
            Mes.Add("*Have you been eating sufficiently latelly? I'm glad to hear that you are.*");
            Mes.Add("*I don't mind cooking for anyone, It actually fills me with joy.*");
            Mes.Add("*I would like to apologize to you for any noxious gas I release, but I really needed to check if the food was good for the people to eat.*");
            if (NpcMod.HasGuardianNPC(Zacks))
            {
                Mes.Add("*I don't know why you let [gn:3] live here. Whenever he shows up on my kitchen, he's salivating while looking at me. Is he planning to eat me?*");
            }
            if (NpcMod.HasGuardianNPC(Brutus))
            {
                Mes.Add("*Beside [gn:6] eats a lot, I don't mind cooking for him, because the stories he tells when I'm eating are interesting. I still want to know the rest of the story he told me last night.*");
            }
            if (NpcMod.HasGuardianNPC(Leopold))
            {
                Mes.Add("*I tried several times to offer food to [gn:10], but he always says that he conjures his own food and water.*");
            }
            if (NpcMod.HasGuardianNPC(Vladimir))
            {
                Mes.Add("*I think... I'm starting to like [gn:11]. He's very different from many guys I've met.*");
            }
            if (NpcMod.HasGuardianNPC(Malisha))
            {
                Mes.Add("*I refuse to cook for [gn:12]. Everytime I try making food for her, I end up tied to a chair, and spending the entire night being forced to drink awfully tasting potions.*");
            }
            return(Mes[Main.rand.Next(Mes.Count)]);
        }
Beispiel #8
0
        public override string TalkMessage(Player player, TerraGuardian guardian)
        {
            List <string> Mes = new List <string>();

            if (!Main.dayTime)
            {
                Mes.Add("You know, i am afraid of being alone in a dark night, thats why i try to collect as many glowsticks when i see a jellyfish or buy some to that merchant old man.");
            }
            if (player.statManaMax > 20)
            {
                Mes.Add("I can sense your magic power is growing stronger, at least share some of those crystals the next time you have some to spare, after all i need to grow stronger too to achieve my objectives.");
            }
            Mes.Add("I hate the beach, the sand gets everywhere and my books end up ruined with the mix of sand and water.");
            Mes.Add("Once i tried to fish but i caught a tuna so big that when i tried to get him out of the water it almost swallowed me in one bite.");
            Mes.Add("when I grow up I will open a magic store or a bookstore or better yet, a magic bookstore");
            Mes.Add("I only take baths in the lakes and rivers, the sea water makes my body completely bristle, also in the sea are sharks.");
            Mes.Add("I heard that there are caves in this world where everything glows a deep blue color and giant mushrooms grow, you must take me to see that.");
            if (NpcMod.HasGuardianNPC(Miguel))
            {
                Mes.Add("That horse keep saying that i am weakling, when he is gonna get that i am not a fighter,i am a wizard, i train my mind, not my body.");
            }
            if (NpcMod.HasGuardianNPC(Minerva))
            {
                Mes.Add("I love that minerva joined us, she cooks really well and make some really tasty cookies for the tea time.");
            }
            if (NpcMod.HasGuardianNPC(Cinnamon))
            {
                Mes.Add("How i can I explain to cinnamon that I don't hate her but the spice of the same name?");
            }
            return(Mes[Main.rand.Next(Mes.Count)]);
        }
Beispiel #9
0
 public override void OnChatButtonClicked(bool firstButton, ref bool shop)
 {
     if (PlayerHasRococo)
     {
         NpcMod.AddGuardianMet(GuardianID, GuardianModID);
         WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianID, GuardianModID);
         //npc.Transform(ModContent.NPCType<GuardianNPC.List.RaccoonGuardian>());
     }
     else if (!RejectedOnce && !AcceptedOnce)
     {
         if (firstButton) //Accept
         {
             AcceptedOnce     = true;
             Main.npcChatText = "*It got very happy after I said that It can move to my world, and said that his name is " + Base.Name + ".*";
             Jump             = true;
         }
         else
         {
             RejectedOnce     = true;
             Main.npcChatText = "*It got saddened after hearing my refusal. But says that wont feel bad for that. He told you that you can call him anytime, if you change your mind, and that his name is " + Base.Name + "*";
         }
         PlayerMod.AddPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID);
         PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID).IncreaseFriendshipProgress(1);
         NpcMod.AddGuardianMet(GuardianID, GuardianModID, firstButton);
         WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianID, GuardianModID);
     }
     else if (AcceptedOnce)
     {
         //npc.Transform(ModContent.NPCType<GuardianNPC.List.RaccoonGuardian>());
     }
 }
Beispiel #10
0
 public override void OnChatButtonClicked(bool firstButton, ref bool shop)
 {
     if (firstButton)
     {
         NpcMod.AddGuardianMet(16);
         Main.player[Main.myPlayer].GetModPlayer <PlayerMod>().AddNewGuardian(16);
         if (PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 16).FriendshipLevel == 0)
         {
             PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 16).IncreaseFriendshipProgress(1);
         }
         Main.npcChatText = "(She looks happy at you, sketches on the floor her name, " + PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 16).Name + ", then places her hand on your shoulder, telling you that you can count on her.)";
         WorldMod.TurnNpcIntoGuardianTownNpc(npc, 16);
     }
     else
     {
         NpcMod.AddGuardianMet(16, "", false);
         Main.player[Main.myPlayer].GetModPlayer <PlayerMod>().AddNewGuardian(16);
         if (PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 16).FriendshipLevel == 0)
         {
             PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 16).IncreaseFriendshipProgress(1);
         }
         Main.npcChatText = "(Her face suddenly changed to a sad look, she sketches her name on the floor, " + PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 16).Name + ", then signals saying that If you need her help, you just need to call.)";
         WorldMod.TurnNpcIntoGuardianTownNpc(npc, 16);
     }
 }
Beispiel #11
0
        public override float SpawnChance(NPCSpawnInfo spawnInfo)
        {
            bool MaySpawn = !spawnInfo.water && !NpcMod.HasMetGuardian(1) && !NpcMod.HasGuardianNPC(1) && !NPC.AnyNPCs(npc.type);

            //return 0;
            return(MaySpawn ? 1 : 0f);
        }
Beispiel #12
0
 public override void OnChatButtonClicked(bool firstButton, ref bool shop)
 {
     if (PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID))
     {
         NpcMod.AddGuardianMet(GuardianID, GuardianModID);
         //npc.Transform(ModContent.NPCType<GuardianNPC.List.FemaleCatGuardian>());
         TransformNPC();
         return;
     }
     else if (PlayerMod.HasGuardianSummoned(Main.player[Main.myPlayer], 2, GuardianModID))
     {
         return;
     }
     else if (!dialogues.Finished)
     {
         dialogues.MarkAnswer(firstButton);
         if (dialogues.Finished)
         {
             Main.npcChatText = GetEndDialogueMessage;
         }
         else
         {
             Main.npcChatText = dialogues.GetQuestion();
         }
     }
     else if (dialogues.Finished)
     {
         if (DialogueResultSuccess)
         {
             TransformNPC();
         }
     }
 }
Beispiel #13
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!NpcMod.HasMetGuardian(GuardianID, GuardianModID) && !NpcMod.HasGuardianNPC(GuardianID, GuardianModID) && !NPC.AnyNPCs(npc.type) && (Main.dayTime && !Main.eclipse && Main.time < 9 * 3600 && CanSpawnGreen()))
     {
         bool HasTree = false;
         for (int y = 0; y >= -4; y--)
         {
             for (int x = -2; x < 3; x++)
             {
                 int TileX = spawnInfo.spawnTileX + x, TileY = spawnInfo.spawnTileY + y;
                 int TreeSize = 0;
                 while (Main.tile[TileX, TileY].active() && Main.tile[TileX, TileY].type == Terraria.ID.TileID.Trees)
                 {
                     TreeSize++;
                     TileY--;
                 }
                 if (TreeSize >= 9)
                 {
                     HasTree = true;
                 }
             }
         }
         if (HasTree)
         {
             return(1f / 35);
         }
     }
     return(0);
 }
Beispiel #14
0
        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            if (MetPlayer)
            {
                return;
            }
            if (SpeakingToKnownPlayer > 0)
            {
                if (firstButton)
                {
                    if (SpeakingToKnownPlayer == 1)
                    {
                        Main.npcChatText = "*Huh.*";
                        SayMessage("(I'll follow them again by keeping some distance, maybe they know the way out.)");
                    }
                    else
                    {
                        Main.npcChatText = "*No, I actually lied. Please, let me go with you! Get me out of here!!*";
                    }
                    PlayerMod.AddPlayerGuardian(Main.LocalPlayer, GuardianBase.Fear);
                    NpcMod.AddGuardianMet(GuardianBase.Fear);
                    WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianID, GuardianModID);
                }
                else
                {
                    Main.npcChatText = "*Uh.. Alright... Just- Just go away!*";
                    MetPlayer        = true;
                }
            }
            switch (DialogueStep)
            {
            case 0:
                DialogueStep++;
                Main.npcChatText = "*I don't trust you! You will try killing me like you did to those scary monsters!*";
                break;

            case 1:
                DialogueStep++;
                Main.npcChatText = "*Uh.. I guess you're right. BUT! Doesn't mean you can't still turn on me.*";
                break;

            case 2:
                DialogueStep++;
                if (firstButton)
                {
                    Main.npcChatText = "*I, ah... Okay.*";
                    SayMessage("(I'll trail behind them carefully for now, maybe they will help me get out of this horrible place.)");
                    PlayerMod.AddPlayerGuardian(Main.LocalPlayer, GuardianBase.Fear);
                    NpcMod.AddGuardianMet(GuardianBase.Fear);
                    WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianID, GuardianModID);
                }
                else
                {
                    Main.npcChatText = "*Uh.. Alright... Just- Just go away!*";
                    MetPlayer        = true;
                }
                break;
            }
        }
Beispiel #15
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!spawnInfo.water && !NpcMod.HasGuardianNPC(GuardianID) && !NpcMod.HasMetGuardian(GuardianID) && spawnInfo.player.ZoneMeteor && NpcMod.RecruitNpcSpawnConditionCheck(spawnInfo) && !NPC.AnyNPCs(ModContent.NPCType <SmellyNPC>()))
     {
         return(1f / 6);
     }
     return(0);
 }
Beispiel #16
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (spawnInfo.player.ZoneDungeon && !spawnInfo.water && !NpcMod.HasGuardianNPC(GuardianID, GuardianModID) && !NpcMod.HasMetGuardian(GuardianID, GuardianModID))
     {
         return(1f / 200);
     }
     return(0);
 }
Beispiel #17
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!spawnInfo.water && NpcMod.RecruitNpcSpawnConditionCheck(spawnInfo) && Main.dayTime && !NpcMod.HasGuardianNPC(7) && !NpcMod.HasMetGuardian(7) && BreeMaySpawn && Main.time > 27000 && Main.time < 48600 && !NPC.AnyNPCs(ModContent.NPCType <BreeNPC>()))
     {
         return((float)(Main.time - 27000) / 432000 * 0.333f);
     }
     return(0);
 }
Beispiel #18
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!spawnInfo.water && Main.dayTime && !NpcMod.HasGuardianNPC(0) && !PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], 0) && Main.time > 27000 && Main.time < 48600 && NpcMod.RecruitNpcSpawnConditionCheck(spawnInfo) && !NPC.AnyNPCs(ModContent.NPCType <RococoNPC>()))
     {
         return((float)(Main.time - 27000) * (1f / 432000 * 0.5f));
     }
     return(0);
 }
Beispiel #19
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!spawnInfo.water && NpcMod.RecruitNpcSpawnConditionCheck(spawnInfo) && !spawnInfo.playerInTown && !NpcMod.HasGuardianNPC(GuardianID) && !NpcMod.HasMetGuardian(GuardianID) && CanSpawnDomino(spawnInfo.player) && !NPC.AnyNPCs(ModContent.NPCType <DominoNPC>()))
     {
         return(0.00390625f);
     }
     return(0);
 }
Beispiel #20
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (CanSpawnMe() && Main.dayTime && Main.invasionSize == 0 && !Main.eclipse &&
         spawnInfo.player.ZoneOverworldHeight && NpcMod.RecruitNpcSpawnConditionCheck(spawnInfo) && !Main.slimeRain && !NPC.AnyNPCs(ModContent.NPCType <MiguelNPC>()) && !NpcMod.HasGuardianNPC(GuardianID) && !NpcMod.HasMetGuardian(GuardianID))
     {
         return(1f / 200);
     }
     return(0);
 }
Beispiel #21
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!spawnInfo.water && !NpcMod.HasGuardianNPC(GuardianBase.Alexander) && !NpcMod.HasMetGuardian(GuardianBase.Alexander) && AlexanderConditionMet &&
         spawnInfo.player.ZoneDungeon && !NPC.AnyNPCs(ModContent.NPCType <AlexanderNPC>()))
     {
         return(1f / 500);
     }
     return(0);
 }
Beispiel #22
0
 public override float SpawnChance(NPCSpawnInfo spawnInfo)
 {
     if (!spawnInfo.playerInTown && NpcMod.RecruitNpcSpawnConditionCheck(spawnInfo) && Main.dayTime && !Main.eclipse && !NpcMod.HasMetGuardian(GuardianID, GuardianModID) &&
         !NpcMod.HasGuardianNPC(GuardianID, GuardianModID) && !NPC.AnyNPCs(ModContent.NPCType <CilleNPC>()) && CanSpawn() &&
         Main.moonPhase != 0 && Main.moonPhase != 4)
     {
         return(1f / 200);
     }
     return(0);
 }
Beispiel #23
0
 public void TurnNpcInTownNpc(bool MoveIn)
 {
     PlayerMod.AddPlayerGuardian(Main.player[npc.target], GuardianID, GuardianModID);
     NpcMod.AddGuardianMet(GuardianID, GuardianModID, MoveIn);
     if (PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID).FriendshipLevel == 0)
     {
         PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianID, GuardianModID).IncreaseFriendshipProgress(1);
     }
     WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianID, GuardianModID);
 }
Beispiel #24
0
        public static void TrySpawningMabel()
        {
            if (Cooldown > 0)
            {
                Cooldown--;
                return;
            }
            Cooldown = Main.rand.Next(180, 601) * 30;
            if (NpcMod.HasMetGuardian(8) || Main.eclipse || !Main.dayTime || !CanSpawnMabel)
            {
                return;
            }
            if (Main.rand.Next(5) == 0)
            {
                int TileX = (int)(Main.player[Main.myPlayer].Center.X / 16) + Main.rand.Next(-10, 11), TileY = (int)(Main.player[Main.myPlayer].Center.Y / 16);
                if (Main.tile[TileX, TileY].active() && Main.tileSolid[Main.tile[TileX, TileY].type])
                {
                    return;
                }
                while (!Main.tile[TileX, TileY + 1].active() || !Main.tileSolid[Main.tile[TileX, TileY + 1].type])
                {
                    TileY++;
                    if (TileY >= Main.worldSurface + 20)
                    {
                        return;
                    }
                }
                switch (Main.tile[TileX, TileY + 1].type)
                {
                default:
                    return;

                case Terraria.ID.TileID.Dirt:
                case Terraria.ID.TileID.ClayBlock:
                case Terraria.ID.TileID.Sand:
                case Terraria.ID.TileID.Mud:
                case Terraria.ID.TileID.Grass:
                case Terraria.ID.TileID.CorruptGrass:
                case Terraria.ID.TileID.FleshGrass:
                case Terraria.ID.TileID.HallowedGrass:
                case Terraria.ID.TileID.JungleGrass:
                case Terraria.ID.TileID.MushroomGrass:
                    break;
                }
                for (int y = 1; y < 65; y++)
                {
                    int ty = TileY - y;
                    if (Main.tile[TileX, ty].active() && Main.tileSolid[Main.tile[TileX, ty].type])
                    {
                        return;
                    }
                }
                NPC.NewNPC(TileX * 16, TileY * 16, ModContent.NPCType <MabelNPC>());
            }
        }
 public override Action ImportantDialogueMessage(QuestData data, TerraGuardian tg, int GuardianID, string GuardianModID)
 {
     if (GuardianModID == MainMod.mod.Name && GuardianID == GuardianBase.Blue)
     {
         if (NpcMod.HasGuardianNPC(GuardianBase.Zacks) && ((ZacksOutfitQuestData)data).QuestStep == 0)
         {
             return(new Action(BlueTellsYouAboutHerRequest));
         }
     }
     return(base.ImportantDialogueMessage(data, tg, GuardianID, GuardianModID));
 }
Beispiel #26
0
 public override void OnKillMob(NPC npc, RequestData data)
 {
     if (!data.IsComplete && NpcMod.IsSameMonster(npc, NpcID))
     {
         data.ObjectiveCount++;
         if (data.ObjectiveCount == data.MaxObjectiveCount)
         {
             Main.NewText("Killed all " + NpcName + " necessary.", new Microsoft.Xna.Framework.Color(200, 200, 200, 255));
         }
     }
 }
Beispiel #27
0
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(Terraria.ID.BuffID.Bleeding, 5 * 60);
            target.AddBuff(ModContent.BuffType <Buffs.ShardPierce>(), 10 * 60);
            NpcMod n = target.GetGlobalNPC <NpcMod>();

            n.ShardDebuffCount++;
            if (n.ShardDebuffCount > 4)
            {
                n.ShardDebuffCount = 4;
            }
        }
Beispiel #28
0
 private void TransformNPC()
 {
     //Transform into Bree guardian npc
     NpcMod.AddGuardianMet(7);
     Main.player[Main.myPlayer].GetModPlayer <PlayerMod>().AddNewGuardian(7);
     if (PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 7).FriendshipLevel == 0)
     {
         PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], 7).IncreaseFriendshipProgress(1);
     }
     WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianBase.Bree);
     //npc.Transform(ModContent.NPCType<GuardianNPC.List.FemaleCatGuardian>());
 }
Beispiel #29
0
        private void RecruitmentScripts()
        {
            bool PlayerHadBlue = PlayerMod.PlayerHasGuardian(Main.player[Main.myPlayer], GuardianBase.Blue);

            PlayerMod.AddPlayerGuardian(Main.player[Main.myPlayer], GuardianBase.Blue);
            if (!PlayerHadBlue)
            {
                PlayerMod.GetPlayerGuardian(Main.player[Main.myPlayer], GuardianBase.Blue).IncreaseFriendshipProgress(1);
            }
            NpcMod.AddGuardianMet(GuardianBase.Blue, "", !Rejected);
            WorldMod.TurnNpcIntoGuardianTownNpc(npc, GuardianBase.Blue);
        }
Beispiel #30
0
        public override string TalkMessage(Player player, TerraGuardian guardian)
        {
            List <string> Mes = new List <string>();

            Mes.Add("*I was a little kid when I got passion for tasty food.*");
            Mes.Add("*My name is the same of a seasoning, since I know. It's funny that my mom picked specifically that name to me.*");
            Mes.Add("*Once we had food shortage at home, because I cooked many different food with what we had at home... We had to eat apples for week.*");
            Mes.Add("*I wonder if my mom is worried about me...*");
            Mes.Add("*I heard from the Travelling Merchant that he travels through worlds, so I'm following him to meet new places, and find new kinds of foods.*");
            Mes.Add("*Every food tastes better with the right seasoning, but sometimes placing them is not necessary.*");
            bool HasSomeoneToTutorInCooking = false;

            if (NpcMod.HasGuardianNPC(Minerva))
            {
                Mes.Add("*I have been learning how to cook food at the right point from [gn:" + Minerva + "]. Even my food tastes better now.*");
                HasSomeoneToTutorInCooking = true;
            }
            if (NpcMod.HasGuardianNPC(Bree))
            {
                Mes.Add("*[gn:" + Bree + "] have been teaching me how to not exagerate when placing seasoning, so my food no longer feels over or under seasoned.*");
                HasSomeoneToTutorInCooking = true;
            }
            if (!HasSomeoneToTutorInCooking)
            {
                Mes.Add("*I'm looking for someone to more about cooking from. I wonder if this world has someone like that.*");
            }
            bool HasSomeoneToTasteFood = false;

            if (NpcMod.HasGuardianNPC(Brutus))
            {
                Mes.Add("*[gn:" + Brutus + "] sometimes eat of the food I made. He always compliments It.*");
                HasSomeoneToTasteFood = true;
            }
            if (NpcMod.HasGuardianNPC(Rococo))
            {
                Mes.Add("*[gn:" + Rococo + "] is always happy when he tastes my food, but I always have to reject his seasoning suggestions.*");
                HasSomeoneToTasteFood = true;
            }
            if (NpcMod.HasGuardianNPC(Vladimir))
            {
                Mes.Add("*I really like testing food with [gn:" + Vladimir + "], we chat about so many things when we do so.*");
                HasSomeoneToTasteFood = true;
            }
            if (!HasSomeoneToTasteFood)
            {
                Mes.Add("*I really don't have a second opinion about the food I cook... I can't know if what I cook is good if only I test It.*");
            }
            return(Mes[Main.rand.Next(Mes.Count)]);
        }