38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "grid_entity.h"
|
|
|
|
struct GridEntity_Rock;
|
|
|
|
// The rail piece a pit's variant carries over it, in its second byte.
|
|
constexpr int PIT_VARIANT_RAILS = 0xff00;
|
|
constexpr int PIT_RAILS_SHIFT = 8;
|
|
|
|
// A pit empty, about to be bridged by a pressure plate, bridged, and bridged by a spiked rock.
|
|
enum PitState : int
|
|
{
|
|
PIT_STATE_EMPTY,
|
|
PIT_STATE_BRIDGE_PENDING,
|
|
PIT_STATE_FILLED,
|
|
PIT_STATE_FILLED_SPIKED
|
|
};
|
|
|
|
// Destruction (007120d0) is the default.
|
|
// A pit (Lua's GridEntityPit): it swallows what walks in until a rock fills it into a bridge. Its sprite joins the pits
|
|
// around it. A ladder lets the players climb across.
|
|
struct GridEntity_Pit : GridEntity
|
|
{
|
|
bool hasLadder = false;
|
|
|
|
void subclass_init() override;
|
|
void PostInit() override;
|
|
void Update() override;
|
|
void Render(const Vector& offset) override;
|
|
WaterClipInfo GetWaterClipInfo() override;
|
|
|
|
void update_sprite_edges();
|
|
void UpdateCollision();
|
|
void SetLadder(bool isLadder);
|
|
void MakeBridge(GridEntity_Rock* rock, int bridgeVarData);
|
|
};
|