/*
    PROJECT Q IV
    (c) 2022 by Pstemarie

    Purple Worm OnCombatRoundEnd Event Script

        Handles the swallowing check

    Version: 1.0
    Created: 28 Jan 2003
    Author:  Lacero
    v1.1:    18 June 2022 Pstemarie - adapted for giant frogs

*/

#include "NW_I0_GENERIC"
#include "q_i0_giantfrog"

void main()
{
    if((GetCurrentHitPoints(GetAttackTarget())<GetLocalInt(OBJECT_SELF,"PW_DAMAGE")))
    {
        //the hit damaged them.  lets swallow them
        gf_Swallow(GetAttackTarget());
    }

    DeleteLocalInt(OBJECT_SELF,"PW_DAMAGE");
    gf_DetermineCombatRound();


    if(GetSpawnInCondition(NW_FLAG_END_COMBAT_ROUND_EVENT))
    {
        SignalEvent(OBJECT_SELF, EventUserDefined(1003));
    }
}
