mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-04 18:57:59 +03:00
Fix merge and small things
This commit is contained in:
parent
e17a8a0d99
commit
1c20cefd4e
2 changed files with 4 additions and 124 deletions
|
@ -21,126 +21,6 @@ static short WreckingBallData[2] = {0, 0};
|
||||||
ITEM_INFO* WBItem;
|
ITEM_INFO* WBItem;
|
||||||
short WBRoom;
|
short WBRoom;
|
||||||
|
|
||||||
void InitialiseFallingBlock(short itemNumber)
|
|
||||||
{
|
|
||||||
g_Level.Items[itemNumber].meshBits = 1;
|
|
||||||
TEN::Floordata::AddBridge(itemNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FallingBlockCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|
||||||
{
|
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNum];
|
|
||||||
if (!item->itemFlags[0] && !item->triggerFlags && item->pos.yPos == l->pos.yPos)
|
|
||||||
{
|
|
||||||
if (!((item->pos.xPos ^ l->pos.xPos) & 0xFFFFFC00) && !((l->pos.zPos ^ item->pos.zPos) & 0xFFFFFC00))
|
|
||||||
{
|
|
||||||
SoundEffect(SFX_TR4_ROCK_FALL_CRUMBLE, &item->pos, 0);
|
|
||||||
AddActiveItem(itemNum);
|
|
||||||
|
|
||||||
item->itemFlags[0] = 0;
|
|
||||||
item->status = ITEM_ACTIVE;
|
|
||||||
item->flags |= 0x3E00;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FallingBlockControl(short itemNumber)
|
|
||||||
{
|
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
|
||||||
|
|
||||||
if (item->triggerFlags)
|
|
||||||
{
|
|
||||||
item->triggerFlags--;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (item->itemFlags[0])
|
|
||||||
{
|
|
||||||
if (item->itemFlags[0] < 60)
|
|
||||||
{
|
|
||||||
if (item->itemFlags[0] < 52)
|
|
||||||
{
|
|
||||||
if (!(GetRandomControl() % (62 - item->itemFlags[0])))
|
|
||||||
item->pos.yPos += (GetRandomControl() & 3) + 1;
|
|
||||||
item->itemFlags[0]++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
item->itemFlags[1] += 2;
|
|
||||||
item->itemFlags[0]++;
|
|
||||||
item->pos.yPos += item->itemFlags[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
KillItem(itemNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
item->meshBits = -2;
|
|
||||||
ExplodingDeath(itemNumber, -1, 15265);
|
|
||||||
item->itemFlags[0]++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//void FallingBlockFloor(ITEM_INFO* item, int x, int y, int z, int* height)
|
|
||||||
//{
|
|
||||||
// if (!((x ^ item->pos.xPos) & 0xFFFFFC00) && !((z ^ item->pos.zPos) & 0xFFFFFC00))
|
|
||||||
// {
|
|
||||||
// if (y <= item->pos.yPos)
|
|
||||||
// {
|
|
||||||
// *height = item->pos.yPos;
|
|
||||||
// HeightType = WALL;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//void FallingBlockCeiling(ITEM_INFO* item, int x, int y, int z, int* height)
|
|
||||||
//{
|
|
||||||
// if (!((x ^ item->pos.xPos) & 0xFFFFFC00) && !((z ^ item->pos.zPos) & 0xFFFFFC00))
|
|
||||||
// {
|
|
||||||
// if (y > item->pos.yPos)
|
|
||||||
// {
|
|
||||||
// *height = item->pos.yPos + 256;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
std::optional<int> FallingBlockFloor(short itemNumber, int x, int y, int z)
|
|
||||||
{
|
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
|
||||||
if (!item->meshBits || item->itemFlags[0] >= 52)
|
|
||||||
return std::nullopt;
|
|
||||||
|
|
||||||
int height = item->pos.yPos;
|
|
||||||
return std::optional{ height };
|
|
||||||
}
|
|
||||||
|
|
||||||
std::optional<int> FallingBlockCeiling(short itemNumber, int x, int y, int z)
|
|
||||||
{
|
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
|
||||||
|
|
||||||
if (!item->meshBits || item->itemFlags[0] >= 52)
|
|
||||||
return std::nullopt;
|
|
||||||
|
|
||||||
int height = item->pos.yPos + 256;
|
|
||||||
return std::optional{ height };
|
|
||||||
}
|
|
||||||
|
|
||||||
int FallingBlockFloorBorder(short itemNumber)
|
|
||||||
{
|
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
|
||||||
return item->pos.yPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
int FallingBlockCeilingBorder(short itemNumber)
|
|
||||||
{
|
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
|
||||||
return (item->pos.yPos + 256);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitialiseWreckingBall(short itemNumber)
|
void InitialiseWreckingBall(short itemNumber)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item;
|
ITEM_INFO* item;
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
|
|
||||||
using namespace TEN::Math::Random;
|
using namespace TEN::Math::Random;
|
||||||
|
|
||||||
constexpr auto FALLINGBLOCK_INITIAL_SPEED = 15;
|
constexpr auto FALLINGBLOCK_INITIAL_SPEED = 10;
|
||||||
constexpr auto FALLINGBLOCK_FALL_ROTATION_SPEED = 2;
|
constexpr auto FALLINGBLOCK_FALL_ROTATION_SPEED = 1;
|
||||||
constexpr auto FALLINGBLOCK_DELAY = 52;
|
constexpr auto FALLINGBLOCK_DELAY = 52;
|
||||||
constexpr auto FALLINGBLOCK_WIBBLE = 4;
|
constexpr auto FALLINGBLOCK_WIBBLE = 3;
|
||||||
constexpr auto FALLINGBLOCK_CRUMBLE_DELAY = 100;
|
constexpr auto FALLINGBLOCK_CRUMBLE_DELAY = 100;
|
||||||
|
|
||||||
void InitialiseFallingBlock(short itemNumber)
|
void InitialiseFallingBlock(short itemNumber)
|
||||||
|
@ -69,7 +69,7 @@ void FallingBlockControl(short itemNumber)
|
||||||
for (int i = 0; i < item->mutator.size(); i++)
|
for (int i = 0; i < item->mutator.size(); i++)
|
||||||
{
|
{
|
||||||
auto rotSpeed = i % 2 ? FALLINGBLOCK_FALL_ROTATION_SPEED : -FALLINGBLOCK_FALL_ROTATION_SPEED;
|
auto rotSpeed = i % 2 ? FALLINGBLOCK_FALL_ROTATION_SPEED : -FALLINGBLOCK_FALL_ROTATION_SPEED;
|
||||||
rotSpeed += i % 3 ? rotSpeed / 4 : rotSpeed;
|
rotSpeed += i % 3 ? rotSpeed / 2 : rotSpeed;
|
||||||
item->mutator[i].Rotation.x += RADIAN * rotSpeed + (RADIAN * GenerateFloat(-1, 1));
|
item->mutator[i].Rotation.x += RADIAN * rotSpeed + (RADIAN * GenerateFloat(-1, 1));
|
||||||
item->mutator[i].Rotation.y += RADIAN * rotSpeed + (RADIAN * GenerateFloat(-1, 1));
|
item->mutator[i].Rotation.y += RADIAN * rotSpeed + (RADIAN * GenerateFloat(-1, 1));
|
||||||
item->mutator[i].Rotation.z += RADIAN * rotSpeed + (RADIAN * GenerateFloat(-1, 1));
|
item->mutator[i].Rotation.z += RADIAN * rotSpeed + (RADIAN * GenerateFloat(-1, 1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue