Esempio n. 1
0
        public virtual TrinityPower GetPowerForTarget(TrinityActor target)
        {
            IRoutine routine = TrinityCombat.Routines.Current;

            if (target == null)
            {
                return(null);
            }

            switch (target.Type)
            {
            case TrinityObjectType.BloodShard:
            case TrinityObjectType.Gold:
            case TrinityObjectType.HealthGlobe:
            case TrinityObjectType.PowerGlobe:
            case TrinityObjectType.ProgressionGlobe:
                return(routine.GetMovementPower(target.Position));

            case TrinityObjectType.Door:
            case TrinityObjectType.HealthWell:
            case TrinityObjectType.Shrine:
            case TrinityObjectType.Interactable:
            case TrinityObjectType.CursedShrine:
                return(InteractPower(target, 100, 250));

            case TrinityObjectType.CursedChest:
            case TrinityObjectType.Container:
                return(InteractPower(target, 100, 1200));

            case TrinityObjectType.Item:
                return(InteractPower(target, 15, 15, 6f));

            case TrinityObjectType.Destructible:
            case TrinityObjectType.Barricade:
                Core.PlayerMover.MoveTowards(target.Position);
                return(routine.GetDestructiblePower());
            }

            if (target.IsQuestGiver)
            {
                Core.PlayerMover.MoveTowards(target.Position);
                return(InteractPower(target, 100, 250));
            }

            if (!TrinityCombat.IsInCombat)
            {
                return(null);
            }

            TrinityPower routinePower = routine.GetOffensivePower();

            return(TryKamakaziPower(target, routinePower, out TrinityPower kamakaziPower) ? kamakaziPower : routinePower);
        }