示例#1
0
        public void Do()
        {
            bounds = Context.Cursor.Bounds.Clone();

            Dialog.Pick("Choose Ammo Type".ToConsoleString(),
                        Assembly.GetExecutingAssembly()
                        .GetTypes()
                        .Where(t => t.HasAttr <AmmoInfo>())
                        .Select(t => new DialogOption()
            {
                DisplayText = t.Attr <AmmoInfo>().DisplayName.ToConsoleString(), Id = t.FullName
            }))
            .Then((choice) =>
            {
                Context.PreviewScene.QueueAction(() =>
                {
                    int amount = 10;
                    bounds     = Context.Cursor.Bounds.Clone();
                    bounds.Pad(.1f);
                    this.ammo = new SerializedAmmo()
                    {
                        AmmoType = choice.Id, Amount = amount, Bounds = bounds
                    };

                    Context.CurrentLevelDefinition.Things.Add(ammo);
                    ammo.Rehydrate(true);
                    Context.PreviewScene.Add(ammo.HydratedThing);
                });
            });
        }
 public void Do()
 {
     bounds = Context.Cursor.Bounds.Clone();
     Dialog.ShowTextInput("Provide portal Id".ToYellow(), (id) =>
     {
         Context.PreviewScene.QueueAction(() =>
         {
             portal = new SerializedPortal()
             {
                 Bounds = Context.Cursor.Bounds.Clone(), DestinationId = id.ToString()
             };
             Context.CurrentLevelDefinition.Things.Add(portal);
             portal.Rehydrate(true);
             Context.PreviewScene.Add(portal.HydratedThing);
         });
     });
 }
示例#3
0
 public Explosive(PowerArgs.Cli.Physics.Rectangle bounds, float angleIcrement, float range) : base(bounds.Clone())
 {
     this.HealthPointsPerShrapnel = 1;
     this.angleIcrement           = angleIcrement;
     this.range = range;
 }