Skip to content

Commit

Permalink
Add isRewardBoss to lua. (#49)
Browse files Browse the repository at this point in the history
Add isRewardBoss to lua
  • Loading branch information
LuanGP authored Jan 7, 2025
1 parent 42b1ea9 commit 61f3e27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/luascript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3010,6 +3010,7 @@ void LuaScriptInterface::registerFunctions()
registerMetaMethod("MonsterType", "__eq", LuaScriptInterface::luaUserdataCompare);

registerMethod("MonsterType", "isAttackable", LuaScriptInterface::luaMonsterTypeIsAttackable);
registerMethod("MonsterType", "isRewardBoss", LuaScriptInterface::luaMonsterTypeIsRewardBoss);
registerMethod("MonsterType", "isChallengeable", LuaScriptInterface::luaMonsterTypeIsChallengeable);
registerMethod("MonsterType", "isConvinceable", LuaScriptInterface::luaMonsterTypeIsConvinceable);
registerMethod("MonsterType", "isSummonable", LuaScriptInterface::luaMonsterTypeIsSummonable);
Expand Down Expand Up @@ -14729,6 +14730,18 @@ int LuaScriptInterface::luaMonsterTypeIsAttackable(lua_State* L)
return 1;
}

int LuaScriptInterface::luaMonsterTypeIsRewardBoss(lua_State* L)
{
// lua monsterType:isRewardBoss()
MonsterType* monsterType = getUserdata<MonsterType>(L, 1);
if (monsterType) {
pushBoolean(L, monsterType->info.isRewardBoss);
} else {
lua_pushnil(L);
}
return 1;
}

int LuaScriptInterface::luaMonsterTypeIsChallengeable(lua_State* L)
{
// get: monsterType:isChallengeable() set: monsterType:isChallengeable(bool)
Expand Down
1 change: 1 addition & 0 deletions src/luascript.h
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,7 @@ class LuaScriptInterface
static int luaMonsterTypeCreate(lua_State* L);

static int luaMonsterTypeIsAttackable(lua_State* L);
static int luaMonsterTypeIsRewardBoss(lua_State* L);
static int luaMonsterTypeIsChallengeable(lua_State* L);
static int luaMonsterTypeIsConvinceable(lua_State* L);
static int luaMonsterTypeIsSummonable(lua_State* L);
Expand Down

0 comments on commit 61f3e27

Please sign in to comment.