// IW6 GSC SOURCE
// Generated by https://github.com/xensik/gsc-tool

main()
{
    init_fx();
}

init_fx()
{
    level._effect["vfx_scrnfx_alien_spitter_mist"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_alien_spitter_mist" );
    level._effect["vfx_scrnfx_alien_blood"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_alien_blood" );
    level._effect["vfx_scrnfx_tocam_slidedust_m"] = loadfx( "vfx/gameplay/screen_effects/vfx_scrnfx_tocam_slidedust_m" );
    level._effect["vfx_melee_blood_spray"] = loadfx( "vfx/gameplay/screen_effects/vfx_melee_blood_spray" );
    level._effect["vfx_blood_hit_left"] = loadfx( "vfx/gameplay/screen_effects/vfx_blood_hit_left" );
    level._effect["vfx_blood_hit_right"] = loadfx( "vfx/gameplay/screen_effects/vfx_blood_hit_right" );
    level._effect["vfx_alien_spitter_hit_left"] = loadfx( "vfx/gameplay/screen_effects/vfx_alien_spitter_hit_left" );
    level._effect["vfx_alien_spitter_hit_right"] = loadfx( "vfx/gameplay/screen_effects/vfx_alien_spitter_hit_right" );
    level._effect["vfx_alien_spitter_hit_center"] = loadfx( "vfx/gameplay/screen_effects/vfx_alien_spitter_hit_center" );
}

alien_fire_on()
{
    if ( !isdefined( self.is_burning ) )
        self.is_burning = 0;

    self.is_burning++;

    if ( self.is_burning == 1 )
        self setscriptablepartstate( "body", "burning" );
}

alien_fire_off()
{
    self.is_burning--;

    if ( self.is_burning > 0 )
        return;

    self.is_burning = undefined;
    self notify( "fire_off" );
    self setscriptablepartstate( "body", "normal" );
}

disable_fx_on_death()
{
    self setscriptablepartstate( "body", "normal" );
}

fx_stun_damage()
{
    if ( maps\mp\alien\_utility::get_alien_type() == "minion" )
        return;

    self endon( "death" );
    self setscriptablepartstate( "body", "shocked" );
    wait 0.5;

    if ( isalive( self ) )
        self setscriptablepartstate( "body", "normal" );
}

alien_cloak_fx_on()
{
    if ( !isdefined( self.is_cloaking ) )
        self.is_cloaking = 0;

    self playsound( "alien_teleport" );
    self.is_cloaking++;

    if ( self.is_cloaking == 1 )
        self setscriptablepartstate( "body", "normal" );
}

alien_cloak_fx_off()
{
    self.is_cloaking--;

    if ( self.is_cloaking > 0 )
        return;

    self playsound( "alien_teleport_appear" );
    self.is_cloaking = undefined;
    self setscriptablepartstate( "body", "normal" );
}
