Пример #1
0
        public int?FindBossEXP(int npcid, NPC npc)
        {
            int?found    = -1;
            int?foundpre = -1;

            int modnpc = 0;

            if (npc != null)
            {
                if (npc.modNPC != null)
                {
                    string thisName = npc.modNPC.GetType().Name;

                    if (npc.modNPC.GetType() == typeof(SPinkyTrue))
                    {
                        thisName = typeof(SPinky).Name;
                    }

                    foundpre = ExpertisePointsFromBossesModded.FindIndex(x => (x == thisName));
                    //Main.NewText(foundpre);
                    //Main.NewText(npc.modNPC.GetType().Name);
                    if (foundpre != null && foundpre > -1)
                    {
                        bool condition = (npc.modNPC.GetType() != typeof(SPinky) || !Main.expertMode);
                        if (condition)
                        {
                            return(foundpre);
                        }
                    }
                }
            }


            if (npcid == NPCID.EaterofWorldsHead || npcid == NPCID.EaterofWorldsBody || npcid == NPCID.EaterofWorldsTail)
            {
                found = ExpertisePointsFromBosses.FindIndex(x => (x == NPCID.EaterofWorldsHead));
                goto gohere;
            }
            if (npcid == NPCID.DD2DarkMageT1 || npcid == NPCID.DD2DarkMageT3)
            {
                found = ExpertisePointsFromBosses.FindIndex(x => (x == NPCID.DD2DarkMageT1));
                goto gohere;
            }
            if (npcid == NPCID.BigMimicCorruption || npcid == NPCID.BigMimicCrimson || npcid == ModContent.NPCType <NPCs.Dank.SwampBigMimic>())
            {
                found = ExpertisePointsFromBosses.FindIndex(x => (x == NPCID.BigMimicCorruption));
                goto gohere;
            }
            if (npcid == NPCID.DD2OgreT2 || npcid == NPCID.DD2OgreT3)
            {
                found = ExpertisePointsFromBosses.FindIndex(x => (x == NPCID.DD2OgreT2));
                goto gohere;
            }
            if (npcid == NPCID.GoblinSorcerer || npcid == NPCID.GoblinPeon || npcid == NPCID.GoblinThief || npcid == NPCID.GoblinWarrior || npcid == NPCID.GoblinArcher)
            {
                found = ExpertisePointsFromBosses.FindIndex(x => (x == NPCID.GoblinPeon));
                goto gohere;
            }

            found = ExpertisePointsFromBosses.FindIndex(x => x == npcid);

gohere:

            return(found);
        }
Пример #2
0
 public void addtolist(int value, int s2ndvalue)
 {
     ExpertisePointsFromBosses.Add(value);
     ExpertisePointsFromBossesPoints.Add(s2ndvalue);
     ExpertisePointsFromBossesModded.Add("");
 }
Пример #3
0
 public void addtolistmodded(string value, int s2ndvalue)
 {
     ExpertisePointsFromBosses.Add(-1);
     ExpertisePointsFromBossesPoints.Add(s2ndvalue);
     ExpertisePointsFromBossesModded.Add(value);
 }
Пример #4
0
        public void DoExpertiseCheck(NPC npc, bool tempc = false)
        {
            if (tempc == false)
            {
                if (npc == null)
                {
                    return;
                }
                if (!npc.active)
                {
                    return;
                }
                if (npc.lifeMax < 100)
                {
                    return;
                }
            }
            if (ExpertisePointsFromBosses == null)
            {
                Main.NewText("The enemy list was somehow null... HOW?!");
                return;
            }

            if (ExpertisePointsFromBosses.Count < 1)
            {
                return;
            }

            int npcid = npc.type;

            int?found = FindBossEXP(npcid, npc);

            if (found != null && found > -1)
            {
                int collected = ExpertisePointsFromBossesPoints[(int)found];
                if (Main.expertMode)
                {
                    if (SGAWorld.NightmareHardcore > 0)
                    {
                        collected = (int)(collected * ((SGAWorld.NightmareHardcore == 1 ? 1.25f : 1.40f) + (NoHitCharm ? 1.25f : 0)));
                    }
                }
                else
                {
                    collected = (int)(collected * 0.80);
                }

                AddExpertise(collected);

                ExpertisePointsFromBosses.RemoveAt((int)found);
                ExpertisePointsFromBossesPoints.RemoveAt((int)found);
                ExpertisePointsFromBossesModded.RemoveAt((int)found);

                int?findagain = FindBossEXP(npcid, npc);

                if (findagain == null || findagain < 0)
                {
                    if (Main.myPlayer == player.whoAmI)
                    {
                        Main.NewText("You have gained Expertise! (you now have " + ExpertiseCollected + ")");
                    }
                }
            }
        }