mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-12-01 00:28:26 +01:00
TU46 Test content, added missing commits by amending commit and cherry-picking to new branch, ready for iggy guis and tu46 bug fixes
139 lines
3.4 KiB
C++
139 lines
3.4 KiB
C++
#pragma once
|
|
using namespace std;
|
|
|
|
#include "Entity.h"
|
|
|
|
class Player;
|
|
class Level;
|
|
class CompoundTag;
|
|
class DamageSource;
|
|
|
|
class Boat : public Entity
|
|
{
|
|
public:
|
|
eINSTANCEOF GetType() { return eTYPE_BOAT; };
|
|
static Entity *create(Level *level) { return new Boat(level); }
|
|
|
|
private:
|
|
// 4J - added for common ctor code
|
|
void _init();
|
|
public:
|
|
static const int serialVersionUID = 0;
|
|
|
|
private:
|
|
static const int DATA_ID_HURT = 17;
|
|
static const int DATA_ID_HURTDIR = 18;
|
|
static const int DATA_ID_DAMAGE = 19;
|
|
static const int DATA_ID_TYPE = 20;
|
|
static const int DATA_ID_PADDLE_LEFT = 21;
|
|
static const int DATA_ID_PADDLE_RIGHT = 22;
|
|
|
|
bool doLerp;
|
|
|
|
public:
|
|
Boat(Level *level);
|
|
|
|
protected:
|
|
virtual bool makeStepSound();
|
|
virtual void defineSynchedData();
|
|
|
|
public:
|
|
virtual AABB *getCollideAgainstBox(shared_ptr<Entity> entity);
|
|
virtual AABB *getCollideBox();
|
|
virtual bool isPushable();
|
|
|
|
Boat(Level *level, double x, double y, double z);
|
|
|
|
virtual double getRideHeight();
|
|
virtual bool hurt(DamageSource *source, float damage);
|
|
virtual void animateHurt();
|
|
virtual bool isPickable();
|
|
|
|
private:
|
|
int lSteps;
|
|
double lx, ly, lz, lyr, lxr;
|
|
double lxd, lyd, lzd;
|
|
|
|
public:
|
|
virtual void lerpTo(double x, double y, double z, float yRot, float xRot, int steps);
|
|
virtual void lerpMotion(double xd, double yd, double zd);
|
|
virtual void tick();
|
|
void createSplash(double particleStrengh);
|
|
virtual void positionRider();
|
|
virtual void positionRider(shared_ptr<Entity> passenger);
|
|
virtual bool hasRider(shared_ptr<Entity> e);
|
|
virtual void addRider(shared_ptr<Entity> e);
|
|
virtual void removeRider(shared_ptr<Entity> e);
|
|
virtual shared_ptr<Entity> getExtraRider();
|
|
int getPassengerCount();
|
|
bool canAddPassenger();
|
|
void ejectPassengers();
|
|
virtual void checkFallDamage(double ya, bool onGround);
|
|
virtual void push(shared_ptr<Entity> e);
|
|
|
|
protected:
|
|
virtual void addAdditonalSaveData(CompoundTag *base);
|
|
virtual void readAdditionalSaveData(CompoundTag *base);
|
|
|
|
public:
|
|
virtual float getShadowHeightOffs();
|
|
virtual int getLightColor(float a);
|
|
wstring getName();
|
|
virtual bool interact(shared_ptr<Player> player);
|
|
|
|
virtual void setDamage(float damage);
|
|
virtual float getDamage();
|
|
virtual void setHurtTime(int hurtTime);
|
|
virtual int getHurtTime();
|
|
virtual void setHurtDir(int hurtDir);
|
|
virtual int getHurtDir();
|
|
|
|
static const int OAK = 0;
|
|
static const int SPRUCE = 1;
|
|
static const int BIRCH = 2;
|
|
static const int JUNGLE = 3;
|
|
static const int ACACIA = 4;
|
|
static const int DARK_OAK = 5;
|
|
static const int TYPE_COUNT = 6;
|
|
|
|
void setType(int type);
|
|
int getType();
|
|
int getDropItemId();
|
|
static int getItemIdForType(int type);
|
|
|
|
float getRowingTime(int side, float a);
|
|
private:
|
|
float paddlePositions[2];
|
|
|
|
enum EStatus { IN_WATER, UNDER_WATER, UNDER_FLOWING_WATER, ON_LAND, IN_AIR };
|
|
weak_ptr<Entity> secondRider;
|
|
EStatus status;
|
|
float invFriction;
|
|
int outOfControlTicks;
|
|
float deltaRotation;
|
|
double waterLevel;
|
|
double lastYd;
|
|
double rockPhase;
|
|
bool inputLeft, inputRight, inputUp, inputDown;
|
|
|
|
static float getWaterFill(Level *level, int x, int y, int z);
|
|
EStatus isUnderwater();
|
|
bool checkInWater();
|
|
float getGroundFriction();
|
|
EStatus getStatus();
|
|
float getWaterLevelAbove();
|
|
void floatBoat();
|
|
void controlBoat();
|
|
void setPaddleState(bool left, bool right);
|
|
void clampRotation(shared_ptr<Entity> passenger);
|
|
static double getSeatOffset(shared_ptr<Entity> passenger);
|
|
public:
|
|
bool getPaddleState(int side);
|
|
bool isLocallyDriven();
|
|
private:
|
|
public:
|
|
|
|
bool getDoLerp();
|
|
void setDoLerp(bool doLerp);
|
|
};
|