|
|
|
#ifndef SEASONI_H
|
|
|
|
#define SEASONI_H
|
|
|
|
#include "pixelGameEngine.h"
|
|
|
|
#include "splash.h"
|
|
|
|
#include "soundwaveEngine.h"
|
|
|
|
#include "flags.h"
|
|
|
|
#include "map.h"
|
|
|
|
#include "cutscene.h"
|
|
|
|
|
|
|
|
using namespace olc;
|
|
|
|
|
|
|
|
class SeasonI:public PixelGameEngine{
|
|
|
|
public:
|
|
|
|
SeasonI(){sAppName="Season I: Winters of Loneliness";}
|
|
|
|
bool OnUserCreate()override;
|
|
|
|
void SetupMoveList();
|
|
|
|
void SetupItemList();
|
|
|
|
void SetupPartyMemberStats();
|
|
|
|
void SetupAnimations();
|
|
|
|
void SetupObjectInfo();
|
|
|
|
void SetupEncounters();
|
|
|
|
void SetupBattleProperties();
|
|
|
|
void SetGameFlag(Flag flag,bool val);
|
|
|
|
void LoadMap(Map*map);
|
|
|
|
void SaveMap(Map*map);
|
|
|
|
void AddItemToPlayerInventory(ItemName item);
|
|
|
|
Decal*CreateSprite(std::string spriteName);
|
|
|
|
Object*CreateObjectInfo(Object*obj,std::string spriteFileName,int sprWidth,Flag enableFlag=Flag::NONE,Flag disableFlag=Flag::NONE);
|
|
|
|
vi2d grid(int x, int y);
|
|
|
|
bool GetGameFlag(int flag);
|
|
|
|
bool GetGameFlag(Flag flag);
|
|
|
|
//You're probably trying to add an object to the world. Use this function inside of AddObjectToWorld(CreateObject(...))
|
|
|
|
//You only need to use this function if you want to create an object from pre-defined OBJ_INFO variables.
|
|
|
|
Object*CreateObject(int id,vd2d pos);
|
|
|
|
Object* AddObjectToWorld(Object*obj);
|
|
|
|
void LoadEncounter(Map*map,vd2d pos,int chance,int id,bool successful);
|
|
|
|
bool OnUserUpdate(float fElapsedTime)override;
|
|
|
|
void updateGame();
|
|
|
|
void keyUpdates();
|
|
|
|
void drawGame();
|
|
|
|
ActionType GetCurrentCutsceneAction();
|
|
|
|
void HandleRollingCounters();
|
|
|
|
void HandleRollingCounters(int i,int(&counter)[4][3],int(&display)[4][3],Entity*member,int maxVal,int currentVal,int targetVal,bool pp=false);
|
|
|
|
void HandleBattle();
|
|
|
|
void HandleCutscenes();
|
|
|
|
bool TabHeld();
|
|
|
|
bool UpPressed();
|
|
|
|
bool DownPressed();
|
|
|
|
bool LeftPressed();
|
|
|
|
bool RightPressed();
|
|
|
|
bool UpHeld();
|
|
|
|
bool DownHeld();
|
|
|
|
bool LeftHeld();
|
|
|
|
bool RightHeld();
|
|
|
|
bool UpReleased();
|
|
|
|
bool DownReleased();
|
|
|
|
bool LeftReleased();
|
|
|
|
bool RightReleased();
|
|
|
|
bool PlayerCanMove();
|
|
|
|
void UpdatePlayerTrail(vd2d newMovement);
|
|
|
|
void SetupRollingHitpointCounters();
|
|
|
|
void AdvanceMessageBox();
|
|
|
|
//CAMERA UPDATES MUST BE LAST!!! COLLISIONS RELY ON THE GAME POSITION STATES REMAINING THE SAME!
|
|
|
|
void cameraUpdate();
|
|
|
|
void StartEffect(Effect*eff);
|
|
|
|
void PopulateBattleMoveList(int partyMemberSlot,bool overworld=false);
|
|
|
|
void SetupTargetSelect();
|
|
|
|
//Can run this after target selection to reset states.
|
|
|
|
void ConfirmPlayerTargetSelection();
|
|
|
|
std::vector<Entity*> GetEntitiesInRange(int targetEnt, vd2d channelPos, Battle::Move*move);
|
|
|
|
int CalculateSpeedGridMovementAmount(int spd);
|
|
|
|
void PopulateMovementGrid(vd2d pos,int range);
|
|
|
|
//Returns 0 if not found.
|
|
|
|
int getProperty(Property prop,Battle::Move*move);
|
|
|
|
void HandleInventoryNavigation();
|
|
|
|
void PerformOverworldMove(Battle::Move*move,int partyMemberSlot);
|
|
|
|
void PopulateEquipMenuItems();
|
|
|
|
void CursorControl(int&cursor,int max);
|
|
|
|
//Returns a version of str with a/an and a space prepended to it followed by the str itself.
|
|
|
|
std::string A_An(std::string str);
|
|
|
|
void DrawTargetRangeGrid(vd2d pos,int range,Pixel outlinecol,Pixel box1col,Pixel box2col,bool connectedborder);
|
|
|
|
void DrawTargetRangeGrid(vd2d pos,int range);
|
|
|
|
void DrawMovementGrid(Pixel outlinecol,Pixel box1col,Pixel box2col);
|
|
|
|
void drawCheckerboardBox(const olc::vi2d &pos, const olc::vi2d &size, olc::Pixel p = olc::WHITE, olc::Pixel alternatingCol = olc::WHITE, const olc::vi2d &checkerboardSize = {3,3}, olc::Pixel p2 = olc::DARK_GREY, olc::Pixel p3 = olc::VERY_DARK_GREY);
|
|
|
|
bool OverworldMenuOpen();
|
|
|
|
void DrawRollingCounter(const olc::vi2d &pos,int val,int*rollcounter,int*rolloffset);
|
|
|
|
void DrawGameWorld();
|
|
|
|
void DrawDialogBox(const vi2d &pos, const vi2d &size, Pixel p, Pixel p2, Pixel p3);
|
|
|
|
//The player's money count. It's shown in a box that is WIDTH/4 and HEIGHT/6 in size.
|
|
|
|
void DrawMoneyBox(vf2d pos,vf2d size={(int)(WIDTH/4),(int)(HEIGHT/6)});
|
|
|
|
void CalculateChangeInEquipmentStats(int partyMemberSlot,int itemSlot,int&equipAttack,int&equipDefense,int&newAttack,int&newDefense);
|
|
|
|
void CalculateEquipmentStats(int partyMemberSlot,int&atk,int&def);
|
|
|
|
std::string Wrap(std::string str,int width,bool proportional,vd2d scale);
|
|
|
|
void DrawBattleMoveList(int partyMemberSlot);
|
|
|
|
vf2d AutoScaleText(std::string str,int targetWidth,vf2d scale={1,1},bool prop=true);
|
|
|
|
std::string ParseBattleMessage(Entity*ent,std::string baseStr);
|
|
|
|
void DrawArrow();
|
|
|
|
bool MoveCameraTowardsPoint(vd2d targetPos,PriorityDirection dir,double spd,bool secondRun=false);
|
|
|
|
bool MoveObjectTowardsPoint(Object*obj,vd2d targetPos,PriorityDirection dir,double moveSpd,bool secondRun=false);
|
|
|
|
int CalculateHealing(Entity*user);
|
|
|
|
int getMemberIDComparingObject(Object*obj);
|
|
|
|
int CalculateDamage(Entity*attacker,Entity*defender,bool includeDefenses=true);
|
|
|
|
//Returns true if the key is meant to be continuously repeated because of being held down.
|
|
|
|
//dir should be UP,DOWN,LEFT,RIGHT
|
|
|
|
bool KeyRepeat(Key dir);
|
|
|
|
bool MessageBoxAllowedToAdvance();
|
|
|
|
void CheckGrid(int x,int y,vd2d pos,int lifetime);
|
|
|
|
bool startsWithVowel(std::string str);
|
|
|
|
void drawBox(const olc::vi2d &pos, const olc::vi2d &size, olc::Pixel p = olc::WHITE, olc::Pixel p2 = olc::DARK_GREY, olc::Pixel p3 = olc::VERY_DARK_GREY);
|
|
|
|
std::string GetTargetName(int target);
|
|
|
|
void OnTextEntryComplete(const std::string&text)override;
|
|
|
|
void GetAnyKeyPress(olc::Key keypress)override;
|
|
|
|
bool Collision(vd2d pos);
|
|
|
|
};
|
|
|
|
#endif
|