Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

skaarjpack.Manta


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
//=============================================================================
// Manta.
//=============================================================================
class Manta extends Monster;

var bool bStinging;


simulated function PostBeginPlay()
{
	Super.PostBeginPlay();
	PlayAnim('Fly');
}

function SetMovementPhysics()
{
	SetPhysics(PHYS_Flying); 
	PlayAnim('Fly');
}

function WingBeat()
{
	PlaySound(sound'fly1m', SLOT_Interact);
}

simulated function AnimEnd(int Channel)
{
	local name Anim;
	local float frame,rate;
	local vector AccelDir;

	if ( bShotAnim )
		bShotAnim = false;
	if ( bVictoryNext && (Physics != PHYS_Falling) )
	{
		bVictoryNext = false;
		PlayVictory();
		return;
	}
	GetAnimParams(0, Anim,frame,rate);
	if ( Anim != 'Fly' )
		TweenAnim('Fly',0.4);
	else if ( (frame > 0.5) && (FRand() < 0.35) )
	{
		AccelDir = Normal(Acceleration);
		if ( AccelDir.Z > 0.5 )
			PlayAnim('Fly');
		else
			TweenAnim('Fly',0.8 + 2*FRand()+FRand());
	}
	else
		PlayAnim('Fly');
}

simulated function PlayDirectionalDeath(Vector HitLoc)
{
	PlayAnim('Death');
}

simulated function PlayDirectionalHit(Vector HitLoc)
{
	TweenAnim('TakeHit', 0.05);
}

function PlayVictory()
{
	SetAnimAction('Whip');
}

function RangedAttack(Actor A)
{
	if ( bShotAnim )
		return;
		
	if ( Location.Z - A.Location.Z + A.CollisionHeight <= 0 )
		return;
	if ( VSize(A.Location - Location) > MeleeRange + CollisionRadius + A.CollisionRadius - FMax(0, 0.7 * A.Velocity Dot Normal(A.Location - Location)) )
		return;
	bShotAnim = true;
	Acceleration = AccelRate * Normal(A.Location - Location + vect(0,0,0.8) * A.CollisionHeight);
	Enable('Bump');
	bStinging = true;
	if (FRand() < 0.5)
	{
		SetAnimAction('Sting');
		PlaySound(sound'whip1m', SLOT_Interact);	 		
	}
	else
	{
 		SetAnimAction('Whip');
 		PlaySound(sound'sting1m', SLOT_Interact); 
 	}	
 }

singular function Bump(actor Other)
{
	local name Anim;
	local float frame,rate;
	
	if ( bShotAnim && bStinging )
	{
		bStinging = false;
		GetAnimParams(0, Anim,frame,rate);
		if ( (Anim == 'Whip') || (Anim == 'Sting') )
			MeleeDamageTarget(18, (20000.0 * Normal(Controller.Target.Location - Location)));
		Velocity *= -0.5;
		Acceleration *= -1;
		if (Acceleration.Z < 0)
			Acceleration.Z *= -1;
	}		
	Super.Bump(Other);
}

defaultproperties
{
	bCanFly=true
	bCanStrafe=false
	bCanDodge=false
	bPhysicsAnimUpdate=false
     MeleeRange=+00200.000000
     WaterSpeed=+00300.000000
     AirSpeed=+00400.000000
     AccelRate=+0800.000000
     Mesh=Manta1
     Skins(0)=JManta1
     Skins(1)=JManta1
     CollisionRadius=+00025.000000
     CollisionHeight=+00012.000000
     Mass=+00080.000000
     Buoyancy=+00080.000000
     RotationRate=(Pitch=16384,Yaw=55000,Roll=15000)

     HitSound(0)=injur1m
     HitSound(1)=injur2m
     HitSound(2)=injur1m
     HitSound(3)=injur2m
     DeathSound(0)=Death2M
     DeathSound(1)=Death2M
     DeathSound(2)=Death2M
     DeathSound(3)=Death2M
     ChallengeSound(0)=call1M
     ChallengeSound(1)=call1M
     ChallengeSound(2)=call2M
     ChallengeSound(3)=call2M
     
    AirStillAnim=Fly
    AirAnims(0)=Fly
    AirAnims(1)=Fly
    AirAnims(2)=Fly
    AirAnims(3)=Fly
    TakeoffStillAnim=Fly
    TakeoffAnims(0)=Fly
    TakeoffAnims(1)=Fly
    TakeoffAnims(2)=Fly
    TakeoffAnims(3)=Fly
    MovementAnims(0)=Fly
    MovementAnims(1)=Fly
    MovementAnims(2)=Fly
    MovementAnims(3)=Fly
    
    WalkAnims(0)=Fly
    WalkAnims(1)=Fly
    WalkAnims(2)=Fly
    WalkAnims(3)=Fly

}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:31:54.000 - Creation time: Do 14.8.2014 09:58:44.024 - Created with UnCodeX