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 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 |
//============================================================================= // U2DrakkDroid.uc //============================================================================= class U2DrakkDroid extends U2PawnBasic; #exec OBJ LOAD File=..\System\ParticleRes\Impact_Metal_AR.u //!!arl -- stubbed to eliminate blood #exec OBJ LOAD File=..\Sounds\U2Drakk.uax #exec OBJ LOAD File=..\Sounds\U2DrakkNew.uax //----------------------------------------------------------------------------- var U2NPCControllerShared NPCCS; var Trigger PodTrigger; var LookTarget HomeActor; var float DeathTimer; var bool bDroidAvailable; var bool bDroidPodOpen; var() bool bExplodeOnNavError; // whether or not to explode when a navigation error occurs var() float PodOpenDelayTime; // time to wait while pod is opening or closing, in seconds var() float RepairDelayTime; // time to wait while repairing a drakk being serviced var() float RebuildTime; // time it takes for a pod to build the droid, maximum difficulty setting (lowest time) function PossessedBy(Controller C) { Super.PossessedBy(C); if (NPCCS == None) NPCCS = U2NPCControllerShared(C); } function UnPossessed() { if (NPCCS == Controller) NPCCS = None; Super.UnPossessed(); } simulated event PostBeginPlay() { local Trigger A; Super.PostBeginPlay(); // our Event is our pod triggers's Tag; find the pod trigger and hold on to it if (Event != '') { foreach AllActors(class'Trigger', A, Event) { PodTrigger = A; break; } } // Rebuild time is given at highest difficulty setting; goes up to 3x this value at lowest difficulty RebuildTime += RebuildTime*2.0*(1.0-Level.Game.GetNormalizedDifficulty()); } simulated function bool OpenPod() { if (!PodTrigger || bDroidPodOpen) return(false); PodTrigger.OnUse(self); bDroidPodOpen = true; } simulated function bool ClosePod() { if (!PodTrigger || !bDroidPodOpen) return(false); PodTrigger.OnUse(self); bDroidPodOpen = false; } simulated function bool SpawnSuccessor() { local U2DrakkDroid A; if (!HomeActor) return(false); A = spawn(class'U2DrakkDroid', , , HomeActor.Location, HomeActor.Rotation); A.PodTrigger = PodTrigger; A.HomeActor = HomeActor; A.bDroidPodOpen = bDroidPodOpen; A.Controller.GotoState('DroidBuild'); return(true); } simulated function DroidDestroy() { if (DeathTimer > 0.0) return; SetCollision(false, false, false); ClosePod(); SpawnSuccessor(); MeshAgentSetInputCurValue('State', 'Inactive'); DeathTimer = 3.0; //ErrorGeneral(ET_Other, "DroidDestroy: "$Name); PlaySound(sound'U2DrakkNew.Explosion_6', SLOT_Misc); } simulated event Destroyed() { local actor Explosion; local RL_Blower Blower; Explosion = Spawn( class'ER_EMPExplosion', self, , Location, Rotation ); Explosion.RemoteRole = ROLE_None; Blower = Spawn( class'RL_Blower', , , Location, Rotation ); Blower.LifeSpan = 0.5; Super.Destroyed(); } event Tick(float DeltaTime) { Super.Tick(DeltaTime); if (bDeleteMe) return; if (DeathTimer > 0.0) { DeathTimer -= DeltaTime; if (DeathTimer <= 0.0) KillSelf(); } if (Controller!=None) U2DrakkDroidController(Controller).DroidUpdateAnimation(DeltaTime); } function eventTakeDamage( int Damage, Pawn Instigator, vector HitLocation, vector Momentum, class<DamageType> DamageType ) { local int OldHealth; if (bDeleteMe) return; if (Controller!=None && !bDroidPodOpen) return; OldHealth = Health; Super.eventTakeDamage(Damage, Instigator, HitLocation, Momentum, DamageType); if ((Health <= 0) && (OldHealth > 0)) DroidDestroy(); } static simulated function bool DroidServiceRequested(Actor InActor) { local U2DrakkDroid A, NearDroid; local U2DrakkMedium InDrakk; local float Dist, NearDist; InDrakk = U2DrakkMedium(InActor); if (!InDrakk) return(false); // only drakk mediums can be serviced NearDist = 999999.0; foreach InDrakk.AllActors(class'U2DrakkDroid', A) { //if ((!A.bDeleteMe) && (A.Health > 0) && (A.bDroidAvailable)) if ((!A.bDeleteMe) && (A.Health > 0) && (A.bDroidAvailable) && (A.Region.ZoneNumber == InDrakk.Region.ZoneNumber)) { Dist = VSize(A.Location - InDrakk.Location); if (Dist < NearDist) { NearDist = Dist; NearDroid = A; } } } if (!NearDroid) return(false); // if we don't have a home yet, make one. // initial droids placed in the level will create a home here, // while spawned in ones (constructed by the pod) will have theirs // set by the previous droid automatically. if (!NearDroid.HomeActor) NearDroid.HomeActor = NearDroid.spawn(class'LookTarget', , , NearDroid.Location, NearDroid.Rotation); NearDroid.OpenPod(); U2DrakkDroidController(NearDroid.Controller).DroidService(InDrakk); InDrakk.ServiceDroid = NearDroid; return(true); } defaultproperties { bExplodeOnNavError=true PodOpenDelayTime=3.000000 RepairDelayTime=1.500000 RebuildTime=20.000000 AttackActiveBehaviors(0)=(StateName=AttackClose,Odds=1.000000,TimeMin=4.000000,TimeMax=4.000000) AttackActiveCantReachBehaviors(0)=(StateName=AttackStationary,Odds=1.000000,TimeMin=3.000000,TimeMax=3.000000) AttackActiveCantReachBehaviors(1)=(StateName=AttackTacticalMove,StateLabel=DontClose,Odds=1.000000,TimeMin=2.000000,TimeMax=2.000000) AttackActiveEnemyNotVisibleBehaviors(0)=(StateName=AttackHunt,Odds=1.000000,TimeMin=20.000000,TimeMax=20.000000) AttackActiveMeleeBehaviors(0)=(StateName=AttackMelee,TimeMin=3.000000,TimeMax=3.000000) AttackPassiveBehaviors(0)=(StateName=AttackMoveToCoverCombat,Odds=0.400000,TimeMin=7.000000,TimeMax=7.000000) AttackPassiveBehaviors(1)=(StateName=AttackStationary,Odds=0.060000,TimeMin=1.000000,TimeMax=3.000000) AttackPassiveBehaviors(2)=(StateName=AttackFallback,Odds=0.240000,TimeMin=2.500000,TimeMax=7.000000) AttackPassiveCantReachBehaviors(0)=(StateName=AttackStationary,Odds=0.500000,TimeMin=1.000000) AttackPassiveCantReachBehaviors(1)=(StateName=AttackFallback,Odds=1.000000,TimeMin=2.000000,TimeMax=7.000000) AttackPassiveEnemyNotVisibleBehaviors(0)=(StateName=AttackFallback,Odds=1.000000,TimeMin=20.000000,TimeMax=20.000000) AttackPassiveUseCoverBehaviors(0)=(StateName=AttackStakeOutCover,TimeMin=2.000000,TimeMax=5.000000) AttackPassiveUseCoverBehaviors(1)=(StateName=AttackRecoverEnemy,TimeMin=2.000000,TimeMax=4.000000) AttackPassiveUseCoverBehaviors(2)=(StateName=AttackStationary,TimeMin=1.000000,TimeMax=4.000000) AttackPassiveUseCoverBehaviors(3)=(StateName=AttackFallback,TimeMin=10.000000,TimeMax=20.000000) AttackPassiveUseCoverBehaviors(4)=(StateName=AttackMoveToCoverCombat,TimeMin=7.000000,TimeMax=7.000000) AttackPassiveMeleeBehaviors(0)=(StateName=AttackMelee,TimeMin=1.000000,TimeMax=2.000000) AttackPassiveMeleeBehaviors(1)=(StateName=AttackFallback,TimeMin=2.000000,TimeMax=5.000000) Melee01MaxDamage=45 Melee01MomentumPerUnitDamage=1000 AnimationControllerClass=None DamageFilterClass=Class'U2Pawns.DamageFilterDrakk' bCanKnockDown=false bOverridesDamageEffect=true ParticleHitEffect=ParticleSalamander'Impact_Metal_AR.ParticleSalamander0' GibSetClass=Class'U2Pawns.GibSetDrakkDroid' bCanStrafe=false MeleeOdds=1.000000 MeleeRange=40.000000 GroundSpeed=800.000000 AccelRate=800.000000 ControllerClass=Class'U2Pawns.U2DrakkDroidController' TeamNumber=42 AmbientSound=Sound'U2Drakk.Ambient' Mesh=LegendMesh'GlmCharactersG.DrakkDroid' Skins(0)=Shader'CharacterFXT.Drakk.drakkdroidFX' SoundVolume=96 TransientSoundRadius=400.000000 CollisionHeight=45.000000 UseReticleOnEvents(0)="UseReticleText" UseReticleOnEvents(1)="UseReticleCorners" UseReticleOnEvents(2)="UseReticleSideBars" ProximityReticleOnEvents(0)="ProximityReticleCorners" ProximityReticleOnEvents(1)="ProximityReticleSideBars" } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |