mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-12-27 07:06:00 +00:00
Script interface:
- Add entity_doElementInteraction() - Add avatar_setElementEffectMult() - Change entity_isUnderWater(): Can now supply an override position.
This commit is contained in:
parent
6f9063ce6d
commit
0df586874d
1 changed files with 29 additions and 1 deletions
|
@ -3572,7 +3572,7 @@ luaFunc(entity_isUnderWater)
|
||||||
bool b = false;
|
bool b = false;
|
||||||
if (e)
|
if (e)
|
||||||
{
|
{
|
||||||
b = e->isUnderWater();
|
b = e->isUnderWater(Vector(lua_tonumber(L, 2), lua_tonumber(L, 3)));
|
||||||
}
|
}
|
||||||
luaReturnBool(b);
|
luaReturnBool(b);
|
||||||
}
|
}
|
||||||
|
@ -5146,6 +5146,31 @@ luaFunc(entity_applySurfaceNormalForce)
|
||||||
luaReturnNil();
|
luaReturnNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(entity_doElementInteraction)
|
||||||
|
{
|
||||||
|
Entity *e = entity(L);
|
||||||
|
if (e)
|
||||||
|
{
|
||||||
|
float mult = lua_tonumber(L, 2);
|
||||||
|
float touchWidth = lua_tonumber(L, 3);
|
||||||
|
if (!touchWidth)
|
||||||
|
touchWidth = 16;
|
||||||
|
|
||||||
|
ElementUpdateList& elems = dsq->game->elementUpdateList;
|
||||||
|
for (ElementUpdateList::iterator it = elems.begin(); it != elems.end(); ++it)
|
||||||
|
{
|
||||||
|
(*it)->doInteraction(e, mult, touchWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
luaReturnNil();
|
||||||
|
}
|
||||||
|
|
||||||
|
luaFunc(avatar_setElementEffectMult)
|
||||||
|
{
|
||||||
|
dsq->game->avatar->elementEffectMult = lua_tonumber(L, 1);
|
||||||
|
luaReturnNil();
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(flingMonkey)
|
luaFunc(flingMonkey)
|
||||||
{
|
{
|
||||||
Entity *e = entity(L);
|
Entity *e = entity(L);
|
||||||
|
@ -8636,6 +8661,9 @@ static const struct {
|
||||||
luaRegister(entity_adjustPositionBySurfaceNormal),
|
luaRegister(entity_adjustPositionBySurfaceNormal),
|
||||||
luaRegister(entity_applySurfaceNormalForce),
|
luaRegister(entity_applySurfaceNormalForce),
|
||||||
|
|
||||||
|
luaRegister(entity_doElementInteraction),
|
||||||
|
luaRegister(avatar_setElementEffectMult),
|
||||||
|
|
||||||
luaRegister(createBeam),
|
luaRegister(createBeam),
|
||||||
luaRegister(beam_setAngle),
|
luaRegister(beam_setAngle),
|
||||||
luaRegister(beam_setDamage),
|
luaRegister(beam_setDamage),
|
||||||
|
|
Loading…
Reference in a new issue