#ifndef ENCOUNTERS_H #define ENCOUNTERS_H #include "pixelGameEngine.h" using namespace olc; #include "defines.h" #include "object.h" #include "battle.h" #include "item.h" #include "entity.h" extern std::vector PARTY_INVENTORY; namespace encounter{ enum{ ENCOUNTER_1, ENCOUNTER_2, ENCOUNTER_3, ENCOUNTER_4, }; } class Encounter{ public: vd2d pos; int chance; //Chance of the encounter existing. std::vectorobjs; std::array playerPos; int id; Encounter(int id,vd2d pos,std::array playerPos,std::vectorobjs,int chance=25) :id(id),pos(pos),objs(objs),chance(chance),playerPos(playerPos){} bool IsEncounterAlive() { for (int i=0;iGetHP()>0) { return true; } } return false; } bool IsInRange(vd2d pos) { vd2d diff=pos-this->pos; return diff.x>=0&&diff.x<=WIDTH&&diff.y>=0&&diff.y<=HEIGHT; } }; #endif