Open source Star Ruler 2 source code!
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
Object.Abilities : components.Abilities::Abilities {
|
||||
local:
|
||||
safe uint get_abilityCount() const;
|
||||
Ability@[] getAbilities() const;
|
||||
uint get_abilityTypes(int id) const;
|
||||
int findAbilityOfType(int type) const;
|
||||
|
||||
remote:
|
||||
async relocking void activateAbility(int id);
|
||||
async relocking void activateAbility(int id, vec3d point);
|
||||
async relocking void activateAbility(int id, Object@ target);
|
||||
|
||||
server:
|
||||
async relocking void activateAbilityFor(Empire& emp, int id);
|
||||
async relocking void activateAbilityFor(Empire& emp, int id, Object@ target);
|
||||
async relocking void activateAbilityFor(Empire& emp, int id, vec3d point);
|
||||
async relocking void activateAbilityTypeFor(Empire& emp, int type);
|
||||
async relocking void activateAbilityTypeFor(Empire& emp, int type, Object@ target);
|
||||
async relocking void activateAbilityTypeFor(Empire& emp, int type, vec3d point);
|
||||
|
||||
void initAbilities(const Design@ fromDesign);
|
||||
void destroyAbilities();
|
||||
void abilityTick(double time);
|
||||
void abilityOwnerChange(Empire@ prevOwner, Empire@ newOwner)
|
||||
void setNeutralAbilities(bool value);
|
||||
void setAbilityDestroy(bool value);
|
||||
void setCooldownForType(int typeId, double cooldown);
|
||||
|
||||
int addAbility(uint id);
|
||||
void createAbility(uint id);
|
||||
void removeAbility(int id);
|
||||
void disableAbility(int id);
|
||||
void enableAbility(int id);
|
||||
bool isChanneling(int id);
|
||||
|
||||
bool isAbilityOnCooldown(int id);
|
||||
double getAbilityRange(int id, Object@ target);
|
||||
double getAbilityRange(int id, vec3d target);
|
||||
|
||||
//Networking
|
||||
void writeAbilities(Message& msg) const;
|
||||
bool writeAbilityDelta(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readAbilities(Message& msg);
|
||||
void readAbilityDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
Object.Cargo : components.Cargo::Cargo {
|
||||
local:
|
||||
CargoStorage@[] getCargo();
|
||||
safe double get_cargoCapacity();
|
||||
safe double get_cargoStored();
|
||||
|
||||
double getCargoStored(uint type);
|
||||
safe uint get_cargoTypes();
|
||||
uint get_cargoType(uint index);
|
||||
|
||||
server:
|
||||
void modCargoStorage(double amount);
|
||||
void addCargo(uint type, double amount);
|
||||
void removeCargo(uint type, double amount);
|
||||
double consumeCargo(uint type, double amount, bool partial = false);
|
||||
void transferAllCargoTo(Object@ other);
|
||||
void transferPrimaryCargoTo(Object@ other, double rate);
|
||||
void transferCargoTo(uint type, Object@ other);
|
||||
|
||||
void writeCargo(Message& msg) const;
|
||||
bool writeCargoDelta(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readCargo(Message& msg);
|
||||
void readCargoDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
Object.Construction : construction.Construction::Construction {
|
||||
restricted local safe:
|
||||
bool get_canBuildShips();
|
||||
bool get_canBuildOrbitals();
|
||||
bool get_canBuildAsteroids();
|
||||
bool get_canBuildSupports();
|
||||
bool get_canTerraform();
|
||||
uint get_constructionCount() const;
|
||||
bool get_constructingSupport() const;
|
||||
bool get_canExportLabor() const;
|
||||
bool get_canImportLabor() const;
|
||||
|
||||
double get_laborIncome() const;
|
||||
double get_constructionCostMod() const;
|
||||
|
||||
int get_shipBuildCost() const;
|
||||
int get_orbitalBuildCost() const;
|
||||
int get_supportBuildSpeed() const;
|
||||
double get_orbitalMaintenanceMod() const;
|
||||
double get_terraformCostMod() const;
|
||||
|
||||
bool get_isRallying() const;
|
||||
vec3d get_rallyPosition() const;
|
||||
|
||||
double get_laborStorageCapacity() const;
|
||||
double get_currentLaborStored() const;
|
||||
|
||||
bool get_isRepeating() const;
|
||||
|
||||
restricted local:
|
||||
float get_constructionProgress() const;
|
||||
string get_constructionName(uint num) const;
|
||||
const Design@ get_constructionDesign() const;
|
||||
Constructible@[] getConstructionQueue();
|
||||
Constructible@[] getConstructionQueue(uint limit);
|
||||
|
||||
Object@ get_rallyObject() const;
|
||||
|
||||
restricted remote:
|
||||
void cancelConstruction(int id);
|
||||
void buildFlagship(const Design@ design, Object@ constructFrom = null);
|
||||
async relocking void buildOrbital(int OrbitalType, vec3d position, Object@ frame = null, Object@ constructFrom = null);
|
||||
async relocking void buildStation(const Design@ design, vec3d position, Object@ frame = null, Object@ constructFrom = null);
|
||||
async relocking void buildConstruction(uint constructionType, Object@ objTarg = null, vec3d pointTarg = vec3d());
|
||||
void buildDryDock(const Design@ forDesign, float pct);
|
||||
void workDryDock(Orbital@ dryDock);
|
||||
async relocking void buildAsteroid(Asteroid@ asteroid, uint resourceId, Object@ constructFrom = null);
|
||||
async relocking void startTerraform(Planet@ planet, uint resourceId);
|
||||
void addSupportShipConstruction(int id, const Design@ dsg, uint amount);
|
||||
void removeSupportShipConstruction(int id, const Design@ dsg, uint amount);
|
||||
void exportLaborTo(Object@ other);
|
||||
void moveConstruction(int id, int beforeId = -1);
|
||||
|
||||
void clearRally();
|
||||
void rallyTo(Object@ dest);
|
||||
void rallyTo(vec3d position);
|
||||
void setRepeating(bool value);
|
||||
|
||||
server:
|
||||
safe uint get_constructionType() const;
|
||||
int get_constructionID(uint num) const;
|
||||
double get_distributedLabor() const;
|
||||
|
||||
safe bool get_isUsingLabor() const;
|
||||
safe double get_baseLaborIncome() const;
|
||||
safe double get_laborFactor() const;
|
||||
void destroyConstruction();
|
||||
void modLaborIncome(double mod);
|
||||
void modLaborFactor(double mod);
|
||||
void setDistributedLabor(double val);
|
||||
safe bool flagUsingLabor(Object@ obj = null);
|
||||
|
||||
void modLaborStorage(double mod);
|
||||
void modStoredLabor(double mod, bool obeyCap = false);
|
||||
|
||||
void modSupportBuildSpeed(int amt);
|
||||
void modShipBuildCost(int amt);
|
||||
void modOrbitalBuildCost(int amt);
|
||||
void modOrbitalMaintenanceMod(double amt);
|
||||
void modTerraformCostMod(double amt);
|
||||
void multConstructionCostMod(double multFactor);
|
||||
uint queuePosition(int id);
|
||||
|
||||
void modConstructionHPBonus(double mod);
|
||||
safe double get_constructionHPBonus();
|
||||
|
||||
void startBuildingConstruction(uint type, vec2i position);
|
||||
void cancelBuildingConstruction(uint type, vec2i position);
|
||||
void startRetrofitConstruction(Object@ fleet, int buildCost, double laborCost, int extraMaint, Object@ constructFrom = null);
|
||||
void retrofitDesignCost(Object@ fleet, const Design@ dsg);
|
||||
void retrofitDesignCostFinish(Object@ fleet);
|
||||
void buildSupport(uint id, const Design@ design, Object@ buildFor);
|
||||
void transferBuildSupport(uint id, Object@ buildFor);
|
||||
void cancelBuildSupport(uint id);
|
||||
|
||||
void doRally(Object@ orderObj);
|
||||
|
||||
void set_canBuildShips(bool value);
|
||||
void set_canBuildOrbitals(bool value);
|
||||
void set_canBuildAsteroids(bool value);
|
||||
void set_canBuildSupports(bool value);
|
||||
void set_canTerraform(bool value);
|
||||
void set_canExportLabor(bool value);
|
||||
void set_canImportLabor(bool value);
|
||||
|
||||
relocking void constructionTick(double time);
|
||||
bool hasConstructionUnder(double eta);
|
||||
|
||||
bool writeConstructionDelta(Message& msg) const;
|
||||
void writeConstruction(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readConstructionDelta(Message& msg);
|
||||
void readConstruction(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
Empire.Attributes : components.Attributes::Attributes {
|
||||
local:
|
||||
safe double getAttribute(uint id);
|
||||
|
||||
server:
|
||||
void initAttributes();
|
||||
void attributesTick(double time);
|
||||
void syncAttributes();
|
||||
|
||||
int createAttributeMod(uint attrib, uint mode, double amount, double timer = -1.0);
|
||||
void removeAttributeMod(uint attrib, int id);
|
||||
|
||||
void modAttribute(uint attrib, uint mode, double amount);
|
||||
|
||||
void writeAttributes(Message& msg, bool initial = false);
|
||||
|
||||
shadow:
|
||||
void readAttributes(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
Empire.EnergyManager : components.EnergyManager::EnergyManager {
|
||||
restricted local:
|
||||
safe uint get_abilityCount() const;
|
||||
Ability@[] getAbilities() const;
|
||||
Ability@[] getAbility(int id) const;
|
||||
Ability@[] getAbilityOfType(uint id) const;
|
||||
uint get_abilityTypes(int id) const;
|
||||
|
||||
restricted remote:
|
||||
async relocking void activateAbility(int id);
|
||||
async relocking void activateAbility(int id, vec3d point);
|
||||
async relocking void activateAbility(int id, Object@ target);
|
||||
|
||||
server:
|
||||
void powerTick(double time);
|
||||
|
||||
int addAbility(uint id);
|
||||
void removeAbility(int id);
|
||||
void disableAbility(int id);
|
||||
void enableAbility(int id);
|
||||
|
||||
//Networking
|
||||
void writeAbilities(Message& msg) const;
|
||||
bool writeAbilityDelta(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readAbilities(Message& msg);
|
||||
void readAbilityDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
Empire.ObjectManager : components.ObjectManager::ObjectManager {
|
||||
restricted local:
|
||||
Planet@[] getPlanets();
|
||||
Planet@[] getQueuedColonizations();
|
||||
Asteroid@[] getAsteroids();
|
||||
safe bool get_hasFlingBeacons();
|
||||
Object@[] getFlingBeacons();
|
||||
Object@ getFlingBeacon(vec3d position);
|
||||
Object@ getClosestFlingBeacon(vec3d position);
|
||||
Object@ getClosestFlingBeacon(Object& obj);
|
||||
Object@[] getStargates();
|
||||
Object@ getStargate(vec3d position);
|
||||
Orbital@[] getOrbitals();
|
||||
bool hasStargates();
|
||||
Artifact@[] getArtifacts();
|
||||
|
||||
bool isDefending(Object@ obj);
|
||||
bool get_hasDefending();
|
||||
Object@[] getDefending();
|
||||
|
||||
double get_globalDefenseRate();
|
||||
double get_globalDefenseStorage();
|
||||
double get_globalDefenseStored();
|
||||
|
||||
safe uint get_planetCount();
|
||||
Planet@ get_planetList(uint index);
|
||||
|
||||
bool isFlingBeacon(Object@ obj);
|
||||
|
||||
safe uint get_orbitalCount();
|
||||
Orbital@ get_orbitals(uint index);
|
||||
Orbital@ getClosestOrbital(uint type, const vec3d& position);
|
||||
|
||||
AutoImportDesc@[] getAutoImports();
|
||||
|
||||
restricted remote:
|
||||
async void autoImportResourceOfClass(Object& into, uint resClsId);
|
||||
async void autoImportResourceOfLevel(Object& into, uint level);
|
||||
async void autoImportResourceOfType(Object& into, uint typeId);
|
||||
async void autoImportToLevel(Object& into, uint level);
|
||||
async void cancelAutoImportTo(Object& into);
|
||||
async void cancelAutoImportTo(Object& into, uint resId);
|
||||
async void cancelAutoImportClassTo(Object& into, uint clsId);
|
||||
async void cancelAutoImportLevelTo(Object& into, uint level);
|
||||
async void autoColonize(Object@ pl);
|
||||
async void cancelColonization(Object@ pl);
|
||||
async void setDefending(Object@ obj, bool value);
|
||||
async void deployDefense(Object& at);
|
||||
|
||||
server:
|
||||
async void registerColonization(Object@ from, Object@ to);
|
||||
async void unregisterColonization(Object@ from, Object@ to, bool cancel = true);
|
||||
|
||||
async void registerPlanet(Planet@ pl);
|
||||
async void unregisterPlanet(Planet@ pl);
|
||||
|
||||
async void registerFlingBeacon(Object@ obj);
|
||||
async void unregisterFlingBeacon(Object@ obj);
|
||||
|
||||
async void registerStargate(Object@ obj);
|
||||
async void unregisterStargate(Object@ obj);
|
||||
bool isStargate(Object@ obj);
|
||||
|
||||
void registerOrbital(Orbital@ obj);
|
||||
void unregisterOrbital(Orbital@ obj);
|
||||
|
||||
async void registerAsteroid(Asteroid@ asteroid);
|
||||
async void unregisterAsteroid(Asteroid@ asteroid);
|
||||
|
||||
async void registerArtifact(Artifact@ obj);
|
||||
async void unregisterArtifact(Artifact@ obj);
|
||||
|
||||
async void checkAutoImport(Object@ from);
|
||||
async void gotImportFor(Object@ forObj, uint resId);
|
||||
|
||||
async void modDefenseRate(double value);
|
||||
async void modDefenseStorage(double value);
|
||||
async void modLocalDefense(double value);
|
||||
async void generateDefense(double amount);
|
||||
async void spawnDefenseAt(Object&, double defense);
|
||||
|
||||
uint get_autoColonizeCount();
|
||||
async void bumpPlanetUpdate();
|
||||
|
||||
void requestTradeCivilian(Region@ toRegion);
|
||||
void stopRequestTradeCivilian(Region@ toRegion);
|
||||
Region@ getTradeCivilianRequest(vec3d position);
|
||||
|
||||
Orbital@ getOrbitalAfter(int id);
|
||||
Object@ popAutoColonizeTarget();
|
||||
void pushAutoColonizeTarget(Object& obj);
|
||||
void registerAutoColonizer(Object& obj, int ablId);
|
||||
void unregisterAutoColonizer(Object& obj, int ablId);
|
||||
|
||||
server:
|
||||
void planetTick(double time);
|
||||
|
||||
void writeObjects(Message& msg, bool initial = false);
|
||||
|
||||
bool get_hasPlanets();
|
||||
|
||||
shadow:
|
||||
void readObjects(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
Empire.ResourceManager : components.ResourceManager::ResourceManager {
|
||||
local:
|
||||
double get_EstTotalPopulation() const;
|
||||
@return Estimated amount of population in this empire, visible to everyone.
|
||||
|
||||
restricted local:
|
||||
double get_TotalPopulation() const;
|
||||
@return Total exact amount of population in this empire.
|
||||
|
||||
|
||||
double get_FTLIncome() const;
|
||||
@return FTL income per second.
|
||||
|
||||
double get_FTLStored() const;
|
||||
@return Current stored FTL.
|
||||
|
||||
double get_FTLCapacity() const;
|
||||
@return Total FTL storage capacity.
|
||||
|
||||
double get_FTLUse() const;
|
||||
@return Current used ftl per second.
|
||||
|
||||
bool get_FTLShortage() const;
|
||||
@return Whether there isn't currently enough ftl to run.
|
||||
|
||||
bool isFTLShortage(double amt) const;
|
||||
@return Whether we would be in ftl shortage using this much energy.
|
||||
|
||||
|
||||
double get_EnergyIncome();
|
||||
@return Energy income per second.
|
||||
|
||||
double get_EnergyStored();
|
||||
@return Current stored Energy.
|
||||
|
||||
double get_EnergyUse();
|
||||
@return Current used energy per second.
|
||||
|
||||
double get_EnergyEfficiency();
|
||||
@return Current efficiency of energy income based on storage.
|
||||
|
||||
bool get_EnergyShortage();
|
||||
@return Whether there isn't currently enough energy to run.
|
||||
|
||||
bool isEnergyShortage(double amt);
|
||||
@return Whether we would be in energy shortage using this much energy.
|
||||
|
||||
|
||||
int get_TotalBudget() const;
|
||||
@return Money generated before reduction by maintenance.
|
||||
|
||||
int get_MaintenanceBudget() const;
|
||||
@return Maintenance being paid every budget cycle.
|
||||
|
||||
int get_RemainingBudget() const;
|
||||
@return Money still available for spending in this budget cycle.
|
||||
|
||||
int get_ForwardBudget() const;
|
||||
@return Money added to the next budget as a single-time modifier.
|
||||
|
||||
int get_BonusBudget() const;
|
||||
@return Special funds bonus budget gotten from one-time incomes.
|
||||
|
||||
int get_EstNextBudget() const;
|
||||
@return Estimated value of the next budget amount.
|
||||
|
||||
int getMoneyFromType(uint type) const;
|
||||
@return The contribution to the budget from a particular type of income/expense.
|
||||
|
||||
uint get_WelfareMode() const;
|
||||
@return The type of welfare exchange mode the empire is using.
|
||||
|
||||
int getEstBudgetConsuming(int amount) const;
|
||||
@return The estimated budget after consuming the given amount.
|
||||
|
||||
double get_BorrowRate() const;
|
||||
@return Factor of borrowed money the next budget is reduced by.
|
||||
|
||||
double get_BudgetCycle() const;
|
||||
@return Total amount of time a single budget cycle lasts.
|
||||
|
||||
double get_BudgetTimer() const;
|
||||
@return Time that has passed since the beginning of this budget cycle.
|
||||
|
||||
bool canBorrow(int amount) const;
|
||||
@arg Total amount of money that would be borrowed.
|
||||
@return Whether it's possible to borrow that amount of money without getting a negative next budget.
|
||||
|
||||
bool canPay(int amount) const;
|
||||
@arg Amount of money that would be spent.
|
||||
@return Whether it's possible to spend that amount of money, including borrowing, without getting a negative next budget.
|
||||
|
||||
float get_DebtFactor() const;
|
||||
@return The factor of income the empire is currently in debt.
|
||||
|
||||
restricted remote:
|
||||
void set_WelfareMode(uint mode);
|
||||
@arg The type of welfare exchange mode the empire should use
|
||||
|
||||
server:
|
||||
void resourceTick(double time);
|
||||
@doc Internal processing function.
|
||||
|
||||
|
||||
void modFTLCapacity(double amount);
|
||||
@doc Modify the FTL storage capacity.
|
||||
|
||||
void modFTLStored(double amount, bool obeyMaximum = false);
|
||||
@doc Modify how much FTL is currently stored.
|
||||
@arg Whether to limit the stored ftl to the maximum ftl cap.
|
||||
|
||||
void modFTLIncome(double amount);
|
||||
@doc Modify the current FTL income.
|
||||
|
||||
void modFTLUse(double amount);
|
||||
@doc Modify the current FTL use.
|
||||
|
||||
double consumeFTL(double amount, bool partial = true, bool record = true);
|
||||
@doc Consume an amount of FTL resource.
|
||||
@arg FTL to consume.
|
||||
@arg Whether a partial amount can be consumed.
|
||||
@arg Whether to immediately record the amount as 'Spent FTL'.
|
||||
@return The amount of FTL that was consumed.
|
||||
|
||||
bool consumeFTLUse(double amount);
|
||||
@doc Grab a chunk of ftl use for our purposes.
|
||||
@arg FTL use to add.
|
||||
@return Whether we can use this much ftl.
|
||||
|
||||
|
||||
void modEnergyStored(double amount);
|
||||
@doc Modify how much Energy is currently stored.
|
||||
|
||||
void modEnergyAllocated(double amount);
|
||||
@doc Modify how much Energy is currently allocated. Allocated energy is considered stored for efficiency purposes, but does not appear as usable energy.
|
||||
|
||||
void modEnergyIncome(double amount);
|
||||
@doc Modify the current Energy income.
|
||||
|
||||
void modEnergyUse(double amount);
|
||||
@doc Modify the current Energy use.
|
||||
|
||||
double consumeEnergy(double amount, bool consumePartial = true);
|
||||
@doc Consume an amount of global energy.
|
||||
@arg Energy to consume.
|
||||
@arg Whether a partial amount can be consumed.
|
||||
@return The amount of energy that was consumed.
|
||||
|
||||
bool consumeEnergyUse(double amount);
|
||||
@doc Grab a chunk of energy use for our purposes.
|
||||
@arg Energy use to add.
|
||||
@return Whether we can use this much energy.
|
||||
|
||||
void addFloatedEnergy(Empire@ other, double amount);
|
||||
@doc Add energy floated for another empire, until spent.
|
||||
|
||||
|
||||
int get_BudgetCycleId();
|
||||
@return ID for the currently active budget cycle.
|
||||
|
||||
int consumeBudget(int amount, bool borrow = true);
|
||||
@doc Spend a chunk of money from the remaining budget.
|
||||
@arg Amount of money to spend.
|
||||
@arg Whether to allow borrowing some or all of the money.
|
||||
@return Budget cycle ID the money was spent in, -1 if unsuccesful.
|
||||
|
||||
int lowerBudget(int amount);
|
||||
@doc Lower the available budget by an amount of money, always able to borrow.
|
||||
@arg Amount of money to spend.
|
||||
@return Budget cycle ID the money was spent in.
|
||||
|
||||
void refundBudget(int amount, int cycleId);
|
||||
@doc Refunds money back to the budget, but only if the money was from this cycle.
|
||||
@arg Amount of money to refund.
|
||||
@arg Budget cycle ID the money was spent in.
|
||||
|
||||
|
||||
void modMaintenance(int amount, uint type = 0);
|
||||
@doc Modify current maintenance costs.
|
||||
|
||||
void modTotalBudget(int amount, uint type = 0);
|
||||
@doc Modify total money income.
|
||||
|
||||
void modForwardBudget(int amount);
|
||||
@doc Add money to the upcoming budget as a single-time modifier.
|
||||
|
||||
void addBonusBudget(int amount);
|
||||
@doc Add money into the bonus budget. Will not go away until spent.
|
||||
|
||||
void modRemainingBudget(int amount);
|
||||
@doc Add money to the current budget as a single-time modifier.
|
||||
|
||||
void resetBudget();
|
||||
@doc Cycle the budget right now.
|
||||
|
||||
void multBorrowPenalty(double multiply);
|
||||
@doc Multiply the penalty for borrowing money from the next cycle.
|
||||
@arg Factor to multiply by.
|
||||
|
||||
|
||||
void modTotalPopulation(double amount);
|
||||
@doc Modify the total empire population remembered.
|
||||
|
||||
|
||||
void writeResources(Message& msg);
|
||||
@doc Internal message passing.
|
||||
|
||||
shadow:
|
||||
void readResources(Message& msg);
|
||||
@doc Internal message passing.
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
Empire.Traits : components.Traits::Traits {
|
||||
local bool hasTrait(uint id) const;
|
||||
local uint get_traitCount() const;
|
||||
local uint getTraitType(uint index) const;
|
||||
|
||||
local uint get_attitudeCount() const;
|
||||
local Attitude@[] getAttitudes() const;
|
||||
local bool hasAttitude(uint id) const;
|
||||
local int getNextAttitudeCost();
|
||||
local uint getAttitudeLevel(uint id) const;
|
||||
|
||||
restricted remote:
|
||||
void takeAttitude(uint id);
|
||||
void discardAttitude(uint id);
|
||||
|
||||
server:
|
||||
void addTrait(uint id, bool doPreInit = false);
|
||||
|
||||
void preInitTraits();
|
||||
void initTraits();
|
||||
void postInitTraits();
|
||||
void traitsTick(double time);
|
||||
void replaceTrait(uint fromId, uint toId, bool doPreInit = true);
|
||||
|
||||
async void forceAttitude(uint id);
|
||||
async void forceDiscardAttitude(uint id);
|
||||
async void levelAttitude(uint id, int levels = 1);
|
||||
async void progressAttitude(uint id, double progress = 0.0, double pct = 0.0);
|
||||
async void resetAttitude(uint id);
|
||||
uint getLevelAttitudeCount(uint level);
|
||||
|
||||
void writeTraits(Message& msg);
|
||||
void writeAttitudes(Message& msg, bool initial);
|
||||
shadow:
|
||||
void readTraits(Message& msg);
|
||||
void readAttitudes(Message& msg, bool initial);
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
Empire.EmpireAI : empire_ai.EmpireAI::EmpireAI {
|
||||
local:
|
||||
bool get_isAI();
|
||||
string getRelation();
|
||||
int getRelationState();
|
||||
restricted local:
|
||||
vec3d get_aiFocus();
|
||||
server:
|
||||
int get_difficulty();
|
||||
uint getAIType();
|
||||
void aiTick(double time);
|
||||
void aiPing(Empire@ fromEmpire, vec3d position, uint type = 0);
|
||||
void initBasicAI();
|
||||
void debugAI();
|
||||
void commandAI(string cmd);
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
Empire.FleetManager : components.FleetManager::FleetManager {
|
||||
restricted local:
|
||||
safe uint get_fleetCount();
|
||||
Object@ get_fleets(uint index);
|
||||
|
||||
restricted local async:
|
||||
Object@ getFleetFromPosition(vec3d pos);
|
||||
Ship@[] getFlagships();
|
||||
Ship@[] getStations();
|
||||
|
||||
server:
|
||||
Ship@ getStrongestFleet();
|
||||
server async:
|
||||
void registerFleet(Object@ obj);
|
||||
void unregisterFleet(Object@ obj);
|
||||
double getTotalFleetStrength();
|
||||
void giveFleetVisionTo(Empire@ toEmpire, bool systemSpace = true, bool deepSpace = true, bool inFTL = true, bool flagships = true, bool stations = false, int statusReq = -1, Region@ toSystem = null);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
Empire.InfluenceManager : components.InfluenceManager::InfluenceManager {
|
||||
restricted local:
|
||||
int get_Influence();
|
||||
double get_InfluenceIncome();
|
||||
double get_InfluencePercentage();
|
||||
double get_InfluenceEfficiency();
|
||||
double get_InfluenceCap();
|
||||
double get_InfluenceFactor();
|
||||
uint getInfluenceCardCount();
|
||||
InfluenceCard@[] getInfluenceCards();
|
||||
int getInfluenceStock();
|
||||
|
||||
local:
|
||||
InfluenceCard@[] getInfluenceCard(int id);
|
||||
uint getInfluenceCardType(int id);
|
||||
int getInfluenceCardUses(int id);
|
||||
int getInfluenceCardQuality(int id);
|
||||
|
||||
uint getEdictType();
|
||||
Empire@ getEdictEmpire();
|
||||
Object@ getEdictObject();
|
||||
|
||||
restricted remote:
|
||||
void clearEdict();
|
||||
void conquerEdict(Empire@ onEmpire);
|
||||
|
||||
server:
|
||||
void addInfluence(double amount);
|
||||
void modInfluence(int amount);
|
||||
void modInfluenceIncome(int amount);
|
||||
void modInfluenceFactor(double amount);
|
||||
|
||||
void takeCardUse(int id, uint amount = 1);
|
||||
void copyCardTo(int id, Empire@ emp, int uses = 0, bool maxQuality = false, int addQuality = 0);
|
||||
void gainRandomLeverage(Empire@ towards, double qualityFactor = 1.0);
|
||||
bool gainIntelligence(Empire@ towards, uint amount = 1);
|
||||
async void gainCard(uint typeId, int uses = 1, int quality = 0);
|
||||
|
||||
uint getUsesOfCardType(uint id);
|
||||
int getCostOfCard(int id);
|
||||
|
||||
int reserveInfluence(double factor, double timer = -1.0);
|
||||
void removeInfluenceReservation(int id);
|
||||
|
||||
void influenceTick(double time);
|
||||
bool consumeInfluence(int amount);
|
||||
|
||||
void writeInfluenceManager(Message& msg, bool initial = false) const;
|
||||
shadow:
|
||||
void readInfluenceManager(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
Object.LeaderAI : orders.LeaderAI::LeaderAI {
|
||||
local:
|
||||
safe double getFormationRadius();
|
||||
|
||||
GroupData@[] getSupportGroups() const;
|
||||
safe uint get_supportCount();
|
||||
Object@ get_supportShip(uint index);
|
||||
|
||||
safe double getFleetHP() const;
|
||||
safe double getFleetDPS() const;
|
||||
safe double getFleetStrength() const;
|
||||
safe double getFleetMaxStrength() const;
|
||||
safe float getFleetEffectiveness() const;
|
||||
safe float getBaseFleetEffectiveness() const;
|
||||
safe double getRemainingExp() const;
|
||||
safe bool get_canHaveSatellites() const;
|
||||
|
||||
safe double get_GhostHP() const;
|
||||
safe double get_GhostDPS() const;
|
||||
|
||||
safe uint get_SupplyUsed() const;
|
||||
safe uint get_SupplyCapacity() const;
|
||||
safe uint get_SupplyAvailable() const;
|
||||
|
||||
restricted local:
|
||||
safe bool get_hasOrders();
|
||||
bool hasOrder(uint type, bool checkQueued = false);
|
||||
uint get_orderCount();
|
||||
string get_orderName(uint num);
|
||||
uint get_orderType(uint num) const;
|
||||
bool get_orderHasMovement(uint num) const;
|
||||
vec3d get_orderMoveDestination(uint num) const;
|
||||
vec3d get_finalMoveDestination() const;
|
||||
|
||||
int getRetrofitCost() const;
|
||||
double getRetrofitLabor() const;
|
||||
|
||||
uint getGhostCount(const Design@ design) const;
|
||||
|
||||
safe uint getAutoMode();
|
||||
safe uint getEngageType();
|
||||
safe uint getEngageBehave();
|
||||
|
||||
safe bool get_autoBuySupports() const;
|
||||
safe bool get_autoFillSupports() const;
|
||||
safe bool get_allowFillFrom() const;
|
||||
|
||||
restricted remote:
|
||||
void addGotoOrder(Object& target, bool append = false);
|
||||
void addAttackOrder(Object& target, bool append = false);
|
||||
void addAbilityOrder(int abilityId, vec3d target, bool append = false);
|
||||
void addAbilityOrder(int abilityId, Object@ target, bool append = false);
|
||||
void addAbilityOrder(int abilityId, vec3d target, double range, bool append = false);
|
||||
void addAbilityOrder(int abilityId, Object@ target, double range, bool append = false);
|
||||
void addCaptureOrder(Planet& target, bool append = false);
|
||||
void addPickupOrder(Pickup& target, bool append = false);
|
||||
void addMoveOrder(vec3d target, bool append = false);
|
||||
void addMoveOrder(vec3d target, quaterniond facing, bool append = false);
|
||||
void addHyperdriveOrder(vec3d target, bool append = false);
|
||||
void addJumpdriveOrder(vec3d target, bool append = false);
|
||||
void addFlingOrder(Object& beacon, vec3d target, bool append = false);
|
||||
void addScanOrder(Anomaly& target, bool append = false);
|
||||
void addRefreshOrder(Object& target, bool append = false);
|
||||
void addOddityGateOrder(Oddity& target, bool append = false);
|
||||
void addSlipstreamOrder(vec3d target, bool append = false);
|
||||
void addAutoExploreOrder(bool useFTL, bool append = false);
|
||||
|
||||
void addSecondaryToSlipstream(Object& other);
|
||||
void addWaitOrder(Object@ waitingFor = null, bool append = false, bool moveTo = false);
|
||||
void moveAfterWait(vec3d position, Object@ waitingFor = null);
|
||||
|
||||
void clearOrders();
|
||||
void clearTopOrder();
|
||||
|
||||
void insertMoveOrder(vec3d target, uint index);
|
||||
void insertHyperdriveOrder(vec3d target, uint index);
|
||||
void insertJumpdriveOrder(vec3d target, uint index);
|
||||
void insertFlingOrder(Object& beacon, vec3d target, uint index);
|
||||
|
||||
void transferSupports(const Design@ ofDesign, uint amount, Object@ transferTo);
|
||||
void orderSupports(const Design@ ofDesign, uint amount);
|
||||
void scuttleSupports(const Design@ ofDesign, uint amount);
|
||||
void rebuildAllGhosts();
|
||||
void clearAllGhosts();
|
||||
void retrofitFleetAt(Object@ obj, Object@ constructFrom = null);
|
||||
|
||||
void setAutoMode(uint type);
|
||||
void setEngageType(uint type);
|
||||
void setEngageBehave(uint type);
|
||||
void setHoldPosition(bool hold);
|
||||
async relocking void refreshSupportsFrom(Object@ obj, bool keepGhosts = false);
|
||||
|
||||
void set_autoBuySupports(bool value);
|
||||
void set_autoFillSupports(bool value);
|
||||
void set_allowFillFrom(bool value);
|
||||
|
||||
void addExperience(double amount);
|
||||
void resetLevelExperience(bool resetLevels = false);
|
||||
void recalculateLevels(int prevSize, int newSize);
|
||||
void convertRandomSupport(Object@ toLeader, Empire@ toEmpire, int maxSize);
|
||||
void compEngageRange();
|
||||
|
||||
server:
|
||||
safe uint get_SupplyGhost() const;
|
||||
safe uint get_SupplyOrdered() const;
|
||||
safe uint get_SupplySatellite() const;
|
||||
|
||||
safe bool get_hasOrderedSupports() const;
|
||||
safe uint get_firstOrderType() const;
|
||||
|
||||
void commandTick();
|
||||
void orderTick(double time);
|
||||
void registerSupport(Object@ obj, bool pickup = false, bool force = false);
|
||||
void unregisterSupport(Object@ obj, bool destroyed = false);
|
||||
|
||||
void set_canGainSupports(bool value);
|
||||
safe bool get_canGainSupports() const;
|
||||
safe bool canTakeSupport(int size, bool pickup = true) const;
|
||||
|
||||
void takeoverFleet(Empire@ newOwner, double supportRatio = 1.0, bool moveToTerritory = false);
|
||||
void leaderInit();
|
||||
void leaderDestroy();
|
||||
void leaderPostLoad();
|
||||
void leaderTick(double time);
|
||||
void leaderChangeOwner(Empire@ oldOwner, Empire@ newOwner);
|
||||
void leaderRegionChanged();
|
||||
void modSupplyCapacity(int amt);
|
||||
void repairFleet(double amount, bool spread = true);
|
||||
void finishFleetRetrofit(Object@ at);
|
||||
void stopFleetRetrofit(Object@ at);
|
||||
void postSupportRetrofit(Ship@ support, const Design@ prevDesign, const Design@ newDesign);
|
||||
void updateFleetStrength();
|
||||
void modBonusDPS(double amount);
|
||||
|
||||
safe double getEngagementRange();
|
||||
Object@ getAttackTarget();
|
||||
double getAttackDistance();
|
||||
|
||||
void idleAllSupports();
|
||||
|
||||
void teleportTo(vec3d position, bool movementPart = false);
|
||||
|
||||
void addSupportGhosts(const Design@ ofDesign, uint amount);
|
||||
void addSupportOrdered(const Design@ ofDesign, uint amount);
|
||||
|
||||
void supportBuildStarted(uint id, const Design@ dsg, Object@ shipyard);
|
||||
void supportBuildFinished(uint id, const Design@ dsg, Object@ shipyard, Ship@ ship);
|
||||
uint getSupportCount(const Design@ design) const;
|
||||
int rebuildGhostsCost();
|
||||
|
||||
void setFleetEffectiveness(float value);
|
||||
void modFleetEffectiveness(float value);
|
||||
|
||||
double get_slowestSupportAccel() const;
|
||||
|
||||
void set_engageRange(double radius);
|
||||
|
||||
safe bool get_freeRaiding();
|
||||
safe double get_raidRange();
|
||||
void setFreeRaiding(bool value);
|
||||
void modRaidRange(double value);
|
||||
|
||||
//Networking
|
||||
void writeLeaderAI(Message& msg) const;
|
||||
bool writeLeaderAIDelta(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void addFakeSupports(const Design@ ofDesign, uint amount);
|
||||
void readLeaderAI(Message& msg);
|
||||
void readLeaderAIDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
Object.Mover : components.Mover::Mover {
|
||||
local safe:
|
||||
bool get_inFTL() const;
|
||||
bool get_isMoving() const;
|
||||
double get_maxAcceleration() const;
|
||||
|
||||
restricted local:
|
||||
vec3d get_moveDestination() const;
|
||||
safe bool get_hasMovePath() const;
|
||||
Object@[] getMovePath() const;
|
||||
|
||||
Object@ getLockedOrbit(bool requireLock = true);
|
||||
Object@ getAroundLockedOrbit();
|
||||
safe bool isLockedOrbit(Object@ at, bool requireLock = true);
|
||||
safe bool hasLockedOrbit(bool requireLock = true);
|
||||
|
||||
server:
|
||||
safe double get_ftlSpeed() const;
|
||||
safe quaterniond get_targetRotation() const;
|
||||
void set_ftlSpeed(double value);
|
||||
safe bool get_isColliding() const;
|
||||
safe vec3d get_internalDestination() const;
|
||||
safe vec3d get_computedDestination() const;
|
||||
void set_maxAcceleration(double accel);
|
||||
void set_rotationSpeed(float speed);
|
||||
double moverTick(double time);
|
||||
bool moveTo(vec3d point, int& id, bool doPathing = true, bool enterOrbit = true, bool allowStop = false);
|
||||
bool moveTo(Object& target, int& id, double distance = 0, bool doPathing = true, bool enterOrbit = true);
|
||||
safe bool isOnMoveOrder(int id);
|
||||
bool rotateTo(quaterniond rotation, int& id);
|
||||
void setRotation(quaterniond rotation);
|
||||
bool FTLTo(vec3d point, double speed, int& id);
|
||||
void FTLTo(vec3d point, double speed);
|
||||
void FTLDrop();
|
||||
void stopMoving(bool doPathing = true, bool enterOrbit = true);
|
||||
void clearMovement();
|
||||
void setCombatFacing(quaterniond& rotation);
|
||||
void clearCombatFacing();
|
||||
async relocking void checkOrbitObject(vec3d destPoint);
|
||||
async relocking void createPathTowards(vec3d destPoint, Object@ target = null);
|
||||
async relocking void updatePath();
|
||||
void speedBoost(double amount);
|
||||
void flagPositionUpdate();
|
||||
void modAccelerationBonus(double mod);
|
||||
void forceLockTo(Object@ obj);
|
||||
|
||||
void impulse(vec3d ForceSeconds);
|
||||
void rotate(quaterniond rot);
|
||||
|
||||
safe bool get_leaderLock() const;
|
||||
void set_leaderLock(bool doLock);
|
||||
|
||||
bool get_hasMovePortal();
|
||||
vec3d getMovePortal();
|
||||
|
||||
void set_hasVectorMovement(bool value);
|
||||
|
||||
bool writeMoverDelta(Message& msg) const;
|
||||
void writeMover(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readMoverDelta(Message& msg);
|
||||
void readMover(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
Empire.Notifications : components.Notifications::Notifications {
|
||||
restricted local:
|
||||
uint get_notificationCount() const;
|
||||
Notification@[] getNotifications(uint limit, int beforeId = -1, bool reverse = true) const;
|
||||
server:
|
||||
void notifyVote(int voteId, int eventId);
|
||||
void notifyWarStatus(Empire@ withEmpire, uint type);
|
||||
void notifyWarEvent(Object@ forObject, uint type);
|
||||
void notifyRename(Object@ forObject, string fromName, string toName);
|
||||
void notifyAnomaly(Object@ forObject);
|
||||
void notifyFlagship(Object@ forObject);
|
||||
void notifyStructure(Object@ atObject, uint type);
|
||||
void notifyEmpireMet(Object@ atObject, Empire@ empire, bool gainsBonus = false);
|
||||
void notifyGeneric(string title, string desc, string icon = "", Empire@ fromEmp = null, Object@ forObject = null);
|
||||
void notifyTreaty(uint treatyId, uint eventType, Empire@ empOne = null, Empire@ empTwo = null);
|
||||
void writeNotifications(Message& msg, bool delta);
|
||||
|
||||
shadow:
|
||||
void readNotifications(Message& msg, bool delta);
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
Object.Resources : components.Resources::ObjectResources {
|
||||
local:
|
||||
Resource@[] getNativeResources() const;
|
||||
Resource@[] getAllResources() const;
|
||||
safe uint get_nativeResourceCount() const;
|
||||
uint get_nativeResourceType(uint index) const;
|
||||
int get_nativeResourceId(uint index) const;
|
||||
uint get_nativeResourceTotalLevel() const;
|
||||
bool get_nativeResourceUsable(uint index) const;
|
||||
bool get_nativeResourceLocked(uint index);
|
||||
uint getTradedResourceCount() const;
|
||||
Object@ get_nativeResourceDestination(uint index) const;
|
||||
bool get_exportEnabled() const;
|
||||
bool get_importEnabled() const;
|
||||
safe uint get_resourceModID() const;
|
||||
safe bool isTerraforming() const;
|
||||
bool get_hasAutoImports() const;
|
||||
safe uint get_queuedImportCount();
|
||||
uint get_queuedImportType(uint i);
|
||||
Object@ get_queuedImportOrigin(uint i);
|
||||
uint getImportsOfClass(uint cls) const;
|
||||
safe float get_resourceVanishRate() const;
|
||||
|
||||
safe uint get_primaryResourceType() const;
|
||||
safe uint get_primaryResourceLevel() const;
|
||||
safe uint get_primaryResourceLimitLevel() const;
|
||||
safe int get_primaryResourceId() const;
|
||||
safe bool get_primaryResourceUsable() const;
|
||||
safe bool get_primaryResourceLocked() const;
|
||||
safe bool get_primaryResourceExported() const;
|
||||
|
||||
string getDisabledReason(int id);
|
||||
|
||||
restricted local:
|
||||
Resource@[] getAvailableResources() const;
|
||||
Resource@[] getImportedResources() const;
|
||||
Resource@[] getQueuedImports() const;
|
||||
Resources@[] getResourceAmounts() const;
|
||||
bool hasImportedResources() const;
|
||||
safe uint get_availableResourceCount() const;
|
||||
uint get_availableResourceType(uint index) const;
|
||||
bool get_availableResourceUsable(uint index) const;
|
||||
uint get_usableResourceCount() const;
|
||||
bool isResourceAvailable(uint id) const;
|
||||
uint getAvailableResourceAmount(uint id) const;
|
||||
Object@ get_availableResourceOrigin(uint index) const;
|
||||
|
||||
remote:
|
||||
async void exportResource(uint index, Object@ to);
|
||||
async void exportResourceByID(int id, Object@ to);
|
||||
|
||||
server:
|
||||
safe bool isPrimaryDestination(Object@ dest);
|
||||
Resource@[] getResourcesFor(Empire@ emp) const;
|
||||
Resource@[] getQueuedImportsFor(Empire@ emp) const;
|
||||
void changeResourceOwner(Empire@ prevOwner);
|
||||
void changeResourceRegion(Region@ prevRegion, Region@ newRegion);
|
||||
void changeResourceTerritory(Territory@ prev, Territory@ terr);
|
||||
void resourceTick(double time);
|
||||
int addResource(uint resourceId);
|
||||
void createResource(uint resourceId);
|
||||
uint getNativeIndex(int id);
|
||||
async void removeResource(int id, bool wasManual = false);
|
||||
Object@ getNativeResourceDestination(Empire@ forEmpire, uint index) const;
|
||||
Object@ getNativeResourceDestinationByID(Empire@ forEmpire, int id) const;
|
||||
bool getNativeResourceUsableByID(int id) const;
|
||||
uint get_nativeResourceByID(int id) const;
|
||||
async void addAvailableResource(Object@ from, int id, uint resource, bool usable);
|
||||
async void removeAvailableResource(Object@ from, int id, bool wasManual = false);
|
||||
async void enableAvailableResource(Object@ from, int id);
|
||||
async void disableAvailableResource(Object@ from, int id, bool wasManual = false);
|
||||
async void setAvailableResourceVanish(Object@ from, int id, double vanishTime);
|
||||
void setResourceDisabled(int nativeId, bool disabled, bool wasManual = false);
|
||||
void setResourceLocked(int nativeId, bool locked);
|
||||
void addQueuedImport(Empire@ forEmpire, Object@ from, int id, uint resource);
|
||||
void removeQueuedImport(Empire@ forEmpire, Object@ from, int id);
|
||||
void setExportEnabled(bool value);
|
||||
void setImportEnabled(bool value);
|
||||
void exportResource(Empire@ forEmpire, uint index, Object@ to);
|
||||
async void clearExportResource(int id);
|
||||
uint getResourceTargetLevel();
|
||||
void modPressure(uint resource, int amount);
|
||||
async void modDummyResource(uint resource, int amount, bool manual = false);
|
||||
void destroyObjResources();
|
||||
uint getUniqueFoodCount(int modBy = 0);
|
||||
uint getFoodCount();
|
||||
void startTerraform();
|
||||
void stopTerraform();
|
||||
void terraformTo(uint resId);
|
||||
void modResourceEfficiencyBonus(double amt);
|
||||
void modResourceVanishBonus(double amt);
|
||||
void bumpResourceModId();
|
||||
void redirectAllImports(Object@ toObject);
|
||||
double pressureFromAsteroids(uint type);
|
||||
uint getAvailableOfTier(uint tier);
|
||||
|
||||
safe float get_resourceEfficiency() const;
|
||||
void set_resourceEfficiency(float val);
|
||||
|
||||
void enableResources();
|
||||
void disableResources();
|
||||
bool get_areResourcesEnabled() const;
|
||||
void setResourceLevel(uint level, bool wasManual = false);
|
||||
int get_resourcePressure(uint resource) const;
|
||||
uint get_resourcesProducing(uint resource) const;
|
||||
int get_totalResourcePressure() const;
|
||||
|
||||
bool writeResourceDelta(Message& msg) const;
|
||||
void writeResources(Message& msg) const;
|
||||
void resourcesPostLoad();
|
||||
|
||||
safe Civilian@ getAssignedCivilian();
|
||||
void setAssignedCivilian(Civilian@ civ);
|
||||
safe double getCivilianTimer();
|
||||
void setCivilianTimer(double time);
|
||||
|
||||
shadow:
|
||||
void readResourceDelta(Message& msg);
|
||||
void readResources(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
Object.Orbit : components.Orbit::Orbit {
|
||||
local:
|
||||
safe bool get_inOrbit() const;
|
||||
safe bool get_hasOrbitCenter() const;
|
||||
server:
|
||||
void orbitTick(double time);
|
||||
void orbitAround(vec3d point);
|
||||
void orbitAround(double minRadius, vec3d point);
|
||||
void orbitAround(vec3d point, double radius);
|
||||
void orbitAround(Object& around);
|
||||
void orbitAround(Object& around, double radius);
|
||||
void orbitAround(Object& around, double radius, double angle);
|
||||
void orbitAround(vec3d position, vec3d origin);
|
||||
void orbitSpin(double dayLength, bool staticPos = false);
|
||||
void orbitRadius(double newRadius);
|
||||
void setOrbitPct(double pct);
|
||||
void orbitDuration(double duration);
|
||||
|
||||
void stopOrbit();
|
||||
async relocking void remakeStandardOrbit(bool orbitPlanets = true);
|
||||
|
||||
void writeOrbit(Message& msg) const;
|
||||
bool writeOrbitDelta(Message& msg) const;
|
||||
Object@ getOrbitingAround();
|
||||
safe bool isOrbitingAround(Object@ around) const;
|
||||
|
||||
shadow:
|
||||
void readOrbit(Message& msg);
|
||||
void readOrbitDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
Object.PickupControl : objects.Pickup::PickupControl {
|
||||
local safe:
|
||||
bool get_isPickupProtected();
|
||||
|
||||
local:
|
||||
Object@ getProtector();
|
||||
|
||||
server:
|
||||
void setCampType(uint id);
|
||||
bool claimPickupDelta(); const
|
||||
void addPickupProtector(Object& obj);
|
||||
void initPickup();
|
||||
void tickPickup(double time);
|
||||
void pickupPickup(Object& obj);
|
||||
|
||||
void writePickup(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readPickup(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
Empire.RandomEvents : components.RandomEvents::RandomEvents {
|
||||
restricted local:
|
||||
bool hasCurrentEvents();
|
||||
CurrentEvent@[] getCurrentEvents();
|
||||
CurrentEvent@[] getEvent(int id);
|
||||
int get_currentEventID();
|
||||
restricted remote:
|
||||
void chooseEventOption(int evtId, uint optId);
|
||||
server:
|
||||
void spawnRandomEvent(uint typeId);
|
||||
void eventsTick(double time);
|
||||
void writeEvents(Message& msg);
|
||||
|
||||
shadow:
|
||||
void readEvents(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
Object.RegionObjects : regions.RegionObjects::RegionObjects {
|
||||
local:
|
||||
safe uint get_planetCount() const;
|
||||
safe Planet@ get_planets(uint index) const;
|
||||
safe uint getPlanetCount(Empire@ emp) const;
|
||||
safe uint get_anomalyCount() const;
|
||||
safe Anomaly@ get_anomalies(uint index) const;
|
||||
safe uint get_asteroidCount() const;
|
||||
safe Asteroid@ get_asteroids(uint index) const;
|
||||
safe uint get_objectCount() const;
|
||||
Object@ get_objects(uint index) const;
|
||||
Object@ getOrbitObject(vec3d point) const;
|
||||
safe uint get_starCount() const;
|
||||
safe Star@ get_stars(uint index) const;
|
||||
safe double get_starTemperature() const;
|
||||
safe double get_starRadius() const;
|
||||
|
||||
safe Territory@ getTerritory(Empire@ forEmpire) const;
|
||||
safe bool sharesTerritory(Empire& forEmpire, Region& region) const;
|
||||
safe bool isTradableRegion(Empire& forEmpire) const;
|
||||
safe Empire@ get_visiblePrimaryEmpire() const;
|
||||
safe uint getContestedState(Empire@ forEmpire) const;
|
||||
|
||||
void addShipDebris(vec3d position, uint count = 1);
|
||||
|
||||
server:
|
||||
safe int getStrength(Empire@ emp) const;
|
||||
double getTotalFleetStrength(uint empireMask, bool fleets = true, bool stations = true, bool planets = true) const;
|
||||
Object@ findEnemy(Empire@ emp, uint empireMask, bool fleets = true, bool stations = true, bool planets = false) const;
|
||||
Object@[] getEnemies(Empire@ emp, uint empireMask, bool fleets = true, bool stations = true, bool planets = false) const;
|
||||
safe double getNeighbourLoyalty(Empire@ emp) const;
|
||||
void modNeighbourLoyalty(Empire@ emp, double amount);
|
||||
safe double getLocalLoyalty(Empire@ emp) const;
|
||||
void modLocalLoyalty(Empire@ emp, double amount);
|
||||
void setTerritory(Empire@ forEmpire, Territory@ territory);
|
||||
void clearTerritory(Empire@ forEmpire, Territory@ oldTerritory);
|
||||
void spawnSupportAtRandomPlanet(Empire@ owner, const Design@ design, bool free = true, Planet@ fallback = null);
|
||||
void addStatusRandomPlanet(int statusType, double duration, uint mask = ~0);
|
||||
void convertRandomSupport(Object@ toLeader, Empire@ toEmpire, uint mask = ~0, int maxSize = -1);
|
||||
void updateRegionPlane() const;
|
||||
void addRegionStatus(Empire@ emp, uint statusId, double timer = -1.0);
|
||||
void removeRegionStatus(Empire@ emp, uint statusId);
|
||||
void mirrorRegionStatusTo(Region& otherRegion);
|
||||
void addSystemDPS(double dps);
|
||||
void addStarDPS(double dps);
|
||||
void dealStarDamage(double damage);
|
||||
void destroyOwnedBy(uint mask, bool ships = true, bool planets = false);
|
||||
async relocking void requestConstructionOn(Object& onObj, uint constrId);
|
||||
async void renameSystem(string name);
|
||||
|
||||
safe Object@[] getPickups();
|
||||
safe Object@[] getPlanets();
|
||||
safe Object@[] getAnomalies();
|
||||
safe Object@[] getArtifacts();
|
||||
safe Object@[] getAsteroids();
|
||||
|
||||
void addStrategicIcon(int level, Object& obj, Node& node);
|
||||
void removeStrategicIcon(int level, Node& node);
|
||||
|
||||
void grantMemory(Empire@ emp);
|
||||
void grantVision(Empire@ emp);
|
||||
void revokeVision(Empire@ emp);
|
||||
void grantTrade(Empire@ emp);
|
||||
void revokeTrade(Empire@ emp);
|
||||
void addTemporaryVision(Empire@ emp, double timer);
|
||||
|
||||
void initRegion();
|
||||
relocking void tickRegion(double time);
|
||||
void leaveRegion(Object& obj);
|
||||
void enterRegion(Object& obj);
|
||||
void regionObjectOwnerChange(Object& obj, Empire@ prevOwner, Empire@ newOwner);
|
||||
void modMilitaryStrength(Empire@ emp, int amount);
|
||||
|
||||
void registerShipyard(Object& obj);
|
||||
void unregisterShipyard(Object& obj);
|
||||
void regionBuildSupport(uint id, Object& obj, const Design@ dsg);
|
||||
void refreshSupportsFor(Object& obj, bool keepGhosts = false);
|
||||
|
||||
void addTradePathing(int toSystem, Object@ from, Object@ to, int resId, uint resource);
|
||||
void removeTradePathing(int toSystem, Object@ origin, int resId);
|
||||
|
||||
int addRegionEffect(Empire@ forEmpire, uint type);
|
||||
void removeRegionEffect(int id);
|
||||
void changeRegionEffectOwner(int id, Empire@ newOwner);
|
||||
|
||||
void forceSiegeAllPlanets(Empire@ emp, uint mask, uint doMask = ~0);
|
||||
void clearForceSiegeAllPlanets(uint mask);
|
||||
|
||||
relocking void freeUpCivilian(Civilian@ civilian);
|
||||
safe bool hasTradeStation(Empire@ emp);
|
||||
safe bool hasTradeStations();
|
||||
void getTradeStation(Civilian@ request, Empire@ emp, vec3d position);
|
||||
void getTradePlanet(Civilian@ request, Empire@ emp);
|
||||
safe void bumpTradeCounter(Empire@ emp);
|
||||
|
||||
void castOnRandomAsteroid(Object@ obj, int ablId);
|
||||
void grantExperience(Empire@ toEmpire, double amount, bool combatOnly = false);
|
||||
|
||||
void regionPostLoad();
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
Empire.ResearchGrid : components.ResearchGrid::ResearchGrid {
|
||||
restricted local:
|
||||
double get_ResearchRate();
|
||||
double get_ResearchPoints();
|
||||
double get_ResearchEfficiency();
|
||||
|
||||
TechnologyNode@[] getTechnologyNodes();
|
||||
TechnologyNode@[] getTechnologyNode(int id);
|
||||
TechnologyNode@[] getTechnologyNode(vec2i position);
|
||||
|
||||
TechnologyNode@[] getResearchingNodes();
|
||||
|
||||
bool isTagUnlocked(int tagID);
|
||||
|
||||
restricted remote:
|
||||
void research(int id, bool secondary = false, bool queue = false);
|
||||
void setResearchQueued(int id, bool queued = true);
|
||||
|
||||
server:
|
||||
void modResearchRate(double mod);
|
||||
void generatePoints(double pts, bool modified = true, bool penalized = true);
|
||||
void initResearch();
|
||||
void researchTick(double time);
|
||||
async void removeResearchOfType(int type);
|
||||
async void replaceResearchOfType(int type, int replaceWith);
|
||||
async void replaceResearchAt(vec2i position, int replaceWith);
|
||||
async void replaceResearchGrid(string name);
|
||||
|
||||
bool consumeResearchPoints(int amount);
|
||||
void freeResearchPoints(int amount);
|
||||
void reduceResearchPenalty(int points);
|
||||
|
||||
void setTagUnlocked(int tagID, bool unlocked);
|
||||
|
||||
void writeResearch(Message& msg, bool initial = false);
|
||||
async void revealSecretProject(bool pickedOnly = false);
|
||||
|
||||
shadow:
|
||||
void readResearch(Message& msg);
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
Object.Statuses : components.Statuses::Statuses {
|
||||
local:
|
||||
Status@[] getStatusEffects();
|
||||
bool hasStatusEffect(uint typeId);
|
||||
|
||||
safe uint get_statusEffectCount();
|
||||
uint get_statusEffectType(uint index);
|
||||
uint get_statusEffectStacks(uint index);
|
||||
Object@ get_statusEffectOriginObject(uint index);
|
||||
Empire@ get_statusEffectOriginEmpire(uint index);
|
||||
|
||||
uint getStatusStackCount(uint typeId, Object@ originObject = null, Empire@ originEmpire = null);
|
||||
uint getStatusStackCountAny(uint typeId);
|
||||
|
||||
server:
|
||||
int addStatus(double timer, uint typeId, Empire@ boundEmpire = null, Region@ boundRegion = null, Empire@ originEmpire = null, Object@ originObject = null);
|
||||
void addStatus(uint typeId, double timer = -1.0, Empire@ boundEmpire = null, Region@ boundRegion = null, Empire@ originEmpire = null, Object@ originObject = null);
|
||||
void removeStatus(int id);
|
||||
bool isStatusInstanceActive(int id);
|
||||
void removeStatusType(uint typeId);
|
||||
void removeStatusInstanceOfType(uint typeId);
|
||||
void removeRegionBoundStatus(Region@ region, uint typeId, double timer = -1.0);
|
||||
|
||||
uint get_statusInstanceCount();
|
||||
uint get_statusInstanceType(uint index);
|
||||
int get_statusInstanceId(uint index);
|
||||
|
||||
void addRandomCondition();
|
||||
|
||||
void changeStatusOwner(Empire@ prevOwner, Empire@ newOwner);
|
||||
void changeStatusRegion(Region@ prevRegion, Region@ newRegion);
|
||||
void statusTick(double time);
|
||||
void destroyStatus();
|
||||
|
||||
void writeStatuses(Message& msg) const;
|
||||
bool writeStatusDelta(Message& msg) const;
|
||||
|
||||
shadow:
|
||||
void readStatuses(Message& msg);
|
||||
void readStatusDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
Object.SupportAI : orders.SupportAI::SupportAI {
|
||||
restricted remote:
|
||||
void transferTo(Object@ leader);
|
||||
void transferTo(Object@ leader, vec3d newOffset);
|
||||
void setFleetOffset(vec3d offset);
|
||||
|
||||
server:
|
||||
void supportInit();
|
||||
void completeRegisterLeader(Object@ leader);
|
||||
void supportDestroy();
|
||||
void supportTick(double time);
|
||||
void supportScuttle();
|
||||
void clearLeader(Object@ prevLeader);
|
||||
void preventExpire();
|
||||
safe bool get_isDetached();
|
||||
safe bool get_isRaiding();
|
||||
safe void set_doRaids(bool raid);
|
||||
|
||||
void writeSupportAI(Message& msg) const;
|
||||
bool writeSupportAIDelta(Message& msg) const;
|
||||
|
||||
void supportAttack(Object@ target);
|
||||
void cavalryCharge(Object@ target);
|
||||
void supportInterfere(Object@ target, Object@ protect);
|
||||
void supportRetreat();
|
||||
void supportIdle();
|
||||
void supportPostLoad();
|
||||
|
||||
void set_supportEngageRange(double range);
|
||||
|
||||
safe int get_LeaderID();
|
||||
|
||||
shadow:
|
||||
void readSupportAI(Message& msg);
|
||||
void readSupportAIDelta(Message& msg);
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
Object.SurfaceComponent : planets.SurfaceComponent::SurfaceComponent {
|
||||
local safe:
|
||||
uint get_maxPopulation() const;
|
||||
double get_population() const;
|
||||
uint get_level() const;
|
||||
uint get_levelChain() const;
|
||||
uint get_resourceLevel() const;
|
||||
int get_income() const;
|
||||
double get_decayTime() const;
|
||||
bool get_quarantined() const;
|
||||
double get_undevelopedMaintenance() const;
|
||||
double get_buildingConstructRate() const;
|
||||
double get_tileDevelopmentRate() const;
|
||||
uint get_pressureCap() const;
|
||||
float get_totalPressure() const;
|
||||
int get_maxLevel() const;
|
||||
|
||||
bool isProtected(Empire@ siegeEmpire = null) const;
|
||||
int get_baseLoyalty() const;
|
||||
int get_currentLoyalty() const;
|
||||
int getLoyaltyFacing(Empire@ emp) const;
|
||||
bool get_isContested() const;
|
||||
bool get_hasContestion() const;
|
||||
bool get_isBeingColonized() const;
|
||||
bool get_isUnderSiege() const;
|
||||
bool get_isOverPressure() const;
|
||||
int get_buildingMaintenance() const;
|
||||
|
||||
Empire@ get_captureEmpire() const;
|
||||
float get_capturePct() const;
|
||||
|
||||
double getResourceProduction(uint resource);
|
||||
double getResourcePressure(uint resource);
|
||||
|
||||
Empire@ get_visibleOwner() const;
|
||||
uint get_visibleLevel() const;
|
||||
vec3d get_planetIconPosition() const;
|
||||
|
||||
uint get_totalSurfaceTiles() const;
|
||||
uint get_usedSurfaceTiles() const;
|
||||
|
||||
uint get_planetGraphicsFlags() const;
|
||||
uint getBuildingCount() const;
|
||||
uint get_surfaceModId() const;
|
||||
vec2i get_surfaceGridSize();
|
||||
vec2i get_originalGridSize();
|
||||
|
||||
uint getSurfaceData(Image& img);
|
||||
|
||||
safe uint get_Biome0();
|
||||
safe uint get_Biome1();
|
||||
safe uint get_Biome2();
|
||||
|
||||
local:
|
||||
uint getBuildingCount(uint buildingId) const;
|
||||
uint get_buildingType(uint index) const;
|
||||
|
||||
PlanetSurface@[] getPlanetSurface();
|
||||
|
||||
restricted local:
|
||||
safe double get_colonyShipAccel() const;
|
||||
safe bool get_isColonizing() const;
|
||||
safe bool get_canSafelyColonize() const;
|
||||
safe uint get_colonyOrderCount() const;
|
||||
|
||||
bool hasColonyTarget(Object& other) const;
|
||||
Object@ get_colonyTarget(uint index) const;
|
||||
int get_lowestLoyalty() const;
|
||||
|
||||
remote:
|
||||
void annex(Empire@ forEmpire = null);
|
||||
|
||||
restricted remote:
|
||||
async void colonize(Object& other, double toPopulation = 1.0);
|
||||
async void stopColonizing(Object& other);
|
||||
void abandon();
|
||||
void buildBuilding(uint tid, vec2i pos);
|
||||
void destroyBuilding(vec2i pos);
|
||||
|
||||
server:
|
||||
safe bool get_isSendingColonyShips() const;
|
||||
safe bool isEmpireColonizing(Empire@ emp) const;
|
||||
safe Empire@ visibleOwnerToEmp(Empire@ emp) const;
|
||||
safe bool hasBiome(uint id) const;
|
||||
void setBeingColonized(Empire@ emp, bool value);
|
||||
void forceAbandon();
|
||||
void forceDestroyBuilding(vec2i pos, bool undevelop = false);
|
||||
safe bool isPressureSaturated(uint resource);
|
||||
|
||||
void giveBasicIconVision(Empire@ emp);
|
||||
|
||||
void initSurface(int width, int height, uint baseBiome, uint biomeTwo, uint biomeThree, uint resourceId);
|
||||
void destroySurface();
|
||||
void regenSurface(int width, int height, uint biomeCount);
|
||||
int getBuildingAt(uint x, uint y);
|
||||
float getBuildingProgressAt(uint x, uint y);
|
||||
void replaceAllBiomesWith(uint id);
|
||||
void replaceFirstBiomeWith(uint id);
|
||||
void replaceBiome(uint index, uint id);
|
||||
async relocking void mirrorSurfaceFrom(Object& other);
|
||||
void forceUsefulSurface(double pct, uint biomeId);
|
||||
|
||||
void changeSurfaceOwner(Empire@ prevOwner);
|
||||
void changeSurfaceRegion(Region@ prevRegion, Region@ newRegion);
|
||||
void changeSurfaceTerritory(Territory@ prev, Territory@ terr);
|
||||
|
||||
void reducePopInTransit(Object& target, double amount);
|
||||
void modMaxPopulation(int amt);
|
||||
void addPopulation(double population, bool allowOver = true);
|
||||
void removePopulation(double population, double minimum = 0);
|
||||
void modIncomingPop(double population);
|
||||
safe double get_IncomingPop();
|
||||
safe uint get_emptyDevelopedTiles();
|
||||
|
||||
void surfaceTick(double time);
|
||||
void colonyShipArrival(Empire@ owner, double population);
|
||||
void takeoverPlanet(Empire@ newOwner, double supportRatio = 1.0);
|
||||
void setQuarantined(bool value);
|
||||
void fakeSiege(uint mask);
|
||||
void clearFakeSiege(uint mask);
|
||||
void forceSiege(uint mask);
|
||||
void clearForceSiege(uint mask);
|
||||
void restoreLoyalty(double mod);
|
||||
void modLoyaltyFacing(Empire@ emp, double mod);
|
||||
void setLoyaltyBonus(int bonus);
|
||||
void spawnBuilding(uint tid, vec2i pos, bool develop = false);
|
||||
void setBuildingCompletion(uint x, uint y, float progress);
|
||||
void modCityCount(int mod);
|
||||
void addSurfaceArea(vec2i size, uint biome, uint voidBiome = uint(-1), bool separate = false, bool developed = false, bool vertical = false);
|
||||
async relocking stealFinalSurfaceRowsFrom(Object& other, uint rows = 1, uint voidBiome = uint(-1));
|
||||
async relocking removeFinalSurfaceRows(uint rows = 1);
|
||||
|
||||
void modOverpopulation(int steps);
|
||||
void modGrowthRate(double amt);
|
||||
void modTileDevelopRate(double amt);
|
||||
void developTiles(uint amount);
|
||||
void modBuildingConstructRate(double amt);
|
||||
void modUndevelopedMaintenance(double amt);
|
||||
void modCivResourceMod(uint resource, double amount);
|
||||
float getCivResourceMod(uint resource);
|
||||
void modColonyShipAccel(double mod);
|
||||
void modBaseLoyalty(int mod);
|
||||
void setGraphicsFlag(uint flag, bool value);
|
||||
void modIncome(int mod);
|
||||
void set_maxLevel(int level);
|
||||
void setLevelChain(uint chainId, bool wasManual = true);
|
||||
|
||||
void clearProtectedFrom(uint mask = ~0);
|
||||
void protectFrom(uint mask);
|
||||
|
||||
void destroyRandomTile(bool civilOnly);
|
||||
void modBombardment(int amount);
|
||||
void absoluteSiege(Empire@ fromEmpire, double loyAmount);
|
||||
void enterIntoOrbit(Object@ ship);
|
||||
void leaveFromOrbit(Object@ ship);
|
||||
bool get_enemiesInOrbit() const;
|
||||
bool get_isGettingRelief() const;
|
||||
safe void flagColonizing();
|
||||
|
||||
void setContestion(bool value);
|
||||
double getCivilianProduction(uint resource);
|
||||
|
||||
void modResource(uint resource, double amount);
|
||||
void addAffinity(uint aff);
|
||||
void removeAffinity(uint aff);
|
||||
uint getAffinitiesMatching(uint type);
|
||||
void modPressureCapFactor(float amt);
|
||||
void modPressureCapMod(int amt);
|
||||
void setNeedsPopulationForLevel(bool value);
|
||||
void onManualResourceRemoved();
|
||||
|
||||
void modBuildingMaintenanceRefund(int amt);
|
||||
void setProtectionDisabled(bool val);
|
||||
|
||||
void spawnDefenseShips(double totalLaborValue);
|
||||
|
||||
bool writeSurfaceDelta(Message& msg) const;
|
||||
void writeSurface(Message& msg) const;
|
||||
void surfacePostLoad();
|
||||
|
||||
async void requestSurface();
|
||||
|
||||
shadow:
|
||||
void readSurfaceDelta(Message& msg);
|
||||
void readSurface(Message& msg);
|
||||
}
|
||||
Reference in New Issue
Block a user