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