1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-05 15:05:40 +02:00
vcmi/scripting/lua/api/BonusSystem.h
AlexVinS ecaa9f5d0b 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.
2021-02-14 19:05:43 +03:00

76 lines
2.4 KiB
C++

/*
* BonusSystem.h, part of VCMI engine
*
* 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
*
*/
#pragma once
#include "../LuaWrapper.h"
class Bonus;
class BonusList;
class IBonusBearer;
namespace scripting
{
namespace api
{
class BonusProxy : public SharedWrapper<const Bonus, BonusProxy>
{
public:
using Wrapper = SharedWrapper<const Bonus, BonusProxy>;
static const std::vector<typename Wrapper::RegType> REGISTER;
static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
static int getType(lua_State * L, std::shared_ptr<const Bonus> object);
static int getSubtype(lua_State * L, std::shared_ptr<const Bonus> object);
static int getDuration(lua_State * L, std::shared_ptr<const Bonus> object);
static int getTurns(lua_State * L, std::shared_ptr<const Bonus> object);
static int getValueType(lua_State * L, std::shared_ptr<const Bonus> object);
static int getVal(lua_State * L, std::shared_ptr<const Bonus> object);
static int getSource(lua_State * L, std::shared_ptr<const Bonus> object);
static int getSourceID(lua_State * L, std::shared_ptr<const Bonus> object);
static int getDescription(lua_State * L, std::shared_ptr<const Bonus> object);
static int getEffectRange(lua_State * L, std::shared_ptr<const Bonus> object);
static int getStacking(lua_State * L, std::shared_ptr<const Bonus> object);
static int toJsonNode(lua_State * L, std::shared_ptr<const Bonus> object);
protected:
virtual void adjustStaticTable(lua_State * L) const override;
};
class BonusListProxy : public SharedWrapper<const BonusList, BonusListProxy>
{
public:
using Wrapper = SharedWrapper<const BonusList, BonusListProxy>;
static const std::vector<typename Wrapper::RegType> REGISTER;
static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
static int index(lua_State * L);
protected:
virtual void adjustMetatable(lua_State * L) const override;
};
class BonusBearerProxy : public OpaqueWrapper<const IBonusBearer, BonusBearerProxy>
{
public:
using Wrapper = OpaqueWrapper<const IBonusBearer, BonusBearerProxy>;
static int getBonuses(lua_State * L, const IBonusBearer * object);
static const std::vector<typename Wrapper::RegType> REGISTER;
static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
};
}
}