1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-24 17:26:41 +00:00
Aquaria/Aquaria/GameStructs.h
fgenesis de80af5612 improvements to gem storage
gems from old saves are still compatible but won't be associated to map tiles
2024-11-16 02:21:41 +01:00

203 lines
3.8 KiB
C++

#ifndef GAMESTRUCTS_H
#define GAMESTRUCTS_H
#include <vector>
#include <string>
#include "Vector.h"
#include "GameEnums.h"
class Path;
struct EmoteData
{
EmoteData()
{
index = -1; variations = 0;
}
int index;
std::string name;
int variations;
};
struct GemData
{
GemData() { canMove=false; blink = false; global = false; isPlayer = false; id = -1; }
std::string name;
std::string userString;
std::string mapName;
Vector pos;
bool canMove;
bool blink; // not saved on older versions
bool global; // local gems use their parent container's coordinate system, global gems are placed directly on the map screen
bool isPlayer;
int id; // used to identify a gem via scripts
};
struct BeaconData
{
BeaconData(){ index=-1; on=0; }
int index;
Vector pos,color;
bool on;
};
struct PetData
{
std::string namePart;
};
struct TreasureDataEntry
{
TreasureDataEntry() { sz = 1; use = 0;}
std::string gfx;
float sz;
int use;
};
struct FoodSortOrder
{
FoodSortOrder(IngredientType t, IngredientEffectType et = IET_NONE, std::string name="", int effectAmount=0)
{ type = t; effectType = et; this->name = name; this->effectAmount=effectAmount;}
FoodSortOrder() { type = IT_NONE; effectType = IET_NONE; }
std::string name;
IngredientType type;
IngredientEffectType effectType;
int effectAmount;
};
struct EatData
{
EatData() { ammoUnitSize=getUnits=1; health=0; ammo=1;}
std::string name, shot;
int ammoUnitSize, getUnits, ammo;
float health;
};
struct PECue
{
PECue(std::string name, Vector pos, float rot, float t)
: name(name), pos(pos), rot(rot), t(t) {}
std::string name;
Vector pos;
float rot;
float t;
};
struct RecipeType
{
RecipeType(IngredientType type, const std::string &typeName) : type(type), amount(1) { this->typeName = typeName; }
RecipeType() { amount = 1; type = IT_NONE; }
IngredientType type;
int amount;
std::string typeName;
};
struct RecipeName
{
RecipeName(const std::string &name) : name(name), amount(1) {}
RecipeName() : amount(1) {}
std::string name;
int amount;
};
class Recipe
{
public:
Recipe();
std::vector<RecipeType> types;
std::vector<RecipeName> names;
std::string result;
std::string resultDisplayName;
int index;
void addName(const std::string &name);
void addType(IngredientType type, const std::string &typeName);
void clear();
void learn();
bool isKnown() { return known; }
protected:
bool known;
};
typedef std::vector<int> SongNotes;
struct Song
{
Song() { index=0; script=0; }
int index;
SongNotes notes;
int script;
};
class Emote
{
public:
Emote();
void load(const std::string &file);
void playSfx(size_t index);
void update(float dt);
float emoteTimer;
int lastVariation;
typedef std::vector<EmoteData> Emotes;
Emotes emotes;
};
struct IngredientEffect
{
IngredientEffect() : magnitude(0), type(IET_NONE) {}
float magnitude;
IngredientEffectType type;
std::string string;
};
class IngredientData
{
public:
IngredientData(const std::string &name, const std::string &gfx, IngredientType type);
int getIndex() const;
const std::string name, gfx;
std::string displayName;
const IngredientType type;
int amount;
int maxAmount;
int held;
int marked;
bool sorted;
bool rotKind;
bool hasIET(IngredientEffectType iet);
typedef std::vector<IngredientEffect> IngredientEffects;
IngredientEffects effects;
private:
// ensure that IngredientData instances are never copied:
IngredientData(const IngredientData&);
const IngredientData& operator=(const IngredientData&);
};
typedef std::vector<IngredientData*> IngredientDatas;
struct UnderWaterResult
{
bool uw;
Path *waterbubble;
};
class ObsRow
{
public:
inline ObsRow(unsigned tx, unsigned ty, unsigned len)
: tx(tx), ty(ty), len(len) {}
inline ObsRow(const ObsRow& o)
: tx(o.tx), ty(o.ty), len(o.len) {}
const unsigned tx, ty, len;
};
#endif