Example #1
0
 public int CompareGunsByPrice(WeaponHash x, WeaponHash y)
 {
     ModOptions.BuyableWeapon buyableX = ModOptions.instance.GetBuyableWeaponByHash(x),
                              buyableY = buyableX = ModOptions.instance.GetBuyableWeaponByHash(y);
     if (buyableX == null)
     {
         if (buyableY == null)
         {
             return(0);
         }
         else
         {
             return(-1);
         }
     }
     else
     {
         if (buyableY == null)
         {
             return(1);
         }
         else
         {
             return(buyableY.price.CompareTo(buyableX.price));
         }
     }
 }
Example #2
0
        /// <summary>
        /// when a gang fights against another, this value is used to influence the outcome.
        /// it varies a little, to give that extra chance to weaker gangs
        /// </summary>
        /// <returns></returns>
        public int GetGangVariedStrengthValue()
        {
            int weaponValue = 200;

            if (gangWeaponHashes.Count > 0)
            {
                ModOptions.BuyableWeapon randomWeap = ModOptions.instance.GetBuyableWeaponByHash(RandoMath.GetRandomElementFromList(gangWeaponHashes));
                if (randomWeap != null)
                {
                    weaponValue = randomWeap.price;
                }
            }
            return(ZoneManager.instance.GetZonesControlledByGang(name).Count * 50 +
                   weaponValue / 200 +
                   memberAccuracyLevel * 10 +
                   memberArmor +
                   memberHealth);
        }