1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-15 14:09:06 +00:00

Add EV_NOAVOID and bone_lookAtPosition()

This commit is contained in:
fgenesis 2013-02-06 21:01:22 +01:00
parent 4433237f3a
commit ab6e92f256
3 changed files with 15 additions and 2 deletions

View file

@ -2788,7 +2788,7 @@ void Entity::doEntityAvoidance(float dt, int range, float mod, Entity *ignore)
{
Entity *e = *i;
if (e != this && e != ignore && e->ridingOnEntity != this)
if (e != this && e != ignore && e->ridingOnEntity != this && !e->getv(EV_NOAVOID))
{
diff = (this->position - e->position);
if (diff.isLength2DIn(range) && !diff.isZero())

View file

@ -70,7 +70,8 @@ enum EV
EV_MINIMAP = 19, // should the entity show up on the minimap?
EV_SOULSCREAMRADIUS = 20, // 0-n: size of radius for naija's dual form scream attack, -1: always hit
EV_WEBSLOW = 21, // 100 by default, multiplied by dt and then divided into vel
EV_MAX = 22
EV_NOAVOID = 22, // if 1: doEntityAvoidance() will ignore this entity
EV_MAX = 23
};
enum DamageType

View file

@ -2887,6 +2887,16 @@ luaFunc(bone_lookAtEntity)
luaReturnNil();
}
luaFunc(bone_lookAtPosition)
{
Bone *b = bone(L);
if (b)
{
b->lookAt(Vector(lua_tonumber(L, 2), lua_tonumber(L, 3)), lua_tonumber(L, 4), lua_tonumber(L, 5), lua_tonumber(L, 6), lua_tonumber(L, 7));
}
luaReturnNil();
}
luaFunc(entity_resetTimer)
{
ScriptedEntity *se = scriptedEntity(L);
@ -7510,6 +7520,7 @@ static const struct {
luaRegister(bone_showFrame),
luaRegister(bone_lookAtEntity),
luaRegister(bone_lookAtPosition),
luaRegister(entity_partSetSegs),
@ -8446,6 +8457,7 @@ static const struct {
luaConstant(EV_MINIMAP),
luaConstant(EV_SOULSCREAMRADIUS),
luaConstant(EV_WEBSLOW),
luaConstant(EV_NOAVOID),
luaConstant(EV_MAX),
{"EVT_NONE", 0},