コード例 #1
0
ファイル: character.cpp プロジェクト: Postremus/manaserv
void CharacterComponent::useSpecialOnBeing(Entity &user, int id, Entity *b)
{
    SpecialMap::iterator it = mSpecials.find(id);
    if (!specialUseCheck(it))
            return;
    SpecialValue &special = it->second;

    if (special.specialInfo->target != SpecialManager::TARGET_BEING)
        return;

    //tell script engine to cast the spell
    Script *script = ScriptManager::currentState();
    script->prepare(special.specialInfo->useCallback);
    script->push(&user);
    script->push(b);
    script->push(special.specialInfo->id);
    script->execute(user.getMap());
}
コード例 #2
0
ファイル: character.cpp プロジェクト: hanwujunlc/manaserv
void Character::useSpecialOnPoint(int id, int x, int y)
{
    SpecialMap::iterator it = mSpecials.find(id);
    if (!specialUseCheck(it))
            return;
    SpecialValue &special = it->second;

    if (special.specialInfo->target != SpecialManager::TARGET_POINT)
        return;

    //tell script engine to cast the spell
    Script *script = ScriptManager::currentState();
    script->prepare(special.specialInfo->useCallback);
    script->push(this);
    script->push(x);
    script->push(y);
    script->push(special.specialInfo->id);
    script->execute(getMap());
}