mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-16 10:04:28 +02:00
save state for key in hole
This commit is contained in:
20
src/lara.h
20
src/lara.h
@@ -574,7 +574,9 @@ struct Lara : Character {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool canSaveGame() {
|
bool canSaveGame() {
|
||||||
return health > 0.0f && !burn;// && (state == STATE_STOP || state == STATE_TREAD || state == STATE_SURF_TREAD);
|
return health > 0.0f && !burn
|
||||||
|
&& state != STATE_USE_KEY
|
||||||
|
&& state != STATE_USE_PUZZLE; // && (state == STATE_STOP || state == STATE_TREAD || state == STATE_SURF_TREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
TR::Entity::Type getItemHands() {
|
TR::Entity::Type getItemHands() {
|
||||||
@@ -1931,8 +1933,13 @@ struct Lara : Character {
|
|||||||
|
|
||||||
keyHole = controller;
|
keyHole = controller;
|
||||||
|
|
||||||
if (game->invUse(camera->cameraIndex, usedKey))
|
if (game->invUse(camera->cameraIndex, usedKey)) {
|
||||||
keyItem = game->addEntity(usedKey, getRoomIndex(), pos, 0);
|
keyItem = game->addEntity(usedKey, getRoomIndex(), pos, 0);
|
||||||
|
keyItem->lockMatrix = true;
|
||||||
|
keyItem->pos = keyHole->pos + vec3(-484, -590, 0);
|
||||||
|
keyItem->angle.x = PI * 0.5f;
|
||||||
|
keyItem->angle.y = keyHole->angle.y;
|
||||||
|
}
|
||||||
|
|
||||||
animation.setState(actionState);
|
animation.setState(actionState);
|
||||||
}
|
}
|
||||||
@@ -2831,12 +2838,9 @@ struct Lara : Character {
|
|||||||
if (animation.isFrameActive(state == STATE_USE_PUZZLE ? PUZZLE_FRAME : KEY_FRAME)) {
|
if (animation.isFrameActive(state == STATE_USE_PUZZLE ? PUZZLE_FRAME : KEY_FRAME)) {
|
||||||
keyHole->activate();
|
keyHole->activate();
|
||||||
if (keyItem) {
|
if (keyItem) {
|
||||||
if (state == STATE_USE_KEY) {
|
if (state == STATE_USE_KEY)
|
||||||
mat4 &m = keyItem->matrix;
|
keyItem->lockMatrix = false;
|
||||||
m = keyHole->getMatrix();
|
else
|
||||||
m.translate(vec3(0, -590, 484));
|
|
||||||
m.rotateX(PI * 0.5f);
|
|
||||||
} else
|
|
||||||
game->removeEntity(keyItem);
|
game->removeEntity(keyItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -968,6 +968,10 @@ struct Level : IGame {
|
|||||||
case TR::Entity::GEARS_1 :
|
case TR::Entity::GEARS_1 :
|
||||||
case TR::Entity::GEARS_2 :
|
case TR::Entity::GEARS_2 :
|
||||||
case TR::Entity::GEARS_3 : return new Gear(this, index);
|
case TR::Entity::GEARS_3 : return new Gear(this, index);
|
||||||
|
case TR::Entity::INV_KEY_1 :
|
||||||
|
case TR::Entity::INV_KEY_2 :
|
||||||
|
case TR::Entity::INV_KEY_3 :
|
||||||
|
case TR::Entity::INV_KEY_4 : return new KeyItemInv(this, index);
|
||||||
case TR::Entity::TRAP_FLOOR : return new TrapFloor(this, index);
|
case TR::Entity::TRAP_FLOOR : return new TrapFloor(this, index);
|
||||||
case TR::Entity::CRYSTAL : return new Crystal(this, index);
|
case TR::Entity::CRYSTAL : return new Crystal(this, index);
|
||||||
case TR::Entity::TRAP_SWING_BLADE : return new TrapSwingBlade(this, index);
|
case TR::Entity::TRAP_SWING_BLADE : return new TrapSwingBlade(this, index);
|
||||||
|
@@ -63,6 +63,12 @@ struct Gear : Controller {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct KeyItemInv : Controller {
|
||||||
|
KeyItemInv(IGame *game, int entity) : Controller(game, entity) {
|
||||||
|
angle.x = PI * 0.5f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
#define DART_DAMAGE 50
|
#define DART_DAMAGE 50
|
||||||
|
|
||||||
struct Dart : Controller {
|
struct Dart : Controller {
|
||||||
|
Reference in New Issue
Block a user