public Injury(InjuryType type, InjuryPlace place, BIWoundSlot slot, InjuryState state, int poison_level = 0, Injury parent_injury = null, DamageInfo damage_info = null) { this.m_Type = type; this.m_Place = place; slot.SetInjury(this); this.m_Slot = slot; this.m_StartTimeInMinutes = MainLevel.Instance.GetCurrentTimeMinutes(); this.m_PoisonLevel = poison_level; this.m_TimeToInfect = this.m_DefaultTimeToInfect; this.m_ParentInjury = parent_injury; if (damage_info != null && damage_info.m_Damager != null) { AI component = damage_info.m_Damager.GetComponent <AI>(); if (component != null) { this.m_AIDamager = component.m_ID; } } this.m_State = state; this.UpdateHealthDecreasePerSec(); this.SetWoundMaterial(this.m_Slot.m_Wound); if (slot.m_AdditionalMeshes != null) { for (int i = 0; i < slot.m_AdditionalMeshes.Count; i++) { this.SetWoundMaterial(slot.m_AdditionalMeshes[i]); } } this.SetAdditionalInjury(this); Injury.s_NumInjuries++; }
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; } } }
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(); } }
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 Injury(InjuryType type, InjuryPlace place, BIWoundSlot slot, InjuryState state, int poison_level = 0, Injury parent_injury = null) { this.m_Type = type; this.m_Place = place; slot.SetInjury(this); this.m_Slot = slot; this.m_StartTimeInMinutes = MainLevel.Instance.GetCurrentTimeMinutes(); this.m_PoisonLevel = poison_level; this.m_TimeToInfect = this.m_DefaultTimeToInfect; this.m_ParentInjury = parent_injury; if (type == InjuryType.VenomBite || type == InjuryType.SnakeBite) { Player.Get().GetComponent <PlayerDiseasesModule>().RequestDisease(ConsumeEffect.Fever, 0f, 1); } this.m_State = state; this.UpdateHealthDecreasePerSec(); this.SetWoundMaterial(this.m_Slot.m_Wound); if (slot.m_AdditionalMeshes != null) { for (int i = 0; i < slot.m_AdditionalMeshes.Count; i++) { this.SetWoundMaterial(slot.m_AdditionalMeshes[i]); } } this.SetAdditionalInjury(this); Injury.s_NumInjuries++; }
public void UnlockKnownInjuryState(InjuryState injury_state) { if (!this.m_KnownInjuryState.Contains(injury_state)) { this.m_KnownInjuryState.Add(injury_state); HUDInfoLog hudinfoLog = (HUDInfoLog)HUDManager.Get().GetHUD(typeof(HUDInfoLog)); string title = GreenHellGame.Instance.GetLocalization().Get("HUD_InfoLog_NewEntry", true); string text = GreenHellGame.Instance.GetLocalization().Get(injury_state.ToString(), true); hudinfoLog.AddInfo(title, text, HUDInfoLogTextureType.Notepad); } }
public List <Injury> GetAllInjuriesOfState(InjuryState state) { this.m_InjuryStateTempList.Clear(); for (int i = 0; i < this.m_Injuries.Count; i++) { if (this.m_Injuries[i].m_State == state) { this.m_InjuryStateTempList.Add(this.m_Injuries[i]); } } return(this.m_InjuryStateTempList); }
public int GetNumWoundsOfState(InjuryState state) { int num = 0; for (int i = 0; i < this.m_Injuries.Count; i++) { if (this.m_Injuries[i].IsWound() && this.m_Injuries[i].m_State == state) { num++; } } return(num); }
public Injury AddInjury(InjuryType type, InjuryPlace place, BIWoundSlot slot, InjuryState state, int poison_level = 0, Injury parent_injury = null) { if (!slot || PlayerConditionModule.Get().GetParameterLossBlocked()) { return(null); } if (type == InjuryType.Leech && this.GetAllInjuries(type).Count == 0 && PlayerSanityModule.Get()) { PlayerSanityModule.Get().ResetEventCooldown(PlayerSanityModule.SanityEventType.Leech); } Debug.Log("AddInjury"); Injury injury = new Injury(type, place, slot, state, poison_level, parent_injury); this.m_Injuries.Add(injury); this.OnAddInjury(type); return(injury); }
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); } }
public Injury AddInjury(InjuryType type, InjuryPlace place, BIWoundSlot slot, InjuryState state, int poison_level = 0, Injury parent_injury = null, DamageInfo damage_info = null) { if (!slot || PlayerConditionModule.Get().GetParameterLossBlocked()) { return(null); } if (DifficultySettings.GetActivePresetType() == DifficultySettings.PresetType.Tourist && !MainLevel.Instance.m_Tutorial) { return(null); } if (type == InjuryType.Leech && this.GetAllInjuries(type).Count == 0 && PlayerSanityModule.Get()) { PlayerSanityModule.Get().ResetEventCooldown(PlayerSanityModule.SanityEventType.Leech); } Debug.Log("AddInjury"); Injury injury = new Injury(type, place, slot, state, poison_level, parent_injury, damage_info); this.m_Injuries.Add(injury); this.OnAddInjury(type); return(injury); }
public override void OnReplicationDeserialize(P2PNetworkReader reader, bool initial_state) { base.OnReplicationDeserialize(reader, initial_state); this.Initialize(); foreach (ReplicatedPlayerInjuries.ReplicatedWoundSlot replicatedWoundSlot in this.m_WoundSlots) { replicatedWoundSlot.m_IsValid = false; } int num = (int)reader.ReadPackedUInt32(); for (int i = 0; i < num; i++) { InjuryType injury_type = (InjuryType)reader.ReadInt32(); InjuryState injury_state = (InjuryState)reader.ReadInt32(); int num2 = reader.ReadInt32(); this.m_WoundSlots[num2].m_IsValid = true; if (num2 >= 0 && num2 < this.m_WoundSlots.Count) { this.m_WoundSlots[num2].SetInjury(injury_type, injury_state); } } }
private void SetState(InjuryState state) { this.m_State = state; this.m_StartTimeInMinutes = MainLevel.Instance.GetCurrentTimeMinutes(); }
public override void OnTakeDamage(DamageInfo info) { base.OnTakeDamage(info); if (info.m_Blocked) { return; } float num = info.m_Damage; info.m_InjuryPlace = this.GetInjuryPlaceFromHit(info); if (!info.m_FromInjury) { Limb limb = EnumTools.ConvertInjuryPlaceToLimb(info.m_InjuryPlace); if (limb == Limb.None) { limb = Limb.LArm; } if (info.m_DamageType != DamageType.Fall && info.m_DamageType != DamageType.SnakePoison && info.m_DamageType != DamageType.VenomPoison && info.m_DamageType != DamageType.Insects && info.m_DamageType != DamageType.Infection) { num = info.m_Damage * (1f - PlayerArmorModule.Get().GetAbsorption(limb)); } PlayerArmorModule.Get().SetPhaseCompleted(ArmorTakeDamagePhase.InjuryModule); } float num2 = 5f; if ((num > num2 && PlayerArmorModule.Get().NoArmorAfterDamage(info)) || info.m_DamageType == DamageType.Insects || info.m_DamageType == DamageType.SnakePoison || info.m_DamageType == DamageType.VenomPoison || info.m_DamageType == DamageType.Fall || info.m_DamageType == DamageType.Infection) { BIWoundSlot biwoundSlot = null; DamageType damageType = info.m_DamageType; InjuryType injuryType; if (damageType <= DamageType.Claws) { if (damageType <= DamageType.Melee) { if (damageType - DamageType.Cut > 1) { if (damageType == DamageType.Melee) { injuryType = InjuryType.SmallWoundAbrassion; goto IL_17F; } } else { if (info.m_CriticalHit) { injuryType = InjuryType.Laceration; goto IL_17F; } injuryType = InjuryType.SmallWoundScratch; goto IL_17F; } } else { if (damageType == DamageType.VenomPoison) { injuryType = InjuryType.VenomBite; goto IL_17F; } if (damageType == DamageType.Claws) { injuryType = InjuryType.LacerationCat; goto IL_17F; } } } else if (damageType <= DamageType.Fall) { if (damageType == DamageType.Insects) { injuryType = InjuryType.Rash; goto IL_17F; } if (damageType == DamageType.Fall) { injuryType = InjuryType.SmallWoundAbrassion; goto IL_17F; } } else { if (damageType == DamageType.Critical) { injuryType = InjuryType.Laceration; goto IL_17F; } if (damageType == DamageType.SnakePoison) { injuryType = InjuryType.SnakeBite; goto IL_17F; } } injuryType = InjuryType.SmallWoundAbrassion; IL_17F: if (!info.m_FromInjury && (injuryType == InjuryType.VenomBite || injuryType == InjuryType.SnakeBite)) { Disease disease = PlayerDiseasesModule.Get().GetDisease(ConsumeEffect.Fever); if (disease != null && disease.IsActive()) { disease.IncreaseLevel(1); } else { PlayerDiseasesModule.Get().RequestDisease(ConsumeEffect.Fever, 0f, 1); } } if (info.m_DamageType == DamageType.Insects && GreenHellGame.TWITCH_DEMO) { biwoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LHand, injuryType, true); } else if (info.m_InjuryPlace == InjuryPlace.LLeg) { biwoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LLeg, injuryType, true); } else if (info.m_InjuryPlace == InjuryPlace.RLeg) { biwoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.RLeg, injuryType, true); } else if (info.m_InjuryPlace == InjuryPlace.LHand) { biwoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LHand, injuryType, true); } else if (info.m_InjuryPlace == InjuryPlace.RHand) { biwoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.RHand, injuryType, true); } if (biwoundSlot != null) { InjuryState state = InjuryState.Open; if (injuryType == InjuryType.Laceration || injuryType == InjuryType.LacerationCat) { state = InjuryState.Bleeding; } else if (injuryType == InjuryType.WormHole) { state = InjuryState.WormInside; } this.AddInjury(injuryType, biwoundSlot.m_InjuryPlace, biwoundSlot, state, info.m_PoisonLevel, null, info); return; } if (info.m_DamageType == DamageType.VenomPoison) { for (int i = 0; i < this.m_Injuries.Count; i++) { if (this.m_Injuries[i].m_Type == InjuryType.VenomBite) { this.m_Injuries[i].m_PoisonLevel += info.m_PoisonLevel; return; } } return; } if (info.m_DamageType == DamageType.SnakePoison) { for (int j = 0; j < this.m_Injuries.Count; j++) { if (this.m_Injuries[j].m_Type == InjuryType.SnakeBite) { this.m_Injuries[j].m_PoisonLevel += info.m_PoisonLevel; return; } } } } }
public bool HasInjury(InjuryType injury_type, InjuryState injury_state) { return(this.m_InjuryData.type == injury_type && this.m_InjuryData.state == injury_state); }
public static void SetWoundMaterial(GameObject obj, InjuryState state, InjuryType type) { if (obj == null) { return; } Renderer componentDeepChild = General.GetComponentDeepChild <Renderer>(obj); switch (type) { case InjuryType.SmallWoundAbrassion: if (state == InjuryState.Open) { componentDeepChild.material = (Resources.Load("Decals/wound_abrasion", typeof(Material)) as Material); return; } if (state == InjuryState.Infected) { componentDeepChild.material = (Resources.Load("Decals/wound_abrasion_infected", typeof(Material)) as Material); return; } break; case InjuryType.SmallWoundScratch: if (state == InjuryState.Open) { componentDeepChild.material = (Resources.Load("Decals/wound_scratch", typeof(Material)) as Material); return; } if (state == InjuryState.Infected) { componentDeepChild.material = (Resources.Load("Decals/wound_scratch_infected", typeof(Material)) as Material); return; } break; case InjuryType.Laceration: if (state == InjuryState.Bleeding) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration", typeof(Material)) as Material); return; } if (state == InjuryState.Open) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration", typeof(Material)) as Material); return; } if (state == InjuryState.Infected) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration_infected", typeof(Material)) as Material); return; } if (state == InjuryState.Closed) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration_closed", typeof(Material)) as Material); return; } break; case InjuryType.LacerationCat: if (state == InjuryState.Bleeding) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration_cat", typeof(Material)) as Material); return; } if (state == InjuryState.Open) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration_cat", typeof(Material)) as Material); return; } if (state == InjuryState.Infected) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration_cat_infected", typeof(Material)) as Material); return; } if (state == InjuryState.Closed) { componentDeepChild.material = (Resources.Load("Decals/wound_laceration_cat_closed", typeof(Material)) as Material); return; } break; case InjuryType.Rash: componentDeepChild.material = (Resources.Load("Decals/wound_rash", typeof(Material)) as Material); return; case InjuryType.Worm: case InjuryType.Leech: case InjuryType.LeechHole: break; case InjuryType.WormHole: if (state == InjuryState.WormInside) { componentDeepChild.material = (Resources.Load("Decals/wound_worm_hole_closed", typeof(Material)) as Material); return; } if (state == InjuryState.Open) { componentDeepChild.material = (Resources.Load("Decals/wound_worm_leech_hole", typeof(Material)) as Material); return; } if (state == InjuryState.Infected) { componentDeepChild.material = (Resources.Load("Decals/wound_worm_hole_infected", typeof(Material)) as Material); } break; case InjuryType.VenomBite: componentDeepChild.material = (Resources.Load("Decals/wound_venom_bite", typeof(Material)) as Material); return; case InjuryType.SnakeBite: componentDeepChild.material = (Resources.Load("Decals/wound_snake_bite", typeof(Material)) as Material); return; default: return; } }
public SReplicatedInjuryData(InjuryType type, InjuryState state) { this.type = type; this.state = state; }
public override void OnTakeDamage(DamageInfo info) { base.OnTakeDamage(info); if (info.m_Blocked) { return; } if (info.m_Damage > 5f) { DamageType damageType = info.m_DamageType; InjuryType injuryType; switch (damageType) { case DamageType.Cut: case DamageType.Thrust: if (info.m_CriticalHit) { injuryType = InjuryType.Laceration; } else { injuryType = InjuryType.SmallWoundScratch; } break; default: if (damageType != DamageType.Claws) { if (damageType != DamageType.Insects) { if (damageType != DamageType.Fall) { if (damageType != DamageType.Critical) { if (damageType != DamageType.SnakePoison) { injuryType = InjuryType.SmallWoundAbrassion; } else { injuryType = InjuryType.SnakeBite; } } else { injuryType = InjuryType.Laceration; } } else { injuryType = InjuryType.SmallWoundAbrassion; } } else { injuryType = InjuryType.Rash; } } else { injuryType = InjuryType.LacerationCat; } break; case DamageType.Melee: injuryType = InjuryType.SmallWoundAbrassion; break; case DamageType.VenomPoison: injuryType = InjuryType.VenomBite; break; } Vector2 zero = Vector2.zero; zero.x = Vector3.Dot(base.transform.right, info.m_HitDir); zero.y = Vector3.Dot(base.transform.up, info.m_HitDir); float num = Vector2.Angle(Vector2.up, zero); if (zero.x < 0f) { num *= -1f; } BIWoundSlot freeWoundSlot; if (info.m_DamageType == DamageType.Insects && GreenHellGame.TWITCH_DEMO) { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LHand, injuryType); } else if (num < 45f && num > -45f) { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LLeg, injuryType); if (freeWoundSlot == null) { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.RLeg, injuryType); } } else if (num >= 45f && num < 135f) { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LHand, injuryType); } else if (num >= 135f || num < -135f) { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.LHand, injuryType); if (freeWoundSlot == null) { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.RHand, injuryType); } } else { freeWoundSlot = this.m_BodyInspectionController.GetFreeWoundSlot(InjuryPlace.RHand, injuryType); } if (freeWoundSlot != null) { InjuryState state = InjuryState.Open; if (injuryType == InjuryType.Laceration || injuryType == InjuryType.Laceration) { state = InjuryState.Bleeding; } else if (injuryType == InjuryType.WormHole) { state = InjuryState.WormInside; } this.AddInjury(injuryType, freeWoundSlot.m_InjuryPlace, freeWoundSlot, state, info.m_PoisonLevel, null); } else if (info.m_DamageType == DamageType.VenomPoison) { for (int i = 0; i < this.m_Injuries.Count; i++) { if (this.m_Injuries[i].m_Type == InjuryType.VenomBite) { this.m_Injuries[i].m_PoisonLevel += info.m_PoisonLevel; break; } } } else if (info.m_DamageType == DamageType.SnakePoison) { for (int j = 0; j < this.m_Injuries.Count; j++) { if (this.m_Injuries[j].m_Type == InjuryType.SnakeBite) { this.m_Injuries[j].m_PoisonLevel += info.m_PoisonLevel; break; } } } } }
public bool IsInjuryStateUnlocked(InjuryState injury_state) { return(this.m_KnownInjuryState.Contains(injury_state)); }
public void UnlockKnownInjuryStateFromScenario(string injury_state_name) { InjuryState injury_state = (InjuryState)Enum.Parse(typeof(InjuryState), injury_state_name); this.UnlockKnownInjuryState(injury_state); }
void GetComponents() { m_pauseMenu = GetComponent <PauseMenu>(); m_injuryState = GetComponent <InjuryState>(); m_volume = GetComponent <Volume>(); }
public void SetInjury(InjuryType injury_type, InjuryState injury_state) { if (this.HasInjury(injury_type, injury_state)) { return; } this.m_InjuryData = new ReplicatedPlayerInjuries.SReplicatedInjuryData(injury_type, injury_state); if (injury_type != InjuryType.None) { this.m_ReplicatedPlayerSlot.SetActive(true); } Injury.SetWoundMaterial(this.m_ReplicatedPlayerSlot, injury_state, injury_type); if (this.m_ReplicatedPlayerAdditionalMeshes != null) { for (int i = 0; i < this.m_ReplicatedPlayerAdditionalMeshes.Count; i++) { Injury.SetWoundMaterial(this.m_ReplicatedPlayerAdditionalMeshes[i], injury_state, injury_type); } } if (injury_type == InjuryType.Worm) { GameObject gameObject = Resources.Load("Prefabs/Items/Item/botfly") as GameObject; if (gameObject == null) { gameObject = (Resources.Load("Prefabs/TempPrefabs/Item/Item/botfly") as GameObject); } if (gameObject == null) { return; } this.m_AdditionalObjectInSlot = UnityEngine.Object.Instantiate <GameObject>(gameObject, this.m_ReplicatedPlayerSlot.transform.position, this.m_ReplicatedPlayerSlot.transform.rotation); Item component = this.m_AdditionalObjectInSlot.GetComponent <Item>(); if (component != null) { component.m_CanSaveNotTriggered = false; } this.m_AdditionalObjectInSlot.layer = Player.Get().gameObject.layer; this.m_AdditionalObjectInSlot.transform.parent = this.m_ReplicatedPlayerSlot.transform; this.m_AdditionalObjectInSlot.GetComponent <Parasite>().m_InBody = true; Renderer[] componentsDeepChild = General.GetComponentsDeepChild <Renderer>(this.m_AdditionalObjectInSlot); for (int j = 0; j < componentsDeepChild.Length; j++) { componentsDeepChild[j].gameObject.layer = LayerMask.NameToLayer("Player"); } this.m_AdditionalObjectInSlot.SetActive(false); return; } else { if (injury_type != InjuryType.Leech) { if (injury_type == InjuryType.VenomBite || injury_type == InjuryType.SnakeBite || injury_type == InjuryType.Laceration || injury_type == InjuryType.LacerationCat || injury_type == InjuryType.Rash || injury_type == InjuryType.SmallWoundAbrassion || injury_type == InjuryType.SmallWoundScratch || injury_type == InjuryType.WormHole) { this.m_ReplicatedPlayerSlot.SetActive(true); if (injury_type == InjuryType.Rash && this.m_ReplicatedPlayerAdditionalMeshes != null) { for (int k = 0; k < this.m_ReplicatedPlayerAdditionalMeshes.Count; k++) { this.m_ReplicatedPlayerAdditionalMeshes[k].SetActive(true); } return; } } else { Item component2 = this.m_ReplicatedPlayerSlot.GetComponent <Item>(); if (component2 != null && component2.m_Info == null) { UnityEngine.Object.Destroy(component2.gameObject); } if (component2 != null && component2.m_Info != null && component2.m_Info.m_ID == ItemID.Leech) { UnityEngine.Object.Destroy(component2.gameObject); } else if (component2 == null || (component2 != null && component2.m_Info != null && component2.m_Info.m_ID != ItemID.Leech && component2.m_Info.m_ID != ItemID.Botfly)) { this.m_ReplicatedPlayerSlot.SetActive(false); } if (this.m_ReplicatedPlayerAdditionalMeshes != null) { for (int l = 0; l < this.m_ReplicatedPlayerAdditionalMeshes.Count; l++) { this.m_ReplicatedPlayerAdditionalMeshes[l].SetActive(false); } } if (this.m_AdditionalObjectInSlot) { UnityEngine.Object.Destroy(this.m_AdditionalObjectInSlot); this.m_AdditionalObjectInSlot = null; } } return; } GameObject gameObject2 = Resources.Load("Prefabs/Items/Item/Leech") as GameObject; if (gameObject2 == null) { gameObject2 = (Resources.Load("Prefabs/TempPrefabs/Items/Item/Leech") as GameObject); } if (gameObject2 == null) { return; } this.m_AdditionalObjectInSlot = UnityEngine.Object.Instantiate <GameObject>(gameObject2, this.m_ReplicatedPlayerSlot.transform.position, this.m_ReplicatedPlayerSlot.transform.rotation); Item component3 = this.m_AdditionalObjectInSlot.GetComponent <Item>(); if (component3 != null) { component3.m_CanSaveNotTriggered = false; } this.m_AdditionalObjectInSlot.layer = Player.Get().gameObject.layer; this.m_AdditionalObjectInSlot.GetComponent <Rigidbody>().useGravity = false; this.m_AdditionalObjectInSlot.transform.parent = this.m_ReplicatedPlayerSlot.transform; this.m_AdditionalObjectInSlot.GetComponent <Animator>().speed = UnityEngine.Random.Range(0.8f, 1.2f); this.m_AdditionalObjectInSlot.GetComponent <Parasite>().m_InBody = true; this.m_AdditionalObjectInSlot.GetComponent <Rigidbody>().detectCollisions = false; this.m_AdditionalObjectInSlot.GetComponent <Animator>().SetBool("Drink", true); Renderer[] componentsDeepChild = General.GetComponentsDeepChild <Renderer>(this.m_AdditionalObjectInSlot); for (int j = 0; j < componentsDeepChild.Length; j++) { componentsDeepChild[j].gameObject.layer = LayerMask.NameToLayer("Player"); } return; } }