#pragma once #include "olcUTIL_Camera2D.h" #include "Textbox.h" #include "Unit.h" #include "olcPGEX_AudioSource.h" #include "olcPGEX_TransformedView.h" #include "GameFlags.h" #include "Level.h" class Scenario{ public: Scenario(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); virtual~Scenario(); void _Start(); void Draw(); virtual void Start(); void _Update(Resources&enemy_resources,std::vector>&collectionPoints,int availableMemory,std::vector>&queuedUnits,std::vector>&SOUNDS); bool transitionToNextLevel=false; LevelName nextLevel=LevelName::STAGE1; void RunAI(Resources&enemy_resources,std::vector>&collectionPoints,int availableMemory,std::vector>&queuedUnits,std::vector>&SOUNDS); bool setupEasyMode=false; float attackTimer=120; std::mapcpCheckTimer; bool AttemptBuild(UnitType unit,vf2d pos,std::vector&resourceCost,Resources&enemy_resources,int availableMemory,std::vector>&queuedUnits); protected: void DisplayBox(std::string text,bool scaryHoodedFigure=false); void SetCameraTarget(vf2d pos,bool instant=false); void SetObjective(std::string objective); void RevealTiles(vf2d pos); virtual bool MissionCompleted(); virtual void Update(); int state=0; utils::Camera2D camera; vf2d targetPos; Textbox box; float initialWaitTime=3; bool missionCompleted=false; float missionFinishWaitTime=3; float missionCompletedTimer=0; float smallTimePass=0; std::vector>&units; std::vector>&IMAGES; std::vector>&SOUNDS; GameFlags&flags; std::string&objective; TileTransformedView&game; float unitBuildTimer=0; }; class Stage1:public Scenario{ public: Stage1(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage2:public Scenario{ public: Stage2(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage3:public Scenario{ public: float oopsTimer=0.3; Stage3(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage4:public Scenario{ public: Stage4(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); int collectorsAttached=0; float nextLevelTimer=0; protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage5:public Scenario{ public: Stage5(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage6:public Scenario{ public: Stage6(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage7:public Scenario{ public: Stage7(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); }; class Stage8:public Scenario{ public: Stage8(std::vector>&units,std::vector>&IMAGES,std::vector>&SOUNDS,std::string&objective,TileTransformedView&game,GameFlags&flags); protected: void Start(); void Update(); bool MissionCompleted(); };