Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ContractCostPerkUtils.CanApplyEffect((PerkEffectVO)GCHandledObjects.GCHandleToObject(*args), (BuildingTypeVO)GCHandledObjects.GCHandleToObject(args[1]))));
 }