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 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 |
//============================================================================= // pbolt. //============================================================================= class PBolt extends projectile; #exec TEXTURE IMPORT NAME=PalGreen FILE=..\unrealshare\textures\expgreen.pcx GROUP=Effects #exec OBJ LOAD FILE=textures\BoltCap.utx PACKAGE=Botpack.BoltCap #exec OBJ LOAD FILE=textures\BoltHit.utx PACKAGE=Botpack.BoltHit #exec MESH IMPORT MESH=pbolt ANIVFILE=MODELS\pbolt_a.3d DATAFILE=MODELS\pbolt_d.3d #exec MESH ORIGIN MESH=pbolt X=0 Y=-400 Z=0 YAW=192 #exec MESH SEQUENCE MESH=pbolt SEQ=All STARTFRAME=0 NUMFRAMES=1 #exec MESH SEQUENCE MESH=pbolt SEQ=still STARTFRAME=0 NUMFRAMES=1 #exec MESHMAP NEW MESHMAP=pbolt MESH=pbolt #exec MESHMAP SCALE MESHMAP=pbolt X=0.10125 Y=0.10125 Z=0.2025 #exec TEXTURE IMPORT NAME=pbolt0 FILE=Textures\Bolta_00.bmp GROUP=Skins LODSET=2 #exec TEXTURE IMPORT NAME=pbolt1 FILE=Textures\Bolta_01.bmp GROUP=Skins LODSET=2 #exec TEXTURE IMPORT NAME=pbolt2 FILE=Textures\Bolta_02.bmp GROUP=Skins LODSET=2 #exec TEXTURE IMPORT NAME=pbolt3 FILE=Textures\Bolta_03.bmp GROUP=Skins LODSET=2 #exec TEXTURE IMPORT NAME=pbolt4 FILE=Textures\Bolta_04.bmp GROUP=Skins LODSET=2 #exec MESHMAP SETTEXTURE MESHMAP=pbolt NUM=0 TEXTURE=pbolt0 var() texture SpriteAnim[5]; var int SpriteFrame; var PBolt PlasmaBeam; var PlasmaCap WallEffect; var int Position; var vector FireOffset; var float BeamSize; var bool bRight, bCenter; var float AccumulatedDamage, LastHitTime; var Actor DamagedActor; replication { // Things the server should send to the client. unreliable if( Role==ROLE_Authority ) bRight, bCenter; } simulated function Destroyed() { Super.Destroyed(); if ( PlasmaBeam != None ) PlasmaBeam.Destroy(); if ( WallEffect != None ) WallEffect.Destroy(); } simulated function CheckBeam(vector X, float DeltaTime) { local actor HitActor; local vector HitLocation, HitNormal; // check to see if hits something, else spawn or orient child HitActor = Trace(HitLocation, HitNormal, Location + BeamSize * X, Location, true); if ( (HitActor != None) && (HitActor != Instigator) && (HitActor.bProjTarget || (HitActor == Level) || (HitActor.bBlockActors && HitActor.bBlockPlayers)) && ((Pawn(HitActor) == None) || Pawn(HitActor).AdjustHitLocation(HitLocation, Velocity)) ) { if ( Level.Netmode != NM_Client ) { if ( DamagedActor == None ) { AccumulatedDamage = FMin(0.5 * (Level.TimeSeconds - LastHitTime), 0.1); HitActor.TakeDamage(damage * AccumulatedDamage, instigator,HitLocation, (MomentumTransfer * X * AccumulatedDamage), MyDamageType); AccumulatedDamage = 0; } else if ( DamagedActor != HitActor ) { DamagedActor.TakeDamage(damage * AccumulatedDamage, instigator,HitLocation, (MomentumTransfer * X * AccumulatedDamage), MyDamageType); AccumulatedDamage = 0; } LastHitTime = Level.TimeSeconds; DamagedActor = HitActor; AccumulatedDamage += DeltaTime; if ( AccumulatedDamage > 0.22 ) { if ( DamagedActor.IsA('Carcass') && (FRand() < 0.09) ) AccumulatedDamage = 35/damage; DamagedActor.TakeDamage(damage * AccumulatedDamage, instigator,HitLocation, (MomentumTransfer * X * AccumulatedDamage), MyDamageType); AccumulatedDamage = 0; } } if ( HitActor.bIsPawn && Pawn(HitActor).bIsPlayer ) { if ( WallEffect != None ) WallEffect.Destroy(); } else if ( (WallEffect == None) || WallEffect.bDeleteMe ) WallEffect = Spawn(class'PlasmaHit',,, HitLocation - 5 * X); else if ( !WallEffect.IsA('PlasmaHit') ) { WallEffect.Destroy(); WallEffect = Spawn(class'PlasmaHit',,, HitLocation - 5 * X); } else WallEffect.SetLocation(HitLocation - 5 * X); if ( (WallEffect != None) && (Level.NetMode != NM_DedicatedServer) ) Spawn(ExplosionDecal,,,HitLocation,rotator(HitNormal)); if ( PlasmaBeam != None ) { AccumulatedDamage += PlasmaBeam.AccumulatedDamage; PlasmaBeam.Destroy(); PlasmaBeam = None; } return; } else if ( (Level.Netmode != NM_Client) && (DamagedActor != None) ) { DamagedActor.TakeDamage(damage * AccumulatedDamage, instigator, DamagedActor.Location - X * 1.2 * DamagedActor.CollisionRadius, (MomentumTransfer * X * AccumulatedDamage), MyDamageType); AccumulatedDamage = 0; DamagedActor = None; } if ( Position >= 9 ) { if ( (WallEffect == None) || WallEffect.bDeleteMe ) WallEffect = Spawn(class'PlasmaCap',,, Location + (BeamSize - 4) * X); else if ( WallEffect.IsA('PlasmaHit') ) { WallEffect.Destroy(); WallEffect = Spawn(class'PlasmaCap',,, Location + (BeamSize - 4) * X); } else WallEffect.SetLocation(Location + (BeamSize - 4) * X); } else { if ( WallEffect != None ) { WallEffect.Destroy(); WallEffect = None; } if ( PlasmaBeam == None ) { PlasmaBeam = Spawn(class'PBolt',,, Location + BeamSize * X); PlasmaBeam.Position = Position + 1; } else PlasmaBeam.UpdateBeam(self, X, DeltaTime); } } simulated function UpdateBeam(PBolt ParentBolt, vector Dir, float DeltaTime) { local actor HitActor; local vector HitLocation, HitNormal; SpriteFrame = ParentBolt.SpriteFrame; Skin = SpriteAnim[SpriteFrame]; SetLocation(ParentBolt.Location + BeamSize * Dir); SetRotation(ParentBolt.Rotation); CheckBeam(Dir, DeltaTime); } defaultproperties { SpriteAnim(0)=Texture'Botpack.Skins.pbolt0' SpriteAnim(1)=Texture'Botpack.Skins.pbolt1' SpriteAnim(2)=Texture'Botpack.Skins.pbolt2' SpriteAnim(3)=Texture'Botpack.Skins.pbolt3' SpriteAnim(4)=Texture'Botpack.Skins.pbolt4' FireOffset=(X=16.000000,Y=-14.000000,Z=-8.000000) BeamSize=81.000000 bRight=True MaxSpeed=0.000000 Damage=72.000000 MomentumTransfer=8500 MyDamageType=zapped ExplosionDecal=Class'Botpack.BoltScorch' bNetTemporary=False Physics=PHYS_None RemoteRole=ROLE_None LifeSpan=60.000000 AmbientSound=Sound'Botpack.PulseGun.PulseBolt' Style=STY_Translucent Texture=Texture'Botpack.Skins.pbolt0' Skin=Texture'Botpack.Skins.pbolt0' Mesh=LodMesh'Botpack.PBolt' bUnlit=True SoundRadius=12 SoundVolume=255 bCollideActors=False bCollideWorld=False } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |