Exemplo n.º 1
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.ShakingOffDamage)
     {
         Vector3 hit_dir = new Vector3(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f));
         hit_dir.Normalize();
         this.m_Player.GiveDamage(null, null, 10f, hit_dir, DamageType.Insects, 0, false);
         return;
     }
     if (id == AnimEventID.ShakingOffEnd)
     {
         this.Stop();
         return;
     }
     if (id == AnimEventID.WaspsFlyAwayLHand)
     {
         InsectsManager.Get().FlyAway(Hand.Left);
         return;
     }
     if (id == AnimEventID.WaspsFlyAwayRHand)
     {
         InsectsManager.Get().FlyAway(Hand.Right);
     }
 }
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.HarvestingEnd)
     {
         this.m_AnimLoops++;
         if (this.m_AnimLoops == Skill.Get <HarvestingAnimalsSkill>().GetAnimationsCount())
         {
             this.m_Animator.SetTrigger(this.m_HarvestingFinishHash);
             return;
         }
     }
     else
     {
         if (id == AnimEventID.HarvestingFinishEnd)
         {
             this.m_Animator.SetTrigger(this.m_HarvestingAnimalEndHash);
             this.m_End = true;
             return;
         }
         if (id == AnimEventID.HarvestingSpawnFX)
         {
             ParticlesManager.Get().Spawn("Animal Harvest", Camera.main.transform.position + Camera.main.transform.forward * 0.1f + Vector3.down * 0.5f, Player.Get().transform.rotation, Vector3.zero, null, -1f, false);
         }
     }
 }
Exemplo n.º 3
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.FishingCastEnd)
     {
         if (!this.m_Target.IsZero())
         {
             this.SetState(FishingController.State.Waiting);
         }
         else
         {
             this.SetState(FishingController.State.Reel);
         }
     }
     else if (id == AnimEventID.FishingStrikeEnd || id == AnimEventID.FishingReelEnd)
     {
         if (this.m_FishingRod.m_Fish)
         {
             this.SetState(FishingController.State.Fish);
         }
         else
         {
             this.SetState(FishingController.State.None);
         }
         this.m_Player.UnblockMoves();
         this.m_FishingRod.StopFishing();
     }
 }
Exemplo n.º 4
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.FishingCastEnd)
     {
         if (!this.m_Target.IsZero())
         {
             this.SetState(FishingController.State.Waiting);
             return;
         }
         this.SetState(FishingController.State.Reel);
         return;
     }
     else
     {
         if (id == AnimEventID.FishingStrikeEnd)
         {
             this.SetState(FishingController.State.Idle);
             this.ShowFish();
             this.m_FishingRod.StopFishing();
             return;
         }
         if (id == AnimEventID.FishingHideVein && this.m_FishingRod)
         {
             this.m_FishingRod.m_HideVein = true;
         }
         return;
     }
 }
Exemplo n.º 5
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.GrabItem || id == AnimEventID.DrinkLiquid)
     {
         if (this.m_TriggerToExecute)
         {
             this.m_TriggerToExecute.OnExecute(this.m_TriggerActionToExecute);
             this.m_TriggerActionToExecute  = TriggerAction.TYPE.None;
             this.m_LastTrigerExecutionTime = Time.time;
             this.m_TriggerToExecute        = null;
         }
     }
     else if (id == AnimEventID.GrabItemEnd)
     {
         this.m_Animator.SetBool(TriggerController.s_BGrabItem, false);
         this.m_Animator.SetBool(TriggerController.s_BGrabItemBow, false);
         this.m_Animator.SetBool(TriggerController.s_BGrabItemBambooBow, false);
         this.m_TriggerToExecute = null;
     }
     else if (id == AnimEventID.DrinkLiquidEnd)
     {
         this.m_Animator.SetBool(this.m_BDrinkWater, false);
         this.m_TriggerInAction = false;
     }
 }
Exemplo n.º 6
0
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.ShowMap)
     {
         this.m_Map.gameObject.SetActive(true);
         return;
     }
     if (id == AnimEventID.ShowMapEnd)
     {
         this.m_CanDisable = true;
         if (!this.m_CursorVisible && GreenHellGame.IsPCControllerActive())
         {
             CursorManager.Get().ShowCursor(true, false);
             this.m_CursorVisible = true;
         }
         HUDMap.Get().Activate();
         return;
     }
     if (id == AnimEventID.HideMapEnd)
     {
         this.Stop();
         return;
     }
     base.OnAnimEvent(id);
 }
