Freeciv-3.3: /fast/freeciv/nightly/main/common/scriptcore/api_game_effects.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Functions
api_game_effects.c File Reference
`#include "effects.h"`
`#include "luascript.h"`
`#include "api_game_effects.h"`

Go to the source code of this file.

## Functions

int | api_effects_world_bonus (lua_State *L, const char *effect_type)
int | api_effects_player_bonus (lua_State *L, Player *pplayer, const char *effect_type)
int | api_effects_city_bonus (lua_State *L, City *pcity, const char *effect_type)
int | api_effects_unit_bonus (lua_State *L, Unit *punit, Player *other_player, const char *effect_type)
int | api_effects_tile_bonus (lua_State *L, Tile *ptile, City *pcity, const char *output_id, const char *effect_type)
int | api_effects_unit_vs_tile_bonus (lua_State *L, Unit *punit, Tile *ptile, const char *effect_type)

## Function Documentation

## ◆ api_effects_city_bonus()

int api_effects_city_bonus | ( | lua_State * | L,
|  | City * | pcity,
|  | const char * | effect_type
| ) |  |

Returns the effect bonus at a city.

Definition at line 65 of file api_game_effects.c.

Referenced by tolua_game_effects_city_bonus00().

## ◆ api_effects_player_bonus()

int api_effects_player_bonus | ( | lua_State * | L,
|  | Player * | pplayer,
|  | const char * | effect_type
| ) |  |

Returns the effect bonus for a player

Definition at line 46 of file api_game_effects.c.

Referenced by tolua_game_effects_player_bonus00().

## ◆ api_effects_tile_bonus()

int api_effects_tile_bonus | ( | lua_State * | L,
|  | Tile * | ptile,
|  | City * | pcity,
|  | const char * | output_id,
|  | const char * | effect_type
| ) |  |

Get effect bonus at tile.

Parameters

  L | Lua State to use
  ptile | Tile to get the effect value for
  pcity | Optional: City related to the effect (e.g. City harvesting the tile)
  output_id | Optional: Indetifier of the output related to the effect (e.g. Output to harvest from the tile)
  effect_type | Effect to check

Returns
  Effect bonus value

Definition at line 124 of file api_game_effects.c.

Referenced by tolua_game_effects_tile_bonus00().

## ◆ api_effects_unit_bonus()

int api_effects_unit_bonus | ( | lua_State * | L,
|  | Unit * | punit,
|  | Player * | other_player,
|  | const char * | effect_type
| ) |  |

Returns the effect bonus at a unit. Can take other_player to support local DiplRel requirements.

Definition at line 85 of file api_game_effects.c.

Referenced by tolua_game_effects_unit_bonus00().

## ◆ api_effects_unit_vs_tile_bonus()

int api_effects_unit_vs_tile_bonus | ( | lua_State * | L,
|  | Unit * | punit,
|  | Tile * | ptile,
|  | const char * | effect_type
| ) |  |

Returns the effect bonus at a tile and the specified unit. Unlike effects.unit_bonus() the city the effect is evaluated against is the city at ptile tile rather than the city at the unit's tile.

Definition at line 168 of file api_game_effects.c.

Referenced by tolua_game_effects_unit_vs_tile_bonus00().

## ◆ api_effects_world_bonus()

int api_effects_world_bonus | ( | lua_State * | L,
|  | const char * | effect_type
| ) |  |

Returns the effect bonus in the world

Definition at line 29 of file api_game_effects.c.

Referenced by tolua_game_effects_world_bonus00().