# SFCharacter.SFMonsterMite

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 |
    //=============================================================================
    // Spatial Fear
    // Class: SFMonsterMite
    // Description:  The monster version of the SFMite. Larger and stronger.
    //
    // Author: Markus Nuebel
    // Modified by: Chris Rogers
    //=============================================================================
    class SFMonsterMite expands SFMite;

    #exec TEXTURE IMPORT NAME=MonsterMite1 FILE=Textures\MiteBoss1.pcx GROUP=Skins FLAGS=2 LODSET=0
    #exec TEXTURE IMPORT NAME=MonsterMite1 FILE=Textures\MiteBoss1.pcx GROUP=Skins PALETTE=Mite1

    var int		m_nFireDelayed;
    var float	m_fEggInterval;
    var float	m_fReFireDelay;
    var 	float	fInterval; // Interval to crack and give birth to a baby mite
    var 	float	fEggInterval; // Egg interval to crack and give birth to a baby mite

    // Overwritten to increase the momentum, mite is a light enemy
    function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation,
    						Vector momentum, name damageType)
    {
    	local float	fHealthLevel;

    	fHealthLevel	= 1.0f - (float(Health) /float(Default.Health)*0.9f);

    	Damage = Damage*fHealthLevel;

    	// Call to base class
    	Super.TakeDamage(Damage, instigatedBy, hitlocation, momentum*0.7, damageType);
    }

    function PlayRangedAttack()
    {
    	PlayAnim('Roar', 2.2, 0.2);
    	m_nFireDelayed	= 2;
    	m_fFireDelay	= Default.m_fFireDelay;
    }

    function PlayMeleeAttack()
    {
    	// Calculate momentum
    	m_vectMeleeMomentum	= 8000 * (Normal(Target.Location - Location));
    	// Call base class
    	Super.PlayMeleeAttack();
    }

    function Tick(float fDelta)
    {
    	local vector projStart;
    	local Vector vecStart,X,Y,Z;

    	// Call to base class
    	Super.Tick(fDelta);
    /*
    	if(m_fEggInterval > 0)
    	{
    		m_fEggInterval -= fDelta;
    		if(m_fEggInterval <= 0)
    		{
    			GiveBirthToChildren();
    			m_fEggInterval	= fInterval;
    		}
    	}
    */
    	if(m_nFireDelayed<=0)
    		return;

    	// Count down
    	m_fFireDelay -= fDelta;

    	if(m_fFireDelay<0)
    	{
    		if(!IsInState('Dying'))
    		{
    			// Extract the axis from the rotation
    			GetAxes(Self.Rotation,X,Y,Z);

    			MakeNoise(1.0);
    			projStart = Location + CollisionHeight * vect(0,0,0.5) + CollisionRadius*0.25*X;
    			Projectile(spawn(RangedProjectile ,self,'',projStart,AdjustAim(ProjectileSpeed, projStart, 900, bLeadTarget, bWarnTarget)));
    			m_fFireDelay	= Default.m_fReFireDelay;

    		}

    		m_nFireDelayed--;
    	}

    }

    /*
    function Trigger( actor Other, pawn EventInstigator )
    {
    	// Call to base class
    	Super.Trigger(Other, EventInstigator);
    	// Activate egg production
    	m_fEggInterval	= fInterval;
    }
    */

    function GiveBirthToChildren()
    {
    	local SFMiteEgg	oEgg;
    	local Vector vecSpawnPoint, vecTracePoint;
    	local Vector X,Y,Z;
    	local vector HitLocation, HitNormal;
    	local actor HitActor;
    	local float fRandom;

    	GetAxes(Self.Rotation,X,Y,Z);

    	fRandom	= FRand();
    	vecSpawnPoint	= Location - (CollisionRadius + 6.0f)*X + fRandom*X + fRandom*Y;
    	vecTracePoint	= vecSpawnPoint - 6.0f*X;
    	HitActor = Trace(HitLocation, HitNormal, vecTracePoint, (Location - CollisionRadius*X));
    	if(None == HitActor)
    	{
    		oEgg			= spawn(class'SFMiteEgg',self,,vecSpawnPoint);

    		if(None != oEgg)
    		{
    			oEgg.fInterval	= fEggInterval;
    			oEgg.SetRotation(rotator(fRandom*vect(1,1,1)));
    			oEgg.Trigger(Self, Self);
    		}
    	}
    }

    defaultproperties
    {
         m_fEggInterval=-1.000000
         m_fReFireDelay=0.100000
         fInterval=1.000000
         fEggInterval=30.000000
         ChewSound=Sound'UnrealShare.Skaarj.spin1s'
         WalkSound=None
         RunSound=Sound'UnrealI.Titan.step1t'
         fMeleeDamage=35.000000
         fStunnedTime=2.000000
         TimeBetweenAttacks=0.300000
         RefireRate=0.500000
         RangedProjectile=Class'SFCharacter.SFMonsterMiteProjectile'
         ProjectileSpeed=30.000000
         Acquire=Sound'UnrealI.Titan.fall1Ti'
         Fear=Sound'UnrealI.Titan.injur1t'
         Roam=Sound'UnrealShare.Skaarj.roam11s'
         Threaten=Sound'UnrealI.Titan.yell1t'
         MeleeRange=40.000000
         GroundSpeed=410.000000
         WaterSpeed=200.000000
         AirSpeed=320.000000
         AccelRate=200.000000
         JumpZ=1.000000
         SightRadius=800.000000
         Health=750
         Intelligence=BRAINS_REPTILE
         Skill=4.000000
         HitSound1=Sound'UnrealI.Titan.injur2t'
         HitSound2=Sound'UnrealI.Titan.injur1t'
         Die=Sound'UnrealI.Titan.death1t'
         DrawScale=4.000000
         MultiSkins(1)=Texture'SFCharacter.NewSkins.miteab1'
         CollisionRadius=120.000000
         CollisionHeight=65.000000
         Mass=1000.000000
         RotationRate=(Pitch=2072,Yaw=55000)
    }

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