Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
//============================================================================= // Projectile. // // A delayed-hit projectile moves around for some time after it is created. // An instant-hit projectile acts immediately. //============================================================================= class Projectile expands Actor abstract intrinsic; #exec Texture Import File=Textures\S_Camera.pcx Name=S_Camera Mips=Off Flags=2 //----------------------------------------------------------------------------- // Projectile variables. // Motion information. var() float Speed; // Initial speed of projectile. var() float MaxSpeed; // Limit on speed of projectile (0 means no limit) // Damage attributes. var() float Damage; var() int MomentumTransfer; // Momentum imparted by impacting projectile. // Projectile sound effects var() sound SpawnSound; // Sound made when projectile is spawned. var() sound ImpactSound; // Sound made when projectile hits something. var() sound MiscSound; // Miscellaneous Sound. var() float ExploWallOut; // distance to move explosions out from wall //============== // Encroachment function bool EncroachingOn( actor Other ) { if ( (Other.Brush != None) || (Brush(Other) != None) ) return true; return false; } //============== // Touching singular function Touch(Actor Other) { local actor HitActor; local vector HitLocation, HitNormal, TestLocation; if ( Other.IsA('BlockAll') ) { HitWall( Normal(Location - Other.Location), Other); return; } if ( Other.bProjTarget || (Other.bBlockActors && Other.bBlockPlayers) ) { //get exact hitlocation HitActor = Trace(HitLocation, HitNormal, Location, OldLocation, true); if (HitActor == Other) { if ( (Pawn(Other) != None) && !Pawn(Other).AdjustHitLocation(HitLocation, Velocity) ) return; ProcessTouch(Other, HitLocation); } else ProcessTouch(Other, Other.Location + Other.CollisionRadius * Normal(Location - Other.Location)); } } function ProcessTouch(Actor Other, Vector HitLocation) { //should be implemented in subclass } function HitWall (vector HitNormal, actor Wall) { if ( (Mover(Wall) != None) && Mover(Wall).bDamageTriggered ) Wall.TakeDamage( Damage, instigator, Location, MomentumTransfer * Normal(Velocity), ''); MakeNoise(1.0); Explode(Location + ExploWallOut * HitNormal, HitNormal); } function Explode(vector HitLocation, vector HitNormal) { Destroy(); } simulated final function RandSpin(float spinRate) { DesiredRotation = RotRand(); RotationRate.Yaw = spinRate * 2 *FRand() - spinRate; RotationRate.Pitch = spinRate * 2 *FRand() - spinRate; RotationRate.Roll = spinRate * 2 *FRand() - spinRate; } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |