Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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]))));
 }
Esempio n. 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]))));
 }