public void OnPlayerPickUpItem(SpecialItem item) { item.OnPlayerPickUp(this.model); if (item.toRespawn) { RespawnPlayer(); } }
public void OpenTreasure(int vipLevel, VipXiaoGuo dataVIPEffect) { if (!TreasureUIViewModel.IsTreasureValid(vipLevel, dataVIPEffect)) { TreasureUIView.Instance.Show(false); return; } UIManagerControl.Instance.OpenUI("TreasureUI", UINodesManager.NormalUIRoot, false, UIType.NonPush); this.ObatinItems.Clear(); this.SpecialItemText = string.Empty; this.VIPEffect = dataVIPEffect; this.VIPLevel10 = GameDataUtils.GetNumIcon10(vipLevel, NumType.Yellow_light); this.VIPLevel1 = GameDataUtils.GetNumIcon1(vipLevel, NumType.Yellow_light); this.BtnOKText = GameDataUtils.GetChineseContent(508009, false); if (dataVIPEffect.value2 > 0 && dataVIPEffect.value3 > 0) { this.ConsumeOn = true; this.ConsumeIcon = GameDataUtils.GetItemIcon(dataVIPEffect.value2); this.ConsumeNum = dataVIPEffect.value3.ToString(); } else { this.ConsumeOn = false; } string text = string.Empty; List <VipBoxItemInfo> vIPBox = VIPManager.Instance.GetVIPBox(dataVIPEffect.effect); if (vIPBox != null) { for (int i = 0; i < vIPBox.get_Count(); i++) { VipBoxItemInfo vipBoxItemInfo = vIPBox.get_Item(i); if (SpecialItem.IsSpecial(vipBoxItemInfo.itemId)) { string colorByID = TextColorMgr.GetColorByID("x" + vipBoxItemInfo.itemCount, 405); if (string.IsNullOrEmpty(text)) { text = GameDataUtils.GetItemName(vipBoxItemInfo.itemId, true, 0L) + colorByID; } else { text = text + ", " + GameDataUtils.GetItemName(vipBoxItemInfo.itemId, true, 0L) + colorByID; } } else { OOItem2Draw oOItem2Draw = new OOItem2Draw(); oOItem2Draw.ID = vipBoxItemInfo.itemId; oOItem2Draw.ItemIcon = GameDataUtils.GetItemIcon(vipBoxItemInfo.itemId); oOItem2Draw.ItemName = Utils.GetItemNum(vipBoxItemInfo.itemId, (long)vipBoxItemInfo.itemCount); this.ObatinItems.Add(oOItem2Draw); } } } this.SpecialItemText = text; }
public void LoadGame() { List <CageSaveData> cages = JsonConvert.DeserializeObject <List <CageSaveData> >(PlayerPrefs.GetString("save")); DataManager.Money = (PlayerPrefs.GetInt("money", 0)); for (int i = 0; i < cages.Count; i++) { Cage tmp = CageFactory.GetNewCage(cages[i].biome, i, true); tmp.Name = cages[i].Name; tmp.stage = cages[i].stage; GameManager.Ins.cages.Add(tmp); GameManager.Ins.ToCage(i); foreach (var item in cages[i].items) { if (item.type == NeedType.Food) { Feeder f = Instantiate(feeders[(int)item.food], tmp.transform).GetComponent <Feeder>(); f.transform.localPosition = item.localPos; f.capacity = item.capacity; f.Place(); } else { SpecialItem s = Instantiate(specials[(int)item.special], tmp.transform).GetComponent <SpecialItem>(); s.transform.localPosition = item.localPos; s.Place(); } } foreach (var animal in cages[i].animals) { Animal a = AnimalFactory.NewAnimalOfKind(animal.kind, tmp.transform, true); a.data.name = animal.data.name; a.data.adult = animal.data.adult; a.data.age = animal.data.age; a.data.male = animal.data.male; a.data.pregnant = animal.data.pregnant; a.data.pregnancy = animal.data.pregnancy; a.data.sexualActivity = animal.data.sexualActivity; a.data.happiness = animal.data.happiness; a.data.foods = animal.data.foods; a.data.specials = animal.data.specials; a.transform.position = tmp.GetFreeTileInGrid(); a.status.RecalculateHappiness(); } if (tmp.animals.Count > 0) { GameManager.Ins.cageIcons.GetChild(i).GetComponent <Image>().sprite = Resources.Load <Sprite>($"Animals/{tmp.animals[0].stats.kind}/CageIcon"); } } Technet99m.Clock.deltaActualized += SaveGame; GameManager.Ins.ToCage(0); StartCoroutine(CalculateTimeChanges()); }
//Function used to buy consumable items /*public void BuyItem() * { * BuyMany(item); * data.AutoSaveGame(); * } * * private void BuyMany(Item item) * { * if(gameMaster.totalMoney >= item.cost) * { * gameMaster.totalMoney -= item.cost; * item.quantity++; * Debug.Log("You bought an item"); * } * else * { * Debug.Log("Not enough money"); * } * }*/ //Function used to buy special items that can be bought just once (e.g. skins) private void BuyOnce(SpecialItem specialItem) { if (gameMaster.totalMoney >= specialItem.cost && !specialItem.isAquired) { gameMaster.totalMoney -= specialItem.cost; specialItem.isAquired = true; Debug.Log("You bought a special item"); } else { Debug.Log("Not enough money"); } }
/// <summary> /// Spawn item. /// </summary> /// <param name="item">Item to be spawned.</param> private IEnumerator SpawnItem(SpecialItem item) { List <Transform> possibleSpawns = new List <Transform>(); // Find a free spawn point for the item. for (int i = 0; i < MapManager.Instance.ItemSpawnPoints.Length; i++) { Collider2D[] collectables = Physics2D.OverlapCircleAll( new Vector2( MapManager.Instance.ItemSpawnPoints[i].transform.position.x, MapManager.Instance.ItemSpawnPoints[i].transform.position.y ), MapManager.Instance.TilemapCellHalfSize, 1 << LayerMask.NameToLayer(Constants.UserLayerNameCollectable) ); if (collectables.Length == 0) { possibleSpawns.Add(MapManager.Instance.ItemSpawnPoints[i]); } } if (possibleSpawns.Count == 0) { Debug.unityLogger.LogFormat(LogType.Log, "[Spawner: {0}] There is no free spawn point to spawn new item.", ItemSpawner.name); yield break; } // Animate throwing item. Component component = null; if ((component = ItemSpawner.GetComponent <PacMan>()) != null) { ((PacMan)component).StartEventAnimation(1); yield return(new WaitForSeconds(0.4f)); // Wait for the correct animation. } // Get random spawn point. int spawnPointIndex = Random.Range(0, possibleSpawns.Count - 1); SpecialItem spawnedItem = Instantiate(item, ItemSpawner.transform.position, item.transform.rotation); spawnedItem.StartThrowing(possibleSpawns[spawnPointIndex].position, 3f); Debug.unityLogger.LogFormat(LogType.Log, "[Spawner: {0}] Spawning item: {1}.", ItemSpawner.name, item); yield return(null); }
public void BackstagePassIsSpecial() { const int sellIn = 12; const int quality = 20; Item item = new SpecialItem { Name = ItemNames.BACKSTAGE_PASS, SellIn = sellIn, Quality = quality }; item.UpdateQuality(); // Quality should increase by 1. item.UpdateQuality(); // Quality should increase by 2. Assert.Equal(sellIn - 2, item.SellIn); Assert.Equal(quality + 3, item.Quality); }
//通过ID查找物品 static public SpecialItem FindSpecialItemByID(int ID) { //如果返回的ID为-1,则表示没有找到物品 SpecialItem Wrong = new SpecialItem(); Wrong.ID = -1; Wrong.Name = "Wrong: Not Find!"; foreach (SpecialItem item in specialItemList) { if (item.ID == ID) { return(item); } } return(Wrong); }
public float DoSpecial(SpecialItem item) { var animator = item.GetComponent <Animator>(); if (animator != null) { animator.Play("Action"); } switch (item.type) { case Special.jump: SetUp(GenderPack.side); anim.Play("Jump"); return(6f); case Special.swim: SetUp(GenderPack.side); anim.Play("Swimming"); return(9.67f); case Special.run: SetUp(GenderPack.side); anim.Play("Run"); return(5f); case Special.sleep: SetUp(GenderPack.down); anim.Play("Sleep"); return(6f); case Special.scratch: SetUp(GenderPack.side); anim.Play("Scratch"); return(1.30f); case Special.mud: SetUp(GenderPack.side); anim.Play("Mud"); return(5f); default: return(0); } }
/// <summary> /// Add item to player and its inventory. /// </summary> /// <param name="target">Target Player character which will get the item.</param> /// <param name="item">Item to add.</param> public void AddItem(Player target, SpecialItem item) { Sprite previousItem = null; // Go through all item slots. for (int i = 0; i < transform.childCount; i++) { // Get image component of the slot. Image img = transform.GetChild(i).GetChild(0).GetComponent <Image>(); // First slot. if (i == 0) { img.enabled = true; previousItem = img.sprite; img.sprite = item.GetComponent <SpriteRenderer>().sprite; continue; } // Another slots. // If there is no item to move from the first slot, we dont need to continue. if (previousItem == null) { break; } img.enabled = true; Sprite currentItem = img.sprite; // Auxiliary variable. img.sprite = previousItem; previousItem = currentItem; // Remove item which overflows. if (i == transform.childCount - 1 && previousItem != null) { target.SpecialItemList.Remove(target.SpecialItemList.First()); } } // Add item's special status effect to player's inventory. target.SpecialItemList.Add(item.GetComponent <SpecialItem>().ItemStatusEffect); }
public void TriggerSMB() { SpecialItem item = SpecialItem.SMB_01; if (!PlayerController.Account.Vault.SpecialItems.TryGetValue(item.ID, out int currentCount) || currentCount <= 0) { return; } PlayerController.Account.Vault.SpecialItems[item.ID] = --currentCount; PlayerController.Account.Cooldown.SpecialItemCooldown.TryGetValue(item.ID, out DateTime lastTrigger); if (lastTrigger.FromNow() < item.Cooldown) { return; } PlayerController.Account.Cooldown.SpecialItemCooldown[item.ID] = DateTime.Now; ICommand smbCommand = PacketBuilder.SpecialItems.Smartbomb(PlayerController); PlayerController.Send( PacketBuilder.Slotbar.ExplosiveItemStatus(item.Name, currentCount, false), PacketBuilder.Slotbar.ItemCooldownCommand(item.Name, item.Cooldown.TotalMilliseconds, currentCount > 0), smbCommand ); PlayerController.EntitiesInRangeSafe(x => { // if performance does not meet demand, add async here if (x is PlayerController playerController && !playerController.SpecialItemsAssembly.IsInvicible && !x.EffectsAssembly.HasProtection && !x.ZoneAssembly.IsInDMZ && x.MovementAssembly.ActualPosition().DistanceTo(PlayerController.MovementAssembly.ActualPosition()) < 550) { double damage = x.HangarAssembly.Hitpoints * .2; int shieldDamage = Math.Abs(x.HangarAssembly.ChangeShield(-(int)(damage * x.BoosterAssembly.Get(BoosterType.SHIELD_ABSORBATION)), false)); int hitpointsDamage = Math.Abs(x.HangarAssembly.ChangeHitpoints(-(int)(damage - shieldDamage), false)); x.AttackTraceAssembly.LogAttack(PlayerController, shieldDamage, hitpointsDamage, false); x.HangarAssembly.CheckDeath(); ICommand attackCommand = PacketBuilder.AttackCommand(PlayerController, x, AttackTypeModule.SMARTBOMB, shieldDamage + hitpointsDamage); x.Send(smbCommand, attackCommand); // send to player x.EntitiesLocked(y => y.Send(attackCommand)); // send to all who have him in lock }
public static void SendSlotbars(GameSession gameSession) { var player = gameSession.Player; var gameHandler = gameSession.Client; var counterValue = 0; var categories = new List <SlotbarCategoryModule>(); var slotbarItemsTest = new List <SlotbarQuickslotItem> { new SlotbarQuickslotItem(1, "ammunition_laser_ucb-100"), new SlotbarQuickslotItem(2, "ammunition_laser_rsb-75"), new SlotbarQuickslotItem(3, "ammunition_laser_mcb-50"), new SlotbarQuickslotItem(4, "ammunition_laser_ucb-100"), new SlotbarQuickslotItem(5, "ammunition_laser_sab-50"), new SlotbarQuickslotItem(6, "ammunition_mine_smb-01"), new SlotbarQuickslotItem(7, "equipment_extra_cpu_ish-01"), new SlotbarQuickslotItem(8, "ammunition_specialammo_emp-01"), }; var premium = new List <SlotbarQuickslotItem> { new SlotbarQuickslotItem(1, "drone_formation_f-3d-rg"), new SlotbarQuickslotItem(2, "drone_formation_f-10-cr"), new SlotbarQuickslotItem(3, "drone_formation_f-09-mo") }; var slotbars = new List <SlotbarQuickslotModule> { new SlotbarQuickslotModule("standardSlotBar", slotbarItemsTest, "50,85|0,40", "0", true), new SlotbarQuickslotModule("premiumSlotBar", premium, "50,85|0,80", "0", true) }; var items = new List <SlotbarCategoryItemModule>(); //LASERS var maxCounter = 1000; foreach (var itemId in ItemStorage.LaserIds) { var item = new LaserItem( itemId, counterValue, maxCounter ); try { item.CounterValue = player.Hangar.Configurations[player.CurrentConfig].Consumables[itemId].Amount; } catch (Exception) { item.CounterValue = 0; } item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("lasers", items)); //ROCKETS items = new List <SlotbarCategoryItemModule>(); maxCounter = 200; foreach (var itemId in ItemStorage.RocketIds) { var item = new RocketItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("rockets", items)); //ROCKET LAUNCHER items = new List <SlotbarCategoryItemModule>(); maxCounter = 200; foreach (var itemId in ItemStorage.RocketLauncherIds) { var item = new RocketLauncherItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("rocket_launchers", items)); //SPECIAL ITEMS items = new List <SlotbarCategoryItemModule>(); maxCounter = 100; foreach (var itemId in ItemStorage.SpecialItemsIds) { var item = new SpecialItem( itemId, counterValue, maxCounter ); try { item.CounterValue = player.Hangar.Configurations[player.CurrentConfig].Consumables[itemId].Amount; } catch (Exception) { item.CounterValue = 0; } item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("special_items", items)); //MINES items = new List <SlotbarCategoryItemModule>(); maxCounter = 100; foreach (var itemId in ItemStorage.MinesIds) { var item = new MineItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("mines", items)); //CPUS items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in ItemStorage.CpusIds) { //TODO } categories.Add(new SlotbarCategoryModule("cpus", items)); //BUY NOW items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in ItemStorage.BuyNowIds) { var item = new BuyItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("buy_now", items)); //TECH ITEMS items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in ItemStorage.TechIds) { var item = new TechItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("tech_items", items)); //SHIP ABILITIES items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in ItemStorage.ShipAbilitiesIds) { var item = new ShipAbilityItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("ship_abilities", items)); //DRONE FORMATION items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in ItemStorage.FormationIds) { var item = new FormationItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); player.SlotbarItems[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("drone_formations", items)); gameHandler.Send(new SlotbarsCommand(categories, "50,85", slotbars).getBytes()); }
public List <SlotbarCategoryModule> GetCategories(Player player) { var counterValue = 0; var categories = new List <SlotbarCategoryModule>(); var items = new List <SlotbarCategoryItemModule>(); //LASERS var maxCounter = 1000; foreach (var itemId in Items.LaserIds) { if (!player.Information.Ammunitions.ContainsKey(itemId)) { continue; } var ammo = player.Information.Ammunitions[itemId]; var item = new LaserItem( itemId, counterValue, maxCounter ); item.CounterValue = ammo.Get(); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("lasers", items)); //ROCKETS items = new List <SlotbarCategoryItemModule>(); maxCounter = 200; foreach (var itemId in Items.RocketIds) { if (!player.Information.Ammunitions.ContainsKey(itemId)) { continue; } var ammo = player.Information.Ammunitions[itemId]; counterValue = ammo.Get(); var item = new RocketItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("rockets", items)); //ROCKET LAUNCHER items = new List <SlotbarCategoryItemModule>(); maxCounter = 200; foreach (var itemId in Items.RocketLauncherIds) { var item = new RocketLauncherItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("rocket_launchers", items)); //SPECIAL ITEMS items = new List <SlotbarCategoryItemModule>(); maxCounter = 100; foreach (var itemId in Items.SpecialItemsIds) { var item = new SpecialItem( itemId, counterValue, maxCounter ); item.CounterValue = 100; item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("special_items", items)); //MINES items = new List <SlotbarCategoryItemModule>(); maxCounter = 100; foreach (var itemId in Items.MinesIds) { var item = new MineItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("mines", items)); //CPUS items = new List <SlotbarCategoryItemModule>(); maxCounter = 100; foreach (var itemId in Items.CpusIds) { var item = new CpuItem( itemId, counterValue, maxCounter, null, 1, false, false ); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("cpus", items)); //BUY NOW //items = new List<SlotbarCategoryItemModule>(); //maxCounter = 0; //foreach (var itemId in Items.BuyNowIds) //{ // var item = new BuyItem( // itemId, // counterValue, // maxCounter // ); // item.Create(); // items.Add(item.Object); // _items[item.ClickedId] = item; //} //categories.Add(new SlotbarCategoryModule("buy_now", items)); //TECH ITEMS items = new List <SlotbarCategoryItemModule>(); maxCounter = 99; foreach (var itemId in Items.TechIds) { var item = new TechItem( itemId, counterValue, maxCounter ); item.Create(); item.CounterValue = 99; items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("tech_items", items)); //SHIP ABILITIES items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in Items.ShipAbilitiesIds) { var item = new ShipAbilityItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("ship_abilities", items)); //DRONE FORMATION items = new List <SlotbarCategoryItemModule>(); maxCounter = 0; foreach (var itemId in Items.FormationIds) { var item = new FormationItem( itemId, counterValue, maxCounter ); item.Create(); items.Add(item.Object); _items[item.ClickedId] = item; } categories.Add(new SlotbarCategoryModule("drone_formations", items)); return(categories); }
private void AddSPList() { SpecialItem SPT; // 1. ## Strength Boost x5 SPT = new SpecialItem { Number = 1, TypeID = 402653188, Quantity = 5, RareType = uint.MaxValue }; SpecialItemData.Add(SPT); // 2. ## Miracle Sign x5 SPT = new SpecialItem { Number = 2, TypeID = 402653189, Quantity = 5, RareType = uint.MaxValue }; SpecialItemData.Add(SPT); // 3. ## Spin Mastery x5 SPT = new SpecialItem { Number = 3, TypeID = 402653184, Quantity = 5, RareType = uint.MaxValue }; SpecialItemData.Add(SPT); // 4. ## Curve Mastery x5 SPT = new SpecialItem { Number = 4, TypeID = 402653185, Quantity = 5, RareType = uint.MaxValue }; SpecialItemData.Add(SPT); // 5. ## Generic Lucky Pangya x5 SPT = new SpecialItem { Number = 5, TypeID = 402653191, Quantity = 5, RareType = uint.MaxValue }; SpecialItemData.Add(SPT); // 6. ## Generic Nerve Stabilizer x5 SPT = new SpecialItem { Number = 6, TypeID = 402653192, Quantity = 5, RareType = uint.MaxValue }; SpecialItemData.Add(SPT); // 7. ## Club Modification Kit x1 SPT = new SpecialItem { Number = 7, TypeID = 436208143, Quantity = 1, }; SpecialItemData.Add(SPT); // Premium Coin Set No.1 SPT = new SpecialItem { Number = 8, TypeID = 402653190, // ## Silent Wind Quantity = 3 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 8, TypeID = 436208015, // ## Bongdari Clip Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 8, TypeID = 335544321, // ## Bomber Aztec Quantity = 30 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 8, TypeID = 436207633, // ## Timer Boost Quantity = 30 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 8, TypeID = 436207680, // ## Auto Clipper Quantity = 30 }; SpecialItemData.Add(SPT); // End Premium Coin // Premium Coin Set No.2 SPT = new SpecialItem { Number = 9, TypeID = 436208145, // ## UCIM CHIP Quantity = 2 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 9, TypeID = 335544342, // ## Watermelon Aztec Quantity = 40 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 9, TypeID = 402653224, // ## Safe Tee Quantity = 5 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 9, TypeID = 436207633, // ## Timer Boost Quantity = 100 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 9, TypeID = 436207680, // ## Auto Clipper Quantity = 100 }; SpecialItemData.Add(SPT); // End Premium Coin // Premium Coin Set No.3 SPT = new SpecialItem { Number = 10, TypeID = 436208144, // ## Abbot Coating Quantity = 3 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 10, TypeID = 335544332, // ## Clover Aztec Quantity = 50 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 10, TypeID = 402653223, // ## Double Strength Boost Quantity = 10 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 10, TypeID = 436207815, // ## Air Note Quantity = 60 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 10, TypeID = 436207633, // ## Timer Boost Quantity = 60 }; SpecialItemData.Add(SPT); // End Premium Coin // Premium Coin Set No.4 SPT = new SpecialItem { Number = 11, TypeID = 2092957696, // ## Card Pack No. 1 Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 11, TypeID = 335544350, // ## Sakura Aztec Quantity = 50 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 11, TypeID = 402653230, // ## Double P.Strength Boost Quantity = 3 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 11, TypeID = 436207618, // ## Pang Mastery Quantity = 20 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 11, TypeID = 436207633, // ## Timer Boost Quantity = 50 }; SpecialItemData.Add(SPT); // End Premium Coin // Premium Coin Set No.5 SPT = new SpecialItem { Number = 12, TypeID = 2092957700, // ## Card Pack No.2 Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 12, TypeID = 335544369, // ## Halloween Skull Aztec Quantity = 30 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 12, TypeID = 402653194, // ## Dual Lucky Pangya Quantity = 5 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 12, TypeID = 436207618, // ## Pang Mastery Quantity = 30 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 12, TypeID = 436207633, // ## Timer Boost Quantity = 50 }; SpecialItemData.Add(SPT); // End Premium Coin // Premium Coin Set No.6 SPT = new SpecialItem { Number = 13, TypeID = 2092957701, // ## Card Pack No.3 Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 13, TypeID = 335544352, // ## Rainbow Aztec Quantity = 30 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 13, TypeID = 402653195, // ## Dual Tran Quantity = 5 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 13, TypeID = 436207618, // ## Pang Mastery Quantity = 30 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 13, TypeID = 436207680, // ## Auto Clipper Quantity = 40 }; SpecialItemData.Add(SPT); // End Premium Coin // Premium Coin Set No.7 SPT = new SpecialItem { Number = 14, TypeID = 2092957703, // ## Card Pack No.4 Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 14, TypeID = 335544465, // ## Smiling Goblin Aztec Quantity = 50 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 14, TypeID = 402653223, // ## Double Strength Boost Quantity = 5 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 14, TypeID = 436207633, // ## Timer Boost Quantity = 50 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 14, TypeID = 436207680, // ## Auto Clipper Quantity = 50 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 15, TypeID = 436207709, // ##Fragment of time (Fall) Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 16, TypeID = 436207707, // ##Fragment of time (Spring) Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 17, TypeID = 436207708, // ##Fragment of time (Summer) Quantity = 1 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 18, TypeID = 436207710, // ##Fragment of time (Winter) Quantity = 1 }; SpecialItemData.Add(SPT); // NOVOS ITENS! SPT = new SpecialItem { Number = 19, TypeID = 436208242, // Moeda do Memorial Premium Quantity = 5, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 20, TypeID = 608256015, // Patinhas Spika Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 21, TypeID = 608174132, // Patinhas Nuri Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 22, TypeID = 608182322, // Patinhas Hana Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 23, TypeID = 608190501, // Patinhas Azer Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 24, TypeID = 608198722, // Patinhas Cecilia Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 25, TypeID = 608206889, // Patinhas Max Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 26, TypeID = 608215139, // Patinhas Kooh Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 27, TypeID = 608223292, // Patinhas Arin Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 28, TypeID = 608231468, // Patinhas Kaz Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 29, TypeID = 608239698, // Patinhas Lucia Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); SPT = new SpecialItem { Number = 30, TypeID = 608247843, // Patinhas Nell Quantity = 1, RareType = 4 }; SpecialItemData.Add(SPT); // End Premium Coin // for SPT in SpItem do // WriteLn(Format('%d %s %d' ,[SPT.Number, IffEntry.GetItemName(SPT.TypeID), SPT.Quantity])); }
private void Timer_Tick(object sender, EventArgs e) { PathGeometry combGeoPlayerVSGround = this.model.screen.groundLine.CombinedGeos(this.model.player); if (combGeoPlayerVSGround.GetArea() == 0) { logic.MovePlayer(Direction.Down); } else if (combGeoPlayerVSGround.GetArea() > 0) { logic.SetPlayerPosition(model.player.CX, combGeoPlayerVSGround.Bounds.Top - 48); } // can't moove props used in WallItem logic.ResetCantPlayerMoove(); SpecialItem toRemove = null; model.screen.specialItems?.ForEach(item => { PathGeometry combGeoPlayerVSSpecialItem = item.CombinedGeos(this.model.player); if (combGeoPlayerVSSpecialItem.GetArea() > 10) { logic.OnPlayerPickUpItem(item); toRemove = item.toRemove ? item : null; } }); model.screen.specialItems?.Remove(toRemove); model.screen.enemies?.ForEach(enemy => { PathGeometry combGeoPlayerVSSpecialItem = enemy.CombinedGeos(model.player); if (combGeoPlayerVSSpecialItem.GetArea() > 0) { logic.DecreasePlayerLife(); logic.RespawnPlayer(); } }); if (model.screen.doorNextScreen != null) { PathGeometry combGeoPlayerVSDoorNextScreen = this.model.screen.doorNextScreen.CombinedGeos(this.model.player); if (combGeoPlayerVSDoorNextScreen.GetArea() > 0) { logic.ChangeScreen(); } } if (model.player.CY > model.GameHeight) { MessageBox.Show("Fail!"); logic.DecreasePlayerLife(); logic.RespawnPlayer(); } if (model.player.Lives < 0) { MessageBox.Show("You loose :( "); Window saveResultWindow = new SaveResultWindow(((FinalScoreViewModel)Window.GetWindow(this).DataContext), model.player.score.ToString()); Window.GetWindow(this).Close(); saveResultWindow.ShowDialog(); } InvalidateVisual(); }