mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-04 10:34:01 +00:00
Make avatar respect maxspeed lerp, allow changing speed multiplier via script. Some extra functions.
Add one additional not-timed speed multiplier that also ignores influence by currents. Lua functions added: - avatar_setSpeedMult(num, time) - avatar_setSpeedMult2(num) - avatar_getSpeedMult() - avatar_getSpeedMult2() - entity_isInCurrent(entity) - entity_getNumTargetPoints(entity)
This commit is contained in:
parent
25727244ad
commit
54d609a8b5
4 changed files with 46 additions and 7 deletions
|
@ -4911,13 +4911,9 @@ void Avatar::clampVelocity()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
setMaxSpeed(currentMaxSpeed * useSpeedMult);
|
setMaxSpeed(currentMaxSpeed * useSpeedMult * dsq->continuity.speedMult2);
|
||||||
//float cheatLen = vel.getSquaredLength2D();
|
|
||||||
vel.capLength2D(getMaxSpeed());
|
vel.capLength2D(getMaxSpeed() * maxSpeedLerp.x);
|
||||||
/*
|
|
||||||
if (cheatLen > sqr(getMaxSpeed()))
|
|
||||||
vel.setLength2D(getMaxSpeed());
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::activateAura(AuraType aura)
|
void Avatar::activateAura(AuraType aura)
|
||||||
|
|
|
@ -3209,6 +3209,7 @@ void Continuity::reset()
|
||||||
//worldMapTiles.clear();
|
//worldMapTiles.clear();
|
||||||
|
|
||||||
speedMult = biteMult = fishPoison = defenseMult = 1;
|
speedMult = biteMult = fishPoison = defenseMult = 1;
|
||||||
|
speedMult2 = 1;
|
||||||
poison = 0;
|
poison = 0;
|
||||||
energyMult = 0;
|
energyMult = 0;
|
||||||
light = petPower = 0;
|
light = petPower = 0;
|
||||||
|
|
|
@ -1102,6 +1102,8 @@ public:
|
||||||
Timer energyTimer, poisonTimer, poisonBitTimer;
|
Timer energyTimer, poisonTimer, poisonBitTimer;
|
||||||
Timer webTimer, webBitTimer, lightTimer, petPowerTimer;
|
Timer webTimer, webBitTimer, lightTimer, petPowerTimer;
|
||||||
|
|
||||||
|
float speedMult2;
|
||||||
|
|
||||||
void eatBeast(const EatData &eatData);
|
void eatBeast(const EatData &eatData);
|
||||||
void removeNaijaEat(int idx);
|
void removeNaijaEat(int idx);
|
||||||
void removeLastNaijaEat();
|
void removeLastNaijaEat();
|
||||||
|
|
|
@ -2898,6 +2898,28 @@ luaFunc(avatar_getSpellCharge)
|
||||||
luaReturnNum(dsq->game->avatar->state.spellCharge);
|
luaReturnNum(dsq->game->avatar->state.spellCharge);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(avatar_setSpeedMult)
|
||||||
|
{
|
||||||
|
dsq->continuity.setSpeedMultiplier(lua_tonumber(L, 1), lua_tonumber(L, 2));
|
||||||
|
luaReturnNil();
|
||||||
|
}
|
||||||
|
|
||||||
|
luaFunc(avatar_setSpeedMult2)
|
||||||
|
{
|
||||||
|
dsq->continuity.speedMult2 = lua_tonumber(L, 1);
|
||||||
|
luaReturnNil();
|
||||||
|
}
|
||||||
|
|
||||||
|
luaFunc(avatar_getSpeedMult)
|
||||||
|
{
|
||||||
|
luaReturnNum(dsq->continuity.speedMult);
|
||||||
|
}
|
||||||
|
|
||||||
|
luaFunc(avatar_getSpeedMult2)
|
||||||
|
{
|
||||||
|
luaReturnNum(dsq->continuity.speedMult2);
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(jumpState)
|
luaFunc(jumpState)
|
||||||
{
|
{
|
||||||
dsq->enqueueJumpState(getString(L, 1), getBool(L, 2));
|
dsq->enqueueJumpState(getString(L, 1), getBool(L, 2));
|
||||||
|
@ -3208,6 +3230,11 @@ luaFunc(entity_checkSplash)
|
||||||
luaReturnBool(ret);
|
luaReturnBool(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(entity_isInCurrent)
|
||||||
|
{
|
||||||
|
Entity *e = entity(L);
|
||||||
|
luaReturnBool(e ? e->isInCurrent() : false);
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(entity_isUnderWater)
|
luaFunc(entity_isUnderWater)
|
||||||
{
|
{
|
||||||
|
@ -5609,6 +5636,12 @@ luaFunc(entity_getRandomTargetPoint)
|
||||||
luaReturnNum(idx);
|
luaReturnNum(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luaFunc(entity_getNumTargetPoints)
|
||||||
|
{
|
||||||
|
Entity *e = entity(L);
|
||||||
|
luaReturnInt(e ? e->getNumTargetPoints() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
luaFunc(playVisualEffect)
|
luaFunc(playVisualEffect)
|
||||||
{
|
{
|
||||||
Entity *target = NULL;
|
Entity *target = NULL;
|
||||||
|
@ -8066,9 +8099,11 @@ static const struct {
|
||||||
|
|
||||||
luaRegister(entity_isUnderWater),
|
luaRegister(entity_isUnderWater),
|
||||||
luaRegister(entity_checkSplash),
|
luaRegister(entity_checkSplash),
|
||||||
|
luaRegister(entity_isInCurrent),
|
||||||
|
|
||||||
luaRegister(entity_getRandomTargetPoint),
|
luaRegister(entity_getRandomTargetPoint),
|
||||||
luaRegister(entity_getTargetPoint),
|
luaRegister(entity_getTargetPoint),
|
||||||
|
luaRegister(entity_getNumTargetPoints),
|
||||||
|
|
||||||
luaRegister(entity_setTargetRange),
|
luaRegister(entity_setTargetRange),
|
||||||
|
|
||||||
|
@ -8453,6 +8488,11 @@ static const struct {
|
||||||
luaRegister(avatar_setBlockSinging),
|
luaRegister(avatar_setBlockSinging),
|
||||||
luaRegister(avatar_isBlockSinging),
|
luaRegister(avatar_isBlockSinging),
|
||||||
|
|
||||||
|
luaRegister(avatar_setSpeedMult),
|
||||||
|
luaRegister(avatar_setSpeedMult2),
|
||||||
|
luaRegister(avatar_getSpeedMult),
|
||||||
|
luaRegister(avatar_getSpeedMult2),
|
||||||
|
|
||||||
|
|
||||||
luaRegister(avatar_toggleMovement),
|
luaRegister(avatar_toggleMovement),
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue