SLIC-Reference : GetNewProposalResult
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 : : GetNewProposalResult  

Arguments: sender, receiver, player, type Type: int

Type: 0 = science, 1 = gold, 2 = production, 3 = regard

Source:

// 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;
}

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: 69716 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