大佬们深钻井范围怎么改啊?
<specialDisplayRadius>2.6</specialDisplayRadius> <!-- 21 closest cells, must be in sync with CompDeepDrill -->using System;
using System.Collections.Generic;
using UnityEngine;
using Verse;
namespace RimWorld
{
// Token: 0x02001EBB RID: 7867
public class CompDeepDrill : ThingComp
{
// Token: 0x17001A6F RID: 6767
// (get) Token: 0x0600ABE1 RID: 44001 RVA: 0x000706F4 File Offset: 0x0006E8F4
[Obsolete("Use WorkPerPortionBase constant directly."
public static float WorkPerPortionCurrentDifficulty
{
get
{
return 10000f;
}
}
// Token: 0x17001A70 RID: 6768
// (get) Token: 0x0600ABE2 RID: 44002 RVA: 0x000706FB File Offset: 0x0006E8FB
public float ProgressToNextPortionPercent
{
get
{
return this.portionProgress / 10000f;
}
}
// Token: 0x0600ABE3 RID: 44003 RVA: 0x0007070A File Offset: 0x0006E90A
public override void PostSpawnSetup(bool respawningAfterLoad)
{
this.powerComp = this.parent.TryGetComp<CompPowerTrader>();
}
// Token: 0x0600ABE4 RID: 44004 RVA: 0x0007071D File Offset: 0x0006E91D
public override void PostExposeData()
{
Scribe_Values.Look<float>(ref this.portionProgress, "portionProgress", 0f, false);
Scribe_Values.Look<float>(ref this.portionYieldPct, "portionYieldPct", 0f, false);
Scribe_Values.Look<int>(ref this.lastUsedTick, "lastUsedTick", 0, false);
}
// Token: 0x0600ABE5 RID: 44005 RVA: 0x00328AB0 File Offset: 0x00326CB0
public void DrillWorkDone(Pawn driller)
{
float statValue = driller.GetStatValue(StatDefOf.DeepDrillingSpeed, true);
this.portionProgress += statValue;
this.portionYieldPct += statValue * driller.GetStatValue(StatDefOf.MiningYield, true) / 10000f;
this.lastUsedTick = Find.TickManager.TicksGame;
if (this.portionProgress > 10000f)
{
this.TryProducePortion(this.portionYieldPct, driller);
this.portionProgress = 0f;
this.portionYieldPct = 0f;
}
}
// Token: 0x0600ABE6 RID: 44006 RVA: 0x0007075D File Offset: 0x0006E95D
public override void PostDeSpawn(Map map)
{
this.portionProgress = 0f;
this.portionYieldPct = 0f;
this.lastUsedTick = -99999;
}
// Token: 0x0600ABE7 RID: 44007 RVA: 0x00328B3C File Offset: 0x00326D3C
private void TryProducePortion(float yieldPct, Pawn driller = null)
{
ThingDef thingDef;
int num;
IntVec3 intVec;
bool nextResource = this.GetNextResource(out thingDef, out num, out intVec);
if (thingDef == null)
{
return;
}
int num2 = Mathf.Min(num, thingDef.deepCountPerPortion);
if (nextResource)
{
this.parent.Map.deepResourceGrid.SetAt(intVec, thingDef, num - num2);
}
int stackCount = Mathf.Max(1, GenMath.RoundRandom((float)num2 * yieldPct));
Thing thing = ThingMaker.MakeThing(thingDef, null);
thing.stackCount = stackCount;
GenPlace.TryPlaceThing(thing, this.parent.InteractionCell, this.parent.Map, ThingPlaceMode.Near, null, (IntVec3 p) => p != this.parent.Position && p != this.parent.InteractionCell, default(Rot4));
if (driller != null)
{
Find.HistoryEventsManager.RecordEvent(new HistoryEvent(HistoryEventDefOf.Mined, driller.Named(HistoryEventArgsNames.Doer)), true);
}
if (nextResource && !this.ValuableResourcesPresent())
{
if (DeepDrillUtility.GetBaseResource(this.parent.Map, this.parent.Position) == null)
{
Messages.Message("DeepDrillExhaustedNoFallback".Translate(), this.parent, MessageTypeDefOf.TaskCompletion, true);
return;
}
Messages.Message("DeepDrillExhausted".Translate(Find.ActiveLanguageWorker.Pluralize(DeepDrillUtility.GetBaseResource(this.parent.Map, this.parent.Position).label, -1)), this.parent, MessageTypeDefOf.TaskCompletion, true);
for (int i = 0; i < 21; i++)
{
IntVec3 c = intVec + GenRadial.RadialPattern[i];
if (c.InBounds(this.parent.Map))
{
ThingWithComps firstThingWithComp = c.GetFirstThingWithComp(this.parent.Map);
if (firstThingWithComp != null && !firstThingWithComp.GetComp<CompDeepDrill>().ValuableResourcesPresent())
{
firstThingWithComp.SetForbidden(true, true);
}
}
}
}
}
// Token: 0x0600ABE8 RID: 44008 RVA: 0x00070780 File Offset: 0x0006E980
private bool GetNextResource(out ThingDef resDef, out int countPresent, out IntVec3 cell)
{
return DeepDrillUtility.GetNextResource(this.parent.Position, this.parent.Map, out resDef, out countPresent, out cell);
}
// Token: 0x0600ABE9 RID: 44009 RVA: 0x000707A0 File Offset: 0x0006E9A0
public bool CanDrillNow()
{
return (this.powerComp == null || this.powerComp.PowerOn) && (DeepDrillUtility.GetBaseResource(this.parent.Map, this.parent.Position) != null || this.ValuableResourcesPresent());
}
// Token: 0x0600ABEA RID: 44010 RVA: 0x00328D10 File Offset: 0x00326F10
public bool ValuableResourcesPresent()
{
ThingDef thingDef;
int num;
IntVec3 intVec;
return this.GetNextResource(out thingDef, out num, out intVec);
}
// Token: 0x0600ABEB RID: 44011 RVA: 0x000707DE File Offset: 0x0006E9DE
public bool UsedLastTick()
{
return this.lastUsedTick >= Find.TickManager.TicksGame - 1;
}
// Token: 0x0600ABEC RID: 44012 RVA: 0x000707F7 File Offset: 0x0006E9F7
public override IEnumerable<Gizmo> CompGetGizmosExtra()
{
foreach (Gizmo gizmo in base.CompGetGizmosExtra())
{
yield return gizmo;
}
IEnumerator<Gizmo> enumerator = null;
if (Prefs.DevMode)
{
yield return new Command_Action
{
defaultLabel = "Debug: Produce portion (100% yield)",
action = delegate()
{
this.TryProducePortion(1f, null);
}
};
}
yield break;
yield break;
}
// Token: 0x0600ABED RID: 44013 RVA: 0x00328D2C File Offset: 0x00326F2C
public override string CompInspectStringExtra()
{
if (!this.parent.Spawned)
{
return null;
}
ThingDef thingDef;
int num;
IntVec3 intVec;
this.GetNextResource(out thingDef, out num, out intVec);
if (thingDef == null)
{
return "DeepDrillNoResources".Translate();
}
return "ResourceBelow".Translate() + ": " + thingDef.LabelCap + "\n" + "ProgressToNextPortion".Translate() + ": " + this.ProgressToNextPortionPercent.ToStringPercent("F0");
}
// Token: 0x04006F47 RID: 28487
private CompPowerTrader powerComp;
// Token: 0x04006F48 RID: 28488
private float portionProgress;
// Token: 0x04006F49 RID: 28489
private float portionYieldPct;
// Token: 0x04006F4A RID: 28490
private int lastUsedTick = -99999;
// Token: 0x04006F4B RID: 28491
private const float WorkPerPortionBase = 10000f;
}
}
布吉岛,可考虑找找mod
页:
[1]