예제 #1
0
 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)
예제 #2
0
    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)