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();
                    }
                }
            }
        }
        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();
                }
            }
        }
 public override void update(float dt)
 {
     if (base.Character.TargetCharacter == null)
     {
         CmdSetCharacterVelocityAndFacing.ExecuteStatic(base.Character, Vector3.zero, base.Character.Facing);
     }
     else
     {
         this.m_pursuitBehaviour.update(dt);
         if ((this.m_pursuitBehaviour.WithinAttackDistance && this.m_pursuitBehaviour.LineOfSightToTargetCharacter) && base.Character.PhysicsBody.rotatedEnoughForMovement())
         {
             base.Character.AttackRoutine = GameLogic.Binder.CommandProcessor.executeCharacterSpecific(base.Character, new CmdAttackRanged(base.Character, base.Character.TargetCharacter.PhysicsBody.Transform.position), 0f);
         }
     }
 }
Esempio n. 4
0
 public override void update(float dt)
 {
     if ((base.Character.TargetCharacter == null) && (base.Character.ManualTargetPos == Vector3.zero))
     {
         CmdSetCharacterVelocityAndFacing.ExecuteStatic(base.Character, Vector3.zero, base.Character.Facing);
     }
     else if (base.Character.RemainInPlaceOnGuard && ((base.Character.TargetCharacter == null) || (PhysicsUtil.DistBetween(base.Character, base.Character.TargetCharacter) > ConfigGameplay.AGGRO_RANGE_IDLE)))
     {
         CmdSetCharacterVelocityAndFacing.ExecuteStatic(base.Character, Vector3.zero, base.Character.Facing);
     }
     else
     {
         this.m_pursuitBehaviour.update(dt);
         if (this.m_pursuitBehaviour.WithinAttackDistance && base.Character.PhysicsBody.rotatedEnoughForMovement())
         {
             base.Character.AttackRoutine = GameLogic.Binder.CommandProcessor.executeCharacterSpecific(base.Character, new CmdAttackMelee(base.Character, base.Character.TargetCharacter), 0f);
         }
     }
 }
Esempio n. 5
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);
                    }
                }
            }
        }