Ejemplo n.º 1
0
        public void Initialize(int radius = 2, int fuelperhit = 15, int secondsperblock = 45) // "seconds" per block isnt quite right anymore, as theres a 50% chance for a free extra hit every second, so 45 equals ~30 seconds
        {
            base.Initialize();
            if (this.status == null)
            {
                this.status = this.Parent.GetComponent <StatusComponent>().CreateStatusElement();
            }
            enabled = true;
            status.SetStatusMessage(this.Enabled, Localizer.DoStr("Drill OK!"), Localizer.DoStr("Mining has not started yet"));
            Resetpos();

            hitsperformed   = 0;
            hitsneeded      = secondsperblock;
            fuelconsumption = fuelperhit;
            R = radius;
        }
Ejemplo n.º 2
0
 public void Initialize(Type blockitem, int grid = 1)
 {
     this.status      = this.Parent.GetComponent <StatusComponent>().CreateStatusElement();
     positionstocheck = World.BlockBelow(this.Parent.Position3i).XZFullNeighborsAndSelf;
     neededBlockItem  = Item.Get(blockitem) as BlockItem;
     this.ismet       = CheckGround();
     status.SetStatusMessage(this.Enabled, "Ground Requirements met", "Ground Requirements not met!");
 }
Ejemplo n.º 3
0
 public void Initialize(Type blockitem, int grid = 1) //"grid" isnt used yet, it is planned to make it possible to require more than a 3x3 grind (or also only a single block)
 {
     status           = Parent.GetComponent <StatusComponent>().CreateStatusElement();
     positionstocheck = World.BlockBelow(Parent.Position3i).XZFullNeighborsAndSelf;
     neededBlockItem  = Item.Get(blockitem) as BlockItem;
     ismet            = CheckGround();
     status.SetStatusMessage(Enabled, "Ground Requirements met", "Ground Requirements not met!");
 }
Ejemplo n.º 4
0
 public override void Tick()
 {
     checkinterval++;
     if (checkinterval >= 100)
     {
         checkinterval = 0;
         if (CheckGround() != ismet)
         {
             ismet = !ismet;
             status.SetStatusMessage(this.Enabled, "Ground Requirements met", "Ground Requirements not met!");
             //ChatManager.ServerMessageToAllAlreadyLocalized(this.Enabled ? "Ground Requirements met" : "Ground Requirements not met!", false);
         }
     }
 }