SLIC-Reference : ConsiderMotivation
CTP2 Bureau
The Modding
Knowledgebase
WePlayCiv: CtP2 Downloads
WePlayCiv: Call To Power forum
Apolyton Call To Power forums
Civilization Fanatics: Call To Power

SLIC-Reference : : ConsiderMotivation  

Arguments: player, priority, type[, player|unit|advance] Type: void

Makes the player consider a motivation with given priority - type is a MOTIVATION_TYPE (valid values: see source). Certain MOTIVATION_TYPEs require additional parameters: player, advance or unit.

Source:

// VOID ConsiderMotivation(player, priority, type[,])
// here type is a MOTIVATION_TYPE
SFN_ERROR Slic_ConsiderMotivation::Call(SlicArgList *args)
{
	if (args->Count() < 3)
		return SFN_ERROR_NUM_ARGS;

	sint32 argNum = 0;
	PLAYER_INDEX player;
	sint32 priority;
	sint32 type;
	sint32 value;
	Unit unit;
	Motivation motivation;

	if(!args->GetPlayer(argNum++, player))
		return SFN_ERROR_TYPE_ARGS;
	
	if(!args->GetInt(argNum++, priority))
		return SFN_ERROR_TYPE_ARGS;

	Assert( priority >= 0);
	motivation.priority = static_cast(priority);

	if(!args->GetInt(argNum++, type))
		return SFN_ERROR_TYPE_ARGS;
	
	Assert(type > MOTIVATION_NONE);
	Assert(type < MOTIVATION_MAX);
	motivation.type = static_cast(type);

	switch (motivation.type)
	{
		case MOTIVATION_FEAR_SCENARIO:
		case MOTIVATION_FEAR_SCIENCE_RANK:
		case MOTIVATION_FEAR_MILITARY_RANK:
		case MOTIVATION_FEAR_TRADE_RANK:
		case MOTIVATION_DESIRE_SCENARIO:
		case MOTIVATION_DESIRE_TRADE:
		case MOTIVATION_DESIRE_GROWTH:
		case MOTIVATION_DESIRE_GOLD:
			break;

		case MOTIVATION_FEAR_INVASION:
		case MOTIVATION_FEAR_PIRACY:
		case MOTIVATION_FEAR_SPECIAL_ATTACKS:
		case MOTIVATION_FEAR_SPYING:
		case MOTIVATION_DESIRE_ATTACK:
		case MOTIVATION_DESIRE_INTIMIDATE:
		case MOTIVATION_DESIRE_MAKE_FRIEND:
			if(!args->GetPlayer(argNum++, value))
				return SFN_ERROR_TYPE_ARGS;
			motivation.arg.playerId = player;
			break;

		case MOTIVATION_FEAR_CITY_DEFENSE:
		case MOTIVATION_DESIRE_ATTACK_CITY:
			if(!args->GetCity(argNum++, unit))
				return SFN_ERROR_TYPE_ARGS;
			motivation.arg.cityId = unit.m_id;
			break;
	
		case MOTIVATION_FEAR_ADVANCE:
		case MOTIVATION_DESIRE_ADVANCE:
			if(!args->GetInt(argNum++, value))
				return SFN_ERROR_TYPE_ARGS;
			motivation.arg.advanceType = value;
			break;
		default:
			Assert(false);
	}

	Diplomat::GetDiplomat(player).ConsiderMotivation( motivation );

	return SFN_ERROR_OK;
}

Information last updated by BureauBert on 26.06.2009

User Comments:

Using this form you may add your own observations concerning the above item, e.g. additional hints for usage, limitations, oddities etc. Please note this is not the place for asking questions or carrying out discussions about modding - please refer to the Apolyton CTP2 Modification Forum on that purpose.

Subject / Title*:
Text:*
(A maximum of characters left)
Your name:*
Your website (URL):

*) Required fields

No user comments yet.

  Administration
This site is currently maintained by: BureauBert (Webmaster)  Maquiladora (Manager)  Legal Notice: Legal Notice Statistics: 70569 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne
Share this page:  VK Facebook Twitter LiveJournal OK MR Google+ LinkedIn tumblr Pinterest Blogger Digg Evernote