lua/wrappers/game/lua_stat_modifier.cpp
/**
	 * Creates a new stat modifier object with the given parameters.
	 * The value of this modifier is used in the context of the type of modification.
	 * <br>This is the list of each modifier type:
	 * <ul>
	 * <li>= : Sets the stat to the given value. This mod is applied first.</li>
	 * <li>* : Multiplies the stat by the given value. This mod is applied second.</li>
	 * <li>+ : Adds the given value directly onto the stat, this value can be negative. This mod is applied third.</li>
	 * </ul>
	 *
	 * @param number value The value of this modifier.
	 * @param string type The stat modifier type.
	 * @param boolean [true] magical This currently does not change the behaviour of the modifier, however it does
	 *  allow the UI to show the origin of this mod better.
	 */
Creates a new stat modifier object with the given parameters.
The value of this modifier is used in the context of the type of modification.
This is the list of each modifier type:

= : Sets the stat to the given value. This mod is applied first.
* : Multiplies the stat by the given value. This mod is applied second.
+ : Adds the given value directly onto the stat, this value can be negative. This mod is applied third.


@param number value The value of this modifier.
@param string type The stat modifier type.
@param boolean [true] magical This currently does not change the behaviour of the modifier, however it does
allow the UI to show the origin of this mod better.
Creates a new stat modifier object with the given parameters . The value of this modifier is used in the context of the type of modification . This is the list of each modifier type : = : Sets the stat to the given value . This mod is applied first . * : Multiplies the stat by the given value . This mod is applied second . + : Adds the given value directly onto the stat this value can be negative . This mod is applied third . @param number value The value of this modifier . @param string type The stat modifier type . @param boolean [ true ] magical This currently does not change the behaviour of the modifier however it does allow the UI to show the origin of this mod better .
int StatModifier_ctor(lua_State *lua)
	{
		if (lua_gettop(lua) == 0)
		{
			StatModifier *stat = new StatModifier();
			wrapObject<StatModifier>(lua, stat);
			return 1;
		}
		else if (lua_isnum(lua, 1) && lua_isstr(lua, 2))
		{
			StatModifierType type = getStatModifier(lua, 2);
			if (type == MOD_MAX_LENGTH)
			{
				lua_pushnil(lua);
				return 1;
			}
			bool magical = true;
			if (lua_isboolean(lua, 3))
			{
				magical = lua_tobool(lua, 3);
			}
			StatModifier *stat = new StatModifier(lua_tofloat(lua, 1), type, magical);
			wrapObject<StatModifier>(lua, stat);
			return 1;
		}
		return LuaState::expectedArgs(lua, "@new", 2, "", "number value, string type, boolean [true] magical");
	}
int StatModifier_ctor ( lua_State * lua ) { if ( lua_gettop ( lua ) == 0 ) { StatModifier * stat = new StatModifier ( ) ; wrapObject < StatModifier > ( lua , stat ) ; return 1 ; } else if ( lua_isnum ( lua , 1 ) && lua_isstr ( lua , 2 ) ) { StatModifierType type = getStatModifier ( lua , 2 ) ; if ( type == MOD_MAX_LENGTH ) { lua_pushnil ( lua ) ; return 1 ; } bool magical = true ; if ( lua_isboolean ( lua , 3 ) ) { magical = lua_tobool ( lua , 3 ) ; } StatModifier * stat = new StatModifier ( lua_tofloat ( lua , 1 ) , type , magical ) ; wrapObject < StatModifier > ( lua , stat ) ; return 1 ; } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; }
Creates a new stat modifier object with the given parameters.
Creates a new stat modifier object with the given parameters .