private object CanLootEntity(BasePlayer player, StorageContainer container) { BaseEntity fridge = container.GetComponentInParent <BaseEntity>(); if (fridge.ShortPrefabName.Equals("fridge.deployed")) { ElectricalHeater electrified = container.GetComponentInChildren <ElectricalHeater>() ?? null; if (electrified == null) { return(null); } if (!electrified.IsPowered() && configData.Settings.blockLooting) { return(false); } string status = Lang("off"); if (electrified.IsPowered()) { status = Lang("on"); } PowerGUI(player, status); } return(null); }
private object CanLootEntity(BasePlayer player, StorageContainer container) { if (!player.IPlayer.HasPermission(permTCGuiUse)) { return(null); } var privs = container.GetComponentInParent <BuildingPrivlidge>() ?? null; if (privs == null) { return(null); } if (cuploot.ContainsKey(privs.net.ID)) { return(null); } if (player.CanBuild()) { cuploot.Add(privs.net.ID, player.userID); TcButtonGUI(player, privs); } return(null); }
static void Postfix(StorageContainer __instance) { var connectable = __instance.gameObject.AddComponent <StorageConnectable>(); connectable.container = __instance; connectable.Identifier = __instance.GetComponentInParent <PrefabIdentifier>(); }
static void Postfix(StorageContainer __instance) { if (__instance.GetComponentInParent <FloatingCargoCrateControl>()?.needShowBeaconText != true) { return; } #if GAME_SN var textHand = HandReticle.main.interactText1; #elif GAME_BZ var textHand = HandReticle.main.textHand; #endif if (textHand != "") { HandReticle.main.setText(textHand: textHand + L10n.str(L10n.ids_attachBeaconToCrate).format(uGUI.FormatButton(GameInput.Button.RightHand))); } }
private object CanLootEntity(BasePlayer player, StorageContainer container) { if (container == null || player == null) { return(null); } var iscarpet = container.GetComponentInParent <CarpetEntity>() ?? null; if (iscarpet != null) { if (iscarpet.carpetlock != null && iscarpet.carpetlock.IsLocked()) { return(false); } } return(null); }
private object CanLootEntity(BasePlayer player, StorageContainer container) { var rc = container.GetComponentInParent <Recycler>() ?? null; if (rc == null) { return(null); } #if DEBUG Puts($"Adding recycler {rc.net.ID.ToString()}"); #endif if (rcloot.ContainsKey(rc.net.ID)) { // if using eco or sw, another player can enter and the cost will shift to that player rcloot.Remove(rc.net.ID); } rcloot.Add(rc.net.ID, player.userID); rcGUI(player, rc); return(null); }