mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
* town visiting
* improvements in garrisons
This commit is contained in:
26
CLua.cpp
26
CLua.cpp
@@ -12,6 +12,7 @@
|
||||
#include "CGameState.h"
|
||||
#include <sstream>
|
||||
#include "hch/CObjectHandler.h"
|
||||
#include "hch/CTownHandler.h"
|
||||
#include "CCallback.h"
|
||||
#include "hch/CGeneralTextHandler.h"
|
||||
#include <sstream>
|
||||
@@ -589,4 +590,27 @@ std::vector<int> CPickable::yourObjects() //returns IDs of objects which are han
|
||||
ret.push_back(5); //artifact
|
||||
ret.push_back(101); //treasure chest / commander stone
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
void CTownScript::onHeroVisit(CGObjectInstance *os, int heroID)
|
||||
{
|
||||
cb->heroVisitCastle(os,heroID);
|
||||
}
|
||||
void CTownScript::onHeroLeave(CGObjectInstance *os, int heroID)
|
||||
{
|
||||
cb->stopHeroVisitCastle(os,heroID);
|
||||
}
|
||||
std::string CTownScript::hoverText(CGObjectInstance *os)
|
||||
{
|
||||
CGTownInstance * n;
|
||||
if(n = dynamic_cast<CGTownInstance*>(os))
|
||||
return n->name + ", " + n->town->name;
|
||||
else return "";
|
||||
}
|
||||
|
||||
std::vector<int> CTownScript::yourObjects() //returns IDs of objects which are handled by script
|
||||
{
|
||||
std::vector<int> ret(1);
|
||||
ret.push_back(98); //town
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user