private void InitAnticipation(PlayerPickupsModule pPickupsModule) { pPickupsModule.SetVariable(c_sVariableName_fGrapplingHookCurrentStepStartTime, Time.time); pPickupsModule.m_pMaster.SetBehaviourFrozen(true); GrapplingHook pHook = (GrapplingHook)(pPickupsModule.GetVariable(c_sVariableName_pGrapplingHookObject)); pPickupsModule.m_pMaster.m_pInventorySlotsModule.EquipItemInSlot(pHook.transform, EInventorySlot.HAND, false); pPickupsModule.SetVariable(c_sVariableName_eGrapplingHookCurrentStep, EGrapplingHookEffectStep.ANTICIPATION); }
private void InitTraction(PlayerPickupsModule pPickupsModule, Vector3 tHookDestination) { PlayerCharacter pPlayer = pPickupsModule.m_pMaster; pPlayer.CanKillGhosts = true; m_pSuperGhostKillEffect.HookEffect(pPickupsModule.m_pMaster); pPickupsModule.SetVariable(c_sVariableName_tGrapplingHookTractionDestination, tHookDestination); pPickupsModule.SetVariable(c_sVariableName_fGrapplingHookCurrentStepStartTime, Time.time); pPickupsModule.SetVariable(c_sVariableName_eGrapplingHookCurrentStep, EGrapplingHookEffectStep.TRACTION); }
private void ResetVariablesAfterAbort(PlayerPickupsModule pPickupsModule) { GrapplingHook pHook = (GrapplingHook)(pPickupsModule.GetVariable(c_sVariableName_pGrapplingHookObject)); PutHookBackInBelt(pHook, pPickupsModule.m_pMaster); ResetVariables(pPickupsModule); pPickupsModule.SetVariable(c_sVariableName_pGrapplingHookObject, pHook); pPickupsModule.m_pMaster.SetBehaviourFrozen(false); pPickupsModule.SetVariable(c_sVariableName_eGrapplingHookCurrentStep, EGrapplingHookEffectStep.AWAITING_INPUT); }
private void InitHookObject(PlayerPickupsModule pPickupsModule) { GrapplingHook pHook = Instantiate(m_pHookPrefab); pPickupsModule.m_pMaster.m_pInventorySlotsModule.EquipItemInSlot(pHook.transform, EInventorySlot.BELT, false); pPickupsModule.SetVariable(c_sVariableName_pGrapplingHookObject, pHook); }
override public void GiveEffectToPlayer(PlayerPickupsModule pPickupsModule) { pPickupsModule.RegisterPelletCollect(); pPickupsModule.SetVariable(c_sVariableName_fSuperPelletStartTime, Time.time); GhostsManager.Instance.GiveFleeBehaviourToGhosts(); if (!pPickupsModule.HasActiveEffect(this)) { pPickupsModule.GiveActiveEffect(this); PlayerCharacter.Instance.CanKillGhosts = true; PlayerCharacter.Instance.m_pNavMeshObstacle.carving = true; // So ghosts won't try to get through the player when trying to go away from him } }
override public void GiveEffectToPlayer(PlayerPickupsModule pPickupsModule) { if (pPickupsModule.HasActiveEffect(this)) { return; } pPickupsModule.GiveActiveEffect(this); ResetVariables(pPickupsModule); InitHookObject(pPickupsModule); pPickupsModule.SetVariable(c_sVariableName_eGrapplingHookCurrentStep, EGrapplingHookEffectStep.AWAITING_INPUT); }
private void AbortShot(PlayerPickupsModule pPickupsModule, Vector3 tHookDestination) { pPickupsModule.SetVariable(c_sVariableName_eGrapplingHookCurrentStep, EGrapplingHookEffectStep.ABORTED); PinHookToDestination(pPickupsModule.m_pMaster, tHookDestination); // Just show the hook for a frame, for visual feedback on why it's got aborted }