public override void OnItemTransfer(Thing item, BeltComponent other) { if (this.IsReceiver()) { return; } int minPuffs = (A2BResearch.TeleporterHeat.IsResearched() ? 1 : 4); int maxPuffs = (A2BResearch.TeleporterHeat.IsResearched() ? 2 : 6); float heat = PowerComponent.PowerOutput / basePowerConsumption * DegreesPerDistance; Room room = GridsUtility.GetRoom(parent.Position); if (room != null) { room.PushHeat(heat); } for (int i = 0; i < Rand.RangeInclusive(minPuffs, maxPuffs); ++i) { MoteThrower.ThrowAirPuffUp(parent.DrawPos); } room = GridsUtility.GetRoom(ReceiverPos); if (room != null) { room.PushHeat(heat); } for (int i = 0; i < Rand.RangeInclusive(minPuffs, maxPuffs); ++i) { MoteThrower.ThrowAirPuffUp(Gen.TrueCenter(ReceiverPos, parent.Rotation, new IntVec2(2, 1), 0.5f)); } }
private void SteamTick() { if (sprayTicksLeft > 0) { sprayTicksLeft--; if (Rand.Value < 0.8f) { MoteThrower.ThrowAirPuffUp(this.TrueCenter()); } if (sprayTicksLeft <= 0) { sprayTicksLeft = Rand.RangeInclusive(1, 10); } } else { sprayTicksLeft = Rand.RangeInclusive(5, 10); } }
public override void CompTick() { if ((Find.TickManager.TicksGame + GetHashCode()) % (60 * 5) == 0) { OnOccasionalTick(); } if (BeltPhase == Phase.Frozen && Rand.Range(0.0f, 1.0f) < 0.05) { MoteThrower.ThrowAirPuffUp(parent.DrawPos); } if (BeltPhase == Phase.Jammed && Rand.Range(0.0f, 1.0f) < 0.05) { MoteThrower.ThrowMicroSparks(parent.DrawPos); } DoBeltTick(); ItemContainer.Tick(); }