mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-06 05:07:48 +02:00
fix braid, fix wade state
This commit is contained in:
@@ -127,29 +127,6 @@ struct Character : Controller {
|
|||||||
health = max(0.0f, health - damage);
|
health = max(0.0f, health - damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void checkRoom() {
|
|
||||||
TR::Level::FloorInfo info;
|
|
||||||
getFloorInfo(getRoomIndex(), pos, info);
|
|
||||||
|
|
||||||
if (info.roomNext != TR::NO_ROOM)
|
|
||||||
roomIndex = info.roomNext;
|
|
||||||
|
|
||||||
if (info.roomBelow != TR::NO_ROOM && pos.y > info.roomFloor)
|
|
||||||
roomIndex = info.roomBelow;
|
|
||||||
|
|
||||||
if (info.roomAbove != TR::NO_ROOM && pos.y <= info.roomCeiling) {
|
|
||||||
TR::Room *room = &level->rooms[info.roomAbove];
|
|
||||||
|
|
||||||
if (stand == STAND_UNDERWATER && !room->flags.water) {
|
|
||||||
stand = STAND_ONWATER;
|
|
||||||
velocity.y = 0;
|
|
||||||
pos.y = info.roomCeiling;
|
|
||||||
} else
|
|
||||||
if (stand != STAND_ONWATER)
|
|
||||||
roomIndex = info.roomAbove;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void updateVelocity() {}
|
virtual void updateVelocity() {}
|
||||||
virtual void updatePosition() {}
|
virtual void updatePosition() {}
|
||||||
virtual Stand getStand() { return stand; }
|
virtual Stand getStand() { return stand; }
|
||||||
@@ -220,11 +197,6 @@ struct Character : Controller {
|
|||||||
return (input & key) && !(lastInput & key);
|
return (input & key) && !(lastInput & key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateRoom() {
|
|
||||||
level->getSector(roomIndex, pos);
|
|
||||||
level->getWaterInfo(getRoomIndex(), pos, waterLevel, waterDepth);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void update() {
|
virtual void update() {
|
||||||
updateRoom();
|
updateRoom();
|
||||||
|
|
||||||
|
@@ -1008,15 +1008,18 @@ struct Controller {
|
|||||||
return fabsf(d.x) < range && fabsf(d.z) < range && fabsf(d.y) < range;
|
return fabsf(d.x) < range && fabsf(d.z) < range && fabsf(d.y) < range;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void hit(float damage, Controller *enemy = NULL, TR::HitType hitType = TR::HIT_DEFAULT) {}
|
void updateRoom() {
|
||||||
|
level->getSector(roomIndex, pos);
|
||||||
|
level->getWaterInfo(getRoomIndex(), pos, waterLevel, waterDepth);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void hit(float damage, Controller *enemy = NULL, TR::HitType hitType = TR::HIT_DEFAULT) {}
|
||||||
virtual void doCustomCommand (int curFrame, int prevFrame) {}
|
virtual void doCustomCommand (int curFrame, int prevFrame) {}
|
||||||
virtual void checkRoom() {}
|
|
||||||
virtual void applyFlow(TR::Camera &sink) {}
|
virtual void applyFlow(TR::Camera &sink) {}
|
||||||
|
|
||||||
virtual void cmdOffset(const vec3 &offset) {
|
virtual void cmdOffset(const vec3 &offset) {
|
||||||
pos = pos + offset.rotateY(-angle.y);
|
pos = pos + offset.rotateY(-angle.y);
|
||||||
checkRoom();
|
updateRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void cmdJump(const vec3 &vel) {}
|
virtual void cmdJump(const vec3 &vel) {}
|
||||||
|
@@ -210,7 +210,7 @@ struct Enemy : Character {
|
|||||||
} else
|
} else
|
||||||
pos = p;
|
pos = p;
|
||||||
|
|
||||||
checkRoom();
|
updateRoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setOverrides(bool active, int chest, int head) {
|
void setOverrides(bool active, int chest, int head) {
|
||||||
@@ -2444,7 +2444,7 @@ struct Doppelganger : Enemy {
|
|||||||
angle.y -= PI;
|
angle.y -= PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
Enemy::checkRoom();
|
Enemy::updateRoom();
|
||||||
|
|
||||||
TR::Level::FloorInfo info;
|
TR::Level::FloorInfo info;
|
||||||
getFloorInfo(getRoomIndex(), pos, info);
|
getFloorInfo(getRoomIndex(), pos, info);
|
||||||
|
118
src/lara.h
118
src/lara.h
@@ -138,6 +138,7 @@ struct Lara : Character {
|
|||||||
ANIM_WADE_RUN_RIGHT = 179,
|
ANIM_WADE_RUN_RIGHT = 179,
|
||||||
ANIM_WADE_STAND = 186,
|
ANIM_WADE_STAND = 186,
|
||||||
ANIM_WADE_ASCEND = 190,
|
ANIM_WADE_ASCEND = 190,
|
||||||
|
ANIM_WATER_OUT = 191,
|
||||||
ANIM_SWIM_STAND = 192,
|
ANIM_SWIM_STAND = 192,
|
||||||
ANIM_SURF_STAND = 193,
|
ANIM_SURF_STAND = 193,
|
||||||
|
|
||||||
@@ -391,7 +392,7 @@ struct Lara : Character {
|
|||||||
delta = delta.normal() * (min(delta.length(), 2048.0f * Core::deltaTime) * DAMPING); // speed limit
|
delta = delta.normal() * (min(delta.length(), 2048.0f * Core::deltaTime) * DAMPING); // speed limit
|
||||||
j.posPrev = j.pos;
|
j.posPrev = j.pos;
|
||||||
j.pos += delta;
|
j.pos += delta;
|
||||||
if ((lara->stand == STAND_WADE || lara->state == STAND_ONWATER || lara->state == STAND_UNDERWATER) && (j.pos.y > lara->waterLevel))
|
if ((lara->stand == STAND_WADE || lara->stand == STAND_ONWATER || lara->stand == STAND_UNDERWATER) && (j.pos.y > lara->waterLevel))
|
||||||
j.pos.y -= ACCEL;
|
j.pos.y -= ACCEL;
|
||||||
else
|
else
|
||||||
j.pos.y += ACCEL;
|
j.pos.y += ACCEL;
|
||||||
@@ -598,6 +599,7 @@ struct Lara : Character {
|
|||||||
//reset(10, vec3(90443, 11264 - 256, 114614), PI, STAND_ONWATER); // villa mortal 2
|
//reset(10, vec3(90443, 11264 - 256, 114614), PI, STAND_ONWATER); // villa mortal 2
|
||||||
// TR2
|
// TR2
|
||||||
//reset(36, vec3(64190, 5632, 35743), 75 * DEG2RAD); // WALL (wade)
|
//reset(36, vec3(64190, 5632, 35743), 75 * DEG2RAD); // WALL (wade)
|
||||||
|
//reset(19, vec3(28353, 2560, 58587), 150 * DEG2RAD); // ASSAULT (wade)
|
||||||
|
|
||||||
//dbgBoxes = NULL;
|
//dbgBoxes = NULL;
|
||||||
|
|
||||||
@@ -1731,6 +1733,10 @@ struct Lara : Character {
|
|||||||
int h = int(pos.y - info.floor);
|
int h = int(pos.y - info.floor);
|
||||||
|
|
||||||
if (h >= 0 && h <= (256 + 128) && (state == STATE_SURF_TREAD || animation.setState(STATE_SURF_TREAD)) && animation.setState(STATE_STOP)) {
|
if (h >= 0 && h <= (256 + 128) && (state == STATE_SURF_TREAD || animation.setState(STATE_SURF_TREAD)) && animation.setState(STATE_STOP)) {
|
||||||
|
if ((level->version & TR::VER_VERSION) > TR::VER_TR1) {
|
||||||
|
if (h < 128) // 0 clicks out of water animation
|
||||||
|
animation.setAnim(ANIM_WATER_OUT);
|
||||||
|
}
|
||||||
alignToWall(LARA_RADIUS);
|
alignToWall(LARA_RADIUS);
|
||||||
roomIndex = roomAbove;
|
roomIndex = roomAbove;
|
||||||
pos.y = info.floor;
|
pos.y = info.floor;
|
||||||
@@ -2173,11 +2179,15 @@ struct Lara : Character {
|
|||||||
void waterSplash() {
|
void waterSplash() {
|
||||||
if (level->extra.waterSplash > -1)
|
if (level->extra.waterSplash > -1)
|
||||||
game->addEntity(TR::Entity::WATER_SPLASH, getRoomIndex(), vec3(pos.x, waterLevel, pos.z));
|
game->addEntity(TR::Entity::WATER_SPLASH, getRoomIndex(), vec3(pos.x, waterLevel, pos.z));
|
||||||
|
specular = LARA_WET_SPECULAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Stand getStand() {
|
virtual Stand getStand() {
|
||||||
if (dozy) return STAND_UNDERWATER;
|
if (dozy) return STAND_UNDERWATER;
|
||||||
|
|
||||||
|
if (stand == STAND_ONWATER && state == STATE_STOP)
|
||||||
|
return STAND_GROUND;
|
||||||
|
|
||||||
if (state == STATE_HANG || state == STATE_HANG_LEFT || state == STATE_HANG_RIGHT) {
|
if (state == STATE_HANG || state == STATE_HANG_LEFT || state == STATE_HANG_RIGHT) {
|
||||||
if (input & ACTION)
|
if (input & ACTION)
|
||||||
return STAND_HANG;
|
return STAND_HANG;
|
||||||
@@ -2192,14 +2202,18 @@ struct Lara : Character {
|
|||||||
|
|
||||||
if (getRoom().flags.water) {
|
if (getRoom().flags.water) {
|
||||||
if (waterDepth > LARA_WADE_MAX_DEPTH || (waterLevel == 0.0f && waterDepth == 0.0f)) {
|
if (waterDepth > LARA_WADE_MAX_DEPTH || (waterLevel == 0.0f && waterDepth == 0.0f)) {
|
||||||
|
if (stand == STAND_GROUND)
|
||||||
|
return STAND_AIR;
|
||||||
wpnHide();
|
wpnHide();
|
||||||
if (stand == STAND_UNDERWATER || stand == STAND_ONWATER)
|
if (stand == STAND_UNDERWATER || stand == STAND_ONWATER)
|
||||||
return stand;
|
return stand;
|
||||||
if (stand == STAND_AIR) {
|
if (stand == STAND_AIR) {
|
||||||
//if (stand != STAND_UNDERWATER && stand != STAND_ONWATER && (state != STATE_FALL && state != STATE_REACH && state != STATE_SWAN_DIVE && state != STATE_FAST_DIVE))
|
if (velocity.y > 0.0f && pos.y - waterLevel > 300.0) {
|
||||||
// animation.setAnim(ANIM_FALL_FORTH);
|
|
||||||
stopScreaming();
|
stopScreaming();
|
||||||
return STAND_UNDERWATER;
|
return STAND_UNDERWATER;
|
||||||
|
}
|
||||||
|
} else if (stand == STAND_GROUND) {
|
||||||
|
return STAND_UNDERWATER;
|
||||||
} else {
|
} else {
|
||||||
pos.y = waterLevel;
|
pos.y = waterLevel;
|
||||||
updateRoom();
|
updateRoom();
|
||||||
@@ -2212,7 +2226,11 @@ struct Lara : Character {
|
|||||||
return STAND_ONWATER;
|
return STAND_ONWATER;
|
||||||
}
|
}
|
||||||
} else if (waterDepth > LARA_WADE_DEPTH) {
|
} else if (waterDepth > LARA_WADE_DEPTH) {
|
||||||
if (stand == STAND_AIR && velocity.y > 0.0f && pos.y - waterLevel > 400.0f) {
|
if (stand == STAND_GROUND && (waterLevel + waterDepth) - pos.y > 300)
|
||||||
|
return STAND_AIR;
|
||||||
|
|
||||||
|
if (stand == STAND_AIR) {
|
||||||
|
if (velocity.y > 0.0f && pos.y - waterLevel > 300.0) {
|
||||||
waterSplash();
|
waterSplash();
|
||||||
pos.y = waterLevel + waterDepth;
|
pos.y = waterLevel + waterDepth;
|
||||||
game->playSound(TR::SND_WATER_SPLASH, pos, Sound::PAN);
|
game->playSound(TR::SND_WATER_SPLASH, pos, Sound::PAN);
|
||||||
@@ -2220,6 +2238,7 @@ struct Lara : Character {
|
|||||||
animation.setAnim(ANIM_SWIM_STAND);
|
animation.setAnim(ANIM_SWIM_STAND);
|
||||||
stopScreaming();
|
stopScreaming();
|
||||||
return STAND_WADE;
|
return STAND_WADE;
|
||||||
|
}
|
||||||
} else if (stand == STAND_UNDERWATER) {
|
} else if (stand == STAND_UNDERWATER) {
|
||||||
if (waterDepth <= LARA_SWIM_MIN_DEPTH) {
|
if (waterDepth <= LARA_SWIM_MIN_DEPTH) {
|
||||||
pos.y = waterLevel + waterDepth;
|
pos.y = waterLevel + waterDepth;
|
||||||
@@ -2233,18 +2252,28 @@ struct Lara : Character {
|
|||||||
pos.y = waterLevel + waterDepth;
|
pos.y = waterLevel + waterDepth;
|
||||||
updateRoom();
|
updateRoom();
|
||||||
return STAND_WADE;
|
return STAND_WADE;
|
||||||
|
} else
|
||||||
|
return STAND_WADE;
|
||||||
}
|
}
|
||||||
return stand;
|
} else {
|
||||||
|
if (stand == STAND_UNDERWATER && !(waterLevel == 0.0f && waterDepth == 0.0f)) {
|
||||||
|
pos.y = waterLevel;
|
||||||
|
updateRoom();
|
||||||
|
return STAND_ONWATER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stand == STAND_ONWATER && state != STATE_STOP) {
|
if (stand == STAND_ONWATER && state != STATE_STOP) {
|
||||||
if (!getRoom().flags.water && state != STATE_WATER_OUT)
|
if (!getRoom().flags.water && state != STATE_WATER_OUT && state != STATE_STOP)
|
||||||
return STAND_AIR;
|
return STAND_AIR;
|
||||||
if (state != STATE_DIVE)
|
if (state != STATE_DIVE)
|
||||||
return stand;
|
return stand;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stand == STAND_UNDERWATER || stand == STAND_ONWATER) {
|
||||||
|
return stand;
|
||||||
|
}
|
||||||
|
|
||||||
TR::Level::FloorInfo info;
|
TR::Level::FloorInfo info;
|
||||||
getFloorInfo(getRoomIndex(), pos, info);
|
getFloorInfo(getRoomIndex(), pos, info);
|
||||||
|
|
||||||
@@ -2281,8 +2310,6 @@ struct Lara : Character {
|
|||||||
animation.setAnim(ANIM_LANDING);
|
animation.setAnim(ANIM_LANDING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stand == STAND_UNDERWATER || stand == STAND_ONWATER)
|
|
||||||
animation.setAnim(ANIM_STAND);
|
|
||||||
return STAND_GROUND;
|
return STAND_GROUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2418,16 +2445,7 @@ struct Lara : Character {
|
|||||||
return STATE_STOP;
|
return STATE_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getStateGround() {
|
bool checkClimb() {
|
||||||
int res = STATE_STOP;
|
|
||||||
angle.x = 0.0f;
|
|
||||||
|
|
||||||
if (waterDepth > 0.0f && !(animation.frameIndex % 4))
|
|
||||||
game->waterDrop(getJoint(jointChest).pos + vec3(randf(), 0.0f, randf()) * 64.0f, 96.0f, 0.02f);
|
|
||||||
|
|
||||||
if ((input == ACTION) && (state == STATE_STOP) && emptyHands() && doPickUp())
|
|
||||||
return state;
|
|
||||||
|
|
||||||
if ((input & (FORTH | ACTION)) == (FORTH | ACTION) && (animation.index == ANIM_STAND || animation.index == ANIM_STAND_NORMAL) && emptyHands() && collision.side == Collision::FRONT) { // TODO: get rid of animation.index
|
if ((input & (FORTH | ACTION)) == (FORTH | ACTION) && (animation.index == ANIM_STAND || animation.index == ANIM_STAND_NORMAL) && emptyHands() && collision.side == Collision::FRONT) { // TODO: get rid of animation.index
|
||||||
float floor = collision.info[Collision::FRONT].floor;
|
float floor = collision.info[Collision::FRONT].floor;
|
||||||
float ceiling = collision.info[Collision::FRONT].ceiling;
|
float ceiling = collision.info[Collision::FRONT].ceiling;
|
||||||
@@ -2448,9 +2466,25 @@ struct Lara : Character {
|
|||||||
|
|
||||||
if (aIndex != animation.index) {
|
if (aIndex != animation.index) {
|
||||||
alignToWall(-LARA_RADIUS);
|
alignToWall(-LARA_RADIUS);
|
||||||
return animation.setAnim(aIndex);
|
animation.setAnim(aIndex);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int getStateGround() {
|
||||||
|
int res = STATE_STOP;
|
||||||
|
angle.x = 0.0f;
|
||||||
|
|
||||||
|
if (waterDepth > 0.0f && !(animation.frameIndex % 4))
|
||||||
|
game->waterDrop(getJoint(jointChest).pos + vec3(randf(), 0.0f, randf()) * 64.0f, 96.0f, 0.02f);
|
||||||
|
|
||||||
|
if ((input == ACTION) && (state == STATE_STOP) && emptyHands() && doPickUp())
|
||||||
|
return state;
|
||||||
|
|
||||||
|
if (checkClimb())
|
||||||
|
return state;
|
||||||
|
|
||||||
if ( (input & (FORTH | BACK)) == (FORTH | BACK) && (animation.index == ANIM_STAND_NORMAL || state == STATE_RUN) )
|
if ( (input & (FORTH | BACK)) == (FORTH | BACK) && (animation.index == ANIM_STAND_NORMAL || state == STATE_RUN) )
|
||||||
return animation.setAnim(ANIM_STAND_ROLL_BEGIN);
|
return animation.setAnim(ANIM_STAND_ROLL_BEGIN);
|
||||||
@@ -2515,13 +2549,8 @@ struct Lara : Character {
|
|||||||
if (state == STATE_STEP_LEFT || state == STATE_STEP_RIGHT)
|
if (state == STATE_STEP_LEFT || state == STATE_STEP_RIGHT)
|
||||||
maxAscent = maxDescent = 64;
|
maxAscent = maxDescent = 64;
|
||||||
|
|
||||||
if (state == STATE_STOP && res != STATE_STOP) {
|
if (state == STATE_STOP && res != STATE_STOP)
|
||||||
vec3 p = pos;
|
res = checkMove(res, maxAscent, maxDescent);
|
||||||
collision = Collision(this, getRoomIndex(), p, vec3(0.0f), vec3(0.0f), LARA_RADIUS * 1.1f, ext, 0, LARA_HEIGHT, maxAscent, maxDescent);
|
|
||||||
if (collision.side == Collision::FRONT)
|
|
||||||
res = STATE_STOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2604,7 +2633,7 @@ struct Lara : Character {
|
|||||||
if ((input == ACTION) && (state == STATE_TREAD) && emptyHands() && doPickUp())
|
if ((input == ACTION) && (state == STATE_TREAD) && emptyHands() && doPickUp())
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
if (state == STATE_FORWARD_JUMP || state == STATE_UP_JUMP || state == STATE_BACK_JUMP || state == STATE_LEFT_JUMP || state == STATE_RIGHT_JUMP || state == STATE_FALL || state == STATE_REACH || state == STATE_SLIDE || state == STATE_SLIDE_BACK) {
|
if (state == STATE_RUN || state == STATE_BACK || state == STATE_FAST_BACK || state == STATE_FORWARD_JUMP || state == STATE_UP_JUMP || state == STATE_BACK_JUMP || state == STATE_LEFT_JUMP || state == STATE_RIGHT_JUMP || state == STATE_FALL || state == STATE_REACH || state == STATE_SLIDE || state == STATE_SLIDE_BACK) {
|
||||||
game->waterDrop(pos, 256.0f, 0.2f);
|
game->waterDrop(pos, 256.0f, 0.2f);
|
||||||
waterSplash();
|
waterSplash();
|
||||||
pos.y += 100.0f;
|
pos.y += 100.0f;
|
||||||
@@ -2688,6 +2717,15 @@ struct Lara : Character {
|
|||||||
return animation.frameIndex < rightStart || animation.frameIndex > (rightStart + animation.framesCount / 2);
|
return animation.frameIndex < rightStart || animation.frameIndex > (rightStart + animation.framesCount / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int checkMove(int newState, int maxAscent = 256 + 128, int maxDescent = 0xFFFFFF) {
|
||||||
|
float ext = angle.y + ((newState == STATE_BACK || newState == STATE_FAST_BACK) ? PI : 0.0f);
|
||||||
|
vec3 p = pos;
|
||||||
|
collision = Collision(this, getRoomIndex(), p, vec3(0.0f), vec3(0.0f), LARA_RADIUS * 1.1f, ext, 0, LARA_HEIGHT, maxAscent, maxDescent);
|
||||||
|
if (collision.side == Collision::FRONT)
|
||||||
|
return STATE_STOP;
|
||||||
|
return newState;
|
||||||
|
}
|
||||||
|
|
||||||
virtual int getStateWade() {
|
virtual int getStateWade() {
|
||||||
angle.x = 0.0f;
|
angle.x = 0.0f;
|
||||||
|
|
||||||
@@ -2697,10 +2735,16 @@ struct Lara : Character {
|
|||||||
if ((input & FORTH) && (input & BACK))
|
if ((input & FORTH) && (input & BACK))
|
||||||
input &= ~(FORTH | BACK);
|
input &= ~(FORTH | BACK);
|
||||||
|
|
||||||
|
if (checkClimb())
|
||||||
|
return state;
|
||||||
|
|
||||||
if (input & JUMP) {
|
if (input & JUMP) {
|
||||||
return STATE_COMPRESS;
|
return STATE_COMPRESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state == STATE_COMPRESS || state == STATE_UP_JUMP)
|
||||||
|
return state;
|
||||||
|
|
||||||
if (state != STATE_WADE) {
|
if (state != STATE_WADE) {
|
||||||
if (state == STATE_SWIM || state == STATE_GLIDE)
|
if (state == STATE_SWIM || state == STATE_GLIDE)
|
||||||
return animation.setAnim(ANIM_WADE_ASCEND);
|
return animation.setAnim(ANIM_WADE_ASCEND);
|
||||||
@@ -2717,14 +2761,18 @@ struct Lara : Character {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (input & FORTH) {
|
if (input & FORTH) {
|
||||||
|
if (checkMove(STATE_WADE) != STATE_WADE)
|
||||||
|
return STATE_STOP;
|
||||||
if (state == STATE_STOP)
|
if (state == STATE_STOP)
|
||||||
return animation.setAnim(ANIM_WADE_STAND);
|
return animation.setAnim(ANIM_WADE_STAND);
|
||||||
if (state != STATE_WADE)
|
if (state != STATE_WADE && state != STATE_WATER_OUT)
|
||||||
return animation.setAnim(ANIM_WADE);
|
return animation.setAnim(ANIM_WADE);
|
||||||
return STATE_WADE;
|
return STATE_WADE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input & BACK) {
|
if (input & BACK) {
|
||||||
|
if (checkMove(STATE_BACK) != STATE_BACK)
|
||||||
|
return STATE_STOP;
|
||||||
return STATE_BACK;
|
return STATE_BACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2748,13 +2796,8 @@ struct Lara : Character {
|
|||||||
if (state == STATE_STEP_LEFT || state == STATE_STEP_RIGHT)
|
if (state == STATE_STEP_LEFT || state == STATE_STEP_RIGHT)
|
||||||
maxAscent = maxDescent = 64;
|
maxAscent = maxDescent = 64;
|
||||||
|
|
||||||
if (state == STATE_STOP && res != STATE_STOP) {
|
if (state == STATE_STOP && res != STATE_STOP)
|
||||||
vec3 p = pos;
|
res = checkMove(res, maxAscent, maxDescent);
|
||||||
collision = Collision(this, getRoomIndex(), p, vec3(0.0f), vec3(0.0f), LARA_RADIUS * 1.1f, ext, 0, LARA_HEIGHT, maxAscent, maxDescent);
|
|
||||||
if (collision.side == Collision::FRONT)
|
|
||||||
res = STATE_STOP;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3437,7 +3480,7 @@ struct Lara : Character {
|
|||||||
if (state == STATE_STEP_LEFT || state == STATE_STEP_RIGHT)
|
if (state == STATE_STEP_LEFT || state == STATE_STEP_RIGHT)
|
||||||
maxAscent = maxDescent = 64;
|
maxAscent = maxDescent = 64;
|
||||||
if (stand == STAND_ONWATER) {
|
if (stand == STAND_ONWATER) {
|
||||||
maxAscent = -1;
|
maxAscent = -2;
|
||||||
maxHeight = 0;
|
maxHeight = 0;
|
||||||
offset.y = -1;
|
offset.y = -1;
|
||||||
}
|
}
|
||||||
@@ -3513,6 +3556,7 @@ struct Lara : Character {
|
|||||||
break;
|
break;
|
||||||
case STAND_GROUND :
|
case STAND_GROUND :
|
||||||
case STAND_HANG :
|
case STAND_HANG :
|
||||||
|
case STAND_WADE :
|
||||||
if (opos.y - floor > (256 * 3 - 128) && state == STATE_RUN)
|
if (opos.y - floor > (256 * 3 - 128) && state == STATE_RUN)
|
||||||
animation.setAnim(isLeftFoot ? ANIM_SMASH_RUN_LEFT : ANIM_SMASH_RUN_RIGHT);
|
animation.setAnim(isLeftFoot ? ANIM_SMASH_RUN_LEFT : ANIM_SMASH_RUN_RIGHT);
|
||||||
else if (stand == STAND_HANG)
|
else if (stand == STAND_HANG)
|
||||||
@@ -3553,7 +3597,7 @@ struct Lara : Character {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dozy) stand = STAND_GROUND;
|
if (dozy) stand = STAND_GROUND;
|
||||||
checkRoom();
|
updateRoom();
|
||||||
if (dozy) stand = STAND_UNDERWATER;
|
if (dozy) stand = STAND_UNDERWATER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user