1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-18 12:39:52 +00:00
Aquaria/Aquaria/Continuity.h
fgenesis 8472718fb7 Major include refactor; changes to pretty much everything
This untangles some of the gigantic kitchen sink headers
in an attempt to split things into smaller files.
Also don't include gl.h, glext.h, windows.h,
and other such nonsense *everywhere*.

Lots of cleanups on the way too. More dead/unused code removal.

Remove incrFlag(), decrFlag() Lua functions.
2016-07-09 04:18:40 +02:00

308 lines
7.7 KiB
C++

#ifndef CONTINUITY_H
#define CONTINUITY_H
#include <map>
#include <vector>
#include <string>
#include "StatsAndAchievements.h"
#include "GameEnums.h"
#include "WorldMap.h"
#include "StringBank.h"
namespace tinyxml2 { class XMLDocument; }
class Avatar;
class IngredientData;
class Path;
typedef std::map<int, TreasureDataEntry> TreasureData;
class Continuity
{
public:
Continuity();
~Continuity() { clearIngredientData(); }
void init();
void shutdown();
void initAvatar(Avatar *a);
void refreshAvatarData(Avatar *a);
void reset();
bool hasItem(int type);
void pickup(int type, int amount=1);
void drop(int type);
void entityDied(Entity *eDead);
void achieve(const std::string &achievement);
void initFoodSort();
void sortFood();
bool isIngredientFull(IngredientData *data);
void setCostume(const std::string &c);
void shortenSong(Song &song, int size);
void warpLiToAvatar();
void flingMonkey(Entity *e);
void upgradeHealth();
int getFlag(std::string flag);
void setFlag(std::string flag, int v);
int getFlag(int flag);
void setFlag(int flag, int v);
int getEntityFlag(const std::string &sceneName, int id);
void setEntityFlag(const std::string &sceneName, int id, int v);
void setPathFlag(Path *p, int v);
int getPathFlag(Path *p);
std::string getStringFlag(std::string flag);
void setStringFlag(std::string flag, std::string v);
void saveFile(int slot, Vector position=Vector(0,0,0), unsigned char *scrShotData=0, int scrShotWidth=0, int scrShotHeight=0);
void loadFileData(int slot, tinyxml2::XMLDocument &doc);
void loadFile(int slot);
void castSong(int num);
bool hasLi();
std::string getDescriptionForSongSlot(int songSlot);
std::string getVoxForSongSlot(int songSlot);
std::string getIEString(IngredientData *data, int i);
std::string getAllIEString(IngredientData *data);
std::string getInternalFormName();
std::string getSaveFileName(int slot, const std::string &pfix);
float maxHealth;
float health;
bool hudVisible;
unsigned int exp;
void clearTempFlags();
void getHoursMinutesSeconds(int *hours, int *minutes, int *seconds);
float seconds;
void update(float dt);
void setItemSlot(int slot, int itemType);
std::vector<int> itemSlots;
bool isItemPlantable(int item);
float getCurrentTime(){return seconds;}
//GardenData gardenData;
Vector zoom;
std::string getIngredientGfx(const std::string &name);
WorldType getWorldType() { return worldType; }
void shiftWorlds();
void applyWorldEffects(WorldType type, bool transition, bool affectMusic);
//void setActivePet(int flag);
bool isStory(float v);
float getStory();
void setStory(float v);
float getSpeedType(int speedType);
void setNaijaModel(std::string model);
std::string naijaModel;
FormType form;
void learnFormUpgrade(FormUpgradeType form);
bool hasFormUpgrade(FormUpgradeType form);
typedef std::map<FormUpgradeType, bool> FormUpgrades;
FormUpgrades formUpgrades;
void loadSongBank();
void loadIntoSongBank(const std::string &file);
int checkSong(const Song &song);
int checkSongAssisted(const Song &song);
typedef std::map<int, Song> SongMap;
SongMap songBank;
Song *getSongByIndex(int idx);
bool hasSong(int song);
int getSongTypeBySlot(int slot);
int getSongSlotByType(int type);
void learnSong(int song);
void unlearnSong(int song);
std::map<int, bool> knowsSong;
std::map<int, int> songSlotsToType;
std::map<int, int> songTypesToSlot;
std::map<int, std::string> songSlotDescriptions;
std::map<int, std::string> songSlotNames;
std::map<int, std::string> songSlotVox;
typedef std::map<std::string, int> EntityFlags;
EntityFlags entityFlags;
bool toggleMoveMode;
typedef std::list<GemData> Gems;
Gems gems;
typedef std::list<BeaconData> Beacons;
Beacons beacons;
GemData *pickupGem(std::string name, bool effects = true);
void removeGemData(GemData *gemData);
typedef std::vector<std::string> VoiceOversPlayed;
VoiceOversPlayed voiceOversPlayed;
std::string costume;
AuraType auraType;
float auraTimer;
EatData *getEatData(const std::string &name);
void loadEatBank();
bool isSongTypeForm(SongType s);
std::string getSongNameBySlot(int slot);
void toggleLiCombat(bool t);
void pickupIngredient(IngredientData *i, int amount, bool effects=true, bool learn=true);
int indexOfIngredientData(const IngredientData* data) const;
IngredientData *getIngredientHeldByName(const std::string &name) const; // an ingredient that the player actually has; in the ingredients list
IngredientData *getIngredientDataByName(const std::string &name); // an ingredient in the general data list; ingredientData
IngredientData *getIngredientHeldByIndex(int idx) const;
IngredientData *getIngredientDataByIndex(int idx);
int getIngredientDataSize() const;
int getIngredientHeldSize() const;
bool applyIngredientEffects(IngredientData *data);
void loadIngredientData();
void loadIngredientData(const std::string &file);
void loadIngredientDisplayNames(const std::string& file);
bool hasIngredients() const { return !ingredients.empty(); }
IngredientDatas::size_type ingredientCount() const { return ingredients.size(); }
IngredientType getIngredientTypeFromName(const std::string &name) const;
std::string getIngredientDisplayName(const std::string& name) const;
void removeEmptyIngredients();
void spawnAllIngredients(const Vector &position);
std::vector<std::string> unsortedOrder;
typedef std::vector<Recipe> Recipes;
Recipes recipes;
void setSpeedMultiplier(float s, float t);
void setBiteMultiplier(float m, float t);
void setFishPoison(float m, float t);
void setDefenseMultiplier(float s, float t);
void setRegen(float t);
void setTrip(float t);
void setInvincible(float t);
void setEnergy(float m, float t);
void setPoison(float m, float t);
void setWeb(float t);
void setLight(float m, float t);
void setPetPower(float m, float t);
void setLiPower(float m, float t);
void cureAllStatus();
float speedMult, biteMult, fishPoison, defenseMult, energyMult, poison, light, petPower, liPower;
Timer speedMultTimer, biteMultTimer, fishPoisonTimer, defenseMultTimer, liPowerTimer;
Timer invincibleTimer;
Timer regenTimer, tripTimer;
Timer energyTimer, poisonTimer, poisonBitTimer;
Timer webTimer, webBitTimer, lightTimer, petPowerTimer;
float speedMult2;
void eatBeast(const EatData &eatData);
void removeNaijaEat(int idx);
void removeLastNaijaEat();
EatData *getLastNaijaEat();
bool isNaijaEatsEmpty();
void loadPetData();
PetData *getPetData(int idx);
std::vector<EatData> naijaEats;
std::vector<PetData> petData;
std::string getIngredientAffectsString(IngredientData *data);
WorldMap worldMap;
StringBank stringBank;
TreasureData treasureData;
void loadTreasureData();
void learnRecipe(Recipe *r, bool effects=true);
void learnRecipe(const std::string &result, bool effects=true);
float poisonBitTime, poisonBitTimeAvatar;
enum { DUALFORM_NAIJA = 0, DUALFORM_LI = 1 };
int dualFormMode, dualFormCharge;
BeaconData *getBeaconByIndex(int index);
void setBeacon(int index, bool v, Vector pos=Vector(0,0,0), Vector color=Vector(1,1,1));
int foodSortType;
std::vector<FoodSortOrder> sortByType, sortByHeal, sortByIngredients, sortByUnsort;
StatsAndAchievements *statsAndAchievements;
protected:
std::vector<EatData> eats;
std::vector<float> speedTypes;
float story;
WorldType worldType;
std::vector<int> items;
std::vector<int> spells;
typedef std::map<std::string,int> Flags;
Flags flags;
int intFlags[MAX_FLAGS];
typedef std::map<std::string,std::string> StringFlags;
StringFlags stringFlags;
private:
void clearIngredientData();
IngredientDatas ingredients; // held ingredients
IngredientDatas ingredientData; // all possible ingredients
typedef std::map<std::string,std::string> IngredientNameMap;
IngredientNameMap ingredientDisplayNames;
};
#endif