游戏达人
  
- 贡献度
- 51
- 金元
- 18622
- 积分
- 2066
- 精华
- 0
- 注册时间
- 2011-2-15

|
using System;
using TUNING;
using UnityEngine;
// Token: 0x020009D7 RID: 2519
public class DesalinatorConfig : IBuildingConfig
{
// Token: 0x06002F32 RID: 12082 RVA: 0x0011D238 File Offset: 0x0011B438
public override BuildingDef CreateBuildingDef()
{
string id = "Desalinator";
int width = 4;
int height = 3;
string anim = "desalinator_kanim";
int hitpoints = 30;
float construction_time = 10f;
float[] tier = BUILDINGS.CONSTRUCTION_MASS_KG.TIER3;
string[] raw_METALS = MATERIALS.RAW_METALS;
float melting_point = 1600f;
BuildLocationRule build_location_rule = BuildLocationRule.OnFloor;
EffectorValues tier2 = NOISE_POLLUTION.NOISY.TIER1;
BuildingDef buildingDef = BuildingTemplates.CreateBuildingDef(id, width, height, anim, hitpoints, construction_time, tier, raw_METALS, melting_point, build_location_rule, BUILDINGS.DECOR.PENALTY.TIER0, tier2, 0.2f);
buildingDef.RequiresPowerInput = true;
buildingDef.EnergyConsumptionWhenActive = 480f;
buildingDef.SelfHeatKilowattsWhenActive = 8f;
buildingDef.ExhaustKilowattsWhenActive = 0f;
buildingDef.InputConduitType = ConduitType.Liquid;
buildingDef.OutputConduitType = ConduitType.Liquid;
buildingDef.Floodable = false;
buildingDef.ViewMode = OverlayModes.LiquidConduits.ID;
buildingDef.AudioCategory = "Metal";
buildingDef.UtilityInputOffset = new CellOffset(-1, 0);
buildingDef.UtilityOutputOffset = new CellOffset(0, 0);
buildingDef.PermittedRotations = PermittedRotations.FlipH;
return buildingDef;
}
// Token: 0x06002F33 RID: 12083 RVA: 0x0011D2F4 File Offset: 0x0011B4F4
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
{
go.GetComponent<KPrefabID>().AddTag(RoomConstraints.ConstraintTags.IndustrialMachinery, false);
Storage storage = go.AddOrGet<Storage>();
storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
storage.showInUI = true;
go.AddOrGet<Desalinator>().maxSalt = 10000f;
var maxmass=10f;
if(storage.capacityKG<maxmass)
{
maxmass=storage.capacityKG;
}
ElementConverter elementConverter = go.AddComponent<ElementConverter>();
elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
{
new ElementConverter.ConsumedElement(new Tag("SaltWater"), maxmass)
};
elementConverter.outputElements = new ElementConverter.OutputElement[]
{
new ElementConverter.OutputElement(maxmass*0.93f, SimHashes.Water, 0f, false, true, 0f, 0.5f, 0.75f, byte.MaxValue, 0),
new ElementConverter.OutputElement(maxmass*0.07f, SimHashes.Salt, 0f, false, true, 0f, 0.5f, 0.25f, byte.MaxValue, 0)
};
ElementConverter elementConverter2 = go.AddComponent<ElementConverter>();
elementConverter2.consumedElements = new ElementConverter.ConsumedElement[]
{
new ElementConverter.ConsumedElement(new Tag("Brine"), maxmass)
};
elementConverter2.outputElements = new ElementConverter.OutputElement[]
{
new ElementConverter.OutputElement(maxmass*0.7f, SimHashes.Water, 0f, false, true, 0f, 0.5f, 0.75f, byte.MaxValue, 0),
new ElementConverter.OutputElement(maxmass*0.3f, SimHashes.Salt, 0f, false, true, 0f, 0.5f, 0.25f, byte.MaxValue, 0)
};
DesalinatorWorkableEmpty desalinatorWorkableEmpty = go.AddOrGet<DesalinatorWorkableEmpty>();
desalinatorWorkableEmpty.workTime = 0.1f;
desalinatorWorkableEmpty.workLayer = Grid.SceneLayer.BuildingFront;
ElementDropper elementDropper = go.AddComponent<ElementDropper>();
elementDropper.emitMass = 800f;
elementDropper.emitTag = new Tag("Salt");
elementDropper.emitOffset = new Vector3(0f, 1f, 0f);
ConduitConsumer conduitConsumer = go.AddOrGet<ConduitConsumer>();
conduitConsumer.conduitType = ConduitType.Liquid;
conduitConsumer.consumptionRate = 100f;
conduitConsumer.capacityKG = 200f;
conduitConsumer.capacityTag = GameTags.AnyWater;
conduitConsumer.forceAlwaysSatisfied = true;
conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Store;
ConduitDispenser conduitDispenser = go.AddOrGet<ConduitDispenser>();
conduitDispenser.conduitType = ConduitType.Liquid;
conduitDispenser.invertElementFilter = true;
conduitDispenser.elementFilter = new SimHashes[]
{
SimHashes.SaltWater,
SimHashes.Brine
};
Prioritizable.AddRef(go);
}
// Token: 0x06002F34 RID: 12084 RVA: 0x0001C8BB File Offset: 0x0001AABB
public override void DoPostConfigurePreview(BuildingDef def, GameObject go)
{
base.DoPostConfigurePreview(def, go);
}
// Token: 0x06002F35 RID: 12085 RVA: 0x0001C8C5 File Offset: 0x0001AAC5
public override void DoPostConfigureUnderConstruction(GameObject go)
{
base.DoPostConfigureUnderConstruction(go);
}
// Token: 0x06002F36 RID: 12086 RVA: 0x00009769 File Offset: 0x00007969
public override void DoPostConfigureComplete(GameObject go)
{
go.AddOrGetDef<PoweredActiveController.Def>().showWorkingStatus = true;
}
// Token: 0x04001FCD RID: 8141
public const string ID = "Desalinator";
// Token: 0x04001FCE RID: 8142
private const ConduitType CONDUIT_TYPE = ConduitType.Liquid;
// Token: 0x04001FCF RID: 8143
private const float INPUT_RATE = 5f;
// Token: 0x04001FD0 RID: 8144
private const float SALT_WATER_TO_SALT_OUTPUT_RATE = 0.35f;
// Token: 0x04001FD1 RID: 8145
private const float SALT_WATER_TO_CLEAN_WATER_OUTPUT_RATE = 4.65f;
// Token: 0x04001FD2 RID: 8146
private const float BRINE_TO_SALT_OUTPUT_RATE = 1.5f;
// Token: 0x04001FD3 RID: 8147
private const float BRINE_TO_CLEAN_WATER_OUTPUT_RATE = 3.5f;
}
这个不能用了
|
|