public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
        {
            if (!CheckInTransitionBetweenSameState(stateEffect.CharacterControl, animator) && stateInfo.normalizedTime >= ProjectileLaunchTiming && stateInfo.normalizedTime < ProjectileLaunchTiming + ReservedTime)
            {
                //if (!animator.IsInTransition(0) && stateInfo.normalizedTime >= ProjectileLaunchTiming) {
                foreach (AttackInfo info in AttackManager.Instance.CurrentAttackInfo)
                {
                    if (!info.IsRegistered && info.ProjectileSkill == this)
                    {
                        Vector3 spawnPoint = Vector3.zero;
                        if (IsGeneratedOnSpawnPoint)
                        {
                            spawnPoint = stateEffect.CharacterControl.GetProjectileSpawnPoint().position;
                        }
                        else
                        {
                            spawnPoint   = stateEffect.CharacterControl.gameObject.transform.position;
                            spawnPoint.y = 0f;
                        }
                        //Launch (info, stateEffect.CharacterControl, spawnPoint, stateEffect.CharacterControl.FaceTarget);
                        Vector3 dir = animator.transform.root.forward;
                        if (DirectionOffset != 0f)
                        {
                            dir = Quaternion.Euler(0f, DirectionOffset, 0f) * dir;
                        }
                        Launch(info, stateEffect.CharacterControl, spawnPoint, dir);

                        info.Register();
                        //Debug.Log ("register projectile : " + stateInfo.normalizedTime.ToString ());
                    }
                }
            }
        }
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (AutoFaceDuration > 0f && stateInfo.normalizedTime > AutoFaceTiming && stateInfo.normalizedTime <= AutoFaceTiming + AutoFaceDuration)
     {
         ChangeFaceDirection(stateEffect, animator, stateInfo, true);
     }
 }
Esempio n. 3
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateEffect.CharacterControl.CharacterData.IsSuperArmour)
     {
         stateEffect.CharacterControl.CharacterData.IsSuperArmour = false;
     }
 }
Esempio n. 4
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (!animator.GetBool(TransitionParameter.EnergyTaken.ToString()) && stateInfo.normalizedTime >= ZoomTiming)
     {
         CameraManager.Instance.ZoomCameraPerFrame(ZoomSpeedGraph.Evaluate(stateInfo.normalizedTime) * ZoomSpeed * Time.deltaTime);
     }
 }
Esempio n. 5
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateInfo.normalizedTime > DamageTiming && animator.GetBool(TransitionParameter.GrapplingHit.ToString()))
     {
         if (stateEffect.CharacterControl.CharacterData.GrapplingTarget != null && !stateEffect.CharacterControl.CharacterData.GrapplingTarget.CharacterData.IsDead)
         {
             stateEffect.CharacterControl.Animator.SetBool(TransitionParameter.GrapplingHit.ToString(), false);
             CharacterControl Target = stateEffect.CharacterControl.CharacterData.GrapplingTarget;
             //Target.Animator.SetFloat (TransitionParameter.SpeedMultiplier.ToString (), 1.0f);
             //Target.Animator.Play ("Idle");
             if (!Target.CharacterData.IsStunned)
             {
                 Target.TakeStun(Stun, this);
             }
             if (Target.CharacterData.IsStunned)
             {
                 Target.TakeDamage(Target.CharacterData.HP, HitReactDuration, this);
             }
             else
             {
                 Target.TakeDamage(Damage, HitReactDuration, this);
             }
             Vector3 dirVector = Target.transform.position - stateEffect.CharacterControl.transform.position;
             Vector3 hitVector = (new Vector3(dirVector.x, 0, dirVector.z)).normalized;
             Target.TakeKnockback(KnockbackForce * hitVector, KnockbackTime);
             Target.CharacterData.FormerAttackTarget = null;
             Target.FaceTarget = -hitVector;
             Target.TurnToTarget(0f, 0f);
             //int randomIndex = Random.Range (0, 3) + 1;
             //Target.Animator.Play ("HitReact" + randomIndex.ToString (), 0, 0f);
         }
     }
 }
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (CheckCollision(stateEffect, animator, stateInfo))
     {
         animator.SetBool(TransitionParameter.EnemyCollision.ToString(), true);
     }
 }
        //[Range (0.01f, 1f)]
        //public float ComboInputStartTime = 0.3f;
        //[Range (0.01f, 1f)]
        //public List<float> ComboInputInterval = new List<float> {0f, 1f};
        //public float ComboInputEndTime = 0.7f;

        //public List<AttackType> AttackParts = new List<AttackPartType> ();
        //public List<AttackInfo> FinishedAttacks = new List<AttackInfo> ();

        public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
        {
            if (animator.GetBool(TransitionParameter.Charge.ToString()) || NotNeedCharge)
            {
                if (stateEffect.CharacterControl.CharacterData.Energy >= EnergyTaken)
                {
                    stateEffect.CharacterControl.TakeEnergy(EnergyTaken, this);
                    GameObject obj     = PoolManager.Instance.GetObject(PoolObjectType.AttackInfo);
                    AttackInfo atkInfo = obj.GetComponent <AttackInfo> ();
                    atkInfo.Init(null, this, stateEffect.CharacterControl);
                    obj.SetActive(true);
                    AttackManager.Instance.CurrentAttackInfo.Add(atkInfo);
                    animator.SetBool(TransitionParameter.EnergyTaken.ToString(), true);
                }
                else
                {
                    stateEffect.CharacterControl.CharacterData.SendMessage(MessageType.EnergyNotEnough);
                }
            }

            //ProjectileSpawnPoint = stateEffect.CharacterControl.GetProjectileSpawnPoint();

            /*
             * if(stateEffect.CharacterControl.CharacterData.GetPrevState() == Animator.StringToHash("AttackHold"))
             * {
             *  Debug.Log("prev state is attack hold");
             *
             * }
             */
            //Debug.Log ("enter launch projectile: " + stateInfo.normalizedTime.ToString ());
        }
Esempio n. 8
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateEffect.CharacterControl.CharacterData.IsInvincible)
     {
         stateEffect.CharacterControl.CharacterData.IsInvincible = false;
     }
 }
Esempio n. 9
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
 {
     if (stateEffect.CharacterControl.CharacterData.FirstFramesOfBlock < MaxBlockFrame)
     {
         stateEffect.CharacterControl.CharacterData.FirstFramesOfBlock++;
     }
 }
Esempio n. 10
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateInfo.normalizedTime > SkipLength && animator.GetFloat(TransitionParameter.SpeedMultiplier.ToString()) > 1.0f)
     {
         animator.SetFloat(TransitionParameter.SpeedMultiplier.ToString(), 1.0f);
     }
 }
Esempio n. 11
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateEffect.CharacterControl.CharacterData.IsColliderOff)
     {
         stateEffect.CharacterControl.TurnOnCollider();
     }
 }
        public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
        {
            foreach (Grappler info in AttackManager.Instance.CurrentGrappler)
            {
                if (info.Skill == this && info.Attacker == stateEffect.CharacterControl && info.IsFinished)
                {
                    //info.IsFinished = true;
                    //info.IsRegistered = false;
                    FinishedGrapplers.Add(info);
                    //Debug.Log (this.name + " deregistered: " + stateInfo.normalizedTime);
                }
            }
            CleanGrapplers();

            /*
             * foreach (Grappler info in FinishedGrapplers) {
             *  if (AttackManager.Instance.CurrentGrappler.Contains (info)) {
             *      AttackManager.Instance.CurrentGrappler.Remove (info);
             *      PoolObject pobj = info.GetComponent<PoolObject> ();
             *      PoolManager.Instance.ReturnToPool (pobj);
             *      info.Clear ();
             *  }
             * }
             * FinishedGrapplers.Clear ();
             */
            animator.SetBool(TransitionParameter.Move.ToString(), false);
            //animator.SetInteger (TransitionParameter.CheckCombo.ToString (), 0);
        }
Esempio n. 13
0
 public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (AutoFaceTiming == 0f)
     {
         ChangeFaceDirection(stateEffect, animator, stateInfo, false);
     }
 }
 public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
 {
     /*
      * AIProgress ai = stateEffect.CharacterControl.AIProgress;
      * if (!AIAgentManager.Instance.CurrentSwarmAgent.Contains (ai))
      *  AIAgentManager.Instance.CurrentSwarmAgent.Add (ai);
      */
 }
Esempio n. 15
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
 {
     /*
      * if (MoveUnderControl)
      *  animator.SetBool (TransitionParameter.Move.ToString (), false);
      */
     stateEffect.CharacterControl.gameObject.transform.position = new Vector3(stateEffect.CharacterControl.gameObject.transform.position.x, 0f, stateEffect.CharacterControl.transform.position.z);
 }
Esempio n. 16
0
 public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateEffect.CharacterControl.CharacterData.GetPrevState() == Animator.StringToHash(PrevStateName))
     {
         animator.SetFloat(TransitionParameter.SpeedMultiplier.ToString(), SpeedUp);
         Debug.Log("trigger skip animation!");
     }
 }
Esempio n. 17
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     animator.SetInteger(TransitionParameter.TransitionIndexer.ToString(), 0);
     animator.SetBool(TransitionParameter.ForcedTransitionDodge.ToString(), false);
     animator.SetBool(TransitionParameter.ForcedTransitionExecute.ToString(), false);
     animator.SetBool(TransitionParameter.ForcedTransitionAttackHold.ToString(), false);
     animator.SetBool(TransitionParameter.ForcedTransitionAttackHoldFS.ToString(), false);
 }
