mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-10 22:26:22 +00:00
Merge branch 'experimental' of github.com:fgenesis/Aquaria_clean into experimental
This commit is contained in:
commit
db2faf026c
13 changed files with 108 additions and 62 deletions
|
@ -7127,7 +7127,7 @@ void Avatar::onUpdate(float dt)
|
||||||
|
|
||||||
if(!core->particlesPaused && elementEffectMult > 0)
|
if(!core->particlesPaused && elementEffectMult > 0)
|
||||||
{
|
{
|
||||||
ElementUpdateList& elems = dsq->game->elementUpdateList;
|
ElementUpdateList& elems = dsq->game->elementInteractionList;
|
||||||
for (ElementUpdateList::iterator it = elems.begin(); it != elems.end(); ++it)
|
for (ElementUpdateList::iterator it = elems.begin(); it != elems.end(); ++it)
|
||||||
{
|
{
|
||||||
(*it)->doInteraction(this, elementEffectMult, 16);
|
(*it)->doInteraction(this, elementEffectMult, 16);
|
||||||
|
|
|
@ -4829,7 +4829,12 @@ void DSQ::modifyDt(float &dt)
|
||||||
if (isDeveloperKeys())
|
if (isDeveloperKeys())
|
||||||
{
|
{
|
||||||
if (core->getKeyState(KEY_G))
|
if (core->getKeyState(KEY_G))
|
||||||
|
{
|
||||||
|
if(core->getShiftState())
|
||||||
|
dt *= 10;
|
||||||
|
else
|
||||||
dt *= 4;
|
dt *= 4;
|
||||||
|
}
|
||||||
else if (core->getKeyState(KEY_F))
|
else if (core->getKeyState(KEY_F))
|
||||||
{
|
{
|
||||||
if (core->getShiftState())
|
if (core->getShiftState())
|
||||||
|
|
|
@ -84,12 +84,8 @@ void Element::doInteraction(Entity *ent, float mult, float touchWidth)
|
||||||
eff->hitPerc = hitPerc;
|
eff->hitPerc = hitPerc;
|
||||||
eff->touchVel = ent->vel;
|
eff->touchVel = ent->vel;
|
||||||
eff->effectMult = mult;
|
eff->effectMult = mult;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//eff->touchVel = Vector(0, 0);
|
|
||||||
//eff->hitPerc = 0;
|
|
||||||
eff->touching = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Element::updateEffects(float dt)
|
void Element::updateEffects(float dt)
|
||||||
|
@ -110,6 +106,7 @@ void Element::updateEffects(float dt)
|
||||||
|
|
||||||
if (eff->touching)
|
if (eff->touching)
|
||||||
{
|
{
|
||||||
|
eff->touching = false;
|
||||||
float ramp = eff->touchVel.getLength2D()/800.0f;
|
float ramp = eff->touchVel.getLength2D()/800.0f;
|
||||||
if (ramp < 0) ramp = 0;
|
if (ramp < 0) ramp = 0;
|
||||||
if (ramp > 1) ramp = 1;
|
if (ramp > 1) ramp = 1;
|
||||||
|
|
|
@ -5910,23 +5910,15 @@ void Game::rebuildElementUpdateList()
|
||||||
elementUpdateList.clear();
|
elementUpdateList.clear();
|
||||||
elementInteractionList.clear();
|
elementInteractionList.clear();
|
||||||
for (int i = 0; i < dsq->getNumElements(); i++)
|
for (int i = 0; i < dsq->getNumElements(); i++)
|
||||||
//for (int i = LR_ELEMENTS1; i <= LR_ELEMENTS8; i++)
|
|
||||||
{
|
{
|
||||||
//RenderObjectLayer *rl = dsq->getRenderObjectLayer(i);
|
|
||||||
Element *e = dsq->getElement(i);
|
Element *e = dsq->getElement(i);
|
||||||
if (e && e->layer >= LR_ELEMENTS1 && e->layer <= LR_ELEMENTS8)
|
const int eeidx = e->getElementEffectIndex();
|
||||||
{
|
if (eeidx != -1 && e->layer >= LR_ELEMENTS1 && e->layer <= LR_ELEMENTS8)
|
||||||
if (e->getElementEffectIndex() != -1)
|
|
||||||
{
|
|
||||||
elementUpdateList.push_back(e);
|
elementUpdateList.push_back(e);
|
||||||
}
|
ElementEffect ee = dsq->getElementEffectByIndex(eeidx);
|
||||||
ElementEffect ee = dsq->getElementEffectByIndex(e->getElementEffectIndex());
|
|
||||||
if(ee.type == EFX_WAVY)
|
if(ee.type == EFX_WAVY)
|
||||||
{
|
|
||||||
elementInteractionList.push_back(e);
|
elementInteractionList.push_back(e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::setElementLayerFlags()
|
void Game::setElementLayerFlags()
|
||||||
|
@ -6460,18 +6452,9 @@ void Game::applyState()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
worldMapRender = 0;
|
/*
|
||||||
dsq->continuity.worldMap.revealMap(sceneToLoad);
|
if (liFlag == 100)
|
||||||
|
*/
|
||||||
debugLog("Creating WorldMapRender");
|
|
||||||
if(dsq->mod.isActive() && dsq->mod.mapRevealMethod != REVEAL_UNSPECIFIED)
|
|
||||||
WorldMapRender::setRevealMethod(dsq->mod.mapRevealMethod);
|
|
||||||
else
|
|
||||||
WorldMapRender::setRevealMethod((WorldMapRevealMethod)dsq->user.video.worldMapRevealMethod);
|
|
||||||
|
|
||||||
worldMapRender = new WorldMapRender;
|
|
||||||
addRenderObject(worldMapRender, LR_WORLDMAP);
|
|
||||||
|
|
||||||
|
|
||||||
if (verbose) debugLog("Creating Avatar");
|
if (verbose) debugLog("Creating Avatar");
|
||||||
avatar = new Avatar();
|
avatar = new Avatar();
|
||||||
|
@ -6535,6 +6518,8 @@ void Game::applyState()
|
||||||
if (verbose) debugLog("...Done");
|
if (verbose) debugLog("...Done");
|
||||||
backupSceneColor = sceneColor;
|
backupSceneColor = sceneColor;
|
||||||
|
|
||||||
|
dsq->continuity.worldMap.revealMap(sceneName);
|
||||||
|
|
||||||
colorTest();
|
colorTest();
|
||||||
|
|
||||||
if (!warpAreaType.empty())
|
if (!warpAreaType.empty())
|
||||||
|
@ -6663,6 +6648,18 @@ void Game::applyState()
|
||||||
timerText->followCamera = 1;
|
timerText->followCamera = 1;
|
||||||
addRenderObject(timerText, LR_MINIMAP);
|
addRenderObject(timerText, LR_MINIMAP);
|
||||||
|
|
||||||
|
worldMapRender = 0;
|
||||||
|
|
||||||
|
if(dsq->mod.isActive() && dsq->mod.mapRevealMethod != REVEAL_UNSPECIFIED)
|
||||||
|
WorldMapRender::setRevealMethod(dsq->mod.mapRevealMethod);
|
||||||
|
else
|
||||||
|
WorldMapRender::setRevealMethod((WorldMapRevealMethod)dsq->user.video.worldMapRevealMethod);
|
||||||
|
|
||||||
|
worldMapRender = new WorldMapRender;
|
||||||
|
addRenderObject(worldMapRender, LR_WORLDMAP);
|
||||||
|
// to hide minimap
|
||||||
|
//miniMapRender->position += Vector(800,0);
|
||||||
|
|
||||||
sceneToLoad="";
|
sceneToLoad="";
|
||||||
|
|
||||||
if (!fromScene.empty())
|
if (!fromScene.empty())
|
||||||
|
@ -10819,6 +10816,7 @@ void Game::removeState()
|
||||||
core->particlesPaused = false;
|
core->particlesPaused = false;
|
||||||
|
|
||||||
elementUpdateList.clear();
|
elementUpdateList.clear();
|
||||||
|
elementInteractionList.clear();
|
||||||
|
|
||||||
dsq->setCursor(CURSOR_NORMAL);
|
dsq->setCursor(CURSOR_NORMAL);
|
||||||
dsq->darkLayer.toggle(0);
|
dsq->darkLayer.toggle(0);
|
||||||
|
|
|
@ -38,6 +38,7 @@ extern "C"
|
||||||
#include "AfterEffect.h"
|
#include "AfterEffect.h"
|
||||||
#include "PathFinding.h"
|
#include "PathFinding.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include "Gradient.h"
|
||||||
|
|
||||||
#include "../BBGE/MathFunctions.h"
|
#include "../BBGE/MathFunctions.h"
|
||||||
|
|
||||||
|
@ -891,6 +892,7 @@ MakeTypeCheckFunc(isNode, SCO_PATH);
|
||||||
MakeTypeCheckFunc(isObject, SCO_RENDEROBJECT);
|
MakeTypeCheckFunc(isObject, SCO_RENDEROBJECT);
|
||||||
MakeTypeCheckFunc(isEntity, SCO_ENTITY)
|
MakeTypeCheckFunc(isEntity, SCO_ENTITY)
|
||||||
MakeTypeCheckFunc(isScriptedEntity, SCO_SCRIPTED_ENTITY)
|
MakeTypeCheckFunc(isScriptedEntity, SCO_SCRIPTED_ENTITY)
|
||||||
|
MakeTypeCheckFunc(isBone, SCO_BONE)
|
||||||
MakeTypeCheckFunc(isShot, SCO_SHOT)
|
MakeTypeCheckFunc(isShot, SCO_SHOT)
|
||||||
MakeTypeCheckFunc(isWeb, SCO_WEB)
|
MakeTypeCheckFunc(isWeb, SCO_WEB)
|
||||||
MakeTypeCheckFunc(isIng, SCO_INGREDIENT)
|
MakeTypeCheckFunc(isIng, SCO_INGREDIENT)
|
||||||
|
@ -1180,6 +1182,7 @@ luaFunc(obj_addChild)
|
||||||
RenderObject *r = robj(L);
|
RenderObject *r = robj(L);
|
||||||
RenderObject *which = robj(L, 2);
|
RenderObject *which = robj(L, 2);
|
||||||
bool takeOwnership = getBool(L, 3);
|
bool takeOwnership = getBool(L, 3);
|
||||||
|
bool front = getBool(L, 4);
|
||||||
if (r && which)
|
if (r && which)
|
||||||
{
|
{
|
||||||
if (takeOwnership)
|
if (takeOwnership)
|
||||||
|
@ -1189,7 +1192,7 @@ luaFunc(obj_addChild)
|
||||||
dsq->getState(dsq->game->name)->removeRenderObjectFromList(which);
|
dsq->getState(dsq->game->name)->removeRenderObjectFromList(which);
|
||||||
which->setStateDataObject(NULL);
|
which->setStateDataObject(NULL);
|
||||||
core->removeRenderObject(which, Core::DO_NOT_DESTROY_RENDER_OBJECT);
|
core->removeRenderObject(which, Core::DO_NOT_DESTROY_RENDER_OBJECT);
|
||||||
r->addChild(which, PM_POINTER);
|
r->addChild(which, PM_POINTER, RBP_NONE, front ? CHILD_FRONT : CHILD_BACK);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
r->addChild(which, PM_STATIC);
|
r->addChild(which, PM_STATIC);
|
||||||
|
@ -5524,7 +5527,7 @@ luaFunc(entity_doElementInteraction)
|
||||||
if (!touchWidth)
|
if (!touchWidth)
|
||||||
touchWidth = 16;
|
touchWidth = 16;
|
||||||
|
|
||||||
ElementUpdateList& elems = dsq->game->elementUpdateList;
|
ElementUpdateList& elems = dsq->game->elementInteractionList;
|
||||||
for (ElementUpdateList::iterator it = elems.begin(); it != elems.end(); ++it)
|
for (ElementUpdateList::iterator it = elems.begin(); it != elems.end(); ++it)
|
||||||
{
|
{
|
||||||
(*it)->doInteraction(e, mult, touchWidth);
|
(*it)->doInteraction(e, mult, touchWidth);
|
||||||
|
@ -8974,6 +8977,19 @@ luaFunc(learnRecipe)
|
||||||
luaReturnNil();
|
luaReturnNil();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(setBGGradient)
|
||||||
|
{
|
||||||
|
if(!dsq->game->grad)
|
||||||
|
dsq->game->createGradient();
|
||||||
|
Vector c1(lua_tonumber(L, 1), lua_tonumber(L, 2), lua_tonumber(L, 3));
|
||||||
|
Vector c2(lua_tonumber(L, 4), lua_tonumber(L, 5), lua_tonumber(L, 6));
|
||||||
|
if(getBool(L, 7))
|
||||||
|
dsq->game->grad->makeHorizontal(c1, c2);
|
||||||
|
else
|
||||||
|
dsq->game->grad->makeVertical(c1, c2);
|
||||||
|
luaReturnNil();
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(createDebugText)
|
luaFunc(createDebugText)
|
||||||
{
|
{
|
||||||
DebugFont *txt = new DebugFont(lua_tointeger(L, 2), getString(L, 1));
|
DebugFont *txt = new DebugFont(lua_tointeger(L, 2), getString(L, 1));
|
||||||
|
@ -10080,6 +10096,7 @@ static const struct {
|
||||||
luaRegister(getScreenVirtualSize),
|
luaRegister(getScreenVirtualSize),
|
||||||
luaRegister(isMiniMapCursorOkay),
|
luaRegister(isMiniMapCursorOkay),
|
||||||
luaRegister(isShuttingDownGameState),
|
luaRegister(isShuttingDownGameState),
|
||||||
|
luaRegister(setBGGradient),
|
||||||
|
|
||||||
luaRegister(inv_isFull),
|
luaRegister(inv_isFull),
|
||||||
luaRegister(inv_getMaxAmount),
|
luaRegister(inv_getMaxAmount),
|
||||||
|
@ -10121,6 +10138,7 @@ static const struct {
|
||||||
luaRegister(isObject),
|
luaRegister(isObject),
|
||||||
luaRegister(isEntity),
|
luaRegister(isEntity),
|
||||||
luaRegister(isScriptedEntity),
|
luaRegister(isScriptedEntity),
|
||||||
|
luaRegister(isBone),
|
||||||
luaRegister(isShot),
|
luaRegister(isShot),
|
||||||
luaRegister(isWeb),
|
luaRegister(isWeb),
|
||||||
luaRegister(isIng),
|
luaRegister(isIng),
|
||||||
|
|
|
@ -547,13 +547,13 @@ tinyxml2::XMLError readXML(const std::string& fn, tinyxml2::XMLDocument& doc)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
tinyxml2::XMLDocument *readXML(const std::string& fn, tinyxml2::XMLError *perr /* = 0 */)
|
tinyxml2::XMLDocument *readXML(const std::string& fn, tinyxml2::XMLError *perr /* = 0 */, bool keepEmpty /* = false */)
|
||||||
{
|
{
|
||||||
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();
|
tinyxml2::XMLDocument *doc = new tinyxml2::XMLDocument();
|
||||||
tinyxml2::XMLError err = readXML(fn, *doc);
|
tinyxml2::XMLError err = readXML(fn, *doc);
|
||||||
if(perr)
|
if(perr)
|
||||||
*perr = err;
|
*perr = err;
|
||||||
if(err != tinyxml2::XML_SUCCESS)
|
if(err != tinyxml2::XML_SUCCESS && !keepEmpty)
|
||||||
{
|
{
|
||||||
delete doc;
|
delete doc;
|
||||||
doc = NULL;
|
doc = NULL;
|
||||||
|
|
|
@ -206,7 +206,7 @@ bool exists(const std::string &f, bool makeFatal = false, bool skipVFS = false);
|
||||||
void errorLog(const std::string &s);
|
void errorLog(const std::string &s);
|
||||||
void debugLog(const std::string &s);
|
void debugLog(const std::string &s);
|
||||||
char *readFile(const std::string& path, unsigned long *size_ret = 0);
|
char *readFile(const std::string& path, unsigned long *size_ret = 0);
|
||||||
tinyxml2::XMLDocument *readXML(const std::string& fn, tinyxml2::XMLError *perr = 0);
|
tinyxml2::XMLDocument *readXML(const std::string& fn, tinyxml2::XMLError *perr = 0, bool keepEmpty = false);
|
||||||
tinyxml2::XMLError readXML(const std::string& fn, tinyxml2::XMLDocument& doc);
|
tinyxml2::XMLError readXML(const std::string& fn, tinyxml2::XMLDocument& doc);
|
||||||
char *readCompressedFile(std::string path, unsigned long *size_ret = 0);
|
char *readCompressedFile(std::string path, unsigned long *size_ret = 0);
|
||||||
void forEachFile(std::string path, std::string type, void callback(const std::string &filename, intptr_t param), intptr_t param);
|
void forEachFile(std::string path, std::string type, void callback(const std::string &filename, intptr_t param), intptr_t param);
|
||||||
|
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "MathFunctions.h"
|
#include "MathFunctions.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
bool RenderObject::renderCollisionShape = false;
|
bool RenderObject::renderCollisionShape = false;
|
||||||
int RenderObject::lastTextureApplied = 0;
|
int RenderObject::lastTextureApplied = 0;
|
||||||
|
@ -467,13 +468,29 @@ void RenderObject::toggleCull(bool value)
|
||||||
|
|
||||||
void RenderObject::moveToFront()
|
void RenderObject::moveToFront()
|
||||||
{
|
{
|
||||||
if (layer != -1)
|
if(RenderObject *p = parent)
|
||||||
|
{
|
||||||
|
if(p->children.size() && p->children[0] != this)
|
||||||
|
{
|
||||||
|
p->removeChild(this);
|
||||||
|
p->addChild(this, (ParentManaged)this->pm, RBP_NONE, CHILD_FRONT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (layer != -1)
|
||||||
core->renderObjectLayers[this->layer].moveToFront(this);
|
core->renderObjectLayers[this->layer].moveToFront(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderObject::moveToBack()
|
void RenderObject::moveToBack()
|
||||||
{
|
{
|
||||||
if (layer != -1)
|
if(RenderObject *p = parent)
|
||||||
|
{
|
||||||
|
if(p->children.size() && p->children[p->children.size()-1] != this)
|
||||||
|
{
|
||||||
|
p->removeChild(this);
|
||||||
|
p->addChild(this, (ParentManaged)this->pm, RBP_NONE, CHILD_BACK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (layer != -1)
|
||||||
core->renderObjectLayers[this->layer].moveToBack(this);
|
core->renderObjectLayers[this->layer].moveToBack(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,13 +34,13 @@ std::string SkeletalSprite::secondaryAnimationPath = "";
|
||||||
|
|
||||||
static std::map<std::string, XMLDocument*> skelCache;
|
static std::map<std::string, XMLDocument*> skelCache;
|
||||||
|
|
||||||
static XMLDocument *_retrieveSkeletalXML(const std::string& name)
|
static XMLDocument *_retrieveSkeletalXML(const std::string& name, bool keepEmpty)
|
||||||
{
|
{
|
||||||
std::map<std::string, XMLDocument*>::iterator it = skelCache.find(name);
|
std::map<std::string, XMLDocument*>::iterator it = skelCache.find(name);
|
||||||
if(it != skelCache.end())
|
if(it != skelCache.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
XMLDocument *doc = readXML(name);
|
XMLDocument *doc = readXML(name, NULL, keepEmpty);
|
||||||
if(doc)
|
if(doc)
|
||||||
skelCache[name] = doc;
|
skelCache[name] = doc;
|
||||||
|
|
||||||
|
@ -49,6 +49,8 @@ static XMLDocument *_retrieveSkeletalXML(const std::string& name)
|
||||||
|
|
||||||
void SkeletalSprite::clearCache()
|
void SkeletalSprite::clearCache()
|
||||||
{
|
{
|
||||||
|
for(std::map<std::string, XMLDocument*>::iterator it = skelCache.begin(); it != skelCache.end(); ++it)
|
||||||
|
delete it->second;
|
||||||
skelCache.clear();
|
skelCache.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +871,7 @@ bool SkeletalSprite::saveSkeletal(const std::string &fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
XMLDocument *xml = _retrieveSkeletalXML(file);
|
XMLDocument *xml = _retrieveSkeletalXML(file, true);
|
||||||
xml->Clear();
|
xml->Clear();
|
||||||
|
|
||||||
XMLElement *animationLayers = xml->NewElement("AnimationLayers");
|
XMLElement *animationLayers = xml->NewElement("AnimationLayers");
|
||||||
|
@ -1179,10 +1181,15 @@ void SkeletalSprite::loadSkin(const std::string &fn)
|
||||||
|
|
||||||
if (!exists(file))
|
if (!exists(file))
|
||||||
{
|
{
|
||||||
errorLog("Could not load skin[" + file + "]");
|
errorLog("Could not load skin[" + file + "] - File not found.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
XMLDocument *d = _retrieveSkeletalXML(file, false);
|
||||||
|
if(!d)
|
||||||
|
{
|
||||||
|
errorLog("Could not load skin[" + file + "] - Malformed XML.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
XMLDocument *d = _retrieveSkeletalXML(file);
|
|
||||||
|
|
||||||
XMLElement *bonesXml = d->FirstChildElement("Bones");
|
XMLElement *bonesXml = d->FirstChildElement("Bones");
|
||||||
if (bonesXml)
|
if (bonesXml)
|
||||||
|
@ -1315,7 +1322,7 @@ void SkeletalSprite::loadSkeletal(const std::string &fn)
|
||||||
|
|
||||||
file = core->adjustFilenameCase(file);
|
file = core->adjustFilenameCase(file);
|
||||||
|
|
||||||
XMLDocument *xml = _retrieveSkeletalXML(file);
|
XMLDocument *xml = _retrieveSkeletalXML(file, false);
|
||||||
if(!xml)
|
if(!xml)
|
||||||
{
|
{
|
||||||
filenameLoaded = "";
|
filenameLoaded = "";
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -144,13 +144,13 @@ function update(me, dt)
|
||||||
end
|
end
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
if entity_isState(me, STATE_TRAP) and v.trappedEnt ~= 0 then
|
if v.trappedEnt ~= 0 then
|
||||||
entity_setPosition(v.trappedEnt, v.hx, v.hy, 0.1)
|
|
||||||
if entity_isDead(v.trappedEnt) then
|
if entity_isDead(v.trappedEnt) then
|
||||||
v.trappedEnt = 0
|
v.trappedEnt = 0
|
||||||
entity_setState(me, STATE_IDLE)
|
entity_setState(me, STATE_IDLE)
|
||||||
end
|
elseif entity_isState(me, STATE_TRAP) then
|
||||||
elseif entity_isState(me, STATE_TRAPPED) and v.trappedEnt ~= 0 then
|
entity_setPosition(v.trappedEnt, v.hx, v.hy, 0.1)
|
||||||
|
elseif entity_isState(me, STATE_TRAPPED) then
|
||||||
entity_setPosition(v.trappedEnt, v.hx, v.hy)
|
entity_setPosition(v.trappedEnt, v.hx, v.hy)
|
||||||
v.hurtTimer = v.hurtTimer + dt
|
v.hurtTimer = v.hurtTimer + dt
|
||||||
if v.hurtTimer > 1 then
|
if v.hurtTimer > 1 then
|
||||||
|
@ -166,6 +166,7 @@ function update(me, dt)
|
||||||
v.hurtTimer = 0
|
v.hurtTimer = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function enterState(me)
|
function enterState(me)
|
||||||
|
|
|
@ -119,6 +119,9 @@ function enterState(me)
|
||||||
quad_alpha(v.glow, 0, 3)
|
quad_alpha(v.glow, 0, 3)
|
||||||
bone_alpha(v.eyes, 0, 3)
|
bone_alpha(v.eyes, 0, 3)
|
||||||
entity_animate(me, "runAway", -1)
|
entity_animate(me, "runAway", -1)
|
||||||
|
elseif entity_isState(me, STATE_DEAD) then
|
||||||
|
quad_delete(v.glow)
|
||||||
|
v.glow = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue