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 #894739 » 0022-AI-Initiate-the-spacerace-if-being-tech-leader.patch

master - Marko Lindqvist, 2020-11-07 10:08 PM

View differences:

ai/default/daieffects.c
311 311
  case EFT_ENABLE_SPACE:
312 312
    if (victory_enabled(VC_SPACERACE)) {
313 313
      v += 10;
314
      if (adv->dipl.production_leader == pplayer) {
315
	v += 150;
314
      if (adv->dipl.production_leader == pplayer
315
          || adv->dipl.tech_leader == pplayer) {
316
        v += 150;
316 317
      }
317 318
    }
318 319
    break;
......
396 397
  case EFT_SS_COMPONENT:
397 398
  case EFT_SS_MODULE:
398 399
    if (victory_enabled(VC_SPACERACE)
399
	/* If someone has started building spaceship already or
400
	 * we have chance to win a spacerace */
401
	&& (adv->dipl.spacerace_leader
402
	    || adv->dipl.production_leader == pplayer)) {
400
        /* If someone has started building spaceship already or
401
         * we have chance to win a spacerace */
402
        && (adv->dipl.spacerace_leader
403
            || adv->dipl.production_leader == pplayer
404
            || adv->dipl.tech_leader == pplayer)) {
403 405
      v += 140;
404 406
    }
405 407
    break;
server/advisors/advdata.c
466 466
    }
467 467
  } players_iterate_end;
468 468

  
469
  adv->dipl.tech_leader = NULL;
470
  players_iterate(aplayer) {
471
    if (adv->dipl.tech_leader == NULL
472
        || adv->dipl.tech_leader->score.techs < aplayer->score.techs) {
473
      adv->dipl.tech_leader = aplayer;
474
    }
475
  } players_iterate_end;
476

  
469 477
  /*** Priorities ***/
470 478

  
471 479
  /* NEVER set these to zero! Weight values are usually multiplied by 
server/advisors/advdata.h
95 95
  struct {
96 96
    struct adv_dipl **adv_dipl_slots;
97 97

  
98
    struct player *spacerace_leader; /* who is leading the space pack */
99
    struct player *production_leader;
98
    struct player *spacerace_leader;  /* Who is leading the space pack */
99
    struct player *tech_leader;       /* Who is first to get spacerace techs */
100
    struct player *production_leader; /* Who is quickest to build spaceship */
100 101
  } dipl;
101 102

  
102 103
  int num_continents; /* last time we updated our continent data */
103
- 
(1-1/2)