Exemple #1
0
    // On trigger collision
    void OnTriggerEnter2D(Collider2D coll)
    {
        if(coll.gameObject.tag== Globals.TAGS.Enemy)
        {
            return;
        }

        if (coll.gameObject.tag == Globals.TAGS.Player) // @@@ENUM HERE!!!
        {
            GameObject dragon = coll.gameObject;
            UseItem(dragon); // For non awarding actions

            if (Audi != null)
            {
                Audi.Play();
            }
            int hp = this.award_HP;
            int stam = this.award_Stam;
            float flame = this.award_Flame;

            if (p == null)
            {
                p = gameObject.GetComponent<Perks>();
            }

            if (p.BE())
            {
                stam *= 2;
                flame *= 2;
            }
            if (hp < 0)
            {
                Debug.Log("1");
                dragonSM.HP += (int)(hp * p.damageMult()) + p.damageReduction();
            }
            if(hp>0 && p.BE())
            {
                dragonSM.HP += hp * 2;
            }
            monitor.Add_Coins(award_Coin_Value);
            Debug.Log(award_Coin_Value);
            dragonSM.StatInput(hp, stam,flame);
            // @@@ SESSION MONITOR
            //monitor.Add_Coins(this.award_Coin_Value);
        Destroy(this.gameObject); // Goodbye
        }
    }
        public CharacterInfo(string name, int hp, int mp, int cheerfulness, int food, int maxHp, int maxMp, int maxCheerfulness, int maxFood, Perks perks, Inventory inventory)
        {
            Name = name;

            HP = hp;
            MP = mp;
            Cheerfulness = cheerfulness;
            Food = food;

            MaxHP = maxHp;
            MaxMP = maxMp;
            MaxCheerfulness = maxCheerfulness;
            MaxFood = maxFood;

            Perks = perks;
            Inventory = inventory;
        }
        static void Main(string[] args)
        {
            // Variables
            int numNPCs;

            Perks[] npcPerks;

            // Ask for the number of NPCs
            Console.Write("How many NPC? ");
            numNPCs = int.Parse(Console.ReadLine());

            // Create the array of NPC perks
            npcPerks = new Perks[numNPCs];

            // For each NPC, ask for its perks
            for (int n = 0; n < numNPCs; n++)
            {
                // User input
                string input;

                // Stealth?
                Console.Write($"Does NPC {n} has stealth (y/n)? ");
                input = Console.ReadLine();
                if (input == "y")
                {
                    npcPerks[n] |= Perks.Stealth;
                }

                // Combat?
                Console.Write($"Does NPC {n} has combat (y/n)? ");
                input = Console.ReadLine();
                if (input == "y")
                {
                    npcPerks[n] |= Perks.Combat;
                }

                // Lockpick?
                Console.Write($"Does NPC {n} has lockpick (y/n)? ");
                input = Console.ReadLine();
                if (input == "y")
                {
                    npcPerks[n] |= Perks.Lockpick;
                }

                // Luck?
                Console.Write($"Does NPC {n} has luck (y/n)? ");
                input = Console.ReadLine();
                if (input == "y")
                {
                    npcPerks[n] |= Perks.Luck;
                }
            }

            // Show on screen the perks of all NPCs
            // If NPC has Combat & Luck print special message
            foreach (Perks perks in npcPerks)
            {
                Perks special = Perks.Combat | Perks.Luck;
                Console.WriteLine($"NPC has {perks}");
                if ((perks & special) == special)
                {
                    Console.WriteLine("\tYou shall win all fights");
                }
            }
        }
Exemple #4
0
    public void LoadSelectedItem(CraftableItem itemRef)
    {
        if (itemRef != null)
        {
            CraftedEquipment equipRef;
            Transform        mainItemPane = recipeCreatorTransform.Find("ContentBG/ItemTab");
            if (itemRef.MyCraftedItemType == CraftedItemType.ARMOR)
            {
                PopulateEquipmentList();
            }
            else if (itemRef.MyCraftedItemType == CraftedItemType.WEAPON)
            {
                PopulateWeaponList();
            }
            else if (itemRef.MyCraftedItemType == CraftedItemType.REAGENT)
            {
                PopulateReagentList();
            }

            if (itemRef.MyCraftedItemType == CraftedItemType.ARMOR || itemRef.MyCraftedItemType == CraftedItemType.WEAPON)
            {
                equipRef = itemRef as CraftedEquipment;
                currItem = itemRef;
                mainItemPane.Find("Name/Name").GetComponent <InputField>().text = equipRef.baseName;
                if (itemRef.MyCraftedItemType == CraftedItemType.ARMOR || itemRef.MyCraftedItemType == CraftedItemType.WEAPON)
                {
                    mainItemPane.Find("Dexterity/Min").GetComponent <InputField>().text    = equipRef.dexterityMin.ToString();
                    mainItemPane.Find("Dexterity/Max").GetComponent <InputField>().text    = equipRef.dexterityMax.ToString();
                    mainItemPane.Find("Might/Min").GetComponent <InputField>().text        = equipRef.mightMin.ToString();
                    mainItemPane.Find("Might/Max").GetComponent <InputField>().text        = equipRef.mightMax.ToString();
                    mainItemPane.Find("Intelligence/Min").GetComponent <InputField>().text = equipRef.intelligenceMin.ToString();
                    mainItemPane.Find("Intelligence/Max").GetComponent <InputField>().text = equipRef.intelligenceMax.ToString();
                    mainItemPane.Find("LevelRange/Min").GetComponent <InputField>().text   = equipRef.minLevelReq.ToString();
                    mainItemPane.Find("LevelRange/Max").GetComponent <InputField>().text   = equipRef.maxLevelReq.ToString();
                    mainItemPane.Find("Health/Min").GetComponent <InputField>().text       = equipRef.minBonusHealth.ToString();
                    mainItemPane.Find("Health/Max").GetComponent <InputField>().text       = equipRef.maxBonusHealth.ToString();

                    mainItemPane.Find("Dexterity/Min").GetComponent <InputField>().interactable    = true;
                    mainItemPane.Find("Dexterity/Max").GetComponent <InputField>().interactable    = true;
                    mainItemPane.Find("Might/Min").GetComponent <InputField>().interactable        = true;
                    mainItemPane.Find("Might/Max").GetComponent <InputField>().interactable        = true;
                    mainItemPane.Find("Intelligence/Min").GetComponent <InputField>().interactable = true;
                    mainItemPane.Find("Intelligence/Max").GetComponent <InputField>().interactable = true;
                    mainItemPane.Find("LevelRange/Min").GetComponent <InputField>().interactable   = true;
                    mainItemPane.Find("LevelRange/Max").GetComponent <InputField>().interactable   = true;
                    mainItemPane.Find("Health/Min").GetComponent <InputField>().interactable       = true;
                    mainItemPane.Find("Health/Max").GetComponent <InputField>().interactable       = true;

                    FetchPerkList();

                    int      val    = 0;
                    Dropdown tempdd = mainItemPane.Find("ItemType").GetComponent <Dropdown>();
                    if (itemRef.MyCraftedItemType == CraftedItemType.WEAPON)
                    {
                        for (int i = 0; i < System.Enum.GetNames(typeof(WeaponType)).Length; i++)
                        {
                            if (tempdd.options[i].text.ToLower() == (itemRef as CraftedWeapon).tarType.ToString().ToLower())
                            {
                                val = i;
                                break;
                            }
                        }
                    }
                    else if (itemRef.MyCraftedItemType == CraftedItemType.ARMOR)
                    {
                        for (int i = 0; i < System.Enum.GetNames(typeof(ArmorType)).Length; i++)
                        {
                            if (tempdd.options[i].text.ToLower() == (itemRef as CraftedArmor).tarType.ToString().ToLower())
                            {
                                val = i;
                                break;
                            }
                        }
                    }
                    tempdd.value = val;

                    for (int i = 0; i < perkListTransform.childCount; i++)
                    {
                        Toggle t = perkListTransform.GetChild(i).GetComponentInChildren <Toggle>();
                        if (equipRef.perks.Contains(Perks.ConvertTextToPerk(perkListTransform.GetChild(i).GetChild(0).GetComponent <Text>().text)))
                        {
                            t.isOn = true;
                        }
                        else
                        {
                            t.isOn = false;
                        }
                    }
                    print(itemRef.ItemName);
                }
            }
            else if (itemRef.MyCraftedItemType == CraftedItemType.REAGENT)
            {
                mainItemPane = recipeCreatorTransform.Find("ReagentBG/ItemTab");
                mainItemPane.Find("Name/Name").GetComponent <InputField>().text             = itemRef.ItemName;
                mainItemPane.Find("SpriteIcon/BG/Image").GetComponent <Image>().sprite      = Resources.Load <Sprite>("ItemIcons/ResourceIcons/" + itemRef.SpritePath);
                mainItemPane.Find("SpriteIcon/InputField").GetComponent <InputField>().text = itemRef.SpritePath;
                currItem = itemRef;
            }

            Dropdown tempDD = mainItemPane.Find("ProfGroup/ProfessionType").GetComponent <Dropdown>();
            for (int i = 0; i < tempDD.options.Count; i++)
            {
                if (Player_Skills_Script.ConvertStringToSkill(tempDD.options[i].text) == itemRef.RequiredProfession)
                {
                    tempDD.value = i;
                    break;
                }
            }
            mainItemPane.Find("ProfGroup/RequiredLevel").GetComponent <InputField>().text = itemRef.RequiredProfLevel.ToString();
            mainItemPane.Find("ProfGroup/RewardedExp").GetComponent <InputField>().text   = itemRef.RewardedExp.ToString();

            reagentController.LoadReagentList();
        }
    }
Exemple #5
0
        public Banker()
        {
            Name  = "Banker";
            Image = Graphics.resources.Res.Banker;
            SetMaxHp(950);
            SetArmor(15);
            SetResist(20);
            SetMaxEnergy(300);
            SetEnergyRegen(15);
            SetMovementSpeed(10);


            InterestRate = new Perk
            {
                Name        = "Interest Rate",
                Number      = (h) => ((InteresRateHeal + InterestRateHealAPScale * h.GetAbilityPower()) * 100),
                Explanation = (h) => "When level up, gives all allies " + InterestRateHpBuffAPScale * 100 + "% AP (" +
                              h.GetAbilityPower() * InterestRateHpBuffAPScale + ") HP; At the end of turn, heals allies in " +
                              InterestRateHealRange + " range for " + InteresRateHeal * 100 + " + " + InterestRateHealAPScale * 100 +
                              "% AP (" + (InteresRateHeal + InterestRateHealAPScale * h.GetAbilityPower()) + ")% target's lost HP",
                LevelUp = (a) => (d) =>
                {
                    var h      = d.HeroValue;
                    var hpBuff = GetAbilityPower() * InterestRateHpBuffAPScale;
                    var allies = h.P.Heroes.Where(hh => hh != h);
                    foreach (var ally in allies)
                    {
                        ally.AddMaxHp(hpBuff);
                        ally.AddHp(hpBuff);
                    }
                    return(a(d));
                },

                EndTurn = (a) => (d) =>
                {
                    var h       = d.HeroValue;
                    var targets = GetAlliesInRange(h, InterestRateHealRange);
                    //heal for % of lost HP
                    var percent = h.GetAbilityPower() * InterestRateHealAPScale + InteresRateHeal;
                    foreach (var ally in targets)
                    {
                        ally.GetHeal((ally.GetMaxHp() - ally.GetHp()) * percent);
                    }
                    return(a(d));
                },
            };
            Perks.Add(InterestRate);



            Investment = new Skill
            {
                Name        = "Investment",
                Explanation = () => "Give chosen ally " + InvestmentMoney + " + " + InvestmentAPScale * 100 + "%AP(" +
                              +(InvestmentMoney + InvestmentAPScale * GetAbilityPower()) + ") of your Money.CD " + InvestmentCD + ". Cost "
                              + InvestmentCost + ".",
                CoolDown   = InvestmentCD,
                EnergyCost = InvestmentCost,
                Job        = (h) =>
                {
                    var moneySent = Math.Min(InvestmentMoney + h.GetAbilityPower() * InvestmentAPScale, h.GetMoney());
                    var allies    = h.P.Heroes.Where(hh => hh != h).ToList();
                    if (allies.Count == 0)
                    {
                        return(false);
                    }
                    var target = ChooseTarget(allies, h.P);
                    if (target == null)
                    {
                        return(false);
                    }
                    h.Targets.Add(target);
                    foreach (var t in h.Targets)
                    {
                        t.AddMoney(moneySent);
                    }
                    h.AddMoney(-moneySent);
                    return(true);
                },
            };
            Investment.SkillTypes.Add(SkillType.Special);
            Skills.Add(Investment);


            CurrencyExchange = new Skill
            {
                Name        = "Exchange",
                Explanation = () => "Damage yourself by (" + ExchangeHP + " + " + ExchangeAPScale * 100 + "% AP)% of MaxHp ("
                              + (ExchangeHP + ExchangeAPScale * GetAbilityPower()) * GetMaxHp() + "). Earns " + ExchangeExpCoeff * 100 + "% ("
                              + (ExchangeHP + ExchangeAPScale * GetAbilityPower()) * ExchangeExpCoeff * GetMaxHp() + ") of it as EXP. CD " + ExchangeCD
                              + ". Cost " + ExchangeCost + ".",
                CoolDown   = ExchangeCD,
                EnergyCost = ExchangeCost,
                Job        = (h) =>
                {
                    var hpCost = h.GetMaxHp() * (ExchangeHP + ExchangeAPScale * h.GetAbilityPower());
                    if (hpCost >= h.GetHp())
                    {
                        hpCost = h.GetHp() - 1;
                    }
                    h.AddHp(-hpCost);
                    h.P.NotifyAboutDamage(new Damage(h, h.P, 0, 0, hpCost * ExchangeExpCoeff));
                    return(true);
                },
            };
            CurrencyExchange.SkillTypes.Add(SkillType.Special);
            Skills.Add(CurrencyExchange);
        }
Exemple #6
0
    void ActivePerk(Perks perk)
    {
        switch (perk.index)
        {
        case 0:
            PlayerStats.Dmg += 5;
            itemList.Remove(itemList[0]);
            itemList.Insert(0, nullPerk);
            break;

        case 1:
            PlayerStats.FireSpd -= 0.1f;
            itemList.Remove(itemList[1]);
            itemList.Insert(1, nullPerk);
            break;

        case 2:
            PlayerStats.Spd += 0.2f;
            itemList.Remove(itemList[2]);
            itemList.Insert(2, nullPerk);
            break;

        case 3:
            PlayerStats.CriChan += 0.05f;
            itemList.Remove(itemList[3]);
            itemList.Insert(3, nullPerk);
            break;

        case 4:
            for (int i = 0; i < playerPerks.slots.Length; i++)
            {
                if (playerPerks.isFull[i] == false)
                {
                    playerPerks.isFull[i] = true;
                    Instantiate(swordPerkButton, playerPerks.slots[i].transform, false);
                    break;
                }
            }
            itemList.Remove(itemList[4]);
            itemList.Insert(4, nullPerk);
            break;

        case 5:
            for (int i = 0; i < playerPerks.slots.Length; i++)
            {
                if (playerPerks.isFull[i] == false)
                {
                    playerPerks.isFull[i] = true;
                    Instantiate(trapPerkButton, playerPerks.slots[i].transform, false);
                    break;
                }
            }
            itemList.Remove(itemList[5]);
            itemList.Insert(5, nullPerk);
            break;

        case 6:
            for (int i = 0; i < playerPerks.slots.Length; i++)
            {
                if (playerPerks.isFull[i] == false)
                {
                    playerPerks.isFull[i] = true;
                    Instantiate(laserPerkButton, playerPerks.slots[i].transform, false);
                    break;
                }
            }
            itemList.Remove(itemList[6]);
            itemList.Insert(6, nullPerk);
            break;

        case 7:
            PlayerStats.Hp = PlayerStats.FullHp;
            break;

        //case 8:
        //    PlayerPerks.stunning = true;
        //    itemList.Remove(itemList[8]);
        //    itemList.Insert(8, nullPerk);
        //    break;
        //case 9:
        //    PlayerPerks.shotgun = true;
        //    itemList.Remove(itemList[9]);
        //    itemList.Insert(9, nullPerk);
        //    break;
        //case 10:
        //    PlayerPerks.focus = true;
        //    itemList.Remove(itemList[10]);
        //    itemList.Insert(10, nullPerk);
        //    break;
        //case 11:
        //    PlayerStats.FireSpd -= 0.05f;
        //    perk.price += 300;
        //    break;
        //case 12:
        //    PlayerPerks.homing = true;
        //    itemList.Remove(itemList[12]);
        //    itemList.Insert(12, nullPerk);
        //    break;
        //case 13:
        //    PlayerPerks.combo = true;
        //    itemList.Remove(itemList[13]);
        //    itemList.Insert(13, nullPerk);
        //    break;
        //case 14:
        //    PlayerPerks.sideShot = true;
        //    itemList.Remove(itemList[14]);
        //    itemList.Insert(14, nullPerk);
        //    break;
        default:
            break;
        }
    }
Exemple #7
0
        public Fe11()
        {
            Name  = "Fe11";
            Image = Graphics.resources.Res.Fe11;
            SetMaxHp(900);
            SetAttackDamage(30);
            SetResist(5);
            SetMovementSpeed(11);
            SetAttackRange(4);
            SetAttackSpeed(2);
            SetMaxEnergy(120);
            SetEnergyRegen(6);

            Stacks     = 0;
            WallStacks = 0;

            Rage = new Perk
            {
                Name        = "Rage",
                Explanation = (h) => "AD increased by " + RageADBuff * Stacks + " and armor by "
                              + RageArmorBuff * Stacks + ".",
                Number = (h) => (h as Fe11).Stacks,

                GetArmor        = (g) => () => g() + Stacks * RageArmorBuff,
                SetArmor        = (s) => (v) => s(v - Stacks * RageArmorBuff),
                GetAttackDamage = (g) => () => g() + Stacks * RageADBuff,
                SetAttackDamage = (s) => (v) => s(v - Stacks * RageADBuff),

                SkillFix = (sf) => {
                    if (sf.SkillTypes.Contains(SkillType.Attack))
                    {
                        var newSkill = new Skill()
                        {
                            SkillTypes = sf.SkillTypes,
                            Job        = (h) =>
                            {
                                var prev = sf.Job(h);
                                if (prev)
                                {
                                    (h as Fe11).Stacks++;
                                }
                                return(prev);
                            }
                        };

                        return(newSkill);
                    }
                    return(sf);
                },

                //Stuff from Wall skill
                EndTurn = (i) => (d) =>
                {
                    var h = (d.HeroValue as Fe11);
                    var a = i(d);
                    if (h.WallOn)
                    {
                        var wallCost = (WallBaseManaPerTurnCost * Math.Pow(WallTurnManaMultiplier, h.WallStacks));
                        if (h.GetEnergy() < wallCost)
                        {
                            WallControl.Disactivate(h);
                            h.M.Effects.Remove(WallControl);
                            h.WallStacks--;
                        }
                        else
                        {
                            h.AddEnergy(-wallCost);
                            h.WallStacks++;
                        }
                    }
                    else
                    {
                        if (h.WallStacks > 0)
                        {
                            h.WallStacks--;
                        }
                    }

                    return(a);
                },
            };
            Perks.Add(Rage);

            Skills.Remove(Attack);
            BuffedAttack = new Skill
            {
                Name        = Attack.Name,
                Explanation = () => Attack.Explanation() + "On attack increases you AD by " + RageADBuff + " and armor by " + RageArmorBuff + ".",
                Job         = Attack.Job
            };
            BuffedAttack.SkillTypes.Add(SkillType.Attack);
            Skills.Add(BuffedAttack);

            WallControl = new Effect(this, int.MaxValue)
            {
                Activate = (h) =>
                {
                    (h as Fe11).BuildWall(h);
                },
                Disactivate = (h) =>
                {
                    (h as Fe11).DestroyWall(h.M);
                },
            };

            Wall = new Skill
            {
                Name        = "YouShallNotPass",
                Explanation = () => WallOn ? "Destroyes the wall builded by this skill. (current cost " + WallBaseManaPerTurnCost * Math.Pow(WallTurnManaMultiplier, WallStacks) + ")"
                    : "Builds a wall in " + WallMinDist + "-" + WallMaxDist +
                              " range around you. On next use destroyes it. At the end of turn eats " + WallBaseManaPerTurnCost * Math.Pow(WallTurnManaMultiplier, WallStacks)
                              + " energy and increase its next cost by " +
                              WallTurnManaMultiplier * 100 + "% (when disactivated - decrease). energy at the end of turn (if not enough - turnes off).",

                Job = (h) =>
                {
                    if (WallOn)
                    {
                        WallControl.Disactivate(h);
                        h.M.Effects.Remove(WallControl);
                    }
                    else
                    {
                        h.M.Effects.Add(WallControl);
                        WallControl.Activate(h);
                    }

                    return(WallOn);
                },
            };
            Wall.SkillTypes.Add(SkillType.Special);
            Skills.Add(Wall);
        }
 public static float ExtraGold(Perks perks) => perks.HasPerk(PerksTypes.Greedy)
     ? 0.05f * perks.GetPerkLevel(PerksTypes.Greedy)
     : 0f;
Exemple #9
0
 public Perk[] GetPerks()
 {
     return(Perks.ToArray());
 }
Exemple #10
0
 public void AddPerk(Perk perk)
 {
     perk.Owner = this;
     Perks.Add(perk);
 }
    public static Perks AddPerk(PerkType Type) //Used to add a perk to a List
    {
        //Variable references to allow for a private setting.
        int    id                  = 0;
        string name                = "";
        string perkIcon            = "";
        float  damageIncrease      = 1f;
        float  healthIncrease      = 1f;
        float  gunCapacityincrease = 1f;
        float  lifeSteal           = 0f;
        float  instantRevive       = 1f;
        float  speedIncrease       = 1f;
        float  fireRateIncrease    = 1f;

        // PerkType;
        switch (Type) //Used to determine what type of perk is being added and changes the stats modifed in accordance.
        {
        case PerkType.HealthIncrease:
            id             = 0;
            name           = "frank";
            perkIcon       = "Health";
            healthIncrease = 1.50f;
            break;

        case PerkType.DamageIncrease:
            id             = 1;
            name           = "";
            perkIcon       = "Damage";
            damageIncrease = 1.20f;
            break;

        case PerkType.SpeedIncrease:
            id            = 2;
            name          = "";
            perkIcon      = "Speed";
            speedIncrease = 1.25f;
            break;

        case PerkType.FireRateIncrease:
            id               = 3;
            name             = "";
            perkIcon         = "Firerate";
            fireRateIncrease = 0.75f;
            break;

        case PerkType.InstantRevive:
            id            = 4;
            name          = "";
            perkIcon      = "InstantRevive";
            instantRevive = 0f;
            break;

        case PerkType.IncreasedGunCapacity:
            id                  = 5;
            name                = "";
            perkIcon            = "Capacity";
            gunCapacityincrease = 1.50f;
            break;

        case PerkType.Lifesteal:
            id        = 6;
            name      = "";
            perkIcon  = "Lifesteal";
            lifeSteal = 0.10f;
            break;
        }
        Perks temp = new Perks() //Creates the data for a new perk and applies the temp/private modifications to said perk then returns the perk as the value for AddPerk.
        {
            ID                  = id,
            Name                = name,
            DamageIncrease      = damageIncrease,
            SpeedIncrease       = speedIncrease,
            FireRateIncrease    = fireRateIncrease,
            InstantRevive       = instantRevive,
            GunCapacityIncrease = gunCapacityincrease,
            LifeSteal           = lifeSteal,
            HealthIncrease      = healthIncrease,
            Perk                = Type,
            PerkIcon            = Resources.Load("Icon/" + perkIcon) as Sprite
        };

        return(temp);
    }
Exemple #12
0
        public bool Equals(DestinyInventoryItemDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DisplayProperties == input.DisplayProperties ||
                     (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties))
                     ) &&
                 (
                     TooltipNotifications == input.TooltipNotifications ||
                     (TooltipNotifications != null && TooltipNotifications.SequenceEqual(input.TooltipNotifications))
                 ) &&
                 (
                     CollectibleHash == input.CollectibleHash ||
                     (CollectibleHash.Equals(input.CollectibleHash))
                 ) &&
                 (
                     IconWatermark == input.IconWatermark ||
                     (IconWatermark != null && IconWatermark.Equals(input.IconWatermark))
                 ) &&
                 (
                     IconWatermarkShelved == input.IconWatermarkShelved ||
                     (IconWatermarkShelved != null && IconWatermarkShelved.Equals(input.IconWatermarkShelved))
                 ) &&
                 (
                     SecondaryIcon == input.SecondaryIcon ||
                     (SecondaryIcon != null && SecondaryIcon.Equals(input.SecondaryIcon))
                 ) &&
                 (
                     SecondaryOverlay == input.SecondaryOverlay ||
                     (SecondaryOverlay != null && SecondaryOverlay.Equals(input.SecondaryOverlay))
                 ) &&
                 (
                     SecondarySpecial == input.SecondarySpecial ||
                     (SecondarySpecial != null && SecondarySpecial.Equals(input.SecondarySpecial))
                 ) &&
                 (
                     BackgroundColor == input.BackgroundColor ||
                     (BackgroundColor != null && BackgroundColor.Equals(input.BackgroundColor))
                 ) &&
                 (
                     Screenshot == input.Screenshot ||
                     (Screenshot != null && Screenshot.Equals(input.Screenshot))
                 ) &&
                 (
                     ItemTypeDisplayName == input.ItemTypeDisplayName ||
                     (ItemTypeDisplayName != null && ItemTypeDisplayName.Equals(input.ItemTypeDisplayName))
                 ) &&
                 (
                     FlavorText == input.FlavorText ||
                     (FlavorText != null && FlavorText.Equals(input.FlavorText))
                 ) &&
                 (
                     UiItemDisplayStyle == input.UiItemDisplayStyle ||
                     (UiItemDisplayStyle != null && UiItemDisplayStyle.Equals(input.UiItemDisplayStyle))
                 ) &&
                 (
                     ItemTypeAndTierDisplayName == input.ItemTypeAndTierDisplayName ||
                     (ItemTypeAndTierDisplayName != null && ItemTypeAndTierDisplayName.Equals(input.ItemTypeAndTierDisplayName))
                 ) &&
                 (
                     DisplaySource == input.DisplaySource ||
                     (DisplaySource != null && DisplaySource.Equals(input.DisplaySource))
                 ) &&
                 (
                     TooltipStyle == input.TooltipStyle ||
                     (TooltipStyle != null && TooltipStyle.Equals(input.TooltipStyle))
                 ) &&
                 (
                     Action == input.Action ||
                     (Action != null && Action.Equals(input.Action))
                 ) &&
                 (
                     Inventory == input.Inventory ||
                     (Inventory != null && Inventory.Equals(input.Inventory))
                 ) &&
                 (
                     SetData == input.SetData ||
                     (SetData != null && SetData.Equals(input.SetData))
                 ) &&
                 (
                     Stats == input.Stats ||
                     (Stats != null && Stats.Equals(input.Stats))
                 ) &&
                 (
                     EmblemObjectiveHash == input.EmblemObjectiveHash ||
                     (EmblemObjectiveHash.Equals(input.EmblemObjectiveHash))
                 ) &&
                 (
                     EquippingBlock == input.EquippingBlock ||
                     (EquippingBlock != null && EquippingBlock.Equals(input.EquippingBlock))
                 ) &&
                 (
                     TranslationBlock == input.TranslationBlock ||
                     (TranslationBlock != null && TranslationBlock.Equals(input.TranslationBlock))
                 ) &&
                 (
                     Preview == input.Preview ||
                     (Preview != null && Preview.Equals(input.Preview))
                 ) &&
                 (
                     Quality == input.Quality ||
                     (Quality != null && Quality.Equals(input.Quality))
                 ) &&
                 (
                     Value == input.Value ||
                     (Value != null && Value.Equals(input.Value))
                 ) &&
                 (
                     SourceData == input.SourceData ||
                     (SourceData != null && SourceData.Equals(input.SourceData))
                 ) &&
                 (
                     Objectives == input.Objectives ||
                     (Objectives != null && Objectives.Equals(input.Objectives))
                 ) &&
                 (
                     Metrics == input.Metrics ||
                     (Metrics != null && Metrics.Equals(input.Metrics))
                 ) &&
                 (
                     Plug == input.Plug ||
                     (Plug != null && Plug.Equals(input.Plug))
                 ) &&
                 (
                     Gearset == input.Gearset ||
                     (Gearset != null && Gearset.Equals(input.Gearset))
                 ) &&
                 (
                     Sack == input.Sack ||
                     (Sack != null && Sack.Equals(input.Sack))
                 ) &&
                 (
                     Sockets == input.Sockets ||
                     (Sockets != null && Sockets.Equals(input.Sockets))
                 ) &&
                 (
                     Summary == input.Summary ||
                     (Summary != null && Summary.Equals(input.Summary))
                 ) &&
                 (
                     TalentGrid == input.TalentGrid ||
                     (TalentGrid != null && TalentGrid.Equals(input.TalentGrid))
                 ) &&
                 (
                     InvestmentStats == input.InvestmentStats ||
                     (InvestmentStats != null && InvestmentStats.SequenceEqual(input.InvestmentStats))
                 ) &&
                 (
                     Perks == input.Perks ||
                     (Perks != null && Perks.SequenceEqual(input.Perks))
                 ) &&
                 (
                     LoreHash == input.LoreHash ||
                     (LoreHash.Equals(input.LoreHash))
                 ) &&
                 (
                     SummaryItemHash == input.SummaryItemHash ||
                     (SummaryItemHash.Equals(input.SummaryItemHash))
                 ) &&
                 (
                     Animations == input.Animations ||
                     (Animations != null && Animations.SequenceEqual(input.Animations))
                 ) &&
                 (
                     AllowActions == input.AllowActions ||
                     (AllowActions != null && AllowActions.Equals(input.AllowActions))
                 ) &&
                 (
                     Links == input.Links ||
                     (Links != null && Links.SequenceEqual(input.Links))
                 ) &&
                 (
                     DoesPostmasterPullHaveSideEffects == input.DoesPostmasterPullHaveSideEffects ||
                     (DoesPostmasterPullHaveSideEffects != null && DoesPostmasterPullHaveSideEffects.Equals(input.DoesPostmasterPullHaveSideEffects))
                 ) &&
                 (
                     NonTransferrable == input.NonTransferrable ||
                     (NonTransferrable != null && NonTransferrable.Equals(input.NonTransferrable))
                 ) &&
                 (
                     ItemCategoryHashes == input.ItemCategoryHashes ||
                     (ItemCategoryHashes != null && ItemCategoryHashes.SequenceEqual(input.ItemCategoryHashes))
                 ) &&
                 (
                     SpecialItemType == input.SpecialItemType ||
                     (SpecialItemType != null && SpecialItemType.Equals(input.SpecialItemType))
                 ) &&
                 (
                     ItemType == input.ItemType ||
                     (ItemType != null && ItemType.Equals(input.ItemType))
                 ) &&
                 (
                     ItemSubType == input.ItemSubType ||
                     (ItemSubType != null && ItemSubType.Equals(input.ItemSubType))
                 ) &&
                 (
                     ClassType == input.ClassType ||
                     (ClassType != null && ClassType.Equals(input.ClassType))
                 ) &&
                 (
                     BreakerType == input.BreakerType ||
                     (BreakerType != null && BreakerType.Equals(input.BreakerType))
                 ) &&
                 (
                     BreakerTypeHash == input.BreakerTypeHash ||
                     (BreakerTypeHash.Equals(input.BreakerTypeHash))
                 ) &&
                 (
                     Equippable == input.Equippable ||
                     (Equippable != null && Equippable.Equals(input.Equippable))
                 ) &&
                 (
                     DamageTypeHashes == input.DamageTypeHashes ||
                     (DamageTypeHashes != null && DamageTypeHashes.SequenceEqual(input.DamageTypeHashes))
                 ) &&
                 (
                     DamageTypes == input.DamageTypes ||
                     (DamageTypes != null && DamageTypes.SequenceEqual(input.DamageTypes))
                 ) &&
                 (
                     DefaultDamageType == input.DefaultDamageType ||
                     (DefaultDamageType != null && DefaultDamageType.Equals(input.DefaultDamageType))
                 ) &&
                 (
                     DefaultDamageTypeHash == input.DefaultDamageTypeHash ||
                     (DefaultDamageTypeHash.Equals(input.DefaultDamageTypeHash))
                 ) &&
                 (
                     SeasonHash == input.SeasonHash ||
                     (SeasonHash.Equals(input.SeasonHash))
                 ) &&
                 (
                     IsWrapper == input.IsWrapper ||
                     (IsWrapper != null && IsWrapper.Equals(input.IsWrapper))
                 ) &&
                 (
                     TraitIds == input.TraitIds ||
                     (TraitIds != null && TraitIds.SequenceEqual(input.TraitIds))
                 ) &&
                 (
                     TraitHashes == input.TraitHashes ||
                     (TraitHashes != null && TraitHashes.SequenceEqual(input.TraitHashes))
                 ) &&
                 (
                     Hash == input.Hash ||
                     (Hash.Equals(input.Hash))
                 ) &&
                 (
                     Index == input.Index ||
                     (Index.Equals(input.Index))
                 ) &&
                 (
                     Redacted == input.Redacted ||
                     (Redacted != null && Redacted.Equals(input.Redacted))
                 ));
        }
 public void Update(DestinyInventoryItemDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (!DisplayProperties.DeepEquals(other.DisplayProperties))
     {
         DisplayProperties.Update(other.DisplayProperties);
         OnPropertyChanged(nameof(DisplayProperties));
     }
     if (!TooltipNotifications.DeepEqualsList(other.TooltipNotifications))
     {
         TooltipNotifications = other.TooltipNotifications;
         OnPropertyChanged(nameof(TooltipNotifications));
     }
     if (CollectibleHash != other.CollectibleHash)
     {
         CollectibleHash = other.CollectibleHash;
         OnPropertyChanged(nameof(CollectibleHash));
     }
     if (IconWatermark != other.IconWatermark)
     {
         IconWatermark = other.IconWatermark;
         OnPropertyChanged(nameof(IconWatermark));
     }
     if (IconWatermarkShelved != other.IconWatermarkShelved)
     {
         IconWatermarkShelved = other.IconWatermarkShelved;
         OnPropertyChanged(nameof(IconWatermarkShelved));
     }
     if (SecondaryIcon != other.SecondaryIcon)
     {
         SecondaryIcon = other.SecondaryIcon;
         OnPropertyChanged(nameof(SecondaryIcon));
     }
     if (SecondaryOverlay != other.SecondaryOverlay)
     {
         SecondaryOverlay = other.SecondaryOverlay;
         OnPropertyChanged(nameof(SecondaryOverlay));
     }
     if (SecondarySpecial != other.SecondarySpecial)
     {
         SecondarySpecial = other.SecondarySpecial;
         OnPropertyChanged(nameof(SecondarySpecial));
     }
     if (!BackgroundColor.DeepEquals(other.BackgroundColor))
     {
         BackgroundColor.Update(other.BackgroundColor);
         OnPropertyChanged(nameof(BackgroundColor));
     }
     if (Screenshot != other.Screenshot)
     {
         Screenshot = other.Screenshot;
         OnPropertyChanged(nameof(Screenshot));
     }
     if (ItemTypeDisplayName != other.ItemTypeDisplayName)
     {
         ItemTypeDisplayName = other.ItemTypeDisplayName;
         OnPropertyChanged(nameof(ItemTypeDisplayName));
     }
     if (FlavorText != other.FlavorText)
     {
         FlavorText = other.FlavorText;
         OnPropertyChanged(nameof(FlavorText));
     }
     if (UiItemDisplayStyle != other.UiItemDisplayStyle)
     {
         UiItemDisplayStyle = other.UiItemDisplayStyle;
         OnPropertyChanged(nameof(UiItemDisplayStyle));
     }
     if (ItemTypeAndTierDisplayName != other.ItemTypeAndTierDisplayName)
     {
         ItemTypeAndTierDisplayName = other.ItemTypeAndTierDisplayName;
         OnPropertyChanged(nameof(ItemTypeAndTierDisplayName));
     }
     if (DisplaySource != other.DisplaySource)
     {
         DisplaySource = other.DisplaySource;
         OnPropertyChanged(nameof(DisplaySource));
     }
     if (TooltipStyle != other.TooltipStyle)
     {
         TooltipStyle = other.TooltipStyle;
         OnPropertyChanged(nameof(TooltipStyle));
     }
     if (!Action.DeepEquals(other.Action))
     {
         Action.Update(other.Action);
         OnPropertyChanged(nameof(Action));
     }
     if (!Inventory.DeepEquals(other.Inventory))
     {
         Inventory.Update(other.Inventory);
         OnPropertyChanged(nameof(Inventory));
     }
     if (!SetData.DeepEquals(other.SetData))
     {
         SetData.Update(other.SetData);
         OnPropertyChanged(nameof(SetData));
     }
     if (!Stats.DeepEquals(other.Stats))
     {
         Stats.Update(other.Stats);
         OnPropertyChanged(nameof(Stats));
     }
     if (EmblemObjectiveHash != other.EmblemObjectiveHash)
     {
         EmblemObjectiveHash = other.EmblemObjectiveHash;
         OnPropertyChanged(nameof(EmblemObjectiveHash));
     }
     if (!EquippingBlock.DeepEquals(other.EquippingBlock))
     {
         EquippingBlock.Update(other.EquippingBlock);
         OnPropertyChanged(nameof(EquippingBlock));
     }
     if (!TranslationBlock.DeepEquals(other.TranslationBlock))
     {
         TranslationBlock.Update(other.TranslationBlock);
         OnPropertyChanged(nameof(TranslationBlock));
     }
     if (!Preview.DeepEquals(other.Preview))
     {
         Preview.Update(other.Preview);
         OnPropertyChanged(nameof(Preview));
     }
     if (!Quality.DeepEquals(other.Quality))
     {
         Quality.Update(other.Quality);
         OnPropertyChanged(nameof(Quality));
     }
     if (!Value.DeepEquals(other.Value))
     {
         Value.Update(other.Value);
         OnPropertyChanged(nameof(Value));
     }
     if (!SourceData.DeepEquals(other.SourceData))
     {
         SourceData.Update(other.SourceData);
         OnPropertyChanged(nameof(SourceData));
     }
     if (!Objectives.DeepEquals(other.Objectives))
     {
         Objectives.Update(other.Objectives);
         OnPropertyChanged(nameof(Objectives));
     }
     if (!Metrics.DeepEquals(other.Metrics))
     {
         Metrics.Update(other.Metrics);
         OnPropertyChanged(nameof(Metrics));
     }
     if (!Plug.DeepEquals(other.Plug))
     {
         Plug.Update(other.Plug);
         OnPropertyChanged(nameof(Plug));
     }
     if (!Gearset.DeepEquals(other.Gearset))
     {
         Gearset.Update(other.Gearset);
         OnPropertyChanged(nameof(Gearset));
     }
     if (!Sack.DeepEquals(other.Sack))
     {
         Sack.Update(other.Sack);
         OnPropertyChanged(nameof(Sack));
     }
     if (!Sockets.DeepEquals(other.Sockets))
     {
         Sockets.Update(other.Sockets);
         OnPropertyChanged(nameof(Sockets));
     }
     if (!Summary.DeepEquals(other.Summary))
     {
         Summary.Update(other.Summary);
         OnPropertyChanged(nameof(Summary));
     }
     if (!TalentGrid.DeepEquals(other.TalentGrid))
     {
         TalentGrid.Update(other.TalentGrid);
         OnPropertyChanged(nameof(TalentGrid));
     }
     if (!InvestmentStats.DeepEqualsList(other.InvestmentStats))
     {
         InvestmentStats = other.InvestmentStats;
         OnPropertyChanged(nameof(InvestmentStats));
     }
     if (!Perks.DeepEqualsList(other.Perks))
     {
         Perks = other.Perks;
         OnPropertyChanged(nameof(Perks));
     }
     if (LoreHash != other.LoreHash)
     {
         LoreHash = other.LoreHash;
         OnPropertyChanged(nameof(LoreHash));
     }
     if (SummaryItemHash != other.SummaryItemHash)
     {
         SummaryItemHash = other.SummaryItemHash;
         OnPropertyChanged(nameof(SummaryItemHash));
     }
     if (!Animations.DeepEqualsList(other.Animations))
     {
         Animations = other.Animations;
         OnPropertyChanged(nameof(Animations));
     }
     if (AllowActions != other.AllowActions)
     {
         AllowActions = other.AllowActions;
         OnPropertyChanged(nameof(AllowActions));
     }
     if (!Links.DeepEqualsList(other.Links))
     {
         Links = other.Links;
         OnPropertyChanged(nameof(Links));
     }
     if (DoesPostmasterPullHaveSideEffects != other.DoesPostmasterPullHaveSideEffects)
     {
         DoesPostmasterPullHaveSideEffects = other.DoesPostmasterPullHaveSideEffects;
         OnPropertyChanged(nameof(DoesPostmasterPullHaveSideEffects));
     }
     if (NonTransferrable != other.NonTransferrable)
     {
         NonTransferrable = other.NonTransferrable;
         OnPropertyChanged(nameof(NonTransferrable));
     }
     if (!ItemCategoryHashes.DeepEqualsListNaive(other.ItemCategoryHashes))
     {
         ItemCategoryHashes = other.ItemCategoryHashes;
         OnPropertyChanged(nameof(ItemCategoryHashes));
     }
     if (SpecialItemType != other.SpecialItemType)
     {
         SpecialItemType = other.SpecialItemType;
         OnPropertyChanged(nameof(SpecialItemType));
     }
     if (ItemType != other.ItemType)
     {
         ItemType = other.ItemType;
         OnPropertyChanged(nameof(ItemType));
     }
     if (ItemSubType != other.ItemSubType)
     {
         ItemSubType = other.ItemSubType;
         OnPropertyChanged(nameof(ItemSubType));
     }
     if (ClassType != other.ClassType)
     {
         ClassType = other.ClassType;
         OnPropertyChanged(nameof(ClassType));
     }
     if (BreakerType != other.BreakerType)
     {
         BreakerType = other.BreakerType;
         OnPropertyChanged(nameof(BreakerType));
     }
     if (BreakerTypeHash != other.BreakerTypeHash)
     {
         BreakerTypeHash = other.BreakerTypeHash;
         OnPropertyChanged(nameof(BreakerTypeHash));
     }
     if (Equippable != other.Equippable)
     {
         Equippable = other.Equippable;
         OnPropertyChanged(nameof(Equippable));
     }
     if (!DamageTypeHashes.DeepEqualsListNaive(other.DamageTypeHashes))
     {
         DamageTypeHashes = other.DamageTypeHashes;
         OnPropertyChanged(nameof(DamageTypeHashes));
     }
     if (!DamageTypes.DeepEqualsListNaive(other.DamageTypes))
     {
         DamageTypes = other.DamageTypes;
         OnPropertyChanged(nameof(DamageTypes));
     }
     if (DefaultDamageType != other.DefaultDamageType)
     {
         DefaultDamageType = other.DefaultDamageType;
         OnPropertyChanged(nameof(DefaultDamageType));
     }
     if (DefaultDamageTypeHash != other.DefaultDamageTypeHash)
     {
         DefaultDamageTypeHash = other.DefaultDamageTypeHash;
         OnPropertyChanged(nameof(DefaultDamageTypeHash));
     }
     if (SeasonHash != other.SeasonHash)
     {
         SeasonHash = other.SeasonHash;
         OnPropertyChanged(nameof(SeasonHash));
     }
     if (IsWrapper != other.IsWrapper)
     {
         IsWrapper = other.IsWrapper;
         OnPropertyChanged(nameof(IsWrapper));
     }
     if (!TraitIds.DeepEqualsListNaive(other.TraitIds))
     {
         TraitIds = other.TraitIds;
         OnPropertyChanged(nameof(TraitIds));
     }
     if (!TraitHashes.DeepEqualsListNaive(other.TraitHashes))
     {
         TraitHashes = other.TraitHashes;
         OnPropertyChanged(nameof(TraitHashes));
     }
     if (Hash != other.Hash)
     {
         Hash = other.Hash;
         OnPropertyChanged(nameof(Hash));
     }
     if (Index != other.Index)
     {
         Index = other.Index;
         OnPropertyChanged(nameof(Index));
     }
     if (Redacted != other.Redacted)
     {
         Redacted = other.Redacted;
         OnPropertyChanged(nameof(Redacted));
     }
 }
 public bool DeepEquals(DestinyInventoryItemDefinition?other)
 {
     return(other is not null &&
            (DisplayProperties is not null ? DisplayProperties.DeepEquals(other.DisplayProperties) : other.DisplayProperties is null) &&
            TooltipNotifications.DeepEqualsList(other.TooltipNotifications) &&
            CollectibleHash == other.CollectibleHash &&
            IconWatermark == other.IconWatermark &&
            IconWatermarkShelved == other.IconWatermarkShelved &&
            SecondaryIcon == other.SecondaryIcon &&
            SecondaryOverlay == other.SecondaryOverlay &&
            SecondarySpecial == other.SecondarySpecial &&
            (BackgroundColor is not null ? BackgroundColor.DeepEquals(other.BackgroundColor) : other.BackgroundColor is null) &&
            Screenshot == other.Screenshot &&
            ItemTypeDisplayName == other.ItemTypeDisplayName &&
            FlavorText == other.FlavorText &&
            UiItemDisplayStyle == other.UiItemDisplayStyle &&
            ItemTypeAndTierDisplayName == other.ItemTypeAndTierDisplayName &&
            DisplaySource == other.DisplaySource &&
            TooltipStyle == other.TooltipStyle &&
            (Action is not null ? Action.DeepEquals(other.Action) : other.Action is null) &&
            (Inventory is not null ? Inventory.DeepEquals(other.Inventory) : other.Inventory is null) &&
            (SetData is not null ? SetData.DeepEquals(other.SetData) : other.SetData is null) &&
            (Stats is not null ? Stats.DeepEquals(other.Stats) : other.Stats is null) &&
            EmblemObjectiveHash == other.EmblemObjectiveHash &&
            (EquippingBlock is not null ? EquippingBlock.DeepEquals(other.EquippingBlock) : other.EquippingBlock is null) &&
            (TranslationBlock is not null ? TranslationBlock.DeepEquals(other.TranslationBlock) : other.TranslationBlock is null) &&
            (Preview is not null ? Preview.DeepEquals(other.Preview) : other.Preview is null) &&
            (Quality is not null ? Quality.DeepEquals(other.Quality) : other.Quality is null) &&
            (Value is not null ? Value.DeepEquals(other.Value) : other.Value is null) &&
            (SourceData is not null ? SourceData.DeepEquals(other.SourceData) : other.SourceData is null) &&
            (Objectives is not null ? Objectives.DeepEquals(other.Objectives) : other.Objectives is null) &&
            (Metrics is not null ? Metrics.DeepEquals(other.Metrics) : other.Metrics is null) &&
            (Plug is not null ? Plug.DeepEquals(other.Plug) : other.Plug is null) &&
            (Gearset is not null ? Gearset.DeepEquals(other.Gearset) : other.Gearset is null) &&
            (Sack is not null ? Sack.DeepEquals(other.Sack) : other.Sack is null) &&
            (Sockets is not null ? Sockets.DeepEquals(other.Sockets) : other.Sockets is null) &&
            (Summary is not null ? Summary.DeepEquals(other.Summary) : other.Summary is null) &&
            (TalentGrid is not null ? TalentGrid.DeepEquals(other.TalentGrid) : other.TalentGrid is null) &&
            InvestmentStats.DeepEqualsList(other.InvestmentStats) &&
            Perks.DeepEqualsList(other.Perks) &&
            LoreHash == other.LoreHash &&
            SummaryItemHash == other.SummaryItemHash &&
            Animations.DeepEqualsList(other.Animations) &&
            AllowActions == other.AllowActions &&
            Links.DeepEqualsList(other.Links) &&
            DoesPostmasterPullHaveSideEffects == other.DoesPostmasterPullHaveSideEffects &&
            NonTransferrable == other.NonTransferrable &&
            ItemCategoryHashes.DeepEqualsListNaive(other.ItemCategoryHashes) &&
            SpecialItemType == other.SpecialItemType &&
            ItemType == other.ItemType &&
            ItemSubType == other.ItemSubType &&
            ClassType == other.ClassType &&
            BreakerType == other.BreakerType &&
            BreakerTypeHash == other.BreakerTypeHash &&
            Equippable == other.Equippable &&
            DamageTypeHashes.DeepEqualsListNaive(other.DamageTypeHashes) &&
            DamageTypes.DeepEqualsListNaive(other.DamageTypes) &&
            DefaultDamageType == other.DefaultDamageType &&
            DefaultDamageTypeHash == other.DefaultDamageTypeHash &&
            SeasonHash == other.SeasonHash &&
            IsWrapper == other.IsWrapper &&
            TraitIds.DeepEqualsListNaive(other.TraitIds) &&
            TraitHashes.DeepEqualsListNaive(other.TraitHashes) &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
 public static float GetExtraDrained(Perks perks) => perks.HasPerk(PerksTypes.EssenceFlow)
     ? 10f * perks.GetPerkLevel(PerksTypes.EssenceFlow) : 0;
Exemple #16
0
 public Perk GetPerk(PerkType type)
 {
     return(Perks.Find(x => x.Type == type));
 }
 public static float ExtraGive(Perks perks) => perks.HasPerk(PerksTypes.EssenceShaper)
      ? 5f * perks.GetPerkLevel(PerksTypes.EssenceShaper) : 0;
Exemple #18
0
        //public static myCoords myCurrentCoords = new myCoords();
        //public struct myCoords
        //{
        //    public int x;
        //    public int y;
        //}
        public static void Main(string[] args)
        {
            myHome.x = 0;
            myHome.y = 0;
            myHome.heading = 0;
            myHome.mapName = "";
            // Create instance of the log file handler
            Logger MyLogger = new Logger();

            // Create instance of the TCP client
            TCPClient.TCPClient MyTCPClient = new TCPClient.TCPClient();

            // Initialize the TCPWrapper
            TCPWrapper MyTCPWrapper = new TCPWrapper(MyTCPClient, MyLogger);

            // set up working directory
            if (args.Length > 0)
            {
                string botName = args[0];
                launchPath = args[1];
                SqlServer = args[2];
                SqlPort = Convert.ToInt16(args[3]);
                SqlUsername = args[4];
                SqlPassword = args[5];
                SqlDatabase = args[6];
                Environment.CurrentDirectory = launchPath + botName;
            }
            if (Environment.CurrentDirectory.ToLower().Contains("Live".ToLower()))
            {
                serverName = "live";
            }
            else if (Environment.CurrentDirectory.ToLower().Contains("Test".ToLower()))
            {
                serverName = "test";
            }
            else if (Environment.CurrentDirectory.ToLower().Contains("PK".ToLower()))
            {
                serverName = "pk";
            }
            else
            {
                launchedByBotManager = false;
            launchPath = "C:\\bot\\test\\";
                Console.WriteLine("serverName not found in file path, defaulting to test");
                Console.WriteLine("path containing cs-elbot.exe should be something like c:/bot/test/botname/");
                Console.WriteLine("If you're not using bot manager, don't worry about this message");
            }

            Settings MySettings = new Settings();

            //Load Sql Configuration if not supplied in parameters
            if (SqlServer == "")
            {
                MySettings.LoadSqlSettingsFromConfigfile();
            }

            MySettings.LoadSettings();
            errorHandler MyErrorHandler = new errorHandler();

            //Setup the MySQL Database
            MySqlManager MyMySqlManager = new MySqlManager(SqlServer, SqlUsername, SqlPassword, SqlDatabase, SqlPort, MyLogger, MyTCPWrapper, MyErrorHandler);
            Settings.TradeTimeOut = MyMySqlManager.GetTimeoutInterval(Settings.botid);
            botType = MyMySqlManager.getBotType(Settings.botid);
            //Console.WriteLine("Bot type: " + botType);

            MyMySqlManager.ImStarted(Settings.botid);
            Settings.URL = MyMySqlManager.getURL() + Settings.Loginname + ".php";

            try
            {
                System.Net.IPHostEntry ServerIPHostEntry = System.Net.Dns.GetHostEntry(Settings.ServerHostname);
                MyTCPWrapper.HostIp = ServerIPHostEntry.AddressList[0];
                MyTCPWrapper.Port = Settings.ServerPort;

                Logging.CommandLogger MyCommandDebugger = new Logging.CommandLogger(MyTCPWrapper, MyLogger);

                //BasicCommunication.HeartBeat MyHeartBeat = new BasicCommunication.HeartBeat(MyTCPWrapper, MyErrorHandler);
                BasicCommunication.HeartBeat MyHeartBeat = new BasicCommunication.HeartBeat(MyTCPWrapper);
                BasicCommunication.Ping MyPing = new BasicCommunication.Ping(MyTCPWrapper);
                Inventory MyInventory = new Inventory(MyTCPWrapper, MyLogger, MyMySqlManager);
                Storage MyStorage = new Storage(MyTCPWrapper, MyLogger, MyMySqlManager);
                BasicCommunication.new_minute MyMewMinute = new BasicCommunication.new_minute(MyTCPWrapper, MyMySqlManager, MyInventory);

                // Login here
                BasicCommunication.Login MyLogin = new BasicCommunication.Login(MyTCPWrapper);
                BasicCommunication.RawText MyRawText = new BasicCommunication.RawText(MyTCPWrapper);
                BasicCommunication.MessageParser MyMessageParser = new BasicCommunication.MessageParser(MyRawText, MyLogger, MyTCPWrapper, MyMySqlManager);
                BasicCommunication.changeMap MyChangeMap = new BasicCommunication.changeMap(MyTCPWrapper);

                //if this is a storage bot (not a tradebot) start a shutdown timer
                if (Settings.IsTradeBot == false && botType == 2)
                {
                    BasicCommunication.Shutdown MyShutdown = new BasicCommunication.Shutdown(MyTCPWrapper, MyMessageParser, MyMySqlManager, MyErrorHandler);
                }

                Logging.LoginLogger MyLoginLogger = new Logging.LoginLogger(MyLogin, MyLogger, MyTCPWrapper, MyMySqlManager);
                Logging.MessageLogger MyMessageLogger = new Logging.MessageLogger(MyMessageParser, MyLogger, MyMySqlManager);

                AdvancedCommunication.ActorHandler MyActorHandler = new AdvancedCommunication.ActorHandler(MyTCPWrapper, MyLogger, MyMySqlManager);

                AdvancedCommunication.PMHandler MyPMHandler = new AdvancedCommunication.PMHandler(MyTCPWrapper, MyMessageParser, MyMySqlManager);
                AdvancedCommunication.HelpCommandHandler MyHelpCommandHandler = new AdvancedCommunication.HelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager);
                AdvancedCommunication.AdvHelpCommandHandler MyAdvHelpCommandHandler = new AdvancedCommunication.AdvHelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager, MyHelpCommandHandler);
                AdvancedCommunication.AdminHelpCommandHandler MyAdminHelpCommandHandler = new AdvancedCommunication.AdminHelpCommandHandler(MyTCPWrapper, MyMessageParser, MyPMHandler, MyMySqlManager, MyAdvHelpCommandHandler);
                AdvancedCommunication.SAYCommandHandler MySAYCommandHandler = new AdvancedCommunication.SAYCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyPMHandler);
                AdvancedCommunication.PMCommandHandler MyPMCommandHandler = new AdvancedCommunication.PMCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager);

                AdvancedCommunication.BuddyHandler MyBuddyHandler = new AdvancedCommunication.BuddyHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogin);

                //get my stats
                Stats MyStats = new Stats(MyTCPWrapper, MyLogger, MyMySqlManager);

                TradeHandler MyTradeHandler = new TradeHandler(MyTCPWrapper, MyMessageParser, MyMySqlManager, MyInventory, MyActorHandler, MyLogger, MyStorage, MyErrorHandler, MyHelpCommandHandler);

                AdvancedCommunication.INVCommandHandler MyINVCommandHandler = new AdvancedCommunication.INVCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.INVRCommandHandler MyINVRCommandHandler = new AdvancedCommunication.INVRCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.STOCommandHandler MySTOCommandHandler = new AdvancedCommunication.STOCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyStorage, MyTradeHandler, MyStats);
                AdvancedCommunication.INVLISTCommandHandler MyINVLISTCommandHandler = new AdvancedCommunication.INVLISTCommandHandler(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats);
                AdvancedCommunication.ReserveCommandHandler MyReserveCommandHandler = new AdvancedCommunication.ReserveCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyStorage);

                AdvancedCommunication.GiveCommandHandler MyGiveCommandHandler = new AdvancedCommunication.GiveCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);
                AdvancedCommunication.GiveToCommandHandler MyGiveToCommandHandler = new AdvancedCommunication.GiveToCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);
                AdvancedCommunication.BUYCommandHandler MyBUYCommandHandler = new AdvancedCommunication.BUYCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.DESCRIBECommandHandler MyDESCRIBECommandHandler = new AdvancedCommunication.DESCRIBECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyPMHandler);

                AdvancedCommunication.DONATECommandHandler MyDONATECommandHandler = new AdvancedCommunication.DONATECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.PUTONSALECommandHandler MyPUTONSALECommandHandler = new AdvancedCommunication.PUTONSALECommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.WANTEDCommandHandler MyWANTEDCommandHandler = new AdvancedCommunication.WANTEDCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyStats);
                AdvancedCommunication.LOCCommandHandler MyLOCCommandHandler = new AdvancedCommunication.LOCCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.BANCommandHandler MyBANCommandHandler = new AdvancedCommunication.BANCommandHandler(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.DropCommandHandler MyDropCommandHandler = new AdvancedCommunication.DropCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.LaunchCommandHandler MyLaunchCommandHandler = new AdvancedCommunication.LaunchCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.QuitCommandHandler MyQuitCommandHandler = new AdvancedCommunication.QuitCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.WearCommandHandler MyWearCommandHandler = new AdvancedCommunication.WearCommandHandler(MyActorHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.UseItemCommandHandler MyUseItemCommandHandler = new AdvancedCommunication.UseItemCommandHandler(MyActorHandler, MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);

                AdvancedCommunication.ABOUTCommandHandler MyABOUTCommandHandler = new AdvancedCommunication.ABOUTCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.AFKCommandHandler MyAFKCommandHandler = new AdvancedCommunication.AFKCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.ELTCCommandHandler MyELTCCommandHandler = new AdvancedCommunication.ELTCCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);

                AdvancedCommunication.ACCEPTMECommandHandler MyACCEPTMECommandHandler = new AdvancedCommunication.ACCEPTMECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.KICKMECommandHandler MyKICKMECommandHandler = new AdvancedCommunication.KICKMECommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.GTCommandHandler MyGTCommandHandler = new AdvancedCommunication.GTCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.GuildTextHandler MyGuildTextHandler = new AdvancedCommunication.GuildTextHandler(MyRawText, MyTCPWrapper, MyMessageParser, MyMySqlManager, MyLogger);

                AdvancedCommunication.GreetPlayers MyGreetPlayers = new AdvancedCommunication.GreetPlayers(MyTCPWrapper, MyMySqlManager, MyActorHandler);
                AdvancedCommunication.AdvertHandler MyAdvertHandler = new AdvancedCommunication.AdvertHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyErrorHandler);
                AdvancedCommunication.HouseKeepingHandler MyHouseKeepingHandler = new AdvancedCommunication.HouseKeepingHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyErrorHandler);
                AdvancedCommunication.AltAdvertHandler MyAltAdvertHandler = new AdvancedCommunication.AltAdvertHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory, MyErrorHandler);
                //AdvancedCommunication.RulesHandler MyRulesHandler = new AdvancedCommunication.RulesHandler(MyTCPWrapper, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.MOVECommandHandler MyMOVECommandHandler = new AdvancedCommunication.MOVECommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);
                AdvancedCommunication.SitStandCommandHandler MySitStandCommandHandler = new AdvancedCommunication.SitStandCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);
                AdvancedCommunication.RetradeCommandHandler MyRetradeCommandHandler = new AdvancedCommunication.RetradeCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyActorHandler, MyTradeHandler);
                AdvancedCommunication.TextCommandsHandler MyTextCommandsHandler = new AdvancedCommunication.TextCommandsHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);
                AdvancedCommunication.WhoIsTradingCommandHandler MyWhoIsTradingHandler = new cs_elbot.AdvancedCommunication.WhoIsTradingCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);
                AdvancedCommunication.CancelTradeCommandHandler MyCancelTradeHandler = new cs_elbot.AdvancedCommunication.CancelTradeCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler);

                //goto command handler
                AdvancedCommunication.GotoCommandHandler MyGotoCommandHandler = new cs_elbot.AdvancedCommunication.GotoCommandHandler(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler, MyActorHandler);

                //use object command handler
                AdvancedCommunication.UseObject MyUseObjectCommandHandler = new cs_elbot.AdvancedCommunication.UseObject(MyTCPWrapper, MyMessageParser, MyAdminHelpCommandHandler, MyMySqlManager, MyPMHandler);

                //openstorage
                AdvancedCommunication.OpenStorage MyOpenStorageCommandHandler = new cs_elbot.AdvancedCommunication.OpenStorage(MyHelpCommandHandler, MyTCPWrapper, MyMessageParser, MyMySqlManager, MyActorHandler, MyAdminHelpCommandHandler);
                //withdraw
                AdvancedCommunication.WithdrawCommandHandler MyWithdrawCommandHandler = new cs_elbot.AdvancedCommunication.WithdrawCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyStorage, MyTradeHandler, MyStats, MyInventory);
                AdvancedCommunication.DepositCommandHandler MyDepositCommandHandler = new cs_elbot.AdvancedCommunication.DepositCommandHandler(MyTCPWrapper, MyMessageParser, MyAdvHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyStorage);

                //gamble
                AdvancedCommunication.GAMBLECommandHandler MyGAMBLECommandHandler = new AdvancedCommunication.GAMBLECommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger, MyTradeHandler, MyInventory);
                AdvancedCommunication.PRIZECommandHandler MyPRIZECommandHandler = new AdvancedCommunication.PRIZECommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyInventory, MyTradeHandler, MyStats, MyLogger, MyActorHandler);

                //isonline command
                AdvancedCommunication.ISOnlineCommandHandler MyISOnlineCommandHandler = new AdvancedCommunication.ISOnlineCommandHandler(MyTCPWrapper, MyMessageParser, MyHelpCommandHandler, MyMySqlManager, MyLogger);

                //Guard bot code below
                if (botType == 3)
                {
                    AdvancedCommunication.AssessThreat MyAssessThreat = new AdvancedCommunication.AssessThreat(MyTCPWrapper, MyMySqlManager, MyActorHandler);
                }

                Perks MyPerks = new Perks(MyTCPWrapper, MyLogger, MyMySqlManager);
                CLI MyCLI = new CLI(MyTCPWrapper, MyMessageParser);

                MyCLI.DoLoop();
            }
            catch (System.Net.Sockets.SocketException se)
            {
                Console.WriteLine("Error in main loop: " + se.Message);
                if (se.ErrorCode == 11001) // Host name not found
                {
                    Console.WriteLine("When this error occurs, check that you are connected to the internet and a firewall is not blocking this program.");
                }
            }
            catch (Exception except)
            {
                MyErrorHandler.writeErrorMessage("Exception in main loop: " + except);
            }
            finally
            {
                Console.ReadLine();
            }
        }
 public static float Discount(Perks perks) => perks.HasPerk(PerksTypes.Greedy)
     ? 0.02f * perks.GetPerkLevel(PerksTypes.Greedy)
     : 0f;
Exemple #20
0
 public void Update(DestinyObjectiveDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (!DisplayProperties.DeepEquals(other.DisplayProperties))
     {
         DisplayProperties.Update(other.DisplayProperties);
         OnPropertyChanged(nameof(DisplayProperties));
     }
     if (CompletionValue != other.CompletionValue)
     {
         CompletionValue = other.CompletionValue;
         OnPropertyChanged(nameof(CompletionValue));
     }
     if (Scope != other.Scope)
     {
         Scope = other.Scope;
         OnPropertyChanged(nameof(Scope));
     }
     if (LocationHash != other.LocationHash)
     {
         LocationHash = other.LocationHash;
         OnPropertyChanged(nameof(LocationHash));
     }
     if (AllowNegativeValue != other.AllowNegativeValue)
     {
         AllowNegativeValue = other.AllowNegativeValue;
         OnPropertyChanged(nameof(AllowNegativeValue));
     }
     if (AllowValueChangeWhenCompleted != other.AllowValueChangeWhenCompleted)
     {
         AllowValueChangeWhenCompleted = other.AllowValueChangeWhenCompleted;
         OnPropertyChanged(nameof(AllowValueChangeWhenCompleted));
     }
     if (IsCountingDownward != other.IsCountingDownward)
     {
         IsCountingDownward = other.IsCountingDownward;
         OnPropertyChanged(nameof(IsCountingDownward));
     }
     if (ValueStyle != other.ValueStyle)
     {
         ValueStyle = other.ValueStyle;
         OnPropertyChanged(nameof(ValueStyle));
     }
     if (ProgressDescription != other.ProgressDescription)
     {
         ProgressDescription = other.ProgressDescription;
         OnPropertyChanged(nameof(ProgressDescription));
     }
     if (!Perks.DeepEquals(other.Perks))
     {
         Perks.Update(other.Perks);
         OnPropertyChanged(nameof(Perks));
     }
     if (!Stats.DeepEquals(other.Stats))
     {
         Stats.Update(other.Stats);
         OnPropertyChanged(nameof(Stats));
     }
     if (MinimumVisibilityThreshold != other.MinimumVisibilityThreshold)
     {
         MinimumVisibilityThreshold = other.MinimumVisibilityThreshold;
         OnPropertyChanged(nameof(MinimumVisibilityThreshold));
     }
     if (AllowOvercompletion != other.AllowOvercompletion)
     {
         AllowOvercompletion = other.AllowOvercompletion;
         OnPropertyChanged(nameof(AllowOvercompletion));
     }
     if (ShowValueOnComplete != other.ShowValueOnComplete)
     {
         ShowValueOnComplete = other.ShowValueOnComplete;
         OnPropertyChanged(nameof(ShowValueOnComplete));
     }
     if (CompletedValueStyle != other.CompletedValueStyle)
     {
         CompletedValueStyle = other.CompletedValueStyle;
         OnPropertyChanged(nameof(CompletedValueStyle));
     }
     if (InProgressValueStyle != other.InProgressValueStyle)
     {
         InProgressValueStyle = other.InProgressValueStyle;
         OnPropertyChanged(nameof(InProgressValueStyle));
     }
     if (Hash != other.Hash)
     {
         Hash = other.Hash;
         OnPropertyChanged(nameof(Hash));
     }
     if (Index != other.Index)
     {
         Index = other.Index;
         OnPropertyChanged(nameof(Index));
     }
     if (Redacted != other.Redacted)
     {
         Redacted = other.Redacted;
         OnPropertyChanged(nameof(Redacted));
     }
 }
 public void Update(DestinyItemResponse?other)
 {
     if (other is null)
     {
         return;
     }
     if (CharacterId != other.CharacterId)
     {
         CharacterId = other.CharacterId;
         OnPropertyChanged(nameof(CharacterId));
     }
     if (!Item.DeepEquals(other.Item))
     {
         Item.Update(other.Item);
         OnPropertyChanged(nameof(Item));
     }
     if (!Instance.DeepEquals(other.Instance))
     {
         Instance.Update(other.Instance);
         OnPropertyChanged(nameof(Instance));
     }
     if (!Objectives.DeepEquals(other.Objectives))
     {
         Objectives.Update(other.Objectives);
         OnPropertyChanged(nameof(Objectives));
     }
     if (!Perks.DeepEquals(other.Perks))
     {
         Perks.Update(other.Perks);
         OnPropertyChanged(nameof(Perks));
     }
     if (!RenderData.DeepEquals(other.RenderData))
     {
         RenderData.Update(other.RenderData);
         OnPropertyChanged(nameof(RenderData));
     }
     if (!Stats.DeepEquals(other.Stats))
     {
         Stats.Update(other.Stats);
         OnPropertyChanged(nameof(Stats));
     }
     if (!TalentGrid.DeepEquals(other.TalentGrid))
     {
         TalentGrid.Update(other.TalentGrid);
         OnPropertyChanged(nameof(TalentGrid));
     }
     if (!Sockets.DeepEquals(other.Sockets))
     {
         Sockets.Update(other.Sockets);
         OnPropertyChanged(nameof(Sockets));
     }
     if (!ReusablePlugs.DeepEquals(other.ReusablePlugs))
     {
         ReusablePlugs.Update(other.ReusablePlugs);
         OnPropertyChanged(nameof(ReusablePlugs));
     }
     if (!PlugObjectives.DeepEquals(other.PlugObjectives))
     {
         PlugObjectives.Update(other.PlugObjectives);
         OnPropertyChanged(nameof(PlugObjectives));
     }
 }
        public Micro()
        {
            Name  = "Micro";
            Image = Graphics.resources.Res.Micro;
            SetAttackDamage(60);
            SetMaxHp(1100);
            SetMaxEnergy(350);
            SetEnergyRegen(10);
            SetMovementSpeed(10);
            SetRegen(15);

            Defence = new Perk
            {
                Name        = "Defence",
                Number      = (h) => (h as Micro).GetEnemiesInRange(h, DefenceRadius).Count,
                Explanation = (h) => "Gets " + (DefenceADScale * 100) + "% AD (" + DefenceADScale * h.GetAttackDamage()
                              + ") armor and resist from every enemy in " + DefenceRadius + "units ("
                              + (h as Micro).GetEnemiesInRange(h, DefenceRadius).Count + " enemies), total "
                              + (h.GetAttackDamage() * DefenceADScale * GetEnemiesInRange(this, DefenceRadius).Count),

                GetArmor = (g) => () =>
                           g() + GetAttackDamage() * DefenceADScale * GetEnemiesInRange(this, DefenceRadius).Count,
                SetArmor = (s) => (v) =>
                           s(v - GetAttackDamage() * DefenceADScale * GetEnemiesInRange(this, DefenceRadius).Count),
                GetResist = (g) => () =>
                            g() + GetAttackDamage() * DefenceADScale * GetEnemiesInRange(this, DefenceRadius).Count,
                SetResist = (s) => (v) =>
                            s(v - GetAttackDamage() * DefenceADScale * GetEnemiesInRange(this, DefenceRadius).Count),
            };
            Perks.Add(Defence);

            Drop = new Skill
            {
                Name        = "Drop",
                Explanation = () => "Get any hero in " + DropCatchRadius + " units and throw in any free place in "
                              + DropRaduis + " units from you."
                              + " CD " + DropCD + ". Cost " + DropCost + ".",
                CoolDown   = DropCD,
                EnergyCost = DropCost,
                Job        = (h) =>
                {
                    var targets = GetHeroesInRange(h, DropCatchRadius).Where(t => t != h).ToList();
                    if (targets.Count == 0)
                    {
                        return(false);
                    }
                    var target = ChooseTarget(targets, h.P);
                    if (target == null)
                    {
                        return(false);
                    }
                    h.Targets.Add(target);
                    var points = h.GetPosition().GetPointsInDistance(0, DropRaduis).Keys
                                 .Where(p => h.M.CellIsFree(p)).ToList();
                    if (points.Count == 0)
                    {
                        return(false);
                    }
                    var point = ChoosePoint(points, h.P);
                    if (point == null)
                    {
                        return(false);
                    }
                    h.M.UnitPositions[Targets[0]] = point;
                    return(true);
                }
            };
            Drop.SkillTypes.Add(SkillType.Special);
            Skills.Add(Drop);


            RestoreRegenBuff = new Perk
            {
                Name     = "Restore",
                Number   = (h) => Math.Floor(RestoreRegen * h.GetMaxHp()),
                GetRegen = (g) => () => g() + RestoreRegen * GetMaxHp(),
                SetRegen = (s) => (v) => s(v - RestoreRegen * GetMaxHp()),
            };

            Restore = new Skill
            {
                Name        = "Restore",
                Explanation = () => "Heal you for "
                              + RestoreHeal + "% MaxHp (" + RestoreHeal * GetMaxHp() + ") and give "
                              + RestoreRegen + "% MaxHp (" + RestoreRegen * GetMaxHp() + ") Regen for "
                              + RestoreRegenDuration + " turns. CD"
                              + RestoreCooldown + ". Cost " + RestoreCost + ".",
                CoolDown   = RestoreCooldown,
                EnergyCost = RestoreCost,
                Job        = (h) =>
                {
                    var effect = new Effect(h, RestoreRegenDuration)
                    {
                        Activate = (eh) =>
                        {
                            eh.Perks.Add(RestoreRegenBuff);
                        },
                        Disactivate = (eh) =>
                        {
                            eh.Perks.Remove(RestoreRegenBuff);
                        }
                    };
                    effect.Activate(h);
                    h.M.Effects.Add(effect);
                    h.GetHeal(RestoreHeal * h.GetMaxHp());
                    return(true);
                }
            };
            Restore.SkillTypes.Add(SkillType.Special);
            Skills.Add(Restore);
        }
Exemple #23
0
        public Gaina()
        {
            Name  = "Gaina";
            Image = Graphics.resources.Res.Gaina;
            SetMaxHp(777);
            SetMaxEnergy(200);
            SetEnergyRegen(20);
            SetAbilityPower(50);
            SetAttackRange(7);


            Blasts   = new List <Specials.Pyroblast>();
            Collider = new Perk
            {
                StartTurn = (s) => (d) =>
                {
                    var list = new List <Pyroblast>(Blasts);
                    foreach (var pyro in list)
                    {
                        pyro.Boom();
                    }
                    return(s(d));
                },
                SkillFix = (s) =>
                {
                    var newSkill = new Skill()
                    {
                        Name        = s.Name,
                        CoolDown    = s.CoolDown,
                        SkillTypes  = s.SkillTypes,
                        Explanation = s.Explanation,
                    };
                    newSkill.Job = (he) =>
                    {
                        var res = s.Job(he);
                        if (res)
                        {
                            var list = new List <Pyroblast>(Blasts);
                            foreach (var pyro in list)
                            {
                                pyro.Boom();
                            }
                            return(true);
                        }
                        return(false);
                    };
                    return(newSkill);
                },

                EndTurn = (v) => (d) =>
                {
                    foreach (var pyro in Blasts)
                    {
                        pyro.Tick();
                    }
                    var list = new List <Pyroblast>(Blasts);
                    foreach (var pyro in list)
                    {
                        pyro.Boom();
                    }
                    return(v(d));
                }
            };

            Perks.Add(new Perk
            {
                StartTurn = (f) => (d) =>
                {
                    foreach (var h in d.HeroValue.M.GetHeroes())
                    {
                        if (!h.Perks.Contains(Collider))
                        {
                            h.Perks.Add(Collider);
                        }
                    }
                    return(f(d));
                },
            });

            Pyroblast = new Skill
            {
                Name        = "Pyroblast",
                Explanation = () => "Shoots pyroblast that moves diagonally and bounce off of stones and deales " + PyroblastAPScale * 100
                              + "%AP (" + GetAbilityPower() * PyroblastAPScale + ") spell damage to all enemies in " + PyroblastRadius + " range when fly on them. Cost "
                              + PyroblastCost + ". CD " + PyroblastCd,
                EnergyCost = PyroblastCost,
                CoolDown   = PyroblastCd,
                Job        = (h) =>
                {
                    var directions = new List <Point> {
                        new Point(1, 1), new Point(-1, 1), new Point(-1, -1), new Point(1, -1)
                    };
                    var positions = directions.Select(d => d + h.GetPosition()).Where(p => h.M.CellIsFree(p)).ToList();
                    var point     = ChoosePoint(positions, h.P);
                    if (point == null)
                    {
                        return(false);
                    }
                    var pyro = new Pyroblast(h)
                    {
                        Direction = new Point(point.X - h.GetPosition().X, point.Y - h.GetPosition().Y)
                    };
                    pyro.Boom = () =>
                    {
                        var place   = h.M.UnitPositions[pyro];
                        var targets = h.M.GetHeroPositions().Where(a => a.Key.P != h.P && place.GetStepsTo(a.Value) <= PyroblasTriggerRadius)
                                      .Select(a => a.Key);
                        if (targets.Count() == 0)
                        {
                            return(false);
                        }
                        var damage = new Damage(h, h.P, magic: GetAbilityPower() * PyroblastAPScale);
                        targets = h.M.GetHeroPositions().Where(a => a.Key.P != h.P && place.GetStepsTo(a.Value) <= PyroblastRadius).Select(a => a.Key);
                        foreach (var tg in targets)
                        {
                            tg.GetDamage(damage);
                        }
                        Blasts.Remove(pyro);
                        h.M.UnitPositions.Remove(pyro);
                        return(true);
                    };
                    pyro.Tick = () =>
                    {
                        var curretPoint = h.M.UnitPositions[pyro];
                        var nextPoint   = curretPoint + pyro.Direction;
                        if (h.M.IsInBounds(nextPoint) && h.M.MapTiles[nextPoint.X, nextPoint.Y].Type == TileType.Empty)
                        {
                            h.M.UnitPositions[pyro] = nextPoint;
                            return;
                        }

                        var one         = curretPoint + new Point(pyro.Direction.X, 0);
                        var another     = curretPoint + new Point(0, pyro.Direction.Y);
                        var oneCool     = h.M.IsInBounds(one) && h.M.MapTiles[one.X, one.Y].Type == TileType.Empty;
                        var anotherCool = h.M.IsInBounds(another) && h.M.MapTiles[another.X, another.Y].Type == TileType.Empty;
                        if (oneCool == anotherCool)
                        {
                            pyro.Direction          = new Point(-pyro.Direction.X, -pyro.Direction.Y);
                            h.M.UnitPositions[pyro] = curretPoint + pyro.Direction;
                            return;
                        }
                        if (oneCool)
                        {
                            var newDirection = new Point(pyro.Direction.X, -pyro.Direction.Y);
                            var newPosition  = curretPoint + newDirection;
                            if (h.M.IsInBounds(newPosition) && h.M.MapTiles[newPosition.X, newPosition.Y].Type == TileType.Empty)
                            {
                                pyro.Direction          = newDirection;
                                h.M.UnitPositions[pyro] = curretPoint + pyro.Direction;
                                return;
                            }
                        }
                        if (anotherCool)
                        {
                            var newDirection = new Point(-pyro.Direction.X, pyro.Direction.Y);
                            var newPosition  = curretPoint + newDirection;
                            if (h.M.IsInBounds(newPosition) && h.M.MapTiles[newPosition.X, newPosition.Y].Type == TileType.Empty)
                            {
                                pyro.Direction          = new Point(-pyro.Direction.X, pyro.Direction.Y);
                                h.M.UnitPositions[pyro] = curretPoint + pyro.Direction;
                                return;
                            }
                        }
                        pyro.Direction          = new Point(-pyro.Direction.X, -pyro.Direction.Y);
                        h.M.UnitPositions[pyro] = curretPoint + pyro.Direction;
                    };
                    Blasts.Add(pyro);
                    h.M.UnitPositions[pyro] = point;
                    return(true);
                }
            };

            Pyroblast.SkillTypes.Add(SkillType.Special);
            Skills.Add(Pyroblast);
        }
 public static float ExtraStarvationPenalty(Perks perks) => perks.HasPerk(PerksTypes.Gluttony)
     ? 0.1f * perks.GetPerkLevel(PerksTypes.Gluttony)
     : 0;
Exemple #25
0
 public PerksForm(Perks perksConfiguration)
 {
     InitializeComponent();
     this.perksConfigurationBindingSource.DataSource = perksConfiguration;
 }
 public static float LowerBurn(Perks perks)
 {
     return(perks.HasPerk(PerksTypes.LowMetabolism)
         ? 0.5f * perks.GetPerkLevel(PerksTypes.LowMetabolism)
         : 0);
 }
Exemple #27
0
 public void Update()
 {
     Perks.Update();
     OnPropertyChanged("Visibility");
 }
 public static float ExtraSensitive(Perks perks) => perks.HasPerk(PerksTypes.Delicate)
     ? 0.2f * perks.GetPerkLevel(PerksTypes.Delicate)
     : 0;
Exemple #29
0
 public bool DeepEquals(DestinyInventoryItemDefinition other)
 {
     return(other != null &&
            Collectible.DeepEquals(other.Collectible) &&
            SummaryItem.DeepEquals(other.SummaryItem) &&
            ItemCategories.DeepEqualsReadOnlyCollections(other.ItemCategories) &&
            AcquireRewardSiteHash == other.AcquireRewardSiteHash &&
            AcquireUnlockHash == other.AcquireUnlockHash &&
            AllowActions == other.AllowActions &&
            (BackgroundColor != null ? BackgroundColor.DeepEquals(other.BackgroundColor) : other.BackgroundColor == null) &&
            BreakerTypeEnumValue == other.BreakerTypeEnumValue &&
            BreakerType.DeepEquals(other.BreakerType) &&
            ClassType == other.ClassType &&
            DefaultDamageTypeEnumValue == other.DefaultDamageTypeEnumValue &&
            DefaultDamageType.DeepEquals(other.DefaultDamageType) &&
            ItemSubType == other.ItemSubType &&
            ItemType == other.ItemType &&
            SpecialItemType == other.SpecialItemType &&
            DisplayProperties.DeepEquals(other.DisplayProperties) &&
            DisplaySource == other.DisplaySource &&
            DoesPostmasterPullHaveSideEffects == other.DoesPostmasterPullHaveSideEffects &&
            Equippable == other.Equippable &&
            IconWatermark == other.IconWatermark &&
            IconWatermarkShelved == other.IconWatermarkShelved &&
            IsWrapper == other.IsWrapper &&
            ItemTypeAndTierDisplayName == other.ItemTypeAndTierDisplayName &&
            ItemTypeDisplayName == other.ItemTypeDisplayName &&
            UiItemDisplayStyle == other.UiItemDisplayStyle &&
            NonTransferrable == other.NonTransferrable &&
            SecondaryIcon == other.SecondaryIcon &&
            SecondaryOverlay == other.SecondaryOverlay &&
            SecondarySpecial == other.SecondarySpecial &&
            Screenshot == other.Screenshot &&
            TooltipStyle == other.TooltipStyle &&
            TraitIds.DeepEqualsReadOnlySimpleCollection(other.TraitIds) &&
            (Stats != null ? Stats.DeepEquals(other.Stats) : other.Stats == null) &&
            (TalentGrid != null ? TalentGrid.DeepEquals(other.TalentGrid) : other.TalentGrid == null) &&
            (TranslationBlock != null ? TranslationBlock.DeepEquals(other.TranslationBlock) : other.TranslationBlock == null) &&
            (Value != null ? Value.DeepEquals(other.Value) : other.Value == null) &&
            (SetData != null ? SetData.DeepEquals(other.SetData) : other.SetData == null) &&
            (Plug != null ? Plug.DeepEquals(other.Plug) : other.Plug == null) &&
            (Preview != null ? Preview.DeepEquals(other.Preview) : other.Preview == null) &&
            (Quality != null ? Quality.DeepEquals(other.Quality) : other.Quality == null) &&
            (Objectives != null ? Objectives.DeepEquals(other.Objectives) : other.Objectives == null) &&
            Inventory.DeepEquals(other.Inventory) &&
            (Action != null ? Action.DeepEquals(other.Action) : other.Action == null) &&
            (EquippingBlock != null ? EquippingBlock.DeepEquals(other.EquippingBlock) : other.EquippingBlock == null) &&
            (Sockets != null ? Sockets.DeepEquals(other.Sockets) : other.Sockets == null) &&
            InvestmentStats.DeepEqualsReadOnlyCollections(other.InvestmentStats) &&
            Perks.DeepEqualsReadOnlyCollections(other.Perks) &&
            TooltipNotifications.DeepEqualsReadOnlyCollections(other.TooltipNotifications) &&
            (Sack != null ? Sack.DeepEquals(other.Sack) : other.Sack == null) &&
            (Gearset != null ? Gearset.DeepEquals(other.Gearset) : other.Gearset == null) &&
            EmblemObjective.DeepEquals(other.EmblemObjective) &&
            (SourceData != null ? SourceData.DeepEquals(other.SourceData) : other.SourceData == null) &&
            (Metrics != null ? Metrics.DeepEquals(other.Metrics) : other.Metrics == null) &&
            (Summary != null ? Summary.DeepEquals(other.Summary) : other.Summary == null) &&
            Lore.DeepEquals(other.Lore) &&
            Animations.DeepEqualsReadOnlyCollections(other.Animations) &&
            Links.DeepEqualsReadOnlyCollections(other.Links) &&
            DamageTypes.DeepEqualsReadOnlyCollections(other.DamageTypes) &&
            DamageTypeEnumValues.DeepEqualsReadOnlySimpleCollection(other.DamageTypeEnumValues) &&
            Season.DeepEquals(other.Season) &&
            Blacklisted == other.Blacklisted &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
 public static float ExtraFatBurn(Perks perks) => perks.HasPerk(PerksTypes.Gluttony)
     ? 0.1f * perks.GetPerkLevel(PerksTypes.Gluttony)
     : 0;
Exemple #31
0
    // Use this for initialization
    void Start()
    {
        // Correct init logics

        if (GetComponent<CoinSpin>() != null)
        {
            coin = GetComponent<CoinSpin>();
        }

        if (GetComponent<AudioSource>() != null)
        {
            //Audi = GetComponent<AudioSource>();
        }
        this.tag = Globals.TAGS.Item;
        this.award_Flame = Mathf.Max(award_Flame, 0f);
        if (monitor == null)
        {
            monitor = Session_Monitor.Instance;
            Audi = ((AudioSource )monitor.gameObject.GetComponent<AudioSource>());
        }
        if (dragonSM == null)
        {
            dragonSM = FindObjectsOfType<HealthMonitor>().First(t => t.tag == Globals.TAGS.Player);
        }
        Audi = ((AudioSource)monitor.gameObject.GetComponent<AudioSource>());
        if(GetComponent<CoinSpin>() == null)
        {
            Audi = null;
        }
        p = FindObjectOfType<Perks>();
    }
 public static float AfterbattleHealPenalty(Perks perks) => perks.HasPerk(PerksTypes.Thug)
     ? 0.1f * perks.GetPerkLevel(PerksTypes.Thug)
     : 0;
        private void SetDefaultStats()
        {
            MaxHP = 100;
            MaxMP = 0;
            MaxCheerfulness = 100;
            MaxFood = 100;

            HP = 100;
            MP = 0;
            Cheerfulness = 100;
            Food = 100;

            Perks = new RolePlayMaker.Perks();
            Inventory = new Inventory();
        }
 public static float ExtraDrain(Perks perks) => perks.HasPerk(PerksTypes.EssenceThief)
     ? 5f * perks.GetPerkLevel(PerksTypes.EssenceThief) : 0;