SFCharacter4.SFReaverKiller

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
//=============================================================================
// Spatial Fear
// Class: SFReaverKiller
// Description: Reaver variant.  This one is intelligent, can jump, and attacks in packs.
//
// Author: Chris Rogers
//=============================================================================
Class SFReaverKiller extends SFReaver;

#exec TEXTURE IMPORT NAME=reaverx1 FILE=Skins\reaverx1.pcx GROUP="Skins" MIPS=ON
#exec TEXTURE IMPORT NAME=reaverx2 FILE=Skins\reaverx2.pcx GROUP="Skins" MIPS=ON
#exec TEXTURE IMPORT NAME=reaverx3 FILE=Skins\reaverx3.pcx GROUP="Skins" MIPS=ON

var (SpatialFear) float LeapDamage;
var bool AttackSuccess;

//=============================================================================
// General Functions

// Overwritten because the killer is friendly to all non-players and NPCs
function eAttitude AttitudeToCreature(Pawn Other)
{
	local float fDecision;

	if ( Other.IsA('SFScientist') || Other.IsA('SFMaleOfficer') || Other.IsA('SFFemaleOfficer') )
	{
		if (FRand() < 0.5)
			return ATTITUDE_Hate;
		else
			return ATTITUDE_Frenzy;
	}

	// Check the global attitude flag
	if(!bFightOtherCreatures)
		return ATTITUDE_FRIENDLY;

	if ( Other.IsA('SFReaver') || Other.IsA('SFReaverAssassin') )
	{
		return ATTITUDE_Ignore;
	}
	else
		if(ScriptedPawn(Other).Aggressiveness > Aggressiveness)
		{
			if(FRand() < 0.1)
				return ATTITUDE_Threaten;
			else
				return ATTITUDE_Ignore;
		}
		else
		{
			if(FRand() < 0.05)
				return ATTITUDE_Threaten;
			else
				return ATTITUDE_Ignore;
		}
}

function PlayInAir()
{
	TweenAnim('Leap',0.4);
}

function PlayLanded(float impactVel)
{
	local float dist;

	dist = VSize(Target.Location - Location);
	if (dist < CollisionRadius + Target.CollisionRadius + 10)
	{
		m_nameRestoreState	= GetStateName();
		m_vectPushDir		= 45000 * (Normal(Target.Location - Location));
		m_fAttackWait		= 0.15;
		fAttackDamage		= 35;
		TweenAnim('LeapHit', 0.1);
		GotoState('Hitting');
	} else {
		TweenAnim('LeapMiss', 0.1);
	}
}


//=============================================================================
// States

/*
state RangedAttack
{
ignores SeePlayer, HearNoise;
	
	function Bump (Actor Other)
	{
		if ( AttackSuccess || (AnimSequence != 'Leap') )
		{
			Disable('Bump');
			return;
		}
		else		
			LungeDamageTarget();

		if (!AttackSuccess && Pawn(Other) != None) //always add momentum
			Pawn(Other).AddVelocity((60000.0 * (Normal(Other.Location - Location)))/Other.Mass);
	}
	
	function LungeDamageTarget()
	{
		If (MeleeDamageTarget(LeapDamage, (LeapDamage * 2000 * Normal(Target.Location - Location))))
		{
			AttackSuccess = true;
			disable('Bump');
		}
	}
	
	function PlayRangedAttack()
	{
		local float dist, decision;

		decision = 1.0;
		dist = VSize(Target.Location - Location);
		if (dist > CollisionRadius + Target.CollisionRadius + 100)
			decision = FRand();

		if (Physics == PHYS_Falling)
			decision = 1.0;
		if (Target == None)
			decision = 1.0;

		if (decision < 0.35)
		{
			// Jump at them
			PlayAnim('LeapBegin');
			PlaySound(Threaten, SLOT_Interact);
			Velocity = 500 * Normal(Target.Location + Target.CollisionHeight * vect(0,0,0.75) - Location);
			if (dist > CollisionRadius + Target.CollisionRadius + 35)
			Velocity.Z += FMax(dist/2, JumpZ);
			SetPhysics(PHYS_Falling);
			Enable('Bump');
			PlayInAir();
		} else {
			Super.PlayRangedAttack();
		}
	}
}
*/

defaultproperties
{
     LeapDamage=35.000000
     WalkSound=None
     fMeleeDamage=18.000000
     bFightOtherCreatures=True
     Acquire=None
     Fear=None
     Roam=None
     Threaten=None
     bCanJump=True
     GroundSpeed=700.000000
     AccelRate=700.000000
     JumpZ=50.000000
     Health=270
     HitSound1=None
     HitSound2=None
     Die=None
     MultiSkins(0)=Texture'SFCharacter4.Skins.reaverx1'
     MultiSkins(1)=Texture'SFCharacter4.Skins.reaverx2'
     MultiSkins(2)=Texture'SFCharacter4.Skins.reaverx3'
}

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