Difference between revisions of "Teleportation Projectile"
Jump to navigation
Jump to search
(Created page with '== Teleportation Projectile == ''Note: I did NOT create this, I only found it on some tutorial dated about 2002 with no author attached, so I figured it would be ok to share it ...') |
(Changed formating and removed useless variable) |
||
Line 4: | Line 4: | ||
'' | '' | ||
class TeleProj expands TazerProj; | |||
function SuperExplosion() | |||
class TeleProj expands TazerProj; | { | ||
// This next line will hurt everyone within 240 units by 3.9x the regular damage | |||
HurtRadius(Damage*3.9, 240, 'jolted', MomentumTransfer*2, Location ); | |||
Destroy(); | |||
} | |||
function SuperExplosion() | function Explode(vector HitLocation,vector HitNormal) | ||
{ | { | ||
// Play the Explosion sound. | |||
// This next line will hurt everyone within 240 units by 3.9x the regular damage | PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand()); | ||
HurtRadius(Damage*3.9, 240, 'jolted', MomentumTransfer*2, Location ); | // Hurt everyone 70 units away. | ||
HurtRadius(Damage, 70, 'jolted', MomentumTransfer, Location ); | |||
Destroy(); | |||
} | // If the damage is high, make a big explosion. | ||
if (Damage > 60) Spawn(class'RingExplosion2',,, HitLocation+HitNormal*8,rotator(HitNormal)); | |||
function Explode(vector HitLocation,vector HitNormal) | // Make teleport sparkles. | ||
{ | Spawn ( class 'PawnTeleportEffect',,, Instigator.Location ); | ||
// Play the Explosion sound. | // Make teleport sparkles where you will end up. | ||
Spawn ( class 'PawnTeleportEffect',,, Location ); | |||
// Here, you are transported to wherever you hit. | |||
Instigator.SetLocation(Location); | |||
// Hurt everyone 70 units away. | |||
// This destroys the projectile. | |||
Destroy(); | |||
} | |||
// If the damage is high, make a big explosion. | |||
// Make teleport sparkles. | |||
// Make teleport sparkles where you will end up. | |||
// Here, you are transported to wherever you hit. | |||
// This destroys the projectile. | |||
} |
Revision as of 00:04, 3 August 2009
Teleportation Projectile
Note: I did NOT create this, I only found it on some tutorial dated about 2002 with no author attached, so I figured it would be ok to share it with everyone. The only parts I did change were the comments in the code, to allow the player to understand what each line does. Just Sub-Class TazerProj and copy this code to make it work.
class TeleProj expands TazerProj; function SuperExplosion() { // This next line will hurt everyone within 240 units by 3.9x the regular damage HurtRadius(Damage*3.9, 240, 'jolted', MomentumTransfer*2, Location ); Destroy(); } function Explode(vector HitLocation,vector HitNormal) { // Play the Explosion sound. PlaySound(ImpactSound, SLOT_Misc, 0.5,,, 0.5+FRand()); // Hurt everyone 70 units away. HurtRadius(Damage, 70, 'jolted', MomentumTransfer, Location ); // If the damage is high, make a big explosion. if (Damage > 60) Spawn(class'RingExplosion2',,, HitLocation+HitNormal*8,rotator(HitNormal)); // Make teleport sparkles. Spawn ( class 'PawnTeleportEffect',,, Instigator.Location ); // Make teleport sparkles where you will end up. Spawn ( class 'PawnTeleportEffect',,, Location ); // Here, you are transported to wherever you hit. Instigator.SetLocation(Location); // This destroys the projectile. Destroy(); }