Upload from upload_mods.ps1
This commit is contained in:
46
Scripts/Blocks/BlockFeedRebirth.cs
Normal file
46
Scripts/Blocks/BlockFeedRebirth.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user