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 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 |
//============================================================================= // ShowDamageInfo.uc //============================================================================= class ShowDamageInfo extends GameRules config(ShowDamageInfo); // show info when Pawns damaged // useful options for testing var() config bool bVerbose; // (false): true ==> shows damage done, and Injured pawn's health var() config bool bPlayerPawnsOnly; // (false): true ==> only show messages for PlayerPawn instigators var() config bool bBroadcast; // (true): true ==> broadcast messages var() config bool bConsole; // (true): true ==> send message to console var() config bool bLog; // (true): true ==> log messages var() config float DrawTime; // (2.0): how long messages stay on-screen (if bBroadcast) var() config Font DrawFont; // (none): e.g. font'engine.debugfont' var() config Color DrawColor; // (255,0,0,255): note that the alpha channel needs to be in 1.255 to have any effect //----------------------------------------------------------------------------- function int NetDamage( int OriginalDamage, int Damage, Pawn Injured, Pawn InstigatedBy, vector HitLocation, vector Momentum, class<DamageType> DamageType ) { local string TerseMessage; local string VerboseMessage; local string InstigatorName; local string InjuredName; local Pawn P; /* DM( "NetDamage - " $ " OriginalDamage: " $ OriginalDamage $ " Damage: " $ Damage $ " Injured: " $ Injured $ " InstigatedBy: " $ InstigatedBy $ " HitLocation: " $ HitLocation $ " Momentum: " $ VSize(Momentum) $ " DamageType: " $ DamageType ); */ if( NextGameRules != None ) Damage = NextGameRules.NetDamage( OriginalDamage, Damage, Injured, InstigatedBy, HitLocation, Momentum, DamageType ); // !!mdf-tbd: for testing with > 1 bot/NPC vs 1 player, might want to check whether player did the damage? if( !bPlayerPawnsOnly || InstigatedBy.IsPlayer() || Injured.IsPlayer() ) { if( InstigatedBy == None ) InstigatorName = "None"; else if( InstigatedBy.PlayerReplicationInfo != None ) InstigatorName = InstigatedBy.PlayerReplicationInfo.PlayerName; else InstigatorName = string(InstigatedBy.Name); if( Injured.PlayerReplicationInfo != None ) InjuredName = Injured.PlayerReplicationInfo.PlayerName; else InjuredName = string(Injured.Name); if( bBroadCast || !bVerbose ) TerseMessage = class'Util'.static.GetFloatString(Level.TimeSeconds) @ InstigatorName @ "damaged" @ InjuredName @ "DIn=" $ OriginalDamage @ "DOut=" $ Damage @ "Health=" $ Injured.Health-Damage; if( bVerbose ) VerboseMessage = Level.TimeSeconds @ InstigatorName @ "(" $ InstigatedBy.Health $ ")" @ "damaged" @ InjuredName @ "Dist=" $ class'Util'.static.GetFloatString(VSize(Injured.Location - HitLocation ),1) @ "Mmnt=" $ class'Util'.static.GetFloatString(VSize(Momentum),0) @ "Type=" $ DamageType @ "DIn=" $ OriginalDamage @ "DOut=" $ Damage @ "Health=" $ Injured.Health-Damage; if( bBroadcast ) class'UIConsole'.static.BroadcastStatusMessage( Self, TerseMessage, // verbose messages are pretty much always too long DrawTime, DrawFont, DrawColor, , //sound , //volume , //pitch, "CenterDebugHolder", true ); if( bConsole ) { if( bVerbose ) BM( VerboseMessage ); else BM( TerseMessage ); } if( bLog ) { if( bVerbose ) log( VerboseMessage ); else log( TerseMessage ); } } return Damage; } //----------------------------------------------------------------------------- defaultproperties { bVerbose=true bBroadcast=true bConsole=true bLog=true DrawTime=2.000000 DrawColor=(R=255,A=255) 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 |