void OnTriggerEnter2D(Collider2D other) { // If player collided with bow if (other.tag == "Player") { stat = other.GetComponent <StatCollectionClass>(); Up = other.GetComponent <ItemUpgrade>(); // set item bow unlocked stat.itemBow = true; Up.BowLevel++; Up.BowDamage += 50; if (stat.ArmorEquip == false && stat.SwordEquip == false) { //add player attack damage with bow damage stat.damage += Up.BowDamage; stat.BowEquip = true; } } // Destroy the item Destroy(this.gameObject); }
void OnTriggerEnter2D(Collider2D other) { // If player collided with item armor if (other.tag == "Player") { stat=other.GetComponent<StatCollectionClass>(); // set item armor unlocked stat.itemArmor = true; Up = other.GetComponent<ItemUpgrade>(); Up.ArmorLevel++; Up.ArmorDamage+=1f; //if not equipment now just equip it if(stat.SwordEquip ==false && stat.BowEquip==false) { //add player defend with armor defend stat.defend+=Up.ArmorDamage; //set armor equip true stat.ArmorEquip = true; } // Destroy the item Destroy(this.gameObject); } }
void OnTriggerEnter2D(Collider2D other) { // If player collided with item Sword if (other.tag == "Player") { stat=other.GetComponent<StatCollectionClass>(); Up = other.GetComponent<ItemUpgrade>(); Destroy(this.gameObject); // set item sword unlocked stat.itemSword = true; Up.SwordLevel++; Up.SwordDamage+=100f; //if no equipment now just equip sword to player if(stat.ArmorEquip==false &&stat.BowEquip==false) { //add player attack damage with SwordDamage stat.damage+=Up.SwordDamage; //set sword equip to true stat.SwordEquip= true; } } // Destroy the item }
void OnTriggerEnter2D(Collider2D other) { // If player collided with item armor if (other.tag == "Player") { stat = other.GetComponent <StatCollectionClass>(); // set item armor unlocked stat.itemArmor = true; Up = other.GetComponent <ItemUpgrade>(); Up.ArmorLevel++; Up.ArmorDamage += 50f; //if not equipment now just equip it if (stat.SwordEquip == false && stat.BowEquip == false) { //add player defend with armor defend stat.defend += Up.ArmorDamage; //set armor equip true stat.ArmorEquip = true; } // Destroy the item Destroy(this.gameObject); } }
void OnTriggerEnter2D(Collider2D other) { // If player collided with item Sword if (other.tag == "Player") { stat = other.GetComponent <StatCollectionClass>(); Up = other.GetComponent <ItemUpgrade>(); Destroy(this.gameObject); // set item sword unlocked stat.itemSword = true; Up.SwordLevel++; Up.SwordDamage += 100f; //if no equipment now just equip sword to player if (stat.ArmorEquip == false && stat.BowEquip == false) { //add player attack damage with SwordDamage stat.damage += Up.SwordDamage; //set sword equip to true stat.SwordEquip = true; } } // Destroy the item }
void OnTriggerEnter2D(Collider2D other) { // If player collided with bow if (other.tag == "Player") { stat=other.GetComponent<StatCollectionClass>(); Up = other.GetComponent<ItemUpgrade>(); // set item bow unlocked stat.itemBow = true; Up.BowLevel++; Up.BowDamage+=0.5f; if (stat.ArmorEquip == false && stat.SwordEquip == false) { //add player attack damage with bow damage stat.damage += Up.BowDamage; stat.BowEquip = true; } } // Destroy the item Destroy(this.gameObject); }
public FactoryUIData(FactoryBuildTask task) { selectedTask = task; selectedItem = selectedTask.buildItem; selectedUpgrade = selectedItem.currentUpgrade; buildCount = selectedTask.itemBuildAmount; colonistAssignedCount = selectedTask.allocatedColonists.Count; }
public void OnLoad(DataSnapshot snapshot) { ItemUpgrade upgrade = snapshot.ItemUpgrades.SingleOrDefault(x => x.ItemId == _id); if (upgrade != null) { int tierIndex = upgrade.Level; this.Item.CurrentTier = GetTierByIndex(tierIndex); } }
public void CreateInstance() { _defaultStrategy = new ItemUpgrade(item => true); _itemUpgrades = new List <ItemUpgrade> { new ItemUpgrade(_ => _.Name == SULFURAS_HAND_OF_RAGNAROS, new DoesNotAge(), new LegendaryQuality()), new ItemUpgrade(_ => _.Name == AGED_BRIE, itemAging: null, qualityStrategy: new QualityIncreases()), new ItemUpgrade(_ => _.Name == BACKSTAGE_PASSES, itemAging: null, qualityStrategy: new BackStagePassQuality()), new ItemUpgrade(_ => _.Name != null && _.Name.StartsWith("Conjured"), itemAging: null, qualityStrategy: new QualityDegradesTwiceAsFast()), }; }
public void ResetItem(DataSnapshot snapshot) { ItemUpgrade upgrade = snapshot.ItemUpgrades.SingleOrDefault(x => x.ItemId == _id); if (upgrade != null) { upgrade.Level = 0; } this.Item.CurrentTier = GetTierByIndex(0); }
void Start() { player = this.gameObject; stat = player.GetComponent<StatCollectionClass >(); skill = player.GetComponent<SkillTree >(); quest = player.GetComponent<All_Quests> (); ps = player.GetComponent<PlayerStateGUI>(); up = player.GetComponent<ItemUpgrade> (); }
// Update is called once per frame void Update() { itemUpgrade = GameObject.Find("Enclume").GetComponent <ItemUpgrade>(); mousePos = controller.cam.ScreenToWorldPoint(Input.mousePosition); DetectMoving(); AnimationYAxis(); AnimationXAxis(); AttackMilo(); TurnMilo(); IsHurt(); IsDead(); DoShoot(); weaponAnim(); }
public IActionResult UpgradeItem([FromBody] ItemUpgrade item, string name) { if (name == "" || item.code == -1 || item.gold <= 0) { return(BadRequest()); } var items = _context.Items.FirstOrDefault(x => x.NameCharacter.Equals(name) && x.ItemId == item.code); var player = _context.Character.FirstOrDefault(x => x.Name.Equals(name)); if (items == null || player == null) { return(NotFound()); } items.Level++; player.Gold -= item.gold; _context.Character.Update(player); _context.Items.Update(items); _context.SaveChanges(); string json = "UPGRADE|" + player.Name + "|" + items.ItemId + "|" + player.Gold; return(new ObjectResult(json)); }
public void OnSave(DataSnapshot snapshot) { if (string.IsNullOrEmpty(_id)) { return; } ItemUpgrade upgrade = snapshot.ItemUpgrades.SingleOrDefault(x => x.ItemId == _id); var currUpgrade = new ItemUpgrade { ItemId = _id, Level = GetCurrTierIndex() }; if (upgrade == null) { snapshot.ItemUpgrades.Add(currUpgrade); } else { upgrade.Level = currUpgrade.Level; } }
public void CreateInstance() { _itemUpgrade = new ItemUpgrade(item => true); }
public Item() { currentUpgrade = new ItemUpgrade(); }
public void Init(ItemUpgrade upgrade) { buttonUpgrade = upgrade; upgradeIcon.sprite = buttonUpgrade.icon; }
void Start() { male = GameObject.Find("MalePlayerPrefab"); female = GameObject.Find("FemalePlayerPrefab"); if (male != null) { Item = male.GetComponent<ItemUpgrade> (); } else { Item = female.GetComponent<ItemUpgrade> (); } }