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 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 00506 00507 00508 00509 00510 00511 00512 00513 00514 00515 00516 00517 00518 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 00549 00550 00551 00552 00553 00554 00555 00556 00557 00558 00559 00560 00561 00562 00563 00564 00565 00566 00567 00568 00569 00570 00571 00572 00573 00574 00575 00576 00577 00578 00579 00580 00581 00582 00583 00584 00585 00586 00587 00588 00589 00590 00591 00592 00593 00594 00595 00596 00597 00598 00599 00600 00601 00602 00603 00604 00605 00606 00607 00608 00609 00610 00611 00612 00613 00614 00615 00616 00617 00618 00619 00620 00621 00622 00623 00624 00625 00626 00627 00628 00629 00630 00631 00632 00633 00634 00635 00636 00637 00638 00639 00640 00641 00642 00643 00644 00645 00646 00647 00648 00649 00650 00651 00652 00653 00654 00655 00656 00657 00658 00659 00660 00661 00662 00663 00664 00665 00666 00667 00668 00669 00670 00671 00672 00673 00674 00675 00676 00677 00678 00679 00680 00681 00682 00683 00684 00685 00686 00687 00688 00689 00690 00691 00692 00693 00694 00695 00696 00697 00698 00699 00700 00701 00702 00703 00704 00705 00706 00707 00708 00709 00710 00711 00712 00713 00714 00715 00716 00717 00718 00719 00720 00721 00722 00723 00724 00725 00726 00727 00728 00729 00730 00731 00732 00733 00734 00735 00736 00737 00738 00739 00740 00741 00742 00743 00744 00745 00746 00747 00748 00749 00750 00751 00752 00753 00754 00755 00756 00757 00758 00759 00760 00761 00762 00763 00764 00765 00766 00767 00768 00769 00770 00771 00772 00773 00774 00775 00776 00777 00778 00779 00780 00781 00782 00783 00784 00785 00786 00787 00788 00789 00790 00791 00792 00793 00794 00795 00796 00797 00798 00799 00800 00801 00802 00803 00804 00805 00806 00807 00808 00809 00810 00811 00812 00813 00814 00815 00816 00817 00818 00819 00820 00821 00822 00823 00824 00825 00826 00827 00828 00829 00830 00831 00832 00833 00834 00835 00836 00837 00838 00839 00840 00841 00842 00843 00844 00845 00846 00847 00848 00849 00850 00851 00852 00853 00854 00855 00856 00857 00858 00859 00860 00861 00862 00863 00864 00865 00866 00867 00868 00869 00870 00871 00872 00873 00874 00875 00876 00877 00878 00879 00880 00881 00882 00883 00884 00885 00886 00887 00888 00889 00890 00891 00892 00893 00894 00895 00896 00897 00898 00899 00900 00901 00902 00903 00904 00905 00906 00907 00908 00909 00910 00911 00912 00913 00914 00915 00916 00917 00918 00919 00920 00921 00922 00923 00924 00925 00926 00927 00928 00929 00930 00931 00932 00933 00934 00935 00936 00937 00938 00939 00940 00941 00942 00943 00944 00945 00946 00947 00948 00949 00950 00951 00952 00953 00954 00955 00956 00957 00958 00959 00960 00961 00962 00963 00964 00965 00966 00967 00968 00969 00970 00971 00972 00973 00974 00975 00976 00977 00978 00979 00980 00981 00982 00983 00984 00985 00986 00987 00988 00989 00990 00991 00992 00993 00994 00995 00996 00997 00998 00999 01000 01001 01002 01003 01004 01005 01006 01007 01008 01009 01010 01011 01012 01013 01014 01015 01016 01017 01018 01019 01020 01021 01022 01023 01024 01025 01026 01027 01028 01029 01030 01031 01032 01033 01034 01035 01036 01037 01038 01039 01040 01041 01042 01043 01044 01045 01046 01047 01048 01049 01050 01051 01052 01053 01054 01055 01056 01057 01058 01059 01060 01061 01062 01063 01064 01065 01066 01067 01068 01069 01070 01071 01072 01073 01074 01075 01076 01077 01078 01079 01080 01081 01082 01083 01084 01085 01086 01087 01088 01089 01090 01091 01092 01093 01094 01095 01096 01097 01098 01099 01100 01101 01102 01103 01104 01105 01106 01107 01108 01109 01110 01111 01112 01113 01114 01115 01116 01117 01118 01119 01120 01121 01122 01123 01124 01125 01126 01127 01128 01129 01130 01131 01132 01133 01134 01135 01136 01137 01138 01139 01140 01141 01142 01143 01144 01145 01146 01147 01148 01149 01150 01151 01152 01153 01154 01155 01156 01157 01158 01159 01160 01161 01162 01163 01164 01165 01166 01167 01168 01169 01170 01171 01172 01173 01174 01175 01176 01177 01178 01179 01180 01181 01182 01183 01184 01185 01186 01187 01188 01189 01190 01191 01192 01193 01194 01195 01196 01197 01198 01199 01200 01201 01202 01203 01204 01205 01206 01207 01208 01209 01210 01211 01212 01213 01214 01215 01216 01217 01218 01219 01220 01221 01222 01223 01224 01225 01226 01227 01228 01229 01230 01231 01232 01233 01234 01235 01236 01237 01238 01239 01240 01241 01242 01243 01244 01245 01246 01247 01248 01249 01250 01251 01252 01253 01254 01255 01256 01257 01258 01259 01260 01261 01262 01263 01264 01265 01266 01267 01268 01269 01270 01271 01272 01273 01274 01275 01276 01277 01278 01279 01280 01281 01282 01283 01284 01285 01286 01287 01288 01289 01290 01291 01292 01293 01294 01295 01296 01297 01298 01299 01300 01301 01302 01303 01304 01305 01306 01307 01308 01309 01310 01311 01312 01313 01314 01315 01316 01317 01318 01319 01320 01321 01322 01323 01324 01325 01326 01327 01328 01329 01330 01331 01332 01333 01334 01335 01336 01337 01338 01339 01340 01341 01342 01343 01344 01345 01346 01347 01348 01349 01350 01351 01352 01353 01354 01355 01356 01357 01358 01359 01360 01361 01362 01363 01364 01365 01366 01367 01368 01369 01370 01371 01372 01373 01374 01375 01376 01377 01378 01379 01380 01381 01382 01383 01384 01385 01386 01387 01388 01389 01390 01391 01392 01393 01394 01395 01396 01397 01398 01399 01400 01401 01402 01403 01404 01405 01406 01407 01408 01409 01410 01411 01412 01413 01414 01415 01416 01417 01418 01419 01420 01421 01422 01423 01424 01425 01426 01427 01428 01429 01430 01431 01432 01433 01434 01435 01436 01437 01438 01439 01440 01441 01442 01443 01444 01445 01446 01447 01448 01449 01450 01451 01452 01453 01454 01455 01456 01457 01458 01459 01460 01461 01462 01463 01464 01465 01466 01467 01468 01469 01470 01471 01472 01473 01474 01475 01476 01477 01478 01479 01480 01481 01482 01483 01484 01485 01486 01487 01488 01489 01490 01491 01492 01493 01494 01495 01496 01497 01498 01499 01500 01501 01502 01503 01504 01505 01506 01507 01508 01509 01510 01511 01512 01513 01514 01515 01516 01517 01518 01519 01520 01521 01522 01523 01524 01525 01526 01527 01528 01529 01530 01531 01532 01533 01534 01535 01536 01537 01538 01539 01540 01541 01542 01543 01544 01545 01546 01547 01548 01549 01550 01551 01552 01553 01554 01555 01556 01557 01558 01559 01560 01561 01562 01563 01564 01565 01566 01567 01568 01569 01570 01571 01572 01573 01574 01575 01576 01577 01578 01579 01580 01581 01582 01583 01584 01585 01586 |
/** * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class UTOnslaughtPowernode extends UTOnslaughtPanelNode native(Onslaught) abstract; //@fixme FIXME: this shouldn't be transient, //but they used to be StaticMeshComponents and the components got saved into maps due to the lighting channels stuff //and so if they aren't transient the map copy will get used and break everything var transient SkeletalMeshComponent EnergySphere; var StaticMeshComponent NodeBase; /** spinning piece rotated in C++ at the same rate as the EnergySphere (YawRotationRate) */ var StaticMeshComponent NodeBaseSpinner; /** these have their 'PowerCoreColor' parameter set to the color of the team that owns this node */ var array<MaterialInstanceConstant> GlowMaterialInstances; /** the colors to use for the materials */ var LinearColor TeamGlowColors[2]; var LinearColor NeutralGlowColor; var CylinderComponent EnergySphereCollision; var transient ParticleSystemComponent AmbientEffect; var MaterialInstanceConstant NodeMaterialInstance; var float YawRotationRate; var float ConstructedCapacity; /** effect used when the node is neutral */ var ParticleSystem NeutralEffectTemplate; /** teamcolored effect used when the node is constructing */ var ParticleSystem ConstructingEffectTemplates[2]; /** teamcolored effect used when the node is fully constructed and active */ var ParticleSystem ActiveEffectTemplates[2]; /** teamcolored effect used when the node is fully constructed and shielded */ var ParticleSystem ShieldedActiveEffectTemplates[2]; /** System to play when captured by an orb*/ var ParticleSystemComponent OrbCaptureComponent; /** templates for above*/ var ParticleSystem OrbCaptureTemplate[2]; /** teamcolored effect used when the node is shielded */ var ParticleSystem ShieldedEffectTemplates[2]; /** teamcolored effect used when the node is vulnerable */ var ParticleSystem VulnerableEffectTemplates[2]; /** teamcolored effect played when local player has the orb and this node cannot be captured */ var ParticleSystemComponent InvulnerableToOrbEffect; var ParticleSystem InvulnerableToOrbTemplates[2]; /** true when damaged effect should be active */ var repnotify bool bPlayDamagedEffect; var ParticleSystemComponent DamagedEffect; var ParticleSystem DamagedEffectTemplates[2]; /** effect used when the node is destroyed */ var ParticleSystem DestroyedEffectTemplate; /** How long does it take for a panel to reach the top of the node */ var float PanelTravelTime; /** orb for the team that controls the node */ var repnotify UTOnslaughtFlag ControllingFlag; /** whether or not the node can be captured or damaged */ var repnotify enum EVulnerabilityStatus { VS_Vulnerable, // node is vulnerable VS_InvulnerableByNearbyOrb, // node is invulnerable because of nearby orb VS_InvulnerableToOrbCapture, // node is invulnerable (only to orb captures) because it was recently captured by the orb } Vulnerability; /** when the friendly orb carrier is this close and visible, this node cannot be captured by the enemy */ var float InvulnerableRadius; /** emitter that links from this node to the flag when invulnerable */ var UTEmitter FlagLinkEffect; /** templates for link effect */ var ParticleSystem FlagLinkEffectTemplates[2]; /** when we are captured, enemy orbs within this radius are returned */ var float CaptureReturnRadius; /** Sound to play when orb is nearby */ var AudioComponent OrbNearbySound; /** offset for the FlagLinkEffect */ var float InvEffectZOffset; /** when the node becomes invulnerable due to a nearby friendly orb, it is also healed this amount per second */ var int OrbHealingPerSecond; /** special invulnerability to orb capture period granted when the node is first constructed */ var float OrbCaptureInvulnerabilityDuration; /** indicates we were last captured by the Orb (different effects get played) - only valid when in Active state */ var bool bCapturedByOrb; /** last time node was captured by an Orb to keep track of invulnerability */ var float LastCaptureTime; /** Necris Capture Node Effects **/ var bool bPlayingNecrisEffects; var StaticMeshComponent NecrisCapturePipesLarge; var MaterialInstanceTimeVarying MITV_NecrisCapturePipesLarge; var InterpCurveFloat MITV_NecrisCapturePipes_FadeIn; var InterpCurveFloat MITV_NecrisCapturePipes_FadeIn2; var InterpCurveFloat NecrisCapturePipes_FadeOut_Fast; var InterpCurveFloat NecrisCapturePuddle_FadeIn50; var InterpCurveFloat NecrisCapturePuddle_FadeIn100; var InterpCurveFloat NecrisCapturePuddle_FadeOut; var StaticMeshComponent NecrisCapturePipesSmall; var MaterialInstanceTimeVarying MITV_NecrisCapturePipesSmall; var UTParticleSystemComponent PSC_NecrisCapture; var UTParticleSystemComponent PSC_NecrisGooPuddle; var MaterialInstanceTimeVarying MITV_NecrisCaptureGoo; /** Sockets this vehicle can be linked to from */ var array<Name> LinkToSockets; /** prime node name/announcement override */ var localized string PrimeNodeName; var localized string EnemyPrimeNodeName; var ObjectiveAnnouncementInfo PrimeAttackAnnouncement; var ObjectiveAnnouncementInfo PrimeDefendAnnouncement; var ObjectiveAnnouncementInfo EnemyPrimeAttackAnnouncement; var ObjectiveAnnouncementInfo EnemyPrimeDefendAnnouncement; var float LastUnlinkedWarningTime; var float NodeConstructionScore, OrbCaptureScore; var float LastInvulnerabilityScoreTime, OrbLockScoringInterval; replication { if (bNetDirty) bPlayDamagedEffect, ControllingFlag, Vulnerability, bCapturedByOrb; } // (cpptext) // (cpptext) // (cpptext) // (cpptext) simulated native function vector GetTargetLocation(optional Actor RequestedBy, optional bool bRequestAlternateLoc) const; simulated event PostBeginPlay() { local MaterialInstanceConstant NewMaterial; Super.PostBeginPlay(); NewMaterial = NodeBase.CreateAndSetMaterialInstanceConstant(0); GlowMaterialInstances[GlowMaterialInstances.Length] = NewMaterial; NewMaterial = NodeBaseSpinner.CreateAndSetMaterialInstanceConstant(0); GlowMaterialInstances[GlowMaterialInstances.Length] = NewMaterial; } simulated event SetInitialState() { local UTTeamGame Game; local UTOnslaughtFlagBase FBase; local byte StartingOwnerTeam; if (Role == ROLE_Authority && StartingOwnerCore != None) { StartingOwnerTeam = StartingOwnerCore.GetTeamNum(); Game = UTTeamGame(WorldInfo.Game); if (Game != None && StartingOwnerTeam < ArrayCount(Game.Teams)) { ControllingFlag = UTOnslaughtFlag(Game.Teams[StartingOwnerTeam].TeamFlag); if ( ControllingFlag == None ) { // the flag might not have been assigned yet if PostBeginPlay() hasn't been called for the flag base, so try to find it foreach WorldInfo.AllNavigationPoints(class'UTOnslaughtFlagBase', FBase) { if (FBase.myFlag != None && FBase.GetTeamNum() == StartingOwnerTeam) { ControllingFlag = FBase.myFlag; break; } } if (ControllingFlag == None) { WarnInternal("No flag for team" @ StartingOwnerTeam); StartingOwnerTeam = 255; } } } } Super.SetInitialState(); } simulated event ReplicatedEvent(name VarName) { if (VarName == 'Vulnerability' || VarName == 'ControllingFlag') { if (Vulnerability == VS_InvulnerableByNearbyOrb) { if (FlagLinkEffect == None || FlagLinkEffect.bDeleteMe) { FlagLinkEffect = Spawn(class'UTEmit_OrbLinkEffect', self,, ControllingFlag.Location, ControllingFlag.Rotation); FlagLinkEffect.SetTemplate(FlagLinkEffectTemplates[ControllingFlag.GetTeamNum() == 1 ? 1 : 0] , false); FlagLinkEffect.SetVectorParameter('LinkBeamEnd', Location); } FlagLinkEffect.SetBase(ControllingFlag); // if we're not already playing, play if (OrbNearbySound != None && !OrbNearbySound.bWasPlaying) { OrbNearbySound.FadeIn(0.3, 1.0); } } else { if (FlagLinkEffect != None) { FlagLinkEffect.Destroy(); } // if we're playing; stop. if (OrbNearbySound.bWasPlaying) { OrbNearbySound.FadeOut(0.3, 0.0); } } UpdateShield(PoweredBy(1 - DefenderTeamIndex)); } else if (VarName == 'bPlayDamagedEffect') { SetDamagedEffect(bPlayDamagedEffect); } else { if (VarName == 'DefenderTeamIndex' && bCapturedByOrb) { ShowOrbCaptureVisuals(); } Super.ReplicatedEvent(VarName); } } simulated function ShowOrbCaptureVisuals() { if (WorldInfo.NetMode != NM_DedicatedServer) { OrbCaptureComponent.DeactivateSystem(); OrbCaptureComponent.SetTemplate(OrbCaptureTemplate[DefenderTeamIndex%2]); OrbCaptureComponent.SetActive(true); } } /** turns on and off the damaged effect */ simulated function SetDamagedEffect(bool bShowEffect) { bPlayDamagedEffect = bShowEffect; if (WorldInfo.NetMode != NM_DedicatedServer) { if (bShowEffect) { if (DamagedEffect == None && DefenderTeamIndex < 2) { DamagedEffect = new(Outer) class'UTParticleSystemComponent'; DamagedEffect.SetTemplate(DamagedEffectTemplates[DefenderTeamIndex]); AttachComponent(DamagedEffect); } } else if (DamagedEffect != None) { DetachComponent(DamagedEffect); DamagedEffect = None; } } } function bool HealDamage(int Amount, Controller Healer, class<DamageType> DamageType) { local bool bResult; bResult = Super.HealDamage(Amount, Healer, DamageType); if (HealEffect != None) { HealEffect.SetLocation(EnergySphere.GetPosition()); } if (bIsActive) { SetDamagedEffect(Health < DamageCapacity / 2); } return bResult; } simulated function TakeRadiusDamage( Controller InstigatedBy, float BaseDamage, float DamageRadius, class<DamageType> DamageType, float Momentum, vector HurtOrigin, bool bFullDamage, optional Actor DamageCauser ) { local vector DamageLocation, HitLocation, HitNormal; // the standard code doesn't work very well for HitLocations on our separated geometry, // so for direct hits, attempt to find a HitLocation on the closer of the two if (bFullDamage) { DamageLocation = Location; if (VSize(EnergySphereCollision.GetPosition() - HurtOrigin) < VSize(NodeBase.GetPosition() - HurtOrigin)) { if (TraceComponent(HitLocation, HitNormal, EnergySphereCollision, EnergySphereCollision.GetPosition(), HurtOrigin)) { DamageLocation = HitLocation; } } else if (TraceComponent(HitLocation, HitNormal, NodeBase, NodeBase.GetPosition(), HurtOrigin)) { DamageLocation = HitLocation; } TakeDamage(BaseDamage, InstigatedBy, DamageLocation, Normal(DamageLocation - HurtOrigin) * Momentum, DamageType,, DamageCauser); } else { Super.TakeRadiusDamage(InstigatedBy, BaseDamage, DamageRadius, DamageType, Momentum, HurtOrigin, bFullDamage, DamageCauser); } } simulated event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { local PlayerController PC; if ( Vulnerability == VS_InvulnerableByNearbyOrb ) { if (Role == ROLE_Authority && !WorldInfo.GRI.OnSameTeam(self, EventInstigator)) { PC = PlayerController(EventInstigator); if (PC != None) { PC.ReceiveLocalizedMessage(MessageClass, (ControllingFlag != None && ControllingFlag.Holder != None) ? 42 : 43); // play 'can't attack' sound if player keeps shooting at us ShieldDamageCounter += Damage; if (ShieldDamageCounter > 200) { PC.ClientPlaySound(ShieldHitSound); ShieldDamageCounter -= 200; } } } } else { Super.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser); if (Role == ROLE_Authority && bIsActive) { SetDamagedEffect(Health < DamageCapacity / 2); } } } /** heals the node while the friendly orb is nearby */ function DoOrbHealing() { HealDamage(OrbHealingPerSecond, (ControllingFlag.Holder != None) ? ControllingFlag.Holder.Controller : None, None); } simulated function bool VerifyOrbLock( UTOnslaughtFlag CheckedFlag ) { local Actor OrbPosition; OrbPosition = CheckedFlag.Position(); if ( OrbPosition != None && VSize(Location - OrbPosition.Location) < InvulnerableRadius && FastTrace(Location + (vect(0,0,1) * InvEffectZOffset), OrbPosition.Location) ) { CheckedFlag.LockedNode = self; return true; } CheckedFlag.LockedNode = None; return false; } /** checks for the presence of the friendly orb and sets us as invulnerable */ function CheckInvulnerability() { local EVulnerabilityStatus NewVulnerability; NewVulnerability = VS_Vulnerable; if (ControllingFlag == None) { // have to find it - this happens e.g. when constructing since no orb was used to capture foreach DynamicActors(class'UTOnslaughtFlag', ControllingFlag) { if (WorldInfo.GRI.OnSameTeam(self, ControllingFlag)) { break; } } } if ( ControllingFlag != None ) { if ( ControllingFlag.Holder != None && VerifyOrbLock(ControllingFlag) ) { NewVulnerability = VS_InvulnerableByNearbyOrb; if ( PoweredBy(1 - ControllingFlag.Team.TeamIndex) ) { ControllingFlag.LastUsefulTime = WorldInfo.TimeSeconds; if ( bIsPrimeNode ) { if ( Vulnerability != NewVulnerability ) { LastInvulnerabilityScoreTime = WorldInfo.TimeSeconds; } else if ( WorldInfo.TimeSeconds - LastInvulnerabilityScoreTime > OrbLockScoringInterval ) { ControllingFlag.Holder.PlayerReplicationInfo.Score += 1.0; LastInvulnerabilityScoreTime = WorldInfo.TimeSeconds; } } } } else if (WorldInfo.TimeSeconds - LastCaptureTime < OrbCaptureInvulnerabilityDuration) { NewVulnerability = VS_InvulnerableToOrbCapture; } } if (Vulnerability != NewVulnerability) { Vulnerability = NewVulnerability; bForceNetUpdate = TRUE; if (WorldInfo.NetMode != NM_DedicatedServer) { ReplicatedEvent('Vulnerability'); } if (Vulnerability == VS_Vulnerable) { // check if enemy orb carrier is already touching us CheckTouching(); } } } simulated function UpdateShield(bool bPoweredByEnemy) { local ParticleSystem NewTemplate; local bool bPlayInvToOrbEffect; if (Vulnerability == VS_InvulnerableByNearbyOrb) { bPoweredByEnemy = false; } else if (Vulnerability == VS_InvulnerableToOrbCapture) { bPlayInvToOrbEffect = true; } if (DefenderTeamIndex < 2) { // update "you can't use the orb here right now" effect if (bPlayInvToOrbEffect) { if (InvulnerableToOrbEffect.Template != InvulnerableToOrbTemplates[DefenderTeamIndex]) { InvulnerableToOrbEffect.SetTemplate(InvulnerableToOrbTemplates[DefenderTeamIndex]); } InvulnerableToOrbEffect.SetHidden(false); InvulnerableToOrbEffect.SetActive(true); } else { InvulnerableToOrbEffect.SetActive(false); InvulnerableToOrbEffect.SetHidden(true); } // update shield part NewTemplate = bPoweredByEnemy ? VulnerableEffectTemplates[DefenderTeamIndex] : ShieldedEffectTemplates[DefenderTeamIndex]; ShieldedEffect.SetHidden(false); if (ShieldedEffect.Template != NewTemplate) { ShieldedEffect.SetTemplate(NewTemplate); } ShieldedEffect.SetActive(true); // update the base part NewTemplate = bPoweredByEnemy ? ActiveEffectTemplates[DefenderTeamIndex] : ShieldedActiveEffectTemplates[DefenderTeamIndex]; AmbientEffect.SetHidden(false); if (AmbientEffect.Template != NewTemplate) { AmbientEffect.SetTemplate(NewTemplate); } AmbientEffect.SetActive(true); } } function DisableObjective(Controller InstigatedBy) { local UTPlayerReplicationInfo PRI; if (InstigatedBy != None) { PRI = UTPlayerReplicationInfo(InstigatedBy.PlayerReplicationInfo); if ( PRI != None ) { PRI.IncrementNodeStat('NODE_DESTROYEDNODE'); PRI.IncrementHeroMeter(2.0); } } super.DisableObjective(InstigatedBy); } /** check if the given Pawn has an enemy orb and if so, takes over this node for that player's team */ function bool CheckFlag(Pawn P) { local UTPlayerReplicationInfo UTPRI; local int CaptureCount; if (P == None || P.IsA('Vehicle')) { return false; } UTPRI = UTPlayerReplicationInfo(P.PlayerReplicationInfo); if (UTPRI == None || !PoweredBy(UTPRI.Team.TeamIndex) || UTOnslaughtFlag(UTPRI.GetFlag()) == None) { if ( (WorldInfo.TimeSeconds - LastUnlinkedWarningTime > 15.0) && (UTOnslaughtFlag(UTPRI.GetFlag()) != None) ) { LastUnlinkedWarningTime = WorldInfo.TimeSeconds; P.ReceiveLocalizedMessage(MessageClass, 6); } return false; } // friendly team can only plant orb at constructing nodes, enemy team only at vulnerable nodes if ( WorldInfo.GRI.OnSameTeam(self, UTPRI) ) { if ( !bIsConstructing ) return false; } else { CheckInvulnerability(); if (Vulnerability != VS_Vulnerable) { if ( PlayerController(P.Controller) != None ) { PlayerController(P.Controller).ClientPlaySound(ShieldHitSound); } if ( !PoweredBy(P.GetTeamNum())) { if ( WorldInfo.TimeSeconds - LastUnlinkedWarningTime > 15.0 ) { LastUnlinkedWarningTime = WorldInfo.TimeSeconds; P.ReceiveLocalizedMessage(MessageClass, 6); } } else { P.ReceiveLocalizedMessage(MessageClass, (ControllingFlag != None && ControllingFlag.Holder != None) ? 42 : 43); } return false; } else { // increment node orb capture stat CaptureCount = UTPRI.IncrementNodeStat('NODE_NODEBUSTER'); if ( UTPlayerController(P.Controller) != None ) { UTPlayerController(P.Controller).ClientMusicEvent(12); } if ( CaptureCount == 10 ) { P.ReceiveLocalizedMessage(MessageClass, 7); } } } if (bIsActive) { GotoState('NeutralNode'); SendChangedEvent(P.Controller); } FindNewHomeForFlag(); // NOT UpdateCloseActors(), because we want vehicles to simply swap teams instead of being destroyed and respawned ControllingFlag = UTOnslaughtFlag(UTPRI.GetFlag()); Vulnerability = VS_InvulnerableToOrbCapture; SetDamagedEffect(false); // remove lightning if the orb was previously nearly gone. bForceNetUpdate = TRUE; Constructor = P.Controller; DefenderTeamIndex = ControllingFlag.GetTeamNum(); bCapturedByOrb = true; UTPRI.Score += OrbCaptureScore; BecomeActive(); ControllingFlag.Score(); Health = DamageCapacity; LastCaptureTime = WorldInfo.TimeSeconds; return true; } function BecomeActive() { local UTBot B; Super.BecomeActive(); if ( Constructor != None ) { if ( UTPlayerReplicationInfo(Constructor.PlayerReplicationInfo) != None ) { Constructor.PlayerReplicationInfo.Score += NodeConstructionScore; UTPlayerReplicationInfo(Constructor.PlayerReplicationInfo).IncrementNodeStat('NODE_NODEBUILT'); UTPlayerReplicationInfo(Constructor.PlayerReplicationInfo).IncrementHeroMeter(2.0); } B = UTBot(Constructor); if ( B != None ) { B.ConstructedNode = self; B.SendMessage(None,'NODECONSTRUCTED', 10, None); } } LastCaptureTime = WorldInfo.TimeSeconds; } function FindNewObjectives() { // work off a delay to make sure the flag and all state changes have been completely resolved first SetTimer(0.05, false, 'DelayedFindNewObjectives'); } function DelayedFindNewObjectives() { if (!IsTimerActive('BecomeActive')) { Super.FindNewObjectives(); } } function OnChangeNodeStatus(UTSeqAct_ChangeNodeStatus Action) { local UTTeamGame Game; local UTOnslaughtFlag NewFlag; if (Action.InputLinks[0].bHasImpulse || Action.InputLinks[1].bHasImpulse) { Game = UTTeamGame(WorldInfo.Game); if (Game != None && Action.OwnerTeam < ArrayCount(Game.Teams)) { NewFlag = UTOnslaughtFlag(Game.Teams[Action.OwnerTeam].TeamFlag); if (NewFlag != None) { Vulnerability = VS_InvulnerableToOrbCapture; bForceNetUpdate = TRUE; if (bIsActive) { GotoState('NeutralNode'); } ControllingFlag = NewFlag; SetDamagedEffect(false); // remove lightning if the orb was previously nearly gone. bForceNetUpdate = TRUE; Constructor = None; DefenderTeamIndex = ControllingFlag.GetTeamNum(); bCapturedByOrb = true; BecomeActive(); Health = DamageCapacity; LastCaptureTime = WorldInfo.TimeSeconds; } } } } function Reset() { DefenderTeamIndex = default.DefenderTeamIndex; Vulnerability = VS_Vulnerable; SetDamagedEffect(false); Super.Reset(); } /** applies any scaling factors to damage we're about to take */ simulated function ScaleDamage(out int Damage, Controller InstigatedBy, class<DamageType> DamageType) { Super.ScaleDamage(Damage, InstigatedBy, DamageType); if ( (Vulnerability == VS_InvulnerableToOrbCapture) && !DamageType.IsA('UTDmgType_Redeemer') ) { Damage *= 0.5; } } function Actor GetAutoObjectiveActor(UTPlayerController PC) { local UTTeamGame Game; local byte PlayerTeam; local UTOnslaughtFlag Orb; local UTPlayerController Teammate; local int OrbOrderCount; local float OrbDist, PawnDist, PawnOrbDist; if ( !PC.bNotUsingOrb ) { // see if this player needs to get the orb instead Game = UTTeamGame(WorldInfo.Game); PlayerTeam = PC.GetTeamNum(); if ( Game != None && PlayerTeam < ArrayCount(Game.Teams) ) { Orb = UTOnslaughtFlag(Game.Teams[PlayerTeam].TeamFlag); if ( (Orb != None) && (Orb.Holder == None) ) { // decide whether to switch orders based on player's objective preference if ( PC.AutoObjectivePreference == AOP_OrbRunner ) { return Orb; } // if orb is in dispenser, check if more than one player has already been told to grab it and is still nearby. if ( Orb.bHome ) { ForEach WorldInfo.AllControllers(class'UTPlayerController', Teammate) { if ( (Teammate != PC) && (Teammate.LastAutoObjective == Orb) && (Teammate.Pawn != None) && VSize(Orb.Location - Teammate.Pawn.Location) < Orb.StartingHomeBase.MaxSensorRange ) { OrbOrderCount++; } } if ( OrbOrderCount < 2 ) { // if not orb runner, only tell him to pick up if orb is near me, or he is near orb, or it is on his way. OrbDist = VSize(Orb.Location - Location); if ( OrbDist < MaxSensorRange ) { return Orb; } PawnOrbDist = VSize(PC.Pawn.Location - Orb.Location); if ( PawnOrbDist < MaxSensorRange ) { return Orb; } PawnDist = VSize(PC.Pawn.Location - Location); if ( PawnOrbDist + OrbDist < 1.5 * PawnDist ) { return Orb; } } } } } } return super.GetAutoObjectiveActor(PC); } simulated function StopNecrisEffects(bool bIncludePipes) { if (bPlayingNecrisEffects) { if (bIncludePipes) { MITV_NecrisCapturePipesLarge.SetScalarCurveParameterValue( 'Nec_TubeFadeOut', NecrisCapturePuddle_FadeOut ); MITV_NecrisCapturePipesLarge.SetScalarStartTime( 'Nec_TubeFadeOut', 0.0f ); MITV_NecrisCapturePipesSmall.SetScalarCurveParameterValue( 'Nec_TubeFadeOut', NecrisCapturePuddle_FadeOut ); MITV_NecrisCapturePipesSmall.SetScalarStartTime( 'Nec_TubeFadeOut', 0.0f ); } //PSC_NecrisGooPuddle.DeactivateSystem(); MITV_NecrisCaptureGoo.SetScalarCurveParameterValue( 'Nec_PuddleOpacity', NecrisCapturePuddle_FadeOut ); MITV_NecrisCaptureGoo.SetScalarStartTime( 'Nec_PuddleOpacity', 0.0f ); PSC_NecrisCapture.DeactivateSystem(); bPlayingNecrisEffects = false; } } simulated state NeutralNode { ignores DoOrbHealing; simulated function UpdateEffects(bool bPropagate) { local PlayerController PC; local int i; if ( WorldInfo.NetMode == NM_DedicatedServer ) return; Global.UpdateEffects(bPropagate); if (AmbientEffect.Template != NeutralEffectTemplate) { AmbientEffect.SetTemplate(NeutralEffectTemplate); } for (i = 0; i < GlowMaterialInstances.length; i++) { GlowMaterialInstances[i].SetVectorParameterValue('PowerCoreColor', NeutralGlowColor); } ForEach LocalPlayerControllers(class'PlayerController', PC) { if ( (PC.PlayerReplicationInfo == None) || (PC.PlayerReplicationInfo.Team == None) ) return; if ( PoweredBy(PC.GetTeamNum()) ) { AmbientEffect.SetActive(true); } else { AmbientEffect.DeactivateSystem(); } } } simulated function UpdateShield(bool bPoweredByEnemy) { InvulnerableToOrbEffect.SetActive(false); InvulnerableToOrbEffect.SetHidden(true); Super.UpdateShield(bPoweredByEnemy); } event Attach(Actor Other) { local UTPawn P; P = UTPawn(Other); if (P != None && P.IsPlayerPawn() && !P.IsHero() && !CheckFlag(P)) { if (PoweredBy(P.GetTeamNum())) { bForceNetUpdate = TRUE; DefenderTeamIndex = P.GetTeamNum(); Constructor = P.Controller; GotoState('Constructing'); } else if ( WorldInfo.TimeSeconds - LastUnlinkedWarningTime > 15.0 ) { LastUnlinkedWarningTime = WorldInfo.TimeSeconds; P.ReceiveLocalizedMessage(MessageClass, 6); } } } event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal) { Attach(Other); } function CheckInvulnerability() { if (Vulnerability != VS_Vulnerable) { Vulnerability = VS_Vulnerable; bForceNetUpdate = TRUE; } } function OnChangeNodeStatus(UTSeqAct_ChangeNodeStatus Action) { if (Action.InputLinks[0].bHasImpulse) { DefenderTeamIndex = Action.OwnerTeam; GotoState('Constructing'); } else if (Action.InputLinks[1].bHasImpulse) { DefenderTeamIndex = Action.OwnerTeam; Health = DamageCapacity; BecomeActive(); } } function bool TellBotHowToDisable(UTBot B) { return Global.TellBotHowToDisable(B); } simulated event BeginState(Name PreviousStateName) { if ( EnergySphere != None ) { EnergySphere.SetHidden(true); EnergySphereCollision.SetActorCollision(false, false); } if (Role == ROLE_Authority) { ControllingFlag = None; Vulnerability = VS_Vulnerable; if (WorldInfo.NetMode != NM_DedicatedServer) { ReplicatedEvent('Vulnerability'); } } StopNecrisEffects(PreviousStateName == 'ActiveNode'); // note: Super call must be last, so that if in there the state is changed again, we won't clobber changes to the EnergySphere Super.BeginState(PreviousStateName); } } simulated state Constructing { simulated function bool BeamEnabled() { return true; } function bool LegitimateTargetOf(UTBot B) { return (DefenderTeamIndex != B.Squad.Team.TeamIndex ); } function bool ValidSpawnPointFor(byte TeamIndex) { return false; } simulated function bool HasHealthBar() { return true; } event Attach(Actor Other) { CheckFlag(Pawn(Other)); } event Timer() { local int HealthGain; if (bSevered) { return; } SetTimer(1.0, True); if (WorldInfo.TimeSeconds < LastAttackTime + 1.0) { return; } bForceNetUpdate = TRUE; ConstructionTimeElapsed += 1.0; HealthGain = (1.0 / ConstructionTime) * DamageCapacity; Health += HealthGain; // Recalculate taking in HealthGain = (1.0 / (ConstructionTime - PanelTravelTime) ) * DamageCapacity; HealPanels(HealthGain); if ( Health > ConstructedCapacity ) { SetTimer(0.0, False); Health = ConstructedCapacity; BecomeActive(); } } simulated event TakeDamage(int Damage, Controller EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { local float OldHealth; OldHealth = Health; Global.TakeDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType, HitInfo, DamageCauser); if ( Health < OldHealth ) { ConstructedCapacity = ConstructedCapacity - (OldHealth - Health); } } function OnChangeNodeStatus(UTSeqAct_ChangeNodeStatus Action) { if (Action.InputLinks[1].bHasImpulse) { DefenderTeamIndex = Action.OwnerTeam; Health = DamageCapacity; BecomeActive(); } else if (Action.InputLinks[2].bHasImpulse) { DisableObjective(None); } } simulated function UpdateEffects(bool bPropagate) { local int i; if (WorldInfo.NetMode != NM_DedicatedServer) { Global.UpdateEffects(bPropagate); if (DefenderTeamIndex < 2) { if (AmbientEffect.Template != ConstructingEffectTemplates[DefenderTeamIndex]) { EnergySphere.SetRotation(rot(0,0,0)); AmbientEffect.SetTemplate(ConstructingEffectTemplates[DefenderTeamIndex]); if (AmbientEffect.bSuppressSpawning) { AmbientEffect.SetActive(true); } } for (i = 0; i < GlowMaterialInstances.length; i++) { GlowMaterialInstances[i].SetVectorParameterValue('PowerCoreColor', TeamGlowColors[DefenderTeamIndex]); } } if (WorldInfo.GRI != None && UTGameReplicationInfo(WorldInfo.GRI).IsNecrisTeam(DefenderTeamIndex)) { PSC_NecrisGooPuddle.SetActive(true); MITV_NecrisCaptureGoo.SetScalarCurveParameterValue( 'Nec_PuddleOpacity', NecrisCapturePuddle_FadeIn50 ); MITV_NecrisCaptureGoo.SetScalarStartTime( 'Nec_PuddleOpacity', 0.0f ); bPlayingNecrisEffects = true; } } } simulated event BeginState(Name PreviousStateName) { local int i; local array<name> BoneNames; bIsConstructing = true; ConstructedCapacity = DamageCapacity; NodeState = GetStateName(); Scorers.length = 0; PlaySound(StartConstructionSound, true); ConstructionTimeElapsed = 0.0; Health = 0.1 * DamageCapacity; SetAmbientSound(HealingSound); // Update Links UpdateLinks(); UpdateEffects(true); SendChangedEvent(Constructor); if (Role == ROLE_Authority) { SetTimer(2.0,false); /* No longer displaying "under construction" messages if (DefenderTeamIndex == 0) { BroadcastLocalizedMessage(MessageClass, 23,,,self); } else if (DefenderTeamIndex == 1) { BroadcastLocalizedMessage(MessageClass, 24,,,self); } */ SetTimer(0.05, true, 'CheckInvulnerability'); } // remove all panels at the start of construction NumPanelsBlownOff = 0; PanelMesh.GetBoneNames(BoneNames); for (i = 0; i < BoneNames.length; i++) { if (InStr(string(BoneNames[i]), PanelBonePrefix) == 0) { if (PanelBoneScaler != None) { PanelBoneScaler.BoneScales[i] = DESTROYED_PANEL_BONE_SCALE; } NumPanelsBlownOff++; } } if (WorldInfo.NetMode != NM_DedicatedServer) { // for some reason, ForceSkelUpdate() doesn't do the job here PanelMesh.LastRenderTime = WorldInfo.TimeSeconds; DetachComponent(PanelMesh); AttachComponent(PanelMesh); } ReplicatedNumPanelsBlownOff = NumPanelsBlownOff; if ( EnergySphere != None ) { EnergySphere.SetHidden(false); EnergySphereCollision.SetActorCollision(true, true); } } simulated event EndState(name NextStateName) { Super.EndState(NextStateName); if (Role == ROLE_Authority) { ClearTimer(); ClearTimer('DoOrbHealing'); ClearTimer('CheckInvulnerability'); Vulnerability = VS_Vulnerable; } bIsConstructing = false; } } simulated state ActiveNode { event Attach(Actor Other) { CheckFlag(Pawn(Other)); } function TarydiumBoost(float Quantity) { Global.TarydiumBoost(Quantity); Health = FMin(Health+Quantity, DamageCapacity); } function CheckInvulnerability() { Global.CheckInvulnerability(); if (Vulnerability == VS_InvulnerableByNearbyOrb && OrbHealingPerSecond > 0) { if (!IsTimerActive('DoOrbHealing')) { SetTimer(1.0, true, 'DoOrbHealing'); } } else { ClearTimer('DoOrbHealing'); } } function OnChangeNodeStatus(UTSeqAct_ChangeNodeStatus Action) { if (Action.InputLinks[2].bHasImpulse) { Health = 0; DisableObjective(None); bForceNetUpdate = TRUE; } else { Global.OnChangeNodeStatus(Action); } } simulated function UpdateEffects(bool bPropagate) { local int i; if (WorldInfo.NetMode != NM_DedicatedServer) { Global.UpdateEffects(bPropagate); if (DefenderTeamIndex < 2) { if (AmbientEffect.bSuppressSpawning) { AmbientEffect.SetActive(true); } for (i = 0; i < GlowMaterialInstances.length; i++) { GlowMaterialInstances[i].SetVectorParameterValue('PowerCoreColor', TeamGlowColors[DefenderTeamIndex]); } // set the effects for a node that has just been taken over by the necris if (WorldInfo.GRI != None && UTGameReplicationInfo(WorldInfo.GRI).IsNecrisTeam(DefenderTeamIndex)) { //`log( "ActiveNode Necris" ); MITV_NecrisCapturePipesLarge.SetScalarCurveParameterValue( 'Nec_BurnInTime', MITV_NecrisCapturePipes_FadeIn ); MITV_NecrisCapturePipesLarge.SetScalarCurveParameterValue( 'Nec_TubeFadeOut', MITV_NecrisCapturePipes_FadeIn2 ); MITV_NecrisCapturePipesLarge.SetScalarStartTime( 'Nec_BurnInTime', 0.0f ); MITV_NecrisCapturePipesLarge.SetScalarStartTime( 'Nec_TubeFadeOut', 0.0f ); MITV_NecrisCapturePipesSmall.SetScalarCurveParameterValue( 'Nec_BurnInTime', MITV_NecrisCapturePipes_FadeIn ); MITV_NecrisCapturePipesSmall.SetScalarCurveParameterValue( 'Nec_TubeFadeOut', MITV_NecrisCapturePipes_FadeIn2 ); MITV_NecrisCapturePipesSmall.SetScalarStartTime( 'Nec_BurnInTime', 0.0f ); MITV_NecrisCapturePipesSmall.SetScalarStartTime( 'Nec_TubeFadeOut', 0.0f ); MITV_NecrisCaptureGoo.SetScalarCurveParameterValue( 'Nec_PuddleOpacity', NecrisCapturePuddle_FadeIn100 ); MITV_NecrisCaptureGoo.SetScalarStartTime( 'Nec_PuddleOpacity', 0.0f ); PSC_NecrisGooPuddle.SetActive(true); PSC_NecrisCapture.SetActive(true); bPlayingNecrisEffects = true; } else { StopNecrisEffects(true); } } } } simulated function BeginState(Name PreviousStateName) { Super.BeginState(PreviousStateName); if ( EnergySphere != None ) { EnergySphere.SetHidden(false); EnergySphereCollision.SetActorCollision(true, true); } if (Role == ROLE_Authority) { SetTimer(0.05, true, 'CheckInvulnerability'); } if (WorldInfo.NetMode != NM_DedicatedServer && bCapturedByOrb) { ShowOrbCaptureVisuals(); } SetAmbientSound(ActiveSound); } simulated function EndState(Name NextStateName) { Super.EndState(NextStateName); if (Role == ROLE_Authority) { ClearTimer('DoOrbHealing'); ClearTimer('CheckInvulnerability'); Vulnerability = VS_Vulnerable; bCapturedByOrb = false; } } } simulated state ObjectiveDestroyed { ignores DoOrbHealing; simulated function UpdateShield(bool bPoweredByEnemy) { InvulnerableToOrbEffect.SetActive(false); InvulnerableToOrbEffect.SetHidden(true); Super.UpdateShield(bPoweredByEnemy); } function CheckInvulnerability() { if (Vulnerability != VS_Vulnerable) { Vulnerability = VS_Vulnerable; bForceNetUpdate = TRUE; } } function OnChangeNodeStatus(UTSeqAct_ChangeNodeStatus Action) { if (Action.InputLinks[0].bHasImpulse) { DefenderTeamIndex = Action.OwnerTeam; GotoState('Constructing'); } else if (Action.InputLinks[1].bHasImpulse) { DefenderTeamIndex = Action.OwnerTeam; Health = DamageCapacity; BecomeActive(); } } simulated event BeginState(name PreviousStateName) { Super.BeginState(PreviousStateName); SetDamagedEffect(false); if (WorldInfo.NetMode != NM_DedicatedServer) { WorldInfo.MyEmitterPool.SpawnEmitter(DestroyedEffectTemplate, Location); StopNecrisEffects(PreviousStateName == 'ActiveNode'); } } } simulated state DisabledNode { simulated event BeginState(Name PreviousStateName) { Super.BeginState(PreviousStateName); if ( EnergySphere != None ) { EnergySphere.SetHidden(true); EnergySphereCollision.SetActorCollision(false, false); } AmbientEffect.DeactivateSystem(); } } simulated function bool TeamLink(int TeamNum) { return ( (LinkHealMult > 0) && (DefenderTeamIndex == TeamNum) ); } simulated function bool NeedsHealing() { return (Health < DamageCapacity); } function bool ShouldGrabFlag(UTOnslaughtSquadAI ONSSquadAI, UTBot B, float Dist) { local float CampTime; if ( ONSSquadAI.ONSTeamAI.Flag.IsRebuilding() ) { // don't camp rebuilding flags for too long if ( !ONSSquadAI.ONSTeamAI.Flag.bFinishedPreBuild ) { return false; } CampTime = ONSSquadAI.ONSTeamAI.Flag.BuildTime - ONSSquadAI.ONSTeamAI.Flag.GetTimerCount('OrbBuilt'); return (CampTime < 2); // FIXME - don't go for it if player is camping it? } return true; } function bool TellBotHowToDisable(UTBot B) { local UTOnslaughtSquadAI ONSSquadAI; local UTBot OtherB; local bool bCloserTeammate; local Actor FlagPosition; local float Dist; if (StandGuard(B)) { return TooClose(B); } else { ONSSquadAI = UTOnslaughtSquadAI(B.Squad); if (ONSSquadAI != None && ONSSquadAI.ONSTeamAI != None && !WorldInfo.GRI.OnSameTeam(self, B)) { // go for orb if: // core is not vulnerable or this is a prime node // bot is closer to orb than us // bot can't just shoot us // and other teammate isn't going for orb or we're closer if ( ONSSquadAI.ONSTeamAI.Flag != None && ONSSquadAI.ONSTeamAI.Flag.Holder == None && ((UTPawn(B.Pawn) == None) || !UTPawn(B.Pawn).IsHero()) && ( WorldInfo.TimeSeconds - B.ForcedFlagDropTime > 8) && (!ONSSquadAI.ONSTeamAI.FinalCore.PoweredBy(ONSSquadAI.ONSTeamAI.EnemyTeam.TeamIndex) || ONSSquadAI.ONSTeamAI.FinalCore.LinkedTo(self)) ) { FlagPosition = ONSSquadAI.ONSTeamAI.Flag.Position(); Dist = VSize(FlagPosition.Location - B.Pawn.Location); if ( ShouldGrabFlag(ONSSquadAI, B, Dist) && (B.RouteGoal == FlagPosition || B.RouteGoal == ONSSquadAI.ONSTeamAI.Flag.LastAnchor || Dist < 1000.0 || Dist * 2.0 < VSize(Location - B.Pawn.Location)) && (Dist < 1000.0 || IsNeutral() || !B.CanAttack(self)) ) { foreach WorldInfo.AllControllers(class'UTBot', OtherB) { if ( OtherB != B && OtherB.RouteGoal != None && (OtherB.RouteGoal == FlagPosition || OtherB.RouteGoal == ONSSquadAI.ONSTeamAI.Flag.LastAnchor) && WorldInfo.GRI.OnSameTeam(B, OtherB) && OtherB.Pawn != None && (OtherB.MoveTarget == OtherB.RouteGoal || OtherB.RouteDist < 2000.0 || VSize(FlagPosition.Location - OtherB.Pawn.Location) < Dist) ) { bCloserTeammate = true; break; } } if (!bCloserTeammate) { B.GoalString = "Get orb"; // make sure not already touching if ( ONSSquadAI.ONSTeamAI.Flag.IsInState('Home') && (VSize(B.Pawn.Location - FlagPosition.Location) < 200) ) { ONSSquadAI.ONSTeamAI.Flag.CheckTouching(); if ( UTPlayerReplicationInfo(B.PlayerReplicationInfo).bHasFlag ) { return B.Squad.FindPathToObjective(B, self); } } return ONSSquadAI.FindPathToObjective(B, FlagPosition); } } } if (Vulnerability != VS_Vulnerable) { if (ControllingFlag != None && ControllingFlag.Holder != None) { // if seen enemy orb carrier recently, or close enough to see connecting effect, try to attack that player directly if ( (B.Enemy == ControllingFlag.Holder || B.LineOfSightTo(ControllingFlag.Holder) || B.ActorReachable(self)) && ONSSquadAI.TryToIntercept(B, ControllingFlag.Holder, self) ) { B.GoalString = "Attack enemy orb carrier"; return true; } // otherwise go towards node until we see the carrier return ONSSquadAI.FindPathToObjective(B, self); } else if (B.Enemy != None) { // temporary invulnerability, fight nearby enemies until node becomes vulnerable return false; } } if (!IsNeutral() && (ONSSquadAI.ONSTeamAI.Flag == None || ONSSquadAI.ONSTeamAI.Flag.HolderPRI != B.PlayerReplicationInfo)) { // no orb or someone else has it, attack the node the old way return Super.TellBotHowToDisable(B); } } return B.Squad.FindPathToObjective(B, self); } } function bool TellBotHowToHeal(UTBot B) { local vector AdjustedLoc; local UTVehicle BotVehicle; // if bot is in important vehicle, don't get out BotVehicle = UTVehicle(B.Pawn); if (BotVehicle != None && BotVehicle.ImportantVehicle()) { return TooClose(B); } AdjustedLoc = EnergySphere.GetPosition(); AdjustedLoc.Z = B.Pawn.Location.Z; if ( VSize(AdjustedLoc - B.Pawn.Location) < 50 ) { // standing right on top of it, move away a little B.GoalString = "Move away from "$self; B.RouteGoal = B.FindRandomDest(); B.MoveTarget = B.RouteCache[0]; B.SetAttractionState(); return true; } else if (VSize(EnergySphere.GetPosition() - B.Pawn.Location) > class'UTWeap_LinkGun'.default.WeaponRange) { // too far to heal B.GoalString = "Move closer to "$self; if ( B.FindBestPathToward(self, false, true) ) { B.SetAttractionState(); return true; } else return false; } if (!TeamLink(B.GetTeamNum()) || Health >= DamageCapacity) { if ( (B.Enemy == None) && B.PlayerReplicationInfo.bHasFlag ) { // defend with flag B.MoveToDefensePoint(); return true; } return false; } if (B.Squad.SquadObjective == None) { if (BotVehicle != None) { return false; } // @hack - if bot has no squadobjective, need this for SwitchToBestWeapon() so bot's weapons' GetAIRating() // has some way of figuring out bot is trying to heal me B.DoRangedAttackOn(self); } if (BotVehicle != None && !BotVehicle.bKeyVehicle && (B.Enemy == None || (!B.LineOfSightTo(B.Enemy) && WorldInfo.TimeSeconds - B.LastSeenTime > 3))) { B.LeaveVehicle(true); return true; } if (UTWeapon(B.Pawn.Weapon) != None && UTWeapon(B.Pawn.Weapon).CanHeal(self)) { if (!B.Pawn.CanAttack(self)) { // need to move to somewhere else near objective B.GoalString = "Can't shoot"@self@"(obstructed)"; B.RouteGoal = B.FindRandomDest(); B.MoveTarget = B.RouteCache[0]; B.SetAttractionState(); return true; } B.GoalString = "Heal "$self; B.DoRangedAttackOn(self); return true; } else { B.SwitchToBestWeapon(); if (UTWeapon(B.Pawn.InvManager.PendingWeapon) != None && UTWeapon(B.Pawn.InvManager.PendingWeapon).CanHeal(self)) { if (!B.Pawn.CanAttack(self)) { // need to move to somewhere else near objective B.GoalString = "Can't shoot"@self@"(obstructed)"; B.RouteGoal = B.FindRandomDest(); B.MoveTarget = B.RouteCache[0]; B.SetAttractionState(); return true; } B.GoalString = "Heal "$self; B.DoRangedAttackOn(self); return true; } else { B.StopFiring(); if (B.FindInventoryGoal(0.0005)) // try to find a weapon to heal the objective { B.GoalString = "Find weapon or ammo to heal "$self; B.SetAttractionState(); return true; } } } return false; } simulated function vector GetHUDOffset(PlayerController PC, Canvas Canvas) { local vector Offset; // if default offset is too high up, don't use it Offset = Super.GetHUDOffset(PC, Canvas); if ( Canvas.Project(Location + Offset).Y < 0.12*Canvas.ClipY ) { if ( Canvas.Project(Location + vect(0,0,210)).Y < 0.12*Canvas.ClipY ) { return vect(0,0,20); } return vect(0,0,210); } return Offset; } defaultproperties { TeamGlowColors(0)=(R=0.000000,G=0.000000,B=0.000000,A=1.000000) TeamGlowColors(1)=(R=0.000000,G=0.000000,B=0.000000,A=1.000000) NeutralGlowColor=(R=0.000000,G=0.000000,B=0.000000,A=1.000000) PrimeNodeName="Prime Node" EnemyPrimeNodeName="Enemy Prime" LastUnlinkedWarningTime=-1000.000000 NodeConstructionScore=2.000000 OrbCaptureScore=4.000000 OrbLockScoringInterval=10.000000 Begin Object Class=AudioComponent Name=AmbientComponent ObjName=AmbientComponent Archetype=AudioComponent'UTGame.Default__UTOnslaughtPanelNode:AmbientComponent' ObjectArchetype=AudioComponent'UTGame.Default__UTOnslaughtPanelNode:AmbientComponent' End Object AmbientSoundComponent=AmbientComponent ObjectiveName="Node" AttackAnnouncement=(AnnouncementText="Attack the Node!") DefendAnnouncement=(AnnouncementText="Defend the Node!") Begin Object Class=CylinderComponent Name=CollisionCylinder ObjName=CollisionCylinder Archetype=CylinderComponent'UTGame.Default__UTOnslaughtPanelNode:CollisionCylinder' ObjectArchetype=CylinderComponent'UTGame.Default__UTOnslaughtPanelNode:CollisionCylinder' End Object CylinderComponent=CollisionCylinder Begin Object Class=ArrowComponent Name=Arrow ObjName=Arrow Archetype=ArrowComponent'UTGame.Default__UTOnslaughtPanelNode:Arrow' ObjectArchetype=ArrowComponent'UTGame.Default__UTOnslaughtPanelNode:Arrow' End Object Components(0)=Arrow Components(1)=CollisionCylinder Begin Object Class=PathRenderingComponent Name=PathRenderer ObjName=PathRenderer Archetype=PathRenderingComponent'UTGame.Default__UTOnslaughtPanelNode:PathRenderer' ObjectArchetype=PathRenderingComponent'UTGame.Default__UTOnslaughtPanelNode:PathRenderer' End Object Components(2)=PathRenderer Begin Object Class=LinkRenderingComponent Name=LinkRenderer ObjName=LinkRenderer Archetype=LinkRenderingComponent'UTGame.Default__UTOnslaughtPanelNode:LinkRenderer' ObjectArchetype=LinkRenderingComponent'UTGame.Default__UTOnslaughtPanelNode:LinkRenderer' End Object Components(3)=LinkRenderer Components(4)=AmbientComponent CollisionComponent=CollisionCylinder Name="Default__UTOnslaughtPowernode" ObjectArchetype=UTOnslaughtPanelNode'UTGame.Default__UTOnslaughtPanelNode' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |