Example #1
0
    public void ScenarioAddInjury(string type, string place, string state)
    {
        InjuryType  injuryType    = (InjuryType)Enum.Parse(typeof(InjuryType), type);
        InjuryPlace place2        = (InjuryPlace)Enum.Parse(typeof(InjuryPlace), place);
        InjuryState state2        = (InjuryState)Enum.Parse(typeof(InjuryState), state);
        BIWoundSlot freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(place2, injuryType, true);
        Injury      injury        = null;

        if (freeWoundSlot != null)
        {
            injury = this.AddInjury(injuryType, place2, freeWoundSlot, state2, 0, null, null);
        }
        if (injury != null)
        {
            switch (state2)
            {
            case InjuryState.Open:
                injury.OpenWound();
                return;

            case InjuryState.Infected:
                injury.Infect();
                return;

            case InjuryState.Closed:
                injury.CloseWound();
                break;

            default:
                return;
            }
        }
    }
Example #2
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);
                }
            }
        }
    }
    public void ScenarioAddInjury(string type, string place, string state)
    {
        InjuryType  injuryType    = (InjuryType)Enum.Parse(typeof(InjuryType), type);
        InjuryPlace place2        = (InjuryPlace)Enum.Parse(typeof(InjuryPlace), place);
        InjuryState injuryState   = (InjuryState)Enum.Parse(typeof(InjuryState), state);
        BIWoundSlot freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(place2, injuryType);
        Injury      injury        = null;

        if (freeWoundSlot != null)
        {
            injury = this.AddInjury(injuryType, place2, freeWoundSlot, injuryState, 0, null);
        }
        if (injuryState != InjuryState.Open)
        {
            if (injuryState != InjuryState.Infected)
            {
                if (injuryState == InjuryState.Closed)
                {
                    injury.CloseWound();
                }
            }
            else
            {
                injury.Infect();
            }
        }
        else
        {
            injury.OpenWound();
        }
    }