forked from freeorion/freeorion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,397 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from focs._effects import ( | ||
BlackHole, | ||
ContainedBy, | ||
Contains, | ||
CreateField, | ||
Destroy, | ||
EffectsGroup, | ||
IsSource, | ||
OwnedBy, | ||
Planet, | ||
Source, | ||
Star, | ||
) | ||
from macros.base_prod import BUILDING_COST_MULTIPLIER | ||
from macros.enqueue import ENQUEUE_BUILD_ONE_PER_PLANET | ||
|
||
try: | ||
from focs._buildings import * | ||
except ModuleNotFoundError: | ||
pass | ||
|
||
BuildingType( # type: ignore[reportUnboundVariable] | ||
name="BLD_BLACK_HOLE_COLLAPSER", | ||
description="BLD_BLACK_HOLE_COLLAPSER_DESC", | ||
buildcost=5000 * BUILDING_COST_MULTIPLIER, | ||
buildtime=10, | ||
location=(Planet() & OwnedBy(empire=Source.Owner) & ContainedBy(Contains(Planet() & Star(type=[BlackHole])))), | ||
enqueuelocation=ENQUEUE_BUILD_ONE_PER_PLANET, | ||
effectsgroups=[ | ||
EffectsGroup( | ||
scope=IsSource, | ||
effects=[ | ||
Destroy, | ||
CreateField(type="FLD_SUBSPACE_RIFT", size=100), | ||
], | ||
), | ||
], | ||
icon="", | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
from buildings.buildings import SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS | ||
from focs._effects import ( | ||
BlackHole, | ||
Contains, | ||
EffectsGroup, | ||
EmpireHasAdoptedPolicy, | ||
Focus, | ||
Happiness, | ||
IsBuilding, | ||
IsSource, | ||
NamedReal, | ||
OwnedBy, | ||
Planet, | ||
ResourceSupplyConnected, | ||
SetTargetIndustry, | ||
Source, | ||
Star, | ||
StatisticIf, | ||
Target, | ||
Value, | ||
) | ||
from macros.base_prod import BUILDING_COST_MULTIPLIER, INDUSTRY_PER_POP | ||
from macros.enqueue import ENQUEUE_BUILD_ONE_PER_PLANET | ||
from macros.priorities import ( | ||
TARGET_AFTER_SCALING_PRIORITY, | ||
) | ||
|
||
try: | ||
from focs._buildings import * | ||
except ModuleNotFoundError: | ||
pass | ||
|
||
BuildingType( # type: ignore[reportUnboundVariable] | ||
name="BLD_BLACK_HOLE_POW_GEN", | ||
description="BLD_BLACK_HOLE_POW_GEN_DESC", | ||
buildcost=300 | ||
* BUILDING_COST_MULTIPLIER | ||
* ( | ||
1 | ||
- 0.25 | ||
* StatisticIf(float, condition=IsSource & EmpireHasAdoptedPolicy(empire=Source.Owner, name="PLC_INDUSTRIALISM")) | ||
), | ||
buildtime=8, | ||
tags=["ORBITAL"], | ||
location=( | ||
Planet() | ||
& ~Contains(IsBuilding(name=["BLD_BLACK_HOLE_POW_GEN"])) | ||
& OwnedBy(empire=Source.Owner) | ||
& Star(type=[BlackHole]) | ||
), | ||
enqueuelocation=ENQUEUE_BUILD_ONE_PER_PLANET, | ||
effectsgroups=[ | ||
*SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS, | ||
EffectsGroup( | ||
scope=( | ||
Planet() | ||
& Focus(type=["FOCUS_INDUSTRY"]) | ||
& OwnedBy(empire=Source.Owner) | ||
& Happiness(low=NamedReal(name="BLD_BLACK_HOLE_POW_GEN_MIN_STABILITY", value=20)) | ||
& ResourceSupplyConnected(empire=Source.Owner, condition=IsSource) | ||
), | ||
activation=Star(type=[BlackHole]), | ||
stackinggroup="BLD_BLACK_HOLE_POW_GEN_PRIMARY_EFFECT", | ||
priority=TARGET_AFTER_SCALING_PRIORITY, | ||
effects=[ | ||
SetTargetIndustry( | ||
value=Value | ||
+ Target.Population | ||
* NamedReal(name="BLD_BLACK_HOLE_POW_GEN_TARGET_INDUSTRY_PERPOP", value=1.0 * INDUSTRY_PER_POP) | ||
) | ||
], | ||
), | ||
], | ||
icon="icons/building/blackhole.png", | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
from buildings.buildings import SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS | ||
from focs._effects import ( | ||
Contains, | ||
EffectsGroup, | ||
Focus, | ||
Happiness, | ||
IsBuilding, | ||
NamedReal, | ||
NamedRealLookup, | ||
OwnedBy, | ||
Planet, | ||
SetTargetIndustry, | ||
SetTargetResearch, | ||
Ship, | ||
Source, | ||
Stationary, | ||
Target, | ||
TargetPopulation, | ||
Value, | ||
WithinDistance, | ||
) | ||
from macros.base_prod import BUILDING_COST_MULTIPLIER, INDUSTRY_PER_POP, RESEARCH_PER_POP | ||
from macros.enqueue import ENQUEUE_BUILD_ONE_PER_PLANET | ||
from macros.priorities import TARGET_AFTER_2ND_SCALING_PRIORITY | ||
|
||
try: | ||
from focs._buildings import * | ||
except ModuleNotFoundError: | ||
pass | ||
|
||
BuildingType( # type: ignore[reportUnboundVariable] | ||
name="BLD_COLLECTIVE_NET", | ||
description="BLD_COLLECTIVE_NET_DESC", | ||
buildcost=250 * BUILDING_COST_MULTIPLIER, | ||
buildtime=10, | ||
location=( | ||
Planet() | ||
& ~Contains(IsBuilding(name=["BLD_COLLECTIVE_NET"])) | ||
& OwnedBy(empire=Source.Owner) | ||
& TargetPopulation(low=1) | ||
), | ||
enqueuelocation=ENQUEUE_BUILD_ONE_PER_PLANET, | ||
effectsgroups=[ | ||
*SPECIES_LIKES_OR_DISLIKES_BUILDING_STABILITY_EFFECTS, | ||
EffectsGroup( | ||
scope=( | ||
Planet() | ||
& OwnedBy(empire=Source.Owner) | ||
& Focus(type=["FOCUS_INDUSTRY"]) | ||
& Happiness(low=NamedReal(name="BLD_COLLECTIVE_NET_MIN_STABILITY", value=15)) | ||
), | ||
activation=~WithinDistance(distance=200, condition=Ship & Stationary), | ||
stackinggroup="BLD_COLLECTIVE_NET_INDUSTRY_EFFECT", | ||
priority=TARGET_AFTER_2ND_SCALING_PRIORITY, | ||
effects=[ | ||
SetTargetIndustry( | ||
value=Value | ||
+ Target.Population | ||
* NamedReal(name="BLD_COLLECTIVE_NET_TARGET_INDUSTRY_PERPOP", value=0.5 * INDUSTRY_PER_POP) | ||
) | ||
], | ||
), | ||
EffectsGroup( | ||
scope=( | ||
Planet() | ||
& OwnedBy(empire=Source.Owner) | ||
& Focus(type=["FOCUS_RESEARCH"]) | ||
& Happiness(low=NamedRealLookup(name="BLD_COLLECTIVE_NET_MIN_STABILITY")) | ||
), | ||
activation=WithinDistance(distance=200, condition=Ship & Stationary), | ||
stackinggroup="BLD_COLLECTIVE_NET_RESEARCH_EFFECT", | ||
priority=TARGET_AFTER_2ND_SCALING_PRIORITY, | ||
effects=[ | ||
SetTargetResearch( | ||
value=Value | ||
+ Target.Population | ||
* NamedReal(name="BLD_COLLECTIVE_NET_TARGET_RESEARCH_PERPOP", value=0.5 * RESEARCH_PER_POP) | ||
) | ||
], | ||
), | ||
], | ||
icon="icons/building/psi-corps.png", | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from focs._effects import ( | ||
Contains, | ||
CreateShip, | ||
Destroy, | ||
EffectsGroup, | ||
IsBuilding, | ||
IsSource, | ||
OwnedBy, | ||
Planet, | ||
Population, | ||
Source, | ||
) | ||
from macros.base_prod import BUILDING_COST_MULTIPLIER | ||
from macros.misc import MIN_RECOLONIZING_SIZE | ||
|
||
try: | ||
from focs._buildings import * | ||
except ModuleNotFoundError: | ||
pass | ||
|
||
BuildingType( # type: ignore[reportUnboundVariable] | ||
name="BLD_COLONY_BASE", | ||
description="BLD_COLONY_BASE_DESC", | ||
buildcost=45 * BUILDING_COST_MULTIPLIER, | ||
buildtime=1, | ||
location=( | ||
Planet() | ||
& ~Contains(IsBuilding(name=["BLD_COLONY_BASE"])) | ||
& Population(low=MIN_RECOLONIZING_SIZE) | ||
& OwnedBy(empire=Source.Owner) | ||
), | ||
# TODO: Disable colony base if there is no possibility in the current system | ||
effectsgroups=[ | ||
EffectsGroup( | ||
scope=IsSource, | ||
effects=[CreateShip(designname="SD_COLONY_BASE", empire=Source.Owner, species=Source.Planet.Species)], | ||
), | ||
EffectsGroup( | ||
scope=IsSource, | ||
effects=[Destroy], | ||
), | ||
], | ||
icon="icons/ship_hulls/colony_base_hull_small.png", | ||
) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.