Example #1
0
        public override object Clone()
        {
            BaseObject_CS b = (BaseObject_CS)base.Clone();

            b.EventsExecutionList = new List <Execution>();
            b.EventGroupList      = new List <EventGroup>();
            this.EventGroupList.ForEach((Action <EventGroup>)(x => b.EventGroupList.Add((EventGroup)x.Clone())));
            return((object)b);
        }
Example #2
0
 public void Update(BaseObject_CS CS_Bullet)
 {
     float[] conditions = new float[3];
     float[] numArray   = new float[21];
     conditions[0] = CS_Bullet.Time;
     conditions[1] = CS_Bullet.CS_Position.X;
     conditions[2] = CS_Bullet.CS_Position.Y;
     numArray[0]   = CS_Bullet.LifeTime;
     numArray[1]   = CS_Bullet.Type;
     numArray[2]   = CS_Bullet.ScaleWidth;
     numArray[3]   = CS_Bullet.ScaleLength;
     numArray[4]   = CS_Bullet.ColorValue.R;
     numArray[5]   = CS_Bullet.ColorValue.G;
     numArray[6]   = CS_Bullet.ColorValue.B;
     numArray[7]   = CS_Bullet.TransparentValueF;
     numArray[8]   = (float)CS_Bullet.AngleDegree;
     numArray[9]   = CS_Bullet.Velocity;
     numArray[10]  = (float)CS_Bullet.DirectionDegree;
     numArray[11]  = CS_Bullet.AccelerateCS;
     numArray[12]  = (float)CS_Bullet.AccDirection;
     numArray[13]  = CS_Bullet.ScaleX;
     numArray[14]  = CS_Bullet.ScaleY;
     numArray[15]  = 0.0f;
     numArray[16]  = 0.0f;
     numArray[17]  = 0.0f;
     numArray[18]  = 0.0f;
     numArray[19]  = 0.0f;
     numArray[20]  = 0.0f;
     if (t < 1)
     {
         t = 1;
     }
     if ((CS_Bullet.Time + 1) % t == 0)
     {
         ++loop;
     }
     foreach (Event ev in EventList)
     {
         if (ev.special2 == 1)
         {
             conditions[0] = CS_Bullet.StageData.TimeMain;
         }
         if (CheckCondition(conditions, ev))
         {
             if (ev.special == 4 && (ev.changevalue == 10 || ev.changevalue == 12))
             {
                 Event  @event           = ev;
                 PointF originalPosition = CS_Bullet.MyPlane.OriginalPosition;
                 double x1 = originalPosition.X;
                 originalPosition = CS_Bullet.MyPlane.OriginalPosition;
                 double y1 = originalPosition.Y;
                 originalPosition = CS_Bullet.OriginalPosition;
                 double x2  = originalPosition.X;
                 double y2  = CS_Bullet.OriginalPosition.Y;
                 double num = Twopointangle((float)x1, (float)y1, (float)x2, (float)y2) * 180.0 / 3.14159274101257;
                 @event.res = (float)num;
             }
             Execution execution = new Execution();
             if (!ev.noloop)
             {
                 if (ev.time > 0)
                 {
                     --ev.time;
                     if (ev.time == 0)
                     {
                         ev.noloop = true;
                     }
                 }
                 execution.change      = ev.change;
                 execution.changetype  = ev.changetype;
                 execution.changevalue = ev.changevalue;
                 execution.value       = ev.rand != 0.0 ? ev.res + ev.rand * (float)CS_Bullet.StageData.Ran.NextPMDouble() : ev.res;
                 execution.region      = numArray[ev.changename].ToString();
                 execution.time        = ev.times;
                 execution.ctime       = execution.time;
                 CS_Bullet.EventsExecutionList.Add(execution);
             }
         }
     }
 }
Example #3
0
        public void Update(BaseObject_CS objects)
        {
            switch (changevalue)
            {
            case 0:
                objects.LifeTime = ChangeValue(objects.LifeTime);
                break;

            case 1:
                objects.Type = ChangeValue(objects.Type);
                break;

            case 2:
                objects.ScaleWidth = ChangeValue(objects.ScaleWidth);
                break;

            case 3:
                objects.ScaleLength = ChangeValue(objects.ScaleLength);
                break;

            case 4:
                Color         colorValue1   = objects.ColorValue;
                int           num1          = ChangeValue(colorValue1.R);
                int           num2          = num1 < 0 ? 0 : num1;
                int           num3          = num2 > byte.MaxValue ? byte.MaxValue : num2;
                BaseObject_CS baseObjectCs1 = objects;
                int           red           = num3;
                colorValue1 = objects.ColorValue;
                int g1 = colorValue1.G;
                colorValue1 = objects.ColorValue;
                int   b1     = colorValue1.B;
                Color color1 = Color.FromArgb(red, g1, b1);
                baseObjectCs1.ColorValue = color1;
                break;

            case 5:
                Color         colorValue2   = objects.ColorValue;
                int           num4          = ChangeValue(colorValue2.G);
                int           num5          = num4 < 0 ? 0 : num4;
                int           num6          = num5 > byte.MaxValue ? byte.MaxValue : num5;
                BaseObject_CS baseObjectCs2 = objects;
                colorValue2 = objects.ColorValue;
                int r1    = colorValue2.R;
                int green = num6;
                colorValue2 = objects.ColorValue;
                int   b2     = colorValue2.B;
                Color color2 = Color.FromArgb(r1, green, b2);
                baseObjectCs2.ColorValue = color2;
                break;

            case 6:
                Color         colorValue3   = objects.ColorValue;
                int           num7          = ChangeValue(colorValue3.B);
                int           num8          = num7 < 0 ? 0 : num7;
                int           num9          = num8 > byte.MaxValue ? byte.MaxValue : num8;
                BaseObject_CS baseObjectCs3 = objects;
                colorValue3 = objects.ColorValue;
                int r2 = colorValue3.R;
                colorValue3 = objects.ColorValue;
                int   g2     = colorValue3.G;
                int   blue   = num9;
                Color color3 = Color.FromArgb(r2, g2, blue);
                baseObjectCs3.ColorValue = color3;
                break;

            case 7:
                objects.TransparentValueF = ChangeValue(objects.TransparentValueF);
                break;

            case 8:
                objects.AngleDegree = ChangeValue(objects.AngleDegree);
                break;

            case 9:
                objects.Velocity = ChangeValue(objects.Velocity);
                break;

            case 10:
                objects.DirectionDegree = ChangeValue(objects.DirectionDegree);
                break;

            case 11:
                objects.AccelerateCS = ChangeValue(objects.AccelerateCS);
                break;

            case 12:
                objects.AccDirection = ChangeValue(objects.AccDirection);
                break;

            case 13:
                objects.ScaleX = ChangeValue(objects.ScaleX);
                break;

            case 14:
                objects.ScaleY = ChangeValue(objects.ScaleY);
                break;

            case 15:
                objects.BeginningEffect = value > 0.0;
                break;

            case 16:
                objects.EndingEffect = value > 0.0;
                break;

            case 17:
                objects.Active = value > 0.0;
                break;

            case 18:
                objects.Ghosting = value > 0.0;
                break;

            case 19:
                objects.OutBound = value > 0.0;
                break;

            case 20:
                objects.UnRemoveable = value > 0.0;
                break;
            }
            --ctime;
            if (!(changetype == 2 & ctime == -1) && !(changetype != 2 & ctime == 0))
            {
                return;
            }
            objects.EventsExecutionList.Remove(this);
        }