Esempio n. 18
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (!stateEffect.CharacterControl.VFXTrail.isPaused)
     {
         stateEffect.CharacterControl.VFXTrail.Pause(true);
         stateEffect.CharacterControl.VFXTrail.Clear();
     }
 }
Esempio n. 19
0
        public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
        {
            stateEffect.CharacterControl.CharacterData.GrapplingTarget.gameObject.transform.parent = null;
            CharacterControl Target = stateEffect.CharacterControl.CharacterData.GrapplingTarget;

            Target.Animator.SetFloat(TransitionParameter.SpeedMultiplier.ToString(), 1.0f);
            Target.CharacterData.IsInvincible = false;
            //Target.Animator.Play ("Idle");
        }
Esempio n. 20
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
 {
     if (!CheckInTransitionBetweenSameState(stateEffect.CharacterControl, animator))
     {
         //Debug.Log ("not in transition");
         RegisterAttack(stateEffect, animator, animatorStateInfo);
         DeregisterAttack(stateEffect, animator, animatorStateInfo);
     }
 }
Esempio n. 21
0
        public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
        {
            AIProgress AI = stateEffect.CharacterControl.AIProgress;

            if (UseCrowdMethod)
            {
                RegisterInCrowdState(AI);
            }
        }
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     /*
      * AIProgress ai = stateEffect.CharacterControl.AIProgress;
      * if (AIAgentManager.Instance.CurrentSwarmAgent.Contains (ai))
      *  AIAgentManager.Instance.CurrentSwarmAgent.Remove(ai);
      * ai.inputVectorIncremental = new Vector2();
      */
 }
Esempio n. 23
0
        public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
        {
            GameObject   obj    = PoolManager.Instance.GetObject(PoolObjectType.CameraShaker);
            CameraShaker shaker = obj.GetComponent <CameraShaker> ();

            shaker.Init(this, stateEffect.CharacterControl);
            obj.SetActive(true);
            CameraManager.Instance.CurrentCameraShakers.Add(shaker);
        }
Esempio n. 24
0
 public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
 {
     if (SuperArmourBeginTiming == 0f)
     {
         if (!stateEffect.CharacterControl.CharacterData.IsSuperArmour)
         {
             stateEffect.CharacterControl.CharacterData.IsSuperArmour = true;
         }
     }
 }
Esempio n. 25
0
        public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
        {
            AIProgress AI = stateEffect.CharacterControl.AIProgress;

            if (AI.HitCountOnGuard >= TriggerHitCount)
            {
                stateEffect.CharacterControl.CharacterData.FirstFramesOfBlock = -FrameOffset;
                AI.HitCountOnGuard = 0;
            }
        }
Esempio n. 26
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (!stateEffect.CharacterControl.VFXHold.isPaused)
     {
         stateEffect.CharacterControl.VFXHold.Pause(true);
         stateEffect.CharacterControl.VFXHold.Clear();
         WeaponObject weaponObject = stateEffect.CharacterControl.gameObject.GetComponentInChildren <WeaponObject> ();
         weaponObject.ToggleWeaponMaterial();
     }
 }
Esempio n. 27
0
 public override void OnEnter(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo animatorStateInfo)
 {
     if (InvincibleBeginTiming == 0f)
     {
         if (!stateEffect.CharacterControl.CharacterData.IsInvincible)
         {
             stateEffect.CharacterControl.CharacterData.IsInvincible = true;
         }
     }
 }
Esempio n. 28
0
 public override void OnExit(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     foreach (CameraShaker info in CameraManager.Instance.CurrentCameraShakers)
     {
         if (info.skill == this && info.Caster == stateEffect.CharacterControl)
         {
             FinishedShakers.Add(info);
         }
     }
     CleanShakers();
 }
Esempio n. 29
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (stateInfo.normalizedTime > TurnOnRagdollTiming && !stateEffect.CharacterControl.CharacterData.IsRagdollOn)
     {
         stateEffect.CharacterControl.TurnOnRagdoll();
     }
     if (stateInfo.normalizedTime > DestroyTiming)
     {
         stateEffect.CharacterControl.DestroyObject();
     }
 }
Esempio n. 30
0
 public override void UpdateEffect(StatewithEffect stateEffect, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (!stateEffect.CharacterControl.CharacterData.IsInvincible && stateInfo.normalizedTime >= InvincibleBeginTiming && stateInfo.normalizedTime < InvincibleEndTiming)
     {
         stateEffect.CharacterControl.CharacterData.IsInvincible = true;
     }
     if (stateEffect.CharacterControl.CharacterData.IsInvincible && stateInfo.normalizedTime >= InvincibleEndTiming)
     {
         stateEffect.CharacterControl.CharacterData.IsInvincible = false;
     }
 }