コード例 #1
0
    public void OnArmorInsert(ArmorSlot slot, Item item)
    {
        ((Armor)item).m_Limb = slot.m_Limb;
        item.ItemsManagerUnregister();
        item.transform.SetParent(slot.transform);
        Physics.IgnoreCollision(this.m_Player.m_Collider, item.GetComponent <Collider>());
        Renderer[] componentsDeepChild = General.GetComponentsDeepChild <Renderer>(item.gameObject);
        for (int i = 0; i < componentsDeepChild.Length; i++)
        {
            componentsDeepChild[i].enabled = false;
        }
        ArmorInfo armorInfo = (ArmorInfo)item.m_Info;
        ArmorData armorData = this.m_LimbMap[(int)slot.m_Limb];

        armorData.m_MeshMap[(int)armorInfo.m_ArmorType].SetActive(true);
        armorData.m_Mesh          = armorData.m_MeshMap[(int)armorInfo.m_ArmorType];
        armorData.m_AttachedArmor = item;
        armorData.m_AttachedArmorOrigCollCenter        = armorData.m_AttachedArmor.m_BoxCollider.center;
        armorData.m_AttachedArmorOrigCollSize          = armorData.m_AttachedArmor.m_BoxCollider.size;
        armorData.m_AttachedArmor.m_BoxCollider.center = armorData.m_AttachedArmorCollCenter;
        armorData.m_AttachedArmor.m_BoxCollider.size   = armorData.m_AttachedArmorCollSize;
        armorData.m_ArmorType  = armorInfo.m_ArmorType;
        armorData.m_Absorption = armorInfo.m_Absorption;
        armorData.m_Health     = armorInfo.m_Health;
        HUDBodyInspection.Get().m_ArmorEnabled = true;
        this.SetMeshesVisible(HUDBodyInspection.Get().m_ArmorEnabled);
        BodyInspectionController.Get().OnArmorAttached(slot.m_Limb);
    }
コード例 #2
0
 public void OnInspection(GameObject obj)
 {
     if (!Player.Get().CanStartBodyInspection())
     {
         return;
     }
     if (NotepadController.Get().IsActive())
     {
         NotepadController.Get().Hide();
         this.m_DelayedType = HUDQuickAccessBar.TYPE.Inspect;
         this.m_DelayedObj  = obj;
         return;
     }
     if (CraftingManager.Get().gameObject.activeSelf)
     {
         CraftingManager.Get().Deactivate();
     }
     if (!BodyInspectionController.Get().IsActive())
     {
         Player.Get().StartController(PlayerControllerType.BodyInspection);
     }
     else
     {
         Player.Get().StopController(PlayerControllerType.BodyInspection);
     }
 }
コード例 #3
0
    private void UpdateNormalMode()
    {
        if (this.m_Target == null)
        {
            Debug.Log("[CameraManager:UpdateNormalMode] Target is not set!");
            return;
        }
        if (SwimController.Get().IsActive() && SwimController.Get().m_State == SwimState.Swim)
        {
            this.m_YOffset += (this.m_YSwimOffset - this.m_YOffset) * Time.deltaTime;
        }
        else
        {
            this.m_YOffset += -this.m_YOffset * Time.deltaTime;
        }
        Vector3 vector = (this.m_Target.GetREyeTransform().position + this.m_Target.GetLEyeTransform().position) * 0.5f;

        vector += this.m_Target.GetREyeTransform().up *this.m_YOffset;
        this.m_MainCamera.transform.position = vector;
        this.m_MainCamera.transform.rotation = this.m_Target.GetREyeTransform().rotation;
        if (this.m_TODRaysUpdateEnabled)
        {
            this.UpdateTodRays();
        }
        if (this.m_InterpolateFov && !BodyInspectionController.Get().IsActive())
        {
            this.InterpolateFov();
        }
    }
コード例 #4
0
ファイル: Injury.cs プロジェクト: Blightbuster/Green-Hell
    public void Load(int index)
    {
        this.m_Diagnosed          = SaveGame.LoadBVal("InjuryDiag" + index);
        this.m_StartTimeInMinutes = SaveGame.LoadFVal("InjuryStart" + index);
        string text = SaveGame.LoadSVal("InjuryBand" + index);

        if (text != string.Empty)
        {
            Transform transform = Player.Get().gameObject.transform.FindDeepChild(text);
            if (transform)
            {
                transform.gameObject.SetActive(true);
                this.m_Bandage = transform.gameObject;
            }
            else
            {
                BodyInspectionController.Get().AttachMaggots(true);
            }
        }
        this.m_Healing                  = SaveGame.LoadBVal("InjuryHeal" + index);
        this.m_HealingStartTime         = SaveGame.LoadFVal("InjuryHealStart" + index);
        this.m_HealingResultInjuryState = (InjuryState)SaveGame.LoadIVal("HealingResultInjuryState" + index);
        if (SaveGame.m_SaveGameVersion >= GreenHellGame.s_GameVersionEarlyAccessUpdate6)
        {
            this.m_AIDamager = (AI.AIID)SaveGame.LoadIVal("PIMDamagerAIID" + index);
        }
        this.UpdateHealthDecreasePerSec();
    }
コード例 #5
0
    private void UpdateWoundSlots(HUDItemSlot.SlotData data)
    {
        bool flag = Inventory3DManager.Get().isActiveAndEnabled&& BodyInspectionController.Get().IsActive() && (!Inventory3DManager.Get().m_CarriedItem || data.slot.CanInsertItem(Inventory3DManager.Get().m_CarriedItem));

        data.obj.gameObject.SetActive(flag);
        if (!flag)
        {
            return;
        }
        Vector3 screenPoint = data.slot.GetScreenPoint();

        if (screenPoint.z <= 0f)
        {
            data.icon.enabled = false;
            return;
        }
        data.icon.rectTransform.position = screenPoint;
        BIWoundSlot biwoundSlot = (BIWoundSlot)data.slot;

        if (biwoundSlot.GetInjury() != null && BodyInspectionController.Get() != null && BodyInspectionController.Get().enabled&& biwoundSlot.GetInjury().m_Bandage == null && biwoundSlot.m_Maggots == null && biwoundSlot.GetInjury().m_ParentInjury == null)
        {
            data.icon.enabled = true;
            data.icon.color   = ((!(Inventory3DManager.Get().m_SelectedSlot == data.slot)) ? this.m_NormalColor : this.m_SelectedColor);
        }
        else
        {
            data.icon.enabled = false;
        }
    }
コード例 #6
0
    public void Load()
    {
        this.ResetInjuries();
        int num = SaveGame.LoadIVal("InjuriesCount");

        for (int i = 0; i < num; i++)
        {
            InjuryType  injuryType  = (InjuryType)SaveGame.LoadIVal("InjuryType" + i);
            InjuryPlace place       = (InjuryPlace)SaveGame.LoadIVal("InjuryPlace" + i);
            InjuryState injuryState = (InjuryState)SaveGame.LoadIVal("InjuryState" + i);
            if (injuryType != InjuryType.WormHole || injuryState != InjuryState.WormInside)
            {
                BIWoundSlot woundSlot    = BodyInspectionController.Get().GetWoundSlot(place, SaveGame.LoadSVal("InjurySlot" + i));
                int         poison_level = SaveGame.LoadIVal("InjuryPoisonLevel" + i);
                Injury      injury       = this.AddInjury(injuryType, place, woundSlot, injuryState, poison_level, null, null);
                if (injury != null)
                {
                    if (injuryState == InjuryState.Infected)
                    {
                        injury.Infect();
                    }
                    else if (injuryState == InjuryState.Closed)
                    {
                        injury.CloseWound();
                    }
                    injury.Load(i);
                }
            }
        }
    }
コード例 #7
0
 private void Initialize()
 {
     if (this.m_Initialized)
     {
         return;
     }
     this.m_Initialized = true;
     this.m_WoundSlots  = new List <ReplicatedPlayerInjuries.ReplicatedWoundSlot>(BodyInspectionController.Get().m_WoundSlots.Count);
     for (int i = 0; i < BodyInspectionController.Get().m_WoundSlots.Count; i++)
     {
         Transform transform = base.transform.FindDeepChild(BodyInspectionController.Get().m_WoundSlots[i].name);
         if (!(transform == null))
         {
             ReplicatedPlayerInjuries.ReplicatedWoundSlot replicatedWoundSlot = new ReplicatedPlayerInjuries.ReplicatedWoundSlot();
             replicatedWoundSlot.m_ReplicatedPlayerSlot = transform.gameObject;
             replicatedWoundSlot.m_LocalPlayerSlot      = (base.ReplIsOwner() ? BodyInspectionController.Get().m_WoundSlots[i].gameObject : null);
             replicatedWoundSlot.m_SlotIndex            = i;
             if (BodyInspectionController.Get().m_WoundSlots[i].m_AdditionalMeshes != null)
             {
                 replicatedWoundSlot.m_ReplicatedPlayerAdditionalMeshes = new List <GameObject>(BodyInspectionController.Get().m_WoundSlots[i].m_AdditionalMeshes.Count);
                 foreach (GameObject gameObject in BodyInspectionController.Get().m_WoundSlots[i].m_AdditionalMeshes)
                 {
                     Transform transform2 = base.transform.FindDeepChild(gameObject.name);
                     DebugUtils.Assert(transform2 != null, true);
                     if (transform2)
                     {
                         replicatedWoundSlot.m_ReplicatedPlayerAdditionalMeshes.Add(transform2.gameObject);
                     }
                 }
             }
             this.m_WoundSlots.Add(replicatedWoundSlot);
         }
     }
 }
コード例 #8
0
 public void OnCraft(GameObject obj)
 {
     if (!Player.Get().CanStartCrafting())
     {
         return;
     }
     if (NotepadController.Get().IsActive())
     {
         NotepadController.Get().Hide();
         this.m_DelayedType = HUDQuickAccessBar.TYPE.Craft;
         this.m_DelayedObj  = obj;
         return;
     }
     if (BodyInspectionController.Get().IsActive())
     {
         Player.Get().StopController(PlayerControllerType.BodyInspection);
     }
     if (!Inventory3DManager.Get().gameObject.activeSelf)
     {
         Inventory3DManager.Get().Activate();
     }
     if (!CraftingManager.Get().gameObject.activeSelf)
     {
         CraftingManager.Get().Activate();
         return;
     }
     CraftingManager.Get().Deactivate();
 }
コード例 #9
0
 private void UpdateArmor()
 {
     if (this.m_ArmorCollider.OverlapPoint(Input.mousePosition))
     {
         this.m_ArmorHL.gameObject.SetActive(true);
         if (Input.GetMouseButtonDown(0))
         {
             this.m_ArmorEnabled = !this.m_ArmorEnabled;
             PlayerArmorModule.Get().SetMeshesVisible(this.m_ArmorEnabled);
             if (this.m_ArmorEnabled)
             {
                 BodyInspectionController.Get().OnArmorMeshesEnabled();
             }
             else
             {
                 BodyInspectionController.Get().OnArmorMeshesDisabled();
             }
         }
     }
     else
     {
         this.m_ArmorHL.gameObject.SetActive(false);
     }
     if (this.m_ArmorEnabled)
     {
         this.m_ArmorOff.gameObject.SetActive(false);
         this.m_ArmorOn.gameObject.SetActive(true);
         return;
     }
     this.m_ArmorOff.gameObject.SetActive(true);
     this.m_ArmorOn.gameObject.SetActive(false);
 }
コード例 #10
0
    protected override void OnShow()
    {
        base.OnShow();
        this.OnClickLimb(Limb.LArm);
        this.m_LimbCurrentSelections[0].enabled = true;
        this.m_HintBG.gameObject.SetActive(true);
        this.m_HintText.gameObject.SetActive(true);
        PlayerArmorModule.Get().SetMeshesVisible(this.m_ArmorEnabled);
        if (this.m_ArmorEnabled)
        {
            BodyInspectionController.Get().OnArmorMeshesEnabled();
        }
        else
        {
            BodyInspectionController.Get().OnArmorMeshesDisabled();
        }
        this.m_ArmorBG.gameObject.SetActive(true);
        this.m_BackpackHint.SetActive(GreenHellGame.IsPadControllerActive() && !Inventory3DManager.Get().IsActive());
        this.m_SortBackpackHint.SetActive(GreenHellGame.IsPadControllerActive() && Inventory3DManager.Get().IsActive());
        TextGenerationSettings generationSettings = this.m_SelectLimbText.GetGenerationSettings(this.m_SelectLimbText.rectTransform.rect.size);

        generationSettings.scaleFactor = 1f;
        float preferredWidth = this.m_TextGen.GetPreferredWidth(this.m_SelectLimbText.text, generationSettings);

        this.m_SelectLimgBGSize.Set(Mathf.Max(99.75f, preferredWidth + this.m_SelectLimbW), this.m_SelectLimbBG.rectTransform.rect.size.y);
        this.m_SelectLimbBG.rectTransform.sizeDelta = this.m_SelectLimgBGSize;
        preferredWidth = this.m_TextGen.GetPreferredWidth(this.m_RotateLimbText.text, generationSettings);
        this.m_RotateLimgBGSize.Set(Mathf.Max(80f, preferredWidth + this.m_SelectLimbW), this.m_RotateLimbBG.rectTransform.rect.size.y);
        this.m_RotateLimbBG.rectTransform.sizeDelta = this.m_RotateLimgBGSize;
    }
コード例 #11
0
ファイル: HUDNewWheel.cs プロジェクト: looki666/Green-Hell
    private void SetupSelections()
    {
        Color color = this.m_Buttons[0].m_Icon.color;

        color.a = (Player.Get().CanStartCrafting() ? ((!CraftingManager.Get().gameObject.activeSelf) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Buttons[0].m_Icon.color = color;
        color   = this.m_Buttons[3].m_Icon.color;
        color.a = (Player.Get().CanShowNotepad() ? ((!NotepadController.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Buttons[3].m_Icon.color = color;
        color   = this.m_Buttons[4].m_Icon.color;
        color.a = ((!Inventory3DManager.Get().gameObject.activeSelf) ? this.m_NormalAlpha : this.m_SelectedAlpha);
        this.m_Buttons[4].m_Icon.color = color;
        color   = this.m_Buttons[5].m_Icon.color;
        color.a = (Player.Get().CanStartBodyInspection() ? ((!BodyInspectionController.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Buttons[5].m_Icon.color = color;
        color   = this.m_Buttons[1].m_Icon.color;
        color.a = (Player.Get().CanStartCrafting() ? ((!CraftingManager.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Buttons[1].m_Icon.color = color;
        color   = this.m_Buttons[0].m_Icon.color;
        color.a = (Player.Get().CanShowMap() ? ((!MapController.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Buttons[0].m_Icon.color = color;
        color   = this.m_Buttons[2].m_Icon.color;
        color.a = (Player.Get().CanSleep() ? ((!SleepController.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Buttons[2].m_Icon.color = color;
    }
コード例 #12
0
 protected override void OnShow()
 {
     base.OnShow();
     this.SetupSelections();
     this.PlayOpenSound();
     this.SetupController();
     this.m_PadQuitHint.SetActive(GreenHellGame.IsPadControllerActive() && !BodyInspectionController.Get().IsActive());
     this.m_PadSortHint.SetActive(GreenHellGame.IsPadControllerActive() && !BodyInspectionController.Get().IsActive());
 }
コード例 #13
0
 protected override void OnHide()
 {
     base.OnHide();
     this.m_HintBG.gameObject.SetActive(false);
     this.m_HintText.gameObject.SetActive(false);
     PlayerArmorModule.Get().SetMeshesVisible(true);
     BodyInspectionController.Get().OnArmorMeshesEnabled();
     this.m_ArmorBG.gameObject.SetActive(false);
 }
コード例 #14
0
 private void OnLMouseUp()
 {
     if (!this.m_CarriedItem)
     {
         return;
     }
     if (this.CanInsertCarriedItemToBackpack())
     {
         InventoryBackpack.InsertResult insertResult = InventoryBackpack.Get().InsertItem(this.m_CarriedItem, this.m_SelectedSlot, this.m_SelectedGroup, false, false, false, false, true);
         if (insertResult != InventoryBackpack.InsertResult.Ok)
         {
             insertResult = InventoryBackpack.Get().InsertItem(this.m_CarriedItem, this.m_CarriedItem.m_PrevSlot, this.m_CarriedItem.m_Info.m_PrevInventoryCellsGroup, false, true, true, false, true);
         }
         if (insertResult == InventoryBackpack.InsertResult.Ok)
         {
             this.m_CarriedItem.m_ShownInInventory = true;
             this.PlayDropSound();
         }
     }
     else if (CraftingManager.Get().gameObject.activeSelf&& this.m_MouseOverCraftTable)
     {
         CraftingManager.Get().AddItem(this.m_CarriedItem, false);
         this.PlayDropSound();
     }
     else if (this.m_CarriedItem.m_Info.m_CanBeRemovedFromInventory)
     {
         if (BodyInspectionController.Get().IsActive())
         {
             if (this.m_SelectedSlot && this.m_SelectedSlot.IsBIWoundSlot())
             {
                 this.m_SelectedSlot.InsertItem(this.m_CarriedItem);
             }
             else
             {
                 this.DropItem(this.m_CarriedItem);
             }
             this.PlayDropSound();
         }
         else if (this.m_SelectedSlot)
         {
             this.m_SelectedSlot.InsertItem(this.m_CarriedItem);
             this.PlayDropSound();
         }
         else if (this.m_MouseOverBackpack)
         {
             InventoryBackpack.Get().InsertItem(this.m_CarriedItem, null, null, true, true, true, true, true);
             this.PlayDropSound();
         }
         else
         {
             this.DropItem(this.m_CarriedItem);
             this.PlayDropSound();
         }
     }
     this.SetCarriedItem(null);
 }
コード例 #15
0
 public void Disinfect()
 {
     BodyInspectionController.Get().DestroyMaggots(this.m_Slot);
     this.SetState(InjuryState.Open);
     this.m_HealingStartTime = float.MaxValue;
     this.m_TimeToInfect     = this.m_DefaultTimeToInfect;
     this.SetWoundMaterial(this.m_Slot.m_Wound.gameObject);
     this.UpdateHealthDecreasePerSec();
     this.RemoveBandage();
 }
コード例 #16
0
 private void TryAddWorm()
 {
     for (int i = 0; i < 4; i++)
     {
         BIWoundSlot freeWoundSlot = BodyInspectionController.Get().GetFreeWoundSlot((InjuryPlace)i, InjuryType.Worm, true);
         if (freeWoundSlot != null)
         {
             PlayerInjuryModule.Get().AddInjury(InjuryType.Worm, (InjuryPlace)i, freeWoundSlot, InjuryState.Open, 0, null, null);
             return;
         }
     }
 }
コード例 #17
0
 private void OnInspect()
 {
     if (BodyInspectionController.Get().IsActive())
     {
         BodyInspectionController.Get().Stop();
         return;
     }
     Player.Get().StartController(PlayerControllerType.BodyInspection);
     if (CraftingManager.Get().IsActive())
     {
         CraftingManager.Get().Deactivate();
     }
 }
コード例 #18
0
    public void OnDragItemToSlot(ArmorSlot slot, Item item)
    {
        ArmorData armorData = this.m_LimbMap[(int)slot.m_Limb];
        ArmorInfo armorInfo = (ArmorInfo)item.m_Info;

        armorData.m_MeshMap[(int)armorInfo.m_ArmorType].SetActive(true);
        Renderer[] componentsDeepChild = General.GetComponentsDeepChild <Renderer>(item.gameObject);
        for (int i = 0; i < componentsDeepChild.Length; i++)
        {
            componentsDeepChild[i].enabled = false;
        }
        BodyInspectionController.Get().OnArmorAttached(slot.m_Limb);
    }
コード例 #19
0
ファイル: HUDItem.cs プロジェクト: Blightbuster/Green-Hell
 public void DelayedExecute()
 {
     this.ExecuteAction(this.m_ActionToExecute, this.m_Item);
     Player.Get().UnblockMoves();
     Player.Get().UnblockRotation();
     Player.Get().m_Animator.SetBool(TriggerController.Get().m_BDrinkWater, false);
     Player.Get().m_Animator.SetBool(TriggerController.s_BGrabItemBambooBow, false);
     Player.Get().m_Animator.SetBool(TriggerController.s_BGrabItemBow, false);
     Player.Get().m_Animator.SetBool(TriggerController.s_BGrabItem, false);
     PlayerArmorModule.Get().SetMeshesVisible(true);
     BodyInspectionController.Get().OnArmorMeshesEnabled();
     Player.Get().m_Animator.SetBool(Player.Get().m_CleanUpHash, false);
     this.SetActive(false);
     this.m_ExecutionInProgress = false;
 }
コード例 #20
0
 protected override void OnShow()
 {
     base.OnShow();
     Player.Get().BlockRotation();
     if (GreenHellGame.IsPCControllerActive())
     {
         CursorManager.Get().ShowCursor(true, false);
         this.m_CursorVisible = true;
         Vector3 position = base.gameObject.transform.position;
         CursorManager.Get().SetCursorPos(position);
     }
     for (int i = 0; i < 6; i++)
     {
         if (!this.IsSlotActive((HUDWheel.HUDWheelSlot)i))
         {
             this.m_Icons[i].color = this.m_InactiveColor;
         }
         else
         {
             this.m_Icons[i].color = this.m_ActiveColor;
         }
     }
     if (Inventory3DManager.Get().IsActive())
     {
         Inventory3DManager.Get().Deactivate();
     }
     if (BodyInspectionController.Get().IsActive())
     {
         BodyInspectionController.Get().Hide();
     }
     if (NotepadController.Get().IsActive())
     {
         NotepadController.Get().Hide();
     }
     if (MapController.Get().IsActive())
     {
         MapController.Get().Hide();
     }
     HUDItem.Get().Deactivate();
     this.m_SelectedSlot = HUDWheel.HUDWheelSlot.None;
     for (int j = 0; j < 6; j++)
     {
         this.m_Selections[j].enabled = false;
         this.m_Icons[j].enabled      = true;
         this.m_IconsHL[j].enabled    = false;
     }
     this.UpdateText();
 }
コード例 #21
0
    private void SetupSelections()
    {
        Color color = this.m_Craft.color;

        color.a            = (Player.Get().CanStartCrafting() ? ((!CraftingManager.Get().gameObject.activeSelf) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Craft.color = color;
        color   = this.m_Notepad.color;
        color.a = (Player.Get().CanShowNotepad() ? ((!NotepadController.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Notepad.color = color;
        color   = this.m_Backpack.color;
        color.a = ((!Inventory3DManager.Get().gameObject.activeSelf) ? this.m_NormalAlpha : this.m_SelectedAlpha);
        this.m_Backpack.color = color;
        color   = this.m_Inspect.color;
        color.a = (Player.Get().CanStartBodyInspection() ? ((!BodyInspectionController.Get().IsActive()) ? this.m_NormalAlpha : this.m_SelectedAlpha) : this.m_InactiveAlpha);
        this.m_Inspect.color = color;
    }
コード例 #22
0
 public void HealInjury(Injury injury)
 {
     for (int i = 0; i < this.m_Injuries.Count; i++)
     {
         if (this.m_Injuries[i].m_ParentInjury == injury)
         {
             this.m_Injuries[i].m_ParentInjury = null;
         }
     }
     BodyInspectionController.Get().DestroyAnts(injury.GetSlot());
     BodyInspectionController.Get().DestroyMaggots(injury.GetSlot());
     injury.GetSlot().SetInjury(null);
     injury.RemoveBandage();
     this.m_Injuries.Remove(injury);
     EventsManager.OnEvent(Enums.Event.HealWound, 1);
 }
コード例 #23
0
    public void OnCreateWound()
    {
        PlayerInjuryModule playerInjuryModule = PlayerInjuryModule.Get();
        InjuryType         injuryType         = (InjuryType)Enum.GetValues(typeof(InjuryType)).GetValue(this.m_WoundTypeList.GetSelectionIndex());
        BIWoundSlot        biwoundSlot        = null;

        if (this.m_ToggleLH.isOn)
        {
            biwoundSlot = BodyInspectionController.Get().GetFreeWoundSlot(InjuryPlace.LHand, injuryType);
        }
        else if (this.m_ToggleRH.isOn)
        {
            biwoundSlot = BodyInspectionController.Get().GetFreeWoundSlot(InjuryPlace.RHand, injuryType);
        }
        else if (this.m_ToggleLL.isOn)
        {
            biwoundSlot = BodyInspectionController.Get().GetFreeWoundSlot(InjuryPlace.LLeg, injuryType);
        }
        else if (this.m_ToggleRL.isOn)
        {
            biwoundSlot = BodyInspectionController.Get().GetFreeWoundSlot(InjuryPlace.RLeg, injuryType);
        }
        if (biwoundSlot != null)
        {
            int poison_level = 0;
            if (injuryType == InjuryType.VenomBite || injuryType == InjuryType.SnakeBite)
            {
                string text = this.m_PosionLevel.text;
                if (!int.TryParse(text, out poison_level))
                {
                    poison_level = 1;
                }
            }
            InjuryState state = InjuryState.Open;
            if (injuryType == InjuryType.Laceration || injuryType == InjuryType.Laceration)
            {
                state = InjuryState.Bleeding;
            }
            else if (injuryType == InjuryType.WormHole)
            {
                state = InjuryState.WormInside;
            }
            playerInjuryModule.AddInjury(injuryType, biwoundSlot.m_InjuryPlace, biwoundSlot, state, poison_level, null);
        }
    }
コード例 #24
0
    private void SpawnInsects(int count, Hand hand)
    {
        GameObject original = this.m_Prefabs[this.m_Type];

        for (int i = 0; i < count; i++)
        {
            BIWoundSlot woundSlot = BodyInspectionController.Get().GetWoundSlot((hand != Hand.Right) ? InjuryPlace.LHand : InjuryPlace.RHand, InjuryType.Leech, null);
            if (!woundSlot)
            {
                break;
            }
            InsectData insectData = new InsectData();
            insectData.m_Insect = UnityEngine.Object.Instantiate <GameObject>(original, woundSlot.transform.position, woundSlot.transform.rotation);
            insectData.m_Slot   = woundSlot;
            insectData.m_Hand   = hand;
            this.m_Insects.Add(insectData);
        }
    }
コード例 #25
0
    private void UpdateWoundSlots(SlotData data)
    {
        if (!Inventory3DManager.Get().isActiveAndEnabled || !BodyInspectionController.Get().IsActive())
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (GreenHellGame.IsPCControllerActive() && (Inventory3DManager.Get().m_CarriedItem == null || !data.slot.CanInsertItem(Inventory3DManager.Get().m_CarriedItem)))
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        BIWoundSlot biwoundSlot = (BIWoundSlot)data.slot;

        if (biwoundSlot == null || biwoundSlot.m_Injury == null)
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (biwoundSlot.m_Injury.m_Type == InjuryType.Leech)
        {
            data.obj.gameObject.SetActive(false);
            return;
        }
        if (!data.obj.gameObject.activeSelf)
        {
            data.obj.gameObject.SetActive(true);
        }
        Vector3 screenPoint = data.slot.GetScreenPoint();

        if (screenPoint.z <= 0f)
        {
            data.icon.enabled = false;
            return;
        }
        data.icon.rectTransform.position = screenPoint;
        if (biwoundSlot.GetInjury() != null && BodyInspectionController.Get() != null && BodyInspectionController.Get().enabled&& EnumTools.ConvertInjuryPlaceToLimb(biwoundSlot.GetInjury().m_Place) == HUDBodyInspection.Get().GetSelectedLimb() && biwoundSlot.GetInjury().m_Bandage == null && biwoundSlot.m_Maggots == null && biwoundSlot.GetInjury().m_ParentInjury == null)
        {
            data.icon.enabled       = true;
            this.m_SelectedSlotData = data;
            return;
        }
        data.icon.enabled = false;
    }
コード例 #26
0
 protected override void OnInsertItem(Item item)
 {
     base.OnInsertItem(item);
     if (this.m_Injury.m_Type == InjuryType.VenomBite || this.m_Injury.m_Type == InjuryType.SnakeBite || this.m_Injury.m_Type == InjuryType.SmallWoundAbrassion || this.m_Injury.m_Type == InjuryType.SmallWoundScratch || this.m_Injury.m_Type == InjuryType.Rash || this.m_Injury.m_Type == InjuryType.SmallWoundScratch || this.m_Injury.m_Type == InjuryType.WormHole)
     {
         this.m_Injury.m_HealingTimeDec = item.m_Info.m_HealingTimeDec;
         UnityEngine.Object.Destroy(item.gameObject);
     }
     else if (this.m_Injury.m_State == InjuryState.Infected)
     {
         UnityEngine.Object.Destroy(item.gameObject);
     }
     else if (this.m_Injury.m_Type == InjuryType.Laceration || this.m_Injury.m_Type == InjuryType.LacerationCat)
     {
         this.m_Injury.m_HealingTimeDec = item.m_Info.m_HealingTimeDec;
         UnityEngine.Object.Destroy(item.gameObject);
     }
     BodyInspectionController.Get().m_ActiveSlot = this;
     this.UnlockInjuryTreatment(item);
 }
コード例 #27
0
 public void OnNotepad(GameObject obj)
 {
     if (!Player.Get().CanShowNotepad())
     {
         return;
     }
     if (Inventory3DManager.Get().gameObject.activeSelf)
     {
         Inventory3DManager.Get().Deactivate();
     }
     if (BodyInspectionController.Get().IsActive())
     {
         Player.Get().StopController(PlayerControllerType.BodyInspection);
     }
     if (!NotepadController.Get().IsActive())
     {
         Player.Get().StartController(PlayerControllerType.Notepad);
         return;
     }
     NotepadController.Get().Hide();
 }
コード例 #28
0
    protected override void Update()
    {
        base.Update();
        HUDBodyInspection.Limb limb = HUDBodyInspection.Limb.None;
        for (int i = 0; i < 4; i++)
        {
            if (this.m_SelectionColliders[i].OverlapPoint(Input.mousePosition))
            {
                limb = (HUDBodyInspection.Limb)i;
                break;
            }
        }
        this.SelectLimb(limb);
        if (Input.GetMouseButtonDown(0))
        {
            this.OnClickLimb(limb);
            switch (limb)
            {
            case HUDBodyInspection.Limb.LArm:
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbX = -1f;
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbY = 1f;
                break;

            case HUDBodyInspection.Limb.RArm:
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbX = 1f;
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbY = 1f;
                break;

            case HUDBodyInspection.Limb.LLeg:
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbX = -1f;
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbY = -1f;
                break;

            case HUDBodyInspection.Limb.RLeg:
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbX = 1f;
                BodyInspectionController.Get().m_Inputs.m_ChooseLimbY = -1f;
                break;
            }
        }
    }
コード例 #29
0
 public void OnInputAction(InputActionData action_data)
 {
     if (action_data.m_Action == InputsManager.InputAction.BIShowHideArmor)
     {
         this.m_ArmorEnabled = !this.m_ArmorEnabled;
         PlayerArmorModule.Get().SetMeshesVisible(this.m_ArmorEnabled);
         if (this.m_ArmorEnabled)
         {
             BodyInspectionController.Get().OnArmorMeshesEnabled();
         }
         else
         {
             BodyInspectionController.Get().OnArmorMeshesDisabled();
         }
         if (this.m_ArmorEnabled)
         {
             this.m_ArmorOff.gameObject.SetActive(false);
             this.m_ArmorOn.gameObject.SetActive(true);
             return;
         }
         this.m_ArmorOff.gameObject.SetActive(true);
         this.m_ArmorOn.gameObject.SetActive(false);
     }
 }
コード例 #30
0
ファイル: HUDWheel.cs プロジェクト: looki666/Green-Hell
    protected override void OnShow()
    {
        base.OnShow();
        Player.Get().BlockRotation();
        CursorManager.Get().ShowCursor(true);
        Vector3 position = base.gameObject.transform.position;

        CursorManager.Get().SetCursorPos(position);
        for (int i = 0; i < 6; i++)
        {
            if (!this.IsSlotActive((HUDWheel.HUDWheelSlot)i))
            {
                this.m_Icons[i].color = this.m_InactiveColor;
            }
            else
            {
                this.m_Icons[i].color = this.m_ActiveColor;
            }
        }
        if (Inventory3DManager.Get().IsActive())
        {
            Inventory3DManager.Get().Deactivate();
        }
        if (BodyInspectionController.Get().IsActive())
        {
            BodyInspectionController.Get().Hide();
        }
        if (NotepadController.Get().IsActive())
        {
            NotepadController.Get().Hide();
        }
        if (MapController.Get().IsActive())
        {
            MapController.Get().Hide();
        }
    }