Пример #1
0
        public async Task <IActionResult> PutStickers(Guid id, Stickers stickers)
        {
            if (id != stickers.Id)
            {
                return(BadRequest());
            }

            _context.Entry(stickers).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StickersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        private static void SpawnModel(int type, int vehicle)
        {
            var coords = GetEntityCoords(PlayerPedId(), false);

            SetNetworkIdExistsOnAllMachines(VehToNet(vehicle), true);
            if (type == 0)
            {
                RequestModel((uint)GetHashKey("p_car_keys_01"));
                Object = CreateObject(GetHashKey("p_car_keys_01"), coords.X, coords.Y, coords.Z, true, true, true);
                var boneIndex = GetEntityBoneIndexByName(vehicle, "wheel_lf");
                SetEntityHeading(Object, 0f);
                SetEntityRotation(Object, 60f, 20f, 10f, 1, true);
                AttachEntityToEntity(Object, vehicle, boneIndex, -0.10f, 0.15f, -0.30f, 180f, 200f, 90f, true, true, false, false, 2, true);
                SetEntityRotation(Object, 60f, 20f, 10f, 1, true);
                SetEntityAsMissionEntity(Object, true, true);
                FreezeEntityPosition(Object, true);
                TriggerServerEvent("Server:ChangeCarState", VehToNet(vehicle), true);
                Clamps.Add(Object, vehicle);
            }
            else if (type == 1)
            {
                RequestModel((uint)GetHashKey("prop_cs_protest_sign_03"));
                Object = CreateObject(GetHashKey("prop_cs_protest_sign_03"), coords.X, coords.Y, coords.Z, true, true, true);
                var boneIndex = GetEntityBoneIndexByName(vehicle, "interiorlight");
                var model     = GetEntityModel(vehicle);
                var vector1   = new Vector3(0f, 0f, 0f);
                var vector2   = new Vector3(0f, 0f, 0f);
                GetModelDimensions((uint)model, ref vector1, ref vector2);
                FreezeEntityPosition(Object, true);
                SetEntityAsMissionEntity(Object, true, true);
                //AttachEntityToEntity(Object, vehicle, boneIndex, 0f, ((vector2.Y - vector1.Y) / 2), ((vector2.Z - vector1.Z) / 2) - ((vector2.Z - vector1.Z) / 5f), 0f, 0f, 0f, true, true, false, false, 1, true);
                AttachEntityToEntity(Object, vehicle, boneIndex, 0f, -((vector2.Y - vector1.Y) / 2) + 5f, -0.12f, 0f, 0f, 0f, true, true, false, false, 1, true);
                Stickers.Add(Object, vehicle);
            }
        }
Пример #3
0
 private void Toolbar_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (e.ClickedItem is TLMessagesStickerSet set && set.Cover != null)
     {
         Stickers.ScrollIntoView(set.Cover);
     }
 }
Пример #4
0
        // Two random cards in your hand cost 1 less for the rest of combat.  Cost 1.  Exhaust.

        public ActionItems()
        {
            SetCommonCardAttributes("Action Items", Rarity.UNCOMMON, TargetType.NO_TARGET_OR_SELF, CardType.SkillCard, 1, typeof(ArchonSoldierClass),

                                    protoGameSprite: ProtoGameSprite.ArchonIcon("checklist"));
            Stickers.Add(new ExhaustCardSticker());
        }
Пример #5
0
 private void Toolbar_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (e.ClickedItem is StickerSetViewModel set && set.Stickers != null)
     {
         Stickers.ScrollIntoView(e.ClickedItem, ScrollIntoViewAlignment.Leading);
     }
 }
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,UserId,Grade")] Stickers stickers)
        {
            if (id != stickers.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(stickers);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!StickersExists(stickers.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.ProfesionallsProfile, "UserId", "UserId", stickers.UserId);
            return(View(stickers));
        }
        //  Deal 3 damage and draw a card.  Discharge:  Deal 20 damage to a random target, and gain 1 energy.  Cost 0.

        public FusionGrenade()
        {
            SetCommonCardAttributes("Fusion Grenade", Rarity.UNCOMMON, TargetType.ENEMY, CardType.AttackCard, 0);
            Stickers.Add(new ExhaustCardSticker());
            BaseDamage  = 3;
            ProtoSprite = ProtoGameSprite.CogIcon("stick-grenade");
        }
Пример #8
0
        // apply 6 Burning to ALL enemies, then exhaust.  Cost 0.  Exhaust.

        public NapalmGrenade()
        {
            SetCommonCardAttributes("Napalm Grenade", Rarity.COMMON, TargetType.NO_TARGET_OR_SELF, CardType.SkillCard, 0);
            Stickers.Add(new BasicAttackRandomEnemySticker());
            BaseDamage  = 2;
            ProtoSprite = ProtoGameSprite.BlackhandIcon("grenade-a");
        }
Пример #9
0
        public async void UpdateFile(File file)
        {
            if (!file.Local.IsDownloadingCompleted)
            {
                return;
            }

            if (_stickers.TryGetValue(file.Id, out List <ViewModels.Dialogs.StickerViewModel> items) && items.Count > 0)
            {
                foreach (var item in items)
                {
                    item.UpdateFile(file);

                    var container = Stickers.ContainerFromItem(item) as SelectorItem;
                    if (container == null)
                    {
                        continue;
                    }

                    var content = container.ContentTemplateRoot as Image;
                    content.Source = await PlaceholderHelper.GetWebpAsync(file.Local.Path);
                }
            }

            foreach (MosaicMediaRow line in GifsView.Items)
            {
                var any = false;
                foreach (var item in line)
                {
                    if (item.Item is Animation animation && animation.UpdateFile(file))
                    {
                        any = true;
                    }
        // Apply 1 Vulnerable to all enemies.  Ambush: Gain 1 energy.  Exhaust.  Cost 0.

        public FlashbangGrenade()
        {
            SetCommonCardAttributes("Flashbang", Rarity.UNCOMMON, TargetType.NO_TARGET_OR_SELF, CardType.SkillCard, 0);
            BaseDamage = 1;
            Stickers.Add(new BasicAttackTargetSticker());
            ProtoSprite = ProtoGameSprite.BlackhandIcon("flash-grenade");
        }
Пример #11
0
        public virtual void Update(StickerSet set, bool reset = false)
        {
            _set = set;

            for (int i = 0; i < set.Stickers.Count; i++)
            {
                if (i < Stickers.Count)
                {
                    if (Stickers[i] is MoreStickerViewModel)
                    {
                        Stickers[i] = new StickerViewModel(_protoService, set.Stickers[i]);
                    }
                    else
                    {
                        Stickers[i].Update(set.Stickers[i]);
                    }
                }
                else
                {
                    Stickers.Add(new StickerViewModel(_protoService, set.Stickers[i]));
                }
            }

            if (reset)
            {
                Stickers.Reset();
            }
        }
Пример #12
0
        protected override IEnumerable <string> MergeDependencies(IJsonCard json, bool overwrite)
        {
            var properties = BadgesContext.Merge(json.Badges, overwrite)
                             .Select(p => $"{nameof(Card.Badges)}.{p}")
                             .ToList();

            if (json.Actions != null)
            {
                Actions.Update(json.Actions.Select(a => a.GetFromCache <Action, IJsonAction>(Auth, overwrite)));
                properties.Add(nameof(Card.Actions));
            }
            if (json.Attachments != null)
            {
                Attachments.Update(json.Attachments.Select(a => a.TryGetFromCache <Attachment, IJsonAttachment>(overwrite) ?? new Attachment(a, Data.Id, Auth)));
                properties.Add(nameof(Card.Attachments));
            }
            if (json.CheckLists != null)
            {
                CheckLists.Update(json.CheckLists.Select(a => a.GetFromCache <CheckList, IJsonCheckList>(Auth, overwrite)));
                properties.Add(nameof(Card.CheckLists));
            }
            if (json.Comments != null)
            {
                Comments.Update(json.Comments.Select(a => a.GetFromCache <Action, IJsonAction>(Auth, overwrite)));
                properties.Add(nameof(Card.Comments));
            }
            if (json.CustomFields != null)
            {
                CustomFields.Update(json.CustomFields.Select(a => a.GetFromCache <CustomField, IJsonCustomField>(Auth, overwrite, Data.Id)));
                properties.Add(nameof(Card.CustomFields));
            }
            if (json.Labels != null)
            {
                Labels.Update(json.Labels.Select(a => a.GetFromCache <Label, IJsonLabel>(Auth, overwrite)));
                properties.Add(nameof(Card.Labels));
            }
            if (json.Members != null)
            {
                Members.Update(json.Members.Select(a => a.GetFromCache <Member, IJsonMember>(Auth, overwrite)));
                properties.Add(nameof(Card.Members));
            }
            if (json.PowerUpData != null)
            {
                PowerUpData.Update(json.PowerUpData.Select(a => a.GetFromCache <PowerUpData, IJsonPowerUpData>(Auth, overwrite)));
                properties.Add(nameof(Card.PowerUpData));
            }
            if (json.Stickers != null)
            {
                Stickers.Update(json.Stickers.Select(a => a.TryGetFromCache <Sticker, IJsonSticker>(overwrite) ?? new Sticker(a, Data.Id, Auth)));
                properties.Add(nameof(Card.Stickers));
            }
            if (json.MembersVoted != null)
            {
                VotingMembers.Update(json.MembersVoted.Select(a => a.GetFromCache <Member, IJsonMember>(Auth, overwrite)));
                properties.Add(nameof(Card.VotingMembers));
            }

            return(properties);
        }
Пример #13
0
        // Does nothing.  Gilded 5.
        public LootCrate()
        {
            SetCommonCardAttributes("Loot Crate", Rarity.COMMON, TargetType.NO_TARGET_OR_SELF, CardType.SkillCard, 10);
            Stickers.Add(new GildedCardSticker(5));

            this.ProtoSprite =
                ProtoGameSprite.ArchonIcon("wooden-crate");
        }
Пример #14
0
        private void addWaresFromSticker(Stickers sticker)
        {
            Cells cell = sticker.Nomenclature.IsKeg() ? Consts.RedemptionCell : new Cells();

            addWareRow(sticker, cell, sticker.Nomenclature, sticker.UnitsQuantity, sticker.Party.Id);
            addWareRow(sticker, cell, sticker.Nomenclature.BoxType, sticker.Quantity, 0);
            addWareRow(sticker, cell, sticker.Tray, 1, 0);
        }
Пример #15
0
        // Gain 1 strength.  Deal 10 damage.  Cost 2.

        public TitanHunter()
        {
            SetCommonCardAttributes("Titan Hunter", Rarity.COMMON, TargetType.ENEMY, CardType.AttackCard, 2);
            BaseDamage = 10;
            Stickers.Add(new ExertCardSticker());
            DamageModifiers.Add(new SlayerDamageModifier());
            ProtoSprite = ProtoGameSprite.HammerIcon("atlas");
        }
        // Cost 7.  Apply 20 Temporary HP to all allies.  Bloodprice.

        public BloodOffering()
        {
            this.SoldierClassCardPools.Add(typeof(DiabolistSoldierClass));

            SetCommonCardAttributes("Blood Offering", Rarity.RARE, TargetType.NO_TARGET_OR_SELF, CardType.SkillCard, 7);
            Stickers.Add(new ExhaustCardSticker());
            ProtoSprite = ProtoGameSprite.DiabolistIcon("pentacle");
        }
Пример #17
0
 private void Toolbar_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (e.ClickedItem is TLMessagesStickerSet set && set.Cover != null)
     {
         //Stickers.ScrollIntoView(set.Cover, ScrollIntoViewAlignment.Leading);
         Stickers.ScrollIntoView(e.ClickedItem, ScrollIntoViewAlignment.Leading);
     }
 }
Пример #18
0
        // Deal 20 damage.  Buster.  Cost 2.

        public HandCannon()
        {
            SetCommonCardAttributes("Hand Cannon", Rarity.UNCOMMON, TargetType.ENEMY, CardType.AttackCard, 2,
                                    protoGameSprite: ProtoGameSprite.ArchonIcon("cannon-shot"));
            Stickers.Add(new BasicAttackTargetSticker());
            BaseDamage = 20;
            DamageModifiers.Add(new BusterDamageModifier());
        }
        // Gain 15 block.  Taunt an enemy.  It gains Weak this turn.

        // Brute: Taunt ALL enemies.


        public Impenetrable()
        {
            this.SoldierClassCardPools.Add(typeof(HammerSoldierClass));

            SetCommonCardAttributes("Impenetrable", Rarity.RARE, TargetType.ENEMY, CardType.SkillCard, 2);
            BaseDefenseValue = 15;
            Stickers.Add(new BasicDefendSelfSticker());
            ProtoSprite = ProtoGameSprite.HammerIcon("stone-block");
        }
Пример #20
0
        // Deal 30 damage.  Precision.  Bounty.  Cost 3.
        // Hoard 4.

        public EarnMySalary()
        {
            SetCommonCardAttributes("Earn My Salary", Rarity.RARE, TargetType.ENEMY, CardType.AttackCard, 3);
            DamageModifiers.Add(new PrecisionDamageModifier());
            DamageModifiers.Add(BountyDamageModifier.GetBountyDamageModifier());
            Stickers.Add(new GildedCardSticker(4));
            BaseDamage  = 30;
            ProtoSprite = ProtoGameSprite.CogIcon("farmer");
        }
        // Deal 8 damage.  Cost 3.  Buster.  Precision.  Refund 2.

        public RealityPenetrator()
        {
            SetCommonCardAttributes("Reality Penetrator", Rarity.UNCOMMON, TargetType.ENEMY, CardType.AttackCard, 3);
            BaseDamage = 8;
            Stickers.Add(new BasicAttackTargetSticker());
            DamageModifiers.Add(new BusterDamageModifier());
            DamageModifiers.Add(new PrecisionDamageModifier());
            ProtoSprite = ProtoGameSprite.CogIcon("vr-headset");
        }
Пример #22
0
        //   Deal 10 damage.  Lethal: Increase this card's Hoard value by 2 PERMANENTLY.   Hoard 2.

        public Stonks()
        {
            SetCommonCardAttributes("Stonks!", Rarity.RARE, TargetType.ENEMY, CardType.AttackCard, 1);
            DamageModifiers.Add(new StonksDamageModifier());
            Stickers.Add(new BasicAttackTargetSticker());
            Stickers.Add(new GildedCardSticker(2));
            BaseDamage  = 10;
            ProtoSprite = ProtoGameSprite.CogIcon("chart");
        }
Пример #23
0
        public GildedGun()
        {
            // deal 6 damage.  Precision.  Hoard 2.  Cost 0.  Gets an additional +2 Gilded for EACH Gilded Gun in your deck.
            SetCommonCardAttributes("Gilded Gun", Rarity.COMMON, TargetType.ENEMY, CardType.AttackCard, 0);
            Stickers.Add(sticker);
            DamageModifiers.Add(new PrecisionDamageModifier());

            this.ProtoSprite =
                ProtoGameSprite.ArchonIcon("machine-gun");
        }
Пример #24
0
        private void Stickers_Loaded(object sender, RoutedEventArgs e)
        {
            var scrollingHost = Stickers.Descendants <ScrollViewer>().FirstOrDefault() as ScrollViewer;

            if (scrollingHost != null)
            {
                // Syncronizes GridView with the toolbar ListView
                scrollingHost.ViewChanged += ScrollingHost_ViewChanged;
            }
        }
        private static void HandleVideonote(Message message)
        {
            Log.Information("Videomessage received: " +
                            $"{message.Chat.Id} " +
                            $"from: {message.From.FirstName} " +
                            $"{message.From.LastName}.");

            Bot.Client.SendStickerAsync(message.Chat.Id,
                                        new InputOnlineFile(Stickers.GetRandomSmickingBotSticker(  )));
        }
Пример #26
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            var scrollViewer = Stickers.GetScrollViewer();

            if (scrollViewer != null)
            {
                stickersScroll              = scrollViewer;
                stickersScroll.ViewChanged += Stickers_ViewChanged;
            }
        }
Пример #27
0
        // Deal 6 damage.  Add two Autocannon Sentries to your hand.
        // Lethal: Gain 3 Data Points.
        // Exhaust.  Cost 1.

        public Vivisect()
        {
            Stickers.Add(new BasicAttackTargetSticker());
            Stickers.Add(new ExhaustCardSticker());
            BaseDamage = 6;
            DamageModifiers.Add(new GainDataPointsOnSlayDamageModifier {
                DataPointsToAcquire = 3
            });
            ProtoSprite = ProtoGameSprite.CogIcon("split-body");
        }
Пример #28
0
 public Crusher()
 {
     SetCommonCardAttributes("Crusher", Rarity.NOT_IN_POOL, TargetType.ENEMY, CardType.AttackCard, 2);
     Stickers.Add(new BasicAttackTargetSticker());
     Stickers.Add(new BasicDefendSelfSticker());
     BaseDamage       = 15;
     BaseDefenseValue = 8;
     DamageModifiers.Add(new SweeperDamageModifier());
     Stickers.Add(new ExhaustCardSticker());
     ProtoSprite = ProtoGameSprite.CogIcon("daemon-pull");
 }
Пример #29
0
 public void Update(Stickers stickers, bool raise = false)
 {
     if (raise)
     {
         Stickers.ReplaceWith(stickers.StickersValue.Select(x => new StickerViewModel(x)));
     }
     else
     {
         Stickers = new MvxObservableCollection <StickerViewModel>(stickers.StickersValue.Select(x => new StickerViewModel(x)));
     }
 }
Пример #30
0
        //
        public FeedAttachmentSticker(ActivityAttachment attachment, ulong actionId)
        {
            _sticker        = Stickers.GetById(attachment.id);
            attachment_id   = attachment.id;
            attachment_type = "sitereaction_sticker";
            title           = _sticker.title;

            uri        = $"https://beta.koobeca.com/view.php?action_id={actionId}";
            image_main = _sticker.file_id > 0 ? new FeedImage(_sticker.file_id) : null;
            mode       = (uint)(attachment.mode ? 1 : 0);
        }
Пример #31
0
 /// <summary>
 /// Create a new Stickers object.
 /// </summary>
 /// <param name="id">Initial value of Id.</param>
 /// <param name="userId">Initial value of UserId.</param>
 /// <param name="needOrFree">Initial value of NeedOrFree.</param>
 /// <param name="number">Initial value of Number.</param>
 public static Stickers CreateStickers(int id, global::System.Guid userId, byte needOrFree, short number)
 {
     Stickers stickers = new Stickers();
     stickers.Id = id;
     stickers.UserId = userId;
     stickers.NeedOrFree = needOrFree;
     stickers.Number = number;
     return stickers;
 }
Пример #32
0
 /// <summary>
 /// There are no comments for Stickers in the schema.
 /// </summary>
 public void AddToStickers(Stickers stickers)
 {
     base.AddObject("Stickers", stickers);
 }
Пример #33
0
 /// <summary>
 /// Create a new Stickers object.
 /// </summary>
 /// <param name="id">Initial value of Id.</param>
 /// <param name="needOrFree">Initial value of NeedOrFree.</param>
 /// <param name="number">Initial value of Number.</param>
 public static Stickers CreateStickers(int id, byte needOrFree, short number)
 {
     Stickers stickers = new Stickers();
     stickers.Id = id;
     stickers.NeedOrFree = needOrFree;
     stickers.Number = number;
     return stickers;
 }