The Castle objects can reference details about the city the script is run in.
Castle objects can be referenced as:
m_city.cityManager.castle.property or city.castle.property
The .property at the end is how you will specify which detail you are referencing. Using the table below, you can for example get the name of the city with city.castle.name. Some castle properties are aliased via the city object as well, for example city.castle.name and city.name are the same thing.
Properties
Property |
Type |
Description |
allowAlliance |
Boolean |
Returns true if the embassy is open. |
buffs |
Object |
Returns an object of the current castles buffs. |
buildingQueuesArray |
Array |
Returns information on the current castles building queues. |
buildingsArray |
Array of Objects |
Returns infromation on the current castles buildings. |
fieldId |
Integer |
Returns the Field ID of the cuttent Castle. |
fieldsArray |
Array |
Returns infromation on the castles fields. |
fortification |
Object |
Returns infromation on the castles fortifications. |
hasEnemy |
Boolean |
Returns true if the castle has incoming attacks. |
herosArray |
Array of Objects |
Returns information on the heroes in the castle. |
id |
Integer |
Returns the unique ID of the castle. |
logUrl |
String |
Returns the path of the Castle image. |
name |
String |
Returns the name of the current castle. |
oid |
Integer |
Returns the old Castle ID. |
Object |
Returns an object containing the current castles resource information. |
|
support |
Boolean |
Returns true if supporting troops exist. |
tradesArray |
Array Of Objects |
Returns information on current trades in the castle. |
transingTradesArray |
Array |
Returns infromation on successful ongoing trades. |
troop |
Object |
Returns infroamtion on the current castles troops. |
usePACIFY_SUCCOUR_OR_PACIFY_PRAY |
boolean |
Returns true if conforting is in cooldown. |