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 |
//============================================================================= // ROPawnSoundGroup //============================================================================= // Player sounds. Some functionality copied from xPawnSoundGroup //============================================================================= // Red Orchestra Source // Copyright (C) 2005 John Gibson //============================================================================= class ROPawnSoundGroup extends Object abstract; var() array<Sound> Sounds; var() sound HeadShotDeathSoundGroup; var() sound UpperBodyShotDeathSoundGroup; var() sound LowerBodyShotDeathSoundGroup; var() sound LimbShotDeathSoundGroup; var() sound GenericDeathSoundGroup; var() sound FallingPainSoundGroup; var() sound WoundingPainSoundGroup; var() Sound LandSounds[20]; // Indexed by ESurfaceTypes (sorry about the literal). var() Sound JumpSounds[20]; // Indexed by ESurfaceTypes (sorry about the literal). Enum ESoundType { EST_Land, EST_CorpseLanded, EST_HitUnderWater, EST_Jump, EST_LandGrunt, EST_Gasp, EST_Drown, EST_BreatheAgain, EST_TiredJump, EST_Dodge, EST_DoubleJump, EST_DiveLand }; static function Sound GetHitSound(optional class<DamageType> DamageType) { //If they are taking damage because they fell, return a falling pain sound if ( DamageType.Name == 'Fell' ) return default.FallingPainSoundGroup; //Otherwise, return a wounding pain sound return default.WoundingPainSoundGroup; } static function Sound GetDeathSound(optional int HitIndex) { //Check for a Head shot if( HitIndex == 1 ) return default.HeadShotDeathSoundGroup; //Check for Upper Torso shot else if( HitIndex == 2 ) return default.UpperBodyShotDeathSoundGroup; //Check for Lower Torso shot else if( HitIndex == 3 ) return default.LowerBodyShotDeathSoundGroup; //Check for Arm/Hand and Leg/Foot shot else if( HitIndex >= 4 && HitIndex <= 15 ) return default.LimbShotDeathSoundGroup; //Hit somewhere without a group, return a generic sound return default.GenericDeathSoundGroup; } static function Sound GetSound(ESoundType SoundType, optional int SurfaceID) { if( SoundType == EST_Land ) { return default.LandSounds[SurfaceID]; } else if( SoundType == EST_Jump ) { return default.JumpSounds[SurfaceID]; } else { return default.Sounds[int(SoundType)]; } } //============================================================================= // defaultproperties //============================================================================= defaultproperties { } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |