Freeciv-3.3
Loading...
Searching...
No Matches
Functions
api_server_game_methods.h File Reference
#include "luascript_types.h"
#include "api_server_edit.h"

Go to the source code of this file.

Functions

int api_methods_player_trait (lua_State *L, Player *pplayer, const char *tname)
 
int api_methods_player_trait_base (lua_State *L, Player *pplayer, const char *tname)
 
int api_methods_player_trait_current_mod (lua_State *L, Player *pplayer, const char *tname)
 
void api_methods_player_lose (lua_State *L, Player *pplayer, Player *looter)
 
int api_methods_nation_trait_min (lua_State *L, Nation_Type *pnation, const char *tname)
 
int api_methods_nation_trait_max (lua_State *L, Nation_Type *pnation, const char *tname)
 
int api_methods_nation_trait_default (lua_State *L, Nation_Type *pnation, const char *tname)
 
int api_methods_player_tech_bulbs (lua_State *L, Player *pplayer, Tech_Type *tech)
 
int api_methods_player_free_bulbs (lua_State *L, Player *pplayer)
 
int api_methods_tag_score (lua_State *L, Player *pplayer, const char *tag)
 
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)
 

Function Documentation

◆ api_methods_add_love()

void api_methods_add_love ( lua_State L,
Player pplayer,
Player towards,
int  amount 
)

Add player love towards another.

Definition at line 254 of file api_server_game_methods.c.

Referenced by tolua_server_Player_add_love00().

◆ api_methods_cancel_pact()

void api_methods_cancel_pact ( lua_State L,
Player pplayer,
Player towards 
)

Try to cancel a pact between players.

Definition at line 268 of file api_server_game_methods.c.

Referenced by tolua_server_Player_cancel_pact00().

◆ api_methods_love()

int api_methods_love ( lua_State L,
Player pplayer,
Player towards 
)

Return player's love towards another.

Definition at line 242 of file api_server_game_methods.c.

Referenced by tolua_server_Player_love00().

◆ api_methods_nation_trait_default()

int api_methods_nation_trait_default ( lua_State L,
Nation_Type pnation,
const char tname 
)

Return the default trait value that will be allocated for a nation

Definition at line 155 of file api_server_game_methods.c.

Referenced by tolua_server_Nation_Type_trait_default00().

◆ api_methods_nation_trait_max()

int api_methods_nation_trait_max ( lua_State L,
Nation_Type pnation,
const char tname 
)

Return the maximum random trait value that will be allocated for a nation

Definition at line 136 of file api_server_game_methods.c.

Referenced by tolua_server_Nation_Type_trait_max00().

◆ api_methods_nation_trait_min()

int api_methods_nation_trait_min ( lua_State L,
Nation_Type pnation,
const char tname 
)

Return the minimum random trait value that will be allocated for a nation

Definition at line 117 of file api_server_game_methods.c.

Referenced by tolua_server_Nation_Type_trait_min00().

◆ api_methods_player_free_bulbs()

int api_methods_player_free_bulbs ( lua_State L,
Player pplayer 
)

Returns bulbs that can be freely transferred to a new research target.

Definition at line 216 of file api_server_game_methods.c.

Referenced by tolua_server_Player_properties_free_bulbs00().

◆ api_methods_player_lose()

void api_methods_player_lose ( lua_State L,
Player pplayer,
Player looter 
)

Mark the player as one who lost the game, optionally giving some loot to looter. This method only marks the nation for wipeout that happens only when kill_dying_players() does the reaper's job. FIXME: client may be not aware if its player is killed in a script.

Definition at line 101 of file api_server_game_methods.c.

Referenced by tolua_server_Player_lose00().

◆ api_methods_player_tech_bulbs()

int api_methods_player_tech_bulbs ( lua_State L,
Player pplayer,
Tech_Type tech 
)

In multiresearch mode, returns bulbs saved for a specific tech in pplayer's research. In other modes, returns the additional bulbs the player may get switching to this tech (negative for penalty)

Definition at line 177 of file api_server_game_methods.c.

Referenced by tolua_server_Player_bulbs_saved00().

◆ api_methods_player_trait()

int api_methods_player_trait ( lua_State L,
Player pplayer,
const char tname 
)

Return the current value of an AI trait in force (base+mod)

Definition at line 40 of file api_server_game_methods.c.

Referenced by tolua_server_Player_trait00().

◆ api_methods_player_trait_base()

int api_methods_player_trait_base ( lua_State L,
Player pplayer,
const char tname 
)

Return the current base value of an AI trait (not including Lua mod)

Definition at line 59 of file api_server_game_methods.c.

Referenced by tolua_server_Player_trait_base00().

◆ api_methods_player_trait_current_mod()

int api_methods_player_trait_current_mod ( lua_State L,
Player pplayer,
const char tname 
)

Return the current Lua increment to an AI trait (can be changed with api_edit_trait_mod_set())

Definition at line 79 of file api_server_game_methods.c.

Referenced by tolua_server_Player_trait_current_mod00().

◆ api_methods_tag_score()

int api_methods_tag_score ( lua_State L,
Player pplayer,
const char tag 
)

Return score of the type associated to the tag.

Definition at line 231 of file api_server_game_methods.c.

Referenced by tolua_server_Player_tag_score00().