Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #825079 ยป 0054-AI-Reduce-defense-building-wants-by-about-20.patch

Marko Lindqvist, 2019-07-05 05:32 AM

View differences:

ai/default/daieffects.c
447 447
    if (has_handicap(pplayer, H_DEFENSIVE)) {
448 448
      v += amount / 10; /* make AI slow */
449 449
    }
450

  
451
    /* TODO: Really should consider how many affected enemy units there is. */
450 452
    unit_class_iterate(pclass) {
451 453
      if (requirement_fulfilled_by_unit_class(pclass, &peffect->reqs)) {
452 454
        if (pclass->adv.sea_move != MOVE_NONE) {
......
465 467
    if (affects_sea_capable_units) {
466 468
      if (is_ocean_tile(pcity->tile)) {
467 469
        v += ai->threats.ocean[-tile_continent(pcity->tile)]
468
          ? amount/5 : amount/20;
470
          ? amount / 6 : amount / 25;
469 471
      } else {
470 472
        adjc_iterate(&(wld.map), pcity->tile, tile2) {
471 473
          if (is_ocean_tile(tile2)) {
472 474
            if (ai->threats.ocean[-tile_continent(tile2)]) {
473
              v += amount/5;
475
              v += amount / 6;
474 476
              break;
475 477
            }
476 478
          }
477 479
        } adjc_iterate_end;
478 480
      }
479 481
    }
480
    v += (amount/20 + ai->threats.invasions - 1) * c; /* for wonder */
482
    v += (amount / 25 + ai->threats.invasions - 1) * c; /* for wonder */
481 483
    if (capital || affects_land_capable_units) {
482 484
      Continent_id place = tile_continent(pcity->tile);
483 485

  
......
489 491
                        and have relevant checks here. */
490 492
              && is_terrain_class_near_tile(pcity->tile, TC_OCEAN))) {
491 493
        if (place && ai->threats.continent[place]) {
492
          v += amount;
494
          v += amount * 4 / 5;
493 495
        } else {
494
          v += amount / (!ai->threats.igwall ? (15 - capital * 5) : 15);
496
          v += amount / (!ai->threats.igwall ? (18 - capital * 6) : 18);
495 497
        }
496 498
      }
497 499
    }
498
- 
    (1-1/1)