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

S3_0, S2_6 - Marko Lindqvist, 2020-11-07 10:08 PM

View differences:

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

  
448
  adv->dipl.tech_leader = NULL;
449
  players_iterate(aplayer) {
450
    if (adv->dipl.tech_leader == NULL
451
        || adv->dipl.tech_leader->score.techs < aplayer->score.techs) {
452
      adv->dipl.tech_leader = aplayer;
453
    }
454
  } players_iterate_end;
455

  
448 456
  /*** Priorities ***/
449 457

  
450 458
  /* NEVER set these to zero! Weight values are usually multiplied by 
server/advisors/advdata.h
91 91
  struct {
92 92
    struct adv_dipl **adv_dipl_slots;
93 93

  
94
    struct player *spacerace_leader; /* who is leading the space pack */
95
    struct player *production_leader;
94
    struct player *spacerace_leader;  /* Who is leading the space pack */
95
    struct player *tech_leader;       /* Who is first to get spacerace techs */
96
    struct player *production_leader; /* Who is quickest to build spaceship */
96 97
  } dipl;
97 98

  
98 99
  int num_continents; /* last time we updated our continent data */
99
- 
(2-2/2)