public void SetFirecamp(Firecamp firecmap) { if (firecmap != null && this.m_BlockFirecampGiveDamage) { firecmap.m_BlockGivingDamage = true; } if (this.m_Firecamp == firecmap) { return; } this.m_Firecamp = firecmap; foreach (Bowl bowl in this.m_Bowls) { if (this.m_Firecamp) { bowl.OnFirecampAdd(this.m_Firecamp); } else { bowl.OnFirecampRemove(this.m_Firecamp); } } if (this.m_Info.m_ID == ItemID.Stone_Ring) { firecmap.SetStoneRing(this); } }
public void OnFirecampRemove(Firecamp firecamp) { this.m_Firecamp = null; HUDBowlCooking.Get().UnregisterBowl(this); this.m_ItemSlot.gameObject.SetActive(false); this.SetState(Bowl.State.None); }
private bool UpdateSnapToFirecamp() { if (this.m_PlacingCondition != ConstructionGhost.GhostPlacingCondition.NeedFirecamp) { return(false); } this.m_Firecamp = null; float num = float.MaxValue; Firecamp firecamp = null; foreach (Firecamp firecamp2 in Firecamp.s_Firecamps) { float num2 = Vector3.Distance(base.transform.position, firecamp2.transform.position); if (num2 < num) { firecamp = firecamp2; num = num2; } } if (!firecamp) { return(false); } if (num < this.m_FirecampSnapDist) { Vector3 position = firecamp.transform.position; position.y -= this.m_BoxCollider.bounds.min.y - base.gameObject.transform.position.y; base.transform.position = position; this.m_Firecamp = firecamp; this.AllignToTerrain(); } return(this.m_Firecamp != null); }
public void OnFirecampIgnite(Firecamp firecamp) { if (this.m_Firecamp) { return; } this.m_Firecamp = firecamp; this.m_Animator.SetBool(this.m_TorchHash, true); this.m_Animator.SetTrigger(this.m_TorchIgniteHash); }
public void UnregisterFirecamp(Firecamp firecamp) { foreach (FirecampIconData firecampIconData in this.m_Datas) { if (firecampIconData.firecamp == firecamp) { UnityEngine.Object.Destroy(firecampIconData.obj); this.m_Datas.Remove(firecampIconData); break; } } }
public void RegisterFirecamp(Firecamp firecamp) { FirecampIconData firecampIconData = new FirecampIconData(); firecampIconData.obj = UnityEngine.Object.Instantiate <GameObject>(this.m_IconPrefab, base.transform); firecampIconData.firecamp = firecamp; firecampIconData.canvas_group = firecampIconData.obj.GetComponent <CanvasGroup>(); firecampIconData.icon = firecampIconData.obj.transform.Find("Icon").gameObject.GetComponent <Image>(); firecampIconData.mask = firecampIconData.obj.transform.Find("Mask").gameObject.GetComponent <Image>(); this.m_Datas.Add(firecampIconData); this.UpdateIcons(); }
public void OnCreateConstruction(ConstructionGhost ghost, Item created_item) { foreach (ConstructionGhost y in this.m_Ghosts) { if (ghost == y) { Firecamp component = created_item.gameObject.GetComponent <Firecamp>(); DebugUtils.Assert(component, true); this.m_Firecamps.Add(component); break; } } }
public void Activate(Firecamp firecamp) { this.m_Firecamp = firecamp; this.m_Elems[0].enabled = true; this.m_Elems[1].enabled = true; this.m_Pointer.enabled = true; this.SetState(HUDFireMiniGame.MiniGameState.Begin); this.m_MouseX = 0f; this.m_CurrentDirection = Direction.Right; this.m_Shift = 20f; this.m_LeftSinStartTime = Time.time; this.m_RightSinStartTime = Time.time; }
public void SetFirecamp(Firecamp firecmap) { if (this.m_Firecamp == firecmap) { return; } this.m_Firecamp = firecmap; if (this.m_Bowl) { if (this.m_Firecamp) { this.m_Bowl.OnFirecampAdd(this.m_Firecamp); } else { this.m_Bowl.OnFirecampRemove(this.m_Firecamp); } } }
private void UpdateParameters() { float num = this.m_PlayerConditionModule.GetHP() / this.m_PlayerConditionModule.GetMaxHP(); float num2 = this.m_PlayerConditionModule.GetHydration() / this.m_PlayerConditionModule.GetMaxHydration(); float num3 = this.m_PlayerConditionModule.GetEnergy() / this.m_PlayerConditionModule.GetMaxEnergy(); float num4 = this.m_PlayerConditionModule.GetNutritionProtein() / this.m_PlayerConditionModule.GetMaxNutritionProtein(); float num5 = this.m_PlayerConditionModule.GetNutritionFat() / this.m_PlayerConditionModule.GetMaxNutritionFat(); float num6 = this.m_PlayerConditionModule.GetMaxNutritionCarbo() / this.m_PlayerConditionModule.GetMaxNutritionCarbo(); float num7 = (float)InventoryBackpack.Get().GetFoodItemsCount(); float num8 = (!Firecamp.IsAnyBurning()) ? 0f : 1f; float num9 = (float)PlayerSanityModule.Get().m_Sanity / 100f; float num10 = (float)this.m_PlayerInjuryModule.GetNumWoundsOfState(InjuryState.Infected); float num11 = (float)this.m_PlayerInjuryModule.GetPosionLevel(); float num12 = (float)this.m_PlayerDiseasesModule.GetDisease(ConsumeEffect.FoodPoisoning).m_Level; float num13 = (float)this.m_PlayerInjuryModule.GetNumWoundsOfState(InjuryState.Bleeding); float num14 = (float)this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.Laceration) + (float)this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.LacerationCat); float num15 = (float)this.m_PlayerInjuryModule.GetNumWoundsOfType(InjuryType.Rash); this.m_WeightedAverage = (num * this.m_HPWeight + num2 * this.m_HydrationWeight + num3 * this.m_EnergyWeight + num4 * this.m_ProteinsWeight + num5 * this.m_FatWeight + num6 * this.m_CarbsWeight + num7 * this.m_HaveItemWeight + num8 * this.m_HaveFireWeight + num9 * this.m_SanityWeight - (num10 * this.m_InfectedWoundWeight + num11 * this.m_SnakeBiteLvlWeight + num12 * this.m_FoodPoisonLvlWeight + num13 * this.m_BleedingWeight + num14 * this.m_CutWoundWeight + num15 * this.m_InsectWoundWeight)) / (this.m_HPWeight + this.m_HydrationWeight + this.m_EnergyWeight + this.m_ProteinsWeight + this.m_FatWeight + this.m_CarbsWeight + this.m_HaveItemWeight + this.m_HaveFireWeight + this.m_SanityWeight + (this.m_InfectedWoundWeight + this.m_SnakeBiteLvlWeight + this.m_FoodPoisonLvlWeight + this.m_BleedingWeight + this.m_CutWoundWeight + this.m_InsectWoundWeight)); }
public override void Update() { base.Update(); if (this.m_Firecamps.Count < this.m_Count) { return; } bool flag = true; for (int i = 0; i < this.m_Firecamps.Count; i++) { Firecamp firecamp = this.m_Firecamps[i]; if (!firecamp.m_Burning) { flag = false; break; } } if (flag) { this.Success(); } }
public override void SetupAfterLoad(int index) { base.SetupAfterLoad(index); IFirecampAttach[] components = base.gameObject.GetComponents <IFirecampAttach>(); if (components.Length > 0) { Bounds bounds = new Bounds(base.transform.TransformPoint(this.m_BoxCollider.center), this.m_BoxCollider.size); for (int i = 0; i < Firecamp.s_Firecamps.Count; i++) { Firecamp firecamp = Firecamp.s_Firecamps[i]; if (!(firecamp.gameObject == base.gameObject)) { Bounds bounds2 = new Bounds(firecamp.transform.TransformPoint(firecamp.m_BoxCollider.center), firecamp.m_BoxCollider.size); if (bounds.Intersects(bounds2)) { for (int j = 0; j < components.Length; j++) { components[j].SetFirecamp(firecamp); } } } } } }
public void SetFirecamp(Firecamp firecmap) { this.m_ConnectedFirecamp = firecmap; }
public void IgniteFirecamp(Firecamp firecamp) { this.m_Animator.SetTrigger(this.m_TCarriedFireIgnite); this.m_FirecampToIgnite = firecamp; }
public override void SetupAfterLoad(int index) { base.SetupAfterLoad(index); IFirecampAttach[] components = base.gameObject.GetComponents <IFirecampAttach>(); if (components.Length != 0) { Bounds bounds = new Bounds(base.transform.TransformPoint(this.m_BoxCollider.center), this.m_BoxCollider.size); for (int i = 0; i < Firecamp.s_Firecamps.Count; i++) { Firecamp firecamp = Firecamp.s_Firecamps[i]; if (!(firecamp.gameObject == base.gameObject)) { Bounds bounds2 = new Bounds(firecamp.transform.TransformPoint(firecamp.m_BoxCollider.center), firecamp.m_BoxCollider.size); if (bounds.Intersects(bounds2)) { for (int j = 0; j < components.Length; j++) { components[j].SetFirecamp(firecamp); } } } } } if (SaveGame.m_SaveGameVersion >= GreenHellGame.s_GameVersionEarlyAccessUpdate4) { for (int k = 0; k < this.m_ConstructionSlots.Length; k++) { ConstructionSlot constructionSlot = this.m_ConstructionSlots[k]; if (SaveGame.LoadBVal(string.Concat(new object[] { "ConstructionSlot", index, constructionSlot.name, k }))) { Vector3 a = SaveGame.LoadV3Val(string.Concat(new object[] { "ConstructionSlotPos", index, constructionSlot.name, k })); foreach (Construction construction in Construction.s_AllConstructions) { if (!(construction == this) && (a - construction.transform.position).sqrMagnitude < 0.01f && constructionSlot.m_MatchingItemIDs.Contains(construction.GetInfoID())) { constructionSlot.SetConstruction(construction); break; } } } } } foreach (Construction construction2 in Construction.s_AllConstructions) { if (!(construction2 == this) && (this.m_ConstructionBelowPos - construction2.transform.position).sqrMagnitude < 0.01f && this.m_ConstructionBelowName == construction2.name) { this.m_ConstructionBelow = construction2; break; } } this.SetUpperLevel(this.m_UpperLevel, this.m_Level); }