Exemplo n.º 7
0
 public void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.CureMachineRClapOpenEnd)
     {
         if (this.m_State != CureMachine.State.Success)
         {
             this.SetState(CureMachine.State.WaitingForItem);
             return;
         }
     }
     else
     {
         if (id == AnimEventID.CureMachineRClapCloseEnd)
         {
             this.SetState(CureMachine.State.Processing);
             return;
         }
         if (id == AnimEventID.CureMachineProcessingEnd && this.m_ItemSlot.m_Item)
         {
             if (this.m_ItemSlot.m_Item.GetInfoID() == this.m_ProperItemID)
             {
                 this.SetState(CureMachine.State.Success);
                 return;
             }
             this.SetState(CureMachine.State.Fail);
         }
     }
 }
Exemplo n.º 8
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.BowShotEnd)
     {
         if (this.m_State == BowController.State.Shot)
         {
             this.ShotEnd();
             return;
         }
     }
     else
     {
         if (id == AnimEventID.BowReloadEnd)
         {
             this.SetState(BowController.State.Idle);
             return;
         }
         if (id == AnimEventID.GrabItemShowArrow)
         {
             this.ShowArrow(true);
             return;
         }
         if (id == AnimEventID.GrabItemHideArrow)
         {
             this.ShowArrow(false);
             return;
         }
         if (id == AnimEventID.WatchStart)
         {
             this.CheckForWatchHide();
         }
     }
 }
Exemplo n.º 9
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.MeleeRightAttackStart)
     {
         this.m_AttackDirection = AttackDirection.Right;
         this.m_Animator.SetBool(this.m_BAttackLeft, false);
         base.SetState(WeaponControllerState.Swing);
     }
     else if (id == AnimEventID.MeleeLeftAttackStart)
     {
         this.m_AttackDirection = AttackDirection.Left;
         this.m_Animator.SetBool(this.m_BAttackRight, false);
         base.SetState(WeaponControllerState.Swing);
     }
     else if (id == AnimEventID.MeleeUpAttackStart)
     {
         this.m_AttackDirection = AttackDirection.Up;
         base.SetState(WeaponControllerState.Swing);
     }
     else if (id == AnimEventID.MeleeRightAttackEnd)
     {
         this.PlayerMeleeRightAttackEnd();
     }
     else if (id == AnimEventID.MeleeUpAttackEnd)
     {
         this.PlayerMeleeUpAttackEnd();
     }
     else if (id == AnimEventID.MeleeLeftAttackEnd)
     {
         this.PlayerMeleeLeftAttackEnd();
     }
 }
Exemplo n.º 10
0
 public void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.BowTrapShootArrow)
     {
         this.ShootArrow();
     }
 }
Exemplo n.º 11
0
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.ObjectSwingEnd)
     {
         this.SetState(ItemController.State.FinishSwing);
         return;
     }
     if (id == AnimEventID.ObjectThrow && this.m_State == ItemController.State.Throw)
     {
         this.Throw();
         return;
     }
     if (id == AnimEventID.FireIgnite)
     {
         if (this.m_FireObjectToIgnite != null)
         {
             this.m_FireObjectToIgnite.Ignite();
             Player.Get().SetWantedItem(Hand.Right, null, true);
             UnityEngine.Object.Destroy(this.m_Item.gameObject);
             this.m_FireObjectToIgnite = null;
             return;
         }
     }
     else
     {
         base.OnAnimEvent(id);
     }
 }
Exemplo n.º 12
0
 public void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.ShamanAttackEnd)
     {
         if (ShamanManager.Get().m_AttackVersion == ShamanManager.AttackVersion.Fast)
         {
             if (base.transform.position.Distance(this.m_Player.transform.position) <= this.m_Agent.stoppingDistance)
             {
                 this.SetState(Shaman.State.Attack);
                 return;
             }
             this.SetState(Shaman.State.MoveToPlayer);
             return;
         }
         else if (ShamanManager.Get().m_AttackVersion == ShamanManager.AttackVersion.Slow)
         {
             if (this.m_AttacksCount == 0 && base.transform.position.Distance(this.m_Player.transform.position) <= this.m_Agent.stoppingDistance && UnityEngine.Random.Range(0f, 1f) > this.m_DoubleAttackChance)
             {
                 this.SetState(Shaman.State.Attack);
                 this.m_AttacksCount++;
                 return;
             }
             this.SetState(Shaman.State.Idle);
             this.m_AttacksCount = 0;
             return;
         }
     }
     else if (id == AnimEventID.ShamanDamage)
     {
         this.TryGiveDamage();
     }
 }
Exemplo n.º 13
0
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.SpawnWashingLHandFX)
     {
         Transform lhand = Player.Get().GetLHand();
         this.m_LHandParticle = ParticlesManager.Get().Spawn("fx_washing_player", lhand.position, Quaternion.identity, Vector3.zero, null, -1f, false);
         return;
     }
     if (id == AnimEventID.SpawnWashingRHandFX)
     {
         Transform rhand = Player.Get().GetRHand();
         this.m_RHandParticle = ParticlesManager.Get().Spawn("fx_washing_player", rhand.position, Quaternion.identity, Vector3.zero, null, -1f, false);
         return;
     }
     if (id == AnimEventID.DestroyWashingLHandFX)
     {
         ParticlesManager.Get().Remove(this.m_LHandParticle);
         this.m_LHandParticle = null;
         return;
     }
     if (id == AnimEventID.DestroyWashingRHandFX)
     {
         ParticlesManager.Get().Remove(this.m_RHandParticle);
         this.m_RHandParticle = null;
     }
 }
Exemplo n.º 14
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.RecoverEnd)
     {
         this.m_Animator.SetInteger(this.m_PassOutHash, 0);
     }
 }
Exemplo n.º 15
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.PlaySwingSound && this.CanPlaySwingSound())
     {
         this.PlaySwingSound();
     }
 }
Exemplo n.º 16
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.BowShot)
     {
         this.Shot();
     }
 }
Exemplo n.º 17
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (this.m_ActiveGoal != null)
     {
         this.m_ActiveGoal.OnAnimEvent(id);
     }
 }
Exemplo n.º 18
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.SwitchWeapon)
     {
         this.m_AI.SwitchWeapon();
     }
 }
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.DemoHitReaction)
     {
         PostProcessManager.Get().SetWeight(PostProcessManager.Effect.Blood, 1f);
     }
 }
Exemplo n.º 20
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.HitReactionEnd)
     {
         this.Stop();
     }
 }
Exemplo n.º 21
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.RecoverEnd)
     {
         this.m_Animator.SetBool(this.m_StandUpHash, false);
     }
 }
Exemplo n.º 22
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.ThrowStone)
     {
         this.Throw();
     }
 }
Exemplo n.º 23
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.FootStep)
     {
         this.PlayFootstepSound();
     }
 }
Exemplo n.º 24
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.AnimationTriggerEnd)
     {
         this.Stop();
     }
 }
Exemplo n.º 25
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (id == AnimEventID.BowShotEnd)
     {
         this.m_Finish = true;
     }
 }
Exemplo n.º 26
0
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.LadderSound)
     {
         PlayerAudioModule.Get().PlayLadderSound();
         return;
     }
     base.OnAnimEvent(id);
 }
Exemplo n.º 27
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (this.m_AI.m_HealthModule && this.m_AI.m_HealthModule.m_IsDead)
     {
         return;
     }
     if (id == AnimEventID.RattlesnakeAttack)
     {
         this.PlayAttackSound();
     }
 }
Exemplo n.º 28
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (this.m_State == SwimState.Dive && (id == AnimEventID.DiveSound0 || id == AnimEventID.DiveSound1 || id == AnimEventID.DiveSound2))
     {
         PlayerAudioModule.Get().PlayDiveSound();
     }
     else if (this.m_State == SwimState.Swim && (id == AnimEventID.SwimSound0 || id == AnimEventID.SwimSound1 || id == AnimEventID.SwimSound2))
     {
         PlayerAudioModule.Get().PlaySwimSound();
     }
 }
Exemplo n.º 29
0
 public override void OnAnimEvent(AnimEventID id)
 {
     if (id == AnimEventID.MudMixerEnd)
     {
         this.m_Finish = true;
         return;
     }
     if (id == AnimEventID.MudMixerGetDirty)
     {
         PlayerConditionModule.Get().GetDirtinessAdd(GetDirtyReason.UsingMud, null);
     }
 }
Exemplo n.º 30
0
 public override void OnAnimEvent(AnimEventID id)
 {
     base.OnAnimEvent(id);
     if (this.m_AI.m_HealthModule && this.m_AI.m_HealthModule.m_IsDead)
     {
         return;
     }
     if (id == AnimEventID.GiveDamage && !this.GivePlayerDamage())
     {
         this.GiveConstructionDamage();
     }
 }