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 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 |
class ArcProjectile extends ExplosiveProjectile; var bool bReadyToExplode; var() float FuseTimer; var() float BounceVelocityModifier; var() float noBounceVelocityThreshold; var() bool bExplodeInAir; var bool bShouldBounce; // The projectile can't bounce off the instigator until after the first bounce. // This stops the projectile bouncing off the instigator when first fired. var int lastCatapultHitTick; // construct overloaded function construct(Rook attacker, optional actor Owner, optional name Tag, optional vector Location, optional rotator Rotation) { bReadyToExplode = false; bShouldBounce = false; super.construct(attacker, Owner, Tag, Location, Rotation); } simulated function PostNetBeginPlay() { Super.PostNetBeginPlay(); if (FuseTimer > 0.0) SetTimer(FuseTimer, false); //how long it takes for the fuse to burn out else bReadyToExplode = true; } simulated function Tick(float Delta) { super.Tick(Delta); SetRotation(Rotator(Velocity)); } simulated function Timer() { bReadyToExplode = true; bShouldBounce = true; if (bExplodeInAir) endLife(None, Location); } simulated function bool ShouldHit(Actor Other, vector TouchLocation) { return !ClientDetectDeflection(Other, TouchLocation) && Other.ShouldProjectileHit(Instigator) && (Other != Instigator || bShouldBounce); } simulated function bool projectileTouchProcessing(Actor Other, vector TouchLocation, vector TouchNormal) { if (Other.IsA('Catapult')) { // move to projectile touch location and trigger catapult Move(TouchLocation - Location); Catapult(Other).TouchProcessing(self); lastCatapultHitTick = LastTick; return false; } return true; } simulated function Vector CalcBounceVelocity(Vector HitNormal) { return VSize(Velocity) * BounceVelocityModifier * MirrorVectorByNormal(Normal(Velocity), HitNormal); } // Touch simulated function ProjectileHit(Actor Other, vector TouchLocation, vector TouchNormal) { if (bReadyToExplode) { endLife(Other, TouchLocation, TouchNormal); } else if (Other != Instigator || bShouldBounce) { bShouldBounce = true; Velocity = CalcBounceVelocity(TouchNormal); } } simulated function HitWall (vector HitNormal, actor Wall) { // do not bounce off catapults // ... appeared to collide with level at the instant of colliding with catapult so handle that here (+1 is for the client side case) if (!bReadyToExplode && (LastTick == lastCatapultHitTick || LastTick == (lastCatapultHitTick + 1) || Wall.IsA('Catapult'))) return; if (bReadyToExplode) { endLife(None, Location, HitNormal); } else { bShouldBounce = true; Velocity = CalcBounceVelocity(HitNormal); if (VSize(Velocity) > noBounceVelocityThreshold) TriggerEffectEvent('Bounce'); } } defaultproperties { bBounce = true Physics = PHYS_Falling noBounceVelocityThreshold = 10 StaticMesh = StaticMesh'Weapons.Grenade' deathMessage = '%s copped it off %s\'s INSERTWEAPONNAMEHERE' bSkipEncroachment = false } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |