Exemple #1
0
        private static void Chipz(int i, float f, ContO conto, Mad mad)
        {
            if (Math.Abs(f) > 100.0F)
            {
                if (f > 100.0F)
                {
                    f -= 100.0F;
                }
                if (f < -100.0F)
                {
                    f += 100.0F;
                }
                for (var i71 = 0; i71 < conto.Npl; i71++)
                {
                    var f72 = 0.0F;
                    for (var i73 = 0; i73 < conto.P[i71].N; i73++)
                    {
                        if (conto.P[i71].Wz == 0 &&
                            Py(conto.Keyx[i], conto.P[i71].Ox[i73], conto.Keyz[i], conto.P[i71].Oz[i73]) <
                            mad.Stat.Clrad)
                        {
                            f72 = f / 20.0F * Medium.Random();
                        }
                    }

                    if (f72 != 0.0F && Math.Abs(f72) >= 1.0F)
                    {
                        conto.P[i71].Chip  = 1;
                        conto.P[i71].Ctmag = f72;
                    }
                }
            }
        }
Exemple #2
0
        private static void Chipx(int i, float f, ContO conto, Mad mad)
        {
            if (Math.Abs(f) > 100.0F)
            {
                if (f > 100.0F)
                {
                    f -= 100.0F;
                }
                if (f < -100.0F)
                {
                    f += 100.0F;
                }
                for (var i68 = 0; i68 < conto.Npl; i68++)
                {
                    var f69 = 0.0F;
                    for (var i70 = 0; i70 < conto.P[i68].N; i70++)
                    {
                        if (conto.P[i68].Wz == 0 &&
                            Py(conto.Keyx[i], conto.P[i68].Ox[i70], conto.Keyz[i], conto.P[i68].Oz[i70]) <
                            mad.Stat.Clrad)
                        {
                            f69 = f / 20.0F * Medium.Random();
                        }
                    }

                    if (f69 == 0.0F || !(Math.Abs(f69) >= 1.0F))
                    {
                        continue;
                    }

                    conto.P[i68].Chip  = 1;
                    conto.P[i68].Ctmag = f69;
                }
            }
        }
Exemple #3
0
        private static void Regz(int i, float f, ContO conto, Mad mad)
        {
            if (Math.Abs(f) > 100.0F)
            {
                if (f > 100.0F)
                {
                    f -= 100.0F;
                }
                if (f < -100.0F)
                {
                    f += 100.0F;
                }
                for (var i65 = 0; i65 < conto.Npl; i65++)
                {
                    var f66 = 0.0F;
                    for (var i67 = 0; i67 < conto.P[i65].N; i67++)
                    {
                        if (conto.P[i65].Wz == 0 &&
                            Py(conto.Keyx[i], conto.P[i65].Ox[i67], conto.Keyz[i], conto.P[i65].Oz[i67]) <
                            mad.Stat.Clrad)
                        {
                            f66 = f / 20.0F * Medium.Random();
                            conto.P[i65].Oz[i67] += (int)(f66 * Medium.Cos(conto.Xz) * Medium.Cos(conto.Zy));
                            conto.P[i65].Ox[i67] += (int)(f66 * Medium.Sin(conto.Xz) * Medium.Cos(conto.Xy));
                        }
                    }

                    if (f66 != 0.0F)
                    {
                        if (Math.Abs(f66) >= 1.0F)
                        {
                            conto.P[i65].Chip  = 1;
                            conto.P[i65].Ctmag = f66;
                        }
                        if (!conto.P[i65].Nocol && conto.P[i65].Glass != 1)
                        {
                            if (conto.P[i65].Bfase > 20 && conto.P[i65].HSB[1] > 0.2)
                            {
                                conto.P[i65].HSB[1] = 0.2F;
                            }
                            if (conto.P[i65].Bfase > 30)
                            {
                                if (conto.P[i65].HSB[2] < 0.5)
                                {
                                    conto.P[i65].HSB[2] = 0.5F;
                                }
                                if (conto.P[i65].HSB[1] > 0.1)
                                {
                                    conto.P[i65].HSB[1] = 0.1F;
                                }
                            }
                            if (conto.P[i65].Bfase > 40)
                            {
                                conto.P[i65].HSB[1] = 0.05F;
                            }
                            if (conto.P[i65].Bfase > 50)
                            {
                                if (conto.P[i65].HSB[2] > 0.8)
                                {
                                    conto.P[i65].HSB[2] = 0.8F;
                                }
                                conto.P[i65].HSB[0] = 0.075F;
                                conto.P[i65].HSB[1] = 0.05F;
                            }
                            if (conto.P[i65].Bfase > 60)
                            {
                                conto.P[i65].HSB[0] = 0.05F;
                            }
                            conto.P[i65].Bfase += (int)Math.Abs(f66);
                            //new Color(conto.p[i65].c[0], conto.p[i65].c[1], conto.p[i65].c[2]);
                            var color = Color.GetHSBColor(conto.P[i65].HSB[0], conto.P[i65].HSB[1],
                                                          conto.P[i65].HSB[2]);
                            conto.P[i65].C[0] = color.R;
                            conto.P[i65].C[1] = color.G;
                            conto.P[i65].C[2] = color.B;
                        }
                        if (conto.P[i65].Glass == 1)
                        {
                            conto.P[i65].Gr += (int)Math.Abs(f66 * 1.5);
                        }
                    }
                }
            }
        }
Exemple #4
0
        private static void Regy(int i, float f, bool abool, ContO conto, Mad mad)
        {
            if (f > 100.0F)
            {
                f -= 100.0F;
                var i50 = 0;
                var i51 = 0;
                var i52 = conto.Zy;
                var i53 = conto.Xy;
                for (/**/; i52 < 360; i52 += 360)
                {
                }
                for (/**/; i52 > 360; i52 -= 360)
                {
                }
                if (i52 < 210 && i52 > 150)
                {
                    i50 = -1;
                }
                if (i52 > 330 || i52 < 30)
                {
                    i50 = 1;
                }
                for (/**/; i53 < 360; i53 += 360)
                {
                }
                for (/**/; i53 > 360; i53 -= 360)
                {
                }
                if (i53 < 210 && i53 > 150)
                {
                    i51 = -1;
                }
                if (i53 > 330 || i53 < 30)
                {
                    i51 = 1;
                }
                if (i51 * i50 == 0 || abool)
                {
                    for (var i54 = 0; i54 < conto.Npl; i54++)
                    {
                        var f55 = 0.0F;
                        for (var i56 = 0; i56 < conto.P[i54].N; i56++)
                        {
                            if (conto.P[i54].Wz == 0 &&
                                Py(conto.Keyx[i], conto.P[i54].Ox[i56], conto.Keyz[i], conto.P[i54].Oz[i56]) <
                                mad.Stat.Clrad)
                            {
                                f55 = f / 20.0F * Medium.Random();
                                conto.P[i54].Oz[i56] += (int)(f55 * Medium.Sin(i52));
                                conto.P[i54].Ox[i56] -= (int)(f55 * Medium.Sin(i53));
                            }
                        }

                        if (f55 != 0.0F)
                        {
                            if (Math.Abs(f55) >= 1.0F)
                            {
                                conto.P[i54].Chip  = 1;
                                conto.P[i54].Ctmag = f55;
                            }
                            if (!conto.P[i54].Nocol && conto.P[i54].Glass != 1)
                            {
                                if (conto.P[i54].Bfase > 20 && conto.P[i54].HSB[1] > 0.2)
                                {
                                    conto.P[i54].HSB[1] = 0.2F;
                                }
                                if (conto.P[i54].Bfase > 30)
                                {
                                    if (conto.P[i54].HSB[2] < 0.5)
                                    {
                                        conto.P[i54].HSB[2] = 0.5F;
                                    }
                                    if (conto.P[i54].HSB[1] > 0.1)
                                    {
                                        conto.P[i54].HSB[1] = 0.1F;
                                    }
                                }
                                if (conto.P[i54].Bfase > 40)
                                {
                                    conto.P[i54].HSB[1] = 0.05F;
                                }
                                if (conto.P[i54].Bfase > 50)
                                {
                                    if (conto.P[i54].HSB[2] > 0.8)
                                    {
                                        conto.P[i54].HSB[2] = 0.8F;
                                    }
                                    conto.P[i54].HSB[0] = 0.075F;
                                    conto.P[i54].HSB[1] = 0.05F;
                                }
                                if (conto.P[i54].Bfase > 60)
                                {
                                    conto.P[i54].HSB[0] = 0.05F;
                                }
                                conto.P[i54].Bfase += (int)f55;
                                new Color(conto.P[i54].C[0], conto.P[i54].C[1], conto.P[i54].C[2]);
                                var color = Color.GetHSBColor(conto.P[i54].HSB[0], conto.P[i54].HSB[1],
                                                              conto.P[i54].HSB[2]);
                                conto.P[i54].C[0] = color.R;
                                conto.P[i54].C[1] = color.G;
                                conto.P[i54].C[2] = color.B;
                            }
                            if (conto.P[i54].Glass == 1)
                            {
                                conto.P[i54].Gr += (int)Math.Abs(f55 * 1.5);
                            }
                        }
                    }
                }
                if (i51 * i50 == -1)
                {
                    var i57 = 0;
                    var i58 = 1;
                    for (var i59 = 0; i59 < conto.Npl; i59++)
                    {
                        var f60 = 0.0F;
                        for (var i61 = 0; i61 < conto.P[i59].N; i61++)
                        {
                            if (conto.P[i59].Wz == 0)
                            {
                                f60 = f / 15.0F * Medium.Random();
                                if ((Math.Abs(conto.P[i59].Oy[i61] - mad.Stat.Flipy - Squash[0, mad.Im]) <
                                     mad.Stat.Msquash * 3 ||
                                     conto.P[i59].Oy[i61] < mad.Stat.Flipy + Squash[0, mad.Im]) &&
                                    Squash[0, mad.Im] < mad.Stat.Msquash)
                                {
                                    conto.P[i59].Oy[i61] += (int)f60;
                                    i57 += (int)f60;
                                    i58++;
                                }
                            }
                        }

                        if (conto.P[i59].Glass == 1)
                        {
                            conto.P[i59].Gr += 5;
                        }
                        else if (f60 != 0.0F)
                        {
                            conto.P[i59].Bfase += (int)f60;
                        }
                        if (Math.Abs(f60) >= 1.0F)
                        {
                            conto.P[i59].Chip  = 1;
                            conto.P[i59].Ctmag = f60;
                        }
                    }
                    Squash[0, mad.Im] += i57 / i58;
                }
            }
        }