2014-06-05 19:52:14 +03:00
/*
2014-06-05 20:26:50 +03:00
* MiscObjects . h , part of VCMI engine
2014-06-05 19:52:14 +03:00
*
* Authors : listed in file AUTHORS in main folder
*
* License : GNU General Public License v2 .0 or later
* Full text of license available in license . txt file , in main folder
*
*/
2017-07-13 10:26:03 +02:00
# pragma once
# include "CObjectHandler.h"
# include "CArmedInstance.h"
# include "../ResourceSet.h"
2014-06-05 19:52:14 +03:00
2016-02-13 18:43:05 +02:00
class CMap ;
2017-06-30 22:39:37 +02:00
/// Legacy class, use CRewardableObject instead
class DLL_LINKAGE CTeamVisited : public CGObjectInstance
2014-06-05 19:52:14 +03:00
{
public :
std : : set < PlayerColor > players ; //players that visited this object
2015-10-12 15:47:10 +02:00
bool wasVisited ( PlayerColor player ) const override ;
2014-06-05 19:52:14 +03:00
bool wasVisited ( TeamID team ) const ;
void setPropertyDer ( ui8 what , ui32 val ) override ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
h & players ;
}
2016-01-20 09:44:13 +02:00
2016-01-29 19:21:19 +02:00
static const int OBJPROP_VISITED = 10 ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGCreature : public CArmedInstance //creatures on map
{
2015-01-10 11:23:58 +02:00
public :
2014-06-05 19:52:14 +03:00
enum Action {
FIGHT = - 2 , FLEE = - 1 , JOIN_FOR_FREE = 0 //values > 0 mean gold price
} ;
2015-01-10 11:23:58 +02:00
enum Character {
COMPLIANT = 0 , FRIENDLY = 1 , AGRESSIVE = 2 , HOSTILE = 3 , SAVAGE = 4
} ;
2014-06-05 19:52:14 +03:00
ui32 identifier ; //unique code for this monster (used in missions)
si8 character ; //character of this set of creatures (0 - the most friendly, 4 - the most hostile) => on init changed to -4 (compliant) ... 10 value (savage)
std : : string message ; //message printed for attacking hero
TResources resources ; // resources given to hero that has won with monsters
ArtifactID gainedArtifact ; //ID of artifact gained to hero, -1 if none
bool neverFlees ; //if true, the troops will never flee
bool notGrowingTeam ; //if true, number of units won't grow
ui64 temppower ; //used to handle fractional stack growth for tiny stacks
bool refusedJoining ;
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( PlayerColor player ) const override ;
std : : string getHoverText ( const CGHeroInstance * hero ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
void newTurn ( CRandomGenerator & rand ) const override ;
2014-06-05 19:52:14 +03:00
void battleFinished ( const CGHeroInstance * hero , const BattleResult & result ) const override ;
void blockingDialogAnswered ( const CGHeroInstance * hero , ui32 answer ) const override ;
2014-12-25 00:53:56 +02:00
//stack formation depends on position,
bool containsUpgradedStack ( ) const ;
int getNumberOfStacks ( const CGHeroInstance * hero ) const ;
2014-06-05 19:52:14 +03:00
struct DLL_LINKAGE formationInfo // info about merging stacks after battle back into one
{
si32 basicType ;
2014-12-25 00:53:56 +02:00
ui8 upgrade ; //random seed used to determine number of stacks and is there's upgraded stack
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-07-31 15:35:42 +02:00
h & basicType ;
h & upgrade ;
2014-06-05 19:52:14 +03:00
}
} formation ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CArmedInstance & > ( * this ) ;
2017-07-31 15:35:42 +02:00
h & identifier ;
h & character ;
h & message ;
h & resources ;
h & gainedArtifact ;
h & neverFlees ;
h & notGrowingTeam ;
h & temppower ;
h & refusedJoining ;
h & formation ;
2014-06-05 19:52:14 +03:00
}
protected :
void setPropertyDer ( ui8 what , ui32 val ) override ;
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2015-11-16 15:30:40 +02:00
2014-06-05 19:52:14 +03:00
private :
void fight ( const CGHeroInstance * h ) const ;
void flee ( const CGHeroInstance * h ) const ;
void fleeDecision ( const CGHeroInstance * h , ui32 pursue ) const ;
void joinDecision ( const CGHeroInstance * h , int cost , ui32 accept ) const ;
int takenAction ( const CGHeroInstance * h , bool allowJoin = true ) const ; //action on confrontation: -2 - fight, -1 - flee, >=0 - will join for given value of gold (may be 0)
2016-01-15 03:29:46 +02:00
void giveReward ( const CGHeroInstance * h ) const ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGSignBottle : public CGObjectInstance //signs and ocean bottles
{
public :
std : : string message ;
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
h & message ;
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
2017-06-30 22:39:37 +02:00
class DLL_LINKAGE CGWitchHut : public CTeamVisited
2014-06-05 19:52:14 +03:00
{
public :
std : : vector < si32 > allowedAbilities ;
ui32 ability ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( PlayerColor player ) const override ;
std : : string getHoverText ( const CGHeroInstance * hero ) const override ;
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-06-30 22:39:37 +02:00
h & static_cast < CTeamVisited & > ( * this ) ;
2017-07-31 15:35:42 +02:00
h & allowedAbilities ;
h & ability ;
2014-06-05 19:52:14 +03:00
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGScholar : public CGObjectInstance
{
public :
enum EBonusType { PRIM_SKILL , SECONDARY_SKILL , SPELL , RANDOM = 255 } ;
EBonusType bonusType ;
ui16 bonusID ; //ID of skill/spell
2016-11-27 16:48:18 +02:00
CGScholar ( ) : bonusType ( EBonusType : : RANDOM ) , bonusID ( 0 ) { } ;
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
2017-07-31 15:35:42 +02:00
h & bonusType ;
h & bonusID ;
2014-06-05 19:52:14 +03:00
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGGarrison : public CArmedInstance
{
public :
bool removableUnits ;
2014-06-24 02:26:36 +03:00
bool passableFor ( PlayerColor color ) const override ;
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
void battleFinished ( const CGHeroInstance * hero , const BattleResult & result ) const override ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CArmedInstance & > ( * this ) ;
h & removableUnits ;
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGArtifact : public CArmedInstance
{
public :
CArtifactInstance * storedArtifact ;
std : : string message ;
2014-07-05 20:35:46 +03:00
CGArtifact ( ) : CArmedInstance ( ) { storedArtifact = nullptr ; } ;
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
void battleFinished ( const CGHeroInstance * hero , const BattleResult & result ) const override ;
void blockingDialogAnswered ( const CGHeroInstance * hero , ui32 answer ) const override ;
2014-06-24 20:39:36 +03:00
std : : string getObjectName ( ) const override ;
2014-06-05 19:52:14 +03:00
void pick ( const CGHeroInstance * h ) const ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
2017-05-28 15:23:42 +02:00
void afterAddToMap ( CMap * map ) override ;
2022-07-09 18:00:03 +02:00
BattleField getBattlefield ( ) const override ;
2017-05-28 15:23:42 +02:00
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CArmedInstance & > ( * this ) ;
2017-07-31 15:35:42 +02:00
h & message ;
h & storedArtifact ;
2014-06-05 19:52:14 +03:00
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGResource : public CArmedInstance
{
public :
2022-05-23 12:08:36 +02:00
static const ui32 RANDOM_AMOUNT = 0 ;
2014-06-05 19:52:14 +03:00
ui32 amount ; //0 if random
2022-05-23 12:08:36 +02:00
2014-06-05 19:52:14 +03:00
std : : string message ;
2014-07-27 20:30:17 +03:00
CGResource ( ) ;
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
void battleFinished ( const CGHeroInstance * hero , const BattleResult & result ) const override ;
void blockingDialogAnswered ( const CGHeroInstance * hero , ui32 answer ) const override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( PlayerColor player ) const override ;
2014-06-05 19:52:14 +03:00
void collectRes ( PlayerColor player ) const ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CArmedInstance & > ( * this ) ;
2017-07-31 15:35:42 +02:00
h & amount ;
h & message ;
2014-06-05 19:52:14 +03:00
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
2017-06-30 22:39:37 +02:00
class DLL_LINKAGE CGShrine : public CTeamVisited
2014-06-05 19:52:14 +03:00
{
public :
SpellID spell ; //id of spell or NONE if random
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( PlayerColor player ) const override ;
std : : string getHoverText ( const CGHeroInstance * hero ) const override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-06-30 22:39:37 +02:00
h & static_cast < CTeamVisited & > ( * this ) ; ;
2014-06-05 19:52:14 +03:00
h & spell ;
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGMine : public CArmedInstance
{
public :
Res : : ERes producedResource ;
ui32 producedQuantity ;
2015-12-02 22:34:13 +02:00
private :
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
void battleFinished ( const CGHeroInstance * hero , const BattleResult & result ) const override ;
void blockingDialogAnswered ( const CGHeroInstance * hero , ui32 answer ) const override ;
void flagMine ( PlayerColor player ) const ;
2016-09-09 19:30:36 +02:00
void newTurn ( CRandomGenerator & rand ) const override ;
void initObj ( CRandomGenerator & rand ) override ;
2014-06-24 20:39:36 +03:00
std : : string getObjectName ( ) const override ;
std : : string getHoverText ( PlayerColor player ) const override ;
2016-01-23 18:53:02 +02:00
bool isAbandoned ( ) const ;
2015-12-02 22:34:13 +02:00
public :
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CArmedInstance & > ( * this ) ;
2017-07-31 15:35:42 +02:00
h & producedResource ;
h & producedQuantity ;
2014-06-05 19:52:14 +03:00
}
ui32 defaultResProduction ( ) ;
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
2015-03-08 14:18:53 +02:00
struct DLL_LINKAGE TeleportChannel
{
enum EPassability { UNKNOWN , IMPASSABLE , PASSABLE } ;
TeleportChannel ( ) : passability ( UNKNOWN ) { }
std : : vector < ObjectInstanceID > entrances ;
std : : vector < ObjectInstanceID > exits ;
EPassability passability ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-07-31 15:35:42 +02:00
h & entrances ;
h & exits ;
h & passability ;
2015-03-08 14:18:53 +02:00
}
} ;
2015-03-08 15:11:23 +02:00
class DLL_LINKAGE CGTeleport : public CGObjectInstance
2014-06-05 19:52:14 +03:00
{
2015-12-02 21:01:43 +02:00
bool isChannelEntrance ( ObjectInstanceID id ) const ;
bool isChannelExit ( ObjectInstanceID id ) const ;
2015-03-08 15:11:23 +02:00
2015-12-02 21:01:43 +02:00
std : : vector < ObjectInstanceID > getAllEntrances ( bool excludeCurrent = false ) const ;
protected :
enum EType { UNKNOWN , ENTRANCE , EXIT , BOTH } ;
2015-03-08 15:11:23 +02:00
EType type ;
CGTeleport ( ) ;
2015-12-02 21:01:43 +02:00
ObjectInstanceID getRandomExit ( const CGHeroInstance * h ) const ;
std : : vector < ObjectInstanceID > getAllExits ( bool excludeCurrent = false ) const ;
public :
TeleportChannelID channel ;
2015-03-08 15:11:23 +02:00
bool isEntrance ( ) const ;
bool isExit ( ) const ;
2015-12-02 16:56:26 +02:00
virtual void teleportDialogAnswered ( const CGHeroInstance * hero , ui32 answer , TTeleportExitsList exits ) const = 0 ;
2015-03-08 15:11:23 +02:00
static bool isTeleport ( const CGObjectInstance * dst ) ;
static bool isConnected ( const CGTeleport * src , const CGTeleport * dst ) ;
static bool isConnected ( const CGObjectInstance * src , const CGObjectInstance * dst ) ;
2015-12-29 04:43:33 +02:00
static void addToChannel ( std : : map < TeleportChannelID , std : : shared_ptr < TeleportChannel > > & channelsList , const CGTeleport * obj ) ;
2015-12-02 21:01:43 +02:00
static std : : vector < ObjectInstanceID > getPassableExits ( CGameState * gs , const CGHeroInstance * h , std : : vector < ObjectInstanceID > exits ) ;
static bool isExitPassable ( CGameState * gs , const CGHeroInstance * h , const CGObjectInstance * obj ) ;
2015-03-08 15:11:23 +02:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-07-31 15:35:42 +02:00
h & type ;
h & channel ;
h & static_cast < CGObjectInstance & > ( * this ) ;
2015-03-08 15:11:23 +02:00
}
} ;
class DLL_LINKAGE CGMonolith : public CGTeleport
{
TeleportChannelID findMeChannel ( std : : vector < Obj > IDs , int SubID ) const ;
2015-12-02 21:01:43 +02:00
protected :
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2015-12-02 16:56:26 +02:00
void teleportDialogAnswered ( const CGHeroInstance * hero , ui32 answer , TTeleportExitsList exits ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
2015-12-02 21:01:43 +02:00
public :
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
2015-03-08 15:11:23 +02:00
h & static_cast < CGTeleport & > ( * this ) ;
}
} ;
class DLL_LINKAGE CGSubterraneanGate : public CGMonolith
{
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2015-12-02 21:01:43 +02:00
public :
2015-03-11 16:17:21 +02:00
static void postInit ( ) ;
2015-03-08 15:11:23 +02:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGMonolith & > ( * this ) ;
}
} ;
class DLL_LINKAGE CGWhirlpool : public CGMonolith
{
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2015-12-02 16:56:26 +02:00
void teleportDialogAnswered ( const CGHeroInstance * hero , ui32 answer , TTeleportExitsList exits ) const override ;
2015-03-08 15:11:23 +02:00
static bool isProtected ( const CGHeroInstance * h ) ;
2015-12-02 21:01:43 +02:00
public :
2015-03-08 15:11:23 +02:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGMonolith & > ( * this ) ;
2014-06-05 19:52:14 +03:00
}
} ;
class DLL_LINKAGE CGMagicWell : public CGObjectInstance //objects giving bonuses to luck/morale/movement
{
public :
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( const CGHeroInstance * hero ) const override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
}
} ;
class DLL_LINKAGE CGSirens : public CGObjectInstance
{
public :
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( const CGHeroInstance * hero ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
}
} ;
class DLL_LINKAGE CGObservatory : public CGObjectInstance //Redwood observatory
{
public :
void onHeroVisit ( const CGHeroInstance * h ) const override ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
}
} ;
class DLL_LINKAGE CGBoat : public CGObjectInstance
{
public :
ui8 direction ;
const CGHeroInstance * hero ; //hero on board
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
CGBoat ( )
{
hero = nullptr ;
direction = 4 ;
}
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-07-31 15:35:42 +02:00
h & static_cast < CGObjectInstance & > ( * this ) ;
h & direction ;
h & hero ;
2014-06-05 19:52:14 +03:00
}
} ;
class CGShipyard : public CGObjectInstance , public IShipyard
{
public :
2015-10-12 15:47:10 +02:00
void getOutOffsets ( std : : vector < int3 > & offsets ) const override ; //offsets to obj pos when we boat can be placed
2014-06-05 19:52:14 +03:00
CGShipyard ( ) ;
void onHeroVisit ( const CGHeroInstance * h ) const override ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
h & static_cast < IShipyard & > ( * this ) ;
}
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
class DLL_LINKAGE CGMagi : public CGObjectInstance
{
public :
static std : : map < si32 , std : : vector < ObjectInstanceID > > eyelist ; //[subID][id], supports multiple sets as in H5
2016-08-25 14:52:20 +02:00
static void reset ( ) ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-05 19:52:14 +03:00
void onHeroVisit ( const CGHeroInstance * h ) const override ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
}
} ;
2017-06-30 22:39:37 +02:00
class DLL_LINKAGE CCartographer : public CTeamVisited
2014-06-05 19:52:14 +03:00
{
///behaviour varies depending on surface and floor
public :
void onHeroVisit ( const CGHeroInstance * h ) const override ;
void blockingDialogAnswered ( const CGHeroInstance * hero , ui32 answer ) const override ;
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-06-30 22:39:37 +02:00
h & static_cast < CTeamVisited & > ( * this ) ;
2014-06-05 19:52:14 +03:00
}
} ;
class DLL_LINKAGE CGDenOfthieves : public CGObjectInstance
{
void onHeroVisit ( const CGHeroInstance * h ) const override ;
} ;
2017-06-30 22:39:37 +02:00
class DLL_LINKAGE CGObelisk : public CTeamVisited
2014-06-05 19:52:14 +03:00
{
public :
2016-01-29 19:21:19 +02:00
static const int OBJPROP_INC = 20 ;
2014-06-05 19:52:14 +03:00
static ui8 obeliskCount ; //how many obelisks are on map
static std : : map < TeamID , ui8 > visited ; //map: team_id => how many obelisks has been visited
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( PlayerColor player ) const override ;
2016-01-20 12:02:52 +02:00
static void reset ( ) ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
2017-06-30 22:39:37 +02:00
h & static_cast < CTeamVisited & > ( * this ) ;
2014-06-05 19:52:14 +03:00
}
protected :
void setPropertyDer ( ui8 what , ui32 val ) override ;
} ;
class DLL_LINKAGE CGLighthouse : public CGObjectInstance
{
public :
void onHeroVisit ( const CGHeroInstance * h ) const override ;
2016-09-09 19:30:36 +02:00
void initObj ( CRandomGenerator & rand ) override ;
2014-06-24 20:39:36 +03:00
std : : string getHoverText ( PlayerColor player ) const override ;
2014-06-05 19:52:14 +03:00
template < typename Handler > void serialize ( Handler & h , const int version )
{
h & static_cast < CGObjectInstance & > ( * this ) ;
}
2018-11-01 22:31:23 +02:00
void giveBonusTo ( PlayerColor player , bool onInit = false ) const ;
2015-11-16 15:30:40 +02:00
protected :
2016-02-22 01:37:19 +02:00
void serializeJsonOptions ( JsonSerializeFormat & handler ) override ;
2014-06-05 19:52:14 +03:00
} ;
2022-06-26 09:21:05 +02:00
class DLL_LINKAGE CGTerrainPatch : public CGObjectInstance
{
public :
CGTerrainPatch ( ) = default ;
virtual bool isTile2Terrain ( ) const override
{
return true ;
}
} ;