-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathPlasticCurtainConfig.cs
82 lines (67 loc) · 3.05 KB
/
PlasticCurtainConfig.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using RomenH.Common;
using STRINGS;
using TUNING;
using UnityEngine;
namespace RomenH.PlasticDoor
{
class PlasticCurtainConfig : IBuildingConfig //, IModdedBuilding
{
public const string ID = "AC_PlasticCurtain";
public static string PlanMenu = "Base";
public static string Tech = "Luxury";
//public MBInfo Info => new MBInfo(ID, "Base", "Luxury", "Door");
public static readonly LocString Name = StringUtils.BuildingName(ID, "Plastic Door");
public static readonly LocString Desc = StringUtils.BuildingDesc(ID, "A transparent insulating door.");
public static readonly LocString Effect = StringUtils.BuildingEffect(ID, $"Quarters off dangerous areas and prevents gases" +
$" from seeping into the colony while closed, while allowing {UI.FormatAsLink("Light", "LIGHT")}" +
$" and {UI.FormatAsLink("Decor", "DECOR")} to pass through.\n\nDuplicants passing through will open the door for a short while, letting gases and liquids to pass through.");
public static readonly LocString ChangeStateName = StringUtils.StatusItemName("CHANGECURTAINCONTROLSTATE", "BUILDING", "Pending Door State Change: {CurrentState}");
public static readonly LocString ChangeStateTooltip = StringUtils.StatusItemTooltip("CHANGECURTAINCONTROLSTATE", "BUILDING", "Waiting for a Duplicant to change control state");
public override BuildingDef CreateBuildingDef()
{
BuildingDef def = BuildingTemplates.CreateBuildingDef(
id: ID,
width: 1,
height: 2,
anim: "plasticcurtain_kanim",
hitpoints: TUNING.BUILDINGS.HITPOINTS.TIER1,
construction_time: TUNING.BUILDINGS.CONSTRUCTION_TIME_SECONDS.TIER2,
construction_mass: TUNING.BUILDINGS.CONSTRUCTION_MASS_KG.TIER4,
construction_materials: new string[] { "AC_FlexibleMaterial" },
melting_point: TUNING.BUILDINGS.MELTING_POINT_KELVIN.TIER0,
build_location_rule: BuildLocationRule.Tile,
decor: TUNING.BUILDINGS.DECOR.BONUS.TIER2,
noise: NOISE_POLLUTION.NONE
);
def.Overheatable = false;
def.Floodable = false;
def.Entombable = false;
def.IsFoundation = true;
def.TileLayer = ObjectLayer.FoundationTile;
def.AudioCategory = "Glass";
def.PermittedRotations = PermittedRotations.Unrotatable;
def.SceneLayer = Grid.SceneLayer.Ground;
def.ForegroundLayer = Grid.SceneLayer.Ground;
return def;
}
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
{
Prioritizable.AddRef(go);
Object.DestroyImmediate(go.GetComponent<BuildingEnabledButton>());
BuildingConfigManager.Instance.IgnoreDefaultKComponent(typeof(RequiresFoundation), prefab_tag);
go.AddOrGet<ZoneTile>();
go.AddOrGet<KBoxCollider2D>();
go.AddOrGet<Workable>().workTime = 3f;
go.AddOrGet<CopyBuildingSettings>().copyGroupTag = ID;
go.AddOrGet<BuildingHP>().destroyOnDamaged = true;
go.AddComponent<Flutterable>();
go.AddComponent<Curtain>();
go.AddComponent<Backwall>();
}
public override void DoPostConfigureComplete(GameObject go)
{
var kbac = go.GetComponent<KBatchedAnimController>();
kbac.PlayMode = KAnim.PlayMode.Once;
}
}
}