widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #07095
Re: [Merge] lp:~widelands-dev/widelands/bug-1530370-soldiers-lua into lp:widelands
Review: Approve code review + testing
LGTM, just a few minor typos in documentation (see diff comments).
Diff comments:
>
> === modified file 'src/scripting/lua_map.cc'
> --- src/scripting/lua_map.cc 2016-03-22 07:32:14 +0000
> +++ src/scripting/lua_map.cc 2016-04-02 16:56:15 +0000
> @@ -2716,19 +2716,176 @@
>
>
>
> -/*
> - ==========================================================
> - LUA METHODS
> - ==========================================================
> - */
> -
> -
> -
> -/*
> - ==========================================================
> - C METHODS
> - ==========================================================
> - */
> +
> +/* RST
> +SoldierDescription
> +-----------------
> +
> +.. class:: SoldierDescription
> +
> + A static description of a tribe's soldier, so it can be used in help files
> + without having to access an actual instance of the worker on the map.
> + See also class WorkerDescription for more properties.
> +*/
> +const char LuaSoldierDescription::className[] = "SoldierDescription";
> +const MethodType<LuaSoldierDescription> LuaSoldierDescription::Methods[] = {
> + {nullptr, nullptr},
> +};
> +const PropertyType<LuaSoldierDescription> LuaSoldierDescription::Properties[] = {
> + PROP_RO(LuaSoldierDescription, max_health_level),
> + PROP_RO(LuaSoldierDescription, max_attack_level),
> + PROP_RO(LuaSoldierDescription, max_defense_level),
> + PROP_RO(LuaSoldierDescription, max_evade_level),
> + PROP_RO(LuaSoldierDescription, base_health),
> + PROP_RO(LuaSoldierDescription, base_min_attack),
> + PROP_RO(LuaSoldierDescription, base_max_attack),
> + PROP_RO(LuaSoldierDescription, base_defense),
> + PROP_RO(LuaSoldierDescription, base_evade),
> + PROP_RO(LuaSoldierDescription, health_incr_per_level),
> + PROP_RO(LuaSoldierDescription, attack_incr_per_level),
> + PROP_RO(LuaSoldierDescription, defense_incr_per_level),
> + PROP_RO(LuaSoldierDescription, evade_incr_per_level),
> + {nullptr, nullptr, nullptr},
> +};
> +
> +
> +/*
> + ==========================================================
> + PROPERTIES
> + ==========================================================
> + */
> +
> +
> +/* RST
> + .. attribute:: get_max_health_level
> +
> + (RO) The maximum health level that the soldier can have.
> +*/
> +int LuaSoldierDescription::get_max_health_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_max_health_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: max_attack_level
> +
> + (RO) The maximum attack level that the soldier can have.
> +*/
> +int LuaSoldierDescription::get_max_attack_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_max_attack_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: max_defense_level
> +
> + (RO) The maximum defense level that the soldier can have.
> +*/
> +int LuaSoldierDescription::get_max_defense_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_max_defense_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: max_evade_level
> +
> + (RO) The maximum evade level that the soldier can have.
> +*/
> +int LuaSoldierDescription::get_max_evade_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_max_evade_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: get_base_health
> +
> + (RO) The health points that the soldier starts with
> +*/
> +int LuaSoldierDescription::get_base_health(lua_State * L) {
> + lua_pushinteger(L, get()->get_base_health());
> + return 1;
> +}
> +
> +
> +/* RST
> + .. attribute:: base_min_attack
> +
> + (RO) The minimum random attack points that get added to a soldier' attack
Typo: soldier' -> soldier's
> +*/
> +int LuaSoldierDescription::get_base_min_attack(lua_State * L) {
> + lua_pushinteger(L, get()->get_base_min_attack());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: base_max_attack
> +
> + ((RO) The maximum random attack points that get added to a soldier' attack
Typos:
- additional left parenthesis
- soldier' -> soldier's
> +*/
> +int LuaSoldierDescription::get_base_max_attack(lua_State * L) {
> + lua_pushinteger(L, get()->get_base_max_attack());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: base_defense
> +
> + (RO) The defense % that the soldier starts with
> +*/
> +int LuaSoldierDescription::get_base_defense(lua_State * L) {
> + lua_pushinteger(L, get()->get_base_defense());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: base_evade
> +
> + (RO) The evade % that the soldier starts with
> +*/
> +int LuaSoldierDescription::get_base_evade(lua_State * L) {
> + lua_pushinteger(L, get()->get_base_evade());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: get_health_incr_per_level
> +
> + (RO) The health points that the soldier will gain with each level.
> +*/
> +int LuaSoldierDescription::get_health_incr_per_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_health_incr_per_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: attack_incr_per_level
> +
> + (RO) The attack points that the soldier will gain with each level.
> +*/
> +int LuaSoldierDescription::get_attack_incr_per_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_attack_incr_per_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: defense_incr_per_level
> +
> + (RO) The defense % that the soldier will gain with each level.
> +*/
> +int LuaSoldierDescription::get_defense_incr_per_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_defense_incr_per_level());
> + return 1;
> +}
> +
> +/* RST
> + .. attribute:: evade_incr_per_level
> +
> + (RO) The evade % that the soldier will gain with each level.
> +*/
> +int LuaSoldierDescription::get_evade_incr_per_level(lua_State * L) {
> + lua_pushinteger(L, get()->get_evade_incr_per_level());
> + return 1;
> +}
>
> /* RST
> ResourceDescription
--
https://code.launchpad.net/~widelands-dev/widelands/bug-1530370-soldiers-lua/+merge/290800
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1530370-soldiers-lua.
References