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 |
class SniperRifleProjectile extends Projectile; var SniperRifleBeam beam; var float energyModifier; // construct overloaded function construct(Rook attacker, optional actor Owner, optional name Tag, optional vector Location, optional rotator Rotation) { energyModifier = Character(attacker).energy / Character(attacker).energyMaximum; damageAmt = default.damageAmt * energyModifier; super.construct(attacker, Owner, Tag, Location, Rotation); } simulated function ProjectileHit(Actor Other, vector TouchLocation, vector TouchNormal) { // scale knockback my energy multiplier local Vector momentum; momentum = normal(velocity) * knockback; victim = Other.Name; Other.TakeDamage(damageAmt, Instigator, TouchLocation, momentum, damageTypeClass, 1.0-knockbackAliveScale); endLife(Other, TouchLocation, TouchNormal); } function PostBounce(Projectile newProjectile) { local SniperRifleProjectile srProj; srProj = SniperRifleProjectile(newProjectile); srProj.energyModifier = energyModifier; srProj.damageAmt = damageAmt; new class'SniperRifleBeam'(srProj); super.PostBounce(srProj); } simulated function Destroyed() { if (beam != None) beam.onProjectileDeath(); super.Destroyed(); } defaultproperties { damageAmt = 60 // Use a teeny-weeny disc for now StaticMesh = StaticMesh'Weapons.Grenade' DrawScale3D = (X=0.1,Y=0.1,Z=0.1) deathMessage = '%s copped it off %s\'s Sniper' knockback = 60000 knockbackAliveScale = 0 //0.25 // reduce knockback while alive because the sniper rifle is not meant to be a knockback weapon } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |