Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/Blocks/BlockFeedRebirth.cs
Nathaniel Cosford 062dfab2cd Patched
2025-05-30 01:04:40 +09:30

46 lines
1.6 KiB
C#

using System.Collections.Generic;
using System.Globalization;
public class BlockFeedRebirth : BlockLoot
{
protected float updateRate = 5;
public string contentName = "";
public string strNestResource = "FuriousRamsayWoodStick";
public int numNestResourceQuantity = 5;
private List<EntityAlive> entsInRange;
public float maxRange = 10;
public System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
public override void Init()
{
base.Init();
if (this.Properties.Values.ContainsKey("UpdateRate"))
{
this.updateRate = StringParsers.ParseFloat(this.Properties.Values["UpdateRate"], 0, -1, NumberStyles.Any);
}
if (this.Properties.Values.ContainsKey("MaxEntityRange"))
{
this.maxRange = StringParsers.ParseFloat(this.Properties.Values["MaxEntityRange"], 0, -1, NumberStyles.Any);
}
if (this.Properties.Values.ContainsKey("NestResource"))
{
this.strNestResource = this.Properties.Values["NestResource"];
}
if (this.Properties.Values.ContainsKey("NestResourceQuantity"))
{
this.numNestResourceQuantity = (int)StringParsers.ParseFloat(this.Properties.Values["NestResourceQuantity"], 0, -1, NumberStyles.Any);
}
}
private byte convertRotation(BlockValue _oldBV, BlockValue _newBV)
{
return _oldBV.rotation;
}
public override ulong GetTickRate()
{
//Log.Out("BlockFeedRebirth-GetTickRate this.GetTickRate(): " + (ulong)(this.updateRate * 20f));
return (ulong)(this.updateRate * 20f);
}
}