示例#1
0
        public float GetContractTimeReductionMultiplierForPerks(IUpgradeableVO deployableVO, List <string> perkIds)
        {
            BuildingLookupController buildingLookupController = Service.BuildingLookupController;
            BuildingTypeVO           minBuildingRequirement   = buildingLookupController.GetMinBuildingRequirement(deployableVO);
            List <string>            perkEffectIds            = this.GetPerkEffectIds(perkIds);

            return(ContractTimePerkUtils.GetTimeReductionMultiplier(minBuildingRequirement, perkEffectIds));
        }
示例#2
0
        public static float GetTimeReductionMultiplier(BuildingTypeVO contractBuildingVO, List <string> perkEffectIds)
        {
            float num = 0f;

            if (perkEffectIds != null)
            {
                StaticDataController staticDataController = Service.StaticDataController;
                int i     = 0;
                int count = perkEffectIds.Count;
                while (i < count)
                {
                    PerkEffectVO perkEffectVO = staticDataController.Get <PerkEffectVO>(perkEffectIds[i]);
                    if (ContractTimePerkUtils.CanApplyEffect(perkEffectVO, contractBuildingVO))
                    {
                        num += perkEffectVO.ContractTimeReduction;
                    }
                    i++;
                }
            }
            return(1f - num);
        }
示例#3
0
 public unsafe static long $Invoke1(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ContractTimePerkUtils.GetTimeReductionMultiplier((BuildingTypeVO)GCHandledObjects.GCHandleToObject(*args), (List <string>)GCHandledObjects.GCHandleToObject(args[1]))));
 }
示例#4
0
 public unsafe static long $Invoke0(long instance, long *args)
 {
     return(GCHandledObjects.ObjectToGCHandle(ContractTimePerkUtils.CanApplyEffect((PerkEffectVO)GCHandledObjects.GCHandleToObject(*args), (BuildingTypeVO)GCHandledObjects.GCHandleToObject(args[1]))));
 }