|
CTP2 Bureau The Modding Knowledgebase |
|
Apolyton CTP2 forums Apolyton CTP2 archives Source Code Project SVN |
![]() |
Search the site: |
SLIC-Reference :
|
| Arguments: | sender, receiver, player, type | Type: | int |
| Type: 0 = science, 1 = gold, 2 = production, 3 = regard |
// INT GetNewProposalResult(sender,receiver,player,type)
// type: 0 = science, 1 = gold, 2 = production, 3 = regard
SFN_ERROR Slic_GetNewProposalResult::Call(SlicArgList *args)
{
if (args->Count() != 4)
return SFN_ERROR_NUM_ARGS;
sint32 argNum = 0;
PLAYER_INDEX sender;
PLAYER_INDEX receiver;
PLAYER_INDEX player;
sint32 type;
if(!args->GetPlayer(argNum++, sender))
return SFN_ERROR_TYPE_ARGS;
if(!args->GetPlayer(argNum++, receiver))
return SFN_ERROR_TYPE_ARGS;
if(!args->GetPlayer(argNum++, player))
return SFN_ERROR_TYPE_ARGS;
if(!args->GetInt(argNum++, type))
return SFN_ERROR_TYPE_ARGS;
NewProposal proposal=Diplomat::GetDiplomat(sender).GetMyLastNewProposal(receiver);
DiplomacyResult sender_result;
DiplomacyResult receiver_result;
ProposalAnalysis::ComputeResult(proposal,sender_result, receiver_result);
if (player==sender){
switch(type){
case 0:m_result.m_int = sender_result.science;
return SFN_ERROR_OK;
case 1:m_result.m_int = sender_result.gold;
return SFN_ERROR_OK;
case 2:m_result.m_int = sender_result.production;
return SFN_ERROR_OK;
case 3:m_result.m_int = sender_result.regard;
return SFN_ERROR_OK;
default:m_result.m_int = 0;
}
}
if (player==receiver){
switch(type){
case 0:m_result.m_int = receiver_result.science;
return SFN_ERROR_OK;
case 1:m_result.m_int = receiver_result.gold;
return SFN_ERROR_OK;
case 2:m_result.m_int = receiver_result.production;
return SFN_ERROR_OK;
case 3:m_result.m_int = receiver_result.regard;
return SFN_ERROR_OK;
default:m_result.m_int = 0;
}
}
return SFN_ERROR_OK;
} |
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.
*) Required fields
| No user comments yet. |
|
| This site is currently maintained by: BureauBert (Webmaster) Maquiladora (Manager) Legal Notice: Legal Notice Statistics: 307184 unique users since 02.05.2004 (» Site Statistics) Hosted by: WebhostOne |