# SFCharacter.SFSkavLeader

00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 |
    //=============================================================================
    // Spatial Fear
    // Class: SFSkavLeader
    // Description:  Big SF enemy. Leader of a Skav team.
    //
    // Created by: Markus Nuebel
    //=============================================================================
    class SFSkavLeader expands SFSkav;

    #exec OBJ LOAD FILE=SPF-Content.uax  PACKAGE=SPF-Content GROUP=Creatures

    #exec MESH IMPORT MESH=SFSkavLeader ANIVFILE=MODELS\SFSkavLeader_a.3d DATAFILE=MODELS\SFSkavLeader_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFSkavLeader X=0 Y=0 Z=-63 YAW=64 ROLL=0 PITCH=0
    #exec MESH SCALE x=0.075 y=0.075 z=0.15

    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=All STARTFRAME=0 NUMFRAMES=349

    //Wait Animations
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Breath1 STARTFRAME=184 NUMFRAMES=10 RATE=10 Group=Waiting
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Breath2 STARTFRAME=200 NUMFRAMES=10 RATE=10 Group=Waiting
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Breath3 STARTFRAME=270 NUMFRAMES=10 RATE=15 Group=Waiting
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Look STARTFRAME=23 NUMFRAMES=20 RATE=15 Group=Waiting
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Fighter STARTFRAME=1 NUMFRAMES=1

    //Movement Animations
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Run STARTFRAME=44 NUMFRAMES=20 RATE=30
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Walk STARTFRAME=2 NUMFRAMES=20 RATE=20
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Turn STARTFRAME=2 NUMFRAMES=2 RATE=15
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=StrafeL STARTFRAME=120 NUMFRAMES=20 RATE=30 Group=MovingFire
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=StrafeR STARTFRAME=100 NUMFRAMES=20 RATE=30 Group=MovingFire
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Jump STARTFRAME=306 NUMFRAMES=1 Group=Jumping // New Frame
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Land STARTFRAME=307 NUMFRAMES=1 Group=Landing // New Frame

    //Attack Animations
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Shoot STARTFRAME=296 NUMFRAMES=10 RATE=20 Group=Shooting// Changed frames
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Shoot2 STARTFRAME=270 NUMFRAMES=10 RATE=15 Group=Shooting // New animation
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Shoot3 STARTFRAME=334 NUMFRAMES=10 RATE=15 Group=Shooting // New animation

    //Special Animations
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Roar STARTFRAME=230 NUMFRAMES=20 RATE=20

    //Take Hit Animations
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=HeadHit STARTFRAME=319 NUMFRAMES=1 Group=TakeHit // Changed Frame
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=GutHit STARTFRAME=74 NUMFRAMES=1 Group=TakeHit
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=LeftHit STARTFRAME=140 NUMFRAMES=1 Group=TakeHit
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=RightHit STARTFRAME=158 NUMFRAMES=1 Group=TakeHit

    //Death Animations
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Dead1 STARTFRAME=64 NUMFRAMES=15 RATE=20 Group=TakeHit
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Dead2 STARTFRAME=210 NUMFRAMES=20 RATE=20
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Dead3 STARTFRAME=79 NUMFRAMES=15 RATE=20
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Dead4 STARTFRAME=250 NUMFRAMES=20 RATE=20
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=Dead5 STARTFRAME=319 NUMFRAMES=10 RATE=10 // New animation

    //Body frames.  Used for corpses.
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=DeathEnd STARTFRAME=78 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=DeathEnd2 STARTFRAME=99 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFSkavLeader SEQ=DeathEnd3 STARTFRAME=229 NUMFRAMES=1

    #exec MESHMAP NEW MESHMAP=SFSkavLeader MESH=SFSkavLeader
    #exec MESHMAP SCALE MESHMAP=SFSkavLeader X=0.1 Y=0.1 Z=0.2

    #exec TEXTURE IMPORT NAME=SkaL1 FILE=Textures\SkavLeaderChest.pcx GROUP=Skins FLAGS=2
    #exec TEXTURE IMPORT NAME=SkaL1 FILE=Textures\SkavLeaderChest.pcx GROUP=Skins PALETTE=SkaL1
    #exec MESHMAP SETTEXTURE MESHMAP=SFSkavLeader NUM=1 TEXTURE=SkaL1

    #exec TEXTURE IMPORT NAME=SkaL2 FILE=Textures\SkavLeaderFace.pcx GROUP=Skins FLAGS=2
    #exec TEXTURE IMPORT NAME=SkaL2 FILE=Textures\SkavLeaderFace.pcx GROUP=Skins PALETTE=SkaL2
    #exec MESHMAP SETTEXTURE MESHMAP=SFSkavLeader NUM=2 TEXTURE=SkaL2

    #exec TEXTURE IMPORT NAME=SkaL3 FILE=Textures\SkavLeaderLegs.pcx GROUP=Skins FLAGS=2
    #exec TEXTURE IMPORT NAME=SkaL3 FILE=Textures\SkavLeaderLegs.pcx GROUP=Skins PALETTE=SkaL3
    #exec MESHMAP SETTEXTURE MESHMAP=SFSkavLeader NUM=3 TEXTURE=SkaL3

    #exec TEXTURE IMPORT NAME=SkaL4 FILE=Textures\SkavLeaderButt.pcx GROUP=Skins FLAGS=2
    #exec TEXTURE IMPORT NAME=SkaL4 FILE=Textures\SkavLeaderButt.pcx GROUP=Skins PALETTE=SkaL4
    #exec MESHMAP SETTEXTURE MESHMAP=SFSkavLeader NUM=4 TEXTURE=SkaL4

    #exec AUDIO IMPORT FILE="Sounds\Skav\SkavSwipe2.wav"			NAME=Roam PACKAGE=SFCharacter GROUP=SkavLeader
    #exec AUDIO IMPORT FILE="Sounds\Skav\SkavRoar2.wav"			NAME=Roar PACKAGE=SFCharacter GROUP=SkavLeader

    function PlayRunning()
    {
    	bFire = 0;
    	bAltFire = 0;

    	PlaySound(RunSound, SLOT_Interact);
    	LoopAnim('Run', -1.35f/GroundSpeed,0.1,0.4);

    	// No call to base, since skav leader does not have Run2
    }

    function PlayRangedAttack()
    {
    	PlayFiring();
    }

    function PlayFiring()
    {
    	local float	fDecision;
    	local name	nameAnim;

    	fDecision	= FRand();
    	if(fDecision < 0.5)
    		nameAnim	= 'Shoot';
    	else if (fDecision < 0.9)
    		nameAnim	= 'Shoot2';
    	else
    		nameAnim	= 'Shoot3';

    	PlayAnim(nameAnim, 1.7, 0.3);

    	if ( (Weapon != None) && (Weapon.AmmoType != None) )
    		Weapon.AmmoType.AmmoAmount = Weapon.AmmoType.Default.AmmoAmount;
    }

    state TakeHit
    {
    ignores seeplayer, hearnoise, bump, hitwall;

    	function BeginState()
    	{
    		bFire = 0;
    		bAltFire = 0;
    		Super.BeginState();
    	}
    }

    state Retreating
    {
    ignores SeePlayer, EnemyNotVisible, HearNoise;

    	function EndState()
    	{
    		bFire = 0;
    		bAltFire = 0;
    		Super.EndState();
    	}
    }

    state Charging
    {
    ignores SeePlayer, HearNoise;

    	function EndState()
    	{
    		bFire = 0;
    		bAltFire = 0;
    		Super.EndState();
    	}
    }

    state TacticalMove
    {
    ignores SeePlayer, HearNoise;

    	function EndState()
    	{
    		bFire = 0;
    		bAltFire = 0;
    		Super.EndState();
    	}
    }

    state Hunting
    {
    ignores EnemyNotVisible;

    	function EndState()
    	{
    		bFire = 0;
    		bAltFire = 0;
    		if ( !Region.Zone.bWaterZone )
    			bCanSwim = false;
    		Super.EndState();
    	}
    }

    function FireWeapon()
    {
    	local float rating;
    	local int bUseAltMode;
    	if( Weapon!=None )
    	{
    		Weapon.RateSelf(bUseAltMode);
    		ViewRotation = Rotation;
    		if ( bUseAltMode > 0 )
    		{
    			bFire = 0;
    			bAltFire = 1;
    			Weapon.AltFire(1.0);
    		}
    		else
    		{
    			bFire = 1;
    			bAltFire = 0;
    			Weapon.Fire(1.0);
    		}
    		PlayFiring();
    	}
    }

    state RangedAttack
    {
    	function PlayRangedAttack()
    	{
    		local float dist;
    		Disable('Bump');
    		FireWeapon();
    	}

    	function AnimEnd()
    	{
    		if ( (FRand() < 0.5) || ((bFire == 0) && (bAltFire == 0)) )
    			GotoState('RangedAttack', 'DoneFiring');
    		else
    			TweenAnim('Shoot', 0.2);
    	}

    	function EndState()
    	{
    		bFire = 0;
    		bAltFire = 0;
    		Super.EndState();
    	}

    }

    function PlayMeleeAttack()
    {
    	//log("play melee attack");
    	Acceleration = AccelRate * VRand();
    	TweenToWaiting(0.15);
    	FireWeapon();
    }

    defaultproperties
    {
         SmellRadius=1700.000000
         fMeleeDamage=28.000000
         WeaponType=Class'SFWeapon.SFAlien'
         fStunnedTime=3.000000
         TimeBetweenAttacks=0.200000
         bHasRangedAttack=True
         bCanFire=True
         Roam=Sound'SPF-Content.Creatures.SkavLeaderSwipe'
         Threaten=Sound'SPF-Content.Creatures.SkavLeaderRoar'
         GroundSpeed=200.000000
         AccelRate=800.000000
         Health=350
         Skill=1.800000
         CombatStyle=0.900000
         Mesh=LodMesh'SFCharacter.SFSkavLeader'
         Mass=110.000000
         RotationRate=(Pitch=3072,Yaw=60000,Roll=2048)
    }

class file time: 12/7/2003 3:58:26 PM - creation time: 12/7/2003 4:03:45 PM
Created with UnCodeX