Ejemplo n.º 1
0
	void OnDamageTaken(Unit* mAttacker, float fAmount)
    {
        if(fAmount < 5) return;
        // <50% hp -> We go to phase 1
        if(_unit->GetHealthPct() <= 50 && mPhase == 0) {
            ChangeToPhase1();
        }
    }
Ejemplo n.º 2
0
    void OnDamageTaken(Unit* mAttacker, float fAmount)
    {
        if(fAmount < 5) return;

        // <100% hp -> We go to phase 1
        if(_unit->GetHealthPct() <= 100 && mPhase == 0) {
            ChangeToPhase1();
        }

        // <67% hp -> We go to phase 2
        if(_unit->GetHealthPct() <= 67 && mPhase == 1) {
            ChangeToPhase2();
        }

        // <34% hp -> We go to phase 3
        if(_unit->GetHealthPct() <= 34 && mPhase == 2) {
            ChangeToPhase3();
        }
    }