Loading

Paste #pex5dlqpr

  1. function WrightAI::GetEngineOptimalRealFakeDist(engine_id, days_in_transit)
  2. {
  3.     /* Assuming going in axis, it is the same as distancemanhattan */
  4.     local realfakedist = (AIEngine.GetMaxSpeed(engine_id) * 2 * 74 * days_in_transit / 256) / 16;
  5.     return realfakedist;

Paste #pjzwj6cj6

  1. function WrightAI::GetEngineOptimalDaysInTransit(engine_id, cargo, days_int, valuator = false)
  2. {
  3.     local distance = WrightAI.GetEngineOptimalRealFakeDist(engine_id, 1000);
  4.     local running_cost = AIEngine.GetRunningCost(engine_id);
  5.     local capacity = AIEngine.GetCapacity(engine_id);

Paste #ps8xl6rne

  1. Trans-Continental
  2.  
  3. Gameplay mechanics
  4.  
  5. TL;DR

Paste #przwrcgpv

  1.     AddSetting({
  2.       name = "select_town_cargo",
  3.       description = "Town Cargo",
  4.       easy_value = 0,
  5.       medium_value = 0,

Paste #pwxcszvll

  1.     AddSetting({
  2.       name = "select_town_cargo",
  3.       description = "Town Cargo",
  4.       easy_value = 0,
  5.       medium_value = 0,

Paste #pwiz28dvn

  1. Trans-Continental
  2.  
  3. Gameplay mechanics
  4.  
  5. TL;DR

Paste #pvvpwsinb

  1. Trans-Continental
  2.  
  3. Gameplay mechanics
  4.  
  5. TL;DR

Paste #pgyu8bbk8

  1.         //if any other station is nearby, except my own airports, return true
  2.         for (local tile = square.Begin(); square.HasNext(); tile = square.Next()) {
  3.             if(AITile.IsStationTile(tile)) {
  4.                 if (AITile.GetOwner(tile) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF)) {
  5.                     return true;

Paste #pgbxqhdnq

  1.         //if any other station is nearby, except my own airports, return true
  2.         for(local tile = square.Begin(); square.HasNext(); tile = square.Next()) {
  3.             if(AITile.IsStationTile(tile) && AITile.GetOwner(tile) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) ||
  4.                AITile.IsStationTile(tile) && AITile.GetOwner(tile) == AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) && !AIStation.HasStationType(AIStation.GetStationID(tile), AIStation.STATION_AIRPORT)) {
  5.                 return true;

Paste #pwp2v1qoc

  1.     function removeUsedCityPair(fromCity, toCity) {
  2.         for (local i = m_nearCityPairArray.len() - 1 ; i >= 0; --i) {
  3.             if (m_nearCityPairArray[i].isEqual(fromCity, toCity)) {
  4.                 m_nearCityPairArray.remove(i);
  5.             }

Paste #pptgbn3aq

  1.     //find road way between fromTile and toTile
  2.     function buildRoad(fromTile, toTile) {
  3.         //can store road tiles into array
  4.         local builtTiles = [];

Paste #pfjjpkvto

  1. /* Utils.nut */
  2. function Utils::HasMoney(money)
  3. {
  4.     local loan_amount = AICompany.GetLoanAmount();
  5.     local max_loan_amount = AICompany.GetMaxLoanAmount();

Paste #ptzbjupwa

  1. /**
  2.  * Build an airport route. Find 2 cities that are big enough and try to build airport in both cities.
  3.  * Then we can build an aircraft and make some money.
  4.  */
  5. function WrightAI::BuildAirportRoute()

Paste #pkii1nhhh

  1. class MoneyTest {
  2.     function DoMoneyTest() {
  3.         local price = GetPrice();
  4.         if (WrightAI.HasMoney(price)) {
  5.             WrightAI.GetMoney(price);

Paste #pqpkz9ykh

  1. /* Original code */
  2. ()
  3. //  local price = AIEngine.GetPrice(engine);
  4. //  if (HasMoney(price)) GetMoney(price);
  5. //  local vehicle = AIVehicle.BuildVehicle(best_hangar, engine);