Example #1
0
        public bool IsContractCostMultiplierAppliedToBuilding(BuildingTypeVO buildingVO)
        {
            List <string> playerActivePerkEffectIds = this.GetPlayerActivePerkEffectIds();

            if (playerActivePerkEffectIds != null)
            {
                StaticDataController staticDataController = Service.StaticDataController;
                int i     = 0;
                int count = playerActivePerkEffectIds.Count;
                while (i < count)
                {
                    PerkEffectVO perkEffectVO = staticDataController.Get <PerkEffectVO>(playerActivePerkEffectIds[i]);
                    if (ContractCostPerkUtils.CanApplyEffect(perkEffectVO, buildingVO))
                    {
                        return(true);
                    }
                    i++;
                }
            }
            return(false);
        }
Example #2
0
        public static float GetDiscountedCostMultiplier(BuildingTypeVO contractBuildingVO, List <string> perkEffectIds)
        {
            float num = 0f;

            if (perkEffectIds != null)
            {
                IDataController dataController = Service.Get <IDataController>();
                int             i     = 0;
                int             count = perkEffectIds.Count;
                while (i < count)
                {
                    PerkEffectVO perkEffectVO = dataController.Get <PerkEffectVO>(perkEffectIds[i]);
                    if (ContractCostPerkUtils.CanApplyEffect(perkEffectVO, contractBuildingVO))
                    {
                        num += perkEffectVO.ContractDiscount;
                    }
                    i++;
                }
            }
            return(1f - num);
        }
Example #3
0
        public float GetContractCostMultiplierForPerks(BuildingTypeVO buildingVO, List <string> perkIds)
        {
            List <string> perkEffectIds = this.GetPerkEffectIds(perkIds);

            return(ContractCostPerkUtils.GetDiscountedCostMultiplier(buildingVO, perkEffectIds));
        }
Example #4
0
        public float GetContractCostMultiplier(BuildingTypeVO buildingVO)
        {
            List <string> playerActivePerkEffectIds = this.GetPlayerActivePerkEffectIds();

            return(ContractCostPerkUtils.GetDiscountedCostMultiplier(buildingVO, playerActivePerkEffectIds));
        }
Example #5
0
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ContractCostPerkUtils.GetDiscountedCostMultiplier((BuildingTypeVO)GCHandledObjects.GCHandleToObject(*args), (List <string>)GCHandledObjects.GCHandleToObject(args[1]))));
 }
Example #6
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ContractCostPerkUtils.CanApplyEffect((PerkEffectVO)GCHandledObjects.GCHandleToObject(*args), (BuildingTypeVO)GCHandledObjects.GCHandleToObject(args[1]))));
 }