Feature #989 ยป 0051-Lua-Add-Player-cancel_pact-method.patch
common/diptreaty.h | ||
---|---|---|
#define SPECENUM_COUNT CLAUSE_COUNT
|
||
#include "specenum_gen.h"
|
||
#define CLAUSE_LAST CLAUSE_COUNT
|
||
#define is_pact_clause(x) \
|
||
((x == CLAUSE_CEASEFIRE) || (x == CLAUSE_PEACE) || (x == CLAUSE_ALLIANCE))
|
||
server/scripting/api_server_game_methods.c | ||
---|---|---|
#include "aitraits.h" /* ai_trait_get_value() */
|
||
/* server */
|
||
#include "hand_gen.h"
|
||
#include "plrhand.h"
|
||
#include "report.h"
|
||
... | ... | |
pplayer->ai_common.love[player_number(towards)]
|
||
+= amount * MAX_AI_LOVE / 1000;
|
||
}
|
||
/**********************************************************************//**
|
||
Try to cancel a pact between players.
|
||
**************************************************************************/
|
||
void api_methods_cancel_pact(lua_State *L, Player *pplayer, Player *towards)
|
||
{
|
||
LUASCRIPT_CHECK_STATE(L);
|
||
LUASCRIPT_CHECK_SELF(L, pplayer);
|
||
LUASCRIPT_CHECK_ARG_NIL(L, towards, 3, Player);
|
||
handle_diplomacy_cancel_pact(pplayer, player_number(towards), CLAUSE_LAST);
|
||
}
|
server/scripting/api_server_game_methods.h | ||
---|---|---|
int api_methods_love(lua_State *L, Player *pplayer, Player *towards);
|
||
void api_methods_add_love(lua_State *L, Player *pplayer, Player *towards, int amount);
|
||
void api_methods_cancel_pact(lua_State *L, Player *pplayer, Player *towards);
|
||
#endif /* FC__API_SERVER_GAME_METHODS_H */
|
server/scripting/tolua_server.pkg | ||
---|---|---|
@ love (lua_State *L, Player *pplayer, Player *towards);
|
||
void api_methods_add_love
|
||
@ add_love (lua_State *L, Player *pplayer, Player *towards, int amount);
|
||
void api_methods_cancel_pact
|
||
@ cancel_pact (lua_State *L, Player *pplayer, Player *towards);
|
||
}
|
||
$[
|