mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-12-25 22:25:46 +00:00
Add EV_NOAVOID and bone_lookAtPosition()
This commit is contained in:
parent
4433237f3a
commit
ab6e92f256
3 changed files with 15 additions and 2 deletions
|
@ -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())
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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},
|
||||
|
|
Loading…
Reference in a new issue