コード例 #1
0
    protected override void OnEnable()
    {
        base.OnEnable();
        this.m_Animator.SetBool(this.m_BSwim, true);
        this.m_Player.m_UseGravity = false;
        this.m_DiveBone            = this.m_Player.gameObject.transform.FindDeepChild("mixamorig:Spine");
        this.m_SwimBones.Clear();
        this.m_SwimBones.Add(this.m_Player.gameObject.transform.FindDeepChild("mixamorig:Eye.R"));
        this.m_WantedSpeed.Force(this.m_CharacterController.velocity);
        this.m_SwimBonesRotation = this.m_LookController.m_LookDev.y;
        this.m_DiveBonesRotation = 0f;
        if (Inventory3DManager.Get().gameObject.activeSelf)
        {
            Inventory3DManager.Get().Deactivate();
        }
        this.m_State = SwimState.Swim;
        if (this.m_Player.m_FPPController.m_TimeInAir > 1f)
        {
            this.m_CheckHighSpeed = true;
            PlayerAudioModule.Get().PlayFallIntoWaterSound();
        }
        else
        {
            PlayerAudioModule.Get().PlayFeetLandingSound(1f, false);
        }
        Item currentItem = Player.Get().GetCurrentItem();

        if (currentItem && currentItem.GetInfoID() == ItemID.Fire)
        {
            Player.Get().DropItem(currentItem);
        }
        Player.Get().StopAim();
        this.m_SmoothPos.Force(base.transform.position);
        DialogsManager.Get().StopDialog();
    }
コード例 #2
0
    private void StartPassingOut()
    {
        this.m_StartPassOutTime = 0f;
        this.m_Progress         = 0f;
        this.m_PrevProgress     = 0f;
        this.m_HoursDelta       = 0f;
        this.m_HourProgress     = 0;
        this.m_Player.ResetBlockMoves();
        this.m_Player.ResetBlockRotation();
        this.m_Player.BlockMoves();
        this.m_Player.BlockRotation();
        HUDItem.Get().Deactivate();
        this.m_MovesBlocked = true;
        this.SetState(ConsciousnessController.ConsciousnessState.PassingOut);
        this.m_Animator.SetInteger(this.m_PassOutHash, 1);
        if (Inventory3DManager.Get().gameObject.activeSelf)
        {
            Inventory3DManager.Get().Deactivate();
        }
        DialogsManager.Get().StopDialog();
        Item currentItem = this.m_Player.GetCurrentItem(Hand.Right);

        if (currentItem && currentItem.m_Info.IsStone())
        {
            this.m_Player.DropItem(currentItem);
        }
    }
コード例 #3
0
 public void OnInputAction(InputActionData action_data)
 {
     if (action_data.m_Action == InputsManager.InputAction.ShowSelectDialogNode && GreenHellGame.IsPadControllerActive())
     {
         if (this.m_LastSelectDialogDeactivationTime == 0f || Time.time - this.m_LastSelectDialogDeactivationTime > 0.5f)
         {
             if (!DialogsManager.Get().IsAnyDialogPlaying())
             {
                 if (!HUDSelectDialog.Get().enabled&& Player.Get().m_Animator.GetCurrentAnimatorStateInfo(2).shortNameHash == this.m_IdleHash && HUDSelectDialog.Get().CanShow())
                 {
                     HUDSelectDialog.Get().Activate();
                     this.m_LastSelectDialogDeactivationTime = Time.time;
                     return;
                 }
             }
             else if (HUDSelectDialog.Get().enabled&& !DialogsManager.Get().IsAnyDialogPlaying())
             {
                 HUDSelectDialog.Get().Deactivate();
                 this.m_LastSelectDialogDeactivationTime = Time.time;
                 return;
             }
         }
     }
     else if (action_data.m_Action == InputsManager.InputAction.Button_B && HUDSelectDialog.Get().enabled)
     {
         HUDSelectDialog.Get().Deactivate();
         this.m_LastSelectDialogDeactivationTime = Time.time;
     }
 }
コード例 #4
0
 public void Deactivate()
 {
     if (!this.m_Active)
     {
         return;
     }
     this.m_Active = false;
     this.ClearDatas();
     Player.Get().UnblockMoves();
     Player.Get().UnblockRotation();
     if (this.m_CursorVisible)
     {
         CursorManager.Get().ShowCursor(false, false);
         CursorManager.Get().SetCursor(CursorManager.TYPE.Normal);
         this.m_CursorVisible = false;
     }
     if (this.m_MarkedData != null)
     {
         if (!this.m_MarkedData.m_IsGroup && GreenHellGame.IsPCControllerActive())
         {
             this.OnSelectDialog(this.m_MarkedData);
         }
         this.m_MarkedData = null;
     }
     if (!DialogsManager.Get().IsAnyDialogPlaying())
     {
         WalkieTalkieController.Get().OnStopDialog(null);
     }
 }
コード例 #5
0
 public static void SetupObjects()
 {
     SaveGame.m_Objects.Clear();
     SaveGame.m_Objects.Add(DifficultySettings.Get());
     SaveGame.m_Objects.Add(DialogsManager.Get());
     SaveGame.m_Objects.Add(AIManager.Get());
     SaveGame.m_Objects.Add(EnemyAISpawnManager.Get());
     SaveGame.m_Objects.Add(TriggersManager.Get());
     SaveGame.m_Objects.Add(ItemsManager.Get());
     SaveGame.m_Objects.Add(SensorManager.Get());
     SaveGame.m_Objects.Add(ConstructionGhostManager.Get());
     SaveGame.m_Objects.Add(StaticObjectsManager.Get());
     SaveGame.m_Objects.Add(Player.Get());
     SaveGame.m_Objects.Add(PlayerConditionModule.Get());
     SaveGame.m_Objects.Add(PlayerInjuryModule.Get());
     SaveGame.m_Objects.Add(PlayerDiseasesModule.Get());
     SaveGame.m_Objects.Add(StatsManager.Get());
     SaveGame.m_Objects.Add(HintsManager.Get());
     SaveGame.m_Objects.Add(ObjectivesManager.Get());
     SaveGame.m_Objects.Add(StoryObjectivesManager.Get());
     SaveGame.m_Objects.Add(HUDObjectives.Get());
     SaveGame.m_Objects.Add(MenuNotepad.Get());
     SaveGame.m_Objects.Add(MapTab.Get());
     SaveGame.m_Objects.Add(Music.Get());
     SaveGame.m_Objects.Add(RainManager.Get());
     SaveGame.m_Objects.Add(SleepController.Get());
     SaveGame.m_Objects.Add(MainLevel.Instance);
     SaveGame.m_Objects.Add(ScenarioManager.Get());
     SaveGame.m_Objects.Add(InventoryBackpack.Get());
     SaveGame.m_Objects.Add(ReplicatedSessionState.Get());
 }
コード例 #6
0
ファイル: Stand.cs プロジェクト: Blightbuster/Green-Hell
 public override bool CanTrigger()
 {
     if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
     {
         return(false);
     }
     if (this.m_StoredItemId == ItemID.None)
     {
         return(false);
     }
     if (ItemsManager.Get().IsHeavyObject(this.m_StoredItemId))
     {
         Item currentItem = Player.Get().GetCurrentItem(Hand.Right);
         if ((currentItem == null && this.m_NumItems > 0) || (currentItem != null && (!ItemsManager.Get().IsHeavyObject(currentItem.m_Info.m_ID) || currentItem.m_Info.m_ID == this.m_StoredItemId)))
         {
             return(true);
         }
     }
     else
     {
         if (this.m_NumItems < this.m_Vis.Count - 1 && InventoryBackpack.Get().Contains(this.m_StoredItemId))
         {
             return(true);
         }
         if (this.m_NumItems > 0)
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #7
0
    public override bool CanTrigger()
    {
        if (this.m_Burning)
        {
            return(false);
        }
        if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
        {
            return(false);
        }
        if (this.GetProcessProgress(this) <= 0f)
        {
            return(false);
        }
        Item currentItem = Player.Get().GetCurrentItem(Hand.Right);

        if (currentItem)
        {
            ItemID id = currentItem.m_Info.m_ID;
            if (id == ItemID.Fire)
            {
                return(true);
            }
            if ((id == ItemID.Torch || id == ItemID.Weak_Torch || id == ItemID.Tobacco_Torch) && ((Torch)currentItem).m_Burning)
            {
                return(true);
            }
        }
        return(this.ShowAdditionalInfo());
    }
コード例 #8
0
 public override bool CanTrigger()
 {
     if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
     {
         return(false);
     }
     if (this.m_State == CharcoalFurnace.State.WaitingForFire)
     {
         Item currentItem = Player.Get().GetCurrentItem(Hand.Right);
         if (currentItem)
         {
             ItemID id = currentItem.m_Info.m_ID;
             if (id == ItemID.Fire)
             {
                 return(true);
             }
             if ((id == ItemID.Torch || id == ItemID.Weak_Torch || id == ItemID.Tobacco_Torch) && ((Torch)currentItem).m_Burning)
             {
                 return(true);
             }
         }
         if (this.ShouldShowEmberRequired())
         {
             return(true);
         }
     }
     else if (this.m_State == CharcoalFurnace.State.DestroyDoor)
     {
         return(true);
     }
     return(false);
 }
コード例 #9
0
    public override bool CanTrigger()
    {
        if (this.m_Freezed)
        {
            return(false);
        }
        if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
        {
            return(false);
        }
        Item currentItem = Player.Get().GetCurrentItem(Hand.Right);

        if (currentItem)
        {
            ItemID id = currentItem.m_Info.m_ID;
            if (id == ItemID.Fire && !this.m_Burning)
            {
                return(true);
            }
            if ((id == ItemID.Torch || id == ItemID.Weak_Torch || id == ItemID.Tobacco_Torch) && ((Torch)currentItem).m_Burning != this.m_Burning)
            {
                return(true);
            }
        }
        return(this.ShouldShowEmberRequired());
    }
コード例 #10
0
 public override bool CanTrigger()
 {
     if (this.m_CantTriggerDuringDialog)
     {
         DialogsManager.Get().IsAnyDialogPlaying();
         return(false);
     }
     return(false);
 }
コード例 #11
0
ファイル: HUDDialog.cs プロジェクト: Blightbuster/Green-Hell
    private DialogNode GetNode()
    {
        DialogNode dialogNode = DialogsManager.Get().m_CurrentDialog.m_CurrentNode;

        if (dialogNode == null)
        {
            dialogNode = DialogsManager.Get().m_CurrentDialog.m_CurrentAdditionalNode;
        }
        return(dialogNode);
    }
コード例 #12
0
ファイル: Bowl.cs プロジェクト: Blightbuster/Green-Hell
 public override bool CanTrigger()
 {
     if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
     {
         return(false);
     }
     if (BowlController.Get().m_Bowl == this)
     {
         return(base.CanTrigger());
     }
     return(this.m_State != Bowl.State.UnsafeWaterCooking && this.m_State != Bowl.State.HerbCooking);
 }
コード例 #13
0
 private void SetupDialogs()
 {
     this.ClearDatas();
     foreach (string text in DialogsManager.Get().m_ScenarioDialogs.Keys)
     {
         List <Dialog> list = DialogsManager.Get().m_ScenarioDialogs[text];
         if (list.Count != 0)
         {
             HUDSelectDialogElemData hudselectDialogElemData;
             if (text == "ALL")
             {
                 using (List <Dialog> .Enumerator enumerator2 = list.GetEnumerator())
                 {
                     while (enumerator2.MoveNext())
                     {
                         Dialog dialog = enumerator2.Current;
                         hudselectDialogElemData = this.CreateElement(dialog.m_Name, !dialog.m_ShownInSelectDialog);
                         if (!PlayerSanityModule.Get().IsWhispersLevel())
                         {
                             dialog.m_ShownInSelectDialog = true;
                         }
                         this.m_Datas.Add(hudselectDialogElemData);
                     }
                     continue;
                 }
             }
             bool show_new = false;
             using (List <Dialog> .Enumerator enumerator2 = list.GetEnumerator())
             {
                 while (enumerator2.MoveNext())
                 {
                     if (!enumerator2.Current.m_ShownInSelectDialog)
                     {
                         show_new = true;
                         break;
                     }
                 }
             }
             hudselectDialogElemData           = this.CreateElement(text, show_new);
             hudselectDialogElemData.m_IsGroup = true;
             hudselectDialogElemData.m_Dialogs = list;
             this.m_Datas.Add(hudselectDialogElemData);
         }
     }
     this.m_Datas.Sort(HUDSelectDialog.s_NewComparer);
     for (int i = 0; i < this.m_Datas.Count; i++)
     {
         this.m_Datas[i].m_Object.transform.localPosition = Vector3.zero + Vector3.up * 40f - Vector3.up * (this.m_Datas[i].m_BG.rectTransform.sizeDelta.y + 2f) * (float)i;
     }
     HUDWalkieTalkie.Get().UpdateNewDialogsCounter();
     this.UpdateVis();
 }
コード例 #14
0
 private void OnDialog()
 {
     if (!DialogsManager.Get().CanSelectDialog())
     {
         return;
     }
     HUDSelectDialog.Get().Activate();
     Player.Get().m_ShouldStartWalkieTalkieController = true;
     if (Player.Get().GetCurrentItem(Hand.Left) == null)
     {
         Player.Get().StartController(PlayerControllerType.WalkieTalkie);
     }
 }
コード例 #15
0
 public void Stop(bool finish)
 {
     if (this.m_AudioSource != null)
     {
         this.m_AudioSource.Stop();
         this.m_AudioSource.clip = null;
     }
     this.m_CurrentNode = null;
     this.SetState(Dialog.State.Finished);
     InputsManager.Get().UnregisterReceiver(this);
     HUDSelectDialogNode.Get().HideNodeSelection();
     DialogsManager.Get().OnStopDialog(this, finish);
 }
コード例 #16
0
    public override bool CanTrigger()
    {
        if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
        {
            return(false);
        }
        if (SwimController.Get().IsActive())
        {
            return(false);
        }
        Item currentItem = Player.Get().GetCurrentItem(Hand.Right);

        return(!currentItem || !currentItem.m_Info.IsHeavyObject());
    }
コード例 #17
0
ファイル: HUDDialog.cs プロジェクト: looki666/Green-Hell
    protected override void Update()
    {
        base.Update();
        if (DialogsManager.Get().m_CurrentDialog == null)
        {
            return;
        }
        DialogNode node = this.GetNode();

        if (node != null && node != this.m_CurrentNode)
        {
            this.Setup(node);
        }
    }
コード例 #18
0
 private void Setup()
 {
     if (!this.m_List)
     {
         return;
     }
     this.m_List.Clear();
     this.m_List.AddElement("NONE", -1);
     foreach (string element in DialogsManager.Get().m_ScenarioDialogs.Keys)
     {
         this.m_List.AddElement(element, -1);
     }
     this.m_List.SetSelectionIndex(0);
 }
コード例 #19
0
 private void OnSelectDialog(HUDSelectDialogElemData data)
 {
     if (data.m_Dialogs != null)
     {
         this.m_LastGroupName = data.m_DialogName;
         this.SetupGroup(data.m_Dialogs);
         return;
     }
     DialogsManager.Get().StartDialog(data.m_DialogName);
     PlayerWalkieTalkieModule.Get().OnCall();
     this.m_MarkedData           = null;
     this.m_LastSelectDialogTime = Time.time;
     this.Deactivate();
 }
コード例 #20
0
 public void OnSelect(int index)
 {
     if (index < 0)
     {
         this.ShowNodes(false);
         return;
     }
     DialogsManager.Get().OnSelectNode(this.m_Nodes[index]);
     this.m_Nodes = null;
     while (this.m_UINodeDatas.Count > 0)
     {
         UnityEngine.Object.Destroy(this.m_UINodeDatas[0].m_Object.gameObject);
         this.m_UINodeDatas.RemoveAt(0);
     }
 }
コード例 #21
0
ファイル: Trigger.cs プロジェクト: Blightbuster/Green-Hell
 public virtual bool CanTrigger()
 {
     if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
     {
         return(false);
     }
     if (this.m_Owner != null)
     {
         return(this.m_Owner.CanTrigger(this));
     }
     if (!this.m_OneTime)
     {
         return(!this.m_HallucinationDisappearing);
     }
     return(!this.m_WasTriggered);
 }
コード例 #22
0
 public override void OnHide()
 {
     base.OnHide();
     if (!DialogsManager.Get())
     {
         return;
     }
     if (this.m_List.GetSelectionIndex() > 0)
     {
         string selectedElementText = this.m_List.GetSelectedElementText();
         if (selectedElementText != string.Empty)
         {
             DialogsManager.Get().StartDialog(selectedElementText);
         }
     }
 }
コード例 #23
0
    public override bool CanTrigger()
    {
        if (this.m_CantTriggerDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
        {
            return(false);
        }
        Item currentItem = Player.Get().GetCurrentItem(Hand.Right);

        if (!currentItem)
        {
            return(false);
        }
        ItemID id = currentItem.m_Info.m_ID;

        return((id == ItemID.Torch || id == ItemID.Weak_Torch || id == ItemID.Tobacco_Torch) && ((Torch)currentItem).m_Burning);
    }
コード例 #24
0
 private void Setup()
 {
     if (!this.m_List)
     {
         return;
     }
     this.m_List.Clear();
     foreach (string text in DialogsManager.Get().m_Dialogs.Keys)
     {
         if (text.ToLower().Contains(this.m_LastField))
         {
             this.m_List.AddElement(text, -1);
         }
     }
     this.m_List.SortAlphabetically();
     this.m_List.SetSelectionIndex(0);
 }
コード例 #25
0
 private void PlayNode(DialogNode node)
 {
     if (node.m_Object)
     {
         this.m_AudioSource.transform.parent = node.m_Object.transform;
     }
     else
     {
         this.m_AudioSource.transform.parent = Player.Get().transform;
     }
     this.m_AudioSource.transform.localPosition = Vector3.zero;
     if (node.m_WTSoundBefore)
     {
         this.m_AudioSource.clip = null;
         if (node.m_WTSoundBeforeName != string.Empty)
         {
             foreach (AudioClip audioClip in DialogsManager.Get().m_WTBeforeSounds)
             {
                 if (audioClip.name == node.m_WTSoundBeforeName)
                 {
                     this.m_AudioSource.clip = audioClip;
                     break;
                 }
             }
         }
         if (!this.m_AudioSource.clip)
         {
             this.m_AudioSource.clip = DialogsManager.Get().m_WTBeforeSounds[UnityEngine.Random.Range(0, DialogsManager.Get().m_WTBeforeSounds.Count)];
         }
         if (!this.m_AudioSource.clip)
         {
             this.m_AudioSource.clip = DialogsManager.Get().m_WTAfterSounds[UnityEngine.Random.Range(0, DialogsManager.Get().m_WTAfterSounds.Count)];
         }
         this.m_CurrentNodeLength = 1f;
         this.SetState(Dialog.State.PlayingWTSoundBefore);
     }
     else
     {
         this.m_AudioSource.clip  = node.m_Clip;
         this.m_CurrentNodeLength = this.GetNodeLength(node);
         this.SetState(Dialog.State.Playing);
     }
     this.m_AudioSource.Play();
     this.m_CurrentNode   = node;
     this.m_StartNodeTime = Time.time;
 }
コード例 #26
0
ファイル: Trigger.cs プロジェクト: Blightbuster/Green-Hell
 public virtual bool CanExecuteActions()
 {
     if (this.m_CantExecuteActionsDuringDialog && DialogsManager.Get().IsAnyDialogPlaying())
     {
         return(false);
     }
     if (this.m_RequiredItems.Count > 0 && (this.m_RequiredBoolValue == string.Empty || !ScenarioManager.Get().IsBoolVariableTrue(this.m_RequiredBoolValue)))
     {
         foreach (ItemID id in this.m_RequiredItems)
         {
             if (!Player.Get().HaveItem(id))
             {
                 return(false);
             }
         }
     }
     return(Inventory3DManager.Get().gameObject.activeSelf || (Player.Get().transform.position - this.m_Collider.ClosestPointOnBounds(Player.Get().transform.position)).magnitude < Mathf.Max(this.m_TriggerUseRange, Player.Get().GetParams().GetTriggerUseRange()));
 }
コード例 #27
0
 protected override void OnEnable()
 {
     base.OnEnable();
     this.m_Animator.SetInteger(this.m_DeathTypeHash, (int)this.m_DeathType);
     DialogsManager.Get().StopDialog();
     CutscenesManager.Get().StopCutscene();
     AIManager.Get().OnPlayerDie();
     if (this.m_DeathType == DeathController.DeathType.UnderWater)
     {
         PlayerAudioModule.Get().PlayUnderwaterDeathSound();
     }
     else
     {
         PlayerAudioModule.Get().PlayDeathSound();
     }
     this.SetState(DeathController.DeathState.Dying);
     this.m_DeathTime = new float?(Time.time);
 }
コード例 #28
0
 public void UpdateNewDialogsCounter()
 {
     this.m_NewDialogsCount = 0;
     foreach (List <Dialog> list in DialogsManager.Get().m_ScenarioDialogs.Values)
     {
         using (List <Dialog> .Enumerator enumerator2 = list.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 if (!enumerator2.Current.m_ShownInSelectDialog)
                 {
                     this.m_NewDialogsCount++;
                 }
             }
         }
     }
     this.m_CounterText.text = this.m_NewDialogsCount.ToString();
 }
コード例 #29
0
    public override void OnHide()
    {
        base.OnHide();
        if (!DialogsManager.Get())
        {
            return;
        }
        if (this.m_List.GetSelectionIndex() < 0 || this.m_List.GetSelectionIndex() >= DialogsManager.Get().m_Dialogs.Count)
        {
            DialogsManager.Get().m_DebugDialogName = string.Empty;
            return;
        }
        string selectedElementText = this.m_List.GetSelectedElementText();

        if (selectedElementText != string.Empty)
        {
            DialogsManager.Get().m_DebugDialogName = selectedElementText;
        }
    }
コード例 #30
0
 public void Start()
 {
     if (this.m_RootNodes.Count == 0)
     {
         Debug.Log("ERROR - dialog " + this.m_Name + " does not have root node!!!");
         this.SetState(Dialog.State.Finished);
         return;
     }
     if (this.m_RootNodes.Count == 1)
     {
         this.PlayNode(this.m_RootNodes[0]);
     }
     else
     {
         HUDSelectDialogNode.Get().ShowNodeSelection(this.m_RootNodes, DialogsManager.Get().m_DefaultReplyTime);
         this.SetState(Dialog.State.WaitingForDecision);
     }
     InputsManager.Get().RegisterReceiver(this);
 }