コード例 #1
0
ファイル: ThreatManager.cpp プロジェクト: Artea/mangos-svn
HostilReference* ThreatContainer::modifyThreatPercent(Unit *pVictim, int32 pPercent)
{
    HostilReference* ref = getReferenceByTarget(pVictim);
    assert(ref);                                            // for a modification the reference must be there. (or not?)
    ref->addThreatPercent(pPercent);
    return ref;
}
コード例 #2
0
HostileReference* ThreatContainer::addThreat(Unit* pVictim, float pThreat)
{
    HostileReference* ref = getReferenceByTarget(pVictim);
    if (ref)
        ref->addThreat(pThreat);
    return ref;
}
コード例 #3
0
void ThreatContainer::modifyThreatPercent(Unit* victim, int32 percent)
{

    if (HostileReference* ref = getReferenceByTarget(victim))
        ref->addThreatPercent(percent);

}
コード例 #4
0
void ThreatContainer::modifyThreatPercent(Unit* pVictim, int32 pPercent)
{
    if (HostileReference* ref = getReferenceByTarget(pVictim))
    {
        if (pPercent < -100)
        {
            ref->removeReference();
            delete ref;
        }
        else
            ref->addThreatPercent(pPercent);
    }
}