Exemplo n.º 1
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);
        }
    }