Exemple #1
0
void CampaignEastWest::plot_a3_next_day()
{
	// viking kingdom survive and mongol kingdom destroyed
	if( !nation_array.is_deleted(plot_nation_recno1)
		&& nation_array.is_deleted(plot_nation_recno2) )
	{
		// fryhtan is not defeated

		if( !nation_array.is_deleted(plot_enemy_nation_recno) )
		{
			NationRelation* nationRelation = nation_array[plot_nation_recno1]->get_relation(nation_array.player_recno);

			short resetWStr[] = { TALK_PROPOSE_ALLIANCE_TREATY, 0 };
			nationRelation->reset_ai_never_consider(resetWStr);
			short setWStr[] = { TALK_END_ALLIANCE_TREATY, 0 };
			nationRelation->set_ai_never_consider(setWStr);

			// if alliance is set

			if( nationRelation->status == RELATION_ALLIANCE )
			{
				// enhance ai relation so it can accept player request declare war with frythan

				nation_array[plot_nation_recno1]->
					change_ai_relation_level(nation_array.player_recno, +100 );

				// hardware not to cease fire with fryhtan kingdom

				short resetWStr2[] = { TALK_REQUEST_CEASE_WAR, 0 };
				nation_array[plot_nation_recno1]->get_relation(plot_enemy_nation_recno)
					->set_ai_never_consider( resetWStr2 );
			}

			// propose an alliance treaty

			else if( info.game_date % 15 == 0 )
			{
				if( nationRelation->status == RELATION_FRIENDLY
					|| nationRelation->status == RELATION_NEUTRAL)
				{
					talk_res.ai_send_talk_msg( nation_array.player_recno,
						plot_nation_recno1, TALK_PROPOSE_ALLIANCE_TREATY );
				}
			}
		}

		// fryhtan is defeated

		else
		{
			NationRelation* nationRelation = nation_array[plot_nation_recno1]->get_relation(nation_array.player_recno);

			nationRelation->ai_never_consider[TALK_SURRENDER-1] = 0;

			talk_res.ai_send_talk_msg( nation_array.player_recno,
				plot_nation_recno1, TALK_SURRENDER );

			plot_nation_recno1 = 0;
		}
	}
}