public override void Load()
        {
            NetHandler.Load();
            NPCSets.Load();
            SquireMinionTypes.Load();
            NecromancerAccessory.Load();
            SquireGlobalProjectile.Load();
            IdleLocationSets.Load();
            TargetSelectionTacticHandler.Load();
            UserInterfaces.Load();
            MinionTacticsGroupMapper.Load();
            LandChunkConfigs.Load();
            SpriteCompositionManager.Load();
            CritterConfigs.Load();
            AmuletOfManyMinionsWorld.Load();
            CombatPetLevelTable.Load();
            CombatPetBuff.Load();
            DefaultPetsQuizData.Load();

            CycleTacticHotKey       = RegisterHotKey("Cycle Minion Tactic", "K");
            CycleTacticsGroupHotKey = RegisterHotKey("Cycle Tactics Group", "L");
            QuickDefendHotKey       = RegisterHotKey("Minion Quick Defend", "V");
            if (!Main.dedServ)
            {
                AddEquipTexture(null, EquipType.Legs, "RoyalGown_Legs", "AmuletOfManyMinions/Items/Armor/RoyalArmor/RoyalGown_Legs");
            }
        }
        public override void Unload()
        {
            NetHandler.Unload();
            NPCSets.Unload();
            SquireMinionTypes.Unload();
            NecromancerAccessory.Unload();
            SquireGlobalProjectile.Unload();
            IdleLocationSets.Unload();
            TargetSelectionTacticHandler.Unload();
            UserInterfaces.Unload();
            MinionTacticsGroupMapper.Unload();
            LandChunkConfigs.Unload();
            SpriteCompositionManager.Unload();
            CritterConfigs.Unload();
            AmuletOfManyMinionsWorld.Unload();
            PartyHatSystem.Unload();
            CombatPetLevelTable.Unload();
            CombatPetBuff.Unload();
            BlackCatMinion.Unload();
            QuizResult.Unload();
            DefaultPetsQuizData.Unload();

            CycleTacticHotKey       = null;
            CycleTacticsGroupHotKey = null;
            QuickDefendHotKey       = null;
        }
Exemplo n.º 3
0
 internal TacticButton(int index, byte id) : base(TargetSelectionTacticHandler.GetTexture(id) /*do not refactor this to Tactic*/)
 {
     this.index = index;
     ID         = id;
 }
 public TacticsRadialMenuButton(Texture2D bgTexture, byte tacticId, Vector2 relativeTopLeft)
     : base(bgTexture, TargetSelectionTacticHandler.GetTexture(tacticId), relativeTopLeft)
 {
     this.tacticId = tacticId;
 }
Exemplo n.º 5
0
        public Vector2?PlayerTargetPosition(float maxRange, Vector2?centeredOn = null, float noLOSRange = 0, Vector2?losCenter = null)
        {
            MinionTacticsPlayer tacticsPlayer = player.GetModPlayer <MinionTacticsPlayer>();

            if (tacticsPlayer.IgnoreVanillaMinionTarget > 0 && tacticsPlayer.SelectedTactic != TargetSelectionTacticHandler.GetTactic <ClosestEnemyToMinion>())
            {
                return(null);
            }
            Vector2 center          = centeredOn ?? projectile.Center;
            Vector2 losCenterVector = losCenter ?? projectile.Center;

            if (player.HasMinionAttackTargetNPC)
            {
                NPC npc = Main.npc[player.MinionAttackTargetNPC];
                // fix to prevent certain minions from continually stacking debuffs against
                // a single enemy
                if (ShouldIgnoreNPC(npc))
                {
                    return(null);
                }
                float distance = Vector2.Distance(npc.Center, center);
                if (distance < noLOSRange || (distance < maxRange &&
                                              Collision.CanHitLine(losCenterVector, 1, 1, npc.position, npc.width, npc.height)))
                {
                    targetNPCIndex = player.MinionAttackTargetNPC;
                    return(npc.Center);
                }
            }
            return(null);
        }