public void Sim1000ms(float dt) { mingleCells.Clear(); RoomProber roomProber = Game.Instance.roomProber; MinionGroupProber minionGroupProber = MinionGroupProber.Get(); foreach (Room room in roomProber.rooms) { if (room.roomType == Db.Get().RoomTypes.RecRoom) { for (int i = room.cavity.minY; i <= room.cavity.maxY; i++) { for (int j = room.cavity.minX; j <= room.cavity.maxX; j++) { int num = Grid.XYToCell(j, i); CavityInfo cavityForCell = roomProber.GetCavityForCell(num); if (cavityForCell == room.cavity && minionGroupProber.IsReachable(num) && !Grid.HasLadder[num] && !Grid.HasTube[num] && !Grid.IsLiquid(num) && Grid.Element[num].id == SimHashes.Oxygen) { mingleCells.Add(num); } } } } } }
public void UpdateReachability() { if (!((Object)base.master == (Object)null)) { int cell = Grid.PosToCell(base.master); base.sm.isReachable.Set(MinionGroupProber.Get().IsAllReachable(cell, base.master.GetOffsets(cell)), base.smi); } }
protected override void OnSpawn() { base.OnSpawn(); var animController = GetComponent <KBatchedAnimController>(); string armName = animController.name + ".arm"; arm = new GameObject(armName); arm.SetActive(false); arm.transform.parent = animController.transform; arm.AddComponent <KPrefabID>().PrefabTag = new Tag(armName); armAnimController = arm.AddComponent <KBatchedAnimController>(); armAnimController.AnimFiles = new KAnimFile[1] { animController.AnimFiles[0] }; armAnimController.initialAnim = "arm"; armAnimController.isMovable = true; armAnimController.sceneLayer = Grid.SceneLayer.TransferArm; animController.SetSymbolVisiblity(ARM_TARGET, false); var column = animController.GetSymbolTransform(ARM_TARGET, out var isVisible).GetColumn(3); column.z = Grid.GetLayerZ(Grid.SceneLayer.TransferArm); arm.transform.SetPosition(column); arm.SetActive(true); armAnimLink = new KAnimLink(animController, armAnimController); var choreGroups = Db.Get().ChoreGroups; for (int i = 0; i < choreGroups.Count; i++) { choreConsumer.SetPermittedByUser(choreGroups[i], true); } Subscribe((int)GameHashes.OperationalChanged, OnOperationalChangedDelegate); Subscribe((int)GameHashes.EndChore, OnEndChoreDelegate); // dunno why this is needed, but it is? animController.enabled = false; animController.enabled = true; MinionGroupProber.Get().SetValidSerialNos(this, serialNumber, serialNumber); smi.StartSM(); }
private void UpdateStorageFetchableBits() { ChoreType storageFetch = Db.Get().ChoreTypes.StorageFetch; ChoreType foodFetch = Db.Get().ChoreTypes.FoodFetch; storageFetchableBits.ClearAll(); foreach (FetchChore fetchChore in fetchChores) { if ((fetchChore.choreType == storageFetch || fetchChore.choreType == foodFetch) && (bool)fetchChore.destination) { int cell = Grid.PosToCell(fetchChore.destination); if (MinionGroupProber.Get().IsReachable(cell, fetchChore.destination.GetOffsets(cell))) { storageFetchableBits.Or(ref fetchChore.tagBits); } } } }
protected override void OnSpawn() { if (addToIdentityList) { ValidateProxy(); CleanupLimboMinions(); } PathProber component = GetComponent <PathProber>(); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { component.SetGroupProber(MinionGroupProber.Get()); } SetName(name); if (nameStringKey == null) { nameStringKey = name; } SetGender(gender); if (genderStringKey == null) { genderStringKey = "NB"; } if (addToIdentityList) { Components.MinionIdentities.Add(this); if (!base.gameObject.HasTag(GameTags.Dead)) { Components.LiveMinionIdentities.Add(this); } } SymbolOverrideController component2 = GetComponent <SymbolOverrideController>(); if ((UnityEngine.Object)component2 != (UnityEngine.Object)null) { Accessorizer component3 = base.gameObject.GetComponent <Accessorizer>(); if ((UnityEngine.Object)component3 != (UnityEngine.Object)null) { bodyData = default(KCompBuilder.BodyData); component3.GetBodySlots(ref bodyData); string text = HashCache.Get().Get(component3.GetAccessory(Db.Get().AccessorySlots.HeadShape).symbol.hash); string str = text.Replace("headshape", "cheek"); component2.AddSymbolOverride("snapto_cheek", Assets.GetAnim("head_swap_kanim").GetData().build.GetSymbol(str), 1); component2.AddSymbolOverride(Db.Get().AccessorySlots.HairAlways.targetSymbolId, component3.GetAccessory(Db.Get().AccessorySlots.Hair).symbol, 1); component2.AddSymbolOverride(Db.Get().AccessorySlots.HatHair.targetSymbolId, Db.Get().AccessorySlots.HatHair.Lookup("hat_" + HashCache.Get().Get(component3.GetAccessory(Db.Get().AccessorySlots.Hair).symbol.hash)).symbol, 1); } } voiceId = "0"; voiceId += (voiceIdx + 1).ToString(); Prioritizable component4 = GetComponent <Prioritizable>(); if ((UnityEngine.Object)component4 != (UnityEngine.Object)null) { component4.showIcon = false; } Pickupable component5 = GetComponent <Pickupable>(); if ((UnityEngine.Object)component5 != (UnityEngine.Object)null) { component5.carryAnimOverride = Assets.GetAnim("anim_incapacitated_carrier_kanim"); } ApplyCustomGameSettings(); }
protected override void OnCleanUp() { GameScenePartitioner.Instance.Free(ref pickupablesChangedEntry); MinionGroupProber.Get().ReleaseProber(this); base.OnCleanUp(); }
protected override void OnCleanUp() { MinionGroupProber.Get().ReleaseProber(this); base.OnCleanUp(); }
private static Color GetMinionGroupProberColour(SimDebugView instance, int cell) { return((!MinionGroupProber.Get().IsReachable(cell)) ? Color.black : Color.white); }