Example #1
0
 public ActorFrame(string sprite, char index, int dur, DecorateFunction.DecorateFunction func)
 {
     if (sprite.Length == 4)
     {
         spriteName = sprite.ToUpper();
     }
     else
     {
         Console.WriteLine("Sprite name for actor frame is not 4 characters!");
         spriteName = "TNT1";
     }
     if (IsCharValid(index))
     {
         spriteIndex = index.ToString().ToUpper();
     }
     else
     {
         Console.WriteLine("Sprite index for actor is not valid!");
         spriteIndex = "A";
     }
     if (dur < 0)
     {
         frameDuration = 0;
     }
     else
     {
         frameDuration = dur;
     }
     this.dfunction = func;
 }
Example #2
0
        private void AddActorFrame(object sender, EventArgs e)
        {
            if (this.InputStateFunction.Text.Equals("Fire Hitscan"))
            {
                DecorateFunction.DecorateFunction dfunc = new DecorateFunction.DecorateFunction("A_FireBullets",
                                                                                                new string[] { this.InputBulletsArg1.Value.ToString(), this.InputBulletsArg2.Value.ToString(), this.InputBulletsArg3.Value.ToString(), this.InputBulletsArg4.Value.ToString() });
                frames.Add(new ActorFrame.ActorFrame(this.GetActorFrameSprite(), this.GetActorFrameIndex(), (int)this.InputStateDuration.Value, dfunc));
                this.StatesAdded.Items.Add(frames.ElementAt(frames.Count - 1));
            }
            else if (this.InputStateFunction.Text.Equals("Fire Projectile"))
            {
                DecorateFunction.DecorateFunction dfunc = new DecorateFunction.DecorateFunction("A_FireCustomMissile",
                                                                                                new string[] { "\"" + this.InputMissileArg1.SelectedItem.ToString() + "\"", this.InputMissileArg2.Value.ToString(), "true", "0.0", "-2.0", "0", this.InputMissileArg3.Value.ToString() });

                frames.Add(new ActorFrame.ActorFrame(this.GetActorFrameSprite(), this.GetActorFrameIndex(), (int)this.InputStateDuration.Value, dfunc));
                this.StatesAdded.Items.Add(frames.ElementAt(frames.Count - 1));
            }
            else if (this.InputStateFunction.Text.Equals("Fire Railgun"))
            {
                DecorateFunction.DecorateFunction dfunc = new DecorateFunction.DecorateFunction("A_FireRailgun", null);
                frames.Add(new ActorFrame.ActorFrame(this.GetActorFrameSprite(), this.GetActorFrameIndex(), (int)this.InputStateDuration.Value, dfunc));
                this.StatesAdded.Items.Add(frames.ElementAt(frames.Count - 1));
            }
            else
            {
                frames.Add(new ActorFrame.ActorFrame(this.GetActorFrameSprite(), this.GetActorFrameIndex(), (int)this.InputStateDuration.Value, null));
                this.StatesAdded.Items.Add(frames.ElementAt(frames.Count - 1));
            }
        }