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 |
//============================================================================= // flamedamager.uc // $Author: Mfox $ // $Date: 12/14/02 10:49p $ // $Revision: 7 $ //============================================================================= class FlameDamager extends Actor ; var float DamageTimeAccum; var Pawn Victim; var int Damage; // Weapon damage will be spread out over a second var Pawn Instigator; var Vector HitLocation; var Vector Momentum; var class<DamageType> DamageType; var float Duration; // How long pawn stays on fire. var float SecondsPerDamage; // How long it takes to do one point of damage var bool beingdamaged; // // oh gee I seem to be on fire // function BeginDamaging (Pawn V, int Da, Pawn I, Vector H, Vector M, class<DamageType> DT, int Du) { Victim=V; Damage=Da; Instigator=I; HitLocation=H; Momentum=vect( 0, 0, 0 ); DamageType=DT; Duration=Du; DamageTimeAccum = 0; Instigator=I; // Scale seconds per damage per difficulty dependent on whether player is giving or receiving damage if (Victim != None && Victim.bIsRealPlayer) { SecondsPerDamage=default.SecondsPerDamage*(1.0/Level.Game.GetDamageToPlayerScalar()); } else if (Instigator != None && Instigator.bIsRealPlayer) { SecondsPerDamage=default.SecondsPerDamage*(1.0/Level.Game.GetDamageByPlayerScalar()); } // sleep (Duration); // StopDamaging(); //GotoState(''); GotoState('DoingDamage'); } function StopDamaging () { if( class'Pawn'.static.ValidPawn( Victim ) ) Victim.TakeDamage( 1, Instigator, HitLocation, Momentum, DamageType ); GotoState(''); } state DoingDamage { event BeginState() { enable ('Tick'); } event EndState() { disable ('Tick'); } event Tick( float DeltaTime ) { local int DamageDealt; if (Victim!=None && Victim.Health>0 && !Victim.bDeleteMe && !bDeleteMe) { DamageTimeAccum += DeltaTime; DamageDealt=0; // Accumulate damage for this tick. while( DamageTimeAccum > SecondsPerDamage ) { DamageTimeAccum -= SecondsPerDamage; DamageDealt+=1; } if( DamageDealt>0 ) { Victim.TakeDamage( DamageDealt, Instigator, HitLocation, Momentum, DamageType ); } } else Destroy(); } Begin: sleep (Duration); StopDamaging(); } defaultproperties { Damage=20 Duration=5.000000 SecondsPerDamage=0.150000 bHidden=true UseReticleOnEvents(0)="UseReticleText" UseReticleOnEvents(1)="UseReticleCorners" UseReticleOnEvents(2)="UseReticleTopBars" ProximityReticleOnEvents(0)="ProximityReticleCorners" ProximityReticleOnEvents(1)="ProximityReticleTopBars" } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |