Loading

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);

Paste #pizkc23g9

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

Paste #pgunmzidm

  1. class MoneyTest {
  2.     function DoMoneyTest() {
  3.         /* Build the airports for real */
  4.         local last_cost = AIAccounting();
  5.         if (AITestMode() && DoBuildAirport()) {

Paste #pknb4f6ep

  1.     /* Build the airports for real */
  2.     local last_cost = AIAccounting();
  3.     if (AITestMode() && AIAirport.BuildAirport(airport1_location, airport1_type, airport1_stationId)) {
  4.         if (HasMoney(last_cost.GetCosts())) GetMoney(last_cost.GetCosts());
  5.     }

Paste #penqudfnq

  1.     /* Build the airports for real */
  2.     local last_cost = AIAccounting();
  3.     if (AITestMode() && AIAirport.BuildAirport(airport1_location, airport1_type, airport1_stationId)) {
  4.         if (HasMoney(last_cost.GetCosts())) GetMoney(last_cost.GetCosts());
  5.     }

Paste #piwcihsrz

  1. function WrightAI::SubLocationDistanceAircraft(t0, t1)
  2. {
  3.     local t0x = AIMap.GetTileX(t0);
  4.     local t0y = AIMap.GetTileY(t0);
  5.     local t1x = AIMap.GetTileX(t1);

Paste #p55s04cof

  1. function WrightAI::SubLocationDistanceAircraft(t0, t1)
  2. {
  3.     local t0x = AIMap.GetTileX(t0);
  4.     local t0y = AIMap.GetTileY(t0);
  5.     local t1x = AIMap.GetTileX(t1);

Paste #po9qykj5r

  1. function WrightAI::GetBestRouteEngine(tile_1, tile_2) {
  2.     local engine_list = AIEngineList(AIVehicle.VT_AIR);
  3.     engine_list.Valuate(AIEngine.CanRefitCargo, this.cargoId);
  4.     engine_list.KeepValue(1);