// 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:
//      Weapon Actions
//
//
// Copyright(C) 2015-2016 Snake Plissken
//
// This mod 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. But
// but modifying before redistribution requires you to pay homage
// to SnakePlisskenPMW
// This Mod is distributed in the hope that it will be useful,
// and fun, and should be considered a attempt to keep you playing
// Turok forever more...
// 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.
// self.FireProjectile( "fx/laserSight.kfx", 5.12f+10.35f, -29.69f, -2.584f-11.35f);
// DESCRIPTION:
//      Pure awsomeness
//

#include "scripts/animations.txt"

/*
==============================================================
SnakePistolupgrade
==============================================================
*/

final class TurokPistolupgrade : TurokWeapon
{    
    TurokPistolupgrade(kWeapon @actor)
    {
        super(actor);
    }
    
	
    void OnTick(void)
    {
		self.FireProjectile( "fx/Viniciuslaser.kfx", 6.656f-0.5f, -2.69f, -4.78f-7.5f, true);
                self.FireProjectile( "fx/Viniciuslaser.kfx", 6.656f-0.5f, -2.69f, -4.78f-7.5f, true);
                self.FireProjectile( "fx/Viniciuslaser.kfx", 6.656f-0.5f, -2.69f, -4.78f-7.5f, true);
    }

    void OnSpawn(void)
    {
    }

    void OnFire(void)
    {
    }
    
    void OnEndFire(void)
    {
    }
    
    void OnLower(void)
    {
    }

    void OnRaise(void)
    {
    }

    void OnHoldster(void)
    {
    }

    /*
    ==============================================================
    OnBeginFire
    ==============================================================
    */
    
    void OnBeginFire(void)
    {
        self.FireProjectile("fx/bullet_shell.kfx", 10.24f, 27.64f, -10.24f, true);
        self.FireProjectile("fx/weffect_pistol.kfx", 6.656f-0.5f, 29.69f, -3.58f-0.5f, true);
        self.FireProjectile("fx/bullet.kfx", 13.107f, 25.6f, -10.24f);
            
        self.PlaySound("sounds/shaders/pistol_shot.ksnd");
        self.AnimState().Set(anim_weaponFire, 4.0f, 0);
        
        self.RunFxEvent("GunFire");
        
        self.Owner().Actor().LoudNoiseAlert();
        self.Owner().Actor().RecoilPitch() = -0.02094395086169243f;
        self.Owner().ConsumeAmmo(1);
    }
}
