ACTION gun1
{
MY.__ROTATE = ON; // gun rotates before being picked up
MY.__REPEAT = ON; // repeats (Auto-fire)
MY.__BOB = ON; // 'bobs' when the player moves
MY.SKILL1 = 32; // x,y,z pos of the gun
MY.SKILL2 = 15;
MY.SKILL3 = 15;
MY._AMMOTYPE = 1.250;
MY._WEAPONNUMBER = 1; // weapon number (press 3 to equip)
MY._BULLETSPEED = 1000.5; // bulletspeed '.' recoil
MY._FIRETIME = 2; // time to cycle (reload)
MY._FIREMODE = DAMAGE_SHOOT + HIT_FLASH + HIT_SMOKE + FIRE_PARTICLE + 0.2 + HIT_HOLE;
gun();
_gun_anim();
}
/////////////////////////////////////////////var weapon_delay = 1; // pause between animation cycles
var anim_shoot_ticks = 15; // time for one standing anim cycle 16
STRING anim_shoot_str,"shoot";
function _gun_anim () // CALL this from within your standard gun action
{
while(1)
{
if(KEY_CTRL | | MOUSE_LEFT == 1)
{
MY._ANIMDIST += TIME;
if(MY._ANIMDIST > anim_shoot_ticks)
{
MY._ANIMDIST -= anim_shoot_ticks;
}
temp = 100 * MY._ANIMDIST / anim_shoot_ticks;
ent_cycle(anim_shoot_str,temp); }
WAITT weapon_delay;
}
}