//
// Copyright(C) 2014-2015 Samuel Villarreal
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//      Sandworm Script Object Class
//

#include "scripts/common.txt"

//-----------------------------------------------------------------------------
//
// Sandworm
//
//-----------------------------------------------------------------------------

/*
==============================================================
TurokSandWorm
==============================================================
*/

final class TurokSandWorm : TurokEnemy
{
    TurokSandWorm(kActor @actor)
    {
        super(actor);
    }
    
    /*
    ==============================================================
    SpitAcid
    ==============================================================
    */
    
    void SpitAcid(kActor @instigator, const float w, const float x, const float y, const float z)
    {
        if(self.GetTarget() is null)
        {
            return;
        }
        
        self.SpawnProjectile("fx/acidspit.kfx", kVec3(x, y, z),
            self.GetTarget().Origin(), Math::Deg2Rad(45.0f));
    }
    
    /*
    ==============================================================
    DeathSound
    ==============================================================
    */
    
    void DeathSound(kActor @instigator, const float w, const float x, const float y, const float z)
    {
        self.PlaySound("sounds/shaders/subterranean_death.ksnd");
    }
    
    /*
    ==============================================================
    InjurySound
    ==============================================================
    */
    
    void InjurySound(kActor @instigator, const float w, const float x, const float y, const float z)
    {
        self.PlaySound("sounds/shaders/subterranean_scream.ksnd");
    }
    
    /*
    ==============================================================
    ViolentSound
    ==============================================================
    */
    
    void ViolentSound(kActor @instigator, const float w, const float x, const float y, const float z)
    {
        self.PlaySound("sounds/shaders/subterranean_violent_death.ksnd");
    }
}
