def MultiplyDenIfAble(self, den: unrealsdk.UObject, amount: float) -> None: if self.CanDenBeMultiplied(den): den.SpawnData.MaxActiveActors = round( den.SpawnData.MaxActiveActors * amount) den.MaxActiveActorsIsNormal = round(den.MaxActiveActorsIsNormal * amount) den.MaxActiveActorsThreatened = round( den.MaxActiveActorsThreatened * amount) den.MaxTotalActors = round(den.MaxTotalActors * amount)
def MultiplyDenIfAble(self, den: unrealsdk.UObject, amount: float) -> None: popDef = den.PopulationDef if popDef is None: return count = 0 for actor in popDef.ActorArchetypeList: factory = actor.SpawnFactory if factory is None: return if factory.Class.Name in ("PopulationFactoryBlackMarket", "PopulationFactoryInteractiveObject", "PopulationFactoryVendingMachine"): return count += 1 if count == 0: return den.SpawnData.MaxActiveActors = round(den.SpawnData.MaxActiveActors * amount) den.MaxActiveActorsIsNormal = round(den.MaxActiveActorsIsNormal * amount) den.MaxActiveActorsThreatened = round(den.MaxActiveActorsThreatened * amount) den.MaxTotalActors = round(den.MaxTotalActors * amount)