Merge branch 'new_features'

feature/prepare-cross-merge
Nuno 4 years ago committed by kaetemi
parent ca042995c0
commit 9b5a4d94cf
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -1828,6 +1828,25 @@ void addHP_f_(CStateInstance* entity, CScriptStack& stack)
}
}
void giveHP_f_(CStateInstance* entity, CScriptStack& stack)
{
float addHP = stack.top();
stack.pop();
CChangeCreatureHPMsg& msgList = CAIS::instance().getCreatureChangeHP();
FOREACH(bot, CCont<CBot>, entity->getGroup()->bots())
{
if (!bot->isSpawned())
continue;
CSpawnBot* const sbot = bot->getSpawnObj();
msgList.Entities.push_back(sbot->dataSetRow());
msgList.DeltaHp.push_back((sint32)(addHP));
}
}
//----------------------------------------------------------------------------
/** @page code
@ -4797,6 +4816,7 @@ std::map<std::string, FScrptNativeFunc> nfGetGroupNativeFunctions()
REGISTER_NATIVE_FUNC(functions, downScaleHP_f_);
REGISTER_NATIVE_FUNC(functions, upScaleHP_f_);
REGISTER_NATIVE_FUNC(functions, addHP_f_);
REGISTER_NATIVE_FUNC(functions, giveHP_f_);
REGISTER_NATIVE_FUNC(functions, aiAction_s_);
REGISTER_NATIVE_FUNC(functions, aiActionSelf_s_);
REGISTER_NATIVE_FUNC(functions, addProfileParameter_s_);

Loading…
Cancel
Save