void WantstoDrillChanged() { if ((Enabled || WantsToDrill) && IsFunctional && ResourceSink!=null && ResourceSink.IsPowered) { // starts the animation m_drillBase.Drill(collectOre: false, performCutout: false); NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME; } else { NeedsUpdate &= ~MyEntityUpdateEnum.EACH_10TH_FRAME; SetupDrillFrameCountdown(); m_drillBase.StopDrill(); } }
void Receiver_IsPoweredChanged() { UpdateIsWorking(); if ((Enabled || m_wantsToDrill) && IsFunctional && PowerReceiver.IsPowered) { // starts the animation m_drillBase.Drill(collectOre: false, performCutout: false); NeedsUpdate |= MyEntityUpdateEnum.EACH_10TH_FRAME; } else { NeedsUpdate &= ~MyEntityUpdateEnum.EACH_10TH_FRAME; SetupDrillFrameCountdown(); m_drillBase.StopDrill(); } }
void WantstoDrillChanged() { ResourceSink.Update(); if ((Enabled || WantsToDrill) && IsFunctional && ResourceSink != null && ResourceSink.IsPowered) { // starts the animation if (!m_drillBase.IsDrilling) { m_drillBase.Drill(false, false); } NeedsUpdate |= MyEntityUpdateEnum.EACH_FRAME | MyEntityUpdateEnum.EACH_10TH_FRAME; } else { NeedsUpdate &= ~MyEntityUpdateEnum.EACH_10TH_FRAME; SetupDrillFrameCountdown(); m_drillBase.StopDrill(); } }
private bool DoDrillAction(bool collectOre) { m_tryingToDrill = true; SinkComp.Update(); if (!SinkComp.IsPowered) { return(false); } m_lastTimeDrilled = MySandboxGame.TotalGamePlayTimeInMilliseconds; m_drillBase.Drill(collectOre); m_spikeLastUpdateTime = MySandboxGame.TotalGamePlayTimeInMilliseconds; return(true); }
private bool DoDrillAction(bool collectOre) { m_tryingToDrill = true; SinkComp.Update(); if (!SinkComp.IsPoweredByType(MyResourceDistributorComponent.ElectricityId)) { return(false); } m_lastTimeDrilled = MySandboxGame.TotalGamePlayTimeInMilliseconds; m_drillBase.Drill(collectOre, assignDamagedMaterial: true, speedMultiplier: m_speedMultiplier); m_spikeLastUpdateTime = MySandboxGame.TotalGamePlayTimeInMilliseconds; return(true); }