mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there. * Declared existing Entity APIs. * Added basic script context caching * Started Lua script module * Started Lua spell effect API * Started script state persistence * Started battle info callback binding * CommitPackage removed * Extracted spells::Caster to own header; Expanded Spell API. * implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C * !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented * Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key) * Re-enabled VERM macros. * !?GM0 added * !?TM implemented * Added !!MF:N * Started !?OB, !!BM, !!HE, !!OW, !!UN * Added basic support of w-variables * Added support for ERM indirect variables * Made !?FU regular trigger * !!re (ERA loop receiver) implemented * Fixed ERM receivers with zero args.
This commit is contained in:
@ -42,6 +42,43 @@ CSkill::~CSkill()
|
||||
{
|
||||
}
|
||||
|
||||
int32_t CSkill::getIndex() const
|
||||
{
|
||||
return id.num;
|
||||
}
|
||||
|
||||
int32_t CSkill::getIconIndex() const
|
||||
{
|
||||
return getIndex(); //TODO: actual value with skill level
|
||||
}
|
||||
|
||||
const std::string & CSkill::getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
const std::string & CSkill::getJsonKey() const
|
||||
{
|
||||
return identifier;
|
||||
}
|
||||
|
||||
void CSkill::registerIcons(const IconRegistar & cb) const
|
||||
{
|
||||
for(int level = 1; level <= 3; level++)
|
||||
{
|
||||
int frame = 2 + level + 3 * id;
|
||||
const LevelInfo & skillAtLevel = at(level);
|
||||
cb(frame, "SECSK32", skillAtLevel.iconSmall);
|
||||
cb(frame, "SECSKILL", skillAtLevel.iconMedium);
|
||||
cb(frame, "SECSK82", skillAtLevel.iconLarge);
|
||||
}
|
||||
}
|
||||
|
||||
SecondarySkill CSkill::getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
void CSkill::addNewBonus(const std::shared_ptr<Bonus> & b, int level)
|
||||
{
|
||||
b->source = Bonus::SECONDARY_SKILL;
|
||||
@ -86,6 +123,17 @@ std::string CSkill::toString() const
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void CSkill::updateFrom(const JsonNode & data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CSkill::serializeJson(JsonSerializeFormat & handler)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
///CSkillHandler
|
||||
CSkillHandler::CSkillHandler()
|
||||
{
|
||||
@ -147,7 +195,7 @@ const std::string & CSkillHandler::skillName(int skill) const
|
||||
return objects[skill]->name;
|
||||
}
|
||||
|
||||
CSkill * CSkillHandler::loadFromJson(const JsonNode & json, const std::string & identifier, size_t index)
|
||||
CSkill * CSkillHandler::loadFromJson(const std::string & scope, const JsonNode & json, const std::string & identifier, size_t index)
|
||||
{
|
||||
CSkill * skill = new CSkill(SecondarySkill((si32)index), identifier);
|
||||
|
||||
|
Reference in New Issue
Block a user