#ifndef BATTLE_PROPERTY_H
#define BATTLE_PROPERTY_H
#include "pixelGameEngine.h"
#include "entity.h"
#include "object.h"

using namespace olc;

class BattleProperty{
    public:
    std::string displayName;
    std::string effectName;
    Property prop;
    BattleProperty(Property prop,std::string displayName,std::string effectName)
    :prop(prop),displayName(displayName),effectName(effectName){}
    virtual void OnApplication(Entity*ent,int val)=0; //What happens when the effect is immediately applied.
    virtual bool OnTurnStart(Entity*ent,int val)=0; //Effects on turn start.
    virtual void OnTurnEnd(Entity*ent,int val)=0; //Effects on turn end.
};

class Property_PETRIFY:public BattleProperty{
    public:
    Property_PETRIFY()
    :BattleProperty(Property::PETRIFY,"PETRIFY","Petrified"){}
    void OnApplication(Entity*ent,int val){
        
    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_PARALYZE:public BattleProperty{
    public:
    Property_PARALYZE()
    :BattleProperty(Property::PARALYZE,"PARALYZE","Paralyzed"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_DIAMONDIZE:public BattleProperty{
    public:
    Property_DIAMONDIZE()
    :BattleProperty(Property::DIAMONDIZE,"DIAMONDIZE","Diamondized"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_CRYING:public BattleProperty{
    public:
    Property_CRYING()
    :BattleProperty(Property::CRYING,"CRYING","Crying"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_SLOW:public BattleProperty{
    public:
    Property_SLOW()
    :BattleProperty(Property::SLOW,"SLOW","Slowed"){}
    void OnApplication(Entity*ent,int val){
        ent->statusEffects[prop]=val;
        printf("%s: %s - %d\n",displayName.c_str(),ent->obj->name.c_str(),ent->statusEffects[prop]);
    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        printf("%s: %s - %d\n",displayName.c_str(),ent->obj->name.c_str(),ent->statusEffects[prop]);
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        ent->statusEffects[prop]--;
        printf("%s: %s - %d\n",displayName.c_str(),ent->obj->name.c_str(),ent->statusEffects[prop]);
    }
};

class Property_MUSHROOMIZED:public BattleProperty{
    public:
    Property_MUSHROOMIZED()
    :BattleProperty(Property::MUSHROOMIZED,"MUSHROOMIZED","Mushroomized"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_CONFUSE:public BattleProperty{
    public:
    Property_CONFUSE()
    :BattleProperty(Property::CONFUSE,"CONFUSE","Confused"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_POISON:public BattleProperty{
    public:
    Property_POISON()
    :BattleProperty(Property::POISON,"POISON","Poisoned"){}
    void OnApplication(Entity*ent,int val){

    }
//Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_REGEN:public BattleProperty{
    public:
    Property_REGEN()
    :BattleProperty(Property::REGEN,"REGEN","Regenerating"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_DEFENSE_UP:public BattleProperty{
    public:
    Property_DEFENSE_UP()
    :BattleProperty(Property::DEFENSE_UP,"DEFENSE_UP","Hardened"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_REVIVE:public BattleProperty{
    public:
    Property_REVIVE()
    :BattleProperty(Property::REVIVE,"REVIVE","Revived"){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};

class Property_NONE:public BattleProperty{
    public:
    Property_NONE()
    :BattleProperty(Property::NONE,"NONE",""){}
    void OnApplication(Entity*ent,int val){

    }
    //Return false to cancel the move.
    bool OnTurnStart(Entity*ent,int val){
        return true;        
    }
    void OnTurnEnd(Entity*ent,int val){
        
    }
};
#endif