Exemplo n.º 1
0
        public override void Tick()
        {
            PowerTrader.powerOutputInt = -GetCurrentPowerDraw();
            base.Tick();

            if (PowerTrader.PowerOn && IsForgeRunning)
            {
                SustainArc();
            }
            else if (arc != null)
            {
                arc.Destroy();
                arc = null;
            }
        }
Exemplo n.º 2
0
        protected virtual void SustainArc()
        {
            if (arc == null)
            {
                arc = new BezierElectricArc(20);
                arc.Spawn(Map);
            }

            var basePos = DrawPos.WorldToFlat();

            arc.P0        = basePos + new Vector2(0, 1.479f);
            arc.P3        = basePos + new Vector2(ForgeCellIndex == 0 ? 1.524f : -1.524f, 1.633f);
            arc.P1        = Vector2.Lerp(arc.P0, arc.P3, 0.3f) + new Vector2(0f, 0.65f);
            arc.P2        = Vector2.Lerp(arc.P0, arc.P3, 0.7f) + new Vector2(0f, 0.65f);
            arc.Amplitude = new Vector2(0, 0.28f);
        }