mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-12-05 16:15:01 +01:00
Co-authored-by: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Anaël <60509176+Bakoubak@users.noreply.github.com> Reviewed-on: https://git.neolegacy.dev/neoStudiosLCE/neoLegacy/pulls/4205
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
#pragma once
|
|
|
|
class Level;
|
|
class EnderCrystal;
|
|
class EnderDragon;
|
|
|
|
class EndDragonFight
|
|
{
|
|
public:
|
|
static const int GATEWAY_X = 65;
|
|
static const int GATEWAY_Y = 75;
|
|
static const int GATEWAY_Z = 0;
|
|
|
|
private:
|
|
enum RespawnStage
|
|
{
|
|
eRespawn_None,
|
|
eRespawn_Start,
|
|
eRespawn_PreparingPillars,
|
|
eRespawn_SummoningPillars,
|
|
eRespawn_SummoningDragon,
|
|
};
|
|
|
|
Level *level;
|
|
RespawnStage respawnStage;
|
|
int respawnTime;
|
|
vector<shared_ptr<EnderCrystal> > respawnCrystals;
|
|
|
|
public:
|
|
EndDragonFight(Level *level);
|
|
|
|
static EndDragonFight *get(Level *level);
|
|
|
|
void tick();
|
|
void onDragonKilled();
|
|
void onCrystalDestroyed(shared_ptr<EnderCrystal> crystal);
|
|
void tryRespawn();
|
|
|
|
static void spawnExitPortal(Level *level, bool active, bool placeEgg);
|
|
|
|
private:
|
|
int getPortalY();
|
|
void findPortalCrystals(vector<shared_ptr<EnderCrystal> > &result);
|
|
void setRespawnStage(RespawnStage stage);
|
|
void tickRespawn();
|
|
void rebuildSpike(int index);
|
|
void resetSpikeCrystals();
|
|
void pointCrystalsAt(int x, int y, int z);
|
|
void growl();
|
|
void createNewDragon();
|
|
};
|