public override void update(float dt)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            this.m_blastTimer.tick(dt);
            if (this.m_blastTimer.Idle)
            {
                this.m_targetingBehaviour.update(dt);
                if (base.Character.TargetCharacter == null)
                {
                    CmdSetCharacterVelocityAndFacing.ExecuteStatic(base.Character, Vector3.zero, base.Character.Facing);
                }
                else
                {
                    Vector3 vector     = Vector3Extensions.ToXzVector3(base.Character.PhysicsBody.Transform.position);
                    Vector3 vector4    = Vector3Extensions.ToXzVector3(base.Character.TargetCharacter.PhysicsBody.Transform.position) - vector;
                    Vector3 normalized = vector4.normalized;
                    CmdSetCharacterVelocityAndFacing.ExecuteStatic(base.Character, Vector3.zero, normalized);
                    if (activeDungeon.ActiveRoom.characterWithinAttackDistance(base.Character, base.Character.TargetCharacter) && base.Character.PhysicsBody.rotatedEnoughForMovement())
                    {
                        GameLogic.Binder.SkillSystem.activateSkill(base.Character, SkillType.Blast, MONSTER_FIREBLAST_BUILDUP_DURATION, null);
                        this.m_blastTimer.reset();
                    }
                }
            }
        }
Beispiel #2
0
 private void onGameplayEnded(ActiveDungeon activeDungeon)
 {
     if (!base.CharacterView.IsMenuView)
     {
         base.stopAction();
     }
 }
        public override void update(float dt)
        {
            this.m_targetingBehaviour.update(dt);
            bool idle = false;

            switch (this.m_skillData.AiTriggerType)
            {
            case TriggerType.Health:
                idle = (this.m_skillExecutionCount == 0) && (base.Character.CurrentHpNormalized <= this.m_skillData.AiTriggerModifier);
                break;

            case TriggerType.TimeInterval:
                idle = this.m_timer.Idle;
                break;
            }
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (idle && (activeDungeon.ActiveRoom.numberOfFriendlyCharactersAlive(base.Character, false) < ConfigSkills.BossSummoner.SummonCountLimit))
            {
                GameLogic.Binder.SkillSystem.activateSkill(base.Character, this.m_parameters.SkillType, -1f, null);
                this.m_skillExecutionCount++;
                if (this.m_skillData.AiTriggerType == TriggerType.TimeInterval)
                {
                    this.m_timer.set(this.m_skillData.AiTriggerModifier);
                }
            }
            else
            {
                this.m_attackBehaviour.update(dt);
            }
        }
        public LootTable getLootTableForChestType(ChestType chestType, [Optional, DefaultParameterValue(0)] int rollNo)
        {
            if (chestType == ChestType.RewardBoxMulti)
            {
                switch (rollNo)
                {
                case 0:
                    return(this.MegaboxSlot1LootTable);

                case 1:
                    return(this.MegaboxSlot2LootTable);

                case 2:
                    return(this.MegaboxSlot3LootTable);
                }
                return(this.MegaboxSlot1LootTable);
            }
            if (chestType == ChestType.MysterySpecialOffer)
            {
                ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
                if ((activeDungeon != null) && (activeDungeon.ActiveTournament != null))
                {
                    return(this.ChestLootTables[ChestType.MysterySpecialOffer_BossHunt]);
                }
            }
            if (ConfigMeta.IsBossChest(chestType))
            {
                return(this.prepareDynamicChestTable(chestType));
            }
            return(this.ChestLootTables[chestType]);
        }
Beispiel #5
0
 private void onGameplayEnded(ActiveDungeon activeDungeon)
 {
     for (int i = GameLogic.Binder.GameState.PersistentCharacters.Count - 1; i >= 0; i--)
     {
         this.removeAiBehaviour(GameLogic.Binder.GameState.PersistentCharacters[i]);
     }
 }
Beispiel #6
0
        public bool canBeOpened()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            PlayerView.MenuType type = PlayerView.Binder.MenuSystem.topmostActiveMenuType();
            return(((!PlayerView.Binder.SlidingTaskPanelController.PanningActive && !PlayerView.Binder.MenuSystem.InTransition) && (PlayerView.Binder.DungeonHud.MenuButton.Button.interactable && PlayerView.Binder.DungeonHud.IsOpen)) && (((activeDungeon != null) && (activeDungeon.CurrentGameplayState != GameplayState.RETIREMENT)) && (!activeDungeon.isTutorialDungeon() && (type == PlayerView.MenuType.NONE))));
        }
 public override void update(float dt)
 {
     if (!this.m_provoked)
     {
         ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
         if (activeDungeon.ActiveRoom.getEnemyCharactersWithinRadius(base.Character.PhysicsBody.Transform.position, ConfigGameplay.AGGRO_RANGE_IDLE, base.Character).Count > 0)
         {
             this.m_provoked = true;
         }
         if (!this.m_provoked)
         {
             List <CharacterInstance> list = activeDungeon.ActiveRoom.getEnemyCharactersWithinRadius(base.Character.PhysicsBody.Transform.position, ConfigGameplay.AGGRO_RANGE_ALARMED, base.Character);
             for (int i = 0; i < list.Count; i++)
             {
                 if (list[i].TargetCharacter != null)
                 {
                     this.m_provoked = true;
                     break;
                 }
             }
         }
     }
     if (this.m_provoked)
     {
         this.m_primaryAi.update(dt);
     }
 }
Beispiel #8
0
 private void onGameplayEnded(ActiveDungeon activeDungeon)
 {
     for (int i = 0; i < GameLogic.Binder.GameState.PersistentCharacters.Count; i++)
     {
         this.hideStatusIndicators(GameLogic.Binder.GameState.PersistentCharacters[i]);
     }
 }
        public void onBuyButtonClicked()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (!PlayerView.Binder.MenuSystem.InTransition && (activeDungeon.ActiveRoom != null))
            {
            }
        }
Beispiel #10
0
        public override void update(float dt)
        {
            ActiveDungeon     activeDungeon          = GameLogic.Binder.GameState.ActiveDungeon;
            CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;

            if (!base.Character.isExecutingSkill())
            {
                if ((base.Character.ManualTargetPos != Vector3.zero) && (PhysicsUtil.DistBetween(base.Character, base.Character.ManualTargetPos) > 1f))
                {
                    this.m_movementBehaviour.update(dt);
                }
                else if ((!primaryPlayerCharacter.IsDead && (primaryPlayerCharacter.CurrentHpNormalized <= 0.5f)) && (Time.fixedTime >= this.m_nextPossibleSkillExecutionTime))
                {
                    if (base.Character.TargetCharacter != primaryPlayerCharacter)
                    {
                        CmdSetCharacterTarget.ExecuteStatic(base.Character, primaryPlayerCharacter, Vector3.zero);
                    }
                    if (base.Character.PhysicsBody.rotatedEnoughForMovement())
                    {
                        GameLogic.Binder.SkillSystem.activateSkill(base.Character, SkillType.Heal, -1f, null);
                        this.m_nextPossibleSkillExecutionTime = Time.fixedTime + ConfigSkills.SHARED_DATA[SkillType.Heal].Cooldown;
                    }
                }
                else if (((primaryPlayerCharacter.TargetCharacter != null) && (PhysicsUtil.DistBetween(primaryPlayerCharacter, primaryPlayerCharacter.TargetCharacter) > ConfigGameplay.PASSIVE_HP_REGEN_PROXIMITY_THRESHOLD)) || (primaryPlayerCharacter.ManualTargetPos != Vector3.zero))
                {
                    if ((base.Character.TargetCharacter != primaryPlayerCharacter.TargetCharacter) || (base.Character.ManualTargetPos != primaryPlayerCharacter.ManualTargetPos))
                    {
                        CmdSetCharacterTarget.ExecuteStatic(base.Character, primaryPlayerCharacter.TargetCharacter, primaryPlayerCharacter.ManualTargetPos);
                    }
                    this.m_movementBehaviour.update(dt);
                    this.m_seekTacticalPosition = true;
                }
                else if (this.m_seekTacticalPosition)
                {
                    this.m_targetingAiBehaviour.update(dt);
                    if (base.Character.TargetCharacter != null)
                    {
                        Vector3 worldPt = base.Character.TargetCharacter.PhysicsBody.Transform.position - ((Vector3)(base.Character.TargetCharacter.PhysicsBody.Transform.forward * 1.5f));
                        worldPt = activeDungeon.ActiveRoom.calculateNearestEmptySpot(worldPt, worldPt - base.Character.TargetCharacter.PhysicsBody.Transform.position, 1f, 1f, 6f, null);
                        CmdSetCharacterTarget.ExecuteStatic(base.Character, null, worldPt);
                        this.m_seekTacticalPosition = false;
                    }
                }
                else
                {
                    this.m_targetingAiBehaviour.update(dt);
                    this.m_movementBehaviour.update(dt);
                    if (((base.Character.TargetCharacter != null) && this.m_movementBehaviour.WithinAttackDistance) && base.Character.PhysicsBody.rotatedEnoughForMovement())
                    {
                        base.Character.AttackRoutine = GameLogic.Binder.CommandProcessor.executeCharacterSpecific(base.Character, new CmdAttackMelee(base.Character, base.Character.TargetCharacter), 0f);
                    }
                }
            }
        }
        protected void Update()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
            Player        player        = GameLogic.Binder.GameState.Player;

            if (((activeDungeon != null) && (player != null)) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION))
            {
                player.TrackingData.FpsTotalFrames  += 1L;
                player.TrackingData.FpsTotalSeconds += Time.unscaledDeltaTime;
            }
        }
Beispiel #12
0
 private void onGameplayStarted(ActiveDungeon activeDungeon)
 {
     for (int i = 0; i < GameLogic.Binder.GameState.PersistentCharacters.Count; i++)
     {
         CharacterInstance key = GameLogic.Binder.GameState.PersistentCharacters[i];
         if (!this.m_characterToAiBehaviourMapping.ContainsKey(key))
         {
             this.addAiBehaviour(key);
         }
     }
 }
        public override void preUpdate(float dt)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((!base.Character.isExecutingSkill() && (base.Character.TargetCharacter != null)) && activeDungeon.ActiveRoom.characterWithinAttackDistance(base.Character, base.Character.TargetCharacter))
            {
                this.m_skillTimer.tick(dt);
            }
            this.m_targetingBehaviour.preUpdate(dt);
            this.m_attackBehaviour.preUpdate(dt);
        }
Beispiel #14
0
        private void onGameplayStarted(ActiveDungeon activeDungeon)
        {
            Player player = GameLogic.Binder.GameState.Player;

            for (int i = 0; i < App.Binder.ConfigMeta.TOKEN_REWARD_FLOOR_MULTIPLIERS.Count; i++)
            {
                if (App.Binder.ConfigMeta.TOKEN_REWARD_FLOOR_MULTIPLIERS[i].Key == activeDungeon.Floor)
                {
                    player.Notifiers.HeroRetirementsInspected = false;
                    break;
                }
            }
        }
        public override void update(float dt)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if (!base.Character.isExecutingSkill())
            {
                CmdSetCharacterVelocityAndFacing.ExecuteStatic(base.Character, Vector3.zero, base.Character.Facing);
                if (this.m_skillTimer.Idle && activeDungeon.ActiveRoom.characterWithinAttackDistance(base.Character, base.Character.TargetCharacter))
                {
                    GameLogic.Binder.SkillSystem.activateSkill(base.Character, this.SkillType, 0.1f, null);
                    this.m_skillTimer.reset();
                }
            }
        }
        private void onRoomCompleted(Room room)
        {
            Player        player        = GameLogic.Binder.GameState.Player;
            ActiveDungeon activeDungeon = room.ActiveDungeon;

            switch (room.EndCondition)
            {
            case RoomEndCondition.NORMAL_COMPLETION:
            case RoomEndCondition.FRENZY_COMPLETION:
                if (room.MainBossSummoned)
                {
                    bool isEliteBoss = activeDungeon.isEliteBossFloor();
                    this.sendBossFightEvent(player, activeDungeon.BossId, isEliteBoss, false, true, room.BossSummonedWith);
                    if (isEliteBoss)
                    {
                        this.sendCrmEvent(player, "crm_elite_boss_beaten");
                    }
                }
                player.TrackingData.ActiveFloorCompletions++;
                this.sendPlayerProgressEvent(player);
                return;

            case RoomEndCondition.FAIL:
                if (!room.MainBossSummoned)
                {
                    player.TrackingData.KilledByMinions++;
                    this.sendKnockedDownEvent(player, "no_boss", Room.BossSummonMethod.UNSPECIFIED);
                    return;
                }
                this.sendBossFightEvent(player, activeDungeon.BossId, activeDungeon.isEliteBossFloor(), false, false, room.BossSummonedWith);
                if (player.TrackingData.LastFailedBossFightFloor != activeDungeon.Floor)
                {
                    player.TrackingData.LastFailedBossFightFloor  = activeDungeon.Floor;
                    player.TrackingData.LostToSameBossInARowCount = 1;
                    break;
                }
                player.TrackingData.LostToSameBossInARowCount++;
                if (player.TrackingData.LostToSameBossInARowCount == 3)
                {
                    this.sendCrmEvent(player, "crm_bossfight_3lost");
                }
                break;

            default:
                return;
            }
            player.TrackingData.BossFightsLost++;
            this.sendKnockedDownEvent(player, room.BossDifficultyDuringSummon, room.BossSummonedWith);
        }
Beispiel #17
0
        protected void Update()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;
            Player        player        = GameLogic.Binder.GameState.Player;
            int           num           = player.getLastCompletedFloor(false) + 1;
            int           floor         = player.getGatedRetirementMinFloor();

            if (num < floor)
            {
                this.AscendButton.interactable = false;
                this.AscendButtonText.gameObject.SetActive(false);
                this.LockedIcon.gameObject.SetActive(true);
                this.LockedText.gameObject.SetActive(true);
                this.LockedText.text = StringExtensions.ToUpperLoca(_.L(ConfigLoca.ASCEND_UNLOCKED_AT_FLOOR, new < > __AnonType15 <int>(floor), false));
            }
            else
            {
                if (!player.hasCompletedTutorial("TUT351A"))
                {
                    this.AscendButton.interactable = false;
                }
                else if (PlayerView.Binder.TransitionSystem.InCriticalTransition)
                {
                    if ((activeDungeon.CurrentGameplayState == GameplayState.START_CEREMONY_STEP1) || (activeDungeon.CurrentGameplayState == GameplayState.START_CEREMONY_STEP2))
                    {
                        this.AscendButton.interactable = true;
                    }
                    else
                    {
                        this.AscendButton.interactable = false;
                    }
                }
                else if (activeDungeon.CurrentGameplayState == GameplayState.ACTION)
                {
                    this.AscendButton.interactable = true;
                }
                else
                {
                    this.AscendButton.interactable = false;
                }
                this.AscendButtonText.gameObject.SetActive(true);
                this.LockedIcon.gameObject.SetActive(false);
                this.LockedText.gameObject.SetActive(false);
            }
            this.AscendButtonImage.material = !this.AscendButton.interactable ? PlayerView.Binder.DisabledUiMaterial : null;
        }
        protected override void onUpdate(float dt)
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            if ((activeDungeon != null) && (((base.CharacterView.Character != null) && base.CharacterView.Character.IsPrimaryPlayerCharacter) && !base.CharacterView.Character.IsSupport))
            {
                if (((Time.timeScale == 1f) && (base.CharacterView.Animator.CurrentAction == AbstractCharacterAnimator.Action.NONE)) && ((base.CharacterView.Animator.TargetState == AbstractCharacterAnimator.State.RUN) && (activeDungeon.CurrentGameplayState == GameplayState.ACTION)))
                {
                    if (activeDungeon.Dungeon.Theme == DungeonThemeType.Theme002)
                    {
                        this.m_footStepTypeL = AudioGroupType.SfxGrpGameplay_HeroStepGrassL;
                        this.m_footStepTypeR = AudioGroupType.SfxGrpGameplay_HeroStepGrassR;
                    }
                    else if (activeDungeon.Dungeon.Theme == DungeonThemeType.Theme003)
                    {
                        this.m_footStepTypeL = AudioGroupType.SfxGrpGameplay_HeroStepIceL;
                        this.m_footStepTypeR = AudioGroupType.SfxGrpGameplay_HeroStepIceR;
                    }
                    else
                    {
                        this.m_footStepTypeL = AudioGroupType.SfxGrpGameplay_HeroStepL;
                        this.m_footStepTypeR = AudioGroupType.SfxGrpGameplay_HeroStepR;
                    }
                    if ((PlayerView.Binder.AudioSystem.numberOfSfxAudioGroupPlaying(this.m_footStepTypeL) == 0) && (PlayerView.Binder.AudioSystem.numberOfSfxAudioGroupPlaying(this.m_footStepTypeR) == 0))
                    {
                        AudioSystem.PlaybackParameters pp = new AudioSystem.PlaybackParameters();
                        pp.PitchMin = 1f;
                        pp.PitchMax = 1f;
                        PlayerView.Binder.AudioSystem.playSfxGrp(this.m_footStepTypeL, pp);
                        AudioSystem.PlaybackParameters parameters2 = new AudioSystem.PlaybackParameters();
                        parameters2.DelayMin = 0.28f;
                        parameters2.DelayMax = 0.28f;
                        parameters2.PitchMin = 1f;
                        parameters2.PitchMax = 1f;
                        PlayerView.Binder.AudioSystem.playSfxGrp(this.m_footStepTypeR, parameters2);
                    }
                    this.updateArmorLayer(true);
                }
                else
                {
                    this.updateArmorLayer(false);
                }
            }
        }
Beispiel #19
0
        protected void Update()
        {
            ActiveDungeon     activeDungeon   = GameLogic.Binder.GameState.ActiveDungeon;
            CharacterInstance activeCharacter = GameLogic.Binder.GameState.Player.ActiveCharacter;
            MiniPopupMenu     contentMenu     = (MiniPopupMenu)base.m_contentMenu;

            if ((PlayerView.Binder.TransitionSystem.InCriticalTransition || GameLogic.Binder.FrenzySystem.isFrenzyActive()) || (activeDungeon.ActiveRoom.MainBossSummoned || (activeCharacter.Inventory.BossPotions == 0)))
            {
                contentMenu.MainButton.Button.interactable = false;
            }
            else if (activeDungeon.CurrentGameplayState == GameplayState.ACTION)
            {
                contentMenu.MainButton.Button.interactable = true;
            }
            else
            {
                contentMenu.MainButton.Button.interactable = false;
            }
            contentMenu.MainButton.Bg.material = !contentMenu.MainButton.Button.interactable ? PlayerView.Binder.DisabledUiMaterial : null;
        }
Beispiel #20
0
        public override void update(float dt)
        {
            ActiveDungeon     activeDungeon          = GameLogic.Binder.GameState.ActiveDungeon;
            CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;

            if ((base.Character.ManualTargetPos != Vector3.zero) && (PhysicsUtil.DistBetween(base.Character, base.Character.ManualTargetPos) > 1f))
            {
                this.m_movementBehaviour.update(dt);
            }
            else if (((primaryPlayerCharacter.TargetCharacter != null) && (PhysicsUtil.DistBetween(primaryPlayerCharacter, primaryPlayerCharacter.TargetCharacter) > ConfigGameplay.PASSIVE_HP_REGEN_PROXIMITY_THRESHOLD)) || (primaryPlayerCharacter.ManualTargetPos != Vector3.zero))
            {
                if ((base.Character.TargetCharacter != primaryPlayerCharacter.TargetCharacter) || (base.Character.ManualTargetPos != primaryPlayerCharacter.ManualTargetPos))
                {
                    CmdSetCharacterTarget.ExecuteStatic(base.Character, primaryPlayerCharacter.TargetCharacter, primaryPlayerCharacter.ManualTargetPos);
                }
                this.m_movementBehaviour.update(dt);
                this.m_seekTacticalPosition = true;
            }
            else if (this.m_seekTacticalPosition)
            {
                this.m_targetingAiBehaviour.update(dt);
                if (base.Character.TargetCharacter != null)
                {
                    Vector3 worldPt = base.Character.TargetCharacter.PhysicsBody.Transform.position - ((Vector3)(base.Character.TargetCharacter.PhysicsBody.Transform.forward * 1.5f));
                    worldPt = activeDungeon.ActiveRoom.calculateNearestEmptySpot(worldPt, worldPt - base.Character.TargetCharacter.PhysicsBody.Transform.position, 1f, 1f, 6f, null);
                    CmdSetCharacterTarget.ExecuteStatic(base.Character, null, worldPt);
                    this.m_seekTacticalPosition = false;
                }
            }
            else
            {
                this.m_targetingAiBehaviour.update(dt);
                this.m_movementBehaviour.update(dt);
                if (((base.Character.TargetCharacter != null) && this.m_movementBehaviour.WithinAttackDistance) && base.Character.PhysicsBody.rotatedEnoughForMovement())
                {
                    base.Character.AttackRoutine = GameLogic.Binder.CommandProcessor.executeCharacterSpecific(base.Character, new CmdAttackMelee(base.Character, base.Character.TargetCharacter), 0f);
                }
            }
        }
Beispiel #21
0
        protected void FixedUpdate()
        {
            ActiveDungeon activeDungeon = GameLogic.Binder.GameState.ActiveDungeon;

            for (int i = 0; i < this.m_aiBehaviours.Count; i++)
            {
                AiBehaviour behaviour = this.m_aiBehaviours[i];
                if (behaviour.UpdateTimer.tick(Time.deltaTime * Time.timeScale))
                {
                    CharacterInstance character = behaviour.Character;
                    float             dt        = behaviour.UpdateTimer.timeElapsed();
                    behaviour.UpdateTimer.reset();
                    behaviour.preUpdate(dt);
                    if (((activeDungeon == null) || (activeDungeon.ActiveRoom == null)) || ((activeDungeon.CurrentGameplayState != GameplayState.ACTION) && (activeDungeon.CurrentGameplayState != GameplayState.START_CEREMONY_STEP1)))
                    {
                        CmdSetCharacterVelocityAndFacing.ExecuteStatic(character, Vector3.zero, character.PhysicsBody.Transform.forward);
                    }
                    else if ((((activeDungeon.CurrentGameplayState != GameplayState.START_CEREMONY_STEP1) && !character.IsDead) && (!character.isAttacking() && (character.AttackCooldownTimer <= 0f))) && (!character.ExternallyControlled && !character.Stunned))
                    {
                        behaviour.update(dt);
                    }
                }
            }
        }
Beispiel #22
0
 private void onGameplayStarted(ActiveDungeon activeDungeon)
 {
     this.onRefresh();
 }
 private void onGameplayStarted(ActiveDungeon activeDungeon)
 {
     this.refreshMissionFeatureAvailability(activeDungeon.PrimaryPlayerCharacter.OwningPlayer);
 }
 private void OnGameplayStarted(ActiveDungeon activeDungeon)
 {
     this.UpdateHighestFloorScore();
 }
        public override void update(float dt)
        {
            ActiveDungeon     activeDungeon          = GameLogic.Binder.GameState.ActiveDungeon;
            CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;

            if (!base.Character.isExecutingSkill())
            {
                if ((base.Character.ManualTargetPos != Vector3.zero) && (PhysicsUtil.DistBetween(base.Character, base.Character.ManualTargetPos) > 1f))
                {
                    this.m_movementBehaviour.update(dt);
                    this.m_seekTacticalPositionTime = Time.fixedTime + UnityEngine.Random.Range((float)2f, (float)2.5f);
                }
                else if ((!primaryPlayerCharacter.IsDead && (primaryPlayerCharacter.CurrentHpNormalized <= 0.5f)) && (Time.fixedTime >= this.m_nextPossibleSkillExecutionTime))
                {
                    if (base.Character.TargetCharacter != primaryPlayerCharacter)
                    {
                        CmdSetCharacterTarget.ExecuteStatic(base.Character, primaryPlayerCharacter, Vector3.zero);
                    }
                    if (base.Character.PhysicsBody.rotatedEnoughForMovement())
                    {
                        GameLogic.Binder.SkillSystem.activateSkill(base.Character, SkillType.Heal, -1f, null);
                        this.m_nextPossibleSkillExecutionTime = Time.fixedTime + ConfigSkills.SHARED_DATA[SkillType.Heal].Cooldown;
                    }
                }
                else if (((primaryPlayerCharacter.TargetCharacter != null) && (PhysicsUtil.DistBetween(primaryPlayerCharacter, primaryPlayerCharacter.TargetCharacter) > ConfigGameplay.PASSIVE_HP_REGEN_PROXIMITY_THRESHOLD)) || (primaryPlayerCharacter.ManualTargetPos != Vector3.zero))
                {
                    if ((base.Character.TargetCharacter != primaryPlayerCharacter.TargetCharacter) || (base.Character.ManualTargetPos != primaryPlayerCharacter.ManualTargetPos))
                    {
                        CmdSetCharacterTarget.ExecuteStatic(base.Character, primaryPlayerCharacter.TargetCharacter, primaryPlayerCharacter.ManualTargetPos);
                    }
                    this.m_movementBehaviour.update(dt);
                    this.m_seekTacticalPositionTime = Time.fixedTime;
                }
                else if ((this.m_seekTacticalPositionTime <= 0f) || (Time.fixedTime < this.m_seekTacticalPositionTime))
                {
                    CharacterInstance b = activeDungeon.ActiveRoom.getClosestEnemyCharacter(base.Character, false);
                    if ((b != null) && (PhysicsUtil.DistBetween(base.Character, b) < (base.Character.AttackRange(true) * 0.5f)))
                    {
                        this.m_seekTacticalPositionTime = Time.fixedTime;
                    }
                    else
                    {
                        this.m_targetingAiBehaviour.update(dt);
                        this.m_movementBehaviour.update(dt);
                        if (((base.Character.TargetCharacter != null) && this.m_movementBehaviour.WithinAttackDistance) && (this.m_movementBehaviour.LineOfSightToTargetCharacter && base.Character.PhysicsBody.rotatedEnoughForMovement()))
                        {
                            Vector3 position = base.Character.TargetCharacter.PhysicsBody.Transform.position;
                            base.Character.AttackRoutine = GameLogic.Binder.CommandProcessor.executeCharacterSpecific(base.Character, new CmdAttackRanged(base.Character, position), 0f);
                        }
                    }
                }
                else
                {
                    CharacterInstance toCharacter = activeDungeon.ActiveRoom.getClosestEnemyCharacter(base.Character, false);
                    if (toCharacter != null)
                    {
                        Vector3 vector;
                        int     num2 = 0;
                        do
                        {
                            float   num3    = base.Character.AttackRange(true) * 0.75f;
                            Vector3 vector2 = (Vector3)(new Vector3(UnityEngine.Random.insideUnitCircle.x, 0f, UnityEngine.Random.insideUnitCircle.y) * 0.5f);
                            switch (UnityEngine.Random.Range(0, 3))
                            {
                            case 0:
                                vector = (toCharacter.PhysicsBody.Transform.position - ((Vector3)(toCharacter.PhysicsBody.Transform.right * num3))) + vector2;
                                break;

                            case 1:
                                vector = (toCharacter.PhysicsBody.Transform.position + ((Vector3)(toCharacter.PhysicsBody.Transform.right * num3))) + vector2;
                                break;

                            default:
                                vector = (toCharacter.PhysicsBody.Transform.position - ((Vector3)(toCharacter.PhysicsBody.Transform.forward * num3))) + vector2;
                                break;
                            }
                            int?mask = null;
                            vector = activeDungeon.ActiveRoom.calculateNearestEmptySpot(vector, Vector3.zero, 1f, 1f, 6f, mask);
                            num2++;
                        }while ((num2 < 20) && (!activeDungeon.ActiveRoom.lineOfSightCharacterToCharacter(base.Character, toCharacter) || (activeDungeon.ActiveRoom.getEnemyCharactersWithinRadius(vector, base.Character.AttackRange(true) * 0.5f, base.Character).Count > 0)));
                        CmdSetCharacterTarget.ExecuteStatic(base.Character, null, vector);
                    }
                    this.m_seekTacticalPositionTime = 0f;
                }
            }
        }
        public override void update(float dt)
        {
            ActiveDungeon     activeDungeon          = GameLogic.Binder.GameState.ActiveDungeon;
            CharacterInstance primaryPlayerCharacter = activeDungeon.PrimaryPlayerCharacter;

            if (((base.Character.getPerkInstanceCount(PerkType.AllyHeal) > 0) && !primaryPlayerCharacter.IsDead) && ((primaryPlayerCharacter.CurrentHpNormalized <= base.Character.getGenericModifierForPerkType(PerkType.AllyHeal)) && (Time.fixedTime >= this.m_nextPossibleHealSkillExecutionTime)))
            {
                GameLogic.Binder.SkillSystem.activateSkill(base.Character, SkillType.Heal, -1f, primaryPlayerCharacter);
                this.m_nextPossibleHealSkillExecutionTime = Time.fixedTime + ConfigSkills.SHARED_DATA[SkillType.Heal].Cooldown;
            }
            if (((primaryPlayerCharacter.TargetCharacter != null) && (PhysicsUtil.DistBetween(primaryPlayerCharacter, primaryPlayerCharacter.TargetCharacter) > 6f)) || (primaryPlayerCharacter.ManualTargetPos != Vector3.zero))
            {
                if ((base.Character.TargetCharacter != primaryPlayerCharacter.TargetCharacter) || (base.Character.ManualTargetPos != primaryPlayerCharacter.ManualTargetPos))
                {
                    CmdSetCharacterTarget.ExecuteStatic(base.Character, primaryPlayerCharacter.TargetCharacter, primaryPlayerCharacter.ManualTargetPos);
                }
                this.m_movementBehaviour.update(dt);
                this.m_seekTacticalPositionTime = Time.fixedTime;
            }
            else if ((base.Character.ManualTargetPos != Vector3.zero) && (PhysicsUtil.DistBetween(base.Character, base.Character.ManualTargetPos) > 1f))
            {
                this.m_movementBehaviour.update(dt);
                this.m_seekTacticalPositionTime = Time.fixedTime + UnityEngine.Random.Range((float)2f, (float)2.5f);
            }
            else
            {
                Vector3 targetWorldPt = primaryPlayerCharacter.PhysicsBody.Transform.position + ((Vector3)(primaryPlayerCharacter.PhysicsBody.Transform.forward * 2f));
                if (base.Character.canBlink(targetWorldPt))
                {
                    GameLogic.Binder.BlinkSystem.blinkCharacter(base.Character, targetWorldPt, 0.6f);
                }
                else if ((this.m_seekTacticalPositionTime > 0f) && (Time.fixedTime >= this.m_seekTacticalPositionTime))
                {
                    CharacterInstance instance2 = activeDungeon.ActiveRoom.getClosestEnemyCharacter(base.Character, false);
                    if (instance2 != null)
                    {
                        bool    flag = false;
                        Vector3 zero = Vector3.zero;
                        for (int i = 0; (i < 20) && !flag; i++)
                        {
                            Vector3 vector4    = new Vector3(UnityEngine.Random.insideUnitCircle.x, 0f, UnityEngine.Random.insideUnitCircle.y);
                            Vector3 normalized = vector4.normalized;
                            zero = instance2.PhysicsBody.Transform.position + ((Vector3)(normalized * base.Character.AttackRange(true)));
                            int?mask = null;
                            zero = activeDungeon.ActiveRoom.calculateNearestEmptySpot(zero, normalized, 1f, 0.25f, 2f, mask);
                            CharacterInstance instance3 = activeDungeon.ActiveRoom.getClosestEnemyCharacter(base.Character, true);
                            CharacterInstance instance4 = activeDungeon.ActiveRoom.getClosestEnemyCharacter(base.Character, false);
                            flag = (instance3 != null) && (Vector3.Distance(instance4.PhysicsBody.Transform.position, zero) >= (base.Character.AttackRange(true) * 0.5f));
                        }
                        if (flag)
                        {
                            CmdSetCharacterTarget.ExecuteStatic(base.Character, null, zero);
                        }
                    }
                    this.m_seekTacticalPositionTime = 0f;
                }
                else
                {
                    CharacterInstance b = activeDungeon.ActiveRoom.getClosestEnemyCharacter(base.Character, false);
                    if ((b != null) && (PhysicsUtil.DistBetween(base.Character, b) < (base.Character.AttackRange(true) * 0.5f)))
                    {
                        this.m_seekTacticalPositionTime = Time.fixedTime;
                    }
                    else
                    {
                        this.m_targetingAiBehaviour.update(dt);
                        this.m_movementBehaviour.update(dt);
                    }
                }
            }
        }