Terraria.World.Generation.Shapes.Slime.Perform C# (CSharp) Method

Perform() public method

public Perform ( System.Point origin, GenAction action ) : bool
origin System.Point
action GenAction
return bool
            public override bool Perform(Point origin, GenAction action)
            {
                float num1 = (float)this._radius;
                int num2 = (this._radius + 1) * (this._radius + 1);
                for (int y = origin.Y - (int)((double)num1 * (double)this._yScale); y <= origin.Y; ++y)
                {
                    float num3 = (float)(y - origin.Y) / this._yScale;
                    int num4 = (int)Math.Min((float)this._radius * this._xScale, this._xScale * (float)Math.Sqrt((double)num2 - (double)num3 * (double)num3));
                    for (int x = origin.X - num4; x <= origin.X + num4; ++x)
                    {
                        if (!this.UnitApply(action, origin, x, y) && this._quitOnFail)
                            return false;
                    }
                }
                for (int y = origin.Y + 1; y <= origin.Y + (int)((double)num1 * (double)this._yScale * 0.5) - 1; ++y)
                {
                    float num3 = (float)(y - origin.Y) * (2f / this._yScale);
                    int num4 = (int)Math.Min((float)this._radius * this._xScale, this._xScale * (float)Math.Sqrt((double)num2 - (double)num3 * (double)num3));
                    for (int x = origin.X - num4; x <= origin.X + num4; ++x)
                    {
                        if (!this.UnitApply(action, origin, x, y) && this._quitOnFail)
                            return false;
                    }
                }
                return true;
            }
        }
Shapes.Slime