From ee260f7a10a3fdee9b3c52a6ec4237f5991a1928 Mon Sep 17 00:00:00 2001 From: GenZmeY Date: Sat, 28 Nov 2020 23:04:55 +0300 Subject: [PATCH] style: brackets --- ServerExt/Classes/ExtAutoPurchaseHelper.uc | 48 +- ServerExt/Classes/ExtCharDataInfo.uc | 4 +- ServerExt/Classes/ExtCharacterInfo.uc | 120 ++-- ServerExt/Classes/ExtEmoteList.uc | 18 +- ServerExt/Classes/ExtGUI_PerkSelectionPage.uc | 6 +- ServerExt/Classes/ExtHUD_PlayerBackpack.uc | 4 +- ServerExt/Classes/ExtHUD_PlayerStatus.uc | 18 +- ServerExt/Classes/ExtHUD_SpectatorInfo.uc | 22 +- ServerExt/Classes/ExtHUD_WaveInfo.uc | 4 +- .../Classes/ExtHUD_WeaponSelectWidget.uc | 44 +- ServerExt/Classes/ExtHumanPawn.uc | 360 ++++++------ ServerExt/Classes/ExtInventoryManager.uc | 10 +- ServerExt/Classes/ExtMenu_Gear.uc | 172 +++--- ServerExt/Classes/ExtMenu_Inventory.uc | 6 +- ServerExt/Classes/ExtMenu_Perks.uc | 30 +- ServerExt/Classes/ExtMenu_Trader.uc | 10 +- ServerExt/Classes/ExtMoviePlayer_HUD.uc | 16 +- ServerExt/Classes/ExtMoviePlayer_Manager.uc | 24 +- ServerExt/Classes/ExtPawn_Customization.uc | 26 +- ServerExt/Classes/ExtPerkManager.uc | 268 ++++----- .../Classes/ExtPerksContainer_Details.uc | 38 +- ServerExt/Classes/ExtPerksContainer_Header.uc | 18 +- .../Classes/ExtPerksContainer_Selection.uc | 20 +- ServerExt/Classes/ExtPlayerController.uc | 454 +++++++-------- ServerExt/Classes/ExtPlayerInput.uc | 30 +- ServerExt/Classes/ExtPlayerReplicationInfo.uc | 206 +++---- ServerExt/Classes/ExtProj_CrackerGrenade.uc | 8 +- ServerExt/Classes/ExtProj_SUPERGrenade.uc | 28 +- ServerExt/Classes/ExtProj_SUPERMedGrenade.uc | 14 +- ServerExt/Classes/ExtSM_Player_Emote.uc | 28 +- ServerExt/Classes/ExtSaveDataBase.uc | 20 +- ServerExt/Classes/ExtSpawnPointHelper.uc | 46 +- ServerExt/Classes/ExtStatWriter.uc | 4 +- .../Classes/ExtTraderContainer_Filter.uc | 18 +- .../Classes/ExtTraderContainer_PlayerInfo.uc | 6 +- ServerExt/Classes/ExtTraderContainer_Store.uc | 10 +- ServerExt/Classes/ExtWeap_Pistol_9mm.uc | 4 +- ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc | 4 +- ServerExt/Classes/ExtWeap_Pistol_MedicS.uc | 4 +- ServerExt/Classes/ExtWeaponSkinList.uc | 16 +- ServerExt/Classes/ExtWebAdmin_UI.uc | 10 +- ServerExt/Classes/ExtWidget_BossHealthBar.uc | 30 +- ServerExt/Classes/ExtWidget_PartyInGame.uc | 18 +- ServerExt/Classes/Ext_AICommandBasePet.uc | 62 +- ServerExt/Classes/Ext_PerkBase.uc | 468 +++++++-------- ServerExt/Classes/Ext_PerkBerserker.uc | 18 +- ServerExt/Classes/Ext_PerkCommando.uc | 22 +- ServerExt/Classes/Ext_PerkDemolition.uc | 28 +- ServerExt/Classes/Ext_PerkFieldMedic.uc | 48 +- ServerExt/Classes/Ext_PerkGunslinger.uc | 12 +- ServerExt/Classes/Ext_PerkRhythmPerkBase.uc | 44 +- ServerExt/Classes/Ext_PerkSWAT.uc | 10 +- ServerExt/Classes/Ext_PerkSharpshooter.uc | 8 +- ServerExt/Classes/Ext_PerkSupport.uc | 8 +- ServerExt/Classes/Ext_TGroupBase.uc | 10 +- ServerExt/Classes/Ext_TGroupRegen.uc | 12 +- ServerExt/Classes/Ext_T_AmmoRegHelp.uc | 10 +- ServerExt/Classes/Ext_T_ArmorRegHelp.uc | 4 +- ServerExt/Classes/Ext_T_AutoFireHelper.uc | 22 +- ServerExt/Classes/Ext_T_GhostHelper.uc | 38 +- ServerExt/Classes/Ext_T_HealthRegHelp.uc | 6 +- ServerExt/Classes/Ext_T_MonsterPRI.uc | 16 +- ServerExt/Classes/Ext_T_SupplierInteract.uc | 74 +-- ServerExt/Classes/Ext_T_UnCloakHelper.uc | 6 +- ServerExt/Classes/Ext_T_ZEDHelper.uc | 76 +-- ServerExt/Classes/Ext_TraitAPShots.uc | 8 +- ServerExt/Classes/Ext_TraitAcidicCompound.uc | 4 +- ServerExt/Classes/Ext_TraitAirborne.uc | 4 +- ServerExt/Classes/Ext_TraitAirborneAgent.uc | 14 +- ServerExt/Classes/Ext_TraitAmmoReg.uc | 6 +- ServerExt/Classes/Ext_TraitArmorReg.uc | 6 +- ServerExt/Classes/Ext_TraitArmorRep.uc | 4 +- ServerExt/Classes/Ext_TraitAutoFire.uc | 4 +- ServerExt/Classes/Ext_TraitBase.uc | 78 +-- ServerExt/Classes/Ext_TraitBoomWeld.uc | 4 +- ServerExt/Classes/Ext_TraitBunnyHop.uc | 8 +- ServerExt/Classes/Ext_TraitCarryCap.uc | 8 +- ServerExt/Classes/Ext_TraitContactNade.uc | 4 +- ServerExt/Classes/Ext_TraitDemoAOE.uc | 4 +- ServerExt/Classes/Ext_TraitDemoCriticalHit.uc | 4 +- ServerExt/Classes/Ext_TraitDemoDirectHit.uc | 4 +- ServerExt/Classes/Ext_TraitDemoNuke.uc | 16 +- .../Classes/Ext_TraitDemoProfessional.uc | 12 +- .../Classes/Ext_TraitDemoReactiveArmor.uc | 4 +- ServerExt/Classes/Ext_TraitDireReload.uc | 4 +- ServerExt/Classes/Ext_TraitDoorRepair.uc | 4 +- ServerExt/Classes/Ext_TraitDuracell.uc | 8 +- ServerExt/Classes/Ext_TraitEliteReload.uc | 4 +- ServerExt/Classes/Ext_TraitEnemyHP.uc | 4 +- ServerExt/Classes/Ext_TraitFanfire.uc | 4 +- ServerExt/Classes/Ext_TraitFireExplode.uc | 4 +- ServerExt/Classes/Ext_TraitFireRange.uc | 4 +- ServerExt/Classes/Ext_TraitGhost.uc | 8 +- ServerExt/Classes/Ext_TraitGrenadeCap.uc | 8 +- ServerExt/Classes/Ext_TraitGrenadeSUpg.uc | 6 +- ServerExt/Classes/Ext_TraitGrenadeUpg.uc | 12 +- ServerExt/Classes/Ext_TraitHealthReg.uc | 6 +- ServerExt/Classes/Ext_TraitHeavyArmor.uc | 8 +- ServerExt/Classes/Ext_TraitKnockback.uc | 8 +- ServerExt/Classes/Ext_TraitMachineGunner.uc | 8 +- ServerExt/Classes/Ext_TraitMedBoost.uc | 8 +- ServerExt/Classes/Ext_TraitMedDamBoost.uc | 8 +- ServerExt/Classes/Ext_TraitMedShield.uc | 8 +- ServerExt/Classes/Ext_TraitMedicPistol.uc | 10 +- ServerExt/Classes/Ext_TraitNapalm.uc | 4 +- ServerExt/Classes/Ext_TraitNightvision.uc | 4 +- ServerExt/Classes/Ext_TraitPenetrator.uc | 14 +- ServerExt/Classes/Ext_TraitRackEmUp.uc | 4 +- ServerExt/Classes/Ext_TraitRagdoll.uc | 8 +- ServerExt/Classes/Ext_TraitRanger.uc | 4 +- ServerExt/Classes/Ext_TraitRapidAssault.uc | 4 +- ServerExt/Classes/Ext_TraitRetali.uc | 4 +- ServerExt/Classes/Ext_TraitSWATEnforcer.uc | 12 +- ServerExt/Classes/Ext_TraitSirenResistance.uc | 4 +- ServerExt/Classes/Ext_TraitSpartan.uc | 8 +- ServerExt/Classes/Ext_TraitSupply.uc | 6 +- ServerExt/Classes/Ext_TraitSupplyData.uc | 14 +- ServerExt/Classes/Ext_TraitSupplyGren.uc | 2 +- ServerExt/Classes/Ext_TraitTacticalMove.uc | 4 +- ServerExt/Classes/Ext_TraitTactician.uc | 12 +- ServerExt/Classes/Ext_TraitToxicDart.uc | 4 +- ServerExt/Classes/Ext_TraitUberAmmo.uc | 4 +- ServerExt/Classes/Ext_TraitUnCloak.uc | 6 +- ServerExt/Classes/Ext_TraitUnGrab.uc | 4 +- ServerExt/Classes/Ext_TraitVampire.uc | 4 +- ServerExt/Classes/Ext_TraitWeapons.uc | 26 +- ServerExt/Classes/Ext_TraitZEDBase.uc | 8 +- ServerExt/Classes/Ext_TraitZED_Damage.uc | 4 +- ServerExt/Classes/Ext_TraitZED_Health.uc | 4 +- ServerExt/Classes/Ext_TraitZED_Summon.uc | 54 +- ServerExt/Classes/Ext_TraitZED_SummonExt.uc | 20 +- ServerExt/Classes/Ext_TraitZedTExt.uc | 4 +- ServerExt/Classes/Ext_TraitZedative.uc | 12 +- ServerExt/Classes/GUIStyleBase.uc | 58 +- ServerExt/Classes/KF2GUIController.uc | 226 ++++---- ServerExt/Classes/KF2GUIInput.uc | 12 +- ServerExt/Classes/KF2GUINetwork.uc | 24 +- ServerExt/Classes/KF2Style.uc | 142 ++--- ServerExt/Classes/KFExtendedHUD.uc | 290 ++++----- ServerExt/Classes/KFGUI_Base.uc | 70 +-- ServerExt/Classes/KFGUI_Button.uc | 8 +- ServerExt/Classes/KFGUI_Button_CD.uc | 20 +- ServerExt/Classes/KFGUI_CheckBox.uc | 8 +- ServerExt/Classes/KFGUI_Clickable.uc | 24 +- ServerExt/Classes/KFGUI_ColumnList.uc | 116 ++-- ServerExt/Classes/KFGUI_ColumnTop.uc | 50 +- ServerExt/Classes/KFGUI_ComboBox.uc | 16 +- ServerExt/Classes/KFGUI_ComboSelector.uc | 4 +- ServerExt/Classes/KFGUI_ComponentList.uc | 34 +- ServerExt/Classes/KFGUI_EditBox.uc | 98 ++-- ServerExt/Classes/KFGUI_EditControl.uc | 14 +- ServerExt/Classes/KFGUI_FloatingWindow.uc | 10 +- .../Classes/KFGUI_FloatingWindowHeader.uc | 8 +- ServerExt/Classes/KFGUI_List.uc | 62 +- ServerExt/Classes/KFGUI_ListItem.uc | 16 +- ServerExt/Classes/KFGUI_MultiComponent.uc | 42 +- ServerExt/Classes/KFGUI_NumericBox.uc | 8 +- ServerExt/Classes/KFGUI_RightClickMenu.uc | 26 +- ServerExt/Classes/KFGUI_RightClickMenu_CD.uc | 10 +- ServerExt/Classes/KFGUI_ScrollBarBase.uc | 34 +- ServerExt/Classes/KFGUI_ScrollBarV_CD.uc | 18 +- ServerExt/Classes/KFGUI_SwitchComponent.uc | 26 +- ServerExt/Classes/KFGUI_SwitchMenuBar.uc | 30 +- ServerExt/Classes/KFGUI_TextField.uc | 88 +-- ServerExt/Classes/KFGUI_TextLable.uc | 20 +- ServerExt/Classes/KFGUI_Tooltip.uc | 6 +- ServerExt/Classes/KFGUI_Tooltip_CD.uc | 14 +- ServerExt/Classes/MS_Game.uc | 6 +- ServerExt/Classes/MS_HUD.uc | 14 +- ServerExt/Classes/MS_Input.uc | 2 +- ServerExt/Classes/MS_PC.uc | 32 +- ServerExt/Classes/MS_TMPUI.uc | 4 +- ServerExt/Classes/MX_MiniGameBase.uc | 42 +- ServerExt/Classes/MX_PongGame.uc | 116 ++-- ServerExt/Classes/UIP_About.uc | 4 +- ServerExt/Classes/UIP_AdminMenu.uc | 14 +- ServerExt/Classes/UIP_MiniGame.uc | 2 +- ServerExt/Classes/UIP_News.uc | 8 +- ServerExt/Classes/UIP_PerkSelection.uc | 78 +-- ServerExt/Classes/UIP_PerkSelectionLobby.uc | 30 +- ServerExt/Classes/UIP_PlayerSpecs.uc | 48 +- ServerExt/Classes/UIP_Settings.uc | 46 +- ServerExt/Classes/UIR_PerkStat.uc | 16 +- ServerExt/Classes/UIR_PerkTraitList.uc | 28 +- ServerExt/Classes/UIR_TraitInfoPopup.uc | 12 +- ServerExt/Classes/UI_AdminMOTD.uc | 10 +- ServerExt/Classes/UI_AdminPerkLevel.uc | 10 +- ServerExt/Classes/UI_MidGameMenu.uc | 22 +- ServerExt/Classes/UI_PrestigeNote.uc | 2 +- ServerExt/Classes/UI_ResetWarning.uc | 6 +- ServerExt/Classes/UI_Scoreboard.uc | 152 ++--- ServerExt/Classes/UI_Scoreboard_CD.uc | 46 +- ServerExt/Classes/UI_UnloadInfo.uc | 12 +- ServerExt/Classes/VSFPZedHands.uc | 6 +- ServerExt/Classes/VSZombie.uc | 142 ++--- ServerExt/Classes/VS_ZedClotBase.uc | 8 +- ServerExt/Classes/VS_ZedRecentZed.uc | 40 +- ServerExt/Classes/xUI_MapRank.uc | 4 +- ServerExt/Classes/xUI_MapVote.uc | 44 +- ServerExt/Classes/xVotingHandlerBase.uc | 10 +- ServerExt/Classes/xVotingReplication.uc | 78 +-- ServerExtMut/Classes/CtryDatabase.uc | 18 +- ServerExtMut/Classes/ExtPlayerStat.uc | 60 +- ServerExtMut/Classes/ExtStatList.uc | 34 +- ServerExtMut/Classes/ExtWebApp.uc | 70 +-- ServerExtMut/Classes/ExtXMLOutput.uc | 8 +- ServerExtMut/Classes/ServerExtMut.uc | 548 +++++++++--------- ServerExtMut/Classes/xMapVoteHistory.uc | 18 +- ServerExtMut/Classes/xVoteBroadcast.uc | 12 +- ServerExtMut/Classes/xVoteWebApp.uc | 34 +- ServerExtMut/Classes/xVotingHandler.uc | 228 ++++---- 211 files changed, 3797 insertions(+), 3797 deletions(-) diff --git a/ServerExt/Classes/ExtAutoPurchaseHelper.uc b/ServerExt/Classes/ExtAutoPurchaseHelper.uc index 368d9bc..3539ed0 100644 --- a/ServerExt/Classes/ExtAutoPurchaseHelper.uc +++ b/ServerExt/Classes/ExtAutoPurchaseHelper.uc @@ -24,10 +24,10 @@ function DoAutoPurchase() GetTraderItems(); EP = GetExtPerk(); - if( EP==None || EP.AutoBuyLoadOutPath.length == 0) + if(EP==None || EP.AutoBuyLoadOutPath.length == 0) return; - for( i = 0; i Perk; Perk = GetBasePerk(); - if( Perk!=None ) + if(Perk!=None) { for (i = 0; i < OwnedItemList.length; i++) { - if( OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(Perk)!=INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1) + if(OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(Perk)!=INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1) { SellWeapon(OwnedItemList[i], i); i=-1; @@ -112,7 +112,7 @@ function SellOffPerkWeapons() for (i = 0; i < OwnedItemList.length; i++) { - if( OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(EP.BasePerk)==INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1 && OwnedItemList[i].SellPrice != 0 ) + if(OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(EP.BasePerk)==INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1 && OwnedItemList[i].SellPrice != 0) { if(EP.AutoBuyLoadOutPath.Find(OwnedItemList[i].DefaultItem.WeaponDef) == INDEX_NONE) { @@ -133,10 +133,10 @@ function InitializeOwnedItemList() EP = GetExtPerk(); OwnedItemList.length = 0; - TraderItems = KFGameReplicationInfo( WorldInfo.GRI ).TraderItems; + TraderItems = KFGameReplicationInfo(WorldInfo.GRI).TraderItems; - KFP = KFPawn_Human( Pawn ); - if( KFP != none ) + KFP = KFPawn_Human(Pawn); + if(KFP != none) { // init armor purchase values ArmorItem.SpareAmmoCount = KFP.Armor; @@ -153,13 +153,13 @@ function InitializeOwnedItemList() // @temp: fill in stuff that is normally serialized in the archetype GrenadeItem.DefaultItem.AssociatedPerkClasses[0] = CurrentPerk.Class; - for ( Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory ) + for (Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory) { - KFW = KFWeapon( Inv ); - if( KFW != none ) + KFW = KFWeapon(Inv); + if(KFW != none) { // Set the weapon information and add it to the OwnedItemList - SetWeaponInformation( KFW ); + SetWeaponInformation(KFW); } } @@ -170,7 +170,7 @@ function InitializeOwnedItemList() } } -function int AddItemByPriority( out SItemInformation WeaponInfo ) +function int AddItemByPriority(out SItemInformation WeaponInfo) { local byte i; local byte WeaponGroup, WeaponPriority; @@ -183,23 +183,23 @@ function int AddItemByPriority( out SItemInformation WeaponInfo ) WeaponGroup = WeaponInfo.DefaultItem.InventoryGroup; WeaponPriority = WeaponInfo.DefaultItem.GroupPriority; - for( i = 0; i < OwnedItemList.length; i++ ) + for(i = 0; i < OwnedItemList.length; i++) { // If the weapon belongs in the group prior to the current weapon, we've found the spot - if( WeaponGroup < OwnedItemList[i].DefaultItem.InventoryGroup ) + if(WeaponGroup < OwnedItemList[i].DefaultItem.InventoryGroup) { BestIndex = i; break; } - else if( WeaponGroup == OwnedItemList[i].DefaultItem.InventoryGroup ) + else if(WeaponGroup == OwnedItemList[i].DefaultItem.InventoryGroup) { - if( WeaponPriority > OwnedItemList[i].DefaultItem.GroupPriority ) + if(WeaponPriority > OwnedItemList[i].DefaultItem.GroupPriority) { // if the weapon is in the same group but has a higher priority, we've found the spot BestIndex = i; break; } - else if( WeaponPriority == OwnedItemList[i].DefaultItem.GroupPriority && WeaponInfo.DefaultItem.AssociatedPerkClasses.Find(Perk)>=0 ) + else if(WeaponPriority == OwnedItemList[i].DefaultItem.GroupPriority && WeaponInfo.DefaultItem.AssociatedPerkClasses.Find(Perk)>=0) { // if the weapons have the same priority give the slot to the on perk weapon BestIndex = i; @@ -212,17 +212,17 @@ function int AddItemByPriority( out SItemInformation WeaponInfo ) BestIndex = i + 1; } } - OwnedItemList.InsertItem( BestIndex, WeaponInfo ); + OwnedItemList.InsertItem(BestIndex, WeaponInfo); // Add secondary ammo immediately after the main weapon - if( WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo() ) + if(WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo()) { WeaponInfo.bIsSecondaryAmmo = true; WeaponInfo.SellPrice = 0; - OwnedItemList.InsertItem( BestIndex + 1, WeaponInfo ); + OwnedItemList.InsertItem(BestIndex + 1, WeaponInfo); } - if( MyGfxManager != none && MyGfxManager.TraderMenu != none ) + if(MyGfxManager != none && MyGfxManager.TraderMenu != none) { MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList; } diff --git a/ServerExt/Classes/ExtCharDataInfo.uc b/ServerExt/Classes/ExtCharDataInfo.uc index 1ce4dee..86d7cd5 100644 --- a/ServerExt/Classes/ExtCharDataInfo.uc +++ b/ServerExt/Classes/ExtCharDataInfo.uc @@ -9,7 +9,7 @@ final function FMyCustomChar LoadData() { local FMyCustomChar R; - if( HasInit==0 ) + if(HasInit==0) { AttachmentMesh0 = 255; AttachmentMesh1 = 255; @@ -27,7 +27,7 @@ final function FMyCustomChar LoadData() R.AttachmentSkinIndices[2] = AttachmentSkin2; return R; } -final function SaveData( FMyCustomChar R ) +final function SaveData(FMyCustomChar R) { HeadMeshIndex = R.HeadMeshIndex; HeadSkinIndex = R.HeadSkinIndex; diff --git a/ServerExt/Classes/ExtCharacterInfo.uc b/ServerExt/Classes/ExtCharacterInfo.uc index 30ffbe2..4e652e1 100644 --- a/ServerExt/Classes/ExtCharacterInfo.uc +++ b/ServerExt/Classes/ExtCharacterInfo.uc @@ -3,32 +3,32 @@ class ExtCharacterInfo extends Object abstract; // Hack fix for not being able to compile materials in run-time. -static final function CloneMIC( MaterialInstanceConstant B ) +static final function CloneMIC(MaterialInstanceConstant B) { local int i; local MaterialInstanceConstant M; local LinearColor C; M = MaterialInstanceConstant(B.Parent); - if( M==None ) + if(M==None) return; B.SetParent(M.Parent); - for( i=0; i 0 ) + if(C.BodyVariants.length > 0) { // Assign a skin to the body mesh as a material override CurrentBodyMeshIndex = (CurrentBodyMeshIndex < C.BodyVariants.length) ? CurrentBodyMeshIndex : 0; @@ -176,7 +176,7 @@ static final function SetBodyMeshAndSkin( KFCharacterInfo_Human C, CharBodyMesh = SkeletalMesh(SafeLoadObject(CharBodyMeshName, class'SkeletalMesh')); // Assign the body mesh to the pawn - if ( CharBodyMesh != KFP.Mesh.SkeletalMesh ) + if (CharBodyMesh != KFP.Mesh.SkeletalMesh) { KFP.Mesh.SetSkeletalMesh(CharBodyMesh); KFP.OnCharacterMeshChanged(); @@ -193,13 +193,13 @@ static final function SetBodyMeshAndSkin( KFCharacterInfo_Human C, } } -static final function SetBodySkinMaterial( KFCharacterInfo_Human C, OutfitVariants CurrentVariant, byte NewSkinIndex, KFPawn KFP) +static final function SetBodySkinMaterial(KFCharacterInfo_Human C, OutfitVariants CurrentVariant, byte NewSkinIndex, KFPawn KFP) { local int i; if (KFP.WorldInfo.NetMode != NM_DedicatedServer) { - if( CurrentVariant.SkinVariations.length > 0 ) + if(CurrentVariant.SkinVariations.length > 0) { // Assign a skin to the body mesh as a material override NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0; @@ -208,7 +208,7 @@ static final function SetBodySkinMaterial( KFCharacterInfo_Human C, OutfitVarian else { // Use material specified in the mesh asset - for( i=0; i 0 ) + if(CurrentVariant.SkinVariations.length > 0) { // Assign a skin to the body mesh as a material override NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0; @@ -231,7 +231,7 @@ static final function SetHeadSkinMaterial( KFCharacterInfo_Human C, OutfitVarian else { // Use material specified in the mesh asset - for( i=0; i 0 ) + if (C.HeadVariants.length > 0) { CurrentHeadMeshIndex = (CurrentHeadMeshIndex < C.HeadVariants.length) ? CurrentHeadMeshIndex : 0; @@ -277,7 +277,7 @@ static final function SetHeadMeshAndSkin( KFCharacterInfo_Human C, } } -static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C, +static final function SetAttachmentSkinMaterial(KFCharacterInfo_Human C, int PawnAttachmentIndex, const out AttachmentVariants CurrentVariant, byte NewSkinIndex, @@ -287,10 +287,10 @@ static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C, local int i; if (KFP.WorldInfo.NetMode != NM_DedicatedServer) { - if( CurrentVariant.AttachmentItem.SkinVariations.length > 0 ) + if(CurrentVariant.AttachmentItem.SkinVariations.length > 0) { // Assign a skin to the attachment mesh as a material override - if ( NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length ) + if (NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length) { if (bIsFirstPerson) { @@ -329,7 +329,7 @@ static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C, else { // Use material specified in the mesh asset - for( i=0; i < KFP.ThirdPersonAttachments[PawnAttachmentIndex].GetNumElements(); i++ ) + for(i=0; i < KFP.ThirdPersonAttachments[PawnAttachmentIndex].GetNumElements(); i++) { KFP.ThirdPersonAttachments[PawnAttachmentIndex].SetMaterial(i, none); } @@ -338,12 +338,12 @@ static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C, } } -static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C, +static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C, int CurrentAttachmentMeshIndex, int CurrentAttachmentSkinIndex, KFPawn KFP, KFPlayerReplicationInfo KFPRI, - optional bool bIsFirstPerson ) + optional bool bIsFirstPerson) { local string CharAttachmentMeshName; local name CharAttachmentSocketName; @@ -367,8 +367,8 @@ static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C, // Since cosmetic attachments are optional, do not choose index 0 if none is // specified unlike the the head and body meshes - if ( C.CosmeticVariants.Length > 0 && - CurrentAttachmentMeshIndex < C.CosmeticVariants.Length ) + if (C.CosmeticVariants.Length > 0 && + CurrentAttachmentMeshIndex < C.CosmeticVariants.Length) { if (KFPRI.StartLoadCosmeticContent(C, ECOSMETICTYPE_Attachment, CurrentAttachmentMeshIndex)) { @@ -382,9 +382,9 @@ static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C, // If previously attached and we could have changed outfits (e.g. local player UI) then re-validate // required skeletal mesh socket. Must be after body mesh DLO, but before AttachComponent. - if ( KFP.IsLocallyControlled() ) + if (KFP.IsLocallyControlled()) { - if ( CharAttachmentSocketName != '' && KFP.Mesh.GetSocketByName(CharAttachmentSocketName) == None ) + if (CharAttachmentSocketName != '' && KFP.Mesh.GetSocketByName(CharAttachmentSocketName) == None) { C.RemoveAttachmentMeshAndSkin(AttachmentSlotIndex, KFP, KFPRI); return; @@ -418,7 +418,7 @@ static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C, } // Treat `CLEARED_ATTACHMENT_INDEX as special value (for client detachment) - if( CurrentAttachmentMeshIndex == `CLEARED_ATTACHMENT_INDEX ) + if(CurrentAttachmentMeshIndex == `CLEARED_ATTACHMENT_INDEX) { C.RemoveAttachmentMeshAndSkin(AttachmentSlotIndex, KFP, KFPRI); } @@ -547,45 +547,45 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta * Removes any attachments that exist in the same socket or have overriding cases * Network: Local Player */ -static final function DetachConflictingAttachments( KFCharacterInfo_Human C, int NewAttachmentMeshIndex, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI) +static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int NewAttachmentMeshIndex, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI) { local name NewAttachmentSocketName; local int i, CurrentAttachmentIdx; local ExtPlayerReplicationInfo EPRI; EPRI = ExtPlayerReplicationInfo(KFPRI); - if ( EPRI==none || !EPRI.UsesCustomChar() ) + if (EPRI==none || !EPRI.UsesCustomChar()) return; - if ( C.CosmeticVariants.length > 0 && - NewAttachmentMeshIndex < C.CosmeticVariants.length ) + if (C.CosmeticVariants.length > 0 && + NewAttachmentMeshIndex < C.CosmeticVariants.length) { // The socket that this attachment requires NewAttachmentSocketName = C.CosmeticVariants[NewAttachmentMeshIndex].AttachmentItem.SocketName; - for( i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++ ) + for(i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++) { CurrentAttachmentIdx = EPRI.CustomCharacter.AttachmentMeshIndices[i]; - if ( CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX ) + if (CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX) continue; // Remove the object if it is taking up our desired slot - if( KFP.ThirdPersonAttachmentSocketNames[i] != '' && - KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName ) + if(KFP.ThirdPersonAttachmentSocketNames[i] != '' && + KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName) { C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); continue; } // Remove the object if it cannot exist at the same time as another equipped item - if( C.GetOverrideCase(CurrentAttachmentIdx, NewAttachmentMeshIndex) ) + if(C.GetOverrideCase(CurrentAttachmentIdx, NewAttachmentMeshIndex)) { C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); continue; } // Check inverse override - if( C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx) ) + if(C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx)) { C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); continue; @@ -595,14 +595,14 @@ static final function DetachConflictingAttachments( KFCharacterInfo_Human C, int } /** Assign an arm mesh and material to this pawn */ -static final function SetFirstPersonArmsFromArch( KFCharacterInfo_Human C, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI ) +static final function SetFirstPersonArmsFromArch(KFCharacterInfo_Human C, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI) { local MaterialInstanceConstant M; local ExtPlayerReplicationInfo EPRI; local bool bCustom; local int AttachmentIdx, CosmeticMeshIdx; - if ( KFPRI == none ) + if (KFPRI == none) { `Warn("Does not have a KFPRI" @ C); return; @@ -633,7 +633,7 @@ static final function SetFirstPersonArmsFromArch( KFCharacterInfo_Human C, KFPaw } // Hack fix for a material bug on KF2 - if( bCustom && KFP.ArmsMesh.SkeletalMesh!=None && KFP.ArmsMesh.GetMaterial(0)!=None ) + if(bCustom && KFP.ArmsMesh.SkeletalMesh!=None && KFP.ArmsMesh.GetMaterial(0)!=None) { M = KFP.ArmsMesh.CreateAndSetMaterialInstanceConstant(0); CloneMIC(M); @@ -650,7 +650,7 @@ static function int GetAttachmentSlotIndex( local ExtPlayerReplicationInfo EPRI; local bool bCustom; - if( KFPRI == None ) + if(KFPRI == None) { `warn("GetAttachmentSlotIndex - NO KFPRI"); return INDEX_NONE; @@ -660,10 +660,10 @@ static function int GetAttachmentSlotIndex( bCustom = (EPRI!=None ? EPRI.UsesCustomChar() : false); // Return the next available attachment index or the index that matches this mesh - for( AttachmentIdx = 0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++ ) + for(AttachmentIdx = 0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++) { CosmeticMeshIdx = bCustom ? EPRI.CustomCharacter.AttachmentMeshIndices[AttachmentIdx] : KFPRI.RepCustomizationInfo.AttachmentMeshIndices[AttachmentIdx]; - if( CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex ) + if(CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex) { return AttachmentIdx; } @@ -673,7 +673,7 @@ static function int GetAttachmentSlotIndex( static function bool IsAttachmentAvailable(KFCharacterInfo_Human C, const out AttachmentVariants Attachment, Pawn PreviewPawn) { - if ( Attachment.AttachmentItem.SocketName != '' && PreviewPawn.Mesh.GetSocketByName(Attachment.AttachmentItem.SocketName) == None ) + if (Attachment.AttachmentItem.SocketName != '' && PreviewPawn.Mesh.GetSocketByName(Attachment.AttachmentItem.SocketName) == None) { return false; } diff --git a/ServerExt/Classes/ExtEmoteList.uc b/ServerExt/Classes/ExtEmoteList.uc index fb36db5..1b743a6 100644 --- a/ServerExt/Classes/ExtEmoteList.uc +++ b/ServerExt/Classes/ExtEmoteList.uc @@ -3,23 +3,23 @@ class ExtEmoteList extends Object var const array Emotes; -static final function name GetUnlockedEmote( int ItemId, ExtPlayerController PC ) +static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC) { local int i; local name Anim; local ExtPlayerReplicationInfo PRI; i = default.Emotes.Find('Id', ItemId); - if( i > -1 ) + if(i > -1) { Anim = default.Emotes[i].AnimName; PRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo); - if( PRI == None ) + if(PRI == None) return Anim; /* - if( InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255 ) + if(InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255) return 'NONE'; */ else return Anim; @@ -28,9 +28,9 @@ static final function name GetUnlockedEmote( int ItemId, ExtPlayerController PC return 'NONE'; } -static final function SaveEquippedEmote( int ItemId, ExtPlayerController PC ) +static final function SaveEquippedEmote(int ItemId, ExtPlayerController PC) { - if( PC == None ) + if(PC == None) return; PC.SelectedEmoteIndex = ItemId; @@ -42,11 +42,11 @@ static final function array GetEmoteArray() return default.Emotes; } -static final function byte GetEmoteIndex( int ItemId ) +static final function byte GetEmoteIndex(int ItemId) { local int i; i = default.Emotes.Find('Id', ItemId); - if( i > -1 ) + if(i > -1) return i; return -1; @@ -54,7 +54,7 @@ static final function byte GetEmoteIndex( int ItemId ) static final function int GetEquippedEmoteId(ExtPlayerController PC) { - if( PC == None ) + if(PC == None) return -1; return PC.SelectedEmoteIndex; diff --git a/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc b/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc index b789463..70870ff 100644 --- a/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc +++ b/ServerExt/Classes/ExtGUI_PerkSelectionPage.uc @@ -8,7 +8,7 @@ function InitMenu() PageSwitcher = KFGUI_SwitchMenuBar(FindComponentID('Pager')); Super(KFGUI_Page).InitMenu(); - for( i=0; iLastWaveMax ) + if(LastWave>LastWaveMax) { SetInt("currentWave",0); // Force text to refresh. SetString("finalText", "END"); diff --git a/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc b/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc index 7600f4c..caef228 100644 --- a/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc +++ b/ServerExt/Classes/ExtHUD_WeaponSelectWidget.uc @@ -2,7 +2,7 @@ class ExtHUD_WeaponSelectWidget extends KFGFxHUD_WeaponSelectWidget; var transient array< class > WeaponGroup; -simulated function UpdateWeaponGroupOnHUD( byte GroupIndex ) +simulated function UpdateWeaponGroupOnHUD(byte GroupIndex) { local Inventory Inv; local KFWeapon KFW; @@ -14,22 +14,22 @@ simulated function UpdateWeaponGroupOnHUD( byte GroupIndex ) local array< class > WPGroup; P = GetPC().Pawn; - if ( P == none || P.InvManager == none ) + if (P == none || P.InvManager == none) return; - for ( Inv = P.InvManager.InventoryChain; Inv != none; Inv = Inv.Inventory ) + for (Inv = P.InvManager.InventoryChain; Inv != none; Inv = Inv.Inventory) { - KFW = KFWeapon( Inv ); - if ( KFW != none && KFW.InventoryGroup == GroupIndex ) + KFW = KFWeapon(Inv); + if (KFW != none && KFW.InventoryGroup == GroupIndex) WeaponsList.AddItem(KFW); } WPGroup.Length = WeaponsList.Length; - TraderItems = KFGameReplicationInfo( P.WorldInfo.GRI ).TraderItems; - for ( i = 0; i < WeaponsList.Length; i++ ) + TraderItems = KFGameReplicationInfo(P.WorldInfo.GRI).TraderItems; + for (i = 0; i < WeaponsList.Length; i++) { Index = TraderItems.SaleItems.Find('ClassName', WeaponsList[i].Class.Name); - if( Index != -1 ) + if(Index != -1) WPGroup[i] = TraderItems.SaleItems[Index].WeaponDef; } @@ -45,42 +45,42 @@ simulated function SetWeaponGroupList(out array WeaponList, byte Group local bool bUsesAmmo; DataProvider = CreateArray(); - if ( DataProvider == None ) + if (DataProvider == None) return; // gfx has been shut down for (i = 0; i < WeaponList.length; i++) { - TempObj = CreateObject( "Object" ); + TempObj = CreateObject("Object"); - if( WeaponGroup[i] != None ) + if(WeaponGroup[i] != None) { - TempObj.SetString( "weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName") ); - TempObj.SetString( "texturePath", "img://"$WeaponGroup[i].static.GetImagePath() ); + TempObj.SetString("weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName")); + TempObj.SetString("texturePath", "img://"$WeaponGroup[i].static.GetImagePath()); } else { - TempObj.SetString( "weaponName", WeaponList[i].ItemName ); - TempObj.SetString( "texturePath", "img://"$PathName(WeaponList[i].WeaponSelectTexture)); + TempObj.SetString("weaponName", WeaponList[i].ItemName); + TempObj.SetString("texturePath", "img://"$PathName(WeaponList[i].WeaponSelectTexture)); } TempObj.SetInt("weaponTier", WeaponList[i].CurrentWeaponUpgradeIndex); - TempObj.SetInt( "ammoCount", WeaponList[i].AmmoCount[0]); - TempObj.SetInt( "spareAmmoCount", WeaponList[i].SpareAmmoCount[0]); + TempObj.SetInt("ammoCount", WeaponList[i].AmmoCount[0]); + TempObj.SetInt("spareAmmoCount", WeaponList[i].SpareAmmoCount[0]); //secondary ammo shenanigans TempObj.SetBool("bUsesSecondaryAmmo", WeaponList[i].UsesSecondaryAmmo()&&WeaponList[i].bCanRefillSecondaryAmmo); TempObj.SetBool("bEnabled", WeaponList[i].HasAnyAmmo()); if(WeaponList[i].UsesSecondaryAmmo() && WeaponList[i].bCanRefillSecondaryAmmo) { TempObj.SetBool("bCanRefillSecondaryAmmo", WeaponList[i].SpareAmmoCapacity[1] > 0); - TempObj.SetInt( "secondaryAmmoCount", WeaponList[i].AmmoCount[1]); - TempObj.SetInt( "secondarySpareAmmoCount", WeaponList[i].SpareAmmoCount[1]); + TempObj.SetInt("secondaryAmmoCount", WeaponList[i].AmmoCount[1]); + TempObj.SetInt("secondarySpareAmmoCount", WeaponList[i].SpareAmmoCount[1]); } - TempObj.SetBool( "throwable", WeaponList[i].CanThrow()); + TempObj.SetBool("throwable", WeaponList[i].CanThrow()); bUsesAmmo = (WeaponList[i].static.UsesAmmo()); - TempObj.SetBool( "bUsesAmmo", bUsesAmmo); - DataProvider.SetElementObject( i, TempObj ); + TempObj.SetBool("bUsesAmmo", bUsesAmmo); + DataProvider.SetElementObject(i, TempObj); } SetWeaponList(DataProvider, GroupIndex); diff --git a/ServerExt/Classes/ExtHumanPawn.uc b/ServerExt/Classes/ExtHumanPawn.uc index 3b9c240..2ebf3fb 100644 --- a/ServerExt/Classes/ExtHumanPawn.uc +++ b/ServerExt/Classes/ExtHumanPawn.uc @@ -18,17 +18,17 @@ var byte HealingShieldMod,HealingSpeedBoostMod,HealingDamageBoostMod; replication { - if( true ) + if(true) bFeigningDeath,RepRegenHP,BackpackWeaponClass; - if( bNetOwner ) + if(bNetOwner) bHasBunnyHop; - if( bNetDirty ) + if(bNetDirty) HealingSpeedBoostMod, HealingDamageBoostMod, HealingShieldMod; } function TakeDamage(int Damage, Controller InstigatedBy, vector HitLocation, vector Momentum, class DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) { - if( KnockbackResist<1 ) + if(KnockbackResist<1) Momentum *= KnockbackResist; Super.TakeDamage(Damage,InstigatedBy,HitLocation,Momentum,DamageType,HitInfo,DamageCauser); } @@ -40,9 +40,9 @@ simulated function bool Died(Controller Killer, class damageType, ve local PlayerReplicationInfo KillerPRI; local SeqAct_Latent Action; - if( WorldInfo.NetMode!=NM_Client && PlayerReplicationInfo!=None ) + if(WorldInfo.NetMode!=NM_Client && PlayerReplicationInfo!=None) { - if( Killer==None || Killer==Controller ) + if(Killer==None || Killer==Controller) { KillerPRI = PlayerReplicationInfo; KillerPawn = None; @@ -50,10 +50,10 @@ simulated function bool Died(Controller Killer, class damageType, ve else { KillerPRI = Killer.PlayerReplicationInfo; - if( KillerPRI==None || KillerPRI.Team!=PlayerReplicationInfo.Team ) + if(KillerPRI==None || KillerPRI.Team!=PlayerReplicationInfo.Team) { KillerPawn = Killer.Pawn!=None ? Killer.Pawn.Class : None; - if( PlayerController(Killer)==None ) // If was killed by a monster, don't broadcast PRI along with it. + if(PlayerController(Killer)==None) // If was killed by a monster, don't broadcast PRI along with it. KillerPRI = None; } else KillerPawn = None; @@ -62,12 +62,12 @@ simulated function bool Died(Controller Killer, class damageType, ve C.ClientKillMessage(damageType,PlayerReplicationInfo,KillerPRI,KillerPawn); } // If got killed by a zombie, turn player into a ragdoll and let em take control of a newly spawned ZED over the ragdoll. - if( bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0 ) + if(bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0) { - if ( bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange ) + if (bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange) return FALSE; bPendingRedead = true; - if ( WorldInfo.Game.PreventDeath(self, Killer, damageType, HitLocation) ) + if (WorldInfo.Game.PreventDeath(self, Killer, damageType, HitLocation)) { bPendingRedead = false; Health = max(Health, 1); @@ -76,15 +76,15 @@ simulated function bool Died(Controller Killer, class damageType, ve Health = 0; foreach LatentActions(Action) Action.AbortFor(self); - if ( Controller != None ) + if (Controller != None) WorldInfo.Game.Killed(Killer, Controller, self, damageType); else WorldInfo.Game.Killed(Killer, Controller(Owner), self, damageType); - if ( InvManager != None ) + if (InvManager != None) InvManager.OwnerDied(); Health = 1; - if( !bFeigningDeath ) + if(!bFeigningDeath) PlayFeignDeath(true,,true); Health = 0; ClearTimer('UnsetFeignDeath'); @@ -93,15 +93,15 @@ simulated function bool Died(Controller Killer, class damageType, ve } return Super.Died(Killer, DamageType, HitLocation); } -simulated function BroadcastDeathMessage( Controller Killer ); +simulated function BroadcastDeathMessage(Controller Killer); -function SetBatteryRate( float Rate ) +function SetBatteryRate(float Rate) { BatteryDrainRate = Default.BatteryDrainRate*Rate; NVGBatteryDrainRate = Default.NVGBatteryDrainRate*Rate; ClientSetBatteryRate(Rate); } -simulated reliable client function ClientSetBatteryRate( float Rate ) +simulated reliable client function ClientSetBatteryRate(float Rate) { BatteryDrainRate = Default.BatteryDrainRate*Rate; NVGBatteryDrainRate = Default.NVGBatteryDrainRate*Rate; @@ -123,92 +123,92 @@ event bool HealDamage(int Amount, Controller Healer, class DamageTyp InstigatorPC = ExtPlayerController(Healer); InstigatorPerk = InstigatorPC.GetPerk(); - if( InstigatorPerk != None && bCanRepairArmor ) - bRepairedArmor = InstigatorPC.GetPerk().RepairArmor( self ); + if(InstigatorPerk != None && bCanRepairArmor) + bRepairedArmor = InstigatorPC.GetPerk().RepairArmor(self); EPRI = ExtPlayerReplicationInfo(InstigatorPC.PlayerReplicationInfo); - if( EPRI != none ) + if(EPRI != none) { InstigatorExtPerk = ExtPlayerController(Controller).ActivePerkManager.CurrentPerk; - if( InstigatorExtPerk != none && Ext_PerkFieldMedic(InstigatorExtPerk) != none ) + if(InstigatorExtPerk != none && Ext_PerkFieldMedic(InstigatorExtPerk) != none) { - if( Ext_PerkFieldMedic(InstigatorExtPerk).bHealingBoost ) + if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingBoost) UpdateHealingSpeedBoostMod(InstigatorPC); - if( Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost ) + if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost) UpdateHealingDamageBoostMod(InstigatorPC); - if( Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield ) + if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield) UpdateHealingShieldMod(InstigatorPC); } } - if( Amount > 0 && IsAliveAndWell() && Health < HealthMax ) + if(Amount > 0 && IsAliveAndWell() && Health < HealthMax) { // Play any healing effects attached to this damage type KFDT = class(DamageType); - if( KFDT != none && KFDT.default.bNoPain ) - PlayHeal( KFDT ); + if(KFDT != none && KFDT.default.bNoPain) + PlayHeal(KFDT); - if( Role == ROLE_Authority ) + if(Role == ROLE_Authority) { - if( Healer==None || Healer.PlayerReplicationInfo == None ) + if(Healer==None || Healer.PlayerReplicationInfo == None) return false; InstigatorPRI = KFPlayerReplicationInfo(Healer.PlayerReplicationInfo); ScAmount = Amount; - if( InstigatorPerk != none ) - InstigatorPerk.ModifyHealAmount( ScAmount ); + if(InstigatorPerk != none) + InstigatorPerk.ModifyHealAmount(ScAmount); UsedHealAmount = ScAmount; // You can never have a HealthToRegen value that's greater than HealthMax - if( Health + HealthToRegen + UsedHealAmount > HealthMax ) + if(Health + HealthToRegen + UsedHealAmount > HealthMax) UsedHealAmount = Min(HealthMax - (Health + HealthToRegen),255-HealthToRegen); else UsedHealAmount = Min(UsedHealAmount,255-HealthToRegen); HealthToRegen += UsedHealAmount; RepRegenHP = HealthToRegen; - if( !IsTimerActive('GiveHealthOverTime') ) + if(!IsTimerActive('GiveHealthOverTime')) SetTimer(HealthRegenRate, true, 'GiveHealthOverTime'); // Give the healer money/XP for helping a teammate - if( Healer.Pawn != none && Healer.Pawn != self ) + if(Healer.Pawn != none && Healer.Pawn != self) { - DoshEarned = ( UsedHealAmount / float(HealthMax) ) * HealerRewardScaler; - if( InstigatorPRI!=None ) + DoshEarned = (UsedHealAmount / float(HealthMax)) * HealerRewardScaler; + if(InstigatorPRI!=None) InstigatorPRI.AddDosh(Max(DoshEarned, 0), true); - if( InstigatorPC!=None ) - InstigatorPC.AddHealPoints( UsedHealAmount ); + if(InstigatorPC!=None) + InstigatorPC.AddHealPoints(UsedHealAmount); } - if( Healer.bIsPlayer ) + if(Healer.bIsPlayer) { - if( Healer != Controller ) + if(Healer != Controller) { - if( InstigatorPC!=None ) + if(InstigatorPC!=None) { - if( !InstigatorPC.bClientHideNumbers ) + if(!InstigatorPC.bClientHideNumbers) InstigatorPC.ClientNumberMsg(UsedHealAmount,Location,DMG_Heal); - InstigatorPC.ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo ); + InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo); } KFPC = ExtPlayerController(Controller); - if( KFPC!=None ) - KFPC.ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo ); + if(KFPC!=None) + KFPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo); } - else if( bMessageHealer && InstigatorPC!=None ) - InstigatorPC.ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_HealedSelf, PlayerReplicationInfo ); + else if(bMessageHealer && InstigatorPC!=None) + InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedSelf, PlayerReplicationInfo); } // don't play dialog for healing done through perk skills (e.g. berserker vampire skill) - if( bMessageHealer ) + if(bMessageHealer) { - `DialogManager.PlayHealingDialog( KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax) ); + `DialogManager.PlayHealingDialog(KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax)); } // Reduce burn duration and damage in half if you heal while burning - for( i = 0; i < DamageOverTimeArray.Length; ++i ) + for(i = 0; i < DamageOverTimeArray.Length; ++i) { - if( DamageOverTimeArray[i].DoT_Type == DOT_Fire ) + if(DamageOverTimeArray[i].DoT_Type == DOT_Fire) { DamageOverTimeArray[i].Duration *= 0.5; DamageOverTimeArray[i].Damage *= 0.5; @@ -231,7 +231,7 @@ function GiveHealthOverTime() simulated event ReplicatedEvent(name VarName) { - switch( VarName ) + switch(VarName) { case 'bFeigningDeath': PlayFeignDeath(bFeigningDeath); @@ -248,11 +248,11 @@ simulated event ReplicatedEvent(name VarName) // Feign death triggers: function PlayHit(float Damage, Controller InstigatedBy, vector HitLocation, class damageType, vector Momentum, TraceHitInfo HitInfo) { - if( damageType!=class'DmgType_Fell' ) // Not from falling! + if(damageType!=class'DmgType_Fell') // Not from falling! { - if( bRagdollFromMomentum && Damage>2 && VSizeSq(Momentum)>1000000.f && Rand(3)==0 ) // Square(1000) + if(bRagdollFromMomentum && Damage>2 && VSizeSq(Momentum)>1000000.f && Rand(3)==0) // Square(1000) SetFeignDeath(3.f+FRand()*2.5f); // Randomly knockout a player if hit by a huge force. - else if( bRagdollFromBackhit && Damage>20 && VSizeSq(Momentum)>40000.f && (vector(Rotation) Dot Momentum)>0.f && Rand(4)==0 ) + else if(bRagdollFromBackhit && Damage>20 && VSizeSq(Momentum)>40000.f && (vector(Rotation) Dot Momentum)>0.f && Rand(4)==0) SetFeignDeath(2.f+FRand()*3.f); // Randomly knockout a player if hit from behind. } Super.PlayHit(Damage,InstigatedBy,HitLocation,damageType,Momentum,HitInfo); @@ -262,10 +262,10 @@ event Landed(vector HitNormal, actor FloorActor) local float ExcessSpeed; Super.Landed(HitNormal, FloorActor); - if( bRagdollFromFalling ) + if(bRagdollFromFalling) { ExcessSpeed = Velocity.Z / (-MaxFallSpeed); - if( ExcessSpeed>1.25 ) // Knockout a player after landed from too high. + if(ExcessSpeed>1.25) // Knockout a player after landed from too high. { Velocity.Z = 0; // Dont go clip through floor now... Velocity.X*=0.5; @@ -273,27 +273,27 @@ event Landed(vector HitNormal, actor FloorActor) SetFeignDeath((3.f+FRand())*ExcessSpeed); } } - else if( BHopAccelSpeed>0 ) + else if(BHopAccelSpeed>0) SetTimer((IsLocallyControlled() ? 0.17 : 1.f),false,'ResetBHopAccel'); // Replicating from client to server here because Server Tickrate may screw clients over from executing bunny hopping. } // ================================================================== // Bunny hopping: -function bool DoJump( bool bUpdating ) +function bool DoJump(bool bUpdating) { local float V; - if ( Super.DoJump(bUpdating) ) + if (Super.DoJump(bUpdating)) { // Accelerate if bunnyhopping. - if( bHasBunnyHop && VSizeSq2D(Velocity)>Square(GroundSpeed*0.75) ) + if(bHasBunnyHop && VSizeSq2D(Velocity)>Square(GroundSpeed*0.75)) { - if( BHopAccelSpeed<20 ) + if(BHopAccelSpeed<20) { - if( BHopAccelSpeed==0 ) + if(BHopAccelSpeed==0) BHopSpeedMod = 1.f; - if( BHopAccelSpeed<5 ) + if(BHopAccelSpeed<5) V = 1.15; else { @@ -313,15 +313,15 @@ function bool DoJump( bool bUpdating ) } return false; } -simulated function ResetBHopAccel( optional bool bSkipRep ) // Set on Landed, or Tick if falling 2D speed is too low. +simulated function ResetBHopAccel(optional bool bSkipRep) // Set on Landed, or Tick if falling 2D speed is too low. { - if( BHopAccelSpeed>0 ) + if(BHopAccelSpeed>0) { BHopAccelSpeed = 0; AirControl = Default.AirControl; GroundSpeed /= BHopSpeedMod; UpdateGroundSpeed(); - if( WorldInfo.NetMode==NM_Client && !bSkipRep ) + if(WorldInfo.NetMode==NM_Client && !bSkipRep) NotifyHasStopped(); } } @@ -330,12 +330,12 @@ function UpdateGroundSpeed() local KFInventoryManager InvM; local float HealthMod; - if ( Role < ROLE_Authority ) + if (Role < ROLE_Authority) return; InvM = KFInventoryManager(InvManager); HealthMod = (InvM != None) ? InvM.GetEncumbranceSpeedMod() : 1.f * (1.f - LowHealthSpeedPenalty); - if( BHopAccelSpeed>0 ) + if(BHopAccelSpeed>0) HealthMod *= BHopSpeedMod; // First reset to default so multipliers do not stack @@ -344,7 +344,7 @@ function UpdateGroundSpeed() SprintSpeed = default.SprintSpeed * HealthMod; // Ask our perk to set the new ground speed based on weapon type - if( GetPerk() != none ) + if(GetPerk() != none) { GetPerk().ModifySpeed(GroundSpeed); GetPerk().ModifySpeed(SprintSpeed); @@ -358,22 +358,22 @@ reliable server function NotifyHasStopped() // ================================================================== // Feign death (UT3): -simulated function Tick( float Delta ) +simulated function Tick(float Delta) { Super.Tick(Delta); - if( bPlayingFeignDeathRecovery ) + if(bPlayingFeignDeathRecovery) { // interpolate Controller yaw to our yaw so that we don't get our rotation snapped around when we get out of feign death Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(Delta*2.f),0.f); - if( Mesh.PhysicsWeight<=0 ) + if(Mesh.PhysicsWeight<=0) StartFeignDeathRecoveryAnim(); } - if( BHopAccelSpeed>0 ) + if(BHopAccelSpeed>0) { - if( Physics==PHYS_Falling && VSizeSq2D(Velocity)0 && bCanBecomeRagdoll && NoRagdollChance<1.f && (NoRagdollChance==0.f || FRand()>NoRagdollChance) ) + if(WorldInfo.NetMode!=NM_Client && !bFeigningDeath && Health>0 && bCanBecomeRagdoll && NoRagdollChance<1.f && (NoRagdollChance==0.f || FRand()>NoRagdollChance)) { Time = FMax(1.f,Time); PlayFeignDeath(true); @@ -399,25 +399,25 @@ function SetFeignDeath( float Time ) } function UnsetFeignDeath() { - if( bFeigningDeath ) + if(bFeigningDeath) PlayFeignDeath(false); } -simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional bool bTransformMode ) +simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional bool bTransformMode) { local vector FeignLocation, HitLocation, HitNormal, TraceEnd, Impulse; local rotator NewRotation; local float UnFeignZAdjust; - if( Health<=0 && WorldInfo.NetMode!=NM_Client ) + if(Health<=0 && WorldInfo.NetMode!=NM_Client) return; // If dead, don't do it. NotifyOutOfBattery(); // Stop nightvision on client. bFeigningDeath = bEnable; - if ( bEnable ) + if (bEnable) { - if( bFPLegsAttached ) + if(bFPLegsAttached) { bFPLegsAttached = false; DetachComponent(FPBodyMesh); @@ -427,7 +427,7 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional bPlayingFeignDeathRecovery = false; ClearTimer('OnWakeUpFinished'); - if( !bTransformMode ) + if(!bTransformMode) GotoState('FeigningDeath'); // if we had some other rigid body thing going on, cancel it @@ -452,9 +452,9 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional Mesh.SetHasPhysicsAssetInstance(false); - if( !InitRagdoll() ) // Ragdoll error! + if(!InitRagdoll()) // Ragdoll error! { - if( PlayerController(Controller)!=None ) + if(PlayerController(Controller)!=None) PlayerController(Controller).ClientMessage("Error: InitRagdoll() failed!"); return; } @@ -467,7 +467,7 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional // Set all kinematic bodies to the current root velocity, since they may not have been updated during normal animation // and therefore have zero derived velocity (this happens in 1st person camera mode). UnFeignZAdjust = VSize(Velocity); - if( UnFeignZAdjust>700.f ) // Limit by a maximum velocity force to prevent from going through walls. + if(UnFeignZAdjust>700.f) // Limit by a maximum velocity force to prevent from going through walls. Mesh.SetRBLinearVelocity((Velocity/UnFeignZAdjust)*700.f, false); else Mesh.SetRBLinearVelocity(Velocity, false); @@ -485,14 +485,14 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional FeignLocation = Location; CollisionComponent = CylinderComponent; TraceEnd = Location + vect(0,0,1) * GetCollisionHeight(); - if (Trace(HitLocation, HitNormal, TraceEnd, Location, true, GetCollisionExtent()) == None ) + if (Trace(HitLocation, HitNormal, TraceEnd, Location, true, GetCollisionExtent()) == None) { HitLocation = TraceEnd; } - if ( !SetFeignEndLocation(HitLocation, FeignLocation) && WorldInfo.NetMode!=NM_Client ) + if (!SetFeignEndLocation(HitLocation, FeignLocation) && WorldInfo.NetMode!=NM_Client) { UnfeignFailedCount++; - if ( UnFeignfailedCount > 4 || bForce ) + if (UnFeignfailedCount > 4 || bForce) { SetLocation(PickNearestNode()); // Just teleport to nearest pathnode. } @@ -552,7 +552,7 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional else FeignRecoverAnim = 'Getup_F_V1'; // Init wakeup anim. - if( Mesh.AnimSets.Find(WakeUpAnimSet)==-1 ) + if(Mesh.AnimSets.Find(WakeUpAnimSet)==-1) Mesh.AnimSets.AddItem(WakeUpAnimSet); BodyStanceNodes[EAS_FullBody].bNoNotifies = true; BodyStanceNodes[EAS_FullBody].PlayCustomAnim(FeignRecoverAnim,0.025f,,,,true); @@ -568,7 +568,7 @@ final function vector PickNearestNode() foreach WorldInfo.AllNavigationPoints(class'NavigationPoint',N) { Dist = VSizeSq(N.Location-Location); - if( Best==None || Dist DamageType, vector HitLoc) Mesh.SetHasPhysicsAssetInstance(false); Mesh.SetHasPhysicsAssetInstance(true); - if( bFPLegsAttached ) + if(bFPLegsAttached) { bFPLegsAttached = false; DetachComponent(FPBodyMesh); @@ -667,7 +667,7 @@ simulated function PlayRagdollDeath(class DamageType, vector HitLoc) PrepareRagdoll(); - if ( InitRagdoll() ) + if (InitRagdoll()) { // Switch to a good RigidBody TickGroup to fix projectiles passing through the mesh // https://udn.unrealengine.com/questions/190581/projectile-touch-not-called.html @@ -682,7 +682,7 @@ simulated function PlayRagdollDeath(class DamageType, vector HitLoc) CheckHitInfo(HitInfo, Mesh, HitDirection, HitLoc); // Play ragdoll death animation (bSkipReplication=TRUE) - if( CanDoSpecialMove(SM_DeathAnim) && ClassIsChildOf(DamageType, class'KFDamageType') ) + if(CanDoSpecialMove(SM_DeathAnim) && ClassIsChildOf(DamageType, class'KFDamageType')) { DoSpecialMove(SM_DeathAnim, TRUE,,,TRUE); KFSM_DeathAnim(SpecialMoves[SM_DeathAnim]).PlayDeathAnimation(DamageType, HitDirection, HitInfo.BoneName); @@ -695,7 +695,7 @@ simulated function PlayRagdollDeath(class DamageType, vector HitLoc) } simulated function StartFeignDeathRecoveryAnim() { - if( FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs ) + if(FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) { bFPLegsAttached = true; AttachComponent(FPBodyMesh); @@ -729,7 +729,7 @@ function AddDefaultInventory() local KFPerk MyPerk; MyPerk = GetPerk(); - if( MyPerk != none ) + if(MyPerk != none) MyPerk.AddDefaultInventory(self); Super(KFPawn).AddDefaultInventory(); @@ -737,34 +737,34 @@ function AddDefaultInventory() simulated event FellOutOfWorld(class dmgType) { - if ( Role==ROLE_Authority && NextRedeemTimer(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class')); } } @@ -807,7 +807,7 @@ ignores FaceRotation, SetMovementPhysics; { bIsSprinting = false; } - simulated event RigidBodyCollision( PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent, const out CollisionImpactData RigidCollisionData, int ContactIndex ) + simulated event RigidBodyCollision(PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent, const out CollisionImpactData RigidCollisionData, int ContactIndex) { // only check fall damage for Z axis collisions if (Abs(RigidCollisionData.ContactInfos[0].ContactNormal.Z) > 0.5) @@ -852,9 +852,9 @@ ignores FaceRotation, SetMovementPhysics; { local rotator NewRotation; - if( bPlayingFeignDeathRecovery ) + if(bPlayingFeignDeathRecovery) { - if( PlayerController(Controller) != None ) + if(PlayerController(Controller) != None) { // interpolate Controller yaw to our yaw so that we don't get our rotation snapped around when we get out of feign death NewRotation = Controller.Rotation; @@ -862,7 +862,7 @@ ignores FaceRotation, SetMovementPhysics; Controller.SetRotation(NewRotation); } Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(DeltaTime*2.f),0.f); - if( Mesh.PhysicsWeight<=0 ) + if(Mesh.PhysicsWeight<=0) StartFeignDeathRecoveryAnim(); } } @@ -872,7 +872,7 @@ ignores FaceRotation, SetMovementPhysics; local KFWeapon UTWeap; // Abort current special move - if( IsDoingSpecialMove() ) + if(IsDoingSpecialMove()) SpecialMoveHandler.EndSpecialMove(); bCanPickupInventory = false; @@ -885,11 +885,11 @@ ignores FaceRotation, SetMovementPhysics; UTWeap.SetIronSights(false); UTWeap.PlayWeaponPutDown(0.5f); } - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { - if( ExtPlayerController(Controller)!=None ) + if(ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(true); - else if( Controller!=None ) + else if(Controller!=None) Controller.ReplicatedEvent('RagdollMove'); } } @@ -905,7 +905,7 @@ ignores FaceRotation, SetMovementPhysics; } function bool CanBeRedeemed() { - if( bFeigningDeath ) + if(bFeigningDeath) PlayFeignDeath(false,true); NextRedeemTimer = WorldInfo.TimeSeconds+0.25; return false; @@ -916,13 +916,13 @@ ignores FaceRotation, SetMovementPhysics; Mesh.AnimSets.RemoveItem(WakeUpAnimSet); BodyStanceNodes[EAS_FullBody].bNoNotifies = false; - if (NextStateName != 'Dying' ) + if (NextStateName != 'Dying') { bNoWeaponFiring = default.bNoWeaponFiring; bCanPickupInventory = default.bCanPickupInventory; UTWeap = KFWeapon(Weapon); - if ( UTWeap != None ) + if (UTWeap != None) { WeaponAttachmentTemplate = UTWeap.AttachmentArchetype; UTWeap.PlayWeaponEquip(0.5f); @@ -930,11 +930,11 @@ ignores FaceRotation, SetMovementPhysics; Global.SetMovementPhysics(); bPlayingFeignDeathRecovery = false; - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { - if( ExtPlayerController(Controller)!=None ) + if(ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(false); - else if( Controller!=None ) + else if(Controller!=None) Controller.ReplicatedEvent('EndRagdollMove'); } @@ -952,9 +952,9 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die { bCanPickupInventory = false; bNoWeaponFiring = true; - if( ExtPlayerController(Controller)!=None ) + if(ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(true); - else if( Controller!=None ) + else if(Controller!=None) Controller.ReplicatedEvent('RagdollMove'); SetTimer(2,false,'TransformToZed'); @@ -970,7 +970,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die { local VS_ZedRecentZed Z; - if( Controller==None ) + if(Controller==None) { Destroy(); return; @@ -978,7 +978,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die PlayFeignDeath(false); SetCollision(false,false); Z = Spawn(class'VS_ZedRecentZed',,,Location,Rotation,,true); - if( Z==None ) + if(Z==None) { Super.Died(None,Class'DamageType',Location); return; @@ -991,15 +991,15 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die Controller.Possess(Z,false); WorldInfo.Game.ChangeTeam(Controller,255,true); WorldInfo.Game.SetPlayerDefaults(Z); - if( ExtPlayerController(Controller)!=None ) + if(ExtPlayerController(Controller)!=None) Controller.GoToState('RagdollMove'); - else if( Controller!=None ) + else if(Controller!=None) Controller.ReplicatedEvent('RagdollMove'); Z.WakeUp(); - if( ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None ) + if(ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None) { ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealth = Min(Z.Health,255); - ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte( float(Z.Health) / float(Z.HealthMax) ); + ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte(float(Z.Health) / float(Z.HealthMax)); } } Controller = None; @@ -1021,7 +1021,7 @@ simulated final function InitFPLegs() FPBodyMesh.SetNotifyRigidBodyCollision(false); FPBodyMesh.SetTraceBlocking(false, false); - for( i=0; i0 ) + if(Health>0) { bOnFirstPerson = !bVisible; - if( AttachedBackItem!=None ) + if(AttachedBackItem!=None) AttachedBackItem.SetHidden(bOnFirstPerson); UpdateFPLegs(); } @@ -1046,14 +1046,14 @@ simulated function SetMeshVisibility(bool bVisible) simulated final function UpdateFPLegs() { - if( FPBodyMesh!=None ) + if(FPBodyMesh!=None) { - if( !bFPLegsAttached && Physics!=PHYS_RigidBody && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs ) + if(!bFPLegsAttached && Physics!=PHYS_RigidBody && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) { bFPLegsAttached = true; AttachComponent(FPBodyMesh); - if( !bFPLegsInit && CharacterArch!=None ) + if(!bFPLegsInit && CharacterArch!=None) InitFPLegs(); } FPBodyMesh.SetHidden(!bOnFirstPerson || !Class'ExtPlayerController'.Default.bShowFPLegs); @@ -1062,11 +1062,11 @@ simulated final function UpdateFPLegs() simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) { - if( SkelComp==Mesh ) // Do not allow first person legs eat up animation slots. + if(SkelComp==Mesh) // Do not allow first person legs eat up animation slots. Super.PostInitAnimTree(SkelComp); } -simulated final function SetBackpackWeapon( class WC ) +simulated final function SetBackpackWeapon(class WC) { local KFCharacterInfo_Human MyCharacter; local Rotator MyRot; @@ -1075,19 +1075,19 @@ simulated final function SetBackpackWeapon( class WC ) local int i; BackpackWeaponClass = WC; - if( WorldInfo.NetMode==NM_DedicatedServer ) + if(WorldInfo.NetMode==NM_DedicatedServer) return; - if( WC!=None ) + if(WC!=None) { - if( AttachedBackItem==None ) + if(AttachedBackItem==None) { AttachedBackItem = new(Self) class'SkeletalMeshComponent'; AttachedBackItem.SetHidden(false); AttachedBackItem.SetLightingChannels(PawnLightingChannel); } AttachedBackItem.SetSkeletalMesh(WC.Default.AttachmentArchetype.SkelMesh); - for( i=0; i WC ) MyCharacter = KFPlayerReplicationInfo(PlayerReplicationInfo).CharacterArchetypes[KFPlayerReplicationInfo(PlayerReplicationInfo).RepCustomizationInfo.CharacterIndex]; WM = WC.Default.AttachmentArchetype.SkelMesh.Name; - if( ClassIsChildOf(WC, class'KFWeap_Edged_Knife') ) + if(ClassIsChildOf(WC, class'KFWeap_Edged_Knife')) { MyPos = vect(0,0,10); MyRot = rot(-16384,-8192,0); B = 'LeftUpLeg'; } - else if( class(WC) != none || class(WC) != none || class(WC) != none || class(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase') ) + else if(class(WC) != none || class(WC) != none || class(WC) != none || class(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase')) { MyPos = vect(0,0,10); MyRot = rot(0,0,16384); B = 'LeftUpLeg'; } - else if( ClassIsChildOf(WC, class'KFWeap_MeleeBase') ) + else if(ClassIsChildOf(WC, class'KFWeap_MeleeBase')) { MyPos = vect(-5,15,0); MyRot = rot(0,0,0); - if( class(WC) != none || class(WC) != none ) + if(class(WC) != none || class(WC) != none) MyPos.Z = -20; B = 'Spine'; @@ -1125,10 +1125,10 @@ simulated final function SetBackpackWeapon( class WC ) MyPos = vect(-18.5,16.5,-18); MyRot = rot(0,0,0); - if( MyCharacter == KFCharacterInfo_Human'CHR_Playable_ARCH.chr_DJSkully_archetype' ) + if(MyCharacter == KFCharacterInfo_Human'CHR_Playable_ARCH.chr_DJSkully_archetype') MyRot.Roll = 8192; - switch( WM ) + switch(WM) { case 'Wep_3rdP_MB500_Rig': MyPos.X = -45; @@ -1153,14 +1153,14 @@ simulated final function SetBackpackWeapon( class WC ) Mesh.AttachComponent(AttachedBackItem, B); AttachedBackItem.SetHidden(bOnFirstPerson); } - else if( AttachedBackItem!=None ) + else if(AttachedBackItem!=None) AttachedBackItem.SetHidden(true); } simulated function PlayDying(class DamageType, vector HitLoc) { FPBodyMesh.SetHidden(true); - if( AttachedBackItem!=None ) + if(AttachedBackItem!=None) AttachedBackItem.SetHidden(true); Super.PlayDying(DamageType,HitLoc); } @@ -1169,7 +1169,7 @@ simulated function SetCharacterAnimationInfo() { Super.SetCharacterAnimationInfo(); - if( !bFPLegsInit && bFPLegsAttached ) + if(!bFPLegsInit && bFPLegsAttached) InitFPLegs(); } @@ -1186,7 +1186,7 @@ simulated function PlayWeaponSwitch(Weapon OldWeapon, Weapon NewWeapon) { Super.PlayWeaponSwitch(OldWeapon, NewWeapon); - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { PlayerOldWeapon = KFWeapon(OldWeapon); SetBackpackWeapon(PlayerOldWeapon!=None ? PlayerOldWeapon.Class : None); @@ -1198,11 +1198,11 @@ simulated function UpdateHealingSpeedBoostMod(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = GetMedicPerk(Healer); - if( MedPerk == None ) + if(MedPerk == None) return; - HealingSpeedBoostMod = Min( HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost() ); - SetTimer( MedPerk.GetHealingSpeedBoostDuration(),, nameOf(ResetHealingSpeedBoost) ); + HealingSpeedBoostMod = Min(HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost()); + SetTimer(MedPerk.GetHealingSpeedBoostDuration(),, nameOf(ResetHealingSpeedBoost)); UpdateGroundSpeed(); } @@ -1217,8 +1217,8 @@ simulated function ResetHealingSpeedBoost() HealingSpeedBoostMod = 0; UpdateGroundSpeed(); - if( IsTimerActive( nameOf( ResetHealingSpeedBoost ) ) ) - ClearTimer( nameOf( ResetHealingSpeedBoost ) ); + if(IsTimerActive(nameOf(ResetHealingSpeedBoost))) + ClearTimer(nameOf(ResetHealingSpeedBoost)); } simulated function UpdateHealingDamageBoostMod(ExtPlayerController Healer) @@ -1226,11 +1226,11 @@ simulated function UpdateHealingDamageBoostMod(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = GetMedicPerk(Healer); - if( MedPerk == None ) + if(MedPerk == None) return; - HealingDamageBoostMod = Min( HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost() ); - SetTimer( MedPerk.GetHealingDamageBoostDuration(),, nameOf(ResetHealingDamageBoost) ); + HealingDamageBoostMod = Min(HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost()); + SetTimer(MedPerk.GetHealingDamageBoostDuration(),, nameOf(ResetHealingDamageBoost)); } simulated function float GetHealingDamageBoostModifier() @@ -1241,8 +1241,8 @@ simulated function float GetHealingDamageBoostModifier() simulated function ResetHealingDamageBoost() { HealingDamageBoostMod = 0; - if( IsTimerActive( nameOf( ResetHealingDamageBoost ) ) ) - ClearTimer( nameOf( ResetHealingDamageBoost ) ); + if(IsTimerActive(nameOf(ResetHealingDamageBoost))) + ClearTimer(nameOf(ResetHealingDamageBoost)); } simulated function UpdateHealingShieldMod(ExtPlayerController Healer) @@ -1250,11 +1250,11 @@ simulated function UpdateHealingShieldMod(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = GetMedicPerk(Healer); - if( MedPerk == None ) + if(MedPerk == None) return; - HealingShieldMod = Min( HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield() ); - SetTimer( MedPerk.GetHealingShieldDuration(),, nameOf(ResetHealingShield) ); + HealingShieldMod = Min(HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield()); + SetTimer(MedPerk.GetHealingShieldDuration(),, nameOf(ResetHealingShield)); } simulated function float GetHealingShieldModifier() @@ -1265,8 +1265,8 @@ simulated function float GetHealingShieldModifier() simulated function ResetHealingShield() { HealingShieldMod = 0; - if( IsTimerActive( nameOf( ResetHealingShield ) ) ) - ClearTimer( nameOf( ResetHealingShield ) ); + if(IsTimerActive(nameOf(ResetHealingShield))) + ClearTimer(nameOf(ResetHealingShield)); } function SacrificeExplode() @@ -1276,7 +1276,7 @@ function SacrificeExplode() Super.SacrificeExplode(); DemoPerk = Ext_PerkDemolition(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk); - if( DemoPerk != none ) + if(DemoPerk != none) DemoPerk.bUsedSacrifice = true; } @@ -1285,7 +1285,7 @@ simulated function Ext_PerkFieldMedic GetMedicPerk(ExtPlayerController Healer) local Ext_PerkFieldMedic MedPerk; MedPerk = Ext_PerkFieldMedic(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk); - if( MedPerk != None ) + if(MedPerk != None) return MedPerk; return None; diff --git a/ServerExt/Classes/ExtInventoryManager.uc b/ServerExt/Classes/ExtInventoryManager.uc index 5f6fc0d..23a667f 100644 --- a/ServerExt/Classes/ExtInventoryManager.uc +++ b/ServerExt/Classes/ExtInventoryManager.uc @@ -6,9 +6,9 @@ var transient byte MoneyTossCount; reliable server function ServerThrowMoney() { - if( MoneyTossTime>WorldInfo.TimeSeconds ) + if(MoneyTossTime>WorldInfo.TimeSeconds) { - if( MoneyTossCount>=10 ) + if(MoneyTossCount>=10) return; ++MoneyTossCount; MoneyTossTime = FMax(MoneyTossTime,WorldInfo.TimeSeconds+0.5); @@ -29,9 +29,9 @@ simulated function Inventory CreateInventory(class NewInventoryItemCl SupClass = Super.CreateInventory(NewInventoryItemClass, bDoNotActivate); Wep = KFWeapon(SupClass); - if( Wep != none ) + if(Wep != none) { - if( KFWeap_Pistol_Dual9mm(Wep) != None && ExtWeap_Pistol_Dual9mm(Wep) == None ) + if(KFWeap_Pistol_Dual9mm(Wep) != None && ExtWeap_Pistol_Dual9mm(Wep) == None) { Wep.Destroy(); return Super.CreateInventory(class'ExtWeap_Pistol_Dual9mm', bDoNotActivate); @@ -47,7 +47,7 @@ simulated function CheckForExcessRemoval(KFWeapon NewWeap) { local Inventory RemoveInv, Inv; - if( KFWeap_Pistol_Dual9mm(NewWeap) != None ) + if(KFWeap_Pistol_Dual9mm(NewWeap) != None) { for (Inv = InventoryChain; Inv != None; Inv = Inv.Inventory) { diff --git a/ServerExt/Classes/ExtMenu_Gear.uc b/ServerExt/Classes/ExtMenu_Gear.uc index 5fa54a0..4a3e2e0 100644 --- a/ServerExt/Classes/ExtMenu_Gear.uc +++ b/ServerExt/Classes/ExtMenu_Gear.uc @@ -12,24 +12,24 @@ var array EmoteList; var bool bWaitingCharList,bIsCustomChar; -function InitializeMenu( KFGFxMoviePlayer_Manager InManager ) +function InitializeMenu(KFGFxMoviePlayer_Manager InManager) { super(KFGFxObject_Menu).InitializeMenu(InManager); - CheckForCustomizationPawn( GetPC() ); + CheckForCustomizationPawn(GetPC()); LocalizeText(); EmoteList = class'ExtEmoteList'.static.GetEmoteArray(); InitCharacterMenu(); - // TraderItems = KFGameReplicationInfo( GetPC().WorldInfo.GRI ).TraderItems; + // TraderItems = KFGameReplicationInfo(GetPC().WorldInfo.GRI).TraderItems; } function InitCharacterMenu() { ExtPRI = ExtPlayerReplicationInfo(GetPC().PlayerReplicationInfo); - if( ExtPRI!=None && ExtPRI.bClientInitChars ) + if(ExtPRI!=None && ExtPRI.bClientInitChars) CharListRecieved(); - else if( ExtPRI==None ) + else if(ExtPRI==None) { - if( GetPC().PlayerReplicationInfo!=None ) // Faulty mod setup. + if(GetPC().PlayerReplicationInfo!=None) // Faulty mod setup. { bWaitingCharList = true; return; @@ -48,9 +48,9 @@ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) switch(WidgetName) { case 'perkSelectionContainer': - if ( PerkSelectionContainer == none ) + if (PerkSelectionContainer == none) { - PerkSelectionContainer = KFGFxGearContainer_PerksSelection( Widget ); + PerkSelectionContainer = KFGFxGearContainer_PerksSelection(Widget); PerkSelectionContainer.Initialize(self); } break; @@ -64,13 +64,13 @@ function OnOpen() local PlayerController PC; PC = GetPC(); - if( PC == none ) + if(PC == none) return; - CheckForCustomizationPawn( PC ); + CheckForCustomizationPawn(PC); //GetGameViewportClient().HandleInputAxis = OnAxisModified; - if ( PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun ) + if (PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun) { // Players cannot change characters if they are in a game SetBool("characterButtonEnabled", false); @@ -78,14 +78,14 @@ function OnOpen() } /** The customization pawn won't exist if this menu was opened mid-match */ -function CheckForCustomizationPawn( PlayerController PC ) +function CheckForCustomizationPawn(PlayerController PC) { local KFPlayerController KFPC; - if( PC.Pawn == None || (!PC.Pawn.IsAliveAndWell() && KFPawn_Customization(PC.Pawn) == None) ) + if(PC.Pawn == None || (!PC.Pawn.IsAliveAndWell() && KFPawn_Customization(PC.Pawn) == None)) { - KFPC = KFPlayerController( PC ); - if( KFPC != None ) + KFPC = KFPlayerController(PC); + if(KFPC != None) { KFPC.SpawnMidGameCustomizationPawn(); } @@ -128,9 +128,9 @@ function UpdateEmoteList() for (i = 0; i < EmoteList.length; i++) { - if ( class'ExtEmoteList'.static.GetUnlockedEmote(EmoteList[i].Id, ExtPlayerController(GetPC())) != 'NONE') + if (class'ExtEmoteList'.static.GetUnlockedEmote(EmoteList[i].Id, ExtPlayerController(GetPC())) != 'NONE') { - SlotObject = CreateObject( "Object" ); + SlotObject = CreateObject("Object"); SlotObject.SetInt("ItemIndex", i); SlotObject.SetString("label", Localize(EmoteList[i].ItemName, "EmoteName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)); TexturePath = "img://"$EmoteList[i].IconPath; @@ -157,9 +157,9 @@ function UpdateCharacterList() bWaitingCharList = false; ItemIndex = 0; DataProvider = CreateArray(); - for( i=0; i Outfit = Outfits[i]; OutfitName = Localize(CharInfoPath, OutfitKey$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString); - if( bIsCustomChar ) + if(bIsCustomChar) OutfitName = GetMenuNameStr(Outfit.MeshName); - if ( InStr(OutfitName, "?INT?") != -1 ) + if (InStr(OutfitName, "?INT?") != -1) continue; - SlotObject = CreateObject( "Object" ); + SlotObject = CreateObject("Object"); SlotObject.SetInt("ItemIndex", i); SlotObject.SetString("label", OutfitName); SlotObject.SetBool("enabled", true); - FirstSkin = UpdateOutfitVariants( OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject ); - if( string(FirstSkin.UITexture) == "Bad" ) + FirstSkin = UpdateOutfitVariants(OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject); + if(string(FirstSkin.UITexture) == "Bad") continue; TexturePath = "img://"$PathName(FirstSkin.UITexture); @@ -282,7 +282,7 @@ function SkinVariant UpdateOutfitVariants(string OutfitKey, string KeyName, out FirstSkin = Skin; bFoundFirst = true; } - SlotObject = CreateObject( "Object" ); + SlotObject = CreateObject("Object"); SlotObject.SetInt("ItemIndex", i); SlotObject.SetString("label", Localize(SectionPath, KeyName$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)); TexturePath = "img://"$PathName(Skin.UITexture); @@ -312,7 +312,7 @@ function UpdateAttachmentsList(array Attachments) MyPawn = GetPC().Pawn; // Insert blank object - SlotObject = CreateObject( "Object" ); + SlotObject = CreateObject("Object"); SlotObject.SetString("label", class'KFGFxMenu_Gear'.default.NoneString); SlotObject.SetString("source", "img://"$class'KFGFxMenu_Gear'.default.ClearImagePath); SlotObject.SetInt("ItemIndex", INDEX_NONE); @@ -323,11 +323,11 @@ function UpdateAttachmentsList(array Attachments) for (i = 0; i < Attachments.Length; i++) { Variant = Attachments[i]; - if ( class'ExtCharacterInfo'.static.IsAttachmentAvailable(CurrentCharInfo, Variant, MyPawn) ) + if (class'ExtCharacterInfo'.static.IsAttachmentAvailable(CurrentCharInfo, Variant, MyPawn)) { - SlotObject = CreateObject( "Object" ); + SlotObject = CreateObject("Object"); SlotObject.SetInt("ItemIndex", i); - FirstSkin = UpdateCosmeticVariants( class'KFGFxMenu_Gear'.default.AttachmentKey, class'KFGFxMenu_Gear'.default.AttachmentSkinKey, Variant.AttachmentItem, i, SlotObject ); + FirstSkin = UpdateCosmeticVariants(class'KFGFxMenu_Gear'.default.AttachmentKey, class'KFGFxMenu_Gear'.default.AttachmentSkinKey, Variant.AttachmentItem, i, SlotObject); AttachmentName = bIsCustomChar ? GetMenuNameStr(Variant.MeshName) : Localize(string(Variant.AttachmentItem.Name), class'KFGFxMenu_Gear'.default.AttachmentKey, class'KFGFxMenu_Gear'.default.KFCharacterInfoString); SlotObject.SetString("label", AttachmentName); SlotObject.SetBool("enabled", true); @@ -363,7 +363,7 @@ function SkinVariant UpdateCosmeticVariants(string OutfitKey, string KeyName, KF FirstSkin = Skin; bFoundFirst = true; } - SlotObject = CreateObject( "Object" ); + SlotObject = CreateObject("Object"); SlotObject.SetInt("ItemIndex", i); SkinName = Localize(string(Attachment.Name), KeyName$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString); SlotObject.SetString("label", SkinName); @@ -393,7 +393,7 @@ function SetCurrentCharacterButtons() HeadSkinIndex = ExtPRI.RepCustomizationInfo.HeadSkinIndex; BodyMeshIndex = ExtPRI.RepCustomizationInfo.BodyMeshIndex; BodySkinIndex = ExtPRI.RepCustomizationInfo.BodySkinIndex; - if( bCustom ) + if(bCustom) { CharacterIndex = ExtPRI.CustomCharacter.CharacterIndex; HeadMeshIndex = ExtPRI.CustomCharacter.HeadMeshIndex; @@ -402,11 +402,11 @@ function SetCurrentCharacterButtons() BodySkinIndex = ExtPRI.CustomCharacter.BodySkinIndex; } - DataObject.SetString( "selectedCharacter", (bIsCustomChar ? Repl(string(CurrentCharInfo.Name),"_"," ") : Localize(CharInfoPath, "CharacterName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)) ); - DataObject.SetString( "characterBio", (bIsCustomChar ? Repl(CurrentCharInfo.ArmMeshPackageName,"|","\n") : Localize(CharInfoPath, "Description", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)) ); - DataObject.SetInt( "selectedCharacterIndex", CharacterIndex ); + DataObject.SetString("selectedCharacter", (bIsCustomChar ? Repl(string(CurrentCharInfo.Name),"_"," ") : Localize(CharInfoPath, "CharacterName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString))); + DataObject.SetString("characterBio", (bIsCustomChar ? Repl(CurrentCharInfo.ArmMeshPackageName,"|","\n") : Localize(CharInfoPath, "Description", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString))); + DataObject.SetInt("selectedCharacterIndex", CharacterIndex); - SetObject( "selectedCharacter", DataObject); + SetObject("selectedCharacter", DataObject); //set head SetGearButtons(HeadMeshIndex, HeadSkinIndex, class'KFGFxMenu_Gear'.Default.HeadMeshKey, class'KFGFxMenu_Gear'.Default.HeadSkinKey, class'KFGFxMenu_Gear'.Default.HeadFunctionKey); @@ -423,18 +423,18 @@ function SetEmoteButton() local GFxObject DataObject; local int EmoteIndex; - EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex( class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC()))); + EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC()))); DataObject = CreateObject("Object"); if(EmoteIndex == 255) { - DataObject.SetString( "selectedEmote", ""); - DataObject.SetInt( "selectedEmoteIndex", 0 ); + DataObject.SetString("selectedEmote", ""); + DataObject.SetInt("selectedEmoteIndex", 0); } else { - DataObject.SetString( "selectedEmote", Localize(EmoteList[EmoteIndex].ItemName, "EmoteName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)); - DataObject.SetInt( "selectedEmoteIndex", 0 ); + DataObject.SetString("selectedEmote", Localize(EmoteList[EmoteIndex].ItemName, "EmoteName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)); + DataObject.SetInt("selectedEmoteIndex", 0); } @@ -449,18 +449,18 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski local string SkinName, MeshName; local GFxObject DataObject; - if( bWaitingCharList ) + if(bWaitingCharList) return; DataObject = CreateObject("Object"); if(MeshIndex == `CLEARED_ATTACHMENT_INDEX) { - DataObject.SetString( sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString ); + DataObject.SetString(sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString); } - else if( bIsCustomChar ) + else if(bIsCustomChar) { - if( MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey ) + if(MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey) { SkinName = GetMenuName(CurrentCharInfo.HeadVariants[MeshIndex].SkinVariations[SkinIndex].Skin); MeshName = GetMenuNameStr(CurrentCharInfo.HeadVariants[MeshIndex].MeshName); @@ -471,7 +471,7 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski MeshName = GetMenuNameStr(CurrentCharInfo.BodyVariants[MeshIndex].MeshName); } - DataObject.SetString( sectionFunctionName, MeshName @"\n" @SkinName ); + DataObject.SetString(sectionFunctionName, MeshName @"\n" @SkinName); } else { @@ -480,13 +480,13 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski SkinName = Localize(SectionPath, SkinKey$SkinIndex, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString); MeshName = Localize(CharInfoPath, CurrentMesh, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString); - DataObject.SetString( sectionFunctionName, MeshName @"\n" @SkinName ); + DataObject.SetString(sectionFunctionName, MeshName @"\n" @SkinName); } - DataObject.SetInt( (sectionFunctionName$"Index"), MeshIndex); - DataObject.SetInt( (sectionFunctionName$"SkinIndex"), SkinIndex); + DataObject.SetInt((sectionFunctionName$"Index"), MeshIndex); + DataObject.SetInt((sectionFunctionName$"SkinIndex"), SkinIndex); - SetObject( sectionFunctionName, DataObject); + SetObject(sectionFunctionName, DataObject); } /** Update the labels for our currently equipped attachments */ @@ -496,7 +496,7 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa local int i, AttachmentIndex; local bool bCustom; - if( bWaitingCharList ) + if(bWaitingCharList) return; bCustom = ExtPRI.UsesCustomChar(); @@ -505,7 +505,7 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa for(i = 0; i < `MAX_COSMETIC_ATTACHMENTS; i++) { AttachmentIndex = bCustom ? ExtPRI.CustomCharacter.AttachmentMeshIndices[i] : ExtPRI.RepCustomizationInfo.AttachmentMeshIndices[i]; - if( AttachmentIndex == `CLEARED_ATTACHMENT_INDEX ) + if(AttachmentIndex == `CLEARED_ATTACHMENT_INDEX) { DataObject.SetString("selectedAttachment_"$i, "----"); } @@ -515,7 +515,7 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa } } - SetObject( sectionFunctionName, DataObject); + SetObject(sectionFunctionName, DataObject); } event OnClose() @@ -526,24 +526,24 @@ event OnClose() //GetGameViewportClient().HandleInputAxis = none; - if ( class'WorldInfo'.static.IsMenuLevel() ) + if (class'WorldInfo'.static.IsMenuLevel()) { Manager.ManagerObject.SetBool("backgroundVisible", true); } // If we are alive, in game, with a playable pawn. switch back to first person view when leaving this menu PC = GetPC(); - if( PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization') ) + if(PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization')) { - PC.ServerCamera( 'FirstPerson' ); + PC.ServerCamera('FirstPerson'); } } -event bool OnAxisModified( int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad ) +event bool OnAxisModified(int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad) { - if ( GetPC().PlayerInput.bUsingGamepad ) + if (GetPC().PlayerInput.bUsingGamepad) { - if ( Key == 'XboxTypeS_RightX' && Abs(Delta) > class'KFGFxMenu_Gear'.Default.ControllerRotationThreshold) + if (Key == 'XboxTypeS_RightX' && Abs(Delta) > class'KFGFxMenu_Gear'.Default.ControllerRotationThreshold) { Callback_RotateCamera(Delta * class'KFGFxMenu_Gear'.Default.ControllerRotationRate); } @@ -560,11 +560,11 @@ function Callback_Emote(int Index) local KFPlayerController KFPC; KFPC = KFPlayerController(GetPC()); - if( KFPC != none ) + if(KFPC != none) { class'ExtEmoteList'.static.SaveEquippedEmote(EmoteList[Index].ID, ExtPlayerController(KFPC)); - if ( ExtPawn_Customization(KFPC.Pawn) != none ) + if (ExtPawn_Customization(KFPC.Pawn) != none) { ExtPawn_Customization(KFPC.Pawn).PlayEmoteAnimation(); } @@ -573,25 +573,25 @@ function Callback_Emote(int Index) SetEmoteButton(); } -function Callback_RotateCamera( int RotationDirection ) +function Callback_RotateCamera(int RotationDirection) { local KFPlayerCamera PlayerCamera; - PlayerCamera = KFPlayerCamera( GetPC().PlayerCamera ); - if ( PlayerCamera != none ) - PlayerCamera.CustomizationCam.RotatedCamera( RotationDirection ); + PlayerCamera = KFPlayerCamera(GetPC().PlayerCamera); + if (PlayerCamera != none) + PlayerCamera.CustomizationCam.RotatedCamera(RotationDirection); } function Callback_EndRotateCamera() { local KFPlayerCamera PlayerCamera; - PlayerCamera = KFPlayerCamera( GetPC().PlayerCamera ); - if ( PlayerCamera != none ) + PlayerCamera = KFPlayerCamera(GetPC().PlayerCamera); + if (PlayerCamera != none) PlayerCamera.CustomizationCam.StartFadeRotation(); } -function Callback_Weapon( int ItemIndex, int SkinIndex ) +function Callback_Weapon(int ItemIndex, int SkinIndex) { local KFPawn_Customization KFP; @@ -602,14 +602,14 @@ function Callback_Weapon( int ItemIndex, int SkinIndex ) function Callback_BodyCamera() { - if ( KFPlayerCamera( GetPC().PlayerCamera ) != none ) - KFPlayerCamera( GetPC().PlayerCamera ).CustomizationCam.SetBodyView( 0 ); + if (KFPlayerCamera(GetPC().PlayerCamera) != none) + KFPlayerCamera(GetPC().PlayerCamera).CustomizationCam.SetBodyView(0); } function Callback_HeadCamera() { - if ( KFPlayerCamera( GetPC().PlayerCamera ) != none ) - KFPlayerCamera( GetPC().PlayerCamera ).CustomizationCam.SetBodyView( 1 ); + if (KFPlayerCamera(GetPC().PlayerCamera) != none) + KFPlayerCamera(GetPC().PlayerCamera).CustomizationCam.SetBodyView(1); } function Callback_Character(int Index) @@ -618,17 +618,17 @@ function Callback_Character(int Index) UpdateGear(); } -function Callback_Head( int MeshIndex, int SkinIndex ) +function Callback_Head(int MeshIndex, int SkinIndex) { - if( !ExtPRI.UsesCustomChar() ) // Force client to setup custom character now for this server. + if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); ExtPRI.UpdateCustomization(CO_Head, MeshIndex, SkinIndex); SetGearButtons(MeshIndex, SkinIndex, class'KFGFxMenu_Gear'.Default.HeadMeshKey, class'KFGFxMenu_Gear'.Default.HeadSkinKey, class'KFGFxMenu_Gear'.Default.HeadFunctionKey); } -function Callback_Body( int MeshIndex, int SkinIndex ) +function Callback_Body(int MeshIndex, int SkinIndex) { - if( !ExtPRI.UsesCustomChar() ) // Force client to setup custom character now for this server. + if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); ExtPRI.UpdateCustomization(CO_Body, MeshIndex, SkinIndex); @@ -641,18 +641,18 @@ function Callback_Body( int MeshIndex, int SkinIndex ) SetGearButtons(MeshIndex, SkinIndex, class'KFGFxMenu_Gear'.Default.BodyMeshKey, class'KFGFxMenu_Gear'.Default.BodySkinKey, class'KFGFxMenu_Gear'.Default.BodyFunctionKey); } -function Callback_Attachment( int MeshIndex, int SkinIndex ) +function Callback_Attachment(int MeshIndex, int SkinIndex) { local int SlotIndex; local KFPawn KFP; - if( !ExtPRI.UsesCustomChar() ) // Force client to setup custom character now for this server. + if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); KFP = KFPawn(GetPC().Pawn); - if( KFP!=None && ExtPRI!=None ) + if(KFP!=None && ExtPRI!=None) { - if( MeshIndex==`CLEARED_ATTACHMENT_INDEX ) + if(MeshIndex==`CLEARED_ATTACHMENT_INDEX) ExtPRI.RemoveAttachments(); else { diff --git a/ServerExt/Classes/ExtMenu_Inventory.uc b/ServerExt/Classes/ExtMenu_Inventory.uc index eec85c8..4d90f96 100644 --- a/ServerExt/Classes/ExtMenu_Inventory.uc +++ b/ServerExt/Classes/ExtMenu_Inventory.uc @@ -22,7 +22,7 @@ function bool IsItemActive(int ItemDefinition) return false; } -function Callback_Equip( int ItemDefinition ) +function Callback_Equip(int ItemDefinition) { local class WeaponDef; local int ItemIndex; @@ -42,7 +42,7 @@ function Callback_Equip( int ItemDefinition ) { class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, 0, ExtPlayerController(KFPC)); - if(class'WorldInfo'.static.IsConsoleBuild( )) + if(class'WorldInfo'.static.IsConsoleBuild()) { Manager.CachedProfile.ClearWeaponSkin(WeaponDef.default.WeaponClassPath); } @@ -50,7 +50,7 @@ function Callback_Equip( int ItemDefinition ) else { class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, ItemDefinition, ExtPlayerController(KFPC)); - if(class'WorldInfo'.static.IsConsoleBuild( )) + if(class'WorldInfo'.static.IsConsoleBuild()) { Manager.CachedProfile.SaveWeaponSkin(WeaponDef.default.WeaponClassPath, ItemDefinition); } diff --git a/ServerExt/Classes/ExtMenu_Perks.uc b/ServerExt/Classes/ExtMenu_Perks.uc index b74b923..47958a4 100644 --- a/ServerExt/Classes/ExtMenu_Perks.uc +++ b/ServerExt/Classes/ExtMenu_Perks.uc @@ -5,34 +5,34 @@ var Ext_PerkBase ExtPrevPerk; function OnOpen() { - KFPC = KFPlayerController( GetPC() ); - if( ExtKFPC == none ) + KFPC = KFPlayerController(GetPC()); + if(ExtKFPC == none) ExtKFPC = ExtPlayerController(KFPC); - if( ExtKFPC.ActivePerkManager==None ) + if(ExtKFPC.ActivePerkManager==None) { ExtKFPC.SetTimer(0.25,true,'OnOpen',Self); return; } ExtKFPC.ClearTimer('OnOpen',Self); - if( ExtPrevPerk==None ) + if(ExtPrevPerk==None) ExtPrevPerk = ExtKFPC.ActivePerkManager.CurrentPerk; ExUpdateContainers(ExtPrevPerk); - SetBool( "locked", true); + SetBool("locked", true); } -final function ExUpdateContainers( Ext_PerkBase PerkClass ) +final function ExUpdateContainers(Ext_PerkBase PerkClass) { LastPerkLevel = PerkClass.CurrentLevel; - if ( ExtPerksContainer_Header(HeaderContainer)!=none ) - ExtPerksContainer_Header(HeaderContainer).ExUpdatePerkHeader( PerkClass ); - if ( ExtPerksContainer_Details(DetailsContainer)!=none ) + if (ExtPerksContainer_Header(HeaderContainer)!=none) + ExtPerksContainer_Header(HeaderContainer).ExUpdatePerkHeader(PerkClass); + if (ExtPerksContainer_Details(DetailsContainer)!=none) { - ExtPerksContainer_Details(DetailsContainer).ExUpdateDetails( PerkClass ); - ExtPerksContainer_Details(DetailsContainer).ExUpdatePassives( PerkClass ); + ExtPerksContainer_Details(DetailsContainer).ExUpdateDetails(PerkClass); + ExtPerksContainer_Details(DetailsContainer).ExUpdatePassives(PerkClass); } - if ( SelectionContainer != none ) + if (SelectionContainer != none) SelectionContainer.UpdatePerkSelection(ExtKFPC.ActivePerkManager.UserPerks.Find(PerkClass)); } @@ -41,19 +41,19 @@ function CheckTiersForPopup(); event OnClose() { ExtPrevPerk = None; - if ( ExtKFPC != none ) + if (ExtKFPC != none) ExtKFPC.ClearTimer('OnOpen',Self); super.OnClose(); } -function PerkChanged( byte NewPerkIndex, bool bClickedIndex) +function PerkChanged(byte NewPerkIndex, bool bClickedIndex) { ExUpdateContainers(ExtPrevPerk); } function OneSecondLoop() { - if( ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel ) + if(ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel) ExUpdateContainers(ExtPrevPerk); } diff --git a/ServerExt/Classes/ExtMenu_Trader.uc b/ServerExt/Classes/ExtMenu_Trader.uc index 6033407..768d208 100644 --- a/ServerExt/Classes/ExtMenu_Trader.uc +++ b/ServerExt/Classes/ExtMenu_Trader.uc @@ -3,10 +3,10 @@ class ExtMenu_Trader extends KFGFxMenu_Trader; var ExtPlayerController ExtKFPC; var Ext_PerkBase ExLastPerkClass; -function InitializeMenu( KFGFxMoviePlayer_Manager InManager ) +function InitializeMenu(KFGFxMoviePlayer_Manager InManager) { Super.InitializeMenu(InManager); - ExtKFPC = ExtPlayerController ( GetPC() ); + ExtKFPC = ExtPlayerController (GetPC()); } function int GetPerkIndex() { @@ -14,11 +14,11 @@ function int GetPerkIndex() } function UpdatePlayerInfo() { - if( ExtKFPC != none && PlayerInfoContainer != none ) + if(ExtKFPC != none && PlayerInfoContainer != none) { PlayerInfoContainer.SetPerkInfo(); PlayerInfoContainer.SetPerkList(); - if( ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass) + if(ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass) { ExLastPerkClass = ExtKFPC.ActivePerkManager.CurrentPerk; OnPerkChanged(GetPerkIndex()); @@ -33,7 +33,7 @@ function Callback_PerkChanged(int PerkIndex) ExtKFPC.PendingPerkClass = ExtKFPC.ActivePerkManager.UserPerks[PerkIndex].Class; ExtKFPC.SwitchToPerk(ExtKFPC.PendingPerkClass); - if( PlayerInventoryContainer != none ) + if(PlayerInventoryContainer != none) { PlayerInventoryContainer.UpdateLock(); } diff --git a/ServerExt/Classes/ExtMoviePlayer_HUD.uc b/ServerExt/Classes/ExtMoviePlayer_HUD.uc index 13114d8..83733d1 100644 --- a/ServerExt/Classes/ExtMoviePlayer_HUD.uc +++ b/ServerExt/Classes/ExtMoviePlayer_HUD.uc @@ -5,11 +5,11 @@ function TickHud(float DeltaTime) local PlayerController PC; PC = GetPC(); - if( PC!=none && PC.PlayerInput!=None ) + if(PC!=none && PC.PlayerInput!=None) Super.TickHud(DeltaTime); } -final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInfo PRI2, optional string VictimStr, optional bool bDeathMessage = false, optional class PawnOther ) +final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInfo PRI2, optional string VictimStr, optional bool bDeathMessage = false, optional class PawnOther) { local GFxObject DataObject; local bool bHumanDeath; @@ -19,11 +19,11 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf if(KFPC == none) return; - if( KFGXHUDManager != none ) + if(KFGXHUDManager != none) { if(PawnOther != none) { - if( bDeathMessage ) + if(bDeathMessage) { KillerTextColor = ZEDTeamTextColor; KillerName = class'KFExtendedHUD'.Static.GetNameOf(PawnOther); @@ -34,7 +34,7 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf bHumanDeath = false; } } - if( (PawnOther==None || !bDeathMessage) && PRI1 != none) + if((PawnOther==None || !bDeathMessage) && PRI1 != none) { if(PRI1.GetTeamNum() == 255) { @@ -44,7 +44,7 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf else { KillerTextColor = HumanTeamTextColor; - if( ExtPlayerReplicationInfo(PRI1)!=None && ExtPlayerReplicationInfo(PRI1).ECurrentPerk!=None ) + if(ExtPlayerReplicationInfo(PRI1)!=None && ExtPlayerReplicationInfo(PRI1).ECurrentPerk!=None) KillerIconpath = ExtPlayerReplicationInfo(PRI1).ECurrentPerk.static.GetPerkIconPath(0); } KillerName = PRI1.PlayerName; @@ -63,10 +63,10 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf bHumanDeath = false; } KilledName = PRI2.PlayerName; - if( ExtPlayerReplicationInfo(PRI2)!=None && ExtPlayerReplicationInfo(PRI2).ECurrentPerk!=None ) + if(ExtPlayerReplicationInfo(PRI2)!=None && ExtPlayerReplicationInfo(PRI2).ECurrentPerk!=None) KilledIconpath = ExtPlayerReplicationInfo(PRI2).ECurrentPerk.static.GetPerkIconPath(0); } - else if( VictimStr!="" ) + else if(VictimStr!="") { KilledTextColor = HumanTeamTextColor; KilledIconpath = "img://"$class'KFPerk_Monster'.static.GetPerkIconPath(); diff --git a/ServerExt/Classes/ExtMoviePlayer_Manager.uc b/ServerExt/Classes/ExtMoviePlayer_Manager.uc index 316e981..6b0fe98 100644 --- a/ServerExt/Classes/ExtMoviePlayer_Manager.uc +++ b/ServerExt/Classes/ExtMoviePlayer_Manager.uc @@ -7,24 +7,24 @@ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) { local PlayerController PC; - switch ( WidgetName ) + switch (WidgetName) { case 'gearMenu': PC = GetPC(); - if( PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun ) + if(PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun) return true; if (EGearMenu == none) { EGearMenu = ExtMenu_Gear(Widget); EGearMenu.InitializeMenu(self); } - OnMenuOpen( WidgetPath, EGearMenu ); + OnMenuOpen(WidgetPath, EGearMenu); return true; default: return Super.WidgetInitialized(WidgetName,WidgetPath,Widget); } } -function LaunchMenus( optional bool bForceSkipLobby ) +function LaunchMenus(optional bool bForceSkipLobby) { local GFxWidgetBinding WidgetBinding; local bool bSkippedLobby; @@ -41,7 +41,7 @@ function LaunchMenus( optional bool bForceSkipLobby ) WidgetBindings.AddItem(WidgetBinding); // Load the platform-specific graphics options menu - switch( class'KFGameEngine'.static.GetPlatform() ) + switch(class'KFGameEngine'.static.GetPlatform()) { case PLATFORM_PC_DX10: WidgetBinding.WidgetName = 'optionsGraphicsMenu'; @@ -62,14 +62,14 @@ function LaunchMenus( optional bool bForceSkipLobby ) } // do this stuff in case CheckSkipLobby failed - if( bForceSkipLobby ) + if(bForceSkipLobby) { bAfterLobby = true; CloseMenus(true); } } -function OpenMenu( byte NewMenuIndex, optional bool bShowWidgets = true ) +function OpenMenu(byte NewMenuIndex, optional bool bShowWidgets = true) { local KF2GUIController GUIController; @@ -77,10 +77,10 @@ function OpenMenu( byte NewMenuIndex, optional bool bShowWidgets = true ) Super.OpenMenu(NewMenuIndex, bShowWidgets); - if( bAfterLobby ) + if(bAfterLobby) return; - if( NewMenuIndex == UI_Perks ) + if(NewMenuIndex == UI_Perks) { PerksPage = GUIController.OpenMenu(class'ExtGUI_PerkSelectionPage'); SetMovieCanReceiveInput(false); @@ -93,7 +93,7 @@ function CloseMenus(optional bool bForceClose=false) { local KF2GUIController GUIController; - if( PerksPage != None ) + if(PerksPage != None) { GUIController = class'KF2GUIController'.Static.GetGUIController(GetPC()); GUIController.CloseMenu(class'ExtGUI_PerkSelectionPage'); @@ -102,11 +102,11 @@ function CloseMenus(optional bool bForceClose=false) Super.CloseMenus(bForceClose); } -function OnMenuOpen( name WidgetPath, KFGFxObject_Menu Widget ) +function OnMenuOpen(name WidgetPath, KFGFxObject_Menu Widget) { Super.OnMenuOpen(WidgetPath, Widget); - if( !bAfterLobby && Widget == PerksMenu ) + if(!bAfterLobby && Widget == PerksMenu) PerksMenu.ActionScriptVoid("closeContainer"); } diff --git a/ServerExt/Classes/ExtPawn_Customization.uc b/ServerExt/Classes/ExtPawn_Customization.uc index a7924e5..fc11215 100644 --- a/ServerExt/Classes/ExtPawn_Customization.uc +++ b/ServerExt/Classes/ExtPawn_Customization.uc @@ -2,23 +2,23 @@ class ExtPawn_Customization extends KFPawn_Customization; simulated function KFCharacterInfoBase GetCharacterInfo() { - if( ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None ) + if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch(); return Super.GetCharacterInfo(); } -simulated function SetCharacterArch( KFCharacterInfoBase Info, optional bool bForce ) +simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce) { local KFPlayerReplicationInfo KFPRI; - KFPRI = KFPlayerReplicationInfo( PlayerReplicationInfo ); + KFPRI = KFPlayerReplicationInfo(PlayerReplicationInfo); if (Info != CharacterArch || bForce) { // Set Family Info CharacterArch = Info; - CharacterArch.SetCharacterFromArch( self, KFPRI ); - class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI ); - class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI ); + CharacterArch.SetCharacterFromArch(self, KFPRI); + class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI); + class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI); SetCharacterAnimationInfo(); @@ -35,9 +35,9 @@ simulated function SetCharacterArch( KFCharacterInfoBase Info, optional bool bFo } } - if( CharacterArch != none ) + if(CharacterArch != none) { - if( CharacterArch.VoiceGroupArchName != "" ) + if(CharacterArch.VoiceGroupArchName != "") VoiceGroupArch = class(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class')); } } @@ -54,18 +54,18 @@ simulated function PlayEmoteAnimation(optional bool bNewCharacter) local name AnimName; local float BlendInTime; - AnimName = class'ExtEmoteList'.static.GetUnlockedEmote( class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(Controller)), ExtPlayerController(Controller) ); + AnimName = class'ExtEmoteList'.static.GetUnlockedEmote(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(Controller)), ExtPlayerController(Controller)); BlendInTime = (bNewCharacter) ? 0.f : 0.4; // Briefly turn off notify so that PlayCustomAnim won't call OnAnimEnd (e.g. character swap) - BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification( FALSE ); + BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification(FALSE); BodyStanceNodes[EAS_FullBody].PlayCustomAnim(AnimName, 1.f, BlendInTime, 0.4, false, true); - BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification( TRUE ); + BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification(TRUE); } -function AttachWeaponByItemDefinition( int ItemDefinition ) +function AttachWeaponByItemDefinition(int ItemDefinition) { local class WeaponDef; local int ItemINdex; @@ -89,7 +89,7 @@ function AttachWeaponByItemDefinition( int ItemDefinition ) } //load in and add object . - WeaponPreview = KFWeaponAttachment ( DynamicLoadObject( WeaponDef.default.AttachmentArchtypePath, class'KFWeaponAttachment' ) ); + WeaponPreview = KFWeaponAttachment (DynamicLoadObject(WeaponDef.default.AttachmentArchtypePath, class'KFWeaponAttachment')); //attatch it to player WeaponAttachmentTemplate = WeaponPreview; diff --git a/ServerExt/Classes/ExtPerkManager.uc b/ServerExt/Classes/ExtPerkManager.uc index 6618bfb..977c88f 100644 --- a/ServerExt/Classes/ExtPerkManager.uc +++ b/ServerExt/Classes/ExtPerkManager.uc @@ -36,59 +36,59 @@ var bool bStatsDirty,bServerReady,bUserStatsBroken,bCurrentlyHealing; replication { // Things the server should send to the client. - if ( bNetDirty ) + if (bNetDirty) CurrentPerk; } -final function SetGrenadeCap( byte AddedCap ) +final function SetGrenadeCap(byte AddedCap) { MaxGrenadeCount = Default.MaxGrenadeCount + AddedCap; - if( RepState==REP_Done ) + if(RepState==REP_Done) ClientSetGrenadeCap(MaxGrenadeCount); } -simulated reliable client function ClientSetGrenadeCap( byte NewCap ) +simulated reliable client function ClientSetGrenadeCap(byte NewCap) { MaxGrenadeCount = NewCap; } -function bool ApplyPerkClass( class P ) +function bool ApplyPerkClass(class P) { local int i; - for( i=0; i HP.HealthMax ) HP.Health = HP.HealthMax; - if( HP.Armor > HP.MaxArmor ) HP.Armor = HP.MaxArmor; + if(HP.Health > HP.HealthMax) HP.Health = HP.HealthMax; + if(HP.Armor > HP.MaxArmor) HP.Armor = HP.MaxArmor; } } } } -simulated final function Ext_PerkBase FindPerk( class P ) +simulated final function Ext_PerkBase FindPerk(class P) { local int i; - for( i=0; i P ) simulated function PostBeginPlay() { SetTimer(0.01,false,'InitPerks'); - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) SetTimer(1,true,'CheckPlayTime'); } @@ -163,18 +163,18 @@ simulated function InitPerks() { local Ext_PerkBase P; - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) { foreach DynamicActors(class'Ext_PerkBase',P) - if( P.PerkManager!=Self ) + if(P.PerkManager!=Self) RegisterPerk(P); } - else if( PRIOwner!=PlayerOwner.PlayerReplicationInfo ) // See if was assigned an inactive PRI. + else if(PRIOwner!=PlayerOwner.PlayerReplicationInfo) // See if was assigned an inactive PRI. { PRIOwner = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo); - if( PRIOwner!=None ) + if(PRIOwner!=None) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) { PRIOwner.ECurrentPerk = CurrentPerk.Class; CurrentPerk.UpdatePRILevel(); @@ -194,22 +194,22 @@ function ServerInitPerks() { local int i; - for( i=0; i=0; --i ) + for(i=(UserPerks.Length-1); i>=0; --i) { UserPerks[i].PerkManager = None; UserPerks[i].Destroy(); } } -function EarnedEXP( int EXP, optional byte Mode ) +function EarnedEXP(int EXP, optional byte Mode) { // `log("EarnedEXP" @ GetScriptTrace()); - if( CurrentPerk!=None ) + if(CurrentPerk!=None) { // Limit how much EXP we got for healing and welding. - switch( Mode ) + switch(Mode) { case 1: ExpUpStatus[0]+=EXP; EXP = ExpUpStatus[0]/CurrentPerk.WeldExpUpNum; - if( EXP>0 ) + if(EXP>0) ExpUpStatus[0]-=(EXP*CurrentPerk.WeldExpUpNum); break; case 2: ExpUpStatus[1]+=EXP; EXP = ExpUpStatus[1]/CurrentPerk.HealExpUpNum; - if( EXP>0 ) + if(EXP>0) ExpUpStatus[1]-=(EXP*CurrentPerk.HealExpUpNum); break; } - if( EXP>0 && CurrentPerk.EarnedEXP(EXP) ) + if(EXP>0 && CurrentPerk.EarnedEXP(EXP)) { TotalEXP+=EXP; PRIOwner.RepEXP+=EXP; @@ -257,7 +257,7 @@ function EarnedEXP( int EXP, optional byte Mode ) } // XML stat writing -function OutputXML( ExtStatWriter Data ) +function OutputXML(ExtStatWriter Data) { local string S; local int i; @@ -268,20 +268,20 @@ function OutputXML( ExtStatWriter Data ) Data.WriteValue("exp",string(TotalEXP)); Data.WriteValue("kills",string(TotalKills)); Data.WriteValue("time",string(TotalPlayTime)); - if( ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None ) + if(ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None) S = string(ExtPlayerController(Owner).PendingPerkClass.Name); else S = (CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "None"); Data.WriteValue("activeperk",S); - for( i=0; i=PRIOwner.CustomCharList.Length ) + if(RepIndex>=PRIOwner.CustomCharList.Length) { PRIOwner.AllCharReceived(); RepIndex = 0; @@ -433,7 +433,7 @@ function ReplicateTimer() } break; case REP_CustomInventory: // Replicate custom trader inventory - if( !PRIOwner.OnRepNextItem(PRIOwner,RepIndex) ) + if(!PRIOwner.OnRepNextItem(PRIOwner,RepIndex)) { RepIndex = 0; ++RepState; @@ -441,20 +441,20 @@ function ReplicateTimer() else ++RepIndex; break; case REP_PerkClasses: // Open up all actor channel connections. - if( RepIndex>=UserPerks.Length ) + if(RepIndex>=UserPerks.Length) { RepIndex = 0; ++RepState; } - else if( UserPerks[RepIndex].bClientAuthorized ) + else if(UserPerks[RepIndex].bClientAuthorized) { - if( UserPerks[RepIndex].bPerkNetReady ) + if(UserPerks[RepIndex].bPerkNetReady) ++RepIndex; } else { UserPerks[RepIndex].RemoteRole = ROLE_SimulatedProxy; - if( UserPerks[RepIndex].NextAuthTime DT ) +function bool CanEarnSmallRadiusKillXP(class DT) { return true; } -simulated function ModifySpeed( out float Speed ) +simulated function ModifySpeed(out float Speed) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) Speed *= CurrentPerk.Modifiers[0]; } -function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) +function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyDamageGiven(InDamage,DamageCauser,MyKFPM,DamageInstigator,DamageType,HitZoneIdx); } -simulated function ModifyDamageTaken( out int InDamage, optional class DamageType, optional Controller InstigatedBy ) +simulated function ModifyDamageTaken(out int InDamage, optional class DamageType, optional Controller InstigatedBy) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyDamageTaken(InDamage,DamageType,InstigatedBy); } -simulated function ModifyRecoil( out float CurrentRecoilModifier, KFWeapon KFW ) +simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyRecoil(CurrentRecoilModifier,KFW); } -simulated function ModifySpread( out float InSpread ) +simulated function ModifySpread(out float InSpread) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifySpread(InSpread); } -simulated function ModifyRateOfFire( out float InRate, KFWeapon KFW ) +simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyRateOfFire(InRate,KFW); } simulated function float GetReloadRateScale(KFWeapon KFW) { return (CurrentPerk!=None ? CurrentPerk.GetReloadRateScale(KFW) : 1.f); } -simulated function bool GetUsingTactialReload( KFWeapon KFW ) +simulated function bool GetUsingTactialReload(KFWeapon KFW) { return (CurrentPerk!=None ? CurrentPerk.GetUsingTactialReload(KFW) : false); } -function ModifyHealth( out int InHealth ) +function ModifyHealth(out int InHealth) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyHealth(InHealth); } -function ModifyArmor( out byte MaxArmor ) +function ModifyArmor(out byte MaxArmor) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyArmor(MaxArmor); } -function float GetKnockdownPowerModifier( optional class DamageType, optional byte BodyPart, optional bool bIsSprinting=false ) +function float GetKnockdownPowerModifier(optional class DamageType, optional byte BodyPart, optional bool bIsSprinting=false) { return (CurrentPerk!=None ? CurrentPerk.GetKnockdownPowerModifier() : 1.f); } -function float GetStumblePowerModifier( optional KFPawn KFP, optional class DamageType, optional out float CooldownModifier, optional byte BodyPart ) +function float GetStumblePowerModifier(optional KFPawn KFP, optional class DamageType, optional out float CooldownModifier, optional byte BodyPart) { return (CurrentPerk!=None ? CurrentPerk.GetKnockdownPowerModifier() : 1.f); } -function float GetStunPowerModifier( optional class DamageType, optional byte HitZoneIdx ) +function float GetStunPowerModifier(optional class DamageType, optional byte HitZoneIdx) { return (CurrentPerk!=None ? CurrentPerk.GetStunPowerModifier(DamageType,HitZoneIdx) : 1.f); } -simulated function ModifyMeleeAttackSpeed( out float InDuration, KFWeapon KFW ) +simulated function ModifyMeleeAttackSpeed(out float InDuration, KFWeapon KFW) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyMeleeAttackSpeed(InDuration); } simulated function class GetGrenadeClass() { return (CurrentPerk!=None ? CurrentPerk.GrenadeClass : GrenadeClass); } -simulated function ModifyWeldingRate( out float FastenRate, out float UnfastenRate ) +simulated function ModifyWeldingRate(out float FastenRate, out float UnfastenRate) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyWeldingRate(FastenRate,UnfastenRate); } simulated function bool HasNightVision() { return (CurrentPerk!=None ? CurrentPerk.bHasNightVision : false); } -function bool RepairArmor( Pawn HealTarget ) +function bool RepairArmor(Pawn HealTarget) { return (CurrentPerk!=None ? CurrentPerk.RepairArmor(HealTarget) : false); } -function bool ModifyHealAmount( out float HealAmount ) +function bool ModifyHealAmount(out float HealAmount) { return (CurrentPerk!=None ? CurrentPerk.ModifyHealAmount(HealAmount) : false); } @@ -563,28 +563,28 @@ function bool CanNotBeGrabbed() { return (CurrentPerk!=None ? !CurrentPerk.bCanBeGrabbed : false); } -simulated function ModifyMagSizeAndNumber( KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname ) +simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyMagSizeAndNumber(KFW,MagazineCapacity,WeaponPerkClass,bSecondary,WeaponClassname); } -simulated function ModifySpareAmmoAmount( KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false ) +simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifySpareAmmoAmount(KFW,PrimarySpareAmmo,TraderItem,bSecondary); } -simulated function ModifyMaxSpareAmmoAmount( KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false ) +simulated function ModifyMaxSpareAmmoAmount(KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifySpareAmmoAmount(KFW,SpareAmmoCapacity,TraderItem,bSecondary); } -simulated function bool ShouldMagSizeModifySpareAmmo( KFWeapon KFW, optional Class WeaponPerkClass ) +simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class WeaponPerkClass) { return (CurrentPerk!=None ? CurrentPerk.ShouldMagSizeModifySpareAmmo(KFW,WeaponPerkClass) : false); } -simulated function ModifyHealerRechargeTime( out float RechargeRate ) +simulated function ModifyHealerRechargeTime(out float RechargeRate) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyHealerRechargeTime(RechargeRate); } simulated function bool CanExplosiveWeld() @@ -597,7 +597,7 @@ simulated function bool IsOnContactActive() } function bool CanSpreadNapalm() { - if( CurrentPerk!=None && CurrentPerk.bNapalmFire && LastNapalmTime!=WorldInfo.TimeSeconds ) + if(CurrentPerk!=None && CurrentPerk.bNapalmFire && LastNapalmTime!=WorldInfo.TimeSeconds) { LastNapalmTime = WorldInfo.TimeSeconds; // Avoid infinite script recursion in KFPawn_Monster. return true; @@ -610,31 +610,31 @@ simulated function bool IsRangeActive() } simulated function DrawSpecialPerkHUD(Canvas C) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.DrawSpecialPerkHUD(C); } -function PlayerKilled( KFPawn_Monster Victim, class DamageType ) +function PlayerKilled(KFPawn_Monster Victim, class DamageType) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.PlayerKilled(Victim,DamageType); } -function ModifyBloatBileDoT( out float DoTScaler ) +function ModifyBloatBileDoT(out float DoTScaler) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.ModifyBloatBileDoT(DoTScaler); } -simulated function bool GetIsUberAmmoActive( KFWeapon KFW ) +simulated function bool GetIsUberAmmoActive(KFWeapon KFW) { return (CurrentPerk!=None ? CurrentPerk.GetIsUberAmmoActive(KFW) : false); } -function UpdatePerkHeadShots( ImpactInfo Impact, class DamageType, int NumHit ) +function UpdatePerkHeadShots(ImpactInfo Impact, class DamageType, int NumHit) { - if( CurrentPerk!=None ) + if(CurrentPerk!=None) CurrentPerk.UpdatePerkHeadShots(Impact,DamageType,NumHit); } -function CheckForAirborneAgent( KFPawn HealTarget, class DamType, int HealAmount ) +function CheckForAirborneAgent(KFPawn HealTarget, class DamType, int HealAmount) { - if( !bCurrentlyHealing && CurrentPerk!=None ) + if(!bCurrentlyHealing && CurrentPerk!=None) { // Using boolean to avoid infinite recursion. bCurrentlyHealing = true; @@ -642,7 +642,7 @@ function CheckForAirborneAgent( KFPawn HealTarget, class DamType, in bCurrentlyHealing = false; } } -simulated function float GetZedTimeModifier( KFWeapon W ) +simulated function float GetZedTimeModifier(KFWeapon W) { return (CurrentPerk!=None ? CurrentPerk.GetZedTimeModifier(W) : 0.f); } @@ -652,14 +652,14 @@ function bool IsAcidicCompoundActive() { return (CurrentPerk!=None ? CurrentPerk.bToxicDart : false); } -function ModifyACDamage( out int InDamage ) +function ModifyACDamage(out int InDamage) { - if( CurrentPerk!=None && CurrentPerk.bToxicDart ) + if(CurrentPerk!=None && CurrentPerk.bToxicDart) InDamage += CurrentPerk.ToxicDartDamage; } // Zombie explosion! -function bool CouldBeZedShrapnel( class KFDT ) +function bool CouldBeZedShrapnel(class KFDT) { return (CurrentPerk!=None ? (CurrentPerk.bFireExplode && class(KFDT)!=None) : false); } @@ -681,7 +681,7 @@ function NotifyZedTimeStarted() { CurrentPerk.NotifyZedTimeStarted(); } -simulated function float GetZedTimeExtensions( byte Level ) +simulated function float GetZedTimeExtensions(byte Level) { return CurrentPerk.GetZedTimeExtensions(Level); } @@ -691,11 +691,11 @@ simulated function bool HasHeavyArmor() { return (CurrentPerk!=None && CurrentPerk.bHeavyArmor); } -simulated function float GetIronSightSpeedModifier( KFWeapon KFW ) +simulated function float GetIronSightSpeedModifier(KFWeapon KFW) { return (CurrentPerk!=None ? CurrentPerk.GetIronSightSpeedModifier(KFW) : 1.f); } -simulated function float GetCrouchSpeedModifier( KFWeapon KFW ) +simulated function float GetCrouchSpeedModifier(KFWeapon KFW) { return (CurrentPerk!=None ? CurrentPerk.GetIronSightSpeedModifier(KFW) : 1.f); } @@ -723,7 +723,7 @@ simulated function bool ShouldNeverDud() } function NotifyPerkSacrificeExploded() { - if( Ext_PerkDemolition(CurrentPerk) != none ) Ext_PerkDemolition(CurrentPerk).bUsedSacrifice = true; + if(Ext_PerkDemolition(CurrentPerk) != none) Ext_PerkDemolition(CurrentPerk).bUsedSacrifice = true; } simulated function float GetAoERadiusModifier() { @@ -755,11 +755,11 @@ static function class GetToxicDmgTypeClass() { return class'Ext_PerkFieldMedic'.static.GetToxicDmgTypeClass(); } -static function ModifyToxicDmg( out int ToxicDamage ) +static function ModifyToxicDmg(out int ToxicDamage) { ToxicDamage = class'Ext_PerkFieldMedic'.static.ModifyToxicDmg(ToxicDamage); } -simulated function float GetSnarePower( optional class DamageType, optional byte HitZoneIdx ) +simulated function float GetSnarePower(optional class DamageType, optional byte HitZoneIdx) { return (Ext_PerkFieldMedic(CurrentPerk)!=None ? Ext_PerkFieldMedic(CurrentPerk).GetSnarePower(DamageType, HitZoneIdx) : 0.f); } @@ -769,7 +769,7 @@ simulated function bool CanRepairDoors() { return (Ext_PerkSupport(CurrentPerk)!=None ? Ext_PerkSupport(CurrentPerk).CanRepairDoors() : false); } -simulated function float GetPenetrationModifier( byte Level, class DamageType, optional bool bForce ) +simulated function float GetPenetrationModifier(byte Level, class DamageType, optional bool bForce ) { return (Ext_PerkSupport(CurrentPerk)!=None ? Ext_PerkSupport(CurrentPerk).GetPenetrationModifier(Level, DamageType, bForce) : 0.f); } @@ -777,12 +777,12 @@ simulated function float GetPenetrationModifier( byte Level, class // Other function ApplySkillsToPawn() { - if( CheckOwnerPawn() ) + if(CheckOwnerPawn()) { OwnerPawn.UpdateGroundSpeed(); OwnerPawn.bMovesFastInZedTime = false; - if( MyPRI == none ) + if(MyPRI == none) MyPRI = KFPlayerReplicationInfo(OwnerPawn.PlayerReplicationInfo); ApplyWeightLimits(); diff --git a/ServerExt/Classes/ExtPerksContainer_Details.uc b/ServerExt/Classes/ExtPerksContainer_Details.uc index dbb16ac..ac7725a 100644 --- a/ServerExt/Classes/ExtPerksContainer_Details.uc +++ b/ServerExt/Classes/ExtPerksContainer_Details.uc @@ -1,8 +1,8 @@ class ExtPerksContainer_Details extends KFGFxPerksContainer_Details; -`define AddWeaponsInfo(InClassDef) if( `InClassDef!=None ) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath()) +`define AddWeaponsInfo(InClassDef) if(`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath()) -final function ExUpdateDetails( Ext_PerkBase PerkClass ) +final function ExUpdateDetails(Ext_PerkBase PerkClass) { local GFxObject DetailsProvider; local KFPlayerController KFPC; @@ -11,15 +11,15 @@ final function ExUpdateDetails( Ext_PerkBase PerkClass ) local array WeaponSources; local int i; - DetailsProvider = CreateObject( "Object" ); + DetailsProvider = CreateObject("Object"); - KFPC = KFPlayerController( GetPC() ); + KFPC = KFPlayerController(GetPC()); - if ( KFPC != none) + if (KFPC != none) { KFGRI = KFGameReplicationInfo(KFPC.WorldInfo.GRI); - DetailsProvider.SetString( "ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP ); + DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP); if(KFGRI != none) { @@ -31,31 +31,31 @@ final function ExUpdateDetails( Ext_PerkBase PerkClass ) for (i = 0; i < WeaponNames.length; i++) { - DetailsProvider.SetString( "WeaponName" $ i, WeaponNames[i] ); - DetailsProvider.SetString( "WeaponImage" $ i, "img://"$WeaponSources[i] ); + DetailsProvider.SetString("WeaponName" $ i, WeaponNames[i]); + DetailsProvider.SetString("WeaponImage" $ i, "img://"$WeaponSources[i]); } - DetailsProvider.SetString( "EXPAction1", "Kill zombies" ); - //DetailsProvider.SetString( "EXPAction2", PerkClass.default.EXPAction2 ); + DetailsProvider.SetString("EXPAction1", "Kill zombies"); + //DetailsProvider.SetString("EXPAction2", PerkClass.default.EXPAction2); - SetObject( "detailsData", DetailsProvider ); + SetObject("detailsData", DetailsProvider); } } -final function ExUpdatePassives( Ext_PerkBase PerkClass ) +final function ExUpdatePassives(Ext_PerkBase PerkClass) { local GFxObject PassivesProvider; local GFxObject PassiveObject; local int i; PassivesProvider = CreateArray(); - for( i=0; i SavedWeaponSkins; replication { // Things the server should send to the client. - if ( bNetDirty ) + if (bNetDirty) MidGameMenuClass,ActivePerkManager; } simulated function PostBeginPlay() { Super.PostBeginPlay(); - if( WorldInfo.NetMode!=NM_Client && ActivePerkManager==None ) + if(WorldInfo.NetMode!=NM_Client && ActivePerkManager==None) { ActivePerkManager = Spawn(class'ExtPerkManager',Self); ActivePerkManager.PlayerOwner = Self; ActivePerkManager.PRIOwner = ExtPlayerReplicationInfo(PlayerReplicationInfo); - if( ActivePerkManager.PRIOwner!=None ) + if(ActivePerkManager.PRIOwner!=None) ActivePerkManager.PRIOwner.PerkManager = ActivePerkManager; SetTimer(0.1,true,'CheckPerk'); } } simulated function Destroyed() { - if( ActivePerkManager!=None ) + if(ActivePerkManager!=None) ActivePerkManager.PreNotifyPlayerLeave(); Super.Destroyed(); - if( ActivePerkManager!=None ) + if(ActivePerkManager!=None) ActivePerkManager.Destroy(); } function CheckPerk() { - if( CurrentPerk!=ActivePerkManager ) + if(CurrentPerk!=ActivePerkManager) { CurrentPerk = ActivePerkManager; - if( KFPlayerReplicationInfo(PlayerReplicationInfo)!=None ) + if(KFPlayerReplicationInfo(PlayerReplicationInfo)!=None) { KFPlayerReplicationInfo(PlayerReplicationInfo).NetPerkIndex = 0; KFPlayerReplicationInfo(PlayerReplicationInfo).CurrentPerkClass = ActivePerkManager.Class; @@ -87,14 +87,14 @@ function CheckPerk() } } -reliable client function AddAdminCmd( string S ) +reliable client function AddAdminCmd(string S) { local int i,j; j = InStr(S,":"); i = AdminCommands.Length; AdminCommands.Length = i+1; - if( j==-1 ) + if(j==-1) { AdminCommands[i].Cmd = S; AdminCommands[i].Info = S; @@ -110,17 +110,17 @@ reliable client function ClientSetHUD(class newHUDType) Super.ClientSetHUD(newHUDType); SendServerSettings(); } -reliable client function ClientSetBonus( SoundCue C, Object FX ) +reliable client function ClientSetBonus(SoundCue C, Object FX) { BonusMusic = C; BonusFX = FX; } simulated final function SendServerSettings() { - if( LocalPlayer(Player)!=None ) + if(LocalPlayer(Player)!=None) ServerSetSettings(bHideKillMsg,bHideDamageMsg,bHideNumberMsg,bNoMonsterPlayer); } -reliable server function ServerSetSettings( bool bHideKill, bool bHideDmg, bool bHideNum, bool bNoZ ) +reliable server function ServerSetSettings(bool bHideKill, bool bHideDmg, bool bHideNum, bool bNoZ) { bClientHideKillMsg = bHideKill; bClientHideDamageMsg = bHideDmg; @@ -128,41 +128,41 @@ reliable server function ServerSetSettings( bool bHideKill, bool bHideDmg, bool bNoDamageTracking = (bHideDmg && bHideNum); bClientNoZed = bNoZ; } -unreliable server function NotifyFixed( byte Mode ) +unreliable server function NotifyFixed(byte Mode) { - if( Mode==1 && (Pawn==None || (WorldInfo.TimeSeconds-Pawn.SpawnTime)<5.f) ) + if(Mode==1 && (Pawn==None || (WorldInfo.TimeSeconds-Pawn.SpawnTime)<5.f)) return; OnClientFixed(Self,Mode); - if( Default.bRenderModes && ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None ) + if(Default.bRenderModes && ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) ExtPlayerReplicationInfo(PlayerReplicationInfo).SetFixedData(Mode); } -delegate OnClientFixed( ExtPlayerController PC, byte Mode ); +delegate OnClientFixed(ExtPlayerController PC, byte Mode); -reliable client event ReceiveLocalizedMessage( class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject ) +reliable client event ReceiveLocalizedMessage(class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject) { - if( Message!=class'KFLocalMessage_PlayerKills' && (Message!=class'KFLocalMessage_Game' || (Switch!=KMT_Suicide && Switch!=KMT_Killed)) ) + if(Message!=class'KFLocalMessage_PlayerKills' && (Message!=class'KFLocalMessage_Game' || (Switch!=KMT_Suicide && Switch!=KMT_Killed))) Super.ReceiveLocalizedMessage(Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject); } -function AddZedKill( class MonsterClass, byte Difficulty, class DT, bool bKiller ) +function AddZedKill(class MonsterClass, byte Difficulty, class DT, bool bKiller) { // Stats. - if( ActivePerkManager!=None ) + if(ActivePerkManager!=None) { ActivePerkManager.TotalKills++; ActivePerkManager.PRIOwner.RepKills++; } } -unreliable client function ClientPlayCameraShake( CameraShake Shake, optional float Scale=1.f, optional bool bTryForceFeedback, optional ECameraAnimPlaySpace PlaySpace=CAPS_CameraLocal, optional rotator UserPlaySpaceRot ) +unreliable client function ClientPlayCameraShake(CameraShake Shake, optional float Scale=1.f, optional bool bTryForceFeedback, optional ECameraAnimPlaySpace PlaySpace=CAPS_CameraLocal, optional rotator UserPlaySpaceRot) { - if( !bNoScreenShake ) + if(!bNoScreenShake) Super.ClientPlayCameraShake(Shake,Scale,bTryForceFeedback,PlaySpace,UserPlaySpaceRot); } -exec final function AwardXP( int XP, optional byte Mode ) +exec final function AwardXP(int XP, optional byte Mode) { - if( WorldInfo.NetMode!=NM_Client && ActivePerkManager!=None ) + if(WorldInfo.NetMode!=NM_Client && ActivePerkManager!=None) ActivePerkManager.EarnedEXP(XP,Mode); } @@ -172,31 +172,31 @@ function OnPlayerXPAdded(INT XP, class PerkClass) AwardXP(XP); } -function AddSmallRadiusKill( byte Difficulty, class PerkClass ) +function AddSmallRadiusKill(byte Difficulty, class PerkClass) { AwardXP(class'KFPerk_Berserker'.static.GetSmallRadiusKillXP(Difficulty)); } -function AddWeldPoints( int PointsWelded ) +function AddWeldPoints(int PointsWelded) { AwardXP(PointsWelded,1); } -function AddHealPoints( int PointsHealed ) +function AddHealPoints(int PointsHealed) { AwardXP(PointsHealed,2); } -function AddShotsHit( int AddedHits ) +function AddShotsHit(int AddedHits) { local KFWeapon W; local float T; Super.AddShotsHit(AddedHits); W = KFWeapon(Pawn.Weapon); - if( W==None ) + if(W==None) { - if( LastMisfireTime>WorldInfo.TimeSeconds ) + if(LastMisfireTime>WorldInfo.TimeSeconds) { - if( ++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f ) + if(++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) NotifyFixed(8); LastMisfireTime = WorldInfo.TimeSeconds+2.f; return; @@ -206,11 +206,11 @@ function AddShotsHit( int AddedHits ) MisfireTimer = WorldInfo.TimeSeconds; return; } - if( !W.HasAmmo(W.CurrentFireMode) ) + if(!W.HasAmmo(W.CurrentFireMode)) { - if( LastMisfireTime>WorldInfo.TimeSeconds ) + if(LastMisfireTime>WorldInfo.TimeSeconds) { - if( ++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f ) + if(++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) NotifyFixed(16); LastMisfireTime = WorldInfo.TimeSeconds+2.f; return; @@ -222,19 +222,19 @@ function AddShotsHit( int AddedHits ) } T = W.GetFireInterval(W.CurrentFireMode); ActivePerkManager.ModifyRateOfFire(T,W); - if( (WorldInfo.TimeSeconds-LastFireTime)<(T*0.5) || !W.IsFiring() ) + if((WorldInfo.TimeSeconds-LastFireTime)<(T*0.5) || !W.IsFiring()) { - if( (WorldInfo.TimeSeconds-LastFireTime)>4.f ) + if((WorldInfo.TimeSeconds-LastFireTime)>4.f) MisrateCounter = 0; LastFireTime = WorldInfo.TimeSeconds; - if( MisrateCounter<5 ) + if(MisrateCounter<5) { ++MisrateCounter; return; } - if( LastMisfireTime>WorldInfo.TimeSeconds ) + if(LastMisfireTime>WorldInfo.TimeSeconds) { - if( ++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f ) + if(++MisfireCount>15 && (WorldInfo.TimeSeconds-MisfireTimer)>10.f) NotifyFixed(2); LastMisfireTime = WorldInfo.TimeSeconds+1.f; return; @@ -247,16 +247,16 @@ function AddShotsHit( int AddedHits ) } // Message of the day. -Delegate OnSetMOTD( ExtPlayerController PC, string S ); -reliable client function ReceiveServerMOTD( string S, bool bFinal ) +Delegate OnSetMOTD(ExtPlayerController PC, string S); +reliable client function ReceiveServerMOTD(string S, bool bFinal) { ServerMOTD $= S; bMOTDReceived = bFinal; } -reliable server function ServerSetMOTD( string S, bool bFinal ) +reliable server function ServerSetMOTD(string S, bool bFinal) { PendingMOTD $= S; - if( bFinal && PendingMOTD!="" ) + if(bFinal && PendingMOTD!="") { OnSetMOTD(Self,PendingMOTD); PendingMOTD = ""; @@ -264,66 +264,66 @@ reliable server function ServerSetMOTD( string S, bool bFinal ) } // TESTING: -reliable server function ServerItemDropGet( string Item ) +reliable server function ServerItemDropGet(string Item) { - if( DropCount>5 || Len(Item)>100 ) + if(DropCount>5 || Len(Item)>100) return; ++DropCount; WorldInfo.Game.Broadcast(Self,PlayerReplicationInfo.GetHumanReadableName()$" got item: "$Item); } -reliable client function ReceiveLevelUp( Ext_PerkBase Perk, int NewLevel ) +reliable client function ReceiveLevelUp(Ext_PerkBase Perk, int NewLevel) { - if( Perk!=None ) + if(Perk!=None) MyGFxHUD.LevelUpNotificationWidget.ShowAchievementNotification(class'KFGFxWidget_LevelUpNotification'.Default.LevelUpString, Perk.PerkName, class'KFGFxWidget_LevelUpNotification'.Default.TierUnlockedString, Perk.GetPerkIconPath(NewLevel), false, NewLevel); } -reliable client function ReceiveKillMessage( class Victim, optional bool bGlobal, optional PlayerReplicationInfo KillerPRI ) +reliable client function ReceiveKillMessage(class Victim, optional bool bGlobal, optional PlayerReplicationInfo KillerPRI) { - if( bHideKillMsg || (bGlobal && KillerPRI==None) ) + if(bHideKillMsg || (bGlobal && KillerPRI==None)) return; - if( bUseKF2KillMessages ) + if(bUseKF2KillMessages) { - if( MyGFxHUD != none ) + if(MyGFxHUD != none) { - ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX( (bGlobal ? KillerPRI : None), None, ,false, Victim ); + ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX((bGlobal ? KillerPRI : None), None, ,false, Victim); } } - else if( KFExtendedHUD(myHUD)!=None && Victim!=None ) + else if(KFExtendedHUD(myHUD)!=None && Victim!=None) KFExtendedHUD(myHUD).AddKillMessage(Victim,1,KillerPRI,byte(bGlobal)); } -unreliable client function ReceiveDamageMessage( class Victim, int Damage ) +unreliable client function ReceiveDamageMessage(class Victim, int Damage) { - if( !bHideDamageMsg && KFExtendedHUD(myHUD)!=None && Victim!=None ) + if(!bHideDamageMsg && KFExtendedHUD(myHUD)!=None && Victim!=None) KFExtendedHUD(myHUD).AddKillMessage(Victim,Damage,None,2); } -unreliable client function ClientNumberMsg( int Count, vector Pos, EDmgMsgType Type ) +unreliable client function ClientNumberMsg(int Count, vector Pos, EDmgMsgType Type) { - if( !bHideNumberMsg && KFExtendedHUD(myHUD)!=None ) + if(!bHideNumberMsg && KFExtendedHUD(myHUD)!=None) KFExtendedHUD(myHUD).AddNumberMsg(Count,Pos,Type); } -reliable client event TeamMessage( PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime ) +reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime ) { - //if( ( ( Type == 'Say' ) || (Type == 'TeamSay' ) ) && ( PRI != None ) ) - // SpeakTTS( S, PRI ); <- KF built without TTS... + //if(((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) + // SpeakTTS(S, PRI); <- KF built without TTS... // since this is on the client, we can assume that if Player exists, it is a LocalPlayer - if( Player!=None ) + if(Player!=None) { - if( ( ( Type == 'Say' ) || ( Type == 'TeamSay' ) ) && ( PRI != None ) ) + if(((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) S = PRI.GetHumanReadableName()$": "$S; - LocalPlayer( Player ).ViewportClient.ViewportConsole.OutputText( "("$Type$") "$S ); + LocalPlayer(Player).ViewportClient.ViewportConsole.OutputText("("$Type$") "$S); } if (MyGFxManager != none && MyGFxManager.PartyWidget != none) { - if( !MyGFxManager.PartyWidget.ReceiveMessage(S) ) //Fails if message is for updating perks in a steam lobby + if(!MyGFxManager.PartyWidget.ReceiveMessage(S)) //Fails if message is for updating perks in a steam lobby return; } - if( MyGFxHUD != none ) + if(MyGFxHUD != none) { - switch( Type ) + switch(Type) { case 'Log': break; // Console only message. @@ -338,7 +338,7 @@ reliable client event TeamMessage( PlayerReplicationInfo PRI, coerce string S, n break; case 'Say': case 'TeamSay': - if( ExtPlayerReplicationInfo(PRI)!=None && ExtPlayerReplicationInfo(PRI).ShowAdminName() ) + if(ExtPlayerReplicationInfo(PRI)!=None && ExtPlayerReplicationInfo(PRI).ShowAdminName()) MyGFxHUD.HudChatBox.AddChatMessage("("$ExtPlayerReplicationInfo(PRI).GetAdminNameAbr()$")"$S, ExtPlayerReplicationInfo(PRI).GetAdminColor()); else MyGFxHUD.HudChatBox.AddChatMessage(S, "64FE2E"); break; @@ -356,7 +356,7 @@ reliable client event TeamMessage( PlayerReplicationInfo PRI, coerce string S, n } } } -final function PopScreenMsg( string S ) +final function PopScreenMsg(string S) { local int i; local string L; @@ -366,14 +366,14 @@ final function PopScreenMsg( string S ) // Get lower part. i = InStr(S,"|"); - if( i!=-1 ) + if(i!=-1) { L = Mid(S,i+1); S = Left(S,i); // Get time. i = InStr(L,"|"); - if( i!=-1 ) + if(i!=-1) { T = float(Mid(L,i+1)); L = Left(L,i); @@ -381,23 +381,23 @@ final function PopScreenMsg( string S ) } MyGFxHUD.DisplayPriorityMessage(S,L,T); } -reliable client function ClientKillMessage( class DamType, PlayerReplicationInfo Victim, PlayerReplicationInfo KillerPRI, optional class KillerPawn ) +reliable client function ClientKillMessage(class DamType, PlayerReplicationInfo Victim, PlayerReplicationInfo KillerPRI, optional class KillerPawn) { local string Msg,S; local bool bFF; - if( Player==None || Victim==None ) + if(Player==None || Victim==None) return; - if( bUseKF2DeathMessages && MyGFxHUD!=None ) + if(bUseKF2DeathMessages && MyGFxHUD!=None) { - if( Victim==KillerPRI || (KillerPRI==None && KillerPawn==None) ) // Suicide - ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX( None, Victim, ,true ); - else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX( KillerPRI, Victim, ,true, KillerPawn ); + if(Victim==KillerPRI || (KillerPRI==None && KillerPawn==None)) // Suicide + ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(None, Victim, ,true); + else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(KillerPRI, Victim, ,true, KillerPawn); } - if( Victim==KillerPRI || (KillerPRI==None && KillerPawn==None) ) // Suicide + if(Victim==KillerPRI || (KillerPRI==None && KillerPawn==None)) // Suicide { - if( Victim.GetTeamNum()==0 ) + if(Victim.GetTeamNum()==0) { Msg = ParseSuicideMsg(Chr(6)$"O"$Victim.GetHumanReadableName(),DamType); class'KFMusicStingerHelper'.static.PlayPlayerDiedStinger(Self); @@ -406,7 +406,7 @@ reliable client function ClientKillMessage( class DamType, PlayerRep } else { - if( KillerPRI!=None && Victim.Team!=None && Victim.Team==KillerPRI.Team ) // Team-kill + if(KillerPRI!=None && Victim.Team!=None && Victim.Team==KillerPRI.Team) // Team-kill { bFF = true; S = KillerPRI.GetHumanReadableName(); @@ -415,14 +415,14 @@ reliable client function ClientKillMessage( class DamType, PlayerRep else // Killed by monster. { bFF = false; - if( KillerPRI!=None ) + if(KillerPRI!=None) { S = KillerPRI.GetHumanReadableName(); } else { S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn); - if( class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss ) // Boss type. + if(class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type. S = "the "$S; else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S; } @@ -431,154 +431,154 @@ reliable client function ClientKillMessage( class DamType, PlayerRep Msg = ParseKillMsg(Victim.GetHumanReadableName(),S,bFF,DamType); } S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg); - if( !bUseKF2DeathMessages ) + if(!bUseKF2DeathMessages) KFExtendedHUD(myHUD).AddDeathMessage(Msg,S); ClientMessage(S,'DeathMessage'); } -reliable client function ClientZedKillMessage( class DamType, string Victim, optional PlayerReplicationInfo KillerPRI, optional class KillerPawn, optional bool bFFKill ) +reliable client function ClientZedKillMessage(class DamType, string Victim, optional PlayerReplicationInfo KillerPRI, optional class KillerPawn, optional bool bFFKill) { local string Msg,S; - if( Player==None ) + if(Player==None) return; - if( bUseKF2DeathMessages && MyGFxHUD!=None ) + if(bUseKF2DeathMessages && MyGFxHUD!=None) { - if( KillerPRI==None && KillerPawn==None ) // Suicide - ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX( None, None, Victim, true ); - else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX( KillerPRI, None, Victim, true, KillerPawn ); + if(KillerPRI==None && KillerPawn==None) // Suicide + ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(None, None, Victim, true); + else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(KillerPRI, None, Victim, true, KillerPawn); } - if( KillerPRI==None && KillerPawn==None ) // Suicide + if(KillerPRI==None && KillerPawn==None) // Suicide { Msg = ParseSuicideMsg(Chr(6)$"O"$Victim,DamType); } else { - if( KillerPRI!=None ) // Team-kill + if(KillerPRI!=None) // Team-kill { S = KillerPRI.GetHumanReadableName(); } else // Killed by monster. { S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn); - if( class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss ) // Boss type. + if(class(KillerPawn)!=None && class(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type. S = "the "$S; else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S; } Msg = ParseKillMsg(Victim,S,bFFKill,DamType); } S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg); - if( !bUseKF2DeathMessages ) + if(!bUseKF2DeathMessages) KFExtendedHUD(myHUD).AddDeathMessage(Msg,S); ClientMessage(S,'DeathMessage'); } -simulated final function string ParseSuicideMsg( string Victim, class DamType ) +simulated final function string ParseSuicideMsg(string Victim, class DamType) { local string S; S = string(DamType.Name); - if( Left(S,15)~="KFDT_Ballistic_" ) + if(Left(S,15)~="KFDT_Ballistic_") { S = Mid(S,15); // Weapon name. return Victim$Chr(6)$"M killed himself with "$S; } - else if( class(DamType)!=None ) + else if(class(DamType)!=None) return Victim$Chr(6)$"M was burned to death"; - else if( class(DamType)!=None ) + else if(class(DamType)!=None) return Victim$Chr(6)$"M was blown into pieces"; return Victim$Chr(6)$"M had a sudden heart attack"; } -simulated final function string ParseKillMsg( string Victim, string Killer, bool bFF, class DamType ) +simulated final function string ParseKillMsg(string Victim, string Killer, bool bFF, class DamType) { local string T,S; T = (bFF ? "O" : "K"); S = string(DamType.Name); - if( Left(S,15)~="KFDT_Ballistic_" ) + if(Left(S,15)~="KFDT_Ballistic_") { S = Mid(S,15); // Weapon name. return Chr(6)$"O"$Victim$Chr(6)$"M was killed by "$Chr(6)$T$Killer$Chr(6)$"M's "$S; } - else if( class(DamType)!=None ) + else if(class(DamType)!=None) return Chr(6)$"O"$Victim$Chr(6)$"M was incinerated by "$Chr(6)$T$Killer; - else if( class(DamType)!=None ) + else if(class(DamType)!=None) return Chr(6)$"O"$Victim$Chr(6)$"M was blown up by "$Chr(6)$T$Killer; return Chr(6)$"O"$Victim$Chr(6)$"M was killed by "$Chr(6)$T$Killer; } -reliable server function ServerCamera( name NewMode ) +reliable server function ServerCamera(name NewMode) { // <- REMOVED CAMERA LOGGING (PlayerController) - if ( NewMode == '1st' ) + if (NewMode == '1st') NewMode = 'FirstPerson'; - else if ( NewMode == '3rd' ) + else if (NewMode == '3rd') NewMode = 'ThirdPerson'; - SetCameraMode( NewMode ); + SetCameraMode(NewMode); } -exec function Camera( name NewMode ) +exec function Camera(name NewMode) { - ServerCamera( PlayerCamera.CameraStyle=='FirstPerson' ? 'ThirdPerson' : 'FirstPerson' ); + ServerCamera(PlayerCamera.CameraStyle=='FirstPerson' ? 'ThirdPerson' : 'FirstPerson'); } -simulated final function ToggleFPBody( bool bEnable ) +simulated final function ToggleFPBody(bool bEnable) { bShowFPLegs = bEnable; Class'ExtPlayerController'.Default.bShowFPLegs = bEnable; - if( ExtHumanPawn(Pawn)!=None ) + if(ExtHumanPawn(Pawn)!=None) ExtHumanPawn(Pawn).UpdateFPLegs(); } -/*exec function KickBan( string S ) +/*exec function KickBan(string S) { - if( WorldInfo.Game!=None ) + if(WorldInfo.Game!=None) WorldInfo.Game.KickBan(S); }*/ -exec function Kick( string S ) +exec function Kick(string S) { - if( WorldInfo.Game!=None ) + if(WorldInfo.Game!=None) WorldInfo.Game.Kick(S); } reliable server function SkipLobby(); -Delegate OnChangePerk( ExtPlayerController PC, class NewPerk ); +Delegate OnChangePerk(ExtPlayerController PC, class NewPerk); -reliable server function SwitchToPerk( class PerkClass ) +reliable server function SwitchToPerk(class PerkClass) { - if( PerkClass!=None ) + if(PerkClass!=None) OnChangePerk(Self,PerkClass); } -Delegate OnBoughtStats( ExtPlayerController PC, class PerkClass, int iStat, int Amount ); +Delegate OnBoughtStats(ExtPlayerController PC, class PerkClass, int iStat, int Amount); -reliable server function BuyPerkStat( class PerkClass, int iStat, int Amount ) +reliable server function BuyPerkStat(class PerkClass, int iStat, int Amount) { - if( PerkClass!=None && Amount>0 && iStat>=0 ) + if(PerkClass!=None && Amount>0 && iStat>=0) OnBoughtStats(Self,PerkClass,iStat,Amount); } -Delegate OnBoughtTrait( ExtPlayerController PC, class PerkClass, class Trait ); +Delegate OnBoughtTrait(ExtPlayerController PC, class PerkClass, class Trait); -reliable server function BoughtTrait( class PerkClass, class Trait ) +reliable server function BoughtTrait(class PerkClass, class Trait) { - if( PerkClass!=None && Trait!=None ) + if(PerkClass!=None && Trait!=None) OnBoughtTrait(Self,PerkClass,Trait); } -Delegate OnPerkReset( ExtPlayerController PC, class PerkClass, bool bPrestige ); +Delegate OnPerkReset(ExtPlayerController PC, class PerkClass, bool bPrestige); -reliable server function ServerResetPerk( class PerkClass, bool bPrestige ) +reliable server function ServerResetPerk(class PerkClass, bool bPrestige) { - if( PerkClass!=None ) + if(PerkClass!=None) OnPerkReset(Self,PerkClass,bPrestige); } -Delegate OnAdminHandle( ExtPlayerController PC, int PlayerID, int Action ); +Delegate OnAdminHandle(ExtPlayerController PC, int PlayerID, int Action); -reliable server function AdminRPGHandle( int PlayerID, int Action ) +reliable server function AdminRPGHandle(int PlayerID, int Action) { OnAdminHandle(Self,PlayerID,Action); } -simulated reliable client event bool ShowConnectionProgressPopup( EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false) +simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false) { switch(ProgressType) { @@ -598,16 +598,16 @@ simulated reliable client event bool ShowConnectionProgressPopup( EProgressMessa simulated function CancelConnection() { - if( KFExtendedHUD(myHUD)!=None ) + if(KFExtendedHUD(myHUD)!=None) KFExtendedHUD(myHUD).CancelConnection(); else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect"); } function NotifyLevelUp(class PerkClass, byte PerkLevel, byte NewPrestigeLevel); -function ShowBossNameplate( KFInterface_MonsterBoss KFBoss, optional string PlayerName) +function ShowBossNameplate(KFInterface_MonsterBoss KFBoss, optional string PlayerName) { - if( !bNamePlateShown ) // Dont make multiple bosses pop this up multiple times. + if(!bNamePlateShown) // Dont make multiple bosses pop this up multiple times. { bNamePlateShown = true; Super.ShowBossNameplate(KFBoss,PlayerName); @@ -616,40 +616,40 @@ function ShowBossNameplate( KFInterface_MonsterBoss KFBoss, optional string Play } function HideBossNameplate() { - if( !bNamePlateHidden ) + if(!bNamePlateHidden) { bNamePlateHidden = false; Super.HideBossNameplate(); ClearTimer('HideBossNameplate'); - if( MyGFxHUD!=None ) + if(MyGFxHUD!=None) MyGFxHUD.MusicNotification.SetVisible(true); } } -function UpdateRotation( float DeltaTime ) +function UpdateRotation(float DeltaTime) { - if( OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell() ) + if(OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell()) NotifyFixed(1); Super.UpdateRotation(DeltaTime); OldViewRot = Rotation; } -reliable server function ServerGetUnloadInfo( byte CallID, class PerkClass, bool bUnload ) +reliable server function ServerGetUnloadInfo(byte CallID, class PerkClass, bool bUnload) { OnRequestUnload(Self,CallID,PerkClass,bUnload); } -delegate OnRequestUnload( ExtPlayerController PC, byte CallID, class PerkClass, bool bUnload ); +delegate OnRequestUnload(ExtPlayerController PC, byte CallID, class PerkClass, bool bUnload); -reliable client function ClientGotUnloadInfo( byte CallID, byte Code, optional int DataA, optional int DataB ) +reliable client function ClientGotUnloadInfo(byte CallID, byte Code, optional int DataA, optional int DataB) { OnClientGetResponse(CallID,Code,DataA,DataB); } -delegate OnClientGetResponse( byte CallID, byte Code, int DataA, int DataB ); -function DefClientResponse( byte CallID, byte Code, int DataA, int DataB ); +delegate OnClientGetResponse(byte CallID, byte Code, int DataA, int DataB); +function DefClientResponse(byte CallID, byte Code, int DataA, int DataB); -reliable client function ClientUsedAmmo( Ext_T_SupplierInteract S ) +reliable client function ClientUsedAmmo(Ext_T_SupplierInteract S) { - if( Pawn!=None && S!=None ) + if(Pawn!=None && S!=None) S.UsedOnClient(Pawn); } @@ -657,31 +657,31 @@ unreliable server function ServerNextSpectateMode() { local Pawn HumanViewTarget; - if( !IsSpectating() ) + if(!IsSpectating()) return; // switch to roaming if human viewtarget is dead - if( CurrentSpectateMode != SMODE_Roaming ) + if(CurrentSpectateMode != SMODE_Roaming) { HumanViewTarget = Pawn(ViewTarget); - if( HumanViewTarget == none || !HumanViewTarget.IsAliveAndWell() ) + if(HumanViewTarget == none || !HumanViewTarget.IsAliveAndWell()) { SpectateRoaming(); return; } } - switch ( CurrentSpectateMode ) + switch (CurrentSpectateMode) { case SMODE_PawnFreeCam: - SpectatePlayer( SMODE_PawnThirdPerson ); + SpectatePlayer(SMODE_PawnThirdPerson); break; case SMODE_PawnThirdPerson: - SpectatePlayer( SMODE_PawnFirstPerson ); + SpectatePlayer(SMODE_PawnFirstPerson); break; case SMODE_PawnFirstPerson: case SMODE_Roaming: - SpectatePlayer( SMODE_PawnFreeCam ); + SpectatePlayer(SMODE_PawnFreeCam); break; } } @@ -691,37 +691,37 @@ function ViewAPlayer(int dir) local PlayerReplicationInfo PRI; PRI = GetNextViewablePlayer(dir); - if ( PRI!=None ) + if (PRI!=None) { SetViewTarget(PRI); ClientMessage("Now viewing from "$PRI.GetHumanReadableName()); } } -exec function ViewPlayerID( int ID ) +exec function ViewPlayerID(int ID) { ServerViewPlayerID(ID); } -reliable server function ServerViewPlayerID( int ID ) +reliable server function ServerViewPlayerID(int ID) { local PlayerReplicationInfo PRI; - if( !IsSpectating() ) + if(!IsSpectating()) return; // Find matching player by ID foreach WorldInfo.GRI.PRIArray(PRI) { - if ( PRI.PlayerID==ID ) + if (PRI.PlayerID==ID) break; } - if( PRI==None || PRI.PlayerID!=ID || Controller(PRI.Owner)==None || Controller(PRI.Owner).Pawn==None || !WorldInfo.Game.CanSpectate(self, PRI) ) + if(PRI==None || PRI.PlayerID!=ID || Controller(PRI.Owner)==None || Controller(PRI.Owner).Pawn==None || !WorldInfo.Game.CanSpectate(self, PRI)) return; SetViewTarget(PRI); ClientMessage("Now viewing from "$PRI.GetHumanReadableName()); - if( CurrentSpectateMode==SMODE_Roaming ) - SpectatePlayer( SMODE_PawnFreeCam ); + if(CurrentSpectateMode==SMODE_Roaming) + SpectatePlayer(SMODE_PawnFreeCam); } reliable server function SpectateRoaming() @@ -731,14 +731,14 @@ reliable server function SpectateRoaming() P = Pawn(ViewTarget); ClientMessage("Viewing from own camera."); Super.SpectateRoaming(); - if( P!=None ) + if(P!=None) { SetLocation(P.Location); SetRotation(P.GetViewRotation()); ClientSetLocation(Location,Rotation); } } -reliable client function ClientSetLocation( vector NewLocation, rotator NewRotation ) +reliable client function ClientSetLocation(vector NewLocation, rotator NewRotation) { SetLocation(NewLocation); Super.ClientSetLocation(NewLocation,NewRotation); @@ -746,15 +746,15 @@ reliable client function ClientSetLocation( vector NewLocation, rotator NewRotat unreliable server function ServerPlayLevelUpDialog() { - if( NextCommTime=20.f ) // Finished view. + if(T>=20.f) // Finished view. { bEndGameCamFocus = false; - if( LocalPlayer(Player)!=None && KFPawn(ViewTarget)!=None ) + if(LocalPlayer(Player)!=None && KFPawn(ViewTarget)!=None) KFPawn(ViewTarget).SetMeshVisibility(!Global.UsingFirstPersonCamera()); return false; } @@ -905,17 +905,17 @@ final function bool CalcEndGameCam() CalcViewLocation.Z = 1.f; RT = WorldInfo.RealTimeSeconds; - if( T<4.f ) + if(T<4.f) RT += (4.f-T); CalcViewLocation.X = Sin(RT*0.08f); CalcViewLocation.Y = Cos(RT*0.08f); CalcViewLocation = EndGameCamFocusPos[0] + Normal(CalcViewLocation)*350.f; - if( Trace(HL,HN,CalcViewLocation,EndGameCamFocusPos[0],false,vect(16,16,16))!=None ) + if(Trace(HL,HN,CalcViewLocation,EndGameCamFocusPos[0],false,vect(16,16,16))!=None) CalcViewLocation = HL; CalcViewRotation = rotator(EndGameCamFocusPos[0]-CalcViewLocation); - if( T<4.f && LocalPlayer(Player)!=None ) // Zoom in to epic death. + if(T<4.f && LocalPlayer(Player)!=None) // Zoom in to epic death. { T*=0.25; CalcViewLocation = CalcViewLocation*T + EndGameCamFocusPos[1]*(1.f-T); @@ -923,9 +923,9 @@ final function bool CalcEndGameCam() } return true; } -simulated event GetPlayerViewPoint( out vector out_Location, out Rotator out_Rotation ) +simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) { - if( bEndGameCamFocus && CalcEndGameCam() ) + if(bEndGameCamFocus && CalcEndGameCam()) { out_Location = CalcViewLocation; out_Rotation = CalcViewRotation; @@ -935,7 +935,7 @@ simulated event GetPlayerViewPoint( out vector out_Location, out Rotator out_Rot } exec function DebugRenderMode() { - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { bRenderModes = !bRenderModes; SaveConfig(); @@ -944,9 +944,9 @@ exec function DebugRenderMode() } // Stats traffic. -reliable server function ServerRequestStats( byte ListNum ) +reliable server function ServerRequestStats(byte ListNum) { - if( ListNum<3 ) + if(ListNum<3) { TransitListNum = ListNum; TransitIndex = 0; @@ -955,29 +955,29 @@ reliable server function ServerRequestStats( byte ListNum ) } function SendNextList() { - if( !OnClientGetStat(Self,TransitListNum,TransitIndex++) ) + if(!OnClientGetStat(Self,TransitListNum,TransitIndex++)) { ClientGetStat(TransitListNum,true); ClearTimer('SendNextList'); } } -simulated reliable client function ClientGetStat( byte ListNum, bool bFinal, optional string N, optional UniqueNetId ID, optional int V ) +simulated reliable client function ClientGetStat(byte ListNum, bool bFinal, optional string N, optional UniqueNetId ID, optional int V) { OnClientReceiveStat(ListNum,bFinal,N,ID,V); } -Delegate OnClientReceiveStat( byte ListNum, bool bFinal, string N, UniqueNetId ID, int V ); -Delegate bool OnClientGetStat( ExtPlayerController PC, byte ListNum, int StatIndex ); +Delegate OnClientReceiveStat(byte ListNum, bool bFinal, string N, UniqueNetId ID, int V); +Delegate bool OnClientGetStat(ExtPlayerController PC, byte ListNum, int StatIndex); -reliable server function ChangeSpectateMode( bool bSpectator ) +reliable server function ChangeSpectateMode(bool bSpectator) { OnSpectateChange(Self,bSpectator); } -simulated reliable client function ClientSpectateMode( bool bSpectator ) +simulated reliable client function ClientSpectateMode(bool bSpectator) { UpdateURL("SpectatorOnly",(bSpectator ? "1" : "0"),false); } -Delegate OnSpectateChange( ExtPlayerController PC, bool bSpectator ); +Delegate OnSpectateChange(ExtPlayerController PC, bool bSpectator); state RagdollMove extends PlayerWalking { @@ -987,58 +987,58 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode; { FOVAngle = DesiredFOV; - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) SetCameraMode('ThirdPerson'); } event EndState(Name NewState) { FOVAngle = DesiredFOV; - if( Pawn!=none && NewState!='Dead' ) + if(Pawn!=none && NewState!='Dead') Global.SetCameraMode('FirstPerson'); } - function PlayerMove( float DeltaTime ) + function PlayerMove(float DeltaTime) { local rotator OldRotation; - if( Pawn == None ) + if(Pawn == None) GotoState('Dead'); else { // Update rotation. OldRotation = Rotation; - UpdateRotation( DeltaTime ); + UpdateRotation(DeltaTime); bDoubleJump = false; bPressedJump = false; - if( Role < ROLE_Authority ) // then save this move and replicate it + if(Role < ROLE_Authority) // then save this move and replicate it ReplicateMove(DeltaTime, vect(0,0,0), DCLICK_None, OldRotation - Rotation); else ProcessMove(DeltaTime, vect(0,0,0), DCLICK_None, OldRotation - Rotation); } } - simulated event GetPlayerViewPoint( out vector out_Location, out Rotator out_Rotation ) + simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) { local Actor TheViewTarget; local vector HL,HN,EndOffset; - if( bEndGameCamFocus && CalcEndGameCam() ) + if(bEndGameCamFocus && CalcEndGameCam()) { out_Location = CalcViewLocation; out_Rotation = CalcViewRotation; return; } - if( Global.UsingFirstPersonCamera() ) + if(Global.UsingFirstPersonCamera()) Global.GetPlayerViewPoint(out_Location,out_Rotation); else { out_Rotation = Rotation; TheViewTarget = GetViewTarget(); - if( TheViewTarget==None ) + if(TheViewTarget==None) TheViewTarget = Self; out_Location = TheViewTarget.Location; EndOffset = out_Location-vector(Rotation)*250.f; - if( TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None ) + if(TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None) out_Location = HL; else out_Location = EndOffset; } @@ -1049,21 +1049,21 @@ state PlayerWalking { ignores SeePlayer, HearNoise, Bump; - function PlayerMove( float DeltaTime ) + function PlayerMove(float DeltaTime) { local vector X,Y,Z, NewAccel; local eDoubleClickDir DoubleClickMove; local rotator OldRotation; local bool bSaveJump; - if( Pawn == None ) + if(Pawn == None) { GotoState('Dead'); } else { GetAxes(Pawn.Rotation,X,Y,Z); - if( VSZombie(Pawn)!=None ) + if(VSZombie(Pawn)!=None) VSZombie(Pawn).ModifyPlayerInput(Self,DeltaTime); // Update acceleration. @@ -1076,14 +1076,14 @@ ignores SeePlayer, HearNoise, Bump; AdjustPlayerWalkingMoveAccel(NewAccel); } - DoubleClickMove = PlayerInput.CheckForDoubleClickMove( DeltaTime/WorldInfo.TimeDilation ); + DoubleClickMove = PlayerInput.CheckForDoubleClickMove(DeltaTime/WorldInfo.TimeDilation); // Update rotation. OldRotation = Rotation; - UpdateRotation( DeltaTime ); + UpdateRotation(DeltaTime); bDoubleJump = false; - if( bPressedJump && Pawn.CannotJumpNow() ) + if(bPressedJump && Pawn.CannotJumpNow()) { bSaveJump = true; bPressedJump = false; @@ -1093,7 +1093,7 @@ ignores SeePlayer, HearNoise, Bump; bSaveJump = false; } - if( Role < ROLE_Authority ) // then save this move and replicate it + if(Role < ROLE_Authority) // then save this move and replicate it { ReplicateMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation); } @@ -1112,8 +1112,8 @@ state Dead { local KFPlayerInput KFPI; - SetTimer( 5.f, false, nameof(StartSpectate) ); - if ( (Pawn != None) && (Pawn.Controller == self) ) + SetTimer(5.f, false, nameof(StartSpectate)); + if ((Pawn != None) && (Pawn.Controller == self)) Pawn.Controller = None; Pawn = None; FOVAngle = DesiredFOV; @@ -1122,7 +1122,7 @@ state Dead FindGoodView(); CleanOutSavedMoves(); - if( KFPawn(ViewTarget)!=none ) + if(KFPawn(ViewTarget)!=none) { KFPawn(ViewTarget).SetMeshVisibility(true); } @@ -1137,18 +1137,18 @@ state Dead if(KFPI != none) KFPI.HideVoiceComms(); - if( MyGFxManager != none ) + if(MyGFxManager != none) MyGFxManager.CloseMenus(); - if(MyGFxHUD != none ) + if(MyGFxHUD != none) MyGFxHUD.ClearBuffIcons(); } - simulated event GetPlayerViewPoint( out vector out_Location, out Rotator out_Rotation ) + simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) { local Actor TheViewTarget; local vector HL,HN,EndOffset; - if( bEndGameCamFocus && CalcEndGameCam() ) + if(bEndGameCamFocus && CalcEndGameCam()) { out_Location = CalcViewLocation; out_Rotation = CalcViewRotation; @@ -1156,12 +1156,12 @@ state Dead } out_Rotation = Rotation; TheViewTarget = GetViewTarget(); - if( TheViewTarget==None ) + if(TheViewTarget==None) TheViewTarget = Self; out_Location = TheViewTarget.Location; EndOffset = out_Location-vector(Rotation)*400.f; - if( TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None ) + if(TheViewTarget.Trace(HL,HN,EndOffset,out_Location,false,vect(16,16,16))!=None) out_Location = HL; else out_Location = EndOffset; } diff --git a/ServerExt/Classes/ExtPlayerInput.uc b/ServerExt/Classes/ExtPlayerInput.uc index c248d4c..9b95fc8 100644 --- a/ServerExt/Classes/ExtPlayerInput.uc +++ b/ServerExt/Classes/ExtPlayerInput.uc @@ -16,14 +16,14 @@ simulated exec function IronSights(optional bool bHoldButtonMode) { local KFWeapon KFW; - if( Pawn != none ) + if(Pawn != none) { - if( KFPawn_Monster(Pawn)!=None ) + if(KFPawn_Monster(Pawn)!=None) Pawn.StartFire(1); else { KFW = KFWeapon(Pawn.Weapon); - if ( KFW != None ) + if (KFW != None) KFW.SetIronSights((bHoldButtonMode) ? true : !KFW.bUsingSights); } } @@ -32,14 +32,14 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode) { local KFWeapon KFW; - if( Pawn != none ) + if(Pawn != none) { - if( KFPawn_Monster(Pawn)!=None ) + if(KFPawn_Monster(Pawn)!=None) Pawn.StopFire(1); else { KFW = KFWeapon(Pawn.Weapon); - if ( !KFW.bHasIronSights || bHoldButtonMode ) + if (!KFW.bHasIronSights || bHoldButtonMode) KFW.SetIronSights(false); } } @@ -47,40 +47,40 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode) simulated exec function ToggleFlashlight() { - if( KFPawn_Monster(Pawn)!=None && Pawn.Health>0 ) + if(KFPawn_Monster(Pawn)!=None && Pawn.Health>0) SetNightVision(!bNightVisionActive); else Super.ToggleFlashlight(); } -function PreClientTravel( string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) +function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) { Super.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel); - if( !bHandledTravel ) + if(!bHandledTravel) { bHandledTravel = true; - if( KFExtendedHUD(MyHUD)!=None ) + if(KFExtendedHUD(MyHUD)!=None) KFExtendedHUD(MyHUD).NotifyLevelChange(true); } } event bool FilterButtonInput(int ControllerId, Name Key, EInputEvent Event, float AmountDepressed, bool bGamepad) { - if ( MyGfxManager.bAfterLobby && Event==IE_Pressed && (Key == 'Escape' || Key == 'XboxTypeS_Start') ) + if (MyGfxManager.bAfterLobby && Event==IE_Pressed && (Key == 'Escape' || Key == 'XboxTypeS_Start')) { - if( MyGUIController==None || MyGUIController.bIsInvalid ) + if(MyGUIController==None || MyGUIController.bIsInvalid) { MyGUIController = class'KF2GUIController'.Static.GetGUIController(Outer); - if( MyGUIController==None ) + if(MyGUIController==None) { ExtPlayerController(Outer).CancelConnection(); return false; } } - if( MyGUIController.bIsInMenuState ) + if(MyGUIController.bIsInMenuState) { return false; } - else if( MyGFxManager.bMenusOpen ) + else if(MyGFxManager.bMenusOpen) { return MyGFxManager.ToggleMenus(); } diff --git a/ServerExt/Classes/ExtPlayerReplicationInfo.uc b/ServerExt/Classes/ExtPlayerReplicationInfo.uc index 7728ce0..13ef9d6 100644 --- a/ServerExt/Classes/ExtPlayerReplicationInfo.uc +++ b/ServerExt/Classes/ExtPlayerReplicationInfo.uc @@ -69,7 +69,7 @@ var repnotify class HasSupplier; replication { // Things the server should send to the client. - if ( true ) + if (true) RespawnCounter,AdminType,ECurrentPerk,ECurrentPerkLevel,ECurrentPerkPrestige,RepKills,RepEXP,RepLevelProgress,bIsDev,NameTag,FixedData,bHiddenUser,CustomCharacter,HasSupplier; if (bNetInitial || bInitialPT) RepPlayTime; @@ -81,22 +81,22 @@ simulated function PostBeginPlay() Super.PostBeginPlay(); SetTimer(1,true,'TickPT'); - if( WorldInfo.NetMode!=NM_DedicatedServer ) + if(WorldInfo.NetMode!=NM_DedicatedServer) { HUDPerkColor = PickPerkColor(); PC = GetALocalPlayerController(); - if( PC!=None ) + if(PC!=None) LocalOwnerPRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo); } else LocalOwnerPRI = Self; // Dedicated server can use self PRI. } // Resupply traits: -simulated final function bool CanUseSupply( Pawn P ) +simulated final function bool CanUseSupply(Pawn P) { return (SupplierLimit.SuppliedPawn!=P || SupplierLimit.NextSupplyTimer S; local int i; - if( List.SaleItems.Length<=Index ) + if(List.SaleItems.Length<=Index) List.SaleItems.Length = Index+1; List.SaleItems[Index].WeaponDef = Item.WeaponDef; List.SaleItems[Index].ClassName = Item.WeaponClass.Name; - if( class(Item.WeaponClass)!=None && class(Item.WeaponClass).Default.SingleClass!=None ) + if(class(Item.WeaponClass)!=None && class(Item.WeaponClass).Default.SingleClass!=None) List.SaleItems[Index].SingleClassName = class(Item.WeaponClass).Default.SingleClass.Name; else List.SaleItems[Index].SingleClassName = ''; List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : ''; @@ -284,7 +284,7 @@ simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCust List.SaleItems[Index].WeaponUpgradeDmgMultiplier[i+1] = Item.WeaponClass.Static.GetUpgradeStatScale(EWUS_Damage0, i+1); } - if( !bDedicated ) + if(!bDedicated) { List.SaleItems[Index].SecondaryAmmoImagePath = Item.WeaponClass.Default.SecondaryAmmoTexture!=None ? PathName(Item.WeaponClass.Default.SecondaryAmmoTexture) : "UI_SecondaryAmmo_TEX.GasTank"; List.SaleItems[Index].TraderFilter = Item.WeaponClass.Static.GetTraderFilter(); @@ -299,14 +299,14 @@ simulated function RecheckGRI() { local ExtPlayerController PC; - if( KFGameReplicationInfo(WorldInfo.GRI)==None ) + if(KFGameReplicationInfo(WorldInfo.GRI)==None) SetTimer(0.1,false,'RecheckGRI'); else { KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomList; foreach LocalPlayerControllers(class'ExtPlayerController',PC) { - if( PC.PurchaseHelper!=None ) + if(PC.PurchaseHelper!=None) { PC.PurchaseHelper.TraderItems = CustomList; } @@ -320,7 +320,7 @@ simulated final function bool ShowAdminName() } simulated function string GetAdminName() { - switch( AdminType ) + switch(AdminType) { case 0: return "Super Admin"; @@ -337,7 +337,7 @@ simulated function string GetAdminName() } simulated function string GetAdminNameAbr() { - switch( AdminType ) + switch(AdminType) { case 0: return "S"; @@ -354,7 +354,7 @@ simulated function string GetAdminNameAbr() } simulated function string GetAdminColor() { - switch( AdminType ) + switch(AdminType) { case 0: return "FF6600"; @@ -371,7 +371,7 @@ simulated function string GetAdminColor() } simulated function color GetAdminColorC() { - switch( AdminType ) + switch(AdminType) { case 0: return MakeColor(255,102,0,255); @@ -392,7 +392,7 @@ simulated function string GetHumanReadableName() return TaggedPlayerName; } -function SetFixedData( byte M ) +function SetFixedData(byte M) { OnModeSet(Self,M); FixedData = FixedData | M; @@ -406,30 +406,30 @@ simulated final function string GetDesc() { local string S; - if( (FixedData & 1)!=0 ) + if((FixedData & 1)!=0) S = "A."; - if( (FixedData & 2)!=0 ) + if((FixedData & 2)!=0) S $= "WF."; - if( (FixedData & 4)!=0 ) + if((FixedData & 4)!=0) S $= "G."; - if( (FixedData & 8)!=0 ) + if((FixedData & 8)!=0) S $= "NW."; - if( (FixedData & 16)!=0 ) + if((FixedData & 16)!=0) S $= "WA."; return S; } -delegate OnModeSet( ExtPlayerReplicationInfo PRI, byte Num ); +delegate OnModeSet(ExtPlayerReplicationInfo PRI, byte Num); -simulated final function bool LoadPlayerCharacter( byte CharIndex, out FMyCustomChar CharInfo ) +simulated final function bool LoadPlayerCharacter(byte CharIndex, out FMyCustomChar CharInfo) { local KFCharacterInfo_Human C; - if( CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length) ) + if(CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length)) return false; - if( SaveDataObjects.Length<=CharIndex ) + if(SaveDataObjects.Length<=CharIndex) SaveDataObjects.Length = CharIndex+1; - if( SaveDataObjects[CharIndex]==None ) + if(SaveDataObjects[CharIndex]==None) { C = (CharIndex=(CharacterArchetypes.Length+CustomCharList.Length) ) + if(CustomCharacter.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length)) return false; - if( SaveDataObjects.Length<=CustomCharacter.CharacterIndex ) + if(SaveDataObjects.Length<=CustomCharacter.CharacterIndex) SaveDataObjects.Length = CustomCharacter.CharacterIndex+1; - if( SaveDataObjects[CustomCharacter.CharacterIndex]==None ) + if(SaveDataObjects[CustomCharacter.CharacterIndex]==None) { C = (CustomCharacter.CharacterIndex=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(CharIndex) ) + if(CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(CharIndex)) CharIndex = 0; - if( bFirstSet && RepCustomizationInfo.CharacterIndex==CharIndex ) + if(bFirstSet && RepCustomizationInfo.CharacterIndex==CharIndex) { // Copy properties from default character info. NewChar.HeadMeshIndex = RepCustomizationInfo.HeadMeshIndex; NewChar.HeadSkinIndex = RepCustomizationInfo.HeadSkinIndex; NewChar.BodyMeshIndex = RepCustomizationInfo.BodyMeshIndex; NewChar.BodySkinIndex = RepCustomizationInfo.BodySkinIndex; - for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i ) + for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i) { NewChar.AttachmentMeshIndices[i] = RepCustomizationInfo.AttachmentMeshIndices[i]; NewChar.AttachmentSkinIndices[i] = RepCustomizationInfo.AttachmentSkinIndices[i]; } } - if( LoadPlayerCharacter(CharIndex,NewChar) ) + if(LoadPlayerCharacter(CharIndex,NewChar)) { NewChar.CharacterIndex = CharIndex; CustomCharacter = NewChar; ServerSetCharacterX(NewChar); - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) CharacterCustomizationChanged(); } } -simulated function UpdateCustomization( byte Type, byte MeshIndex, byte SkinIndex, optional byte SlotIndex ) +simulated function UpdateCustomization(byte Type, byte MeshIndex, byte SkinIndex, optional byte SlotIndex) { - switch( Type ) + switch(Type) { case CO_Head: CustomCharacter.HeadMeshIndex = MeshIndex; @@ -503,26 +503,26 @@ simulated function UpdateCustomization( byte Type, byte MeshIndex, byte SkinInde } SavePlayerCharacter(); ServerSetCharacterX(CustomCharacter); - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) CharacterCustomizationChanged(); } simulated final function RemoveAttachments() { local byte i; - for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i ) + for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i) { CustomCharacter.AttachmentMeshIndices[i] = `CLEARED_ATTACHMENT_INDEX; CustomCharacter.AttachmentSkinIndices[i] = 0; } SavePlayerCharacter(); ServerSetCharacterX(CustomCharacter); - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) CharacterCustomizationChanged(); } simulated function ClearCharacterAttachment(int AttachmentIndex) { - if( UsesCustomChar() ) + if(UsesCustomChar()) { CustomCharacter.AttachmentMeshIndices[AttachmentIndex] = `CLEARED_ATTACHMENT_INDEX; CustomCharacter.AttachmentSkinIndices[AttachmentIndex] = 0; @@ -530,42 +530,42 @@ simulated function ClearCharacterAttachment(int AttachmentIndex) else Super.ClearCharacterAttachment(AttachmentIndex); } -reliable server final function ServerSetCharacterX( FMyCustomChar NewMeshInfo ) +reliable server final function ServerSetCharacterX(FMyCustomChar NewMeshInfo) { - if( NewMeshInfo.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(NewMeshInfo.CharacterIndex) ) + if(NewMeshInfo.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(NewMeshInfo.CharacterIndex)) return; CustomCharacter = NewMeshInfo; - if ( Role == Role_Authority ) + if (Role == Role_Authority) { CharacterCustomizationChanged(); } } -simulated final function bool IsClientCharLocked( byte Index ) +simulated final function bool IsClientCharLocked(byte Index) { - if( Index=CharacterArchetypes.Length); } simulated final function KFCharacterInfo_Human GetSelectedArch() { - if( UsesCustomChar() ) + if(UsesCustomChar()) return (CustomCharacter.CharacterIndex=2 ) + if(Data.GetArVer()>=2) S = Data.ReadStr(); - if( S=="" ) // Stock skin. + if(S=="") // Stock skin. return; - for( i=0; i=2 ) + if(Data.GetArVer()>=2) S = Data.ReadStr(); - if( S=="" ) // Stock skin. + if(S=="") // Stock skin. return; Data.SkipBytes(4); n = Data.ReadInt(); - for( i=0; i Res ); -function SetData( out array S ); +function GetData(out array Res); +function SetData(out array S); // Archive version (to allow modder to make upgraded stat binarily compatible) function int GetArVer(); -function SetArVer( int Ver ); +function SetArVer(int Ver); // Push/Pop file limitators (to prevent it from reading EoF in sub sections). -function PushEOFLimit( int EndOffset ); +function PushEOFLimit(int EndOffset); function PopEOFLimit(); // Get most recent save version for this user. function int GetSaveVersion(); -function SetSaveVersion( int Num ); +function SetSaveVersion(int Num); diff --git a/ServerExt/Classes/ExtSpawnPointHelper.uc b/ServerExt/Classes/ExtSpawnPointHelper.uc index e08b6c9..0b5b062 100644 --- a/ServerExt/Classes/ExtSpawnPointHelper.uc +++ b/ServerExt/Classes/ExtSpawnPointHelper.uc @@ -5,7 +5,7 @@ Class ExtSpawnPointHelper extends Info var transient array PendingList,CheckedList; var array ValidSpawnSpots; -static final function ExtSpawnPointHelper FindHelper( WorldInfo Level ) +static final function ExtSpawnPointHelper FindHelper(WorldInfo Level) { local ExtSpawnPointHelper H; @@ -24,21 +24,21 @@ final function Actor PickBestSpawn() BestScore = 0; foreach ValidSpawnSpots(N) { - if( Rand(4)==0 ) + if(Rand(4)==0) { Score = FRand(); foreach WorldInfo.AllPawns(class'KFPawn',P,N.Location,2000.f) { - if( !P.IsAliveAndWell() ) + if(!P.IsAliveAndWell()) continue; Dist = VSize(N.Location-P.Location); - if( FastTrace(P.Location,N.Location) ) + if(FastTrace(P.Location,N.Location)) Dist*=0.75; - if( P.IsA('KFPawn_Human') ) + if(P.IsA('KFPawn_Human')) Score+=(3000.f-Dist)/2000.f; else Score-=(3500.f-Dist)/2500.f; } - if( BestN==None || Score>BestScore ) + if(BestN==None || Score>BestScore) { BestN = N; BestScore = Score; @@ -49,21 +49,21 @@ final function Actor PickBestSpawn() // See if can spawn ontop of other players. foreach WorldInfo.AllPawns(class'KFPawn_Human',H) { - if( !H.IsAliveAndWell() || H.Physics==PHYS_Falling || (ExtHumanPawn(H)!=None && ExtHumanPawn(H).bFeigningDeath) ) + if(!H.IsAliveAndWell() || H.Physics==PHYS_Falling || (ExtHumanPawn(H)!=None && ExtHumanPawn(H).bFeigningDeath)) continue; Score = FRand(); foreach WorldInfo.AllPawns(class'KFPawn',P,H.Location,2000.f) { - if( !P.IsAliveAndWell() ) + if(!P.IsAliveAndWell()) continue; Dist = VSize(H.Location-P.Location); - if( FastTrace(P.Location,H.Location) ) + if(FastTrace(P.Location,H.Location)) Dist*=0.75; - if( P.IsA('KFPawn_Human') ) + if(P.IsA('KFPawn_Human')) Score+=(3000.f-Dist)/3000.f; else Score-=(3500.f-Dist)/3500.f; } - if( BestN==None || Score>BestScore ) + if(BestN==None || Score>BestScore) { BestN = H; BestScore = Score; @@ -83,14 +83,14 @@ function InitChecker() foreach WorldInfo.AllNavigationPoints(class'PlayerStart',PS) { Fallback = PS; - if( PS.bEnabled && PS.TeamIndex==0 ) + if(PS.bEnabled && PS.TeamIndex==0) { CheckSpawn(PS); - if( PendingList.Length!=0 ) + if(PendingList.Length!=0) break; } } - if( PendingList.Length==0 && Fallback!=None ) + if(PendingList.Length==0 && Fallback!=None) CheckSpawn(Fallback); SetTimer(0.001,true,'NextCheck'); } @@ -99,9 +99,9 @@ function NextCheck() local NavigationPoint N; local byte i; - if( PendingList.Length!=0 ) + if(PendingList.Length!=0) { - while( ++i<5 && PendingList.Length!=0 ) + while(++i<5 && PendingList.Length!=0) { N = PendingList[PendingList.Length-1]; PendingList.Remove(PendingList.Length-1,1); @@ -114,7 +114,7 @@ function NextCheck() CheckedList.Length = 0; } } -final function CheckSpawn( NavigationPoint N ) +final function CheckSpawn(NavigationPoint N) { local vector V; local ReachSpec R; @@ -122,7 +122,7 @@ final function CheckSpawn( NavigationPoint N ) local KFPawnBlockingVolume P; V = N.Location; - if( N.MaxPathSize.Radius>30 && N.MaxPathSize.Height>80 && FindSpot(vect(36,36,86),V) && KFDoorMarker(N)==None && PickupFactory(N)==None ) + if(N.MaxPathSize.Radius>30 && N.MaxPathSize.Height>80 && FindSpot(vect(36,36,86),V) && KFDoorMarker(N)==None && PickupFactory(N)==None) { //DrawDebugLine(V,V+vect(0,0,50),255,255,255,true); ValidSpawnSpots.AddItem(N); @@ -132,22 +132,22 @@ final function CheckSpawn( NavigationPoint N ) foreach N.PathList(R) { E = R.GetEnd(); - if( E==None || R.CollisionRadius<30 || R.CollisionHeight<80 || R.Class==Class'ProscribedReachSpec' ) + if(E==None || R.CollisionRadius<30 || R.CollisionHeight<80 || R.Class==Class'ProscribedReachSpec') { - //if( E!=None ) + //if(E!=None) // DrawDebugLine(E.Location,N.Location,255,255,0,true); continue; } - if( CheckedList.Find(E)!=INDEX_NONE ) + if(CheckedList.Find(E)!=INDEX_NONE) continue; // DO NOT go through any blocking volumes. V = (N.Location+E.Location) * 0.5; foreach OverlappingActors(class'KFPawnBlockingVolume',P,VSize(N.Location-V),V) { - if( P.bBlockPlayers && TraceComponent(V,V,P.CollisionComponent,E.Location,N.Location,vect(36,36,50)) ) + if(P.bBlockPlayers && TraceComponent(V,V,P.CollisionComponent,E.Location,N.Location,vect(36,36,50))) break; } - if( P==None ) + if(P==None) { //DrawDebugLine(E.Location,N.Location,0,255,0,true); PendingList.AddItem(E); diff --git a/ServerExt/Classes/ExtStatWriter.uc b/ServerExt/Classes/ExtStatWriter.uc index f6ee083..d94333a 100644 --- a/ServerExt/Classes/ExtStatWriter.uc +++ b/ServerExt/Classes/ExtStatWriter.uc @@ -1,7 +1,7 @@ // Interface class for outputting stats into a file or something. Interface ExtStatWriter; -function WriteValue( string Key, string Value ); -function StartIntendent( string Section, optional string Key, optional string Value ); +function WriteValue(string Key, string Value); +function StartIntendent(string Section, optional string Key, optional string Value); function EndIntendent(); function ResetFile(); diff --git a/ServerExt/Classes/ExtTraderContainer_Filter.uc b/ServerExt/Classes/ExtTraderContainer_Filter.uc index d642fea..a39700d 100644 --- a/ServerExt/Classes/ExtTraderContainer_Filter.uc +++ b/ServerExt/Classes/ExtTraderContainer_Filter.uc @@ -11,18 +11,18 @@ function SetPerkFilterData(byte FilterIndex) SetBool("filterVisibliity", true); - KFPC = ExtPlayerController( GetPC() ); - if ( KFPC != none ) + KFPC = ExtPlayerController(GetPC()); + if (KFPC != none) { PrM = KFPC.ActivePerkManager; KFPRI = KFPlayerReplicationInfo(KFPC.PlayerReplicationInfo); - if ( KFPRI != none && PrM!=None ) + if (KFPRI != none && PrM!=None) { i = Max(PrM.UserPerks.Find(PrM.CurrentPerk),0); SetInt("selectedIndex", i); // Set the title of this filter based on either the perk or the off perk string - if( FilterIndex < PrM.UserPerks.Length ) + if(FilterIndex < PrM.UserPerks.Length) { SetString("filterText", PrM.UserPerks[FilterIndex].PerkName); } @@ -34,16 +34,16 @@ function SetPerkFilterData(byte FilterIndex) DataProvider = CreateArray(); for (i = 0; i < PrM.UserPerks.Length; i++) { - FilterObject = CreateObject( "Object" ); + FilterObject = CreateObject("Object"); FilterObject.SetString("source", PrM.UserPerks[i].GetPerkIconPath(PrM.UserPerks[i].CurrentLevel)); - DataProvider.SetElementObject( i, FilterObject ); + DataProvider.SetElementObject(i, FilterObject); } - FilterObject = CreateObject( "Object" ); + FilterObject = CreateObject("Object"); FilterObject.SetString("source", "img://"$class'KFGFxObject_TraderItems'.default.OffPerkIconPath); - DataProvider.SetElementObject( i, FilterObject ); + DataProvider.SetElementObject(i, FilterObject); - SetObject( "filterSource", DataProvider ); + SetObject("filterSource", DataProvider); } } } diff --git a/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc b/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc index 4e5aa86..a3e94f5 100644 --- a/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc +++ b/ServerExt/Classes/ExtTraderContainer_PlayerInfo.uc @@ -7,7 +7,7 @@ function SetPerkInfo() local float V; KFPC = ExtPlayerController(GetPC()); - if( KFPC!=none && KFPC.ActivePerkManager!=None && KFPC.ActivePerkManager.CurrentPerk!=None ) + if(KFPC!=none && KFPC.ActivePerkManager!=None && KFPC.ActivePerkManager.CurrentPerk!=None) { CurrentPerk = KFPC.ActivePerkManager.CurrentPerk; SetString("perkName", CurrentPerk.PerkName); @@ -28,14 +28,14 @@ function SetPerkList() local Ext_PerkBase P; KFPC = ExtPlayerController(GetPC()); - if( KFPC != none && KFPC.ActivePerkManager!=None ) + if(KFPC != none && KFPC.ActivePerkManager!=None) { DataProvider = CreateArray(); for (i = 0; i < KFPC.ActivePerkManager.UserPerks.Length; i++) { P = KFPC.ActivePerkManager.UserPerks[i]; - PerkObject = CreateObject( "Object" ); + PerkObject = CreateObject("Object"); PerkObject.SetString("name", P.PerkName); PerkObject.SetString("perkIconSource", P.GetPerkIconPath(P.CurrentLevel)); PerkObject.SetInt("level", P.CurrentLevel); diff --git a/ServerExt/Classes/ExtTraderContainer_Store.uc b/ServerExt/Classes/ExtTraderContainer_Store.uc index 158df19..504f6d5 100644 --- a/ServerExt/Classes/ExtTraderContainer_Store.uc +++ b/ServerExt/Classes/ExtTraderContainer_Store.uc @@ -9,9 +9,9 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array local ExtPlayerController EKFPC; EKFPC = ExtPlayerController(KFPC); - if ( EKFPC!=none && EKFPC.ActivePerkManager!=None) + if (EKFPC!=none && EKFPC.ActivePerkManager!=None) { - if( FilterIndex for (i = 0; i < ItemList.Length; i++) { - if ( IsItemFiltered(ItemList[i]) ) + if (IsItemFiltered(ItemList[i])) { continue; // Skip this item if it's in our inventory } - else if ( ItemList[i].AssociatedPerkClasses.length > 0 && ItemList[i].AssociatedPerkClasses[0] != none && TargetPerkClass != class'KFPerk_Survivalist' - && (TargetPerkClass==None || ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass) == INDEX_NONE ) ) + else if (ItemList[i].AssociatedPerkClasses.length > 0 && ItemList[i].AssociatedPerkClasses[0] != none && TargetPerkClass != class'KFPerk_Survivalist' + && (TargetPerkClass==None || ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass) == INDEX_NONE)) { continue; // filtered by perk } diff --git a/ServerExt/Classes/ExtWeap_Pistol_9mm.uc b/ServerExt/Classes/ExtWeap_Pistol_9mm.uc index 780d15e..cfe1182 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_9mm.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_9mm.uc @@ -17,12 +17,12 @@ simulated static function bool AllowedForAllPerks() return true; } -simulated function ConsumeAmmo( byte FireModeNum ) +simulated function ConsumeAmmo(byte FireModeNum) { } -simulated static event class GetWeaponPerkClass( class InstigatorPerkClass ) +simulated static event class GetWeaponPerkClass(class InstigatorPerkClass) { if(InstigatorPerkClass != None) return InstigatorPerkClass; diff --git a/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc b/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc index eb36097..1243269 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_Dual9mm.uc @@ -17,12 +17,12 @@ simulated static function bool AllowedForAllPerks() return true; } -simulated function ConsumeAmmo( byte FireModeNum ) +simulated function ConsumeAmmo(byte FireModeNum) { } -simulated static event class GetWeaponPerkClass( class InstigatorPerkClass ) +simulated static event class GetWeaponPerkClass(class InstigatorPerkClass) { if(InstigatorPerkClass != None) return InstigatorPerkClass; diff --git a/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc b/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc index 81164bc..c51ed2e 100644 --- a/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc +++ b/ServerExt/Classes/ExtWeap_Pistol_MedicS.uc @@ -24,13 +24,13 @@ simulated static function bool AllowedForAllPerks() return true; } -simulated function ConsumeAmmo( byte FireModeNum ) +simulated function ConsumeAmmo(byte FireModeNum) { if(FireModeNum == ALTFIRE_FIREMODE) super.ConsumeAmmo(FireModeNum); } -simulated static event class GetWeaponPerkClass( class InstigatorPerkClass ) +simulated static event class GetWeaponPerkClass(class InstigatorPerkClass) { if(InstigatorPerkClass != None) return InstigatorPerkClass; diff --git a/ServerExt/Classes/ExtWeaponSkinList.uc b/ServerExt/Classes/ExtWeaponSkinList.uc index 831c6b1..89da31b 100644 --- a/ServerExt/Classes/ExtWeaponSkinList.uc +++ b/ServerExt/Classes/ExtWeaponSkinList.uc @@ -27,28 +27,28 @@ static function array GetWeaponSkin(int ItemId, EWeaponSkinTy local string FirstPMat; i = default.Skins.Find('Id', ItemId); - if( i > -1 ) + if(i > -1) { - switch( Type ) + switch(Type) { case WST_FirstPerson: foreach default.Skins[i].MIC_1P(FirstPMat) { LoadedMat = MaterialInterface(DynamicLoadObject(FirstPMat, class'MaterialInterface')); - if( LoadedMat != None ) + if(LoadedMat != None) Mats.AddItem(LoadedMat); } break; case WST_ThirdPerson: LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_3P, class'MaterialInterface')); - if( LoadedMat != None ) + if(LoadedMat != None) Mats.AddItem(LoadedMat); break; case WST_Pickup: LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_Pickup, class'MaterialInterface')); - if( LoadedMat != None ) + if(LoadedMat != None) Mats.AddItem(LoadedMat); break; @@ -58,12 +58,12 @@ static function array GetWeaponSkin(int ItemId, EWeaponSkinTy return Mats; } -static function SaveWeaponSkin(class WeaponDef, int ID, ExtPlayerController PC ) +static function SaveWeaponSkin(class WeaponDef, int ID, ExtPlayerController PC) { local int ALen, i; i = PC.SavedWeaponSkins.Find('WepDef', WeaponDef); - if( i > -1 ) + if(i > -1) PC.SavedWeaponSkins.Remove(i, 1); ALen = PC.SavedWeaponSkins.Length; @@ -77,7 +77,7 @@ static function bool IsSkinEquip(class WeaponDef, int ID, Ex { local int i; i = PC.SavedWeaponSkins.Find('ID', ID); - if( i > -1 ) + if(i > -1) return true; return false; diff --git a/ServerExt/Classes/ExtWebAdmin_UI.uc b/ServerExt/Classes/ExtWebAdmin_UI.uc index 261ec5a..fc967fb 100644 --- a/ServerExt/Classes/ExtWebAdmin_UI.uc +++ b/ServerExt/Classes/ExtWebAdmin_UI.uc @@ -33,19 +33,19 @@ struct FPropGroup var array ConfigList; // Value accessors. -Delegate string OnGetValue( name PropName, int ElementIndex ); -Delegate OnSetValue( name PropName, int ElementIndex, string Value ); +Delegate string OnGetValue(name PropName, int ElementIndex); +Delegate OnSetValue(name PropName, int ElementIndex, string Value); final function Cleanup() { ConfigList.Length = 0; } -final function AddSettingsPage( string PageName, class Obj, const out array Configs, delegate GetFunc, delegate SetFunc ) +final function AddSettingsPage(string PageName, class Obj, const out array Configs, delegate GetFunc, delegate SetFunc) { local int i; i = ConfigList.Find('PageName',PageName); - if( i>=0 ) // Make sure no dupe pages. + if(i>=0) // Make sure no dupe pages. PageName $= "_"$(ConfigList[i].Dupes++); i = ConfigList.Length; @@ -56,7 +56,7 @@ final function AddSettingsPage( string PageName, class Obj, const out ar ConfigList[i].GetValue = GetFunc; ConfigList[i].SetValue = SetFunc; } -final function bool HasConfigFor( class Obj ) +final function bool HasConfigFor(class Obj) { return (ConfigList.Find('ObjClass',Obj)>=0); } diff --git a/ServerExt/Classes/ExtWidget_BossHealthBar.uc b/ServerExt/Classes/ExtWidget_BossHealthBar.uc index 7ece3ae..98c4800 100644 --- a/ServerExt/Classes/ExtWidget_BossHealthBar.uc +++ b/ServerExt/Classes/ExtWidget_BossHealthBar.uc @@ -7,12 +7,12 @@ var transient bool bVisib,bHasInit; function TickHud(float DeltaTime) { - if( !KFPC.bHideBossHealthBar && BossList.Length>0 ) + if(!KFPC.bHideBossHealthBar && BossList.Length>0) { - if( KFPC.WorldInfo.RealTimeSeconds>LastUpdateTime && HasBossesAlive() ) + if(KFPC.WorldInfo.RealTimeSeconds>LastUpdateTime && HasBossesAlive()) { LastUpdateTime = KFPC.WorldInfo.RealTimeSeconds + UpdateTickTime; - if( !bVisib ) + if(!bVisib) { LastHP = -1; LastShield = -1; @@ -22,12 +22,12 @@ function TickHud(float DeltaTime) UpdateBossInfo(); } } - else if( bHasInit ) + else if(bHasInit) { NumBosses = 0; bHasInit = false; BossList.Length = 0; - if( bVisib ) + if(bVisib) { bVisib = false; SetVisible(false); @@ -39,14 +39,14 @@ final function bool HasBossesAlive() { local int i; - for( i=(BossList.Length-1); i>=0; --i ) + for(i=(BossList.Length-1); i>=0; --i) { - if( BossList[i]==None || BossList[i].bDeleteMe || BossList[i].GetTeamNum()==0 ) + if(BossList[i]==None || BossList[i].bDeleteMe || BossList[i].GetTeamNum()==0) { BossList.Remove(i,1); --NumBosses; } - else if( !BossList[i].IsAliveAndWell() ) + else if(!BossList[i].IsAliveAndWell()) BossList.Remove(i,1); } return (BossList.Length>0); @@ -54,7 +54,7 @@ final function bool HasBossesAlive() function SetBossPawn(KFInterface_MonsterBoss NewBoss) { - if( !KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell() ) + if(!KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell()) { bHasInit = true; ++NumBosses; @@ -67,27 +67,27 @@ final function UpdateBossInfo() local float V; local KFPawn_Monster B; - if( NextBossDistTime1 ) + if(NumBosses>1) { foreach BossList(B) V += FClamp(float(B.Health) / float(B.HealthMax),0.f,1.f); V /= NumBosses; } - if( LastShield!=V ) + if(LastShield!=V) { LastShield = V; SetFloat("currentShieldPercecntValue",V); @@ -104,14 +104,14 @@ final function CheckBestBoss() foreach BossList(B) { Dist = VSizeSq(Pos-B.Location); - if( Best==None || Dist 0 && VSizeSq( DoorEnemy.Location - Pawn.Location ) < (DoorMeleeDistance * DoorMeleeDistance) ) //200UU + if(DoorEnemy != none && DoorEnemy.Health > 0 && VSizeSq(DoorEnemy.Location - Pawn.Location) < (DoorMeleeDistance * DoorMeleeDistance)) //200UU { - `AILog( self$" DoorEnemy: "$DoorEnemy$" starting melee attack", 'Command_Base' ); - UpdateHistoryString( "[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]" ); - class'AICommand_Attack_Melee'.static.Melee( Outer, DoorEnemy ); + `AILog(self$" DoorEnemy: "$DoorEnemy$" starting melee attack", 'Command_Base'); + UpdateHistoryString("[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]"); + class'AICommand_Attack_Melee'.static.Melee(Outer, DoorEnemy); } // See if we are close to our owner RecheckOwner: OwnerPawn = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None; - if( OwnerPawn!=None ) + if(OwnerPawn!=None) { - if( Enemy!=None && LineOfSightTo(OwnerPawn) && LineOfSightTo(Enemy) ) // We have sight to our owner and can see enemy, go for it! + if(Enemy!=None && LineOfSightTo(OwnerPawn) && LineOfSightTo(Enemy)) // We have sight to our owner and can see enemy, go for it! { OwnerPawn = None; bWaitingOnMovementPlugIn = true; - SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving() ); + SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving()); NextSightCheckTime = WorldInfo.TimeSeconds+2.f; - while( bWaitingOnMovementPlugIn && bUsePluginsForMovement ) + while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) { - if( NextSightCheckTime640000.f || !LineOfSightTo(OwnerPawn) ) // 800.f - Need to move closer to our owner. + else if(VSizeSq(OwnerPawn.Location-Pawn.Location)>640000.f || !LineOfSightTo(OwnerPawn)) // 800.f - Need to move closer to our owner. { bWaitingOnMovementPlugIn = true; SetMovePoint(PickPointNearOwner(),OwnerPawn,,300.f); - while( bWaitingOnMovementPlugIn && bUsePluginsForMovement ) + while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) { Sleep(0.03); } @@ -104,22 +104,22 @@ RecheckOwner: Sleep(0.2+FRand()*0.5); } } - else if( IsValidAttackTarget(KFPawn(Enemy)) ) + else if(IsValidAttackTarget(KFPawn(Enemy))) { - `AILog( "Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base' ); + `AILog("Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base'); bWaitingOnMovementPlugIn = true; - SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving() ); + SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving()); - while( bWaitingOnMovementPlugIn && bUsePluginsForMovement ) + while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) { Sleep(0.03); } `AiLog("Back from waiting for the movement plug in!!!"); - if( Enemy == none ) + if(Enemy == none) { - Sleep( FRand() + 0.1f ); - Goto( 'Begin' ); + Sleep(FRand() + 0.1f); + Goto('Begin'); } } else @@ -130,18 +130,18 @@ RecheckOwner: // Check combat transitions CheckCombatTransition(); - if( bFailedToMoveToEnemy ) + if(bFailedToMoveToEnemy) { - if( bFailedPathfind ) + if(bFailedPathfind) { bFailedPathfind = false; - Sleep( 0.f ); + Sleep(0.f); } else { - Sleep( 0.f ); + Sleep(0.f); } - SetEnemy( GetClosestEnemy( Enemy ) ); + SetEnemy(GetClosestEnemy(Enemy)); } else { diff --git a/ServerExt/Classes/Ext_PerkBase.uc b/ServerExt/Classes/Ext_PerkBase.uc index 160f80f..6eb2feb 100644 --- a/ServerExt/Classes/Ext_PerkBase.uc +++ b/ServerExt/Classes/Ext_PerkBase.uc @@ -112,7 +112,7 @@ var localized string StatHealRecharge; reliable client simulated function string UIName(FDefPerkStat DefPerkStat) { - switch( DefPerkStat.StatType ) + switch(DefPerkStat.StatType) { case name("Speed"): return StatSpeed; case name("Damage"): return StatDamage; @@ -142,22 +142,22 @@ reliable client simulated function string UIName(FDefPerkStat DefPerkStat) replication { // Things the server should send to the client. - if ( true ) + if (true) CurrentLevel,CurrentPrestige,CurrentEXP,NextLevelEXP,CurrentSP,LastLevelEXP,bHasNightVision,MinLevelForPrestige,PrestigeSPIncrease,MaxPrestige,bTacticalReload,EnemyHealthRange; } -simulated final function bool IsWeaponOnPerk( KFWeapon W ) +simulated final function bool IsWeaponOnPerk(KFWeapon W) { - if( class(BasePerk) != None ) + if(class(BasePerk) != None) return true; - //if( W.AllowedForAllPerks() ) + //if(W.AllowedForAllPerks()) // return true; return W!=None && W.GetWeaponPerkClass(BasePerk)==BasePerk; } -simulated static function string GetPerkIconPath( int Level ) +simulated static function string GetPerkIconPath(int Level) { return "img://"$PathName(default.PerkIcon); } @@ -167,7 +167,7 @@ simulated function PostBeginPlay() local int i,j; local class T; - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) { PerkStats.Length = 0; // Prevent client desync with client settings. PlayerOwner = GetALocalPlayerController(); @@ -177,7 +177,7 @@ simulated function PostBeginPlay() { RemoteRole = ROLE_None; // Make sure these actors get replicated in order to client. PlayerOwner = Controller(Owner); - if( PlayerOwner==None ) + if(PlayerOwner==None) { `Log(Self@"spawned without owner."); Destroy(); @@ -187,10 +187,10 @@ simulated function PostBeginPlay() // Load trait classes. j = 0; - for( i=0; i(DynamicLoadObject(TraitClasses[i],Class'Class')); - if( T==None || !T.Static.IsEnabled(Self) ) + if(T==None || !T.Static.IsEnabled(Self)) continue; PerkTraits.Length = j+1; PerkTraits[j].TraitType = T; @@ -198,16 +198,16 @@ simulated function PostBeginPlay() } // Setup serverside stat info (for XML log files). - for( j=0; j=0 ) + if(i>=0) PerkStats[j].UIName = UIName(DefPerkStats[i]); else { // Fallback to parent perk for trying to find name. i = Class'Ext_PerkBase'.Default.DefPerkStats.Find('StatType',PerkStats[j].StatType); - if( i>=0 ) + if(i>=0) PerkStats[j].UIName = UIName(Class'Ext_PerkBase'.Default.DefPerkStats[i]); else PerkStats[j].UIName = string(PerkStats[j].StatType); // Fallback to stat name then... } @@ -216,9 +216,9 @@ simulated function PostBeginPlay() } simulated function InitPerk() { - if( PlayerOwner==None ) + if(PlayerOwner==None) PlayerOwner = GetALocalPlayerController(); - if( PerkManager==None ) + if(PerkManager==None) { foreach DynamicActors(class'ExtPerkManager',PerkManager) { @@ -231,11 +231,11 @@ simulated function Destroyed() { local int i; - if( PerkManager!=None ) + if(PerkManager!=None) PerkManager.UnregisterPerk(Self); - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { - for( i=0; i0 || CurrentPrestige>0); } -reliable client simulated function ClientReceiveStat( int Index, int MaxValue, int CostPerValue, name Type, int CurValue, float Progress ) +reliable client simulated function ClientReceiveStat(int Index, int MaxValue, int CostPerValue, name Type, int CurValue, float Progress) { local int i; - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) { - if( PerkStats.Length<=Index ) + if(PerkStats.Length<=Index) PerkStats.Length = Index+1; PerkStats[Index].MaxValue = MaxValue; PerkStats[Index].CostPerValue = CostPerValue; @@ -280,79 +280,79 @@ reliable client simulated function ClientReceiveStat( int Index, int MaxValue, i PerkStats[Index].Progress = Progress; } i = DefPerkStats.Find('StatType',Type); - if( i>=0 ) + if(i>=0) PerkStats[Index].UIName = UIName(DefPerkStats[i]); else { // Fallback to parent perk for trying to find name. i = Class'Ext_PerkBase'.Default.DefPerkStats.Find('StatType',Type); - if( i>=0 ) + if(i>=0) PerkStats[Index].UIName = UIName(Class'Ext_PerkBase'.Default.DefPerkStats[i]); else PerkStats[Index].UIName = string(Type); // Fallback to stat name then... } } -reliable client simulated function ClientSetStatValue( int Index, int NewValue ) +reliable client simulated function ClientSetStatValue(int Index, int NewValue) { - if( PerkStats.Length<=Index ) + if(PerkStats.Length<=Index) PerkStats.Length = Index+1; PerkStats[Index].CurrentValue = NewValue; - if( bPerkNetReady ) + if(bPerkNetReady) ApplyEffects(); } -reliable client simulated function ClientReceiveTrait( int Index, class TC, byte Lvl ) +reliable client simulated function ClientReceiveTrait(int Index, class TC, byte Lvl) { - if( PerkTraits.Length<=Index ) + if(PerkTraits.Length<=Index) PerkTraits.Length = Index+1; PerkTraits[Index].TraitType = TC; PerkTraits[Index].CurrentLevel = Lvl; } -reliable client simulated function ClientReceiveTraitData( int Index, string Data ) +reliable client simulated function ClientReceiveTraitData(int Index, string Data) { - if( WorldInfo.NetMode==NM_Client ) + if(WorldInfo.NetMode==NM_Client) PerkTraits[Index].TraitType.Static.ClientSetRepData(Data); } -reliable client simulated function ClientReceiveTraitLvl( int Index, byte NewLevel ) +reliable client simulated function ClientReceiveTraitLvl(int Index, byte NewLevel) { PerkTraits[Index].CurrentLevel = NewLevel; } -final function SetPerkStat( name Type, int Value ) +final function SetPerkStat(name Type, int Value) { local int i; i = PerkStats.Find('StatType',Type); - if( i>=0 ) + if(i>=0) PerkStats[i].CurrentValue = Value; } -final function int GetPerkStat( name Type ) +final function int GetPerkStat(name Type) { local int i; i = PerkStats.Find('StatType',Type); - if( i==-1 ) + if(i==-1) return 0; return PerkStats[i].CurrentValue; } -function bool EarnedEXP( int EXP ) +function bool EarnedEXP(int EXP) { local int n; bForceNetUpdate = true; CurrentEXP+=EXP; - while( CurrentEXP>=NextLevelEXP && CurrentLevel=NextLevelEXP && CurrentLevel0 ) + if(n>0) { CurrentSP+=(n*(StarPointsPerLevel+CurrentPrestige*PrestigeSPIncrease)); - if( PerkManager.PRIOwner!=None && PerkManager.CurrentPerk==Self ) + if(PerkManager.PRIOwner!=None && PerkManager.CurrentPerk==Self) UpdatePRILevel(); // TODO - broadcast level up messages. - if( ExtPlayerController(PlayerOwner)!=None ) + if(ExtPlayerController(PlayerOwner)!=None) ExtPlayerController(PlayerOwner).ReceiveLevelUp(Self,CurrentLevel); } return true; @@ -364,7 +364,7 @@ final function UpdatePRILevel() } // XML output -function OutputXML( ExtStatWriter Data ) +function OutputXML(ExtStatWriter Data) { local int i; @@ -377,9 +377,9 @@ function OutputXML( ExtStatWriter Data ) Data.WriteValue("exptilnext",string(NextLevelEXP)); Data.WriteValue("exponprev",string(LastLevelEXP)); - for( i=0; i0 ) + if(PerkStats[i].CurrentValue>0) { Data.StartIntendent("stat","type",string(PerkStats[i].StatType)); Data.WriteValue("name",GetStatUIStr(i)); @@ -389,9 +389,9 @@ function OutputXML( ExtStatWriter Data ) } } - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) { Data.StartIntendent("trait","class",string(PerkTraits[i].TraitType.Name)); Data.WriteValue("name",PerkTraits[i].TraitType.Default.TraitName); @@ -404,7 +404,7 @@ function OutputXML( ExtStatWriter Data ) } // Data saving. -function SaveData( ExtSaveDataBase Data ) +function SaveData(ExtSaveDataBase Data) { local int i,j; @@ -416,15 +416,15 @@ function SaveData( ExtSaveDataBase Data ) // Count number of given stats j = 0; - for( i=0; i0 ) + for(i=0; i0) ++j; // Then perk stats. Data.SaveInt(j); - for( i=0; i0 ) + if(PerkStats[i].CurrentValue>0) { Data.SaveStr(string(PerkStats[i].StatType)); Data.SaveInt(PerkStats[i].CurrentValue,1); @@ -433,15 +433,15 @@ function SaveData( ExtSaveDataBase Data ) // Count bought traits. j = 0; - for( i=0; i0 ) + for(i=0; i0) ++j; // Then traits. Data.SaveInt(j); - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) { Data.SaveStr(string(PerkTraits[i].TraitType)); Data.SaveInt(PerkTraits[i].CurrentLevel); @@ -450,7 +450,7 @@ function SaveData( ExtSaveDataBase Data ) } // Data loading. -function LoadData( ExtSaveDataBase Data ) +function LoadData(ExtSaveDataBase Data) { local int i,j,l,n; local string S; @@ -463,16 +463,16 @@ function LoadData( ExtSaveDataBase Data ) // CurrentEXP = i // } - if( Data.GetArVer()>=1 ) + if(Data.GetArVer()>=1) CurrentPrestige = Data.ReadInt(3); l = Data.ReadInt(); // Perk stats length. - for( i=0; i=GetNeededExp(a) ) + if(a=GetNeededExp(a)) ++a; break; } i = a+((b-a)>>1); - if( InExpMinimumLevel ? GetNeededExp(CurrentLevel-1) : 0); // Now verify the points player used on individual stats. - for( i=0; i0 ) + if(PerkStats[i].CurrentValue>0) { PerkStats[i].CurrentValue = Min(PerkStats[i].CurrentValue,PerkStats[i].MaxValue); a = PerkStats[i].CurrentValue*PerkStats[i].CostPerValue; - if( CurrentSP>a ) + if(CurrentSP>a) CurrentSP-=a; - else if( CurrentSP<=0 ) // No points at all for this. + else if(CurrentSP<=0) // No points at all for this. PerkStats[i].CurrentValue = 0; else // Nope, reduce the stat! { @@ -557,78 +557,78 @@ function SetInitialLevel() // Then verify trait levels and costs. MT = 0; - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) { PerkTraits[i].CurrentLevel = Min(PerkTraits[i].CurrentLevel,PerkTraits[i].TraitType.Default.NumLevels); - if( PerkTraits[i].TraitType.Default.LoadPriority>0 ) + if(PerkTraits[i].TraitType.Default.LoadPriority>0) MT = Max(MT,PerkTraits[i].TraitType.Default.LoadPriority); else { - if( !PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self) ) + if(!PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self)) a = 0; else { - for( a=0; aCurrentSP ) + if(b>CurrentSP) break; CurrentSP-=b; } } PerkTraits[i].CurrentLevel = a; - if( PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None ) + if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None) PerkTraits[i].Data = PerkTraits[i].TraitType.Static.InitializeFor(Self,ExtPlayerController(Owner)); } } - if( PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None ) + if(PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None) PerkTraits[i].TraitType.Static.CleanupTrait(ExtPlayerController(Owner),Self,PerkTraits[i].Data); } // Delayed loads. - for( j=1; j<=MT; ++j ) + for(j=1; j<=MT; ++j) { - for( i=0; i0 && PerkTraits[i].TraitType.Default.LoadPriority==j ) + if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.LoadPriority==j) { - if( !PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self) ) + if(!PerkTraits[i].TraitType.Static.MeetsRequirements(PerkTraits[i].CurrentLevel-1,Self)) a = 0; else { - for( a=0; aCurrentSP ) + if(b>CurrentSP) break; CurrentSP-=b; } } PerkTraits[i].CurrentLevel = a; - if( PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None ) + if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].Data==None) PerkTraits[i].Data = PerkTraits[i].TraitType.Static.InitializeFor(Self,ExtPlayerController(Owner)); } - if( PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None ) + if(PerkTraits[i].CurrentLevel==0 && PerkTraits[i].Data!=None) PerkTraits[i].TraitType.Static.CleanupTrait(ExtPlayerController(Owner),Self,PerkTraits[i].Data); } } ApplyEffects(); - if( PerkManager.CurrentPerk==Self ) + if(PerkManager.CurrentPerk==Self) ActivateTraits(); } // Check the needed amount of EXP for a perk. -function int GetNeededExp( int LevelNum ) +function int GetNeededExp(int LevelNum) { - if( LevelNum=MaximumLevel ) + if(LevelNum=MaximumLevel) return 0; LevelNum-=MinimumLevel; LevelNum = (FirstLevelExp+(LevelNum*LevelUpExpCost)+(LevelNum*LevelNum*LevelUpIncCost)); - if( CurrentPrestige>0 && PrestigeXPReduce>0 ) + if(CurrentPrestige>0 && PrestigeXPReduce>0) LevelNum *= (1.f / (1.f + PrestigeXPReduce*CurrentPrestige)); return LevelNum; } @@ -639,24 +639,24 @@ static function CheckConfig() local int i; local class T; - if( Default.ConfigVersion!=Default.CurrentConfigVer ) + if(Default.ConfigVersion!=Default.CurrentConfigVer) { UpdateConfigs(Default.ConfigVersion); Default.ConfigVersion = Default.CurrentConfigVer; StaticSaveConfig(); } - for( i=0; i(DynamicLoadObject(Default.TraitClasses[i],Class'Class')); - if( T!=None ) + if(T!=None) T.Static.CheckConfig(); } } -static function UpdateConfigs( int OldVer ) +static function UpdateConfigs(int OldVer) { local int i,j; - if( OldVer==0 ) + if(OldVer==0) { Default.FirstLevelExp = 400; Default.LevelUpExpCost = 500; @@ -675,34 +675,34 @@ static function UpdateConfigs( int OldVer ) Default.PerkStats.Length = 0; AddStatsCfg(0); Default.TraitClasses.Length = Default.DefTraitList.Length; - for( i=0; i=0 ) + if(j>=0) Default.PerkStats[i].Progress = Default.DefPerkStats[j].Progress; } // Add off-perk damage stat. AddStatsCfg(12); } - else if( OldVer<=3 ) + else if(OldVer<=3) AddStatsCfg(13); // Add self damage. - else if( OldVer<=4 ) + else if(OldVer<=4) AddStatsCfg(15); // Add poison damage. - else if( OldVer<=7 ) + else if(OldVer<=7) AddStatsCfg(16); // Add sonic/fire damage. - else if( OldVer<=12 ) + else if(OldVer<=12) AddStatsCfg(18); // Add all damage. - else if( OldVer<=13 ) + else if(OldVer<=13) AddStatsCfg(19); // Add HeadDamage and HealRecharge - if( OldVer<=5 ) + if(OldVer<=5) { // Add prestige Default.MinLevelForPrestige = 140; @@ -712,18 +712,18 @@ static function UpdateConfigs( int OldVer ) } Default.TraitClasses.Length = Default.DefTraitList.Length; - for( i=0; i=0 ) // Don't add if already found for some reason. + if(Default.DefPerkStats[i].bHiddenConfig || Default.PerkStats.Find('StatType',Default.DefPerkStats[i].StatType)>=0) // Don't add if already found for some reason. continue; Default.PerkStats.Length = j+1; Default.PerkStats[j].MaxValue = Default.DefPerkStats[i].MaxValue; @@ -735,24 +735,24 @@ static final function AddStatsCfg( int StartRange ) } // WebAdmin UI stuff. -static function InitWebAdmin( ExtWebAdmin_UI UI ) +static function InitWebAdmin(ExtWebAdmin_UI UI) { local class T; local int i; UI.AddSettingsPage("Perk "$Default.PerkName,Default.Class,Default.WebConfigs,GetValue,ApplyValue); - for( i=0; i(DynamicLoadObject(Default.TraitClasses[i],Class'Class')); - if( T==None || UI.HasConfigFor(T) ) + if(T==None || UI.HasConfigFor(T)) continue; T.Static.InitWebAdmin(UI); } } -static function string GetValue( name PropName, int ElementIndex ) +static function string GetValue(name PropName, int ElementIndex) { - switch( PropName ) + switch(PropName) { case 'FirstLevelExp': return string(Default.FirstLevelExp); @@ -782,9 +782,9 @@ static function string GetValue( name PropName, int ElementIndex ) return string(Default.PrestigeXPReduce); } } -static function ApplyValue( name PropName, int ElementIndex, string Value ) +static function ApplyValue(name PropName, int ElementIndex, string Value) { - switch( PropName ) + switch(PropName) { case 'FirstLevelExp': Default.FirstLevelExp = int(Value); break; @@ -801,21 +801,21 @@ static function ApplyValue( name PropName, int ElementIndex, string Value ) case 'StarPointsPerLevel': Default.StarPointsPerLevel = int(Value); break; case 'TraitClasses': - if( Value=="#DELETE" ) + if(Value=="#DELETE") Default.TraitClasses.Remove(ElementIndex,1); else { - if( ElementIndex>=Default.TraitClasses.Length ) + if(ElementIndex>=Default.TraitClasses.Length) Default.TraitClasses.Length = ElementIndex+1; Default.TraitClasses[ElementIndex] = Value; } break; case 'PerkStats': - if( Value=="#DELETE" ) + if(Value=="#DELETE") Default.PerkStats.Remove(ElementIndex,1); else { - if( ElementIndex>=Default.PerkStats.Length ) + if(ElementIndex>=Default.PerkStats.Length) Default.PerkStats.Length = ElementIndex+1; Default.PerkStats[ElementIndex] = ParsePerkStatStr(Value); } @@ -833,23 +833,23 @@ static function ApplyValue( name PropName, int ElementIndex, string Value ) } StaticSaveConfig(); } -static final function FPerkStat ParsePerkStatStr( string S ) +static final function FPerkStat ParsePerkStatStr(string S) { local FPerkStat Res; local int i; i = InStr(S,","); - if( i==-1 ) + if(i==-1) return Res; Res.StatType = name(Left(S,i)); S = Mid(S,i+1); i = InStr(S,","); - if( i==-1 ) + if(i==-1) return Res; Res.MaxValue = int(Left(S,i)); S = Mid(S,i+1); i = InStr(S,","); - if( i==-1 ) + if(i==-1) return Res; Res.CostPerValue = int(Left(S,i)); Res.Progress = float(Mid(S,i+1)); @@ -857,10 +857,10 @@ static final function FPerkStat ParsePerkStatStr( string S ) } // Amount and iStat values are verified already by ServerExtMut. -function bool IncrementStat( int iStat, int Amount ) +function bool IncrementStat(int iStat, int Amount) { PerkStats[iStat].CurrentValue+=Amount; - if( bOwnerNetClient ) + if(bOwnerNetClient) ClientSetStatValue(iStat,PerkStats[iStat].CurrentValue); PerkManager.bStatsDirty = true; ApplyEffects(); @@ -872,9 +872,9 @@ simulated function ApplyEffects() { local int i; - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) { - if( PerkTraits[i].TraitType.Default.bPostApplyEffect ) + if(PerkTraits[i].TraitType.Default.bPostApplyEffect) bSec = true; else PerkTraits[i].TraitType.Static.ApplyEffectOn(P,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } - if( bSec ) + if(bSec) { - for( i=0; i0 && PerkTraits[i].TraitType.Default.bPostApplyEffect ) + if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.bPostApplyEffect) PerkTraits[i].TraitType.Static.ApplyEffectOn(P,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } @@ -915,27 +915,27 @@ function ActivateTraits() local bool bSec; KFP = KFPawn_Human(PlayerOwner.Pawn); - if( KFP!=None && !KFP.IsAliveAndWell() ) + if(KFP!=None && !KFP.IsAliveAndWell()) KFP = None; - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) { PerkTraits[i].TraitType.Static.TraitActivate(Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); - if( KFP!=None ) + if(KFP!=None) { - if( PerkTraits[i].TraitType.Default.bPostApplyEffect ) + if(PerkTraits[i].TraitType.Default.bPostApplyEffect) bSec = true; else PerkTraits[i].TraitType.Static.ApplyEffectOn(KFP,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } } - if( bSec ) + if(bSec) { - for( i=0; i0 && PerkTraits[i].TraitType.Default.bPostApplyEffect ) + if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.bPostApplyEffect) PerkTraits[i].TraitType.Static.ApplyEffectOn(KFP,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } @@ -946,22 +946,22 @@ function DeactivateTraits() { local int i; - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) PerkTraits[i].TraitType.Static.TraitDeActivate(Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } simulated unreliable client function ClientAuth() { - if( Owner==None ) + if(Owner==None) SetOwner(PlayerOwner); ServerAck(); } unreliable server function ServerAck() { - if( !bClientAuthorized ) + if(!bClientAuthorized) { bClientAuthorized = true; RepState = 0; @@ -971,10 +971,10 @@ unreliable server function ServerAck() } function ReplicateTimer() { - switch( RepState ) + switch(RepState) { case 0: // Send all perk stats - if( RepIndex>=PerkStats.Length ) + if(RepIndex>=PerkStats.Length) { ++RepState; RepIndex = 0; @@ -986,7 +986,7 @@ function ReplicateTimer() } break; case 1: // Send all traits - if( RepIndex>=PerkTraits.Length ) + if(RepIndex>=PerkTraits.Length) ++RepState; else { @@ -1006,7 +1006,7 @@ simulated reliable client function ClientIsReady() bPerkNetReady = true; ApplyEffects(); } -simulated function string GetStatUIStr( int iStat ) +simulated function string GetStatUIStr(int iStat) { local string S; local bool bLoop; @@ -1015,9 +1015,9 @@ simulated function string GetStatUIStr( int iStat ) bLoop = true; // Chop off float digits that aren't needed. - while( bLoop ) + while(bLoop) { - switch( Right(S,1) ) + switch(Right(S,1)) { case "0": S = Left(S,Len(S)-1); @@ -1033,68 +1033,68 @@ simulated function string GetStatUIStr( int iStat ) return Repl(PerkStats[iStat].UIName,"&",S); } -final function UnloadStats( optional byte Mode ) +final function UnloadStats(optional byte Mode) { local int i,j; local KFPawn_Human KFP; PerkManager.bStatsDirty = true; - if( Mode<=1 ) + if(Mode<=1) { // Reset stats. - for( i=0; i0 ) + if(PerkStats[i].CurrentValue>0) { CurrentSP+=(PerkStats[i].CurrentValue*PerkStats[i].CostPerValue); PerkStats[i].CurrentValue = 0; - if( bOwnerNetClient ) + if(bOwnerNetClient) ClientSetStatValue(i,0); } } ApplyEffects(); } - if( Mode==0 || Mode==2 ) + if(Mode==0 || Mode==2) { KFP = KFPawn_Human(PlayerOwner.Pawn); - if( KFP!=None && !KFP.IsAliveAndWell() ) + if(KFP!=None && !KFP.IsAliveAndWell()) KFP = None; // Reset traits. - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) { - for( j=0; j DamType ) +function bool PreventDeath(KFPawn_Human Player, Controller Killer, Class DamType) { local int i; // Doing 2 passes of this so that things don't go out of order (spawn retaliation effect when you get redeemed etc) - for( i=0; i0 && PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data) ) + if(PerkTraits[i].CurrentLevel>0 && PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data)) return true; } - for( i=0; i0 && !PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data) ) + if(PerkTraits[i].CurrentLevel>0 && !PerkTraits[i].TraitType.Default.bHighPriorityDeath && PerkTraits[i].TraitType.Static.PreventDeath(Player,Killer,DamType,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data)) return true; } return false; @@ -1125,23 +1125,23 @@ simulated function PlayerDied() { local int i; - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) PerkTraits[i].TraitType.Static.PlayerDied(Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } } // Stat modifier functions. -simulated function float ApplyEffect( name Type, float Value, float Progress ) +simulated function float ApplyEffect(name Type, float Value, float Progress) { local bool bActivePerk; bActivePerk = (PerkManager!=None && PerkManager.CurrentPerk==Self); - switch( Type ) + switch(Type) { case 'Speed': Modifiers[0] = 1.f + (Value*Progress); @@ -1163,7 +1163,7 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) break; case 'Health': Modifiers[6] = 1.f + (Value*Progress); - if( bActivePerk && PlayerOwner.Pawn!=None ) + if(bActivePerk && PlayerOwner.Pawn!=None) { PlayerOwner.Pawn.HealthMax = PlayerOwner.Pawn.Default.Health; ModifyHealth(PlayerOwner.Pawn.HealthMax); @@ -1180,12 +1180,12 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) break; case 'Mag': Modifiers[10] = 1.f + (Value*Progress); - if( bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None ) + if(bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None) UpdateAmmoStatus(PlayerOwner.Pawn.InvManager); break; case 'Spare': Modifiers[11] = 1.f + (Value*Progress); - if( bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None ) + if(bActivePerk && WorldInfo.NetMode!=NM_Client && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.InvManager!=None) UpdateAmmoStatus(PlayerOwner.Pawn.InvManager); break; case 'OffDamage': @@ -1196,7 +1196,7 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) break; case 'Armor': Modifiers[14] = (Value*Progress*100.f); - if( bActivePerk && KFPawn_Human(PlayerOwner.Pawn)!=None ) + if(bActivePerk && KFPawn_Human(PlayerOwner.Pawn)!=None) { KFPawn_Human(PlayerOwner.Pawn).MaxArmor = KFPawn_Human(PlayerOwner.Pawn).Default.MaxArmor; ModifyArmor(KFPawn_Human(PlayerOwner.Pawn).MaxArmor); @@ -1224,57 +1224,57 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) return (Value*Progress); } -simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) +simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if( BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))) ) + if(BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) { if(HitZoneIdx == 0) InDamage *= (Modifiers[1] + Modifiers[19]); else InDamage *= Modifiers[1]; } - else if( DamageType==None || DamageType.Name!='KFDT_SuicideExplosive' ) + else if(DamageType==None || DamageType.Name!='KFDT_SuicideExplosive') InDamage *= Modifiers[12]; } -simulated function ModifyDamageTaken( out int InDamage, optional class DamageType, optional Controller InstigatedBy ) +simulated function ModifyDamageTaken(out int InDamage, optional class DamageType, optional Controller InstigatedBy) { - if( InDamage>0 ) + if(InDamage>0) { - if( (InstigatedBy==None || InstigatedBy==PlayerOwner) && class(DamageType)!=None ) + if((InstigatedBy==None || InstigatedBy==PlayerOwner) && class(DamageType)!=None) InDamage *= Modifiers[13]; - else if( Modifiers[15]<1 && class(DamageType)!=None ) + else if(Modifiers[15]<1 && class(DamageType)!=None) InDamage = Max(InDamage*Modifiers[15],1); // Do at least 1 damage. - else if( Modifiers[16]<1 && class(DamageType)!=None ) + else if(Modifiers[16]<1 && class(DamageType)!=None) InDamage = Max(InDamage*Modifiers[16],1); - else if( Modifiers[17]<1 && class(DamageType)!=None ) + else if(Modifiers[17]<1 && class(DamageType)!=None) InDamage = Max(InDamage*Modifiers[17],1); - if( Modifiers[18]<1 && InstigatedBy!=None && InstigatedBy!=PlayerOwner ) + if(Modifiers[18]<1 && InstigatedBy!=None && InstigatedBy!=PlayerOwner) InDamage = Max(InDamage*Modifiers[18],1); } } -simulated function ModifyRecoil( out float CurrentRecoilModifier, KFWeapon KFW ) +simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW) { - if( IsWeaponOnPerk(KFW) ) + if(IsWeaponOnPerk(KFW)) CurrentRecoilModifier *= Modifiers[2]; } -simulated function ModifySpread( out float InSpread ) +simulated function ModifySpread(out float InSpread) { InSpread *= Modifiers[3]; } -simulated function ModifyRateOfFire( out float InRate, KFWeapon KFW ) +simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) { - if( IsWeaponOnPerk(KFW) ) + if(IsWeaponOnPerk(KFW)) InRate *= Modifiers[4]; } simulated function float GetReloadRateScale(KFWeapon KFW) { return (IsWeaponOnPerk(KFW) ? Modifiers[5] : 1.f); } -function ModifyHealth( out int InHealth ) +function ModifyHealth(out int InHealth) { InHealth *= Modifiers[6]; } -function ModifyArmor( out byte MaxArmor ) +function ModifyArmor(out byte MaxArmor) { MaxArmor = Min(MaxArmor+Modifiers[14],255); } @@ -1282,83 +1282,83 @@ function float GetKnockdownPowerModifier() { return Modifiers[7]; } -function float GetStunPowerModifier( optional class DamageType, optional byte HitZoneIdx ) +function float GetStunPowerModifier(optional class DamageType, optional byte HitZoneIdx) { return Modifiers[7]; } -simulated function ModifyMeleeAttackSpeed( out float InDuration ); +simulated function ModifyMeleeAttackSpeed(out float InDuration); -function AddDefaultInventory( KFPawn P ) +function AddDefaultInventory(KFPawn P) { local int i; - if( PrimaryWeapon!=None ) + if(PrimaryWeapon!=None) P.DefaultInventory.AddItem(PrimaryWeapon); P.DefaultInventory.AddItem(PrimaryMelee); - if( KFInventoryManager(P.InvManager)!=None ) + if(KFInventoryManager(P.InvManager)!=None) KFInventoryManager(P.InvManager).MaxCarryBlocks = KFInventoryManager(P.InvManager).Default.MaxCarryBlocks+Modifiers[10]; - for( i=0; i0 ) + if(PerkTraits[i].CurrentLevel>0) PerkTraits[i].TraitType.Static.AddDefaultInventory(P,Self,PerkTraits[i].CurrentLevel,PerkTraits[i].Data); } } -simulated function ModifyWeldingRate( out float FastenRate, out float UnfastenRate ) +simulated function ModifyWeldingRate(out float FastenRate, out float UnfastenRate) { FastenRate *= Modifiers[8]; UnfastenRate *= Modifiers[8]; } -function bool RepairArmor( Pawn HealTarget ) +function bool RepairArmor(Pawn HealTarget) { return false; } -function bool ModifyHealAmount( out float HealAmount ) +function bool ModifyHealAmount(out float HealAmount) { HealAmount*=Modifiers[9]; return false; } -simulated function ModifyMagSizeAndNumber( KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname ) +simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname) { - if( MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW)) ) // Skip boomstick for this. + if(MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW))) // Skip boomstick for this. MagazineCapacity = Min(MagazineCapacity*Modifiers[10],255); } -simulated function ModifySpareAmmoAmount( KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary ) +simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary) { - if( KFW==None ? TraderItem.AssociatedPerkClasses.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW) ) + if(KFW==None ? TraderItem.AssociatedPerkClasses.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW)) PrimarySpareAmmo*=Modifiers[11]; } -simulated function bool ShouldMagSizeModifySpareAmmo( KFWeapon KFW, optional Class WeaponPerkClass ) +simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class WeaponPerkClass) { return (KFW==None ? WeaponPerkClass==BasePerk : IsWeaponOnPerk(KFW)); } -final function UpdateAmmoStatus( InventoryManager Inv ) +final function UpdateAmmoStatus(InventoryManager Inv) { local KFWeapon W; foreach Inv.InventoryActors(class'KFWeapon',W) { - if( IsWeaponOnPerk(W) ) + if(IsWeaponOnPerk(W)) W.ReInitializeAmmoCounts(PerkManager); } } -simulated function ModifyHealerRechargeTime( out float RechargeRate ) +simulated function ModifyHealerRechargeTime(out float RechargeRate) { RechargeRate *= Modifiers[20]; } simulated function DrawSpecialPerkHUD(Canvas C) { - if( EnemyHealthRange>0 && PlayerOwner!=None && KFPawn_Human(PlayerOwner.Pawn)!=None ) + if(EnemyHealthRange>0 && PlayerOwner!=None && KFPawn_Human(PlayerOwner.Pawn)!=None) DrawEnemyHealth(C); } -simulated final function DrawEnemyHealth( Canvas C ) +simulated final function DrawEnemyHealth(Canvas C) { local KFPawn_Monster KFPM; local vector X,CameraLocation; @@ -1368,12 +1368,12 @@ simulated final function DrawEnemyHealth( Canvas C ) foreach WorldInfo.AllPawns(class'KFPawn_Monster',KFPM,CameraLocation,EnemyDistDraw[EnemyHealthRange-1]) { - if( KFPM.IsAliveAndWell() && `TimeSince(KFPM.Mesh.LastRenderTime)<0.1f && KFPM.CanShowHealth() && KFPM.GetTeamNum()!=0 && (X Dot (KFPM.Location - CameraLocation))>0 ) + if(KFPM.IsAliveAndWell() && `TimeSince(KFPM.Mesh.LastRenderTime)<0.1f && KFPM.CanShowHealth() && KFPM.GetTeamNum()!=0 && (X Dot (KFPM.Location - CameraLocation))>0) DrawZedHealthbar(C,KFPM,CameraLocation); } } -simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector CameraLocation ) +simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector CameraLocation) { local vector ScreenPos, TargetLocation; local float HealthBarLength, HealthbarHeight, HealthScale; @@ -1382,7 +1382,7 @@ simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector HealthbarHeight = FMin(6.f * (float(C.SizeX) / 1024.f), 6.f) * class'KFGFxHudWrapper'.Default.FriendlyHudScale; HealthScale = FClamp(float(KFPM.Health) / float(KFPM.HealthMax),0.f,1.f); - if( KFPM.bCrawler && KFPM.Floor.Z <= -0.7f && KFPM.Physics == PHYS_Spider ) + if(KFPM.bCrawler && KFPM.Floor.Z <= -0.7f && KFPM.Physics == PHYS_Spider) { TargetLocation = KFPM.Location + vect(0,0,-1) * KFPM.GetCollisionHeight() * 1.2; } @@ -1392,7 +1392,7 @@ simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector } ScreenPos = C.Project(TargetLocation); - if( ScreenPos.X < 0 || ScreenPos.X > C.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > C.SizeY || !FastTrace(TargetLocation, CameraLocation) ) + if(ScreenPos.X < 0 || ScreenPos.X > C.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > C.SizeY || !FastTrace(TargetLocation, CameraLocation)) return; C.EnableStencilTest(true); @@ -1406,33 +1406,33 @@ simulated final function DrawZedHealthbar(Canvas C, KFPawn_Monster KFPM, vector C.EnableStencilTest(false); } -function PlayerKilled( KFPawn_Monster Victim, class DamageType ); +function PlayerKilled(KFPawn_Monster Victim, class DamageType); -function ModifyBloatBileDoT( out float DoTScaler ) +function ModifyBloatBileDoT(out float DoTScaler) { DoTScaler = Modifiers[15]; } -simulated function bool GetIsUberAmmoActive( KFWeapon KFW ) +simulated function bool GetIsUberAmmoActive(KFWeapon KFW) { return false; } -function UpdatePerkHeadShots( ImpactInfo Impact, class DamageType, int NumHit ); +function UpdatePerkHeadShots(ImpactInfo Impact, class DamageType, int NumHit); -function CheckForAirborneAgent( KFPawn HealTarget, class DamType, int HealAmount ); +function CheckForAirborneAgent(KFPawn HealTarget, class DamType, int HealAmount); -simulated function float GetZedTimeModifier( KFWeapon W ) +simulated function float GetZedTimeModifier(KFWeapon W) { return 0.f; } -simulated function bool GetUsingTactialReload( KFWeapon KFW ) +simulated function bool GetUsingTactialReload(KFWeapon KFW) { return (bTacticalReload && IsWeaponOnPerk(KFW)); } -simulated function float GetIronSightSpeedModifier( KFWeapon KFW ) +simulated function float GetIronSightSpeedModifier(KFWeapon KFW) { return 1.f; } @@ -1440,7 +1440,7 @@ simulated function float GetIronSightSpeedModifier( KFWeapon KFW ) function OnWaveEnded(); function NotifyZedTimeStarted(); -simulated function float GetZedTimeExtensions( byte Level ) +simulated function float GetZedTimeExtensions(byte Level) { return 1.f; } diff --git a/ServerExt/Classes/Ext_PerkBerserker.uc b/ServerExt/Classes/Ext_PerkBerserker.uc index 18a4edd..81374c2 100644 --- a/ServerExt/Classes/Ext_PerkBerserker.uc +++ b/ServerExt/Classes/Ext_PerkBerserker.uc @@ -5,30 +5,30 @@ var float VampRegenRate,ZedTimeMeleeAtkRate; replication { // Things the server should send to the client. - if ( true ) + if (true) ZedTimeMeleeAtkRate; } -simulated function ModifyMeleeAttackSpeed( out float InDuration ) +simulated function ModifyMeleeAttackSpeed(out float InDuration) { InDuration *= Modifiers[4]; - if( ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f ) + if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) InDuration *= ZedTimeMeleeAtkRate; } -simulated function ModifyRateOfFire( out float InRate, KFWeapon KFW ) +simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) { - if( IsWeaponOnPerk(KFW) ) + if(IsWeaponOnPerk(KFW)) { InRate *= Modifiers[4]; - if( ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f ) + if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) InRate *= ZedTimeMeleeAtkRate; } } -function PlayerKilled( KFPawn_Monster Victim, class DT ) +function PlayerKilled(KFPawn_Monster Victim, class DT) { - if( VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class(DT)!=None && class(DT).Default.ModifierPerkList.Find(BasePerk)>=0 ) - PlayerOwner.Pawn.HealDamage( Max(PlayerOwner.Pawn.HealthMax*VampRegenRate,1), PlayerOwner, class'KFDT_Healing', false, false ); + if(VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class(DT)!=None && class(DT).Default.ModifierPerkList.Find(BasePerk)>=0) + PlayerOwner.Pawn.HealDamage(Max(PlayerOwner.Pawn.HealthMax*VampRegenRate,1), PlayerOwner, class'KFDT_Healing', false, false); } defaultproperties diff --git a/ServerExt/Classes/Ext_PerkCommando.uc b/ServerExt/Classes/Ext_PerkCommando.uc index fd10120..17ebf49 100644 --- a/ServerExt/Classes/Ext_PerkCommando.uc +++ b/ServerExt/Classes/Ext_PerkCommando.uc @@ -6,46 +6,46 @@ var float ZTExtCount; replication { // Things the server should send to the client. - if ( true ) + if (true) bUseProfessional,bUseMachineGunner; } -simulated function bool GetUsingTactialReload( KFWeapon KFW ) +simulated function bool GetUsingTactialReload(KFWeapon KFW) { return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.65 : false); } -simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) +simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if( (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))) ) + if((DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) { - if( bUseMachineGunner && WorldInfo.TimeDilation < 1.f ) + if(bUseMachineGunner && WorldInfo.TimeDilation < 1.f) InDamage += InDamage * 0.03; } Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx); } -simulated function float GetZedTimeModifier( KFWeapon W ) +simulated function float GetZedTimeModifier(KFWeapon W) { local name StateName; StateName = W.GetStateName(); - if( bUseProfessional && IsWeaponOnPerk( W ) ) + if(bUseProfessional && IsWeaponOnPerk(W)) { - if( StateName == 'Reloading' || StateName == 'AltReloading' ) + if(StateName == 'Reloading' || StateName == 'AltReloading') return 1.f; - else if( StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping' ) + else if(StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping') return 0.3f; } - if( bUseMachineGunner && IsWeaponOnPerk( W ) && BasePerk.Default.ZedTimeModifyingStates.Find( StateName ) != INDEX_NONE ) + if(bUseMachineGunner && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE) return 0.5f; return 0.f; } -simulated function float GetZedTimeExtensions( byte Level ) +simulated function float GetZedTimeExtensions(byte Level) { return ZTExtCount; } diff --git a/ServerExt/Classes/Ext_PerkDemolition.uc b/ServerExt/Classes/Ext_PerkDemolition.uc index 6a338a6..0246162 100644 --- a/ServerExt/Classes/Ext_PerkDemolition.uc +++ b/ServerExt/Classes/Ext_PerkDemolition.uc @@ -7,7 +7,7 @@ var float AOEMult, NukeDamageMult; replication { // Things the server should send to the client. - if ( true ) + if (true) NukeDamageMult,bDirectHit,bCriticalHit,bProfessionalActive,AOEMult; } @@ -16,12 +16,12 @@ simulated function float GetAoERadiusModifier() return AOEMult; } -simulated function bool GetUsingTactialReload( KFWeapon KFW ) +simulated function bool GetUsingTactialReload(KFWeapon KFW) { return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.85 : false); } -simulated function float ApplyEffect( name Type, float Value, float Progress ) +simulated function float ApplyEffect(name Type, float Value, float Progress) { local KFPlayerReplicationInfo MyPRI; local float DefValue; @@ -29,7 +29,7 @@ simulated function float ApplyEffect( name Type, float Value, float Progress ) DefValue = Super.ApplyEffect(Type, Value, Progress); MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo); - if( MyPRI != None && Type == 'KnockDown' ) + if(MyPRI != None && Type == 'KnockDown') MyPRI.bConcussiveActive = Modifiers[7] > 1.5; return DefValue; @@ -40,37 +40,37 @@ function OnWaveEnded() bUsedSacrifice = false; } -simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) +simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { - if( BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser))) ) + if(BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || (KFWeapon(DamageCauser)!=None && IsWeaponOnPerk(KFWeapon(DamageCauser)))) { - if( bDirectHit && class(DamageType) != none ) + if(bDirectHit && class(DamageType) != none) InDamage *= 1.25; - if( bCriticalHit && MyKFPM != none && IsCriticalHitZone( MyKFPM, HitZoneIdx ) ) + if(bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx)) InDamage *= 1.5f; } - if( class(DamageType) != None ) + if(class(DamageType) != None) InDamage *= NukeDamageMult; Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx); } -function bool IsCriticalHitZone( KFPawn TestPawn, int HitZoneIndex ) +function bool IsCriticalHitZone(KFPawn TestPawn, int HitZoneIndex) { - if( TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length ) + if(TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length) return TestPawn.HitZones[HitZoneIndex].DmgScale > 1.f; return false; } -simulated function ModifySpareAmmoAmount( KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary ) +simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary) { - if( KFW != None && KFWeap_Thrown_C4(KFW) != None ) + if(KFW != None && KFWeap_Thrown_C4(KFW) != None) PrimarySpareAmmo += (1 + Modifiers[11]); - Super.ModifySpareAmmoAmount( KFW, PrimarySpareAmmo, TraderItem, bSecondary ); + Super.ModifySpareAmmoAmount(KFW, PrimarySpareAmmo, TraderItem, bSecondary); } defaultproperties diff --git a/ServerExt/Classes/Ext_PerkFieldMedic.uc b/ServerExt/Classes/Ext_PerkFieldMedic.uc index a6bb2a9..3d8ab5f 100644 --- a/ServerExt/Classes/Ext_PerkFieldMedic.uc +++ b/ServerExt/Classes/Ext_PerkFieldMedic.uc @@ -12,13 +12,13 @@ var bool bUseToxicDamage,bUseSlug,bUseAirborneAgent; var const class ToxicDmgTypeClass; -simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) +simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { local float TempDamage; TempDamage = InDamage; - if( bUseSlug && WorldInfo.TimeDilation < 1.f && DamageType != none && ClassIsChildOf( DamageType, class'KFDT_Toxic' ) ) + if(bUseSlug && WorldInfo.TimeDilation < 1.f && DamageType != none && ClassIsChildOf(DamageType, class'KFDT_Toxic')) TempDamage += InDamage * 100; InDamage = Round(TempDamage); @@ -26,60 +26,60 @@ simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCau Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx); } -simulated function ModifyMagSizeAndNumber( KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname ) +simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class > WeaponPerkClass, optional bool bSecondary=false, optional name WeaponClassname) { - if( MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW)) ) // Skip boomstick for this. + if(MagazineCapacity>2 && (KFW==None ? WeaponPerkClass.Find(BasePerk)>=0 : IsWeaponOnPerk(KFW))) // Skip boomstick for this. MagazineCapacity = Min(MagazineCapacity*Modifiers[10], bSecondary ? 150 : 255); } -function bool RepairArmor( Pawn HealTarget ) +function bool RepairArmor(Pawn HealTarget) { local KFPawn_Human KFPH; - if( RepairArmorRate>0 ) + if(RepairArmorRate>0) { KFPH = KFPawn_Human(Healtarget); - if( KFPH != none && KFPH.Armor < KFPH.MaxArmor ) + if(KFPH != none && KFPH.Armor < KFPH.MaxArmor) { - KFPH.AddArmor( Round( float(KFPH.MaxArmor) * RepairArmorRate ) ); + KFPH.AddArmor(Round(float(KFPH.MaxArmor) * RepairArmorRate)); return true; } } return false; } -function bool ModifyHealAmount( out float HealAmount ) +function bool ModifyHealAmount(out float HealAmount) { HealAmount*=Modifiers[9]; return (RepairArmorRate>0); } // Di -// simulated function ModifyHealerRechargeTime( out float RechargeRate ) +// simulated function ModifyHealerRechargeTime(out float RechargeRate) // { // super.ModifyHealerRechargeTime(RechargeRate) // RechargeRate /= Clamp(Modifiers[9] * 2, 1.f, 3.f); // } -function CheckForAirborneAgent( KFPawn HealTarget, class DamType, int HealAmount ) +function CheckForAirborneAgent(KFPawn HealTarget, class DamType, int HealAmount) { - if( (AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1 ) - GiveMedicAirborneAgentHealth( HealTarget, DamType, HealAmount ); + if((AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1) + GiveMedicAirborneAgentHealth(HealTarget, DamType, HealAmount); } -function GiveMedicAirborneAgentHealth( KFPawn HealTarget, class DamType, int HealAmount ) +function GiveMedicAirborneAgentHealth(KFPawn HealTarget, class DamType, int HealAmount) { local KFPawn KFP; local int RoundedExtraHealAmount; - RoundedExtraHealAmount = FCeil( float(HealAmount) * AirborneAgentHealRate ); + RoundedExtraHealAmount = FCeil(float(HealAmount) * AirborneAgentHealRate); foreach WorldInfo.Allpawns(class'KFPawn', KFP, HealTarget.Location, 500.f) { - if( KFP.IsAliveAndWell() && WorldInfo.GRI.OnSameTeam( HealTarget, KFP ) ) + if(KFP.IsAliveAndWell() && WorldInfo.GRI.OnSameTeam(HealTarget, KFP)) { - if ( HealTarget == KFP ) - KFP.HealDamage( RoundedExtraHealAmount, PlayerOwner, DamType ); - else KFP.HealDamage( RoundedExtraHealAmount + HealAmount, PlayerOwner, DamType ); + if (HealTarget == KFP) + KFP.HealDamage(RoundedExtraHealAmount, PlayerOwner, DamType); + else KFP.HealDamage(RoundedExtraHealAmount + HealAmount, PlayerOwner, DamType); } } } @@ -94,7 +94,7 @@ static function int ModifyToxicDmg(int ToxicDamage) local float TempDamage; TempDamage = float(ToxicDamage) * 1.2; - return FCeil( TempDamage ); + return FCeil(TempDamage); } function NotifyZedTimeStarted() @@ -103,19 +103,19 @@ function NotifyZedTimeStarted() HPawn = KFPawn_Human(PlayerOwner.Pawn); - if( bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell() ) + if(bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell()) HPawn.StartAirBorneAgentEvent(); } -simulated function float GetSnarePower( optional class DamageType, optional byte HitZoneIdx ) +simulated function float GetSnarePower(optional class DamageType, optional byte HitZoneIdx) { - if( bUseSlug && WorldInfo.TimeDilation < 1.f && class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0 ) + if(bUseSlug && WorldInfo.TimeDilation < 1.f && class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0) return 100; return 0.f; } -function AddDefaultInventory( KFPawn P ) +function AddDefaultInventory(KFPawn P) { local int i; i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm'); diff --git a/ServerExt/Classes/Ext_PerkGunslinger.uc b/ServerExt/Classes/Ext_PerkGunslinger.uc index 90234dd..e5a24e6 100644 --- a/ServerExt/Classes/Ext_PerkGunslinger.uc +++ b/ServerExt/Classes/Ext_PerkGunslinger.uc @@ -5,28 +5,28 @@ var bool bHasUberAmmo,bHasFanfire; replication { // Things the server should send to the client. - if ( true ) + if (true) bHasUberAmmo,bHasFanfire; } -simulated function bool GetUsingTactialReload( KFWeapon KFW ) +simulated function bool GetUsingTactialReload(KFWeapon KFW) { return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.8 : false); } -simulated function bool GetIsUberAmmoActive( KFWeapon KFW ) +simulated function bool GetIsUberAmmoActive(KFWeapon KFW) { return bHasUberAmmo && IsWeaponOnPerk(KFW) && WorldInfo.TimeDilation < 1.f; } -simulated function float GetZedTimeModifier( KFWeapon W ) +simulated function float GetZedTimeModifier(KFWeapon W) { local name StateName; - if( bHasFanfire && IsWeaponOnPerk( W ) ) + if(bHasFanfire && IsWeaponOnPerk(W)) { StateName = W.GetStateName(); - if( BasePerk.Default.ZedTimeModifyingStates.Find( StateName ) != INDEX_NONE || StateName == 'Reloading' ) + if(BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE || StateName == 'Reloading') return 1.f; } diff --git a/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc b/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc index 4c9e2b1..7f8062a 100644 --- a/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc +++ b/ServerExt/Classes/Ext_PerkRhythmPerkBase.uc @@ -4,14 +4,14 @@ var byte HeadShotComboCount,MaxRhythmCombo; var float RhythmComboDmg; var private const float HeadShotCountdownIntervall; -simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx ) +simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class DamageType, optional int HitZoneIdx) { Super.ModifyDamageGiven(InDamage,DamageCauser,MyKFPM,DamageInstigator,DamageType,HitZoneIdx); - if( RhythmComboDmg>0 && BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || IsWeaponOnPerk(KFWeapon(DamageCauser)) ) + if(RhythmComboDmg>0 && BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || IsWeaponOnPerk(KFWeapon(DamageCauser))) InDamage *= (1.f+RhythmComboDmg); } -final function SetMaxRhythm( byte MaxCombo ) +final function SetMaxRhythm(byte MaxCombo) { MaxRhythmCombo = MaxCombo; } @@ -25,21 +25,21 @@ final function ResetRhythm() function SubstractHeadShotCombo() { - if( HeadShotComboCount > 0 ) + if(HeadShotComboCount > 0) UpdateDmgScale(false); else - ClearTimer( nameOf( SubstractHeadShotCombo ) ); + ClearTimer(nameOf(SubstractHeadShotCombo)); } -final function UpdateDmgScale( bool bUp ) +final function UpdateDmgScale(bool bUp) { - if( bUp ) + if(bUp) { HeadShotComboCount = Min(HeadShotComboCount+1,MaxRhythmCombo); HeadShotMessage(HeadShotComboCount,false,MaxRhythmCombo); - SetTimer( HeadShotCountdownIntervall, true, nameOf( SubstractHeadShotCombo ) ); + SetTimer(HeadShotCountdownIntervall, true, nameOf(SubstractHeadShotCombo)); } - else if( HeadShotComboCount>0) + else if(HeadShotComboCount>0) { --HeadShotComboCount; HeadShotMessage(HeadShotComboCount,true,MaxRhythmCombo); @@ -48,31 +48,31 @@ final function UpdateDmgScale( bool bUp ) RhythmComboDmg = HeadShotComboCount*0.075; } -function UpdatePerkHeadShots( ImpactInfo Impact, class DamageType, int NumHit ) +function UpdatePerkHeadShots(ImpactInfo Impact, class DamageType, int NumHit) { local int HitZoneIdx; local KFPawn_Monster KFPM; - if( MaxRhythmCombo<=0 ) + if(MaxRhythmCombo<=0) return; KFPM = KFPawn_Monster(Impact.HitActor); - if( KFPM==none || KFPM.GetTeamNum()==0 ) + if(KFPM==none || KFPM.GetTeamNum()==0) return; HitZoneIdx = KFPM.HitZones.Find('ZoneName', Impact.HitInfo.BoneName); - if( HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell() ) + if(HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell()) { - if( class(DamageType)!=None && (class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) + if(class(DamageType)!=None && (class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) UpdateDmgScale(true); } } -reliable client function HeadShotMessage( byte HeadShotNum, bool bMissed, byte MaxHits ) +reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte MaxHits) { local AkEvent TempAkEvent; local KFPlayerController PC; PC = KFPlayerController(PlayerOwner); - if( PC==none || PC.MyGFxHUD==none ) + if(PC==none || PC.MyGFxHUD==none) { return; } @@ -80,25 +80,25 @@ reliable client function HeadShotMessage( byte HeadShotNum, bool bMissed, byte M PC.MyGFxHUD.RhythmCounterWidget.SetInt("count", HeadShotNum); PC.MyGFxHUD.RhythmCounterWidget.SetBonusPercentage(float(HeadShotNum) / float(MaxHits)); - if( HeadshotNum==0 ) + if(HeadshotNum==0) TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Reset'; - else if( HeadShotNum0 && IsWeaponOnPerk(KFW)) ? MoveSpeedMods[RepTacticalMove-1] : 1.f); } -simulated function bool GetIsUberAmmoActive( KFWeapon KFW ) +simulated function bool GetIsUberAmmoActive(KFWeapon KFW) { return bRapidAssault && IsWeaponOnPerk(KFW) && WorldInfo.TimeDilation < 1.f; } -simulated function float GetZedTimeModifier( KFWeapon W ) +simulated function float GetZedTimeModifier(KFWeapon W) { - if( bRapidAssault && WorldInfo.TimeDilation<1.f && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(W.GetStateName()) != INDEX_NONE ) + if(bRapidAssault && WorldInfo.TimeDilation<1.f && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(W.GetStateName()) != INDEX_NONE) return 0.51f; return 0.f; } diff --git a/ServerExt/Classes/Ext_PerkSharpshooter.uc b/ServerExt/Classes/Ext_PerkSharpshooter.uc index cfca467..d46047a 100644 --- a/ServerExt/Classes/Ext_PerkSharpshooter.uc +++ b/ServerExt/Classes/Ext_PerkSharpshooter.uc @@ -6,19 +6,19 @@ var float ZEDTimeStunPower,DireReloadSpeed; replication { // Things the server should send to the client. - if ( true ) + if (true) bHasDireReload; } simulated function float GetReloadRateScale(KFWeapon KFW) { - if( bHasDireReload && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health<40 ) + if(bHasDireReload && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health<40) return Super.GetReloadRateScale(KFW)*DireReloadSpeed; return Super.GetReloadRateScale(KFW); } -function float GetStunPowerModifier( optional class DamageType, optional byte HitZoneIdx ) +function float GetStunPowerModifier(optional class DamageType, optional byte HitZoneIdx) { - if( ZEDTimeStunPower>0 && HitZoneIdx==HZI_Head && WorldInfo.TimeDilation<1.f && (class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0) ) + if(ZEDTimeStunPower>0 && HitZoneIdx==HZI_Head && WorldInfo.TimeDilation<1.f && (class(DamageType)!=None && class(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)) return Super.GetStunPowerModifier(DamageType,HitZoneIdx) + ZEDTimeStunPower; return Super.GetStunPowerModifier(DamageType,HitZoneIdx); } diff --git a/ServerExt/Classes/Ext_PerkSupport.uc b/ServerExt/Classes/Ext_PerkSupport.uc index b0de476..4910896 100644 --- a/ServerExt/Classes/Ext_PerkSupport.uc +++ b/ServerExt/Classes/Ext_PerkSupport.uc @@ -6,11 +6,11 @@ var float APShotMul; replication { // Things the server should send to the client. - if ( true ) + if (true) bCanRepairDoors, bUseAPShot, bUsePerforate, APShotMul; } -simulated function bool GetUsingTactialReload( KFWeapon KFW ) +simulated function bool GetUsingTactialReload(KFWeapon KFW) { return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.75 : false); } @@ -20,10 +20,10 @@ simulated function bool CanRepairDoors() return bCanRepairDoors; } -simulated function float GetPenetrationModifier( byte Level, class DamageType, optional bool bForce ) +simulated function float GetPenetrationModifier(byte Level, class DamageType, optional bool bForce ) { local float PenetrationPower; - if( !bForce && (DamageType == none || ( DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk) == INDEX_NONE ))) + if(!bForce && (DamageType == none || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk) == INDEX_NONE))) return 0; PenetrationPower = bUseAPShot ? APShotMul : 0.f; diff --git a/ServerExt/Classes/Ext_TGroupBase.uc b/ServerExt/Classes/Ext_TGroupBase.uc index 76eeffe..58a13ca 100644 --- a/ServerExt/Classes/Ext_TGroupBase.uc +++ b/ServerExt/Classes/Ext_TGroupBase.uc @@ -5,7 +5,7 @@ Class Ext_TGroupBase extends Object var() localized string GroupInfo; var() bool bLimitToOne; // Limit to only one trait for this group. -static function string GetUIInfo( Ext_PerkBase Perk ) +static function string GetUIInfo(Ext_PerkBase Perk) { return (Default.bLimitToOne ? Default.GroupInfo$" (MAX 1)" : Default.GroupInfo); } @@ -15,14 +15,14 @@ static function string GetUIDesc() } // See if group is already using up limitation. -static function bool GroupLimited( Ext_PerkBase Perk, class Trait ) +static function bool GroupLimited(Ext_PerkBase Perk, class Trait) { local int i; - if( Default.bLimitToOne ) + if(Default.bLimitToOne) { - for( i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class ) + for(i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class) return true; } return false; diff --git a/ServerExt/Classes/Ext_TGroupRegen.uc b/ServerExt/Classes/Ext_TGroupRegen.uc index e552e35..0d71909 100644 --- a/ServerExt/Classes/Ext_TGroupRegen.uc +++ b/ServerExt/Classes/Ext_TGroupRegen.uc @@ -1,6 +1,6 @@ class Ext_TGroupRegen extends Ext_TGroupBase; -static function string GetUIInfo( Ext_PerkBase Perk ) +static function string GetUIInfo(Ext_PerkBase Perk) { return Default.GroupInfo$" (MAX "$GetMaxLimit(Perk)$")"; } @@ -9,21 +9,21 @@ static function string GetUIDesc() return Super.GetUIDesc()$"|To buy additional regen abilities:|-Prestige level 1 + Perk level 100 = MAX 2 traits|-Prestige level 5 + Perk level 150 = MAX 3 traits"; } -static function bool GroupLimited( Ext_PerkBase Perk, class Trait ) +static function bool GroupLimited(Ext_PerkBase Perk, class Trait) { local int i; local byte n; n = GetMaxLimit(Perk); - for( i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0 ) + for(i=0; i0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0) return true; return false; } -static final function byte GetMaxLimit( Ext_PerkBase Perk ) +static final function byte GetMaxLimit(Ext_PerkBase Perk) { - if( Perk.CurrentPrestige<1 || Perk.CurrentLevel<100 ) + if(Perk.CurrentPrestige<1 || Perk.CurrentLevel<100) return 1; return ((Perk.CurrentPrestige<5 || Perk.CurrentLevel<150) ? 2 : 3); } diff --git a/ServerExt/Classes/Ext_T_AmmoRegHelp.uc b/ServerExt/Classes/Ext_T_AmmoRegHelp.uc index 31ef5a9..46fba8a 100644 --- a/ServerExt/Classes/Ext_T_AmmoRegHelp.uc +++ b/ServerExt/Classes/Ext_T_AmmoRegHelp.uc @@ -7,7 +7,7 @@ var float RegCount; function PostBeginPlay() { PawnOwner = Pawn(Owner); - if( PawnOwner==None ) + if(PawnOwner==None) Destroy(); else SetTimer(29+FRand(),true); } @@ -17,18 +17,18 @@ function Timer() local byte i; local int ExtraAmmo; - if( PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None ) + if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None) Destroy(); else { foreach PawnOwner.InvManager.InventoryActors(class'KFWeapon',W) { - for( i=0; i<2; ++i ) + for(i=0; i<2; ++i) { - if( W.SpareAmmoCount[i] < W.SpareAmmoCapacity[i] ) + if(W.SpareAmmoCount[i] < W.SpareAmmoCapacity[i]) { ExtraAmmo = FMax(float(W.SpareAmmoCapacity[i] + W.MagazineCapacity[i])*RegCount,1.f); - if ( i==0 ) + if (i==0) { W.AddAmmo(ExtraAmmo); } diff --git a/ServerExt/Classes/Ext_T_ArmorRegHelp.uc b/ServerExt/Classes/Ext_T_ArmorRegHelp.uc index b9190a3..2d06f9f 100644 --- a/ServerExt/Classes/Ext_T_ArmorRegHelp.uc +++ b/ServerExt/Classes/Ext_T_ArmorRegHelp.uc @@ -3,9 +3,9 @@ Class Ext_T_ArmorRegHelp extends Ext_T_HealthRegHelp function Timer() { - if( PawnOwner==None || PawnOwner.Health<=0 ) + if(PawnOwner==None || PawnOwner.Health<=0) Destroy(); - else if( PawnOwner.ArmorWorldInfo.TimeSeconds ) + if(Level==1 || LastDiedTimer>WorldInfo.TimeSeconds) return false; } - else if( Level==1 && Rand(2)==0 ) + else if(Level==1 && Rand(2)==0) return false; LastDied = Other; bTeleporting = true; - if( SpawnPointer==None ) + if(SpawnPointer==None) SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo); ResPoint = SpawnPointer.PickBestSpawn().Location; LastDied.FindSpot(vect(36,36,86),ResPoint); - if( VSizeSq(LastDied.Location-ResPoint)<1.f ) // Prevent division by zero errors in future. + if(VSizeSq(LastDied.Location-ResPoint)<1.f) // Prevent division by zero errors in future. ResPoint.Z+=5; Enable('Tick'); StartResurrect(); @@ -42,10 +42,10 @@ final function StartResurrect() LastDied.Health = 9999; LastDied.LastStartTime = WorldInfo.TimeSeconds; - if( ExtHumanPawn(LastDied)!=None ) + if(ExtHumanPawn(LastDied)!=None) { ExtHumanPawn(LastDied).bCanBecomeRagdoll = false; - if( !ExtHumanPawn(LastDied).CanBeRedeemed() ) + if(!ExtHumanPawn(LastDied).CanBeRedeemed()) { bIsDelayed = true; return; @@ -61,26 +61,26 @@ final function StartResurrect() LastDiedTimer = WorldInfo.TimeSeconds+TeleTime; } -function Tick( float Delta ) +function Tick(float Delta) { - if( !bTeleporting ) + if(!bTeleporting) { Disable('Tick'); return; } - if( LastDied==None || LastDied.Health<=0 ) + if(LastDied==None || LastDied.Health<=0) { bTeleporting = false; return; } - if( bIsDelayed ) + if(bIsDelayed) { bIsDelayed = false; StartResurrect(); return; } Delta = (LastDiedTimer-WorldInfo.TimeSeconds); - if( Delta<=0 ) + if(Delta<=0) { EndGhostTeleport(); return; @@ -88,7 +88,7 @@ function Tick( float Delta ) Delta /= TeleTime; LastDied.Velocity = Normal(ResPoint-TeleStartPoint)*900.f; LastDied.SetLocation(TeleStartPoint*Delta+ResPoint*(1.f-Delta)); - if( LastDied.Physics!=PHYS_None ) + if(LastDied.Physics!=PHYS_None) LastDied.SetPhysics(PHYS_None); } @@ -106,16 +106,16 @@ final function EndGhostTeleport() LastDied.SetPhysics(PHYS_Falling); LastDied.Velocity = vect(0,0,0); LastDied.LastStartTime = WorldInfo.TimeSeconds; // For spawn protection, if any. - if( LastDied.IsDoingSpecialMove() ) // Stop any grabbing zeds. + if(LastDied.IsDoingSpecialMove()) // Stop any grabbing zeds. LastDied.EndSpecialMove(); - if( ExtHumanPawn(LastDied)!=None ) + if(ExtHumanPawn(LastDied)!=None) ExtHumanPawn(LastDied).bCanBecomeRagdoll = true; } function Destroyed() { - if( bTeleporting && LastDied!=None && LastDied.Health>0 ) + if(bTeleporting && LastDied!=None && LastDied.Health>0) EndGhostTeleport(); } diff --git a/ServerExt/Classes/Ext_T_HealthRegHelp.uc b/ServerExt/Classes/Ext_T_HealthRegHelp.uc index cab441b..c924b45 100644 --- a/ServerExt/Classes/Ext_T_HealthRegHelp.uc +++ b/ServerExt/Classes/Ext_T_HealthRegHelp.uc @@ -7,15 +7,15 @@ var byte RegCount; function PostBeginPlay() { PawnOwner = KFPawn_Human(Owner); - if( PawnOwner==None ) + if(PawnOwner==None) Destroy(); else SetTimer(9+FRand(),true); } function Timer() { - if( PawnOwner==None || PawnOwner.Health<=0 ) + if(PawnOwner==None || PawnOwner.Health<=0) Destroy(); - else if( PawnOwner.Health=0 && ActiveUsers[i].NextUseTime>WorldInfo.TimeSeconds ) + if(i>=0 && ActiveUsers[i].NextUseTime>WorldInfo.TimeSeconds) return false; - if( bInteractIfTrue ) + if(bInteractIfTrue) { - if( i==-1 ) + if(i==-1) { i = ActiveUsers.Length; ActiveUsers.Length = i+1; @@ -113,7 +113,7 @@ simulated function bool GetCanInteract( Pawn User, optional bool bInteractIfTrue } } - if( bInteractIfTrue && WorldInfo.NetMode!=NM_Client ) + if(bInteractIfTrue && WorldInfo.NetMode!=NM_Client) { GiveAmmunition(KFPawn_Human(User)); } @@ -123,60 +123,60 @@ function CleanupUsers() { local int i; - for( i=(ActiveUsers.Length-1); i>=0; --i ) - if( ActiveUsers[i].Player==None || ActiveUsers[i].Player.Health<=0 || ActiveUsers[i].NextUseTime=0; --i) + if(ActiveUsers[i].Player==None || ActiveUsers[i].Player.Health<=0 || ActiveUsers[i].NextUseTime1 ) + if(RespawnHelperTime>1) --RespawnHelperTime; - if( OldKillsValue==PawnOwner.PlayerReplicationInfo.Kills ) + if(OldKillsValue==PawnOwner.PlayerReplicationInfo.Kills) return; bNeedsKillZed = false; } - else if( RespawnHelperTime>0 ) + else if(RespawnHelperTime>0) { - if( --RespawnHelperTime==0 ) + if(--RespawnHelperTime==0) SpawnHelper(); } - else if( LiveHelper==None || LiveHelper.Health<=0 ) + else if(LiveHelper==None || LiveHelper.Health<=0) { OldKillsValue = PawnOwner.PlayerReplicationInfo.Kills; bNeedsKillZed = true; RespawnHelperTime = 60; } - else if( !HasLiveZeds() ) + else if(!HasLiveZeds()) { - if( NoLiveCounter==0 ) + if(NoLiveCounter==0) { PrevMonster = LiveHelper.Class; PrevMonsterHP = (float(LiveHelper.Health) / LiveHelper.HealthMax); @@ -66,18 +66,18 @@ function Timer() } function Destroyed() { - if( LiveHelper!=None && LiveHelper.Health>0 ) + if(LiveHelper!=None && LiveHelper.Health>0) LiveHelper.Died(None,class'DmgType_Suicided',vect(0,0,0)); } final function bool HasLiveZeds() { local KFPawn_Monster M; - if( KFGameReplicationInfo(WorldInfo.GRI).WaveNum>=KFGameReplicationInfo(WorldInfo.GRI).WaveMax ) // No pets on possible bonus waves. + if(KFGameReplicationInfo(WorldInfo.GRI).WaveNum>=KFGameReplicationInfo(WorldInfo.GRI).WaveMax) // No pets on possible bonus waves. return false; foreach WorldInfo.AllPawns(Class'KFPawn_Monster',M) - if( M.Health>0 && M.GetTeamNum()!=0 ) + if(M.Health>0 && M.GetTeamNum()!=0) return true; return false; } @@ -92,41 +92,41 @@ final function SpawnHelper() local AkBaseSoundObject TempSound; local bool bFinalWave; - if( PawnOwner.PlayerReplicationInfo==None || !HasLiveZeds() ) + if(PawnOwner.PlayerReplicationInfo==None || !HasLiveZeds()) { RespawnHelperTime = 3; return; } NoLiveCounter = 5; bFinalWave = KFGameReplicationInfo(WorldInfo.GRI).IsFinalWave(); - if( bFinalWave && Class(PrevMonster)!=None ) + if(bFinalWave && Class(PrevMonster)!=None) PrevMonster = None; MC = (PrevMonster!=None ? PrevMonster : PickRandomMonster(CurLevel,bFinalWave)); - if( MC!=None ) + if(MC!=None) { R.Yaw = Rand(65536); - if( MC.Default.SoundGroupArch!=None ) + if(MC.Default.SoundGroupArch!=None) { // Make no entrance roam (for FP's and Scrakes). TempSound = MC.Default.SoundGroupArch.EntranceSound; MC.Default.SoundGroupArch.EntranceSound = None; } - for( i=0; i<40; ++i ) + for(i=0; i<40; ++i) { V = PawnOwner.Location; V.X += (FRand()*300.f-150.f); V.Y += (FRand()*300.f-150.f); - if( !PawnOwner.FastTrace(V,PawnOwner.Location) ) + if(!PawnOwner.FastTrace(V,PawnOwner.Location)) continue; LiveHelper = Spawn(MC,,,V,R); - if( LiveHelper!=None ) + if(LiveHelper!=None) break; } - if( MC.Default.SoundGroupArch!=None ) + if(MC.Default.SoundGroupArch!=None) MC.Default.SoundGroupArch.EntranceSound = TempSound; } - if( LiveHelper==None ) + if(LiveHelper==None) RespawnHelperTime = 2; else { @@ -136,7 +136,7 @@ final function SpawnHelper() // Setup AI C = Spawn(LiveHelper.ControllerClass); - if( KFAIController(C)!=None ) + if(KFAIController(C)!=None) { KFAIController(C).bCanTeleportCloser = false; KFAIController(C).DefaultCommandClass = class'Ext_AICommandBasePet'; @@ -155,14 +155,14 @@ final function SpawnHelper() LiveHelper.bCanGrabAttack = false; // Scale by previous zed HP. - if( PrevMonster!=None ) + if(PrevMonster!=None) { LiveHelper.Health *= PrevMonsterHP; PrevMonster = None; } // Setup PRI. - if( C.PlayerReplicationInfo!=None ) + if(C.PlayerReplicationInfo!=None) C.PlayerReplicationInfo.Destroy(); PRI = Spawn(class'Ext_T_MonsterPRI',LiveHelper); LiveHelper.PlayerReplicationInfo = PRI; @@ -174,21 +174,21 @@ final function SpawnHelper() PRI.MonsterType = MC; PRI.PlayerName = PawnOwner.PlayerReplicationInfo.PlayerName$"'s "$PRI.MonsterName; PRI.OwnerController = PawnOwner.Controller; - if( PawnOwner.PlayerReplicationInfo.Team!=None ) + if(PawnOwner.PlayerReplicationInfo.Team!=None) PawnOwner.PlayerReplicationInfo.Team.AddToTeam(C); PRI.Timer(); - if( WorldInfo.NetMode!=NM_DedicatedServer ) + if(WorldInfo.NetMode!=NM_DedicatedServer) PRI.NotifyOwner(); } } -final function SetDamageScale( float Sc ) +final function SetDamageScale(float Sc) { DamageScale = Default.DamageScale*Sc; - if( LiveHelper!=None ) + if(LiveHelper!=None) LiveHelper.DamageScaling = DamageScale; } -final function SetHealthScale( float Sc ) +final function SetHealthScale(float Sc) { HPScale = Default.HPScale*Sc; } @@ -201,35 +201,35 @@ static final function LoadMonsterList() Default.ZedTypes.Length = class'Ext_TraitZED_Summon'.Default.ZedTypes.Length; - for( i=0; i(DynamicLoadObject(SA[j],Class'Class')); - if( C==None ) + if(C==None) continue; Default.ZedTypes[i].Zeds[Default.ZedTypes[i].Zeds.Length] = C; } - if( Default.ZedTypes[i].Zeds.Length==0 ) + if(Default.ZedTypes[i].Zeds.Length==0) Default.ZedTypes[i].Zeds[Default.ZedTypes[i].Zeds.Length] = Class'KFPawn_ZedClot_Alpha'; } } -static final function class PickRandomMonster( byte Level, bool bNotBoss ) +static final function class PickRandomMonster(byte Level, bool bNotBoss) { local byte i; local class Res; Level = Min(Default.ZedTypes.Length-1,Level); - for( i=0; i<5; ++i ) + for(i=0; i<5; ++i) { Res = Default.ZedTypes[Level].Zeds[Rand(Default.ZedTypes[Level].Zeds.Length)]; - if( !bNotBoss || class(Res)==None ) + if(!bNotBoss || class(Res)==None) break; } - if( bNotBoss && class(Res)!=None ) + if(bNotBoss && class(Res)!=None) Res = Class'KFPawn_ZedFleshpound'; return Res; } diff --git a/ServerExt/Classes/Ext_TraitAPShots.uc b/ServerExt/Classes/Ext_TraitAPShots.uc index b811bee..e1ad7a2 100644 --- a/ServerExt/Classes/Ext_TraitAPShots.uc +++ b/ServerExt/Classes/Ext_TraitAPShots.uc @@ -1,21 +1,21 @@ Class Ext_TraitAPShots extends Ext_TraitBase; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSupport(Perk).APShotMul = 1 + (0.25 + (((float(Level) - 1.f) * 5.f) / 100.f)); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSupport(Perk).APShotMul = 0.f; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSupport(Perk).bUseAPShot = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSupport(Perk).bUseAPShot = false; } diff --git a/ServerExt/Classes/Ext_TraitAcidicCompound.uc b/ServerExt/Classes/Ext_TraitAcidicCompound.uc index 3dc78c6..293c147 100644 --- a/ServerExt/Classes/Ext_TraitAcidicCompound.uc +++ b/ServerExt/Classes/Ext_TraitAcidicCompound.uc @@ -1,10 +1,10 @@ Class Ext_TraitAcidicCompound extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).bUseToxicDamage = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).bUseToxicDamage = false; } diff --git a/ServerExt/Classes/Ext_TraitAirborne.uc b/ServerExt/Classes/Ext_TraitAirborne.uc index 5e0a164..40f8499 100644 --- a/ServerExt/Classes/Ext_TraitAirborne.uc +++ b/ServerExt/Classes/Ext_TraitAirborne.uc @@ -2,12 +2,12 @@ Class Ext_TraitAirborne extends Ext_TraitBase; var array HealRates; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).AirborneAgentHealRate = Default.HealRates[Level-1]; Ext_PerkFieldMedic(Perk).AirborneAgentLevel = (Level<4 ? 1 : 2); } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).AirborneAgentLevel = 0; } diff --git a/ServerExt/Classes/Ext_TraitAirborneAgent.uc b/ServerExt/Classes/Ext_TraitAirborneAgent.uc index a1269dc..c5bfca2 100644 --- a/ServerExt/Classes/Ext_TraitAirborneAgent.uc +++ b/ServerExt/Classes/Ext_TraitAirborneAgent.uc @@ -9,18 +9,18 @@ static function string GetPerkDescription() return S; } -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if( Perk.CurrentLevel RegenValues; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_AmmoRegHelp H; H = Player.Spawn(class'Ext_T_AmmoRegHelp',Player); - if( H!=None ) + if(H!=None) H.RegCount = Default.RegenValues[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_AmmoRegHelp H; diff --git a/ServerExt/Classes/Ext_TraitArmorReg.uc b/ServerExt/Classes/Ext_TraitArmorReg.uc index aa9da91..d105294 100644 --- a/ServerExt/Classes/Ext_TraitArmorReg.uc +++ b/ServerExt/Classes/Ext_TraitArmorReg.uc @@ -1,14 +1,14 @@ Class Ext_TraitArmorReg extends Ext_TraitHealthReg; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ArmorRegHelp H; H = Player.Spawn(class'Ext_T_ArmorRegHelp',Player); - if( H!=None ) + if(H!=None) H.RegCount = Default.RegenValues[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ArmorRegHelp H; diff --git a/ServerExt/Classes/Ext_TraitArmorRep.uc b/ServerExt/Classes/Ext_TraitArmorRep.uc index b0a06fb..fc59049 100644 --- a/ServerExt/Classes/Ext_TraitArmorRep.uc +++ b/ServerExt/Classes/Ext_TraitArmorRep.uc @@ -1,10 +1,10 @@ Class Ext_TraitArmorRep extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).RepairArmorRate = float(Level)*0.05f; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).RepairArmorRate = 0; } diff --git a/ServerExt/Classes/Ext_TraitAutoFire.uc b/ServerExt/Classes/Ext_TraitAutoFire.uc index 72d65c7..b5ba8ca 100644 --- a/ServerExt/Classes/Ext_TraitAutoFire.uc +++ b/ServerExt/Classes/Ext_TraitAutoFire.uc @@ -1,13 +1,13 @@ Class Ext_TraitAutoFire extends Ext_TraitBase; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_AutoFireHelper H; H = Player.Spawn(class'Ext_T_AutoFireHelper',Player); H.AssociatedPerkClass = Perk.BasePerk; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_AutoFireHelper H; diff --git a/ServerExt/Classes/Ext_TraitBase.uc b/ServerExt/Classes/Ext_TraitBase.uc index 9192fd0..e702e37 100644 --- a/ServerExt/Classes/Ext_TraitBase.uc +++ b/ServerExt/Classes/Ext_TraitBase.uc @@ -27,20 +27,20 @@ var() bool bGroupLimitToOne, // TraitGroup should limit so you can only buy one bPostApplyEffect; // Apply effects on second pass (relies on that another trait is activated first). // Check if trait is enabled and usable on this perk. -static function bool IsEnabled( Ext_PerkBase Perk ) +static function bool IsEnabled(Ext_PerkBase Perk) { return !Default.bDisabled && (Default.SupportedPerk==None || ClassIsChildOf(Perk.Class,Default.SupportedPerk)); } // Check if player meets the requirements to buy this trait. -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { // First check level. - if( Perk.CurrentLevel0 ) + if(Default.MinLevel>0) S = "Min perk level: #{FF4000}"$Default.MinLevel$"#{DEF}|"$S; return Default.Description$"||"$S; } @@ -70,11 +70,11 @@ static function string GetTooltipInfo() } // Return level specific trait prices. -static function int GetTraitCost( byte LevelNum ) +static function int GetTraitCost(byte LevelNum) { - if( Default.LevelCosts.Length>0 ) + if(Default.LevelCosts.Length>0) { - if( LevelNum DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ); +static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data); // Give/modify default inventory. -static function AddDefaultInventory( KFPawn Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ); +static function AddDefaultInventory(KFPawn Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data); // Data that server should replicate to client. -static final function string IntToStr( int Value, optional byte MaxVal ) // Helper function to put integer into one character of string. +static final function string IntToStr(int Value, optional byte MaxVal) // Helper function to put integer into one character of string. { - switch( MaxVal ) + switch(MaxVal) { case 0: // 0-65535 return Chr(Max(Value,0)+1); @@ -130,15 +130,15 @@ static final function string IntToStr( int Value, optional byte MaxVal ) // Help return Chr((Value & 32767)+1) $ Chr(((Value >> 15) & 32767)+1); } } -static final function string InlineString( string Str ) // Helper function to append a string line to a text using a length char in front. +static final function string InlineString(string Str) // Helper function to append a string line to a text using a length char in front. { return IntToStr(Len(Str))$Str; } -static final function int StrToInt( out string Value, optional byte MaxVal ) // Reverse. +static final function int StrToInt(out string Value, optional byte MaxVal) // Reverse. { local int Res; - switch( MaxVal ) + switch(MaxVal) { case 0: // 0-65535 Res = Asc(Left(Value,1))-1; @@ -151,7 +151,7 @@ static final function int StrToInt( out string Value, optional byte MaxVal ) // } return Res; } -static final function string GetInlineStr( out string S ) // Reverse. +static final function string GetInlineStr(out string S) // Reverse. { local int l; local string Res; @@ -168,17 +168,17 @@ static function string GetRepData() local int i; S = IntToStr(Default.MinLevel)$IntToStr(Default.LevelCosts.Length); - for( i=0; i CarryAdds; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local KFInventoryManager M; M = KFInventoryManager(Player.InvManager); - if( M!=None ) + if(M!=None) M.MaxCarryBlocks = M.Default.MaxCarryBlocks+Default.CarryAdds[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local KFInventoryManager M; M = KFInventoryManager(Player.InvManager); - if( M!=None ) + if(M!=None) M.MaxCarryBlocks = M.Default.MaxCarryBlocks; } diff --git a/ServerExt/Classes/Ext_TraitContactNade.uc b/ServerExt/Classes/Ext_TraitContactNade.uc index bbd46b0..d4bb0b7 100644 --- a/ServerExt/Classes/Ext_TraitContactNade.uc +++ b/ServerExt/Classes/Ext_TraitContactNade.uc @@ -1,10 +1,10 @@ Class Ext_TraitContactNade extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bExplodeOnContact = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bExplodeOnContact = false; } diff --git a/ServerExt/Classes/Ext_TraitDemoAOE.uc b/ServerExt/Classes/Ext_TraitDemoAOE.uc index df5e401..0a59e02 100644 --- a/ServerExt/Classes/Ext_TraitDemoAOE.uc +++ b/ServerExt/Classes/Ext_TraitDemoAOE.uc @@ -1,11 +1,11 @@ Class Ext_TraitDemoAOE extends Ext_TraitBase; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).AOEMult = 1 + (0.15 + (((float(Level) - 1.f) * 5.f) / 100.f)); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).AOEMult = 1.0f; } diff --git a/ServerExt/Classes/Ext_TraitDemoCriticalHit.uc b/ServerExt/Classes/Ext_TraitDemoCriticalHit.uc index d9e8e17..e20d73d 100644 --- a/ServerExt/Classes/Ext_TraitDemoCriticalHit.uc +++ b/ServerExt/Classes/Ext_TraitDemoCriticalHit.uc @@ -1,10 +1,10 @@ Class Ext_TraitDemoCriticalHit extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bCriticalHit = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bCriticalHit = false; } diff --git a/ServerExt/Classes/Ext_TraitDemoDirectHit.uc b/ServerExt/Classes/Ext_TraitDemoDirectHit.uc index e35f26f..7802182 100644 --- a/ServerExt/Classes/Ext_TraitDemoDirectHit.uc +++ b/ServerExt/Classes/Ext_TraitDemoDirectHit.uc @@ -1,10 +1,10 @@ Class Ext_TraitDemoDirectHit extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bDirectHit = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bDirectHit = false; } diff --git a/ServerExt/Classes/Ext_TraitDemoNuke.uc b/ServerExt/Classes/Ext_TraitDemoNuke.uc index 9a5ec88..aa5a4e1 100644 --- a/ServerExt/Classes/Ext_TraitDemoNuke.uc +++ b/ServerExt/Classes/Ext_TraitDemoNuke.uc @@ -9,41 +9,41 @@ static function string GetPerkDescription() return S; } -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if( Perk.CurrentLevel=0 ) + if(i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } return true; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local ExtPlayerReplicationInfo MyPRI; MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo); - if( MyPRI == None || Ext_PerkDemolition(Perk) == None ) + if(MyPRI == None || Ext_PerkDemolition(Perk) == None) return; MyPRI.bNukeActive = true; Ext_PerkDemolition(Perk).NukeDamageMult = 1.0 + (((float(Level) - 1.f) * 5.f) / 100.f); } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local ExtPlayerReplicationInfo MyPRI; MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo); - if( MyPRI == None || Ext_PerkDemolition(Perk) == None ) + if(MyPRI == None || Ext_PerkDemolition(Perk) == None) return; MyPRI.bNukeActive = false; diff --git a/ServerExt/Classes/Ext_TraitDemoProfessional.uc b/ServerExt/Classes/Ext_TraitDemoProfessional.uc index 05f3788..6f363a2 100644 --- a/ServerExt/Classes/Ext_TraitDemoProfessional.uc +++ b/ServerExt/Classes/Ext_TraitDemoProfessional.uc @@ -9,29 +9,29 @@ static function string GetPerkDescription() return S; } -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if( Perk.CurrentLevel=0 ) + if(i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } return true; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bProfessionalActive = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bProfessionalActive = false; } diff --git a/ServerExt/Classes/Ext_TraitDemoReactiveArmor.uc b/ServerExt/Classes/Ext_TraitDemoReactiveArmor.uc index dc9040f..17fd410 100644 --- a/ServerExt/Classes/Ext_TraitDemoReactiveArmor.uc +++ b/ServerExt/Classes/Ext_TraitDemoReactiveArmor.uc @@ -1,10 +1,10 @@ Class Ext_TraitDemoReactiveArmor extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bCanUseSacrifice = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bCanUseSacrifice = false; } diff --git a/ServerExt/Classes/Ext_TraitDireReload.uc b/ServerExt/Classes/Ext_TraitDireReload.uc index c51db38..44c3c91 100644 --- a/ServerExt/Classes/Ext_TraitDireReload.uc +++ b/ServerExt/Classes/Ext_TraitDireReload.uc @@ -1,10 +1,10 @@ Class Ext_TraitDireReload extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSharpshooter(Perk).bHasDireReload = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSharpshooter(Perk).bHasDireReload = false; } diff --git a/ServerExt/Classes/Ext_TraitDoorRepair.uc b/ServerExt/Classes/Ext_TraitDoorRepair.uc index f49d6fd..5af125b 100644 --- a/ServerExt/Classes/Ext_TraitDoorRepair.uc +++ b/ServerExt/Classes/Ext_TraitDoorRepair.uc @@ -1,11 +1,11 @@ Class Ext_TraitDoorRepair extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSupport(Perk).bCanRepairDoors = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSupport(Perk).bCanRepairDoors = false; } diff --git a/ServerExt/Classes/Ext_TraitDuracell.uc b/ServerExt/Classes/Ext_TraitDuracell.uc index 15968ad..e498f4f 100644 --- a/ServerExt/Classes/Ext_TraitDuracell.uc +++ b/ServerExt/Classes/Ext_TraitDuracell.uc @@ -2,14 +2,14 @@ Class Ext_TraitDuracell extends Ext_TraitBase; var array BatteryCharges; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).SetBatteryRate(Default.BatteryCharges[Level-1]); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).SetBatteryRate(1.f); } diff --git a/ServerExt/Classes/Ext_TraitEliteReload.uc b/ServerExt/Classes/Ext_TraitEliteReload.uc index 1537d9a..3e91088 100644 --- a/ServerExt/Classes/Ext_TraitEliteReload.uc +++ b/ServerExt/Classes/Ext_TraitEliteReload.uc @@ -1,10 +1,10 @@ Class Ext_TraitEliteReload extends Ext_TraitBase; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bTacticalReload = true; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bTacticalReload = false; } diff --git a/ServerExt/Classes/Ext_TraitEnemyHP.uc b/ServerExt/Classes/Ext_TraitEnemyHP.uc index feccfeb..e494817 100644 --- a/ServerExt/Classes/Ext_TraitEnemyHP.uc +++ b/ServerExt/Classes/Ext_TraitEnemyHP.uc @@ -1,10 +1,10 @@ Class Ext_TraitEnemyHP extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.EnemyHealthRange = Level; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.EnemyHealthRange = 0; } diff --git a/ServerExt/Classes/Ext_TraitFanfire.uc b/ServerExt/Classes/Ext_TraitFanfire.uc index 4678b72..99c1237 100644 --- a/ServerExt/Classes/Ext_TraitFanfire.uc +++ b/ServerExt/Classes/Ext_TraitFanfire.uc @@ -1,10 +1,10 @@ Class Ext_TraitFanfire extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkGunslinger(Perk).bHasFanfire = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkGunslinger(Perk).bHasFanfire = false; } diff --git a/ServerExt/Classes/Ext_TraitFireExplode.uc b/ServerExt/Classes/Ext_TraitFireExplode.uc index c2178ff..d9e5717 100644 --- a/ServerExt/Classes/Ext_TraitFireExplode.uc +++ b/ServerExt/Classes/Ext_TraitFireExplode.uc @@ -1,10 +1,10 @@ Class Ext_TraitFireExplode extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bFireExplode = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bFireExplode = false; } diff --git a/ServerExt/Classes/Ext_TraitFireRange.uc b/ServerExt/Classes/Ext_TraitFireRange.uc index 9c6ea98..d7c0793 100644 --- a/ServerExt/Classes/Ext_TraitFireRange.uc +++ b/ServerExt/Classes/Ext_TraitFireRange.uc @@ -1,10 +1,10 @@ Class Ext_TraitFireRange extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { KFPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo).bExtraFireRange = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { KFPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo).bExtraFireRange = false; } diff --git a/ServerExt/Classes/Ext_TraitGhost.uc b/ServerExt/Classes/Ext_TraitGhost.uc index 68f23e2..e8ff092 100644 --- a/ServerExt/Classes/Ext_TraitGhost.uc +++ b/ServerExt/Classes/Ext_TraitGhost.uc @@ -1,16 +1,16 @@ Class Ext_TraitGhost extends Ext_TraitBase; -static function bool PreventDeath( KFPawn_Human Player, Controller Instigator, Class DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Controller C; - if( (Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided' ) + if((Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided') return false; // Allow normal suicide to go ahead. - if( Ext_T_GhostHelper(Data).CanResPlayer(Player,Level) ) + if(Ext_T_GhostHelper(Data).CanResPlayer(Player,Level)) { // Abort current special move - if( Player.IsDoingSpecialMove() ) + if(Player.IsDoingSpecialMove()) Player.SpecialMoveHandler.EndSpecialMove(); // Notify AI to stop hunting me. diff --git a/ServerExt/Classes/Ext_TraitGrenadeCap.uc b/ServerExt/Classes/Ext_TraitGrenadeCap.uc index dac0f82..3291be4 100644 --- a/ServerExt/Classes/Ext_TraitGrenadeCap.uc +++ b/ServerExt/Classes/Ext_TraitGrenadeCap.uc @@ -1,13 +1,13 @@ Class Ext_TraitGrenadeCap extends Ext_TraitCarryCap; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ); -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ); +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data); +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data); -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.PerkManager.SetGrenadeCap(Default.CarryAdds[Level-1]); } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.PerkManager.SetGrenadeCap(0); } diff --git a/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc b/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc index 9b66645..40cd183 100644 --- a/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc +++ b/ServerExt/Classes/Ext_TraitGrenadeSUpg.uc @@ -1,11 +1,11 @@ Class Ext_TraitGrenadeSUpg extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( Level==1 ) + if(Level==1) Perk.GrenadeClass = Perk.SuperGrenade; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.GrenadeClass = Perk.Default.GrenadeClass; } diff --git a/ServerExt/Classes/Ext_TraitGrenadeUpg.uc b/ServerExt/Classes/Ext_TraitGrenadeUpg.uc index 5191aa4..8e2d84d 100644 --- a/ServerExt/Classes/Ext_TraitGrenadeUpg.uc +++ b/ServerExt/Classes/Ext_TraitGrenadeUpg.uc @@ -1,19 +1,19 @@ Class Ext_TraitGrenadeUpg extends Ext_TraitBase; -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { - if( Lvl>=1 && Perk.CurrentLevel<50 ) + if(Lvl>=1 && Perk.CurrentLevel<50) return false; return Super.MeetsRequirements(Lvl,Perk); } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( Level==1 ) + if(Level==1) Perk.GrenadeClass = Perk.PerkGrenade; - else if( Level==2 ) + else if(Level==2) Perk.GrenadeClass = Perk.SuperGrenade; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.GrenadeClass = Perk.Default.GrenadeClass; } diff --git a/ServerExt/Classes/Ext_TraitHealthReg.uc b/ServerExt/Classes/Ext_TraitHealthReg.uc index 44a59ea..f8b669e 100644 --- a/ServerExt/Classes/Ext_TraitHealthReg.uc +++ b/ServerExt/Classes/Ext_TraitHealthReg.uc @@ -2,15 +2,15 @@ Class Ext_TraitHealthReg extends Ext_TraitBase; var array RegenValues; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_HealthRegHelp H; H = Player.Spawn(class'Ext_T_HealthRegHelp',Player); - if( H!=None ) + if(H!=None) H.RegCount = Default.RegenValues[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_HealthRegHelp H; diff --git a/ServerExt/Classes/Ext_TraitHeavyArmor.uc b/ServerExt/Classes/Ext_TraitHeavyArmor.uc index 90ab413..b341da6 100644 --- a/ServerExt/Classes/Ext_TraitHeavyArmor.uc +++ b/ServerExt/Classes/Ext_TraitHeavyArmor.uc @@ -1,17 +1,17 @@ Class Ext_TraitHeavyArmor extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bHeavyArmor = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bHeavyArmor = false; } -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( Level <= 1 ) + if(Level <= 1) return; Level == 2 ? Player.AddArmor(50) : Player.AddArmor(Player.MaxArmor); diff --git a/ServerExt/Classes/Ext_TraitKnockback.uc b/ServerExt/Classes/Ext_TraitKnockback.uc index 9c85c81..a2c286c 100644 --- a/ServerExt/Classes/Ext_TraitKnockback.uc +++ b/ServerExt/Classes/Ext_TraitKnockback.uc @@ -1,13 +1,13 @@ Class Ext_TraitKnockback extends Ext_TraitRagdoll; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).KnockbackResist = Default.ChanceValues[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).KnockbackResist = 1.f; } diff --git a/ServerExt/Classes/Ext_TraitMachineGunner.uc b/ServerExt/Classes/Ext_TraitMachineGunner.uc index 2936b02..5b275ac 100644 --- a/ServerExt/Classes/Ext_TraitMachineGunner.uc +++ b/ServerExt/Classes/Ext_TraitMachineGunner.uc @@ -9,20 +9,20 @@ static function string GetPerkDescription() return S; } -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { - if( Perk.CurrentLevel ComboSize; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkRhythmPerkBase(Perk).SetMaxRhythm(Default.ComboSize[Level-1]); } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkRhythmPerkBase(Perk).ResetRhythm(); } diff --git a/ServerExt/Classes/Ext_TraitRagdoll.uc b/ServerExt/Classes/Ext_TraitRagdoll.uc index 9c931f8..e4a60e3 100644 --- a/ServerExt/Classes/Ext_TraitRagdoll.uc +++ b/ServerExt/Classes/Ext_TraitRagdoll.uc @@ -2,14 +2,14 @@ Class Ext_TraitRagdoll extends Ext_TraitBase; var float ChanceValues[4]; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).NoRagdollChance = Default.ChanceValues[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).NoRagdollChance = 0.f; } diff --git a/ServerExt/Classes/Ext_TraitRanger.uc b/ServerExt/Classes/Ext_TraitRanger.uc index 19cd020..293d02d 100644 --- a/ServerExt/Classes/Ext_TraitRanger.uc +++ b/ServerExt/Classes/Ext_TraitRanger.uc @@ -1,10 +1,10 @@ Class Ext_TraitRanger extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSharpshooter(Perk).ZEDTimeStunPower = 4.f; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSharpshooter(Perk).ZEDTimeStunPower = 0.f; } diff --git a/ServerExt/Classes/Ext_TraitRapidAssault.uc b/ServerExt/Classes/Ext_TraitRapidAssault.uc index 92713d6..92ecb55 100644 --- a/ServerExt/Classes/Ext_TraitRapidAssault.uc +++ b/ServerExt/Classes/Ext_TraitRapidAssault.uc @@ -1,10 +1,10 @@ Class Ext_TraitRapidAssault extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSWAT(Perk).bRapidAssault = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSWAT(Perk).bRapidAssault = false; } diff --git a/ServerExt/Classes/Ext_TraitRetali.uc b/ServerExt/Classes/Ext_TraitRetali.uc index 6c6f503..65cd71a 100644 --- a/ServerExt/Classes/Ext_TraitRetali.uc +++ b/ServerExt/Classes/Ext_TraitRetali.uc @@ -1,11 +1,11 @@ Class Ext_TraitRetali extends Ext_TraitBase; -static function bool PreventDeath( KFPawn_Human Player, Controller Instigator, Class DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local ExtProj_SUPERGrenade P; P = Player.Spawn(class'ExtProj_SUPERGrenade'); - if( P!=None ) + if(P!=None) { P.bExplodeOnContact = false; // Nope! P.InstigatorController = Player.Controller; diff --git a/ServerExt/Classes/Ext_TraitSWATEnforcer.uc b/ServerExt/Classes/Ext_TraitSWATEnforcer.uc index a90bc78..ad27f11 100644 --- a/ServerExt/Classes/Ext_TraitSWATEnforcer.uc +++ b/ServerExt/Classes/Ext_TraitSWATEnforcer.uc @@ -1,20 +1,20 @@ Class Ext_TraitSWATEnforcer extends Ext_TraitBase; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).bMovesFastInZedTime = true; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).bMovesFastInZedTime = false; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bHasSWATEnforcer = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bHasSWATEnforcer = false; } diff --git a/ServerExt/Classes/Ext_TraitSirenResistance.uc b/ServerExt/Classes/Ext_TraitSirenResistance.uc index 771ca30..13be550 100644 --- a/ServerExt/Classes/Ext_TraitSirenResistance.uc +++ b/ServerExt/Classes/Ext_TraitSirenResistance.uc @@ -1,10 +1,10 @@ Class Ext_TraitSirenResistance extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bSirenResistance = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkDemolition(Perk).bSirenResistance = false; } diff --git a/ServerExt/Classes/Ext_TraitSpartan.uc b/ServerExt/Classes/Ext_TraitSpartan.uc index fea372e..659a847 100644 --- a/ServerExt/Classes/Ext_TraitSpartan.uc +++ b/ServerExt/Classes/Ext_TraitSpartan.uc @@ -2,15 +2,15 @@ Class Ext_TraitSpartan extends Ext_TraitBase; var array AtkRates; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).bMovesFastInZedTime = true; Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f/Default.AtkRates[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { - if( ExtHumanPawn(Player)!=None ) + if(ExtHumanPawn(Player)!=None) ExtHumanPawn(Player).bMovesFastInZedTime = false; Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f; } diff --git a/ServerExt/Classes/Ext_TraitSupply.uc b/ServerExt/Classes/Ext_TraitSupply.uc index b15fb03..df43e53 100644 --- a/ServerExt/Classes/Ext_TraitSupply.uc +++ b/ServerExt/Classes/Ext_TraitSupply.uc @@ -2,15 +2,15 @@ Class Ext_TraitSupply extends Ext_TraitBase; var() Texture2D SupplyIcon; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_TraitSupplyData(Data).SpawnSupplier(Player); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_TraitSupplyData(Data).RemoveSupplier(); } -static function PlayerDied( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function PlayerDied(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_TraitSupplyData(Data).RemoveSupplier(); } diff --git a/ServerExt/Classes/Ext_TraitSupplyData.uc b/ServerExt/Classes/Ext_TraitSupplyData.uc index e472d1b..01053fa 100644 --- a/ServerExt/Classes/Ext_TraitSupplyData.uc +++ b/ServerExt/Classes/Ext_TraitSupplyData.uc @@ -2,26 +2,26 @@ Class Ext_TraitSupplyData extends Ext_TraitDataStore; var Ext_T_SupplierInteract SupplyInteraction; -final function SpawnSupplier( KFPawn_Human H, optional bool bGrenades ) +final function SpawnSupplier(KFPawn_Human H, optional bool bGrenades) { - if( SupplyInteraction!=None ) + if(SupplyInteraction!=None) SupplyInteraction.Destroy(); - SupplyInteraction = Spawn( class'Ext_T_SupplierInteract', H,, H.Location, H.Rotation,, true ); - SupplyInteraction.SetBase( H ); + SupplyInteraction = Spawn(class'Ext_T_SupplierInteract', H,, H.Location, H.Rotation,, true); + SupplyInteraction.SetBase(H); SupplyInteraction.PlayerOwner = H; SupplyInteraction.PerkOwner = Perk; SupplyInteraction.bGrenades = bGrenades; - if( PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None ) + if(PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = class(TraitClass); } final function RemoveSupplier() { - if( SupplyInteraction!=None ) + if(SupplyInteraction!=None) SupplyInteraction.Destroy(); - if( PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None ) + if(PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = None; } function Destroyed() diff --git a/ServerExt/Classes/Ext_TraitSupplyGren.uc b/ServerExt/Classes/Ext_TraitSupplyGren.uc index 83e7198..10cff13 100644 --- a/ServerExt/Classes/Ext_TraitSupplyGren.uc +++ b/ServerExt/Classes/Ext_TraitSupplyGren.uc @@ -1,6 +1,6 @@ Class Ext_TraitSupplyGren extends Ext_TraitSupply; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_TraitSupplyData(Data).SpawnSupplier(Player,true); } diff --git a/ServerExt/Classes/Ext_TraitTacticalMove.uc b/ServerExt/Classes/Ext_TraitTacticalMove.uc index ffe2c99..0a9b716 100644 --- a/ServerExt/Classes/Ext_TraitTacticalMove.uc +++ b/ServerExt/Classes/Ext_TraitTacticalMove.uc @@ -1,10 +1,10 @@ Class Ext_TraitTacticalMove extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSWAT(Perk).RepTacticalMove = Level; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkSWAT(Perk).RepTacticalMove = 0; } diff --git a/ServerExt/Classes/Ext_TraitTactician.uc b/ServerExt/Classes/Ext_TraitTactician.uc index 2d689ac..3d5b5cc 100644 --- a/ServerExt/Classes/Ext_TraitTactician.uc +++ b/ServerExt/Classes/Ext_TraitTactician.uc @@ -9,29 +9,29 @@ static function string GetPerkDescription() return S; } -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if( Perk.CurrentLevel=0 ) + if(i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } return true; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkCommando(Perk).bUseProfessional = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkCommando(Perk).bUseProfessional = false; } diff --git a/ServerExt/Classes/Ext_TraitToxicDart.uc b/ServerExt/Classes/Ext_TraitToxicDart.uc index 1c6c0eb..e1b86cf 100644 --- a/ServerExt/Classes/Ext_TraitToxicDart.uc +++ b/ServerExt/Classes/Ext_TraitToxicDart.uc @@ -2,12 +2,12 @@ Class Ext_TraitToxicDart extends Ext_TraitBase; var array DartDamages; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.ToxicDartDamage = Default.DartDamages[Level-1]; Perk.bToxicDart = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bToxicDart = false; } diff --git a/ServerExt/Classes/Ext_TraitUberAmmo.uc b/ServerExt/Classes/Ext_TraitUberAmmo.uc index e9cfda1..c4c23b1 100644 --- a/ServerExt/Classes/Ext_TraitUberAmmo.uc +++ b/ServerExt/Classes/Ext_TraitUberAmmo.uc @@ -1,10 +1,10 @@ Class Ext_TraitUberAmmo extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkGunslinger(Perk).bHasUberAmmo = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkGunslinger(Perk).bHasUberAmmo = false; } diff --git a/ServerExt/Classes/Ext_TraitUnCloak.uc b/ServerExt/Classes/Ext_TraitUnCloak.uc index da18f12..65cc7b9 100644 --- a/ServerExt/Classes/Ext_TraitUnCloak.uc +++ b/ServerExt/Classes/Ext_TraitUnCloak.uc @@ -2,15 +2,15 @@ Class Ext_TraitUnCloak extends Ext_TraitBase; var array RadiusValues; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_UnCloakHelper H; H = Player.Spawn(class'Ext_T_UnCloakHelper',Player); - if( H!=None ) + if(H!=None) H.HandleRadius = Default.RadiusValues[Level-1]; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_UnCloakHelper H; diff --git a/ServerExt/Classes/Ext_TraitUnGrab.uc b/ServerExt/Classes/Ext_TraitUnGrab.uc index 17c0438..5fd8b6b 100644 --- a/ServerExt/Classes/Ext_TraitUnGrab.uc +++ b/ServerExt/Classes/Ext_TraitUnGrab.uc @@ -1,10 +1,10 @@ Class Ext_TraitUnGrab extends Ext_TraitBase; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bCanBeGrabbed = false; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.bCanBeGrabbed = true; } diff --git a/ServerExt/Classes/Ext_TraitVampire.uc b/ServerExt/Classes/Ext_TraitVampire.uc index 4359a0e..214a9a2 100644 --- a/ServerExt/Classes/Ext_TraitVampire.uc +++ b/ServerExt/Classes/Ext_TraitVampire.uc @@ -2,11 +2,11 @@ Class Ext_TraitVampire extends Ext_TraitBase; var() array RegenRate; -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkBerserker(Perk).VampRegenRate = Default.RegenRate[Level-1]; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkBerserker(Perk).VampRegenRate = 0; } diff --git a/ServerExt/Classes/Ext_TraitWeapons.uc b/ServerExt/Classes/Ext_TraitWeapons.uc index d74df01..2d7aae8 100644 --- a/ServerExt/Classes/Ext_TraitWeapons.uc +++ b/ServerExt/Classes/Ext_TraitWeapons.uc @@ -7,13 +7,13 @@ struct FLevelFX }; var array LevelEffects; -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { - if( Lvl>=3 && (Perk.CurrentLevel<50 || !HasMaxCarry(Perk)) ) + if(Lvl>=3 && (Perk.CurrentLevel<50 || !HasMaxCarry(Perk))) return false; return Super.MeetsRequirements(Lvl,Perk); } -static final function bool HasMaxCarry( Ext_PerkBase Perk ) +static final function bool HasMaxCarry(Ext_PerkBase Perk) { local int i; @@ -25,16 +25,16 @@ static function string GetPerkDescription() return Super.GetPerkDescription()$"|- Level 4 requires perk level 50 and level 3 carry capacity trait!"; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.PrimaryWeapon = None; // Give a new primary weapon. } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Perk.PrimaryWeapon = Perk.Default.PrimaryWeapon; } -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local class IC; local KFInventoryManager M; @@ -42,32 +42,32 @@ static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Leve Level = Min(Level-1,Default.LevelEffects.Length-1); M = KFInventoryManager(Player.InvManager); - if( M!=None ) + if(M!=None) M.bInfiniteWeight = true; foreach Default.LevelEffects[Level].LoadoutClasses(IC) { - if( Player.FindInventoryType(IC)==None ) + if(Player.FindInventoryType(IC)==None) { Inv = Player.CreateInventory(IC,Player.Weapon!=None); - if ( KFWeapon(Inv)!=None ) + if (KFWeapon(Inv)!=None) KFWeapon(Inv).bGivenAtStart = true; } } - if( M!=None ) + if(M!=None) M.bInfiniteWeight = false; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local class IC; local Inventory Inv; - if( Level==0 ) + if(Level==0) return; Level = Min(Level-1,Default.LevelEffects.Length-1); foreach Default.LevelEffects[Level].LoadoutClasses(IC) { Inv = Player.FindInventoryType(IC); - if( Inv!=None ) + if(Inv!=None) Inv.Destroy(); } } diff --git a/ServerExt/Classes/Ext_TraitZEDBase.uc b/ServerExt/Classes/Ext_TraitZEDBase.uc index c55ccfc..ac66cb2 100644 --- a/ServerExt/Classes/Ext_TraitZEDBase.uc +++ b/ServerExt/Classes/Ext_TraitZEDBase.uc @@ -4,19 +4,19 @@ Class Ext_TraitZEDBase extends Ext_TraitBase var class BaseTrait; var bool bIsSummoner; -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; // First check level. - if( Perk.CurrentLevel=0 ) + if(i>=0) return (Perk.PerkTraits[i].CurrentLevel>0); } return true; diff --git a/ServerExt/Classes/Ext_TraitZED_Damage.uc b/ServerExt/Classes/Ext_TraitZED_Damage.uc index 9c8f474..683e0ec 100644 --- a/ServerExt/Classes/Ext_TraitZED_Damage.uc +++ b/ServerExt/Classes/Ext_TraitZED_Damage.uc @@ -3,14 +3,14 @@ Class Ext_TraitZED_Damage extends Ext_TraitZEDBase var array DamList; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) H.SetDamageScale(Default.DamList[Level-1]); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; diff --git a/ServerExt/Classes/Ext_TraitZED_Health.uc b/ServerExt/Classes/Ext_TraitZED_Health.uc index 249f8a3..3633e0f 100644 --- a/ServerExt/Classes/Ext_TraitZED_Health.uc +++ b/ServerExt/Classes/Ext_TraitZED_Health.uc @@ -3,14 +3,14 @@ Class Ext_TraitZED_Health extends Ext_TraitZEDBase var array HPList; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) H.SetHealthScale(Default.HPList[Level-1]); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; diff --git a/ServerExt/Classes/Ext_TraitZED_Summon.uc b/ServerExt/Classes/Ext_TraitZED_Summon.uc index 8ed5662..c48c9a6 100644 --- a/ServerExt/Classes/Ext_TraitZED_Summon.uc +++ b/ServerExt/Classes/Ext_TraitZED_Summon.uc @@ -15,7 +15,7 @@ static function string GetPerkDescription() local string S; S = Super.GetPerkDescription(); - if( Default.FinalLevelPrestige>0 ) + if(Default.FinalLevelPrestige>0) S $= "|Level 6 requires prestige level: #{FF4000}"$Default.FinalLevelPrestige; return S; } @@ -24,14 +24,14 @@ static function CheckConfig() { local byte i,j; - if( Default.ZedTypes.Length==0 ) + if(Default.ZedTypes.Length==0) { Default.ZedTypes.Length = Default.DefZedTypes.Length; - for( i=0; i=5 && Perk.CurrentPrestige=5 && Perk.CurrentPrestige=0 ) + if(i>=0) return (Perk.PerkStats[i].CurrentValue>=30); } return true; } -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; local int i; H = Player.Spawn(class'Ext_T_ZEDHelper',Player); - if( H!=None ) + if(H!=None) H.CurLevel = Level-1; // Make other traits refresh (apply HP/damage scalers). - for( i=0; i0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner ) + for(i=0; i0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner) Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) - if( !H.bIsExtra ) + if(!H.bIsExtra) H.Destroy(); } @@ -115,16 +115,16 @@ static function string GetRepData() S $= IntToStr(Default.FinalLevelPrestige); return S; } -static function string ClientSetRepData( string S ) +static function string ClientSetRepData(string S) { S = Super.ClientSetRepData(S); Default.FinalLevelPrestige = StrToInt(S); return S; } -static function string GetValue( name PropName, int ElementIndex ) +static function string GetValue(name PropName, int ElementIndex) { - switch( PropName ) + switch(PropName) { case 'ZedTypes': return (ElementIndex==-1 ? string(Default.ZedTypes.Length) : Default.ZedTypes[ElementIndex]); @@ -136,12 +136,12 @@ static function string GetValue( name PropName, int ElementIndex ) return Super.GetValue(PropName,ElementIndex); } } -static function ApplyValue( name PropName, int ElementIndex, string Value ) +static function ApplyValue(name PropName, int ElementIndex, string Value) { - switch( PropName ) + switch(PropName) { case 'ZedTypes': - if( Value!="#DELETE" && ElementIndex0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner ) + for(i=0; i0 && Class(Perk.PerkTraits[i].TraitType)!=None && !Class(Perk.PerkTraits[i].TraitType).Default.bIsSummoner) Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data); } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { local Ext_T_ZEDHelper H; foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) - if( H.bIsExtra ) + if(H.bIsExtra) H.Destroy(); } -static final function AddHelperType( byte Lv, KFPawn_Human Player ) +static final function AddHelperType(byte Lv, KFPawn_Human Player) { local Ext_T_ZEDHelper H; H = Player.Spawn(class'Ext_T_ZEDHelper',Player); - if( H!=None ) + if(H!=None) { H.CurLevel = Lv; H.bIsExtra = true; diff --git a/ServerExt/Classes/Ext_TraitZedTExt.uc b/ServerExt/Classes/Ext_TraitZedTExt.uc index 184b269..4c9cc48 100644 --- a/ServerExt/Classes/Ext_TraitZedTExt.uc +++ b/ServerExt/Classes/Ext_TraitZedTExt.uc @@ -1,11 +1,11 @@ Class Ext_TraitZedTExt extends Ext_TraitBase; -static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkCommando(Perk).ZTExtCount = Level; } -static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkCommando(Perk).ZTExtCount = Level; } diff --git a/ServerExt/Classes/Ext_TraitZedative.uc b/ServerExt/Classes/Ext_TraitZedative.uc index a308988..0e56cc4 100644 --- a/ServerExt/Classes/Ext_TraitZedative.uc +++ b/ServerExt/Classes/Ext_TraitZedative.uc @@ -9,29 +9,29 @@ static function string GetPerkDescription() return S; } -static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk ) +static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) { local int i; - if( Perk.CurrentLevel=0 ) + if(i>=0) return (Perk.PerkStats[i].CurrentValue>=25); } return true; } -static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).bUseSlug = true; } -static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data ) +static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) { Ext_PerkFieldMedic(Perk).bUseSlug = false; } diff --git a/ServerExt/Classes/GUIStyleBase.uc b/ServerExt/Classes/GUIStyleBase.uc index 417c034..e48c831 100644 --- a/ServerExt/Classes/GUIStyleBase.uc +++ b/ServerExt/Classes/GUIStyleBase.uc @@ -10,42 +10,42 @@ var transient Canvas Canvas; function InitStyle() { ItemTex = Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02",class'Texture2D')); - if( ItemTex==None ) + if(ItemTex==None) ItemTex = Texture2D'EngineMaterials.DefaultWhiteGrid'; } -function RenderFramedWindow( KFGUI_FloatingWindow P ); -function RenderWindow( KFGUI_Page P ); -function RenderToolTip( KFGUI_Tooltip TT ); -function RenderButton( KFGUI_Button B ); -function RenderEditBox( KFGUI_EditBox E ); -function RenderScrollBar( KFGUI_ScrollBarBase S ); -function RenderColumnHeader( KFGUI_ColumnTop C, float XPos, float Width, int Index, bool bFocus, bool bSort ); -function RenderCheckbox( KFGUI_CheckBox C ); -function RenderComboBox( KFGUI_ComboBox C ); -function RenderComboList( KFGUI_ComboSelector C ); -function RenderRightClickMenu( KFGUI_RightClickMenu C ); +function RenderFramedWindow(KFGUI_FloatingWindow P); +function RenderWindow(KFGUI_Page P); +function RenderToolTip(KFGUI_Tooltip TT); +function RenderButton(KFGUI_Button B); +function RenderEditBox(KFGUI_EditBox E); +function RenderScrollBar(KFGUI_ScrollBarBase S); +function RenderColumnHeader(KFGUI_ColumnTop C, float XPos, float Width, int Index, bool bFocus, bool bSort); +function RenderCheckbox(KFGUI_CheckBox C); +function RenderComboBox(KFGUI_ComboBox C); +function RenderComboList(KFGUI_ComboSelector C); +function RenderRightClickMenu(KFGUI_RightClickMenu C); -function Font PickFont( byte i, out float Scaler ); -function PickDefaultFontSize( float YRes ) +function Font PickFont(byte i, out float Scaler); +function PickDefaultFontSize(float YRes) { local int XL,YL; local string S; DefaultFontSize = 0; - if( YRes>800 ) + if(YRes>800) ++DefaultFontSize; - if( YRes>1000 ) + if(YRes>1000) ++DefaultFontSize; - //if( YRes>1200 ) + //if(YRes>1200) //++DefaultFontSize; - //if( YRes>1300 ) + //if(YRes>1300) //++DefaultFontSize; S = "ABC"; PickFont(DefaultFontSize,YRes).GetStringHeightAndWidth(S,YL,XL); DefaultHeight = float(YL)*YRes; } -final function DrawText( byte Res, string S ) +final function DrawText(byte Res, string S) { local float Scale; @@ -53,9 +53,9 @@ final function DrawText( byte Res, string S ) Canvas.DrawText(S,,Scale,Scale); } -final function DrawCornerTexNU( int SizeX, int SizeY, byte Dir ) // Draw non-uniform corner. +final function DrawCornerTexNU(int SizeX, int SizeY, byte Dir) // Draw non-uniform corner. { - switch( Dir ) + switch(Dir) { case 0: // Up-left Canvas.DrawTile(ItemTex,SizeX,SizeY,77,15,-66,58); @@ -70,9 +70,9 @@ final function DrawCornerTexNU( int SizeX, int SizeY, byte Dir ) // Draw non-uni Canvas.DrawTile(ItemTex,SizeX,SizeY,11,73,66,-58); } } -final function DrawCornerTex( int Size, byte Dir ) +final function DrawCornerTex(int Size, byte Dir) { - switch( Dir ) + switch(Dir) { case 0: // Up-left Canvas.DrawTile(ItemTex,Size,Size,77,15,-66,58); @@ -87,14 +87,14 @@ final function DrawCornerTex( int Size, byte Dir ) Canvas.DrawTile(ItemTex,Size,Size,11,73,66,-58); } } -final function DrawWhiteBox( int XS, int YS ) +final function DrawWhiteBox(int XS, int YS) { Canvas.DrawTile(ItemTex,XS,YS,19,45,1,1); } -final function DrawRectBox( int X, int Y, int XS, int YS, int Edge, optional byte Extrav ) +final function DrawRectBox(int X, int Y, int XS, int YS, int Edge, optional byte Extrav) { - if( Extrav==2 ) + if(Extrav==2) Edge = Min(FMin(Edge,(XS)*0.5),YS);// Verify size. else Edge = Min(FMin(Edge,(XS)*0.5),(YS)*0.5);// Verify size. @@ -102,9 +102,9 @@ final function DrawRectBox( int X, int Y, int XS, int YS, int Edge, optional byt Canvas.SetPos(X,Y); DrawCornerTex(Edge,0); - if( Extrav<=1 ) + if(Extrav<=1) { - if( Extrav==0 ) + if(Extrav==0) { // Top right Canvas.SetPos(X+XS-Edge,Y); @@ -122,7 +122,7 @@ final function DrawRectBox( int X, int Y, int XS, int YS, int Edge, optional byt Canvas.SetPos(X+XS-Edge,Y+Edge); DrawWhiteBox(Edge,YS-Edge*2); } - else if( Extrav==1 ) + else if(Extrav==1) { // Top right Canvas.SetPos(X+XS,Y); diff --git a/ServerExt/Classes/KF2GUIController.uc b/ServerExt/Classes/KF2GUIController.uc index c9fbeb5..f660e67 100644 --- a/ServerExt/Classes/KF2GUIController.uc +++ b/ServerExt/Classes/KF2GUIController.uc @@ -19,16 +19,16 @@ var transient KFGUIConsoleHack HackConsole; var bool bMouseWasIdle,bIsInMenuState,bAbsorbInput,bIsInvalid; -static function KF2GUIController GetGUIController( PlayerController PC ) +static function KF2GUIController GetGUIController(PlayerController PC) { local KF2GUIController G; - if( PC.Player==None ) + if(PC.Player==None) return None; foreach PC.ChildActors(class'KF2GUIController',G) - if( !G.bIsInvalid ) + if(!G.bIsInvalid) break; - if( G==None ) + if(G==None) G = PC.Spawn(class'KF2GUIController',PC); return G; } @@ -43,32 +43,32 @@ simulated function PostBeginPlay() simulated function Destroyed() { - if( PlayerOwner!=None ) + if(PlayerOwner!=None) SetMenuState(false); } simulated function HandleDrawMenu() { - if( HackConsole==None ) + if(HackConsole==None) { HackConsole = new(ClientViewport)class'KFGUIConsoleHack'; HackConsole.OutputObject = Self; } - if( HackConsole!=ClientViewport.ViewportConsole ) + if(HackConsole!=ClientViewport.ViewportConsole) { OrgConsole = ClientViewport.ViewportConsole; ClientViewport.ViewportConsole = HackConsole; // Make sure nothing overrides these settings while menu is being open. PlayerOwner.PlayerInput = CustomInput; - if( !ClientViewport.bDisplayHardwareMouseCursor ) + if(!ClientViewport.bDisplayHardwareMouseCursor) { ClientViewport.bDisplayHardwareMouseCursor = true; ClientViewport.ForceUpdateMouseCursor(TRUE); } } } -simulated function RenderMenu( Canvas C ) +simulated function RenderMenu(Canvas C) { local int i; local float OrgX,OrgY,ClipX,ClipY; @@ -89,7 +89,7 @@ simulated function RenderMenu( Canvas C ) ClipX = C.ClipX; ClipY = C.ClipY; - for( i=(ActiveMenus.Length-1); i>=0; --i ) + for(i=(ActiveMenus.Length-1); i>=0; --i) { ActiveMenus[i].bWindowFocused = (i==0); ActiveMenus[i].InputPos[0] = 0.f; @@ -99,7 +99,7 @@ simulated function RenderMenu( Canvas C ) ActiveMenus[i].Canvas = C; ActiveMenus[i].PreDraw(); } - if( InputFocus!=None && InputFocus.bFocusedPostDrawItem ) + if(InputFocus!=None && InputFocus.bFocusedPostDrawItem) { InputFocus.InputPos[0] = 0.f; InputFocus.InputPos[1] = 0.f; @@ -111,26 +111,26 @@ simulated function RenderMenu( Canvas C ) C.SetOrigin(OrgX,OrgY); C.SetClip(ClipX,ClipY); - if( OrgConsole!=None ) + if(OrgConsole!=None) OrgConsole.PostRender_Console(C); OrgConsole = None; } -simulated final function SetMenuState( bool bActive ) +simulated final function SetMenuState(bool bActive) { - if( PlayerOwner.PlayerInput==None ) + if(PlayerOwner.PlayerInput==None) { NotifyLevelChange(); bActive = false; } - if( bIsInMenuState==bActive ) + if(bIsInMenuState==bActive) return; bIsInMenuState = bActive; - if( bActive ) + if(bActive) { - if( CustomInput==None ) + if(CustomInput==None) { CustomInput = new (KFPlayerController(PlayerOwner)) class'KF2GUIInput'; CustomInput.ControllerOwner = Self; @@ -146,7 +146,7 @@ simulated final function SetMenuState( bool bActive ) } else { - if( BackupInput!=None ) + if(BackupInput!=None) { PlayerOwner.PlayerInput = BackupInput; BackupInput.OnReceivedNativeInputKey = BackupInput.OnReceivedNativeInputKey; @@ -162,19 +162,19 @@ simulated function NotifyLevelChange() { local int i; - if( bIsInvalid ) + if(bIsInvalid) return; bIsInvalid = true; - if( InputFocus!=None ) + if(InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; } - for( i=(ActiveMenus.Length-1); i>=0; --i ) + for(i=(ActiveMenus.Length-1); i>=0; --i) ActiveMenus[i].NotifyLevelChange(); - for( i=(PersistentMenus.Length-1); i>=0; --i ) + for(i=(PersistentMenus.Length-1); i>=0; --i) PersistentMenus[i].NotifyLevelChange(); SetMenuState(false); @@ -184,40 +184,40 @@ simulated function MenuInput(float DeltaTime) { local int i; - if( PlayerOwner.PlayerInput==None ) + if(PlayerOwner.PlayerInput==None) { NotifyLevelChange(); return; } - if( InputFocus!=None ) + if(InputFocus!=None) InputFocus.MenuTick(DeltaTime); - for( i=0; i5.f || Abs(MousePosition.Y-OldMousePos.Y)>5.f || (bMouseWasIdle && MousePauseTime<0.5f) ) + if(Abs(MousePosition.X-OldMousePos.X)>5.f || Abs(MousePosition.Y-OldMousePos.Y)>5.f || (bMouseWasIdle && MousePauseTime<0.5f)) { - if( bMouseWasIdle ) + if(bMouseWasIdle) { bMouseWasIdle = false; - if( InputFocus!=None ) + if(InputFocus!=None) InputFocus.InputMouseMoved(); } OldMousePos = MousePosition; MousePauseTime = 0.f; } - else if( !bMouseWasIdle && (MousePauseTime+=DeltaTime)>0.5f ) + else if(!bMouseWasIdle && (MousePauseTime+=DeltaTime)>0.5f) { bMouseWasIdle = true; - if( MouseFocus!=None ) + if(MouseFocus!=None) MouseFocus.NotifyMousePaused(); } - if( ActiveMenus.Length>0 ) + if(ActiveMenus.Length>0) MenuTime+=DeltaTime; } -simulated function MouseMove( float MouseX, float MouseY ) +simulated function MouseMove(float MouseX, float MouseY) { local int i; local KFGUI_Base F; @@ -227,15 +227,15 @@ simulated function MouseMove( float MouseX, float MouseY ) MousePosition.Y = Clamp(MouseY, 0, ScreenSize.Y); // Capture mouse for GUI - if( InputFocus!=None && InputFocus.bCanFocus ) + if(InputFocus!=None && InputFocus.bCanFocus) { - if( InputFocus.CaptureMouse() ) + if(InputFocus.CaptureMouse()) { F = InputFocus.GetMouseFocus(); - if( F!=MouseFocus ) + if(F!=MouseFocus) { MousePauseTime = 0; - if( MouseFocus!=None ) + if(MouseFocus!=None) MouseFocus.MouseLeave(); MouseFocus = F; F.MouseEnter(); @@ -245,43 +245,43 @@ simulated function MouseMove( float MouseX, float MouseY ) } else { - for( i=0; i MenuClass ) +simulated function KFGUI_Page OpenMenu(class MenuClass) { local int i; local KFGUI_Page M; - if( MenuClass==None ) + if(MenuClass==None) return None; - if( KeyboardFocus!=None ) + if(KeyboardFocus!=None) GrabInputFocus(None); - if( InputFocus!=None ) + if(InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; @@ -310,12 +310,12 @@ simulated function KFGUI_Page OpenMenu( class MenuClass ) SetMenuState(true); // Check if should use pre-excisting menu. - if( MenuClass.Default.bUnique ) + if(MenuClass.Default.bUnique) { - for( i=0; i0 && ActiveMenus[i].BringPageToFront() ) // Sort it upfront. + if(i>0 && ActiveMenus[i].BringPageToFront()) // Sort it upfront. { M = ActiveMenus[i]; ActiveMenus.Remove(i,1); @@ -325,10 +325,10 @@ simulated function KFGUI_Page OpenMenu( class MenuClass ) return M; } - if( MenuClass.Default.bPersistant ) + if(MenuClass.Default.bPersistant) { - for( i=0; i MenuClass ) } M = New(None)MenuClass; - if( M==None ) // Probably abstract class. + if(M==None) // Probably abstract class. return None; i = GetFreeIndex(M.bAlwaysTop); @@ -351,109 +351,109 @@ simulated function KFGUI_Page OpenMenu( class MenuClass ) M.ShowMenu(); return M; } -simulated function CloseMenu( class MenuClass, optional bool bCloseAll ) +simulated function CloseMenu(class MenuClass, optional bool bCloseAll) { local int i; local KFGUI_Page M; - if( !bCloseAll && MenuClass==None ) + if(!bCloseAll && MenuClass==None) return; - if( KeyboardFocus!=None ) + if(KeyboardFocus!=None) GrabInputFocus(None); - if( InputFocus!=None ) + if(InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; } - for( i=(ActiveMenus.Length-1); i>=0; --i ) - if( bCloseAll || ActiveMenus[i].Class==MenuClass ) + for(i=(ActiveMenus.Length-1); i>=0; --i) + if(bCloseAll || ActiveMenus[i].Class==MenuClass) { M = ActiveMenus[i]; ActiveMenus.Remove(i,1); M.CloseMenu(); // Cache menu. - if( M.bPersistant && M.bUnique ) + if(M.bPersistant && M.bUnique) PersistentMenus[PersistentMenus.Length] = M; } - if( ActiveMenus.Length==0 ) + if(ActiveMenus.Length==0) SetMenuState(false); } -simulated function PopCloseMenu( KFGUI_Base Item ) +simulated function PopCloseMenu(KFGUI_Base Item) { local int i; local KFGUI_Page M; - if( Item==None ) + if(Item==None) return; - if( KeyboardFocus!=None ) + if(KeyboardFocus!=None) GrabInputFocus(None); - if( InputFocus!=None ) + if(InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; } - for( i=(ActiveMenus.Length-1); i>=0; --i ) - if( ActiveMenus[i]==Item ) + for(i=(ActiveMenus.Length-1); i>=0; --i) + if(ActiveMenus[i]==Item) { M = ActiveMenus[i]; ActiveMenus.Remove(i,1); M.CloseMenu(); // Cache menu. - if( M.bPersistant && M.bUnique ) + if(M.bPersistant && M.bUnique) PersistentMenus[PersistentMenus.Length] = M; break; } - if( ActiveMenus.Length==0 ) + if(ActiveMenus.Length==0) SetMenuState(false); } -simulated function BringMenuToFront( KFGUI_Page Page ) +simulated function BringMenuToFront(KFGUI_Page Page) { local int i; - if( ActiveMenus[0].bAlwaysTop && !Page.bAlwaysTop ) + if(ActiveMenus[0].bAlwaysTop && !Page.bAlwaysTop) return; // Can't override this menu. // Try to remove from current position at stack. - for( i=(ActiveMenus.Length-1); i>=0; --i ) - if( ActiveMenus[i]==Page ) + for(i=(ActiveMenus.Length-1); i>=0; --i) + if(ActiveMenus[i]==Page) { ActiveMenus.Remove(i,1); break; } - if( i==-1 ) + if(i==-1) return; // Page isn't open. // Put on front of stack. ActiveMenus.Insert(0,1); ActiveMenus[0] = Page; } -simulated final function bool MenuIsOpen( optional class MenuClass ) +simulated final function bool MenuIsOpen(optional class MenuClass) { local int i; - for( i=(ActiveMenus.Length-1); i>=0; --i ) - if( MenuClass==None || ActiveMenus[i].Class==MenuClass ) + for(i=(ActiveMenus.Length-1); i>=0; --i) + if(MenuClass==None || ActiveMenus[i].Class==MenuClass) return true; return false; } -simulated final function GrabInputFocus( KFGUI_Base Comp, optional bool bForce ) +simulated final function GrabInputFocus(KFGUI_Base Comp, optional bool bForce) { - if( Comp==KeyboardFocus && !bForce ) + if(Comp==KeyboardFocus && !bForce) return; - if( KeyboardFocus!=None ) + if(KeyboardFocus!=None) KeyboardFocus.LostKeyFocus(); - if( Comp==None ) + if(Comp==None) { OnInputKey = InternalInputKey; OnReceivedInputChar = InternalReceivedInputChar; } - else if( KeyboardFocus==None ) + else if(KeyboardFocus==None) { OnInputKey = Comp.NotifyInputKey; OnReceivedInputChar = Comp.NotifyInputChar; @@ -461,23 +461,23 @@ simulated final function GrabInputFocus( KFGUI_Base Comp, optional bool bForce ) KeyboardFocus = Comp; } -simulated final function GUI_InputMouse( bool bPressed, bool bRight ) +simulated final function GUI_InputMouse(bool bPressed, bool bRight) { local byte i; MousePauseTime = 0; - if( bPressed ) + if(bPressed) { - if( KeyboardFocus!=None && KeyboardFocus!=MouseFocus ) + if(KeyboardFocus!=None && KeyboardFocus!=MouseFocus) { GrabInputFocus(None); LastClickTimes[0] = 0; LastClickTimes[1] = 0; } - if( MouseFocus!=None ) + if(MouseFocus!=None) { - if( MouseFocus!=InputFocus && !MouseFocus.bClickable && !MouseFocus.IsTopMenu() && MouseFocus.BringPageToFront() ) + if(MouseFocus!=InputFocus && !MouseFocus.bClickable && !MouseFocus.IsTopMenu() && MouseFocus.BringPageToFront()) { BringMenuToFront(MouseFocus.GetPageTop()); LastClickTimes[0] = 0; @@ -486,7 +486,7 @@ simulated final function GUI_InputMouse( bool bPressed, bool bRight ) else { i = byte(bRight); - if( (MenuTime-LastClickTimes[i])<0.2 && Abs(LastClickPos[i].X-MousePosition.X)<5 && Abs(LastClickPos[i].Y-MousePosition.Y)<5 ) + if((MenuTime-LastClickTimes[i])<0.2 && Abs(LastClickPos[i].X-MousePosition.X)<5 && Abs(LastClickPos[i].Y-MousePosition.Y)<5) { LastClickTimes[i] = 0; MouseFocus.DoubleMouseClick(bRight); @@ -499,7 +499,7 @@ simulated final function GUI_InputMouse( bool bPressed, bool bRight ) } } } - else if( InputFocus!=None ) + else if(InputFocus!=None) { InputFocus.LostInputFocus(); InputFocus = None; @@ -509,17 +509,17 @@ simulated final function GUI_InputMouse( bool bPressed, bool bRight ) } else { - if( InputFocus!=None ) + if(InputFocus!=None) InputFocus.MouseRelease(bRight); - else if( MouseFocus!=None ) + else if(MouseFocus!=None) MouseFocus.MouseRelease(bRight); } } -simulated final function bool CheckMouse( name Key, EInputEvent Event ) +simulated final function bool CheckMouse(name Key, EInputEvent Event) { - if ( Event == IE_Pressed ) + if (Event == IE_Pressed) { - switch( Key ) + switch(Key) { case 'LeftMouseButton': GUI_InputMouse(true,false); @@ -529,9 +529,9 @@ simulated final function bool CheckMouse( name Key, EInputEvent Event ) return true; } } - else if ( Event == IE_Released ) + else if (Event == IE_Released) { - switch( Key ) + switch(Key) { case 'LeftMouseButton': GUI_InputMouse(false,false); @@ -543,21 +543,21 @@ simulated final function bool CheckMouse( name Key, EInputEvent Event ) } return false; } -simulated function bool ReceivedInputKey( int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad ) +simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad) { - if( !bIsInMenuState ) + if(!bIsInMenuState) return false; - if( !CheckMouse(Key,Event) && !OnInputKey(ControllerId,Key,Event,AmountDepressed,bGamepad) ) + if(!CheckMouse(Key,Event) && !OnInputKey(ControllerId,Key,Event,AmountDepressed,bGamepad)) { - switch( Key ) + switch(Key) { case 'Escape': - if( Event==IE_Pressed ) + if(Event==IE_Pressed) ActiveMenus[0].UserPressedEsc(); // Pop top menu if possible. return true; case 'MouseScrollDown': case 'MouseScrollUp': - if( Event==IE_Pressed && MouseFocus!=None ) + if(Event==IE_Pressed && MouseFocus!=None) MouseFocus.ScrollMouseWheel(Key=='MouseScrollUp'); return true; } @@ -565,26 +565,26 @@ simulated function bool ReceivedInputKey( int ControllerId, name Key, EInputEven } return true; } -simulated function bool ReceivedInputChar( int ControllerId, string Unicode ) +simulated function bool ReceivedInputChar(int ControllerId, string Unicode) { - if( !bIsInMenuState ) + if(!bIsInMenuState) return false; return OnReceivedInputChar(ControllerId,Unicode); } -simulated Delegate bool OnInputKey( int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad ) +simulated Delegate bool OnInputKey(int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad) { return false; } -simulated Delegate bool OnReceivedInputChar( int ControllerId, string Unicode ) +simulated Delegate bool OnReceivedInputChar(int ControllerId, string Unicode) { return false; } -simulated Delegate bool InternalInputKey( int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad ) +simulated Delegate bool InternalInputKey(int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad) { return false; } -simulated Delegate bool InternalReceivedInputChar( int ControllerId, string Unicode ) +simulated Delegate bool InternalReceivedInputChar(int ControllerId, string Unicode) { return false; } diff --git a/ServerExt/Classes/KF2GUIInput.uc b/ServerExt/Classes/KF2GUIInput.uc index fb2fa57..f1cbe54 100644 --- a/ServerExt/Classes/KF2GUIInput.uc +++ b/ServerExt/Classes/KF2GUIInput.uc @@ -4,24 +4,24 @@ class KF2GUIInput extends KFPlayerInput; var KF2GUIController ControllerOwner; var PlayerInput BaseInput; -function DrawHUD( HUD H ) +function DrawHUD(HUD H) { //ControllerOwner.RenderMenu(H.Canvas); } -function PostRender( Canvas Canvas ) +function PostRender(Canvas Canvas) { - if( ControllerOwner.bIsInMenuState ) + if(ControllerOwner.bIsInMenuState) ControllerOwner.HandleDrawMenu(); //ControllerOwner.RenderMenu(Canvas); } // Postprocess the player's input. -function PlayerInput( float DeltaTime ) +function PlayerInput(float DeltaTime) { // Do not move. ControllerOwner.MenuInput(DeltaTime); - if( !ControllerOwner.bAbsorbInput ) + if(!ControllerOwner.bAbsorbInput) { aMouseX = 0; aMouseY = 0; @@ -50,7 +50,7 @@ function PlayerInput( float DeltaTime ) } } -function PreClientTravel( string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) +function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) { ControllerOwner.BackupInput.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel); // Let original mod do stuff too! ControllerOwner.NotifyLevelChange(); // Close menu NOW! diff --git a/ServerExt/Classes/KF2GUINetwork.uc b/ServerExt/Classes/KF2GUINetwork.uc index cc53310..16d05b2 100644 --- a/ServerExt/Classes/KF2GUINetwork.uc +++ b/ServerExt/Classes/KF2GUINetwork.uc @@ -6,40 +6,40 @@ var transient KF2GUIController GUIController; var bool bLocalClient; -static function OpenMenuForClient( PlayerController PC, class Page ) +static function OpenMenuForClient(PlayerController PC, class Page) { local KF2GUINetwork G; foreach PC.ChildActors(class'KF2GUINetwork',G) break; - if( G==None ) + if(G==None) G = PC.Spawn(class'KF2GUINetwork',PC); G.ClientOpenMenu(Page); } -static function CloseMenuForClient( PlayerController PC, class Page, optional bool bCloseAll ) +static function CloseMenuForClient(PlayerController PC, class Page, optional bool bCloseAll) { local KF2GUINetwork G; foreach PC.ChildActors(class'KF2GUINetwork',G) break; - if( G==None ) + if(G==None) G = PC.Spawn(class'KF2GUINetwork',PC); G.ClientCloseMenu(Page,bCloseAll); } -simulated reliable client function ClientOpenMenu( class Page ) +simulated reliable client function ClientOpenMenu(class Page) { - if( !bLocalClient ) + if(!bLocalClient) return; - if( GUIController==None ) + if(GUIController==None) GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController.OpenMenu(Page); } -simulated reliable client function ClientCloseMenu( class Page, bool bCloseAll ) +simulated reliable client function ClientCloseMenu(class Page, bool bCloseAll) { - if( !bLocalClient ) + if(!bLocalClient) return; - if( GUIController==None ) + if(GUIController==None) GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController.CloseMenu(Page,bCloseAll); } @@ -47,10 +47,10 @@ simulated reliable client function ClientCloseMenu( class Page, bool simulated function PostBeginPlay() { PlayerOwner = PlayerController(Owner); - if( WorldInfo.NetMode==NM_Client || (PlayerOwner!=None && LocalPlayer(PlayerOwner.Player)!=None) ) + if(WorldInfo.NetMode==NM_Client || (PlayerOwner!=None && LocalPlayer(PlayerOwner.Player)!=None)) { bLocalClient = true; - if( PlayerOwner==None ) + if(PlayerOwner==None) PlayerOwner = GetALocalPlayerController(); } } diff --git a/ServerExt/Classes/KF2Style.uc b/ServerExt/Classes/KF2Style.uc index e7fef54..b9a094f 100644 --- a/ServerExt/Classes/KF2Style.uc +++ b/ServerExt/Classes/KF2Style.uc @@ -13,20 +13,20 @@ function InitStyle() LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable",class'Texture2D')); LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick",class'Texture2D')); - for( i=0; iTT.Owner.ScreenSize.X ) + if((X+TX)>TT.Owner.ScreenSize.X) X = TT.Owner.ScreenSize.X-TX; - if( (Y+TY)>TT.Owner.ScreenSize.Y ) + if((Y+TY)>TT.Owner.ScreenSize.Y) Y = TT.CompPos[1]-TY; - if( TT.CurrentAlpha<255 ) + if(TT.CurrentAlpha<255) TT.CurrentAlpha = Min(TT.CurrentAlpha+25,255); // Reset clipping. @@ -161,27 +161,27 @@ function RenderToolTip( KFGUI_Tooltip TT ) Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha); X+=TOOLTIP_BORDER; Y+=TOOLTIP_BORDER; - for( i=0; i=YP && Y<=(YP+YL) ) + if(bCheckMouse && Y>=YP && Y<=(YP+YL)) { bCheckMouse = false; C.CurrentRow = i; @@ -415,7 +415,7 @@ function RenderComboList( KFGUI_ComboSelector C ) } Canvas.SetPos(Edge,YP); - if( i==C.Combo.SelectedIndex ) + if(i==C.Combo.SelectedIndex) Canvas.DrawColor = C.Combo.SelectedTextColor; else Canvas.DrawColor = C.Combo.TextColor; @@ -424,13 +424,13 @@ function RenderComboList( KFGUI_ComboSelector C ) YP+=YL; } Canvas.PopMaskRegion(); - if( C.OldRow!=C.CurrentRow ) + if(C.OldRow!=C.CurrentRow) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); } } -function RenderRightClickMenu( KFGUI_RightClickMenu C ) +function RenderRightClickMenu(KFGUI_RightClickMenu C) { local float X,Y,YP,Edge,TextScale; local int i; @@ -457,9 +457,9 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C ) C.CurrentRow = -1; Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); - for( i=0; i=YP && Y<=(YP+DefaultHeight) ) + if(bCheckMouse && Y>=YP && Y<=(YP+DefaultHeight)) { bCheckMouse = false; C.CurrentRow = i; @@ -469,14 +469,14 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C ) } Canvas.SetPos(Edge,YP); - if( C.ItemRows[i].bSplitter ) + if(C.ItemRows[i].bSplitter) { Canvas.SetDrawColor(0,0,0,255); Canvas.DrawText("-------",,TextScale,TextScale); } else { - if( C.ItemRows[i].bDisabled ) + if(C.ItemRows[i].bDisabled) Canvas.SetDrawColor(148,148,148,255); else Canvas.SetDrawColor(248,248,248,255); Canvas.DrawText(C.ItemRows[i].Text,,TextScale,TextScale); @@ -485,16 +485,16 @@ function RenderRightClickMenu( KFGUI_RightClickMenu C ) YP+=DefaultHeight; } Canvas.PopMaskRegion(); - if( C.OldRow!=C.CurrentRow ) + if(C.OldRow!=C.CurrentRow) { C.OldRow = C.CurrentRow; C.PlayMenuSound(MN_DropdownChange); } } -function Font PickFont( byte i, out float Scaler ) +function Font PickFont(byte i, out float Scaler) { - switch( i ) + switch(i) { case 0: Scaler = 0.3; diff --git a/ServerExt/Classes/KFExtendedHUD.uc b/ServerExt/Classes/KFExtendedHUD.uc index 87194e6..7f98393 100644 --- a/ServerExt/Classes/KFExtendedHUD.uc +++ b/ServerExt/Classes/KFExtendedHUD.uc @@ -71,7 +71,7 @@ simulated function PostBeginPlay() KFPlayerOwner = KFPlayerController(Owner); OnlineSub = class'GameEngine'.static.GetOnlineSubsystem(); - if( OnlineSub!=None ) + if(OnlineSub!=None) { OnlineSub.AddOnInventoryReadCompleteDelegate(SearchInventoryForNewItem); SetTimer(60,false,'SearchInventoryForNewItem'); @@ -84,16 +84,16 @@ simulated function Destroyed() Super.Destroyed(); NotifyLevelChange(); } -simulated final function NotifyLevelChange( optional bool bMapswitch ) +simulated final function NotifyLevelChange(optional bool bMapswitch) { - if( OnlineSub!=None ) + if(OnlineSub!=None) { OnlineSub.ClearOnInventoryReadCompleteDelegate(SearchInventoryForNewItem); OnlineSub = None; } // Send to an empty stage to play the "waiting" game. - if( bMapswitch ) + if(bMapswitch) SetTimer(0.5,false,'PendingMapSwitch'); } simulated function PendingMapSwitch() @@ -106,15 +106,15 @@ simulated function PendingMapSwitch() ConsoleCommand("Open KFMainMenu?Game="$PathName(class'MS_Game')); } -final function AddKillMessage( class Victim, int Value, PlayerReplicationInfo PRI, byte Type ) +final function AddKillMessage(class Victim, int Value, PlayerReplicationInfo PRI, byte Type) { local int i; local bool bDmg,bLcl; bDmg = (Type==2); bLcl = (Type==0); - for( i=0; i Victim, int Value, PlayerReplicationI KillMessages[i].Name = GetNameOf(Victim); KillMessages[i].MsgColor = GetMsgColor(bDmg,Value); } -final function AddDeathMessage( string S, string StrippedMsg ) +final function AddDeathMessage(string S, string StrippedMsg) { DeathMessages.Insert(0,1); DeathMessages[0].Msg = S; DeathMessages[0].SMsg = StrippedMsg; DeathMessages[0].MsgTime = WorldInfo.TimeSeconds; } -final function ShowProgressMsg( string S, optional bool bDis ) +final function ShowProgressMsg(string S, optional bool bDis) { - if( S=="" ) + if(S=="") { bShowProgress = false; return; } bShowProgress = true; ParseStringIntoArray(S,ProgressLines,"|",false); - if( !bProgressDC ) + if(!bProgressDC) ProgressMsgTime = WorldInfo.TimeSeconds+4.f; bProgressDC = bDis; - if( bDis ) + if(bDis) { LocalPlayer(KFPlayerOwner.Player).ViewportClient.ViewportConsole.OutputText(Repl(S,"|","\n")); } } -static final function string GetNameOf( class Other ) +static final function string GetNameOf(class Other) { local string S; local class KFM; - if( Class(Other)!=None ) + if(Class(Other)!=None) return Class(Other).Default.ZombieName; KFM = class(Other); - if( KFM!=None && KFM.default.LocalizationKey != '' ) + if(KFM!=None && KFM.default.LocalizationKey != '') return Localize("Zeds", string(KFM.default.LocalizationKey), "KFGame"); - if( Other.Default.MenuName!="" ) + if(Other.Default.MenuName!="") return Other.Default.MenuName; S = string(Other.Name); - if( Left(S,10)~="KFPawn_Zed" ) + if(Left(S,10)~="KFPawn_Zed") S = Mid(S,10); - else if( Left(S,7)~="KFPawn_" ) + else if(Left(S,7)~="KFPawn_") S = Mid(S,7); S = Repl(S,"_"," "); return S; } -static final function string GetNameArticle( string S ) +static final function string GetNameArticle(string S) { - switch( Caps(Left(S,1)) ) // Check if a vowel, then an. + switch(Caps(Left(S,1))) // Check if a vowel, then an. { case "A": case "E": @@ -191,33 +191,33 @@ static final function string GetNameArticle( string S ) } return "a"; } -static final function string StripMsgColors( string S ) +static final function string StripMsgColors(string S) { local int i; - while( true ) + while(true) { i = InStr(S,Chr(6)); - if( i==-1 ) + if(i==-1) break; S = Left(S,i)$Mid(S,i+2); } return S; } -final function color GetMsgColor( bool bDamage, int Count ) +final function color GetMsgColor(bool bDamage, int Count) { local float T; - if( bDamage ) + if(bDamage) { - if( Count>1500 ) + if(Count>1500) return MakeColor(148,0,0,255); - else if( Count>1000 ) + else if(Count>1000) { T = (Count-1000) / 500.f; return MakeColor(148,0,0,255)*T + MakeColor(255,0,0,255)*(1.f-T); } - else if( Count>500 ) + else if(Count>500) { T = (Count-500) / 500.f; return MakeColor(255,0,0,255)*T + MakeColor(255,255,0,255)*(1.f-T); @@ -225,14 +225,14 @@ final function color GetMsgColor( bool bDamage, int Count ) T = Count / 500.f; return MakeColor(255,255,0,255)*T + MakeColor(0,255,0,255)*(1.f-T); } - if( Count>20 ) + if(Count>20) return MakeColor(255,0,0,255); - else if( Count>10 ) + else if(Count>10) { T = (Count-10) / 10.f; return MakeColor(148,0,0,255)*T + MakeColor(255,0,0,255)*(1.f-T); } - else if( Count>5 ) + else if(Count>5) { T = (Count-5) / 5.f; return MakeColor(255,0,0,255)*T + MakeColor(255,255,0,255)*(1.f-T); @@ -243,14 +243,14 @@ final function color GetMsgColor( bool bDamage, int Count ) event PostRender() { - if( GUIController!=None && PlayerOwner.PlayerInput==None ) + if(GUIController!=None && PlayerOwner.PlayerInput==None) GUIController.NotifyLevelChange(); - if( KFGRI==None ) + if(KFGRI==None) KFGRI = KFGameReplicationInfo(WorldInfo.GRI); - if( GUIController==None || GUIController.bIsInvalid ) + if(GUIController==None || GUIController.bIsInvalid) { GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); - if( GUIController!=None ) + if(GUIController!=None) GUIStyle = GUIController.CurrentStyle; } GUIStyle.Canvas = Canvas; @@ -266,41 +266,41 @@ event PostRender() PLCameraDir = vector(PLCameraRot); PLCameraDot = (PLCameraDir Dot PLCameraLoc); - if( MyCurrentPet.Length>0 ) + if(MyCurrentPet.Length>0) DrawPetInfo(); - if( EPRI==None ) + if(EPRI==None) EPRI = ExtPlayerReplicationInfo(KFPlayerOwner.PlayerReplicationInfo); - else if( EPRI.RespawnCounter>0 ) + else if(EPRI.RespawnCounter>0) DrawRespawnCounter(); bMeAdmin = (EPRI!=None && EPRI.AdminType<=1); - if( KillMessages.Length>0 ) + if(KillMessages.Length>0) RenderKillMsg(); - if( DeathMessages.Length>0 ) + if(DeathMessages.Length>0) RenderDMMessages(); - if( NewItems.Length>0 ) + if(NewItems.Length>0) DrawItemsList(); - if( bShowProgress || PlayerOwner.Player==None ) + if(bShowProgress || PlayerOwner.Player==None) { - if( ProgressMsgTime6.f ) + if(T>6.f) { KillMessages.Remove(i--,1); continue; } - if( KillMessages[i].bDamage ) + if(KillMessages[i].bDamage) S = "-"$KillMessages[i].Counter$" HP "$KillMessages[i].Name; - else if( KillMessages[i].bLocal ) + else if(KillMessages[i].bLocal) S = "+"$KillMessages[i].Counter@KillMessages[i].Name$(KillMessages[i].Counter>1 ? " kills" : " kill"); else S = (KillMessages[i].OwnerPRI!=None ? KillMessages[i].OwnerPRI.GetHumanReadableName() : "Someone")$" +"$KillMessages[i].Counter@KillMessages[i].Name$(KillMessages[i].Counter>1 ? " kills" : " kill"); Canvas.SetPos(X,Y); @@ -373,10 +373,10 @@ final function RenderDMMessages() Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc); Y = Canvas.ClipY*0.98; - for( i=0; i6.f ) + if(T>6.f) { DeathMessages.Remove(i--,1); continue; @@ -393,22 +393,22 @@ final function RenderDMMessages() // Now strip text into color tag pieces. S = DeathMessages[i].Msg; - while( true ) + while(true) { Canvas.SetPos(X,Y); j = InStr(S,Chr(6)); - if( j==-1 ) + if(j==-1) { Canvas.DrawText(S,,Sc,Sc); break; } - if( j>0 ) + if(j>0) { Canvas.DrawText(Left(S,j),,Sc,Sc); Canvas.TextSize(Left(S,j),XL,YL,Sc,Sc); X+=XL; } - switch( Mid(S,j+1,1) ) + switch(Mid(S,j+1,1)) { case "O": // Blue victim color. Canvas.SetDrawColor(32,32,255,a); @@ -430,12 +430,12 @@ final function RenderProgress() local int i; Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc); - if( bProgressDC ) + if(bProgressDC) Canvas.SetDrawColor(255,80,80,255); else Canvas.SetDrawColor(255,255,255,255); Y = Canvas.ClipY*0.2; - for( i=0; i 0.f ) + PlayerPartyInfoLocation = KFPH.Mesh.GetPosition() + (KFPH.CylinderComponent.CollisionHeight * vect(0,0,1)); + if(`TimeSince(KFPH.Mesh.LastRenderTime) < 0.2f && Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector > 0.f) { - if( DrawFriendlyHumanPlayerInfo(KFPH) ) + if(DrawFriendlyHumanPlayerInfo(KFPH)) { - VisibleHumanPlayers.AddItem( KFPH.PlayerReplicationInfo ); + VisibleHumanPlayers.AddItem(KFPH.PlayerReplicationInfo); } else { - HiddenHumanPlayers.Insert( 0, 1 ); + HiddenHumanPlayers.Insert(0, 1); HiddenHumanPlayers[0].HumanPawn = KFPH; HiddenHumanPlayers[0].HumanPRI = KFPH.PlayerReplicationInfo; } } else { - HiddenHumanPlayers.Insert( 0, 1 ); + HiddenHumanPlayers.Insert(0, 1); HiddenHumanPlayers[0].HumanPawn = KFPH; HiddenHumanPlayers[0].HumanPRI = KFPH.PlayerReplicationInfo; } @@ -536,10 +536,10 @@ function DrawHUD() } } - if( !KFGRI.bHidePawnIcons ) + if(!KFGRI.bHidePawnIcons) { // Draw hidden players - CheckAndDrawHiddenPlayerIcons( VisibleHumanPlayers, HiddenHumanPlayers ); + CheckAndDrawHiddenPlayerIcons(VisibleHumanPlayers, HiddenHumanPlayers); // Draw last remaining zeds CheckAndDrawRemainingZedIcons(); @@ -564,7 +564,7 @@ function DrawHUD() Canvas.EnableStencilTest(false); } } - else if( KFPawn_Monster(PlayerOwner.Pawn)!=None ) + else if(KFPawn_Monster(PlayerOwner.Pawn)!=None) { // Draw human health auras. DotScale = Canvas.ClipX*0.2f; @@ -572,19 +572,19 @@ function DrawHUD() { PawnLocation = KFPH.Location; - if( IsZero( PawnLocation ) ) + if(IsZero(PawnLocation)) { continue; } ThisDot = (PLCameraDir Dot PawnLocation) - PLCameraDot; - if( KFPH.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f ) + if(KFPH.IsAliveAndWell() && ThisDot>0.f && ThisDot<10000.f) { V = Canvas.Project(PawnLocation); - if( V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100) ) + if(V.X<-100 || V.X>(Canvas.SizeX+100) || V.Y<-100 || V.Y>(Canvas.SizeY+100)) continue; Canvas.DrawColor = GetHPColorScale(KFPH); - if( PlayerOwner.FastTrace(PawnLocation,PLCameraLoc) ) + if(PlayerOwner.FastTrace(PawnLocation,PLCameraLoc)) ThisDot*=1.75f; ThisDot = (DotScale/ThisDot)*350.f; Canvas.SetPos(V.X-ThisDot*0.25f,V.Y-ThisDot*0.5f); @@ -592,14 +592,14 @@ function DrawHUD() } } - if( !class'ExtPlayerController'.Default.bHideNameBeacons ) + if(!class'ExtPlayerController'.Default.bHideNameBeacons) { Canvas.EnableStencilTest(true); // Draw zed health bars. foreach WorldInfo.AllPawns(class'KFPawn_Monster', M) { ThisDot = (PLCameraDir Dot (M.Location + M.CylinderComponent.CollisionHeight * vect(0,0,1))) - PLCameraDot; - if( ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f ) + if(ThisDot>0 && ThisDot<8000.f && M.IsAliveAndWell() && M.PlayerReplicationInfo!=None && M!=PlayerOwner.Pawn && (WorldInfo.TimeSeconds - M.Mesh.LastRenderTime) < 0.4f) DrawFriendlyHUDZ(M); } Canvas.EnableStencilTest(false); @@ -607,18 +607,18 @@ function DrawHUD() } } -simulated static final function color GetHPColorScale( Pawn P ) +simulated static final function color GetHPColorScale(Pawn P) { local color C; - if( P.Health<25 ) // Red + if(P.Health<25) // Red C.R = 255; - else if( P.Health<75 ) // Yellow -> Red + else if(P.Health<75) // Yellow -> Red { C.G = (P.Health-25) * 5.1f; C.R = 255; } - else if( P.Health<100 ) // Green -> Yellow + else if(P.Health<100) // Green -> Yellow { C.G = 255; C.R = (100-P.Health) * 10.2f; @@ -627,7 +627,7 @@ simulated static final function color GetHPColorScale( Pawn P ) C.B = 25; return C; } -simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH ) +simulated function DrawFriendlyHUDZ(KFPawn_Monster KFPH) { local float Percentage; local float BarHeight, BarLength; @@ -636,7 +636,7 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH ) local float FontScale; local byte FadeAlpha; - MyFontRenderInfo = Canvas.CreateFontRenderInfo( true ); + MyFontRenderInfo = Canvas.CreateFontRenderInfo(true); FadeAlpha = DrawToDistance(KFPH); BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale; @@ -645,7 +645,7 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH ) TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 1.2; ScreenPos = Canvas.Project(TargetLocation); - if( ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY ) + if(ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY) return; //Draw health bar @@ -660,9 +660,9 @@ simulated function DrawFriendlyHUDZ( KFPawn_Monster KFPH ) Canvas.DrawColor.A = FadeAlpha; Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 2); - Canvas.DrawText( KFPH.PlayerReplicationInfo.PlayerName,,FontScale,FontScale, MyFontRenderInfo ); + Canvas.DrawText(KFPH.PlayerReplicationInfo.PlayerName,,FontScale,FontScale, MyFontRenderInfo); } -simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH ) +simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH) { local float Percentage; local float BarHeight, BarLength; @@ -679,19 +679,19 @@ simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH ) ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale; KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo); - if( KFPRI == none ) + if(KFPRI == none) { return false; } FadeAlpha = DrawToDistance(KFPH); - MyFontRenderInfo = Canvas.CreateFontRenderInfo( true ); + MyFontRenderInfo = Canvas.CreateFontRenderInfo(true); BarLength = FMin(PlayerStatusBarLengthMax * (Canvas.ClipX / 1024.f), PlayerStatusBarLengthMax) * ResModifier; BarHeight = FMin(8.f * (Canvas.ClipX / 1024.f), 8.f) * ResModifier; - TargetLocation = KFPH.Mesh.GetPosition() + ( KFPH.CylinderComponent.CollisionHeight * vect(0,0,2.5f) ); - ScreenPos = Canvas.Project( TargetLocation ); - if( ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY ) + TargetLocation = KFPH.Mesh.GetPosition() + (KFPH.CylinderComponent.CollisionHeight * vect(0,0,2.5f)); + ScreenPos = Canvas.Project(TargetLocation); + if(ScreenPos.X < 0 || ScreenPos.X > Canvas.ClipX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.ClipY) { return false; } @@ -702,19 +702,19 @@ simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH ) // drop shadow for player name text S = KFPRI.PlayerName; - if( KFPRI.bBot ) + if(KFPRI.bBot) { S = S$" (Bot)"; TextColor = KFPRI.HUDPerkColor; } - else if( KFPRI.ShowAdminName() ) // Admin info. + else if(KFPRI.ShowAdminName()) // Admin info. { S = S$" ("$KFPRI.GetAdminNameAbr()$")"; TextColor = KFPRI.GetAdminColorC(); } else TextColor = PlayerBarTextColor; - if( bMeAdmin && KFPRI.FixedData>0 ) + if(bMeAdmin && KFPRI.FixedData>0) { TextColor = MakeColor(255,0,0,255); S @= "-"$KFPRI.GetDesc(); @@ -743,7 +743,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH ) CurrentHealthColor.A = FadeAlpha; DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 2 + (36 * FontScale * ResModifier), CurrentHealthColor, FadeAlpha, true); - if( KFPRI.ECurrentPerk == None ) + if(KFPRI.ECurrentPerk == None) { return false; } @@ -781,7 +781,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo( KFPawn_Human KFPH ) return true; } -simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float BarLength, float BarHeight, float XPos, float YPos, Color BarColor, byte FadeAlpha, optional bool bDrawingHealth ) +simulated final function DrawPlayerInfoBar(KFPawn P, float BarPercentage, float BarLength, float BarHeight, float XPos, float YPos, Color BarColor, byte FadeAlpha, optional bool bDrawingHealth) { //background for status bar Canvas.DrawColor = PlayerBarBGColor; @@ -800,7 +800,7 @@ simulated final function DrawPlayerInfoBar( KFPawn P, float BarPercentage, float Canvas.SetPos(XPos, YPos); Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32); - if( bDrawingHealth && ExtHumanPawn(P) != None && P.Health0 ) + if(bDrawingHealth && ExtHumanPawn(P) != None && P.Health0) { // Draw to-regen bar. XPos+=(BarLength * BarPercentage); @@ -876,7 +876,7 @@ simulated function DrawPerkIcons(KFPawn_Human KFPH, float PerkIconSize, float Pe Canvas.DrawTile(KFPRI.ECurrentPerk.default.BasePerk.static.GetInteractIcon(), (PlayerStatusIconSize * 0.75) * ResModifier, (PlayerStatusIconSize * 0.75) * ResModifier, 0, 0, 256, 256); } } -simulated function DrawMonsterHUD( KFPawn KFPH ) +simulated function DrawMonsterHUD(KFPawn KFPH) { local float Percentage; local float BarHeight, BarLength; @@ -887,11 +887,11 @@ simulated function DrawMonsterHUD( KFPawn KFPH ) local byte FadeAlpha; PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo); - if( PRI==None ) + if(PRI==None) return; FadeAlpha = DrawToDistance(KFPH); - MyFontRenderInfo = Canvas.CreateFontRenderInfo( true ); + MyFontRenderInfo = Canvas.CreateFontRenderInfo(true); BarLength = FMin(PlayerStatusBarLengthMax * (float(Canvas.SizeX) / 1024.f), PlayerStatusBarLengthMax) * FriendlyHudScale; BarHeight = FMin(8.f * (float(Canvas.SizeX) / 1024.f), 8.f) * FriendlyHudScale; @@ -899,7 +899,7 @@ simulated function DrawMonsterHUD( KFPawn KFPH ) TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 0.8; ScreenPos = Canvas.Project(TargetLocation); - if( ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY ) + if(ScreenPos.X < 0 || ScreenPos.X > Canvas.SizeX || ScreenPos.Y < 0 || ScreenPos.Y > Canvas.SizeY) return; //Draw health bar @@ -911,7 +911,7 @@ simulated function DrawMonsterHUD( KFPawn KFPH ) Canvas.Font = class'KFGameEngine'.Static.GetKFCanvasFont(); Canvas.DrawColor = PRI.OwnerPRI==PlayerOwner.PlayerReplicationInfo ? MakeColor(32,250,32,FadeAlpha) : MakeColor(250,32,32,FadeAlpha); Canvas.SetPos(ScreenPos.X - (BarLength *0.5f), ScreenPos.Y - BarHeight * 3); - Canvas.DrawText( PRI.PlayerName,,FontScale,FontScale, MyFontRenderInfo ); + Canvas.DrawText(PRI.PlayerName,,FontScale,FontScale, MyFontRenderInfo); //draw HP icon Canvas.SetPos(ScreenPos.X - (BarLength * 0.75), ScreenPos.Y - BarHeight * 2); @@ -932,19 +932,19 @@ simulated function DrawPetInfo() Y-=(YS*MyCurrentPet.Length); Canvas.SetDrawColor(120,0,0,145); - GUIStyle.DrawRectBox( X, Y, BestPetXL * 1.04, YL, 4 ); + GUIStyle.DrawRectBox(X, Y, BestPetXL * 1.04, YL, 4); Canvas.DrawColor = MakeColor(255,255,255,255); Canvas.SetPos(X,Y); Canvas.DrawText(S,,Sc,Sc); Canvas.SetDrawColor(8,8,8,145); - GUIStyle.DrawRectBox( X, Y + YS, BestPetXL * 1.04, YL * MyCurrentPet.Length, 4 ); + GUIStyle.DrawRectBox(X, Y + YS, BestPetXL * 1.04, YL * MyCurrentPet.Length, 4); Canvas.DrawColor = MakeColor(32,250,32,255); - for( i=0; i BestPetXL ) + if(XL > BestPetXL) BestPetXL = XL; - if( YL > BestPetYL ) + if(YL > BestPetYL) BestPetYL = YL; } } @@ -967,14 +967,14 @@ function byte DrawToDistance(Actor A, optional float StartAlpha=255.f, optional local float Dist, fZoom; Dist = VSize(A.Location - PLCameraLoc); - if ( Dist <= HealthBarFullVisDist || PlayerOwner.PlayerReplicationInfo.bOnlySpectator ) + if (Dist <= HealthBarFullVisDist || PlayerOwner.PlayerReplicationInfo.bOnlySpectator) fZoom = 1.0; else fZoom = FMax(1.0 - (Dist - HealthBarFullVisDist) / (HealthBarCutoffDist - HealthBarFullVisDist), 0.0); return Clamp(StartAlpha * fZoom, MinAlpha, StartAlpha); } -final function AddNumberMsg( int Amount, vector Pos, byte Type ) +final function AddNumberMsg(int Amount, vector Pos, byte Type) { local Color C; @@ -987,27 +987,27 @@ final function AddNumberMsg( int Amount, vector Pos, byte Type ) DamagePopups[NextDamagePopupIndex].RandY = 1.0 + FRand(); C.A = 255; - if ( Type == 0 && Amount < 100 ) { + if (Type == 0 && Amount < 100) { C.R = 220; C.G = 0; C.B = 0; } - else if ( Type == 1 ) { + else if (Type == 1) { C.R = 255; C.G = 255; C.B = 25; } - else if ( Type == 2 ) { + else if (Type == 2) { C.R = 32; C.G = 240; C.B = 32; } - else if ( Amount >= 300 ) { + else if (Amount >= 300) { C.R = 0; C.G = 206; C.B = 0; } - else if ( Amount >= 100 ) { + else if (Amount >= 100) { C.R = 206; C.G = 206; C.B = 0; @@ -1019,7 +1019,7 @@ final function AddNumberMsg( int Amount, vector Pos, byte Type ) } DamagePopups[NextDamagePopupIndex].FontColor = C; - if( ++NextDamagePopupIndex >= DAMAGEPOPUP_COUNT) + if(++NextDamagePopupIndex >= DAMAGEPOPUP_COUNT) NextDamagePopupIndex=0; } @@ -1039,14 +1039,14 @@ final function DrawDamage() KFPlayerController(Owner).GetPlayerViewPoint(CameraLocation, CameraRotation); CamDir = vector(CameraRotation); - for( i=0; i < DAMAGEPOPUP_COUNT ; i++ ) + for(i=0; i < DAMAGEPOPUP_COUNT ; i++) { TimeSinceHit = WorldInfo.TimeSeconds - DamagePopups[i].HitTime; - if( TimeSinceHit > DamagePopupFadeOutTime - || ( Normal(DamagePopups[i].HitLocation - CameraLocation) dot Normal(CamDir) < 0.1 ) ) //don't draw if player faced back to the hit location + if(TimeSinceHit > DamagePopupFadeOutTime + || (Normal(DamagePopups[i].HitLocation - CameraLocation) dot Normal(CamDir) < 0.1)) //don't draw if player faced back to the hit location continue; - switch( DamagePopups[i].Type ) + switch(DamagePopups[i].Type) { case 0: // Pawn damage. S = "-"$string(DamagePopups[i].Damage); @@ -1070,15 +1070,15 @@ final function DrawDamage() x = Sin(2*Pi * TimeSinceHit/DamagePopupFadeOutTime) * TextWidth * DamagePopups[i].RandX; // odd numbers start to flying to the right side, even - left // So in situations of decapitaion player could see both damages - if ( i % 2 == 0) + if (i % 2 == 0) x *= -1.0; HBScreenPos.X += x; Canvas.DrawColor = DamagePopups[i].FontColor; Canvas.DrawColor.A = 255 * Cos(0.5*Pi * TimeSinceHit/DamagePopupFadeOutTime); - Canvas.SetPos( HBScreenPos.X, HBScreenPos.Y); - Canvas.DrawText( S ); + Canvas.SetPos(HBScreenPos.X, HBScreenPos.Y); + Canvas.DrawText(S); } } @@ -1087,14 +1087,14 @@ simulated function SearchInventoryForNewItem() { local int i,j; - if( WasNewlyAdded.Length!=OnlineSub.CurrentInventory.Length ) + if(WasNewlyAdded.Length!=OnlineSub.CurrentInventory.Length) WasNewlyAdded.Length = OnlineSub.CurrentInventory.Length; - for( i=0; i=10.f ) + if(T>=10.f) { NewItems.Remove(i--,1); continue; } - if( T>9.f ) + if(T>9.f) { T = 255.f * (10.f-T); Canvas.SetDrawColor(255,255,255,T); @@ -1153,7 +1153,7 @@ simulated final function DrawItemsList() Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale); - /*if( NewItems[i].Icon!=None ) + /*if(NewItems[i].Icon!=None) { Canvas.SetPos(XPos-YSize,YPos); Canvas.DrawRect(YSize,YSize,NewItems[i].Icon); @@ -1172,7 +1172,7 @@ simulated final function DrawItemsList() simulated function CheckForItems() { - if( KFGameReplicationInfo(WorldInfo.GRI)!=none ) + if(KFGameReplicationInfo(WorldInfo.GRI)!=none) KFGameReplicationInfo(WorldInfo.GRI).ProcessChanceDrop(); SetTimer(260+FRand()*220.f,false,'CheckForItems'); } diff --git a/ServerExt/Classes/KFGUI_Base.uc b/ServerExt/Classes/KFGUI_Base.uc index e32a69b..18d7221 100644 --- a/ServerExt/Classes/KFGUI_Base.uc +++ b/ServerExt/Classes/KFGUI_Base.uc @@ -46,20 +46,20 @@ function PreDraw() function DrawMenu(); // Draw menu now. function CloseMenu(); // Menu was closed. -function MenuTick( float DeltaTime ) +function MenuTick(float DeltaTime) { - if( bTimerActive && (TimerCounter-=DeltaTime)<=0.f ) + if(bTimerActive && (TimerCounter-=DeltaTime)<=0.f) { - if( bLoopTimer ) + if(bLoopTimer) TimerCounter = TimerRate; else bTimerActive = false; Timer(); } } -final function SetTimer( float Rate, optional bool bLoop ) +final function SetTimer(float Rate, optional bool bLoop) { bTimerActive = (Rate>0.f); - if( bTimerActive ) + if(bTimerActive) { bLoopTimer = bLoop; TimerRate = Rate; @@ -78,26 +78,26 @@ function MouseLeave() bFocused = false; OnFocus(Self,False); } -function MouseClick( bool bRight ); -function MouseRelease( bool bRight ); -function DoubleMouseClick( bool bRight ) // User rapidly double clicked this component. +function MouseClick(bool bRight); +function MouseRelease(bool bRight); +function DoubleMouseClick(bool bRight) // User rapidly double clicked this component. { MouseClick(bRight); } -function ScrollMouseWheel( bool bUp ); +function ScrollMouseWheel(bool bUp); final function PlayerController GetPlayer() { return Owner.PlayerOwner; } -function SetDisabled( bool bDisable ) +function SetDisabled(bool bDisable) { bDisabled = bDisable; } -Delegate OnFocus( KFGUI_Base Sender, bool bBecame ); +Delegate OnFocus(KFGUI_Base Sender, bool bBecame); final function ComputeCoords() { @@ -109,21 +109,21 @@ final function ComputeCoords() function bool CaptureMouse() { - return ( Owner.MousePosition.X>=CompPos[0] && Owner.MousePosition.Y>=CompPos[1] && Owner.MousePosition.X<=(CompPos[0]+CompPos[2]) && Owner.MousePosition.Y<=(CompPos[1]+CompPos[3]) ); + return (Owner.MousePosition.X>=CompPos[0] && Owner.MousePosition.Y>=CompPos[1] && Owner.MousePosition.X<=(CompPos[0]+CompPos[2]) && Owner.MousePosition.Y<=(CompPos[1]+CompPos[3])); } final function KFGUI_Base GetMouseFocus() { local KFGUI_Base M; - for( M=Self; M.MouseArea!=None; M=M.MouseArea ) + for(M=Self; M.MouseArea!=None; M=M.MouseArea) {} return M; } function DoClose() { - if( ParentComponent!=None ) + if(ParentComponent!=None) ParentComponent.DoClose(); else Owner.PopCloseMenu(Self); } @@ -135,13 +135,13 @@ function byte GetCursorStyle() function UserPressedEsc() // user pressed escape while this menu was active. { - if( ParentComponent!=None ) + if(ParentComponent!=None) ParentComponent.UserPressedEsc(); else DoClose(); } function bool BringPageToFront() { - if( ParentComponent!=None ) + if(ParentComponent!=None) return ParentComponent.BringPageToFront(); return true; // Allow user to bring this page to front. } @@ -153,32 +153,32 @@ final function KFGUI_Page GetPageTop() { local KFGUI_Base M; - for( M=Self; M.ParentComponent!=None; M=M.ParentComponent ) + for(M=Self; M.ParentComponent!=None; M=M.ParentComponent) {} return KFGUI_Page(M); } -function KFGUI_Base FindComponentID( name InID ) +function KFGUI_Base FindComponentID(name InID) { - if( ID==InID ) + if(ID==InID) return Self; return None; } -function FindAllComponentID( name InID, out array Res ) +function FindAllComponentID(name InID, out array Res) { - if( ID==InID ) + if(ID==InID) Res[Res.Length] = Self; } -function RemoveComponent( KFGUI_Base B ); +function RemoveComponent(KFGUI_Base B); function GetInputFocus() { - if( Owner.InputFocus!=None ) + if(Owner.InputFocus!=None) Owner.InputFocus.LostInputFocus(); Owner.InputFocus = Self; } function DropInputFocus() { - if( Owner.InputFocus==Self ) + if(Owner.InputFocus==Self) { Owner.InputFocus.LostInputFocus(); Owner.InputFocus = None; @@ -193,16 +193,16 @@ final function GrabKeyFocus() } final function ReleaseKeyFocus() { - if( Owner.KeyboardFocus==Self ) + if(Owner.KeyboardFocus==Self) Owner.GrabInputFocus(None); } function LostKeyFocus(); -function bool NotifyInputKey( int ControllerId, name Key, EInputEvent Event, float AmountDepressed, bool bGamepad ) +function bool NotifyInputKey(int ControllerId, name Key, EInputEvent Event, float AmountDepressed, bool bGamepad) { return false; } -function bool NotifyInputChar( int ControllerId, string Unicode ) +function bool NotifyInputChar(int ControllerId, string Unicode) { return false; } @@ -213,22 +213,22 @@ function InputMouseMoved(); // Notify any focused menu element that mouse has been idle over it. function NotifyMousePaused(); -final function GetActualPos( out float X, out float Y ) +final function GetActualPos(out float X, out float Y) { X = ((XPosition+X)*InputPos[2]) + InputPos[0]; Y = ((YPosition+Y)*InputPos[3]) + InputPos[1]; } -final function GetRealtivePos( out float X, out float Y ) +final function GetRealtivePos(out float X, out float Y) { X = X / CompPos[2]; Y = Y / CompPos[2]; } -simulated final function PlayMenuSound( EMenuSound Slot ) +simulated final function PlayMenuSound(EMenuSound Slot) { /*local SoundCue S; - switch( Slot ) + switch(Slot) { case MN_Focus: S = SoundCue'a_interface.menu.UT3MenuMouseOverCue'; @@ -252,14 +252,14 @@ simulated final function PlayMenuSound( EMenuSound Slot ) S = SoundCue'a_interface.menu.UT3MenuNavigateUpCue'; break; } - if( S!=None ) + if(S!=None) GetPlayer().PlaySound(S,true,,false);*/ } // Pre level change notification. function NotifyLevelChange(); -final function SetPosition( float X, float Y, float XS, float YS ) +final function SetPosition(float X, float Y, float XS, float YS) { XPosition = X; YPosition = Y; @@ -267,7 +267,7 @@ final function SetPosition( float X, float Y, float XS, float YS ) YSize = YS; } -static final function string MakeSortStr( int Value ) +static final function string MakeSortStr(int Value) { local string S; local int i; @@ -275,7 +275,7 @@ static final function string MakeSortStr( int Value ) // Prefix with zeroes to properly sort this string. S = string(Value); i = Len(S); - if( i<10 ) + if(i<10) return Mid("0000000000",i)$S; return S; } diff --git a/ServerExt/Classes/KFGUI_Button.uc b/ServerExt/Classes/KFGUI_Button.uc index a642930..73e4563 100644 --- a/ServerExt/Classes/KFGUI_Button.uc +++ b/ServerExt/Classes/KFGUI_Button.uc @@ -12,16 +12,16 @@ function DrawMenu() Owner.CurrentStyle.RenderButton(Self); } -function HandleMouseClick( bool bRight ) +function HandleMouseClick(bool bRight) { PlayMenuSound(MN_ClickButton); - if( bRight ) + if(bRight) OnClickRight(Self); else OnClickLeft(Self); } -Delegate OnClickLeft( KFGUI_Button Sender ); -Delegate OnClickRight( KFGUI_Button Sender ); +Delegate OnClickLeft(KFGUI_Button Sender); +Delegate OnClickRight(KFGUI_Button Sender); defaultproperties { diff --git a/ServerExt/Classes/KFGUI_Button_CD.uc b/ServerExt/Classes/KFGUI_Button_CD.uc index 729d11c..6efc17b 100644 --- a/ServerExt/Classes/KFGUI_Button_CD.uc +++ b/ServerExt/Classes/KFGUI_Button_CD.uc @@ -6,15 +6,15 @@ function DrawMenu() local byte i, FrameOpacity; FrameOpacity = 200; - if( bDisabled ) + if(bDisabled) Canvas.SetDrawColor(10, 10, 10, FrameOpacity); - else if( bPressedDown ) + else if(bPressedDown) Canvas.SetDrawColor(20, 20, 20, FrameOpacity); - else if( bFocused ) + else if(bFocused) Canvas.SetDrawColor(75, 75, 75, FrameOpacity); else Canvas.SetDrawColor(45, 45, 45, FrameOpacity); - if( bIsHighlighted ) + if(bIsHighlighted) { Canvas.DrawColor.R = Min(Canvas.DrawColor.R + 25, FrameOpacity); Canvas.DrawColor.G = Min(Canvas.DrawColor.G + 25, FrameOpacity); @@ -22,29 +22,29 @@ function DrawMenu() } Canvas.SetPos(0.f,0.f); - if( ExtravDir==255 ) + if(ExtravDir==255) Owner.CurrentStyle.DrawWhiteBox(CompPos[2],CompPos[3]); else Owner.CurrentStyle.DrawRectBox(0,0,CompPos[2],CompPos[3],Min(CompPos[2],CompPos[3])*0.2,ExtravDir); - if( OverlayTexture.Texture!=None ) + if(OverlayTexture.Texture!=None) { Canvas.SetPos(0.f,0.f); Canvas.DrawTile(OverlayTexture.Texture,CompPos[2],CompPos[3],OverlayTexture.U,OverlayTexture.V,OverlayTexture.UL,OverlayTexture.VL); } - if( ButtonText!="" ) + if(ButtonText!="") { // Chose the best font to fit this button. i = Min(FontScale+Owner.CurrentStyle.DefaultFontSize,Owner.CurrentStyle.MaxFontScale); - while( true ) + while(true) { Canvas.Font = Owner.CurrentStyle.PickFont(i,TS); Canvas.TextSize(ButtonText,XL,YL,TS,TS); - if( i==0 || (XL<(CompPos[2]*0.95) && YL<(CompPos[3]*0.95)) ) + if(i==0 || (XL<(CompPos[2]*0.95) && YL<(CompPos[3]*0.95))) break; --i; } Canvas.SetPos((CompPos[2]-XL)*0.5,(CompPos[3]-YL)*0.5); - if( bDisabled ) + if(bDisabled) Canvas.DrawColor = TextColor*0.5f; else Canvas.DrawColor = TextColor; Canvas.DrawText(ButtonText,,TS,TS,TextFontInfo); diff --git a/ServerExt/Classes/KFGUI_CheckBox.uc b/ServerExt/Classes/KFGUI_CheckBox.uc index 88e0fe0..c676e00 100644 --- a/ServerExt/Classes/KFGUI_CheckBox.uc +++ b/ServerExt/Classes/KFGUI_CheckBox.uc @@ -6,7 +6,7 @@ var() bool bForceUniform,bChecked; function UpdateSizes() { Super.UpdateSizes(); - if( bForceUniform ) + if(bForceUniform) XSize = (YSize*InputPos[3]) / InputPos[2]; } @@ -15,16 +15,16 @@ function DrawMenu() Owner.CurrentStyle.RenderCheckbox(Self); } -function HandleMouseClick( bool bRight ) +function HandleMouseClick(bool bRight) { bChecked = !bChecked; - if( bChecked ) + if(bChecked) PlayMenuSound(MN_ClickCheckboxOn); else PlayMenuSound(MN_ClickCheckboxOff); OnCheckChange(Self); } -Delegate OnCheckChange( KFGUI_CheckBox Sender ); +Delegate OnCheckChange(KFGUI_CheckBox Sender); defaultproperties { diff --git a/ServerExt/Classes/KFGUI_Clickable.uc b/ServerExt/Classes/KFGUI_Clickable.uc index 60d0979..4065f93 100644 --- a/ServerExt/Classes/KFGUI_Clickable.uc +++ b/ServerExt/Classes/KFGUI_Clickable.uc @@ -14,17 +14,17 @@ function InitMenu() Super.InitMenu(); bClickable = !bDisabled; } -function MouseClick( bool bRight ) +function MouseClick(bool bRight) { - if( !bDisabled ) + if(!bDisabled) { PressedDown[byte(bRight)] = 1; bPressedDown = true; } } -function MouseRelease( bool bRight ) +function MouseRelease(bool bRight) { - if( !bDisabled && PressedDown[byte(bRight)]==1 ) + if(!bDisabled && PressedDown[byte(bRight)]==1) { PressedDown[byte(bRight)] = 0; bPressedDown = (PressedDown[0]!=0 || PressedDown[1]!=0); @@ -34,7 +34,7 @@ function MouseRelease( bool bRight ) function MouseLeave() { Super.MouseLeave(); - if( !bDisabled ) + if(!bDisabled) PlayMenuSound(MN_LostFocus); PressedDown[0] = 0; PressedDown[1] = 0; @@ -43,11 +43,11 @@ function MouseLeave() function MouseEnter() { Super.MouseEnter(); - if( !bDisabled ) + if(!bDisabled) PlayMenuSound(MN_Focus); } -function SetDisabled( bool bDisable ) +function SetDisabled(bool bDisable) { Super.SetDisabled(bDisable); bClickable = !bDisable; @@ -58,9 +58,9 @@ function SetDisabled( bool bDisable ) function NotifyMousePaused() { - if( Owner.InputFocus==None && ToolTip!="" ) + if(Owner.InputFocus==None && ToolTip!="") { - if( ToolTipItem==None ) + if(ToolTipItem==None) { ToolTipItem = New(None)Class'KFGUI_Tooltip'; ToolTipItem.Owner = Owner; @@ -74,14 +74,14 @@ function NotifyMousePaused() ToolTipItem.GetInputFocus(); } } -final function ChangeToolTip( string S ) +final function ChangeToolTip(string S) { - if( ToolTipItem!=None ) + if(ToolTipItem!=None) ToolTipItem.SetText(S); else ToolTip = S; } -function HandleMouseClick( bool bRight ); +function HandleMouseClick(bool bRight); defaultproperties { diff --git a/ServerExt/Classes/KFGUI_ColumnList.uc b/ServerExt/Classes/KFGUI_ColumnList.uc index 895bfbc..49ddcaf 100644 --- a/ServerExt/Classes/KFGUI_ColumnList.uc +++ b/ServerExt/Classes/KFGUI_ColumnList.uc @@ -29,15 +29,15 @@ var bool bLastSortedReverse; var() bool bShouldSortList; // Should sort any new items added to the list instantly. var() bool bCanSortColumn; // Allow user to sort columns. -delegate OnSelectedRow( KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick ); +delegate OnSelectedRow(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick); -function KFGUI_ListItem AddLine( string Value, optional int iValue, optional string SortValue, optional int Index=-1 ) +function KFGUI_ListItem AddLine(string Value, optional int iValue, optional string SortValue, optional int Index=-1) { local KFGUI_ListItem N,O; local int i; // Allocate list item object. - if( UnusedItem!=None ) + if(UnusedItem!=None) { N = UnusedItem; UnusedItem = N.Next; @@ -49,27 +49,27 @@ function KFGUI_ListItem AddLine( string Value, optional int iValue, optional str N.SetValue(Value,iValue,SortValue); // Insert into list. - if( bShouldSortList && Index==-1 ) + if(bShouldSortList && Index==-1) { N.Temp = N.GetSortStr(LastSortedColumn); - if( ListCount==0 ) // No sorting needed yet. + if(ListCount==0) // No sorting needed yet. { N.Next = FirstItem; FirstItem = N; } - else if( bLastSortedReverse ) + else if(bLastSortedReverse) { - if( FirstItem.TempN.Temp ) + else if(FirstItem.Temp>N.Temp) { N.Next = FirstItem; FirstItem = N; } else { - for( O=FirstItem; O!=None; O=O.Next ) + for(O=FirstItem; O!=None; O=O.Next) { - if( O.Next==None || O.Next.Temp>N.Temp ) + if(O.Next==None || O.Next.Temp>N.Temp) { N.Next = O.Next; O.Next = N; @@ -96,9 +96,9 @@ function KFGUI_ListItem AddLine( string Value, optional int iValue, optional str } } } - else if( Index==-1 || Index>ListCount ) + else if(Index==-1 || Index>ListCount) Index = ListCount; - if( Index==0 ) + if(Index==0) { N.Next = FirstItem; FirstItem = N; @@ -106,9 +106,9 @@ function KFGUI_ListItem AddLine( string Value, optional int iValue, optional str else { i = 0; - for( O=FirstItem; O!=None; O=O.Next ) + for(O=FirstItem; O!=None; O=O.Next) { - if( (++i)==Index ) + if((++i)==Index) { N.Next = O.Next; O.Next = N; @@ -120,26 +120,26 @@ function KFGUI_ListItem AddLine( string Value, optional int iValue, optional str return N; } -final function RemoveLine( KFGUI_ListItem I ) +final function RemoveLine(KFGUI_ListItem I) { local KFGUI_ListItem N; - if( I.Index==-1 ) + if(I.Index==-1) return; // Update selected row info. - if( SelectedRowIndex==I.Index ) + if(SelectedRowIndex==I.Index) SelectedRowIndex = -1; - else if( SelectedRowIndex>I.Index ) + else if(SelectedRowIndex>I.Index) --SelectedRowIndex; // Remove from list. - if( FirstItem==I ) + if(FirstItem==I) FirstItem = I.Next; else { - for( N=FirstItem; N!=None; N=N.Next ) - if( N.Next==I ) + for(N=FirstItem; N!=None; N=N.Next) + if(N.Next==I) { N.Next = I.Next; break; @@ -157,7 +157,7 @@ final function EmptyList() { local KFGUI_ListItem N,I; - for( I=FirstItem; I!=None; I=N ) + for(I=FirstItem; I!=None; I=N) { N = I.Next; @@ -171,25 +171,25 @@ final function EmptyList() UpdateListSize(); } -final function KFGUI_ListItem GetFromIndex( int Index ) +final function KFGUI_ListItem GetFromIndex(int Index) { local KFGUI_ListItem N; - if( Index<0 || Index>=ListCount ) + if(Index<0 || Index>=ListCount) return None; - for( N=FirstItem; N!=None; N=N.Next ) - if( (Index--)==0 ) + for(N=FirstItem; N!=None; N=N.Next) + if((Index--)==0) return N; return None; } -function SortColumn( int Column, optional bool bReverse ) +function SortColumn(int Column, optional bool bReverse) { local array List; local KFGUI_ListItem Sel,N,P; local int i; - if( !bCanSortColumn || Column<0 || Column>=Columns.Length ) + if(!bCanSortColumn || Column<0 || Column>=Columns.Length) return; LastSortedColumn = Column; @@ -205,20 +205,20 @@ function SortColumn( int Column, optional bool bReverse ) SelectedRowIndex = -1; // Slow, sort it all. - for( N=FirstItem; N!=None; N=N.Next ) + for(N=FirstItem; N!=None; N=N.Next) { N.Temp = N.GetSortStr(Column); - if( bReverse ) + if(bReverse) { - for( i=0; iN.Temp ) + for(i=0; iN.Temp) break; } List.Insert(i,1); @@ -228,28 +228,28 @@ function SortColumn( int Column, optional bool bReverse ) // Rebuild list. FirstItem = None; P = None; - for( i=0; i=ListCount ) + if(SelectedRowIndex>=ListCount) SelectedRowIndex = -1; OldItemsPerFrame = ListItemsPerPage; bListSizeDirty = false; @@ -403,12 +403,12 @@ function PreDraw() CompPos[2] += SpaceX; CompPos[3] += ColumnComp.CompPos[3]; } -function InternalClickedItem( int Index, bool bRight, int MouseX, int MouseY ) +function InternalClickedItem(int Index, bool bRight, int MouseX, int MouseY) { SelectedRowIndex = Index; OnSelectedRow(GetFromIndex(Index),Index,bRight,false); } -function InternalDblClickedItem( int Index, bool bRight, int MouseX, int MouseY ) +function InternalDblClickedItem(int Index, bool bRight, int MouseX, int MouseY) { SelectedRowIndex = Index; OnSelectedRow(GetFromIndex(Index),Index,bRight,true); diff --git a/ServerExt/Classes/KFGUI_ColumnTop.uc b/ServerExt/Classes/KFGUI_ColumnTop.uc index e61acf7..51385a5 100644 --- a/ServerExt/Classes/KFGUI_ColumnTop.uc +++ b/ServerExt/Classes/KFGUI_ColumnTop.uc @@ -24,35 +24,35 @@ function DrawMenu() MinSize = ColumnMinSize / CompPos[2]; // Scale column - if( bScaleColumn ) + if(bScaleColumn) { MouseX = Owner.MousePosition.X - CompPos[0]; - for( i=0; i=(1.f-MinSize) ) + if(X>=(1.f-MinSize)) { MouseX = X-(1.f-MinSize); // Grab overshoot. // Then push back! - for( j=i; j>=0; --j ) + for(j=i; j>=0; --j) { - if( (ListOwner.Columns[j].Width-MouseX)>MinSize ) // This column has enough space to retract. + if((ListOwner.Columns[j].Width-MouseX)>MinSize) // This column has enough space to retract. { ListOwner.Columns[j].Width-=MouseX; MouseX = 0; break; } - else if( ListOwner.Columns[j].Width>MinSize ) // This column has limited space to retract. + else if(ListOwner.Columns[j].Width>MinSize) // This column has limited space to retract. { MouseX-=(ListOwner.Columns[j].Width-MinSize); ListOwner.Columns[j].Width = MinSize; @@ -66,7 +66,7 @@ function DrawMenu() // Init mouse check. MouseColumn = -1; bCheckMouse = (bClickable && bFocused); - if( bCheckMouse ) + if(bCheckMouse) { GrabWidth = CompPos[3]*0.175; MouseX = Owner.MousePosition.X - CompPos[0] - GrabWidth; @@ -76,17 +76,17 @@ function DrawMenu() // Draw the columns and compute the scalings. X = 0; j = (ListOwner.bShouldSortList ? ListOwner.LastSortedColumn : -1); - for( i=0; i=GrabWidth) && ((i+1)=CompPos[2] ) + if(X>=CompPos[2]) ListOwner.Columns[i].bHidden = true; else { @@ -116,14 +116,14 @@ function DrawMenu() } } -function MouseClick( bool bRight ) +function MouseClick(bool bRight) { - if( !ListOwner.bDisabled && bClickable ) + if(!ListOwner.bDisabled && bClickable) { PressedDown[byte(bRight)] = 1; bPressedDown = true; - if( !bRight && bMouseScaler ) + if(!bRight && bMouseScaler) { PlayMenuSound(MN_ClickButton); bScaleColumn = true; @@ -132,24 +132,24 @@ function MouseClick( bool bRight ) } } } -function MouseRelease( bool bRight ) +function MouseRelease(bool bRight) { - if( bScaleColumn && !bRight ) + if(bScaleColumn && !bRight) { bScaleColumn = false; DropInputFocus(); return; } - if( !bDisabled && bClickable && PressedDown[byte(bRight)]==1 ) + if(!bDisabled && bClickable && PressedDown[byte(bRight)]==1) { PlayMenuSound(MN_ClickButton); PressedDown[byte(bRight)] = 0; bPressedDown = (PressedDown[0]!=0 || PressedDown[1]!=0); - if( MouseColumn>=0 ) + if(MouseColumn>=0) { ListOwner.SortColumn(MouseColumn,(PrevSortedColumn==MouseColumn)); - if( PrevSortedColumn==MouseColumn ) + if(PrevSortedColumn==MouseColumn) PrevSortedColumn = -1; else PrevSortedColumn = MouseColumn; } @@ -157,14 +157,14 @@ function MouseRelease( bool bRight ) } function byte GetCursorStyle() { - if( bClickable ) + if(bClickable) return (bMouseScaler ? 2 : 1); return 0; } function MouseLeave() { Super.MouseLeave(); - if( !bScaleColumn ) + if(!bScaleColumn) { PressedDown[0] = 0; PressedDown[1] = 0; diff --git a/ServerExt/Classes/KFGUI_ComboBox.uc b/ServerExt/Classes/KFGUI_ComboBox.uc index e46bed0..12743bc 100644 --- a/ServerExt/Classes/KFGUI_ComboBox.uc +++ b/ServerExt/Classes/KFGUI_ComboBox.uc @@ -11,7 +11,7 @@ var() bool bButtonStretched; function UpdateSizes() { // Update height. - if( bScaleByFontSize ) + if(bScaleByFontSize) YSize = (TextHeight + (BorderSize*2)) / InputPos[3]; } @@ -20,10 +20,10 @@ function DrawMenu() Owner.CurrentStyle.RenderComboBox(Self); } -function HandleMouseClick( bool bRight ) +function HandleMouseClick(bool bRight) { PlayMenuSound(MN_Dropdown); - if( Selection==None ) + if(Selection==None) { Selection = New(None)Class'KFGUI_ComboSelector'; Selection.Owner = Owner; @@ -34,27 +34,27 @@ function HandleMouseClick( bool bRight ) Selection.YPosition = (CompPos[1]+CompPos[3]) / Owner.ScreenSize.Y; Selection.XSize = CompPos[2] / Owner.ScreenSize.X; Selection.YSize = (TextHeight / Owner.ScreenSize.Y) * Values.Length + ((BorderSize*2) / Owner.ScreenSize.Y); - if( (Selection.YPosition+Selection.YSize)>1.f ) + if((Selection.YPosition+Selection.YSize)>1.f) Selection.YPosition-=((Selection.YPosition+Selection.YSize)-1.f); Selection.GetInputFocus(); } final function string GetCurrent() { - if( SelectedIndex=0 ) + if(CurrentRow>=0) { Combo.SelectedIndex = CurrentRow; Combo.OnComboChanged(Combo); diff --git a/ServerExt/Classes/KFGUI_ComponentList.uc b/ServerExt/Classes/KFGUI_ComponentList.uc index 81be667..483a6bf 100644 --- a/ServerExt/Classes/KFGUI_ComponentList.uc +++ b/ServerExt/Classes/KFGUI_ComponentList.uc @@ -6,12 +6,12 @@ var() int NumColumns; var array ItemComponents; // REMEMBER to call InitMenu() on the newly created component after values are init!!! -final function KFGUI_Base AddListComponent( class CompClass, optional float XS=1.f, optional float YS=1.f ) +final function KFGUI_Base AddListComponent(class CompClass, optional float XS=1.f, optional float YS=1.f) { local KFGUI_Base G; G = new(Self)CompClass; - if( G==None ) + if(G==None) return None; G.XPosition = (1.f - XS) * 0.5f; G.YPosition = (1.f - YS) * 0.5f; @@ -52,16 +52,16 @@ function PreDraw() // Update list size i = ItemComponents.Length / NumColumns; - if( i!=NumColumns ) + if(i!=NumColumns) { ListCount = i; UpdateListVis(); } // First draw scrollbar to allow it to resize itself. - for( j=0; j<4; ++j ) + for(j=0; j<4; ++j) ScrollBar.InputPos[j] = CompPos[j]; - if( OldXSize!=InputPos[2] ) + if(OldXSize!=InputPos[2]) { OldXSize = InputPos[2]; ScrollBar.XPosition = 1.f - ScrollBar.GetWidth(); @@ -82,7 +82,7 @@ function PreDraw() YS = CompPos[3] / ListItemsPerPage; VisRange[0] = (ScrollBar.CurrentScroll*NumColumns); VisRange[1] = ItemComponents.Length; - for( i=VisRange[0]; i0.5f ) + if(XS>0.5f) XS = (1.f-XS); Canvas.DrawColor = C*(Sin(XS*2.f*Pi)*0.45f); - if( bAllSelected ) + if(bAllSelected) { Canvas.TextSize(Mid(Value,ScrollOffset),XS,YS,TextScale,TextScale); Canvas.SetPos(X,Y); @@ -53,14 +53,14 @@ function DrawMenu() } else { - if( ScrollOffset>(TypePos-4) ) + if(ScrollOffset>(TypePos-4)) ScrollOffset = Max(TypePos-4,0); Retry: Canvas.TextSize(Mid(Value,ScrollOffset,TypePos-ScrollOffset),XS,YS,TextScale,TextScale); Canvas.SetPos(X+XS,Y); - if( Canvas.CurX<(CompPos[2]-X) ) + if(Canvas.CurX<(CompPos[2]-X)) Canvas.DrawText("|",,TextScale,TextScale,TextFontInfo); else { @@ -69,11 +69,11 @@ Retry: } } } - if( Value!="" ) + if(Value!="") { Canvas.DrawColor = C; Canvas.SetPos(X,Y); - if( ScrollOffset>5 ) + if(ScrollOffset>5) ScrollOffset = Min(ScrollOffset,Len(Value)-6); DrawClippedText(Mid(Value,ScrollOffset),TextScale,CompPos[2]); @@ -84,101 +84,101 @@ Retry: } } -function bool NotifyInputKey( int ControllerId, name Key, EInputEvent Event, float AmountDepressed, bool bGamepad ) +function bool NotifyInputKey(int ControllerId, name Key, EInputEvent Event, float AmountDepressed, bool bGamepad) { - if( Owner.CheckMouse(Key,Event) ) + if(Owner.CheckMouse(Key,Event)) return true; - if( Key=='LeftControl' ) + if(Key=='LeftControl') { bHoldCtrl = (Event!=IE_Released); } - else if( Event == IE_Released ) + else if(Event == IE_Released) { - if( Key=='Escape' || Key=='Enter' ) + if(Key=='Escape' || Key=='Enter') { - if( Key=='Enter' && OnHitEnter(Self) ) + if(Key=='Enter' && OnHitEnter(Self)) return true; ReleaseKeyFocus(); } } - else if( Event==IE_Pressed || Event==IE_Repeat ) + else if(Event==IE_Pressed || Event==IE_Repeat) { - if( Key=='backspace' ) + if(Key=='backspace') { - if( bAllSelected ) + if(bAllSelected) { bTextDirty = (Value!=""); Value = ""; TypePos = 0; bAllSelected = false; } - else if( TypePos>0 ) + else if(TypePos>0) { bTextDirty = true; - if( TypePos==Len(Value) ) + if(TypePos==Len(Value)) Value = Left(Value,TypePos-1); else Value = Left(Value,TypePos-1)$Mid(Value,TypePos); --TypePos; } } - else if( Key=='delete' ) + else if(Key=='delete') { - if( bAllSelected ) + if(bAllSelected) { bTextDirty = (Value!=""); Value = ""; TypePos = 0; bAllSelected = false; } - else if( TypePosMaxTextLength ) + if((bAllSelected ? (Len(Value)+Len(S)) : Len(S))>MaxTextLength) return; bTextDirty = true; - if( bAllSelected ) + if(bAllSelected) { bAllSelected = false; Value = S; TypePos = 0; } - else if( TypePos==Len(Value) ) + else if(TypePos==Len(Value)) Value $= S; else Value = Left(Value,TypePos) $ S $ Mid(Value,TypePos); TypePos+=Len(S); } -function bool NotifyInputChar( int ControllerId, string Unicode ) +function bool NotifyInputChar(int ControllerId, string Unicode) { - if( (!bAllSelected && Len(Value)>=MaxTextLength) || (bHoldCtrl && (Unicode~="C" || Unicode~="X" || Unicode~="V")) ) + if((!bAllSelected && Len(Value)>=MaxTextLength) || (bHoldCtrl && (Unicode~="C" || Unicode~="X" || Unicode~="V"))) return true; - if( Asc(Unicode)>=32 ) // Skip system characters. + if(Asc(Unicode)>=32) // Skip system characters. { bTextDirty = true; - if( bAllSelected ) + if(bAllSelected) { bAllSelected = false; Value = Unicode; TypePos = 0; } - else if( TypePos==Len(Value) ) + else if(TypePos==Len(Value)) Value $= Unicode; else Value = Left(Value,TypePos) $ Unicode $ Mid(Value,TypePos); ++TypePos; @@ -228,12 +228,12 @@ function bool NotifyInputChar( int ControllerId, string Unicode ) return true; } -function HandleMouseClick( bool bRight ) +function HandleMouseClick(bool bRight) { PlayMenuSound(MN_ClickButton); - if( bIsTyping ) + if(bIsTyping) { - if( Value!="" ) + if(Value!="") bAllSelected = !bAllSelected; } else @@ -247,7 +247,7 @@ function HandleMouseClick( bool bRight ) function LostKeyFocus() { - if( bTextDirty ) + if(bTextDirty) { OnTextChange(Self); bTextDirty = false; diff --git a/ServerExt/Classes/KFGUI_EditControl.uc b/ServerExt/Classes/KFGUI_EditControl.uc index 9eaec0d..98d1592 100644 --- a/ServerExt/Classes/KFGUI_EditControl.uc +++ b/ServerExt/Classes/KFGUI_EditControl.uc @@ -13,7 +13,7 @@ var(Lable) bool bScaleByFontSize; // Scale this component height by font height. function InitMenu() { - if( LableString=="" ) + if(LableString=="") TextLable = None; else { @@ -37,7 +37,7 @@ function InitMenu() function UpdateSizes() { // Update height. - if( bScaleByFontSize ) + if(bScaleByFontSize) YSize = ((TextHeight*1.05) + 6) / InputPos[3]; } @@ -53,26 +53,26 @@ function PreDraw() UpdateSizes(); Super.PreDraw(); - if( TextLable!=None ) + if(TextLable!=None) { TextLable.YSize = YSize; TextLable.Canvas = Canvas; - for( i=0; i<4; ++i ) + for(i=0; i<4; ++i) TextLable.InputPos[i] = InputPos[i]; TextLable.PreDraw(); } } -final function DrawClippedText( string S, float TScale, float MaxX ) +final function DrawClippedText(string S, float TScale, float MaxX) { local int i,l; local float X,XL,YL; l = Len(S); - for( i=0; iMaxX ) + if((Canvas.CurX+X+XL)>MaxX) { --i; break; diff --git a/ServerExt/Classes/KFGUI_FloatingWindow.uc b/ServerExt/Classes/KFGUI_FloatingWindow.uc index 35a0c12..88c0e0c 100644 --- a/ServerExt/Classes/KFGUI_FloatingWindow.uc +++ b/ServerExt/Classes/KFGUI_FloatingWindow.uc @@ -16,16 +16,16 @@ function DrawMenu() { Owner.CurrentStyle.RenderFramedWindow(Self); - if( HeaderComp!=None ) + if(HeaderComp!=None) { HeaderComp.CompPos[3] = Owner.CurrentStyle.DefaultHeight; HeaderComp.YSize = HeaderComp.CompPos[3] / CompPos[3]; // Keep header height fit the window height. } } -function SetWindowDrag( bool bDrag ) +function SetWindowDrag(bool bDrag) { bDragWindow = bDrag; - if( bDrag ) + if(bDrag) { DragOffset[0] = Owner.MousePosition.X-CompPos[0]; DragOffset[1] = Owner.MousePosition.Y-CompPos[1]; @@ -33,7 +33,7 @@ function SetWindowDrag( bool bDrag ) } function bool CaptureMouse() { - if( bDragWindow && HeaderComp!=None ) // Always keep focus on window frame now! + if(bDragWindow && HeaderComp!=None) // Always keep focus on window frame now! { MouseArea = HeaderComp; return true; @@ -42,7 +42,7 @@ function bool CaptureMouse() } function PreDraw() { - if( bDragWindow ) + if(bDragWindow) { XPosition = FClamp(Owner.MousePosition.X-DragOffset[0],0,InputPos[2]-CompPos[2]) / InputPos[2]; YPosition = FClamp(Owner.MousePosition.Y-DragOffset[1],0,InputPos[3]-CompPos[3]) / InputPos[3]; diff --git a/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc b/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc index e2d0c6f..bf5aac6 100644 --- a/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc +++ b/ServerExt/Classes/KFGUI_FloatingWindowHeader.uc @@ -6,14 +6,14 @@ function PreDraw() { ComputeCoords(); } -function MouseClick( bool bRight ) +function MouseClick(bool bRight) { - if( !bRight ) + if(!bRight) KFGUI_FloatingWindow(ParentComponent).SetWindowDrag(true); } -function MouseRelease( bool bRight ) +function MouseRelease(bool bRight) { - if( !bRight ) + if(!bRight) KFGUI_FloatingWindow(ParentComponent).SetWindowDrag(false); } diff --git a/ServerExt/Classes/KFGUI_List.uc b/ServerExt/Classes/KFGUI_List.uc index 1120244..caa70a5 100644 --- a/ServerExt/Classes/KFGUI_List.uc +++ b/ServerExt/Classes/KFGUI_List.uc @@ -13,11 +13,11 @@ var transient int FocusMouseItem,LastFocusItem; var byte PressedDown[2]; var bool bPressedDown; -delegate OnDrawItem( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus ); +delegate OnDrawItem(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus); // Requires bClickable=true to receive this event. -delegate OnClickedItem( int Index, bool bRight, int MouseX, int MouseY ); -delegate OnDblClickedItem( int Index, bool bRight, int MouseX, int MouseY ); +delegate OnClickedItem(int Index, bool bRight, int MouseX, int MouseY); +delegate OnDblClickedItem(int Index, bool bRight, int MouseX, int MouseY); function InitMenu() { @@ -32,7 +32,7 @@ function DrawMenu() local float Y; local bool bCheckMouse; - if( bDrawBackground ) + if(bDrawBackground) { Canvas.DrawColor = BackgroundColor; Canvas.SetPos(0.f,0.f); @@ -42,19 +42,19 @@ function DrawMenu() // Mouse focused item check. bCheckMouse = bClickable && bFocused; FocusMouseItem = -1; - if( bCheckMouse ) + if(bCheckMouse) MouseYHit = Owner.MousePosition.Y - CompPos[1]; n = ScrollBar.CurrentScroll; ItemHeight = CompPos[3] / ListItemsPerPage; Y = 0; - for( i=0; i=ListCount ) + if(n>=ListCount) break; - if( bCheckMouse && FocusMouseItem==-1 ) + if(bCheckMouse && FocusMouseItem==-1) { - if( MouseYHit=0 ) + if(Owner.InputFocus==None && FocusMouseItem>=0) OnMouseRest(FocusMouseItem); } -Delegate OnMouseRest( int Item ); +Delegate OnMouseRest(int Item); defaultproperties { diff --git a/ServerExt/Classes/KFGUI_ListItem.uc b/ServerExt/Classes/KFGUI_ListItem.uc index 5b20a26..3229901 100644 --- a/ServerExt/Classes/KFGUI_ListItem.uc +++ b/ServerExt/Classes/KFGUI_ListItem.uc @@ -7,32 +7,32 @@ var int Index,Value; var transient string Temp; // Cache sorting key. -function SetValue( string S, int i, string SortStr ) +function SetValue(string S, int i, string SortStr) { ParseStringIntoArray(S,Columns,"\n",false); - if( SortStr=="" ) + if(SortStr=="") SortColumns.Length = 0; else ParseStringIntoArray(Caps(SortStr),SortColumns,"\n",false); Value = i; } // Return string to draw on HUD. -function string GetDisplayStr( int Column ) +function string GetDisplayStr(int Column) { - if( Column0 ) + if(SortColumns.Length>0) { - if( Column Res ) +function FindAllComponentID(name InID, out array Res) { local int i; - if( ID==InID ) + if(ID==InID) Res[Res.Length] = Self; - for( i=0; i=48 && ControllerId<=57) || ControllerId==46 ) + if((ControllerId>=48 && ControllerId<=57) || ControllerId==46) Super.NotifyInputChar(ControllerId,Unicode); return true; } diff --git a/ServerExt/Classes/KFGUI_RightClickMenu.uc b/ServerExt/Classes/KFGUI_RightClickMenu.uc index cba9a6a..089cac6 100644 --- a/ServerExt/Classes/KFGUI_RightClickMenu.uc +++ b/ServerExt/Classes/KFGUI_RightClickMenu.uc @@ -10,7 +10,7 @@ var array ItemRows; var int CurrentRow,OldRow; var int EdgeSize; -function OpenMenu( KFGUI_Base Menu ) +function OpenMenu(KFGUI_Base Menu) { Owner = Menu.Owner; InitMenu(); @@ -20,9 +20,9 @@ function OpenMenu( KFGUI_Base Menu ) ComputeSize(); XPosition = float(Owner.MousePosition.X+4) / Owner.ScreenSize.X; YPosition = float(Owner.MousePosition.Y+4) / Owner.ScreenSize.Y; - if( (XPosition+XSize)>1.f ) + if((XPosition+XSize)>1.f) YPosition = (float(Owner.MousePosition.X) / Owner.ScreenSize.X) - XSize; // Move to left side of mouse pointer. - if( (YPosition+YSize)>1.f ) + if((YPosition+YSize)>1.f) YPosition-=((YPosition+YSize)-1.f); // Move up until fit on screen. GetInputFocus(); } @@ -33,7 +33,7 @@ final function ComputeSize() local Font F; local string S; - if( ItemRows.Length==0 ) + if(ItemRows.Length==0) { YS = 0; XS = 50; @@ -43,9 +43,9 @@ final function ComputeSize() YS = Owner.CurrentStyle.DefaultHeight * ItemRows.Length; XS = 20; F = Owner.CurrentStyle.PickFont(Owner.CurrentStyle.DefaultFontSize,Scalar); - for( i=0; i=0 && (ItemRows[CurrentRow].bSplitter || ItemRows[CurrentRow].bDisabled) ) + if(CurrentRow>=0 && (ItemRows[CurrentRow].bSplitter || ItemRows[CurrentRow].bDisabled)) return; PlayMenuSound(MN_ClickButton); DropInputFocus(); - if( CurrentRow>=0 ) + if(CurrentRow>=0) OnSelectedItem(CurrentRow); } function LostInputFocus() @@ -87,8 +87,8 @@ function LostInputFocus() OnBecameHidden(Self); } -Delegate OnSelectedItem( int Index ); -Delegate OnBecameHidden( KFGUI_RightClickMenu M ); +Delegate OnSelectedItem(int Index); +Delegate OnBecameHidden(KFGUI_RightClickMenu M); defaultproperties { diff --git a/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc b/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc index 3355fdf..205c0f7 100644 --- a/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc +++ b/ServerExt/Classes/KFGUI_RightClickMenu_CD.uc @@ -27,9 +27,9 @@ function DrawMenu() CurrentRow = -1; Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY); - for( i=0; i=YP && Y<=(YP+Owner.CurrentStyle.DefaultHeight) ) + if(bCheckMouse && Y>=YP && Y<=(YP+Owner.CurrentStyle.DefaultHeight)) { bCheckMouse = false; CurrentRow = i; @@ -39,14 +39,14 @@ function DrawMenu() } Canvas.SetPos(Edge,YP); - if( ItemRows[i].bSplitter ) + if(ItemRows[i].bSplitter) { Canvas.SetDrawColor(255,255,255,255); Canvas.DrawText("-------",,TextScale,TextScale); } else { - if( ItemRows[i].bDisabled ) + if(ItemRows[i].bDisabled) Canvas.SetDrawColor(148,148,148,255); else Canvas.SetDrawColor(248,248,248,255); Canvas.DrawText(ItemRows[i].Text,,TextScale,TextScale); @@ -55,7 +55,7 @@ function DrawMenu() YP+=Owner.CurrentStyle.DefaultHeight; } Canvas.PopMaskRegion(); - if( OldRow!=CurrentRow ) + if(OldRow!=CurrentRow) { OldRow = CurrentRow; PlayMenuSound(MN_DropdownChange); diff --git a/ServerExt/Classes/KFGUI_ScrollBarBase.uc b/ServerExt/Classes/KFGUI_ScrollBarBase.uc index ad78686..cf63b13 100644 --- a/ServerExt/Classes/KFGUI_ScrollBarBase.uc +++ b/ServerExt/Classes/KFGUI_ScrollBarBase.uc @@ -12,18 +12,18 @@ var transient bool bGrabbedScroller; var bool bVertical; -final function UpdateScrollSize( int Current, int MxRange, int Stride, int StepStride ) +final function UpdateScrollSize(int Current, int MxRange, int Stride, int StepStride) { MaxRange = MxRange; ScrollStride = Stride; PageStep = StepStride; SetValue(Current); } -final function AddValue( int V ) +final function AddValue(int V) { SetValue(CurrentScroll+V); } -final function SetValue( int V ) +final function SetValue(int V) { CurrentScroll = Clamp((V / ScrollStride) * ScrollStride,0,MaxRange); OnScrollChange(Self,CurrentScroll); @@ -32,7 +32,7 @@ final function int GetValue() { return CurrentScroll; } -Delegate OnScrollChange( KFGUI_ScrollBarBase Sender, int Value ); +Delegate OnScrollChange(KFGUI_ScrollBarBase Sender, int Value); // Get UI width. function float GetWidth() @@ -43,7 +43,7 @@ function float GetWidth() function PreDraw() { // Auto scale to match width to screen size. - if( bVertical ) + if(bVertical) XSize = GetWidth(); else YSize = GetWidth(); Super.PreDraw(); @@ -52,41 +52,41 @@ function DrawMenu() { Owner.CurrentStyle.RenderScrollBar(Self); } -function MouseClick( bool bRight ) +function MouseClick(bool bRight) { - if( bRight || bDisabled ) + if(bRight || bDisabled) return; bPressedDown = true; PlayMenuSound(MN_ClickButton); - if( bVertical ) + if(bVertical) { - if( Owner.MousePosition.Y>=(CompPos[1]+ButtonOffset) && Owner.MousePosition.Y<=(CompPos[1]+ButtonOffset+SliderScale) ) // Grabbed scrollbar! + if(Owner.MousePosition.Y>=(CompPos[1]+ButtonOffset) && Owner.MousePosition.Y<=(CompPos[1]+ButtonOffset+SliderScale)) // Grabbed scrollbar! { GrabbedOffset = Owner.MousePosition.Y - (CompPos[1]+ButtonOffset); bGrabbedScroller = true; GetInputFocus(); } - else if( Owner.MousePosition.Y<(CompPos[1]+ButtonOffset) ) // Page up. + else if(Owner.MousePosition.Y<(CompPos[1]+ButtonOffset)) // Page up. AddValue(-PageStep); else AddValue(PageStep); } else { - if( Owner.MousePosition.X>=(CompPos[0]+ButtonOffset) && Owner.MousePosition.X<=(CompPos[0]+ButtonOffset+SliderScale) ) // Grabbed scrollbar! + if(Owner.MousePosition.X>=(CompPos[0]+ButtonOffset) && Owner.MousePosition.X<=(CompPos[0]+ButtonOffset+SliderScale)) // Grabbed scrollbar! { GrabbedOffset = Owner.MousePosition.X - (CompPos[0]+ButtonOffset); bGrabbedScroller = true; GetInputFocus(); } - else if( Owner.MousePosition.X<(CompPos[0]+ButtonOffset) ) // Page left. + else if(Owner.MousePosition.X<(CompPos[0]+ButtonOffset)) // Page left. AddValue(-PageStep); else AddValue(PageStep); } } -function MouseRelease( bool bRight ) +function MouseRelease(bool bRight) { - if( !bRight ) + if(!bRight) DropInputFocus(); } @@ -96,11 +96,11 @@ function LostInputFocus() bPressedDown = false; } -function ScrollMouseWheel( bool bUp ) +function ScrollMouseWheel(bool bUp) { - if( bDisabled ) + if(bDisabled) return; - if( bUp ) + if(bUp) AddValue(-ScrollStride); else AddValue(ScrollStride); } diff --git a/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc b/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc index 46c2306..af2a6ea 100644 --- a/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc +++ b/ServerExt/Classes/KFGUI_ScrollBarV_CD.uc @@ -5,27 +5,27 @@ function DrawMenu() local float A; local byte i; - if( bDisabled ) + if(bDisabled) Canvas.SetDrawColor(5, 5, 5, 0); - else if( bFocused || bGrabbedScroller ) + else if(bFocused || bGrabbedScroller) Canvas.SetDrawColor(30, 30, 30, 160); else Canvas.SetDrawColor(30, 30, 30, 160); Owner.CurrentStyle.DrawRectBox (0.f, 0.f, CompPos[2], CompPos[3], 4); - if( bDisabled ) + if(bDisabled) return; - if( bVertical ) + if(bVertical) i = 3; else i = 2; SliderScale = FMax(PageStep * (CompPos[i] - 32.f) / (MaxRange + PageStep),CalcButtonScale); - if( bGrabbedScroller ) + if(bGrabbedScroller) { // Track mouse. - if( bVertical ) + if(bVertical) A = Owner.MousePosition.Y - CompPos[1] - GrabbedOffset; else A = Owner.MousePosition.X - CompPos[0] - GrabbedOffset; @@ -36,13 +36,13 @@ function DrawMenu() A = float(CurrentScroll) / float(MaxRange); ButtonOffset = A*(CompPos[i]-SliderScale); - if( bGrabbedScroller ) + if(bGrabbedScroller) Canvas.SetDrawColor(90,90,90,255); - else if( bFocused ) + else if(bFocused) Canvas.SetDrawColor(65,65,65,255); else Canvas.SetDrawColor(40,40,40,255); - if( bVertical ) + if(bVertical) Owner.CurrentStyle.DrawRectBox (0.f, ButtonOffset, CompPos[2], SliderScale, 4); else Owner.CurrentStyle.DrawRectBox (ButtonOffset, 0.f, SliderScale, CompPos[3], 4); } diff --git a/ServerExt/Classes/KFGUI_SwitchComponent.uc b/ServerExt/Classes/KFGUI_SwitchComponent.uc index 4110946..64012c7 100644 --- a/ServerExt/Classes/KFGUI_SwitchComponent.uc +++ b/ServerExt/Classes/KFGUI_SwitchComponent.uc @@ -8,17 +8,17 @@ function PreDraw() local byte j; ComputeCoords(); - if( CurrentComponent<0 || CurrentComponent>=Components.Length ) + if(CurrentComponent<0 || CurrentComponent>=Components.Length) return; Components[CurrentComponent].Canvas = Canvas; - for( j=0; j<4; ++j ) + for(j=0; j<4; ++j) Components[CurrentComponent].InputPos[j] = CompPos[j]; Components[CurrentComponent].PreDraw(); } function bool CaptureMouse() { - if( (CurrentComponent>=0 || CurrentComponent=0 || CurrentComponent=0 && Num=0 && Num PageButtons; // Remember to call InitMenu() on the newly created page after. -final function KFGUI_Base AddPage( class PageClass, optional out KFGUI_Button Button ) +final function KFGUI_Base AddPage(class PageClass, optional out KFGUI_Button Button) { local KFGUI_Base P; local KFGUI_Base C; @@ -31,29 +31,29 @@ final function KFGUI_Base AddPage( class PageClass, optional out KFG B.OnClickRight = PageSwitched; B.IDValue = NumButtons; - if( ButtonPosition<2 ) + if(ButtonPosition<2) { B.XPosition = NumButtons*ButtonAxisSize; B.XSize = ButtonAxisSize*0.99; - if( ButtonPosition==0 ) + if(ButtonPosition==0) B.YPosition = 0.f; else B.YPosition = YSize-BorderWidth*0.99; B.YSize = BorderWidth*0.99; - if( NumButtons>0 ) + if(NumButtons>0) PageButtons[PageButtons.Length-1].ExtravDir = 1; } else { - if( ButtonPosition==2 ) + if(ButtonPosition==2) B.XPosition = 0.f; else B.XPosition = XSize-BorderWidth*0.99; B.XSize = BorderWidth*0.99; B.YPosition = NumButtons*ButtonAxisSize; B.YSize = ButtonAxisSize*0.99; - if( NumButtons>0 ) + if(NumButtons>0) PageButtons[PageButtons.Length-1].ExtravDir = 2; } @@ -64,14 +64,14 @@ final function KFGUI_Base AddPage( class PageClass, optional out KFG return P; } -function PageSwitched( KFGUI_Button Sender ) +function PageSwitched(KFGUI_Button Sender) { SelectPage(Sender.IDValue); } -final function SelectPage( int Index ) +final function SelectPage(int Index) { - if( CurrentPageNum>=0 ) + if(CurrentPageNum>=0) { PageButtons[CurrentPageNum].bIsHighlighted = false; SubPages[CurrentPageNum].CloseMenu(); @@ -79,7 +79,7 @@ final function SelectPage( int Index ) PageComponentIndex = -1; } CurrentPageNum = (Index>=0 && Index=0 ) + if(CurrentPageNum>=0) { PageButtons[CurrentPageNum].bIsHighlighted = true; SubPages[CurrentPageNum].ShowMenu(); @@ -93,20 +93,20 @@ function PreDraw() local int i; local byte j; - if( CurrentPageNum==-1 && NumButtons>0 ) + if(CurrentPageNum==-1 && NumButtons>0) SelectPage(0); ComputeCoords(); Canvas.SetOrigin(CompPos[0],CompPos[1]); Canvas.SetClip(CompPos[0]+CompPos[2],CompPos[1]+CompPos[3]); DrawMenu(); - for( i=0; i0 ) + if(j>0) { Lines[i].Text.Length = z+1; Lines[i].Text[z].S = Left(S,j); Lines[i].Text[z].C = C; ++z; } - else if( j==-1 ) + else if(j==-1) break; S = Mid(S,j+2); - if( Left(S,4)=="DEF}" ) + if(Left(S,4)=="DEF}") { C.A = 0; S = Mid(S,4); @@ -90,7 +90,7 @@ final function ParseTextLines() } OrgLines = Lines; // Create a backup. } -final function byte GrabHexValue( string S ) +final function byte GrabHexValue(string S) { local byte n; @@ -98,13 +98,13 @@ final function byte GrabHexValue( string S ) S = Mid(S,2); return n; } -final function byte HexToInt( byte n ) +final function byte HexToInt(byte n) { - if( n>=48 && n<=57 ) // '0' - '9' + if(n>=48 && n<=57) // '0' - '9' return n-48; - if( n>=65 && n<=70 ) // 'A' - 'F' + if(n>=65 && n<=70) // 'A' - 'F' return n-55; // 'A' - 10 - if( n>=97 && n<=102 ) // 'a' - 'f' + if(n>=97 && n<=102) // 'a' - 'f' return n-87; // 'a' - 10 return 0; } @@ -116,7 +116,7 @@ function InitSize() OldSize[0] = CompPos[2]; OldSize[1] = CompPos[3]; - if( !bTextParsed ) + if(!bTextParsed) { ParseTextLines(); bTextParsed = true; @@ -135,9 +135,9 @@ function InitSize() bClickable = bShowScrollbar; bCanFocus = bShowScrollbar; - if( bShowScrollbar ) + if(bShowScrollbar) { - if( ScrollBar==None ) + if(ScrollBar==None) { ScrollBar = new(Self) class'KFGUI_ScrollBarV'; ScrollBar.SetPosition(0.9,0.0,0.1,1.0); @@ -147,7 +147,7 @@ function InitSize() } // Compute scrollbar size and X-position. - for( i=0; i<4; ++i ) + for(i=0; i<4; ++i) ScrollBar.InputPos[i] = CompPos[i]; ScrollWidth = ScrollBar.GetWidth(); ScrollBar.XPosition = 1.f - ScrollWidth; @@ -159,31 +159,31 @@ function InitSize() Lines = OrgLines; ParseLines((CompPos[2]-ScrollWidth) / InitFontScale); - if( Components.Find(ScrollBar)==-1 ) + if(Components.Find(ScrollBar)==-1) Components.AddItem(ScrollBar); MaxHeight = (Lines.Length * TextHeight); ScrollBar.UpdateScrollSize(0,Max(((MaxHeight-CompPos[3])/TextHeight)+1,1),1,1); } - else if( ScrollBar!=None ) + else if(ScrollBar!=None) Components.RemoveItem(ScrollBar); } // Parse textlines to see if they're too long. -final function ParseLines( float ClipX ) +final function ParseLines(float ClipX) { local float X,XS,YS; local int i,j,z,n; - for( i=0; iClipX ) + if((X+XS)>ClipX) { z = FindSplitPoint(Lines[i].Text[j].S,X,ClipX); @@ -191,7 +191,7 @@ final function ParseLines( float ClipX ) Lines.Insert(i+1,1); // Append the remaining lines there. - for( n=j; nClipX ) // Split here if possible. + if(X>ClipX) // Split here if possible. { - if( PrevWord==0 ) + if(PrevWord==0) return (bStartedZero ? i : 0); // No wrap. return PrevWord; } @@ -254,9 +254,9 @@ final function int FindSplitPoint( string S, float X, float ClipX ) } return l; } -final function string StripWhiteSpaces( string S ) +final function string StripWhiteSpaces(string S) { - if( Left(S,1)==" " ) + if(Left(S,1)==" ") S = Mid(S,1); return S; } @@ -271,36 +271,36 @@ function DrawMenu() local int i,j; local float Y; - if( Text=="" ) + if(Text=="") return; // Need to figure out best fitting font. - if( OldSize[0]!=CompPos[2] || OldSize[1]!=CompPos[3] ) + if(OldSize[0]!=CompPos[2] || OldSize[1]!=CompPos[3]) InitSize(); Canvas.Font = InitFont; - if( bShowScrollbar ) + if(bShowScrollbar) { Canvas.SetClip(CompPos[0]+(CompPos[2]-ScrollWidth),CompPos[1]+CompPos[3]); i = ScrollBar.GetValue(); } else i = 0; - if( i=CompPos[3] ) + if((Lines[i].Y-Y+TextHeight)>=CompPos[3]) break; - for( j=0; jOwner.ScreenSize.X ) + if((X+TX)>Owner.ScreenSize.X) X = Owner.ScreenSize.X-TX; - if( (Y+TY)>Owner.ScreenSize.Y ) + if((Y+TY)>Owner.ScreenSize.Y) Y = CompPos[1]-TY; - if( CurrentAlpha<255 ) + if(CurrentAlpha<255) CurrentAlpha = Min(CurrentAlpha+25,255); // Reset clipping. @@ -54,7 +54,7 @@ function PreDraw() Canvas.SetDrawColor(255,255,255,CurrentAlpha); X+=KF2Style(Owner.CurrentStyle).TOOLTIP_BORDER; Y+=KF2Style(Owner.CurrentStyle).TOOLTIP_BORDER; - for( i=0; i GameClass); -simulated function HandleNetworkError( bool bConnectionLost ) +simulated function HandleNetworkError(bool bConnectionLost) { ConsoleCommand("Disconnect"); } -event PlayerTick( float DeltaTime ) +event PlayerTick(float DeltaTime) { - if( ConnectionCounter<3 && ++ConnectionCounter==3 ) + if(ConnectionCounter<3 && ++ConnectionCounter==3) { - if( TravelData.PendingURL!="" ) + if(TravelData.PendingURL!="") { MS_HUD(myHUD).ShowProgressMsg("Connecting to "$TravelData.PendingURL); ConsoleCommand("Open "$TravelData.PendingURL); } - if( TravelData.PendingSong!=None ) + if(TravelData.PendingSong!=None) StartMusicTrack(TravelData.PendingSong); // Reset all cached data. @@ -31,18 +31,18 @@ event PlayerTick( float DeltaTime ) MS_HUD(myHUD).ActiveGame.UpdateMouse(PlayerInput.aTurn,PlayerInput.aLookUp); } -simulated final function StartMusicTrack( SoundCue Music ) +simulated final function StartMusicTrack(SoundCue Music) { local AudioComponent A; - if( WorldInfo.MusicComp!=None ) + if(WorldInfo.MusicComp!=None) { WorldInfo.MusicComp.FadeOut(WorldInfo.CurrentMusicTrack.FadeOutTime,WorldInfo.CurrentMusicTrack.FadeOutVolumeLevel); WorldInfo.MusicComp = None; } Music.SoundClass = 'Music'; // Force music group for this. A = WorldInfo.CreateAudioComponent(Music,false,false,false,,false); - if( A!=None ) + if(A!=None) { // update the new component with the correct settings A.bAutoDestroy = true; @@ -50,7 +50,7 @@ simulated final function StartMusicTrack( SoundCue Music ) A.bIsMusic = true; A.bAutoPlay = true; A.bIgnoreForFlushing = false; - A.FadeIn( 0.25, 1.f ); + A.FadeIn(0.25, 1.f); } WorldInfo.MusicComp = A; WorldInfo.CurrentMusicTrack.TheSoundCue = Music; @@ -60,7 +60,7 @@ simulated final function StartMusicTrack( SoundCue Music ) final function AbortConnection() { - if( bConnectionFailed ) + if(bConnectionFailed) HandleNetworkError(false); else { @@ -69,11 +69,11 @@ final function AbortConnection() } } -reliable client event TeamMessage( PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime ); +reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime ); -reliable client event bool ShowConnectionProgressPopup( EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false) +reliable client event bool ShowConnectionProgressPopup(EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false) { - if( bConnectionFailed ) + if(bConnectionFailed) return false; switch(ProgressType) { @@ -91,9 +91,9 @@ reliable client event bool ShowConnectionProgressPopup( EProgressMessageType Pro return false; } -exec function CustomStartFire( optional byte FireModeNum ) +exec function CustomStartFire(optional byte FireModeNum) { - if( !MS_HUD(myHUD).ActiveGame.bGameStarted ) + if(!MS_HUD(myHUD).ActiveGame.bGameStarted) MS_HUD(myHUD).ActiveGame.StartGame(); } @@ -110,7 +110,7 @@ auto state PlayerWaiting { ignores SeePlayer, HearNoise, NotifyBump, TakeDamage, PhysicsVolumeChange, NextWeapon, PrevWeapon, SwitchToBestWeapon; - reliable server function ServerChangeTeam( int N ); + reliable server function ServerChangeTeam(int N); reliable server function ServerRestartPlayer(); diff --git a/ServerExt/Classes/MS_TMPUI.uc b/ServerExt/Classes/MS_TMPUI.uc index 90db59d..70dc35d 100644 --- a/ServerExt/Classes/MS_TMPUI.uc +++ b/ServerExt/Classes/MS_TMPUI.uc @@ -9,7 +9,7 @@ static final function Apply() local MS_TMPUI T; G = class'Engine'.Static.GetEngine().GameViewport; - if( MS_TMPUI(G.UIController)!=None ) + if(MS_TMPUI(G.UIController)!=None) return; T = new(G)class'MS_TMPUI'; T.RealUI = G.UIController; @@ -23,7 +23,7 @@ static final function Remove() G = class'Engine'.Static.GetEngine().GameViewport; T = MS_TMPUI(G.UIController); - if( T==None ) + if(T==None) return; G.UIController = T.RealUI; } diff --git a/ServerExt/Classes/MX_MiniGameBase.uc b/ServerExt/Classes/MX_MiniGameBase.uc index 8bf85d2..dbed7df 100644 --- a/ServerExt/Classes/MX_MiniGameBase.uc +++ b/ServerExt/Classes/MX_MiniGameBase.uc @@ -10,16 +10,16 @@ var bool bGameStarted; function Init() { - if( Sensitivity==0 ) + if(Sensitivity==0) { Sensitivity = 1; SaveConfig(); } } -function AdjustSensitivity( bool bUp ) +function AdjustSensitivity(bool bUp) { - if( bUp ) + if(bUp) Sensitivity = FMin(Sensitivity+0.05,3.f); else Sensitivity = FMax(Sensitivity-0.05,0.05f); SetTimer(2,false,'DelayedSaveConfig',Self); @@ -30,21 +30,21 @@ final function DelayedSaveConfig() SaveConfig(); } -function SetFXTrack( Object O ); +function SetFXTrack(Object O); function StartGame() { bGameStarted = true; } -function Render( float XPos, float YPos, float XSize, float YSize ); +function Render(float XPos, float YPos, float XSize, float YSize); -function SetMouse( float X, float Y ); -function UpdateMouse( float X, float Y ); +function SetMouse(float X, float Y); +function UpdateMouse(float X, float Y); -function Tick( float Delta ); +function Tick(float Delta); -final function bool Box8DirTrace( vector Start, vector Dir, vector HitTest, vector Ext, vector ExtB, out vector HitNorm, out float HitTime ) // free movement trace. +final function bool Box8DirTrace(vector Start, vector Dir, vector HitTest, vector Ext, vector ExtB, out vector HitNorm, out float HitTime) // free movement trace. { local vector V; local float tmin,tmax,tymin,tymax,tmp; @@ -54,20 +54,20 @@ final function bool Box8DirTrace( vector Start, vector Dir, vector HitTest, vect Ext+=ExtB; // AABB check if start inside box. - if( Abs(V.X)Normal2D(ExtB).Y ) + if(Abs(V.X)>Normal2D(ExtB).Y) { - if( V.X<0 ) + if(V.X<0) HitNorm = vect(1,0,0); else HitNorm = vect(-1,0,0); } - else if( V.Y<0 ) + else if(V.Y<0) HitNorm = vect(0,1,0); else HitNorm = vect(0,-1,0); @@ -80,7 +80,7 @@ final function bool Box8DirTrace( vector Start, vector Dir, vector HitTest, vect tmin = (V.X - Ext.X) * tmp; tmax = (V.X + Ext.X) * tmp; - if( tmin > tmax ) + if(tmin > tmax) { tmp = tmax; tmax = tmin; @@ -99,7 +99,7 @@ final function bool Box8DirTrace( vector Start, vector Dir, vector HitTest, vect } // Fully missed. - if( (tmin > tymax) || (tymin > tmax) ) + if((tmin > tymax) || (tymin > tmax)) return false; if (tymin > tmin) @@ -114,21 +114,21 @@ final function bool Box8DirTrace( vector Start, vector Dir, vector HitTest, vect tmax = tymax; } - if( tmin1.f ) // Too far away + if(tmax<0.f || tmax>1.f) // Too far away return false; - if( bMaxY ) + if(bMaxY) { - if( Dir.Y>0.f ) + if(Dir.Y>0.f) HitNorm = vect(0,-1,0); else HitNorm = vect(0,1,0); } - else if( Dir.X>0.f ) + else if(Dir.X>0.f) HitNorm = vect(-1,0,0); else HitNorm = vect(1,0,0); diff --git a/ServerExt/Classes/MX_PongGame.uc b/ServerExt/Classes/MX_PongGame.uc index d01566f..98aa091 100644 --- a/ServerExt/Classes/MX_PongGame.uc +++ b/ServerExt/Classes/MX_PongGame.uc @@ -29,10 +29,10 @@ function Init() local int i; Super.Init(); - if( Data!=0 ) + if(Data!=0) i = Data ^ InverseXOr; Score = (i >> 16) & 32767; - if( Score>31767 ) + if(Score>31767) Score = Score-32768; NumPlays = i & 65535; SetAIRating(); @@ -44,26 +44,26 @@ final function UpdateScores() SaveConfig(); } -function SetFXTrack( Object O ) +function SetFXTrack(Object O) { local ObjectReferencer R; local int i; - if( SoundCue(O)!=None ) + if(SoundCue(O)!=None) { HitSoundsA.AddItem(SoundCue(O)); HitSoundsB.AddItem(SoundCue(O)); } - else if( ObjectReferencer(O)!=None ) + else if(ObjectReferencer(O)!=None) { R = ObjectReferencer(O); - if( R.ReferencedObjects.Length<2 ) + if(R.ReferencedObjects.Length<2) return; MissSound[0] = SoundCue(R.ReferencedObjects[0]); MissSound[1] = SoundCue(R.ReferencedObjects[1]); - for( i=2; i0.f ) // Top. + else if(V.Y>0.f) // Top. { DY = (1.f - LevelBoarderSize - (BallHeight*0.5) - P.Y) / V.Y; - if( DY3 ) + if(AITactic>3) AITrajOffset = FMin((AITactic-3)*0.35,0.97)*(0.5-FRand())*(PadHeight+BallWidth); // Randomly chose to throw ball in the corners to give angular momentum. BallHeading = BH_ToEnemy; BallVel.X *= -1.05; @@ -300,20 +300,20 @@ function Tick( float Delta ) } break; case BH_ToEnemy: - if( BallPos.X>1.f ) + if(BallPos.X>1.f) PlayerScored(true); - else if( (BallPos.X+V.X)>0.95 ) + else if((BallPos.X+V.X)>0.95) { ExtA.X = PadWidth*0.5; ExtA.Y = PadHeight*0.5; ExtB.X = BallWidth*0.5; ExtB.Y = BallHeight*0.5; - if( Box8DirTrace(BallPos,V,EnemyPad-vect(0.5,0,0)*PadWidth,ExtB,ExtA,HN,DY) ) + if(Box8DirTrace(BallPos,V,EnemyPad-vect(0.5,0,0)*PadWidth,ExtB,ExtA,HN,DY)) { BallPos+=(V*DY); V = vect(0,0,0); - if( HN.X>-0.25 ) // Hit edge of the paddle + if(HN.X>-0.25) // Hit edge of the paddle { PlayerScored(true); BallVel = MirrorVectorByNormal(BallVel,HN); @@ -332,10 +332,10 @@ function Tick( float Delta ) // Check edges // Top. - if( V.Y<0.f ) + if(V.Y<0.f) { DY = LevelBoarderSize + (BallHeight*0.5) - BallPos.Y; - if( DY>V.Y ) + if(DY>V.Y) { DY = DY / V.Y; // Calc intersection time. BallPos+=(V*DY); @@ -346,10 +346,10 @@ function Tick( float Delta ) } } // Bottom - if( V.Y>0.f ) + if(V.Y>0.f) { DY = 1.f - LevelBoarderSize - (BallHeight*0.5) - BallPos.Y; - if( DY0.f ) // Directly follow ball + if(AITactic>0.f) // Directly follow ball { bTraj = false; - if( AITactic<1.f ) + if(AITactic<1.f) { - if( BallHeading==BH_ToEnemy ) + if(BallHeading==BH_ToEnemy) bRand = BallPos.X>AITactic; } else { bRand = false; - if( AITactic>2.f && BallHeading==BH_ToEnemy ) + if(AITactic>2.f && BallHeading==BH_ToEnemy) bTraj = (AITactic>=4.f || BallPos.X>(2.f - AITactic*0.5)); } - if( !bRand ) + if(!bRand) { - if( bTraj ) + if(bTraj) { - if( BallPos.X>0.5 ) + if(BallPos.X>0.5) HN.Y = BallTrajectory.Y+AITrajOffset-EnemyPad.Y; else HN.Y = BallTrajectory.Y-EnemyPad.Y; HN.X = FMin(2.f + ((AITactic-1.f)*3.f),13.f); // Calc paddle changespeed rate @@ -398,27 +398,27 @@ function Tick( float Delta ) } // Update AI - if( bRand ) // Random motion. + if(bRand) // Random motion. { - if( AITacticTimer(1.f-PadMoveLimit) ) + else if(EnemyPad.Y>(1.f-PadMoveLimit)) { EnemyPad.Y = 1.f-PadMoveLimit; EnemyPadVel = FMin(EnemyPadVel,0.f); diff --git a/ServerExt/Classes/UIP_About.uc b/ServerExt/Classes/UIP_About.uc index 8e55bba..29d756d 100644 --- a/ServerExt/Classes/UIP_About.uc +++ b/ServerExt/Classes/UIP_About.uc @@ -43,9 +43,9 @@ private final function UniqueNetId GetAuthID() return Res; } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Forum': class'GameEngine'.static.GetOnlineSubsystem().OpenURL(ForumURL); diff --git a/ServerExt/Classes/UIP_AdminMenu.uc b/ServerExt/Classes/UIP_AdminMenu.uc index 734d9cf..08ac702 100644 --- a/ServerExt/Classes/UIP_AdminMenu.uc +++ b/ServerExt/Classes/UIP_AdminMenu.uc @@ -98,27 +98,27 @@ function Timer() class'UIP_PlayerSpecs'.Static.UpdatePlayerList(PlayersList,GetPlayer().WorldInfo.GRI); } -function SelectedRow( KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick ) +function SelectedRow(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) { - if( bRight || bDblClick ) + if(bRight || bDblClick) { PlayerContext.ItemRows[0].Text = EditPlayer$" "$Item.Columns[0]; SelectedID = Item.Value; PlayerContext.OpenMenu(Self); } } -function SelectedRCItem( int Index ) +function SelectedRCItem(int Index) { - if( Index>0 && !PlayerContext.ItemRows[Index].bSplitter ) + if(Index>0 && !PlayerContext.ItemRows[Index].bSplitter) { - if( PlayerContext.ItemRows[Index].Value>=0 ) + if(PlayerContext.ItemRows[Index].Value>=0) ExtPlayerController(GetPlayer()).AdminRPGHandle(SelectedID,PlayerContext.ItemRows[Index].Value); else UI_AdminPerkLevel(Owner.OpenMenu(class'UI_AdminPerkLevel')).InitPage(SelectedID,-PlayerContext.ItemRows[Index].Value); } } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'MOTD': Owner.OpenMenu(class'UI_AdminMOTD'); diff --git a/ServerExt/Classes/UIP_MiniGame.uc b/ServerExt/Classes/UIP_MiniGame.uc index ec3f876..7ceef4d 100644 --- a/ServerExt/Classes/UIP_MiniGame.uc +++ b/ServerExt/Classes/UIP_MiniGame.uc @@ -10,7 +10,7 @@ function ShowMenu() Level = GetPlayer().WorldInfo; LastUpdateTime = Level.RealTimeSeconds; - if( ActiveGame==None ) + if(ActiveGame==None) { ActiveGame = new (GetPlayer()) class'MX_PongGame'; ActiveGame.Init(); diff --git a/ServerExt/Classes/UIP_News.uc b/ServerExt/Classes/UIP_News.uc index 9459b39..fae3801 100644 --- a/ServerExt/Classes/UIP_News.uc +++ b/ServerExt/Classes/UIP_News.uc @@ -26,7 +26,7 @@ function ShowMenu() Super.ShowMenu(); GRI = KFGameReplicationInfo(GetPlayer().WorldInfo.GRI); WebsiteButton.SetDisabled(GRI==None || GRI.ServerAdInfo.WebsiteLink==""); - if( !WebsiteButton.bDisabled ) + if(!WebsiteButton.bDisabled) { WebsiteURL = GRI.ServerAdInfo.WebsiteLink; WebsiteButton.ChangeToolTip(WebsiteButtonToolTip$" "$WebsiteURL); @@ -34,13 +34,13 @@ function ShowMenu() } function Timer() { - if( !ExtPlayerController(GetPlayer()).bMOTDReceived ) + if(!ExtPlayerController(GetPlayer()).bMOTDReceived) SetTimer(0.2,false); else NewsField.SetText(ExtPlayerController(GetPlayer()).ServerMOTD); } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Website': class'GameEngine'.static.GetOnlineSubsystem().OpenURL(WebsiteURL); diff --git a/ServerExt/Classes/UIP_PerkSelection.uc b/ServerExt/Classes/UIP_PerkSelection.uc index b7823a3..0d0482f 100644 --- a/ServerExt/Classes/UIP_PerkSelection.uc +++ b/ServerExt/Classes/UIP_PerkSelection.uc @@ -67,31 +67,31 @@ function Timer() local int i; CurrentManager = ExtPlayerController(GetPlayer()).ActivePerkManager; - if( CurrentManager!=None ) + if(CurrentManager!=None) { - if( PrevPendingPerk!=None ) + if(PrevPendingPerk!=None) { PendingPerk = CurrentManager.FindPerk(PrevPendingPerk); PrevPendingPerk = None; } PerkList.ChangeListSize(CurrentManager.UserPerks.Length); - if( PendingPerk!=None && !PendingPerk.bPerkNetReady ) + if(PendingPerk!=None && !PendingPerk.bPerkNetReady) return; // Huge code block to handle stat updating, but actually pretty well optimized. - if( PendingPerk!=OldUsedPerk ) + if(PendingPerk!=OldUsedPerk) { OldUsedPerk = PendingPerk; - if( PendingPerk!=None ) + if(PendingPerk!=None) { OldPerkPoints = -1; - if( StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length ) + if(StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length) { - if( StatsList.ItemComponents.Length=StatBuyers.Length ) + if(i>=StatBuyers.Length) { StatBuyers[StatBuyers.Length] = UIR_PerkStat(StatsList.AddListComponent(class'UIR_PerkStat')); StatBuyers[i].StatIndex = i; @@ -104,41 +104,41 @@ function Timer() } } } - else if( StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length ) + else if(StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length) { - for( i=PendingPerk.PerkStats.Length; i0 ) + if(j>0) { TraitsList.AddLine("--"$N.Static.GetUIInfo(PendingPerk),-1); TraitsList.ToolTip.AddItem(N.Static.GetUIDesc()); } - for( i=0; i=TC.Default.NumLevels ) + if(PendingPerk.PerkTraits[i].CurrentLevel>=TC.Default.NumLevels) S = MaxStr$"\n"$NotAviable; else { S = PendingPerk.PerkTraits[i].CurrentLevel$"/"$TC.Default.NumLevels$"\n"; - if( TC.Static.MeetsRequirements(PendingPerk.PerkTraits[i].CurrentLevel,PendingPerk) ) + if(TC.Static.MeetsRequirements(PendingPerk.PerkTraits[i].CurrentLevel,PendingPerk)) S $= string(TC.Static.GetTraitCost(PendingPerk.PerkTraits[i].CurrentLevel)); else S $= NotAviable; } @@ -198,25 +198,25 @@ final function UpdateTraits() } } -function DrawPerkInfo( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus ) +function DrawPerkInfo(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus) { local Ext_PerkBase P; local float Sc; - if( CurrentManager==None || Index>=CurrentManager.UserPerks.Length ) + if(CurrentManager==None || Index>=CurrentManager.UserPerks.Length) return; P = CurrentManager.UserPerks[Index]; - if( P.Class==ExtPlayerReplicationInfo(GetPlayer().PlayerReplicationInfo).ECurrentPerk ) + if(P.Class==ExtPlayerReplicationInfo(GetPlayer().PlayerReplicationInfo).ECurrentPerk) { - if( PendingPerk==None ) + if(PendingPerk==None) PendingPerk = P; C.SetDrawColor(164,164,32); } - else if( P==PendingPerk ) + else if(P==PendingPerk) C.SetDrawColor(164,86,32); else C.SetDrawColor(32,32,128); - if( bFocus ) + if(bFocus) { C.DrawColor.R+=15; C.DrawColor.G+=15; @@ -236,45 +236,45 @@ function DrawPerkInfo( Canvas C, int Index, float YOffset, float Height, float W C.SetPos(6+Height,YOffset+Height*0.5); C.DrawText("Lv "$P.GetLevelString()$" ("$P.CurrentEXP$"/"$P.NextLevelEXP$" XP)",,Sc,Sc); } -function SwitchedPerk( int Index, bool bRight, int MouseX, int MouseY ) +function SwitchedPerk(int Index, bool bRight, int MouseX, int MouseY) { - if( CurrentManager==None || Index>=CurrentManager.UserPerks.Length ) + if(CurrentManager==None || Index>=CurrentManager.UserPerks.Length) return; PendingPerk = CurrentManager.UserPerks[Index]; ExtPlayerController(GetPlayer()).SwitchToPerk(PendingPerk.Class); } -function ShowTraitInfo( KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick ) +function ShowTraitInfo(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) { local UIR_TraitInfoPopup T; - if( (bRight || bDblClick) && Item.Value>=0 ) + if((bRight || bDblClick) && Item.Value>=0) { T = UIR_TraitInfoPopup(Owner.OpenMenu(class'UIR_TraitInfoPopup')); T.ShowTraitInfo(Item.Value,PendingPerk); } } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { local KFGUI_Page T; - switch( Sender.ID ) + switch(Sender.ID) { case 'Reset': - if( PendingPerk!=None ) + if(PendingPerk!=None) { T = Owner.OpenMenu(class'UI_ResetWarning'); UI_ResetWarning(T).SetupTo(PendingPerk); } break; case 'Unload': - if( PendingPerk!=None ) + if(PendingPerk!=None) { T = Owner.OpenMenu(class'UI_UnloadInfo'); UI_UnloadInfo(T).SetupTo(PendingPerk.Class); } break; case 'Prestige': - if( PendingPerk!=None ) + if(PendingPerk!=None) { T = Owner.OpenMenu(class'UI_PrestigeNote'); UI_PrestigeNote(T).SetupTo(PendingPerk); diff --git a/ServerExt/Classes/UIP_PerkSelectionLobby.uc b/ServerExt/Classes/UIP_PerkSelectionLobby.uc index 4e183f2..28680fb 100644 --- a/ServerExt/Classes/UIP_PerkSelectionLobby.uc +++ b/ServerExt/Classes/UIP_PerkSelectionLobby.uc @@ -5,31 +5,31 @@ function Timer() local int i; CurrentManager = ExtPlayerController(GetPlayer()).ActivePerkManager; - if( CurrentManager!=None ) + if(CurrentManager!=None) { - if( PrevPendingPerk!=None ) + if(PrevPendingPerk!=None) { PendingPerk = CurrentManager.FindPerk(PrevPendingPerk); PrevPendingPerk = None; } PerkList.ChangeListSize(CurrentManager.UserPerks.Length); - if( PendingPerk!=None && !PendingPerk.bPerkNetReady ) + if(PendingPerk!=None && !PendingPerk.bPerkNetReady) return; // Huge code block to handle stat updating, but actually pretty well optimized. - if( PendingPerk!=OldUsedPerk ) + if(PendingPerk!=OldUsedPerk) { OldUsedPerk = PendingPerk; - if( PendingPerk!=None ) + if(PendingPerk!=None) { OldPerkPoints = -1; - if( StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length ) + if(StatsList.ItemComponents.Length!=PendingPerk.PerkStats.Length) { - if( StatsList.ItemComponents.Length=StatBuyers.Length ) + if(i>=StatBuyers.Length) { StatBuyers[StatBuyers.Length] = UIR_PerkStat(StatsList.AddListComponent(class'UIR_PerkStat')); StatBuyers[i].StatIndex = i; @@ -42,16 +42,16 @@ function Timer() } } } - else if( StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length ) + else if(StatsList.ItemComponents.Length>PendingPerk.PerkStats.Length) { - for( i=PendingPerk.PerkStats.Length; i"); } } - else if( PendingPerk!=None && OldPerkPoints!=PendingPerk.CurrentSP ) + else if(PendingPerk!=None && OldPerkPoints!=PendingPerk.CurrentSP) { OldPerkPoints = PendingPerk.CurrentSP; PerkLabel.SetText("Lv"$PendingPerk.GetLevelString()@PendingPerk.PerkName$" (Points: "$PendingPerk.CurrentSP$")"); - for( i=0; i0 ) + if(Days>0) S = Days$"d "$S; return S; } -static final function string FormatInteger( int Val ) +static final function string FormatInteger(int Val) { local string S,O; S = string(Val); Val = Len(S); - if( Val<=3 ) + if(Val<=3) return S; - while( Val>3 ) + while(Val>3) { - if( O=="" ) + if(O=="") O = Right(S,3); else O = Right(S,3)$","$O; S = Left(S,Val-3); Val-=3; } - if( Val>0 ) + if(Val>0) O = S$","$O; return O; } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - if( CurrentPageIndex==Sender.IDValue ) + if(CurrentPageIndex==Sender.IDValue) return; - if( PreviousButton!=None ) + if(PreviousButton!=None) PreviousButton.bIsHighlighted = false; Sender.bIsHighlighted = true; PreviousButton = Sender; @@ -202,19 +202,19 @@ function ButtonClicked( KFGUI_Button Sender ) Timer(); } -function SelectedRow( KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick ) +function SelectedRow(KFGUI_ListItem Item, int Row, bool bRight, bool bDblClick) { local UniqueNetId Res; local PlayerReplicationInfo PRI; - if( bRight || bDblClick ) + if(bRight || bDblClick) { - if( CurrentPageIndex==0 ) + if(CurrentPageIndex==0) { foreach GetPlayer().WorldInfo.GRI.PRIArray(PRI) - if( PRI.PlayerID==Item.Value ) + if(PRI.PlayerID==Item.Value) break; - if( PRI==None || PRI.PlayerID!=Item.Value || PRI.bBot ) + if(PRI==None || PRI.PlayerID!=Item.Value || PRI.bBot) return; Res = PRI.UniqueId; } diff --git a/ServerExt/Classes/UIP_Settings.uc b/ServerExt/Classes/UIP_Settings.uc index 99505b9..6e994cd 100644 --- a/ServerExt/Classes/UIP_Settings.uc +++ b/ServerExt/Classes/UIP_Settings.uc @@ -36,9 +36,9 @@ function InitMenu() // Client settings SettingsBox = KFGUI_ComponentList(FindComponentID('SettingsBox')); - //AddCheckBox("Text-To-Speech:","Enable Text-to-Speech talk for player chat messages",'TTS', bool bDefault ); + //AddCheckBox("Text-To-Speech:","Enable Text-to-Speech talk for player chat messages",'TTS', bool bDefault); AddCheckBox(FirstPersonLegsText,FirstPersonLegsToolTip,'FP',class'ExtPlayerController'.Default.bShowFPLegs); - if( class'ExtPlayerController'.Default.bShowFPLegs ) + if(class'ExtPlayerController'.Default.bShowFPLegs) ExtPlayerController(GetPlayer()).ToggleFPBody(false); AddCheckBox(HideNameBeaconsText,HideNameBeaconsToolTip,'NB',class'ExtPlayerController'.Default.bHideNameBeacons); AddCheckBox(HideKillMessagesText,HideKillMessagesToolTip,'KM',class'ExtPlayerController'.Default.bHideKillMsg); @@ -61,9 +61,9 @@ final function InitBehindviewKey() // Check what keys now using! IN = Owner.BackupInput; - for( i=0; i 1) CurrentCost = StatCountBox.GetValueInt()*MyPerk.PerkStats[StatIndex].CostPerValue; @@ -78,7 +78,7 @@ final function CheckBuyLimit() i = Max(Min(MyPerk.CurrentSP/MyPerk.PerkStats[StatIndex].CostPerValue,MyPerk.PerkStats[StatIndex].MaxValue-MyPerk.PerkStats[StatIndex].CurrentValue),0); StatCountBox.MaxValue = i; - if( i==0 ) + if(i==0) StatCountBox.MinValue = 0; else StatCountBox.MinValue = 1; @@ -97,7 +97,7 @@ final function CheckBuyLimit() Timer(); } -final function string ChopExtraDigits( float Value ) +final function string ChopExtraDigits(float Value) { local string S; local bool bLoop; @@ -106,9 +106,9 @@ final function string ChopExtraDigits( float Value ) bLoop = true; // Chop off float digits that aren't needed. - while( bLoop ) + while(bLoop) { - switch( Right(S,1) ) + switch(Right(S,1)) { case "0": S = Left(S,Len(S)-1); diff --git a/ServerExt/Classes/UIR_PerkTraitList.uc b/ServerExt/Classes/UIR_PerkTraitList.uc index f8a6065..4a00208 100644 --- a/ServerExt/Classes/UIR_PerkTraitList.uc +++ b/ServerExt/Classes/UIR_PerkTraitList.uc @@ -42,13 +42,13 @@ function DrawMenu() // Mouse focused item check. bCheckMouse = bClickable && bFocused; FocusMouseItem = -1; - if( bCheckMouse ) + if(bCheckMouse) MouseYHit = Owner.MousePosition.Y - CompPos[1]; n = ScrollBar.CurrentScroll; i = 0; - for( C=FirstItem; C!=None; C=C.Next ) - if( (i++)==n ) + for(C=FirstItem; C!=None; C=C.Next) + if((i++)==n) break; Y = 0.f; TextY = (ItemHeight-TextHeight)*0.5f; @@ -56,19 +56,19 @@ function DrawMenu() YClip = CompPos[1]+CompPos[3]; Canvas.SetDrawColor(250,250,250,255); - for( i=0; (i=MyTrait.Default.NumLevels ) + if(OldLevel>=MyTrait.Default.NumLevels) { YesButton.ButtonText = ButtonBuyDisabledText; YesButton.SetDisabled(true); @@ -65,14 +65,14 @@ function Timer() } Cost = MyTrait.Static.GetTraitCost(OldLevel); YesButton.ButtonText = ButtonBuyText$" ("$Cost$")"; - if( Cost>OldPoints || !MyTrait.Static.MeetsRequirements(OldLevel,MyPerk) ) + if(Cost>OldPoints || !MyTrait.Static.MeetsRequirements(OldLevel,MyPerk)) YesButton.SetDisabled(true); else YesButton.SetDisabled(false); } } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).BoughtTrait(MyPerk.Class,MyTrait); diff --git a/ServerExt/Classes/UI_AdminMOTD.uc b/ServerExt/Classes/UI_AdminMOTD.uc index e84c754..63253dd 100644 --- a/ServerExt/Classes/UI_AdminMOTD.uc +++ b/ServerExt/Classes/UI_AdminMOTD.uc @@ -34,7 +34,7 @@ function InitMenu() } function Timer() { - if( !ExtPlayerController(GetPlayer()).bMOTDReceived ) + if(!ExtPlayerController(GetPlayer()).bMOTDReceived) SetTimer(0.2,false); else { @@ -42,15 +42,15 @@ function Timer() MOTDEdited(EditField); } } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { local string S; - switch( Sender.ID ) + switch(Sender.ID) { case 'Yes': S = EditField.Value; - while( Len(S)>510 ) + while(Len(S)>510) { ExtPlayerController(GetPlayer()).ServerSetMOTD(Left(S,500),false); S = Mid(S,500); @@ -63,7 +63,7 @@ function ButtonClicked( KFGUI_Button Sender ) break; } } -function MOTDEdited( KFGUI_EditBox Sender ) +function MOTDEdited(KFGUI_EditBox Sender) { NewsField.SetText(MotdPreviewText$"|"$Sender.Value); } diff --git a/ServerExt/Classes/UI_AdminPerkLevel.uc b/ServerExt/Classes/UI_AdminPerkLevel.uc index 5c48810..5b0d2a5 100644 --- a/ServerExt/Classes/UI_AdminPerkLevel.uc +++ b/ServerExt/Classes/UI_AdminPerkLevel.uc @@ -30,7 +30,7 @@ function InitMenu() LevelBox.Tooltip=LevelBoxToolTip; } -final function InitPage( int UserID, byte Mode ) +final function InitPage(int UserID, byte Mode) { local PlayerReplicationInfo PRI; @@ -39,10 +39,10 @@ final function InitPage( int UserID, byte Mode ) // Find matching player by ID foreach GetPlayer().WorldInfo.GRI.PRIArray(PRI) { - if ( PRI.PlayerID==UserID ) + if (PRI.PlayerID==UserID) break; } - if( ExtPlayerReplicationInfo(PRI)==None ) + if(ExtPlayerReplicationInfo(PRI)==None) { WindowTitle = Mode==1 ? WindowTitleSetLevel : WindowTitleSetPrestigeLevel; return; @@ -51,9 +51,9 @@ final function InitPage( int UserID, byte Mode ) LevelBox.ChangeValue(string(Mode==1 ? ExtPlayerReplicationInfo(PRI).ECurrentPerkLevel : ExtPlayerReplicationInfo(PRI).ECurrentPerkPrestige)); BaseValue = (Mode==1 ? 100 : 100000); } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).AdminRPGHandle(PlayerID,BaseValue+LevelBox.GetValueInt()); diff --git a/ServerExt/Classes/UI_MidGameMenu.uc b/ServerExt/Classes/UI_MidGameMenu.uc index c80f20a..bb9e73a 100644 --- a/ServerExt/Classes/UI_MidGameMenu.uc +++ b/ServerExt/Classes/UI_MidGameMenu.uc @@ -42,10 +42,10 @@ function InitMenu() AddMenuButton('Disconnect',DisconnectButtonText,DisconnectButtonToolTip); AddMenuButton('Exit',ExitButtonText,ExitButtonToolTip); - for( i=0; i0 && PrevButton!=None ) + if(NumButtons>0 && PrevButton!=None) PrevButton.ExtravDir = 1; PrevButton = B; - if( ++NumButtons>8 ) + if(++NumButtons>8) { ++NumButtonRows; NumButtons = 0; diff --git a/ServerExt/Classes/UI_PrestigeNote.uc b/ServerExt/Classes/UI_PrestigeNote.uc index 9d1af51..b360842 100644 --- a/ServerExt/Classes/UI_PrestigeNote.uc +++ b/ServerExt/Classes/UI_PrestigeNote.uc @@ -11,7 +11,7 @@ function InitMenu() YesButton.ToolTip=PrestigeButtonToolTip; } -function SetupTo( Ext_PerkBase P ) +function SetupTo(Ext_PerkBase P) { PerkToReset = P.Class; WindowTitle = WindowTitleText$" "$P.PerkName; diff --git a/ServerExt/Classes/UI_ResetWarning.uc b/ServerExt/Classes/UI_ResetWarning.uc index dad58e8..cae4c09 100644 --- a/ServerExt/Classes/UI_ResetWarning.uc +++ b/ServerExt/Classes/UI_ResetWarning.uc @@ -26,14 +26,14 @@ function InitMenu() Super.InitMenu(); } -function SetupTo( Ext_PerkBase P ) +function SetupTo(Ext_PerkBase P) { PerkToReset = P.Class; WindowTitle = TitleText$" "$P.PerkName; } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).ServerResetPerk(PerkToReset,bIsPrestige); diff --git a/ServerExt/Classes/UI_Scoreboard.uc b/ServerExt/Classes/UI_Scoreboard.uc index 45d6339..994ec6e 100644 --- a/ServerExt/Classes/UI_Scoreboard.uc +++ b/ServerExt/Classes/UI_Scoreboard.uc @@ -79,11 +79,11 @@ function ShowMenu() Owner.bAbsorbInput = false; PC = ExtPlayerController(GetPlayer()); bAdmin = PC!=None && (PC.WorldInfo.NetMode!=NM_Client || (PC.PlayerReplicationInfo!=None && PC.PlayerReplicationInfo.bAdmin)); - if( PC!=None && (InitAdminSize!=PC.AdminCommands.Length || !bAdmin) ) + if(PC!=None && (InitAdminSize!=PC.AdminCommands.Length || !bAdmin)) { InitAdminSize = (bAdmin ? PC.AdminCommands.Length : 0); PlayerContext.ItemRows.Length = 4+InitAdminSize; - for( i=0; i0; --i ) + for(i=(KFGRI.PRIArray.Length-1); i>0; --i) { - for( j=i-1; j>=0; --j ) - if( !InOrder(KFGRI.PRIArray[i],KFGRI.PRIArray[j]) ) + for(j=i-1; j>=0; --j) + if(!InOrder(KFGRI.PRIArray[i],KFGRI.PRIArray[j])) { PRI = KFGRI.PRIArray[i]; KFGRI.PRIArray[i] = KFGRI.PRIArray[j]; @@ -140,30 +140,30 @@ function DrawMenu() // Check players. PlayerIndex = -1; NumPlayer = 0; - for( i=(KFGRI.PRIArray.Length-1); i>=0; --i ) + for(i=(KFGRI.PRIArray.Length-1); i>=0; --i) { KPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]); - if( KPRI==None || KPRI.bHiddenUser ) + if(KPRI==None || KPRI.bHiddenUser) continue; - if( KPRI.bOnlySpectator ) + if(KPRI.bOnlySpectator) { ++NumSpec; continue; } - if( KPRI.PlayerHealth>0 && KPRI.PlayerHealthPercent>0 && KPRI.GetTeamNum()==0 ) + if(KPRI.PlayerHealth>0 && KPRI.PlayerHealthPercent>0 && KPRI.GetTeamNum()==0) ++NumAlivePlayer; ++NumPlayer; } PRIList.Length = (bShowSpectatorsOnly ? NumSpec : NumPlayer); j = PRIList.Length; - for( i=(KFGRI.PRIArray.Length-1); i>=0; --i ) + for(i=(KFGRI.PRIArray.Length-1); i>=0; --i) { KPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]); - if( KPRI!=None && bShowSpectatorsOnly==KPRI.bOnlySpectator ) + if(KPRI!=None && bShowSpectatorsOnly==KPRI.bOnlySpectator) { PRIList[--j] = KPRI; - if( KPRI==PC.PlayerReplicationInfo ) + if(KPRI==PC.PlayerReplicationInfo) PlayerIndex = j; } } @@ -175,7 +175,7 @@ function DrawMenu() YHeight = YL*5.f; // Draw header. - if( Canvas.ClipX<1000 ) + if(Canvas.ClipX<1000) { XPos = Canvas.ClipX*0.2; XScale = Canvas.ClipX*0.6; @@ -199,7 +199,7 @@ function DrawMenu() Canvas.SetPos(XPos+26,Y); Canvas.DrawText(KFGRI.ServerName,,FontScalar,FontScalar); - if( KFGRI.GameClass!=None ) + if(KFGRI.GameClass!=None) { Y+=YL; Canvas.SetPos(XPos+26,Y); @@ -225,7 +225,7 @@ function DrawMenu() // Scoreboard title line. Canvas.Font = Owner.CurrentStyle.PickFont(DefFont,FontScalar); YL = Owner.CurrentStyle.DefaultHeight; - if( Canvas.ClipX<1000 ) + if(Canvas.ClipX<1000) { XPos = Canvas.ClipX*0.175; XScale = Canvas.ClipX*0.65; @@ -237,7 +237,7 @@ function DrawMenu() } YPos += YHeight*1.05; YHeight = YL; - if( bShowSpectatorsOnly ) + if(bShowSpectatorsOnly) Canvas.SetDrawColor(32,32,128,FrameOpacity); else Canvas.SetDrawColor(128,32,32,FrameOpacity); Owner.CurrentStyle.DrawRectBox(XPos,YPos,XScale,YHeight,16,2); @@ -253,7 +253,7 @@ function DrawMenu() Y = YPos+4; Canvas.SetPos(XPos+18,Y); Canvas.DrawText(HeaderPlayerText,,FontScalar,FontScalar); - if( !bShowSpectatorsOnly ) + if(!bShowSpectatorsOnly) { Canvas.SetPos(XPos+CashXPos,Y); Canvas.DrawText(HeaderDoshText,,FontScalar,FontScalar); @@ -266,12 +266,12 @@ function DrawMenu() YPos+=(YHeight-1); YHeight = (Canvas.ClipY*0.95) - YPos; i = DefFont+2; - while( i>0 ) + while(i>0) { Canvas.Font = Owner.CurrentStyle.PickFont(i,SBFontSize); Canvas.TextSize("A",XL,SBFontHeight,SBFontSize,SBFontSize); BoxHeight = SBFontHeight*2.f+ScoreboardSpacing; - if( (BoxHeight*PRIList.Length)<=YHeight ) + if((BoxHeight*PRIList.Length)<=YHeight) break; --i; } @@ -290,17 +290,17 @@ function DrawMenu() SBFont = Canvas.Font; } -final function Texture2D FindAvatar( UniqueNetId ClientID ) +final function Texture2D FindAvatar(UniqueNetId ClientID) { local string S; S = KFPlayerController(GetPlayer()).GetSteamAvatar(ClientID); - if( S=="" ) + if(S=="") return None; return Texture2D(FindObject(S,class'Texture2D')); } -final function DrawCenteredText( string S, float X, float Y, optional float Scale=1.f ) +final function DrawCenteredText(string S, float X, float Y, optional float Scale=1.f) { local float XL,YL; @@ -308,7 +308,7 @@ final function DrawCenteredText( string S, float X, float Y, optional float Scal Canvas.SetPos(X-(XL*Scale*0.5),Y); Canvas.DrawText(S,,Scale,Scale); } -static final function string FormatTimeSM( float Sec ) +static final function string FormatTimeSM(float Sec) { local int Seconds,Minutes; @@ -320,13 +320,13 @@ static final function string FormatTimeSM( float Sec ) return Minutes$":"$(Seconds<10 ? "0"$Seconds : string(Seconds)); } -function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus ) +function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus) { local ExtPlayerReplicationInfo PRI; local float XPos,YPos,XL,YL; local string S; - if( Index==0 ) + if(Index==0) { // Setup font info. C.Font = SBFont; @@ -336,51 +336,51 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa bFocus = bFocus || (bHasSelectedPlayer && RightClickPlayer==PRI); // Draw name entry background. - if( PRI.bOnlySpectator ) // Spectator - blue. + if(PRI.bOnlySpectator) // Spectator - blue. { - if( bFocus ) + if(bFocus) C.SetDrawColor(86,86,212,FrameOpacity); else C.SetDrawColor(48,48,164,FrameOpacity); } - else if( PRI.Team==None ) // Unteamed - Grey. + else if(PRI.Team==None) // Unteamed - Grey. { - if( bFocus ) + if(bFocus) C.SetDrawColor(86,86,86,FrameOpacity); else C.SetDrawColor(48,48,48,FrameOpacity); } else { - switch( PRI.Team.TeamIndex ) + switch(PRI.Team.TeamIndex) { case 0: // Humans - Red. - if( bFocus ) + if(bFocus) C.SetDrawColor(160,48,48,FrameOpacity); else C.SetDrawColor(128,32,32,FrameOpacity); break; default: // Rest - Green. - if( bFocus ) + if(bFocus) C.SetDrawColor(48,160,48,FrameOpacity); else C.SetDrawColor(32,128,32,FrameOpacity); } } - if( PRI.PlayerHealth<=0 || PRI.PlayerHealthPercent<=0 ) + if(PRI.PlayerHealth<=0 || PRI.PlayerHealthPercent<=0) C.DrawColor = C.DrawColor*0.6; Owner.CurrentStyle.DrawRectBox(0.f,YOffset,Width,Height-ScoreboardSpacing,10); Height-=ScoreboardSpacing; // Draw health bg. - if( !bShowSpectatorsOnly ) + if(!bShowSpectatorsOnly) { - if( PRI.PlayerHealth<30 || PRI.PlayerHealthPercent<=0 ) // Chose color based on health. + if(PRI.PlayerHealth<30 || PRI.PlayerHealthPercent<=0) // Chose color based on health. C.SetDrawColor(220,32,32,255); - else if( PRI.PlayerHealth<70 ) + else if(PRI.PlayerHealth<70) C.SetDrawColor(220,220,32,255); else C.SetDrawColor(32,225,32,255); Owner.CurrentStyle.DrawRectBox(6.f,YOffset+6,Height-12,Height-12,5); } // Avatar - if( PRI.Avatar!=None ) + if(PRI.Avatar!=None) { C.SetDrawColor(255,255,255,255); C.SetPos(Height+4,YOffset+4); @@ -392,36 +392,36 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa XPos = Height+4; // Try to obtain avatar. - if( !PRI.bBot ) + if(!PRI.bBot) PRI.Avatar = FindAvatar(PRI.UniqueId); } // Name C.SetPos(XPos,YOffset+2); - if( PlayerIndex==Index ) + if(PlayerIndex==Index) C.SetDrawColor(128,255,128,255); else C.DrawColor = SBTextColor; YPos = SBFontSize; S = PRI.TaggedPlayerName; - if( PRI.ShowAdminName() ) + if(PRI.ShowAdminName()) { S = S$" ("$PRI.GetAdminNameAbr()$")"; C.DrawColor = PRI.GetAdminColorC(); } - else if( PRI.bIsDev ) + else if(PRI.bIsDev) { S = S$" (D)"; C.DrawColor = MakeColor(130,255,235,255); } - if( bMeAdmin && PRI.FixedData>0 ) + if(bMeAdmin && PRI.FixedData>0) { C.DrawColor = MakeColor(255,0,0,255); S = S$" -"$PRI.GetDesc(); } - while( true ) // Make sure too long name doesn't overleap. + while(true) // Make sure too long name doesn't overleap. { C.TextSize(S,XL,YL,YPos,YPos); - if( (C.CurX+XL)=0 ) + if(PRI.RespawnCounter>=0) { C.DrawColor = SBTextColor; S = RespawnText$": "$FormatTimeSM(PRI.RespawnCounter); } - while( true ) // Make sure too long name doesn't overleap. + while(true) // Make sure too long name doesn't overleap. { C.TextSize(S,XL,YL,YPos,YPos); - if( (C.CurX+XL)=4 ) + if(Index>=4) PC.ConsoleCommand("Admin "$ExtPlayerController(PC).AdminCommands[Index-4].Cmd@RightClickPlayer.PlayerID); } } -function ShowPlayerTooltip( int Index ) +function ShowPlayerTooltip(int Index) { local ExtPlayerReplicationInfo PRI; local string S; PRI = PRIList[Index]; - if( PRI!=None ) + if(PRI!=None) { - if( ToolTipItem==None ) + if(ToolTipItem==None) { ToolTipItem = New(None)Class'KFGUI_Tooltip'; ToolTipItem.Owner = Owner; @@ -590,7 +590,7 @@ function ShowPlayerTooltip( int Index ) ToolTipItem.InitMenu(); } S = PlayerText$": "$PRI.TaggedPlayerName$"|"$HealthText$": "$(PRI.PlayerHealthPercent<=0 ? "0" : string(PRI.PlayerHealth)); - if( PRI.ShowAdminName() ) + if(PRI.ShowAdminName()) S = S$"|"$PRI.GetAdminName(); S = S$"|"$RClickForOptsText; ToolTipItem.SetText(S); @@ -601,9 +601,9 @@ function ShowPlayerTooltip( int Index ) } } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Spec': bShowSpectatorsOnly = !bShowSpectatorsOnly; diff --git a/ServerExt/Classes/UI_Scoreboard_CD.uc b/ServerExt/Classes/UI_Scoreboard_CD.uc index a2913c8..c4992fe 100644 --- a/ServerExt/Classes/UI_Scoreboard_CD.uc +++ b/ServerExt/Classes/UI_Scoreboard_CD.uc @@ -210,7 +210,7 @@ function DrawMenu() PingXPos = Width * 0.95; // Header texts - if( !bShowSpectatorsOnly ) + if(!bShowSpectatorsOnly) { Canvas.SetPos (XPos + PerkXPos, YPos); Canvas.DrawText (HeaderPerkText, , FontScalar, FontScalar); @@ -239,21 +239,21 @@ function DrawMenu() PRIList.Length = (bShowSpectatorsOnly ? NumSpec : NumPlayer); j = PRIList.Length; - for( i=(KFGRI.PRIArray.Length-1); i>=0; --i ) + for(i=(KFGRI.PRIArray.Length-1); i>=0; --i) { KFPRI = ExtPlayerReplicationInfo(KFGRI.PRIArray[i]); - if( KFPRI!=None && bShowSpectatorsOnly==KFPRI.bOnlySpectator ) + if(KFPRI!=None && bShowSpectatorsOnly==KFPRI.bOnlySpectator) { PRIList[--j] = KFPRI; - if( KFPRI==PC.PlayerReplicationInfo ) + if(KFPRI==PC.PlayerReplicationInfo) PlayerIndex = j; } } CurrentBoxY = (YL + 4) * MaxPlayerCount; - while( CurrentBoxY > (Canvas.ClipY-YPos) ) + while(CurrentBoxY > (Canvas.ClipY-YPos)) { - if( ++i>=5 ) + if(++i>=5) { NotShownCount = MaxPlayerCount-int((Canvas.ClipY-YPos)/CurrentBoxY)+1; MaxPlayerCount-=NotShownCount; @@ -269,7 +269,7 @@ function DrawMenu() PlayersList.ChangeListSize(PRIList.Length); } -function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus ) +function DrawPlayerEntry(Canvas C, int Index, float YOffset, float Height, float Width, bool bFocus) { local float FontScalar; local ExtPlayerReplicationInfo KFPRI; @@ -286,13 +286,13 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa if (KFPRI == GetPlayer().PlayerReplicationInfo) { - if( bFocus ) + if(bFocus) C.SetDrawColor(0, 83, 255, 150); else C.SetDrawColor (51, 30, 101, 150); } else { - if( bFocus ) + if(bFocus) C.SetDrawColor(0, 83, 255, 150); else C.SetDrawColor (30, 30, 30, 150); } @@ -302,10 +302,10 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa C.DrawColor = MakeColor (250, 250, 250, 255); // Perk - if( !bShowSpectatorsOnly ) + if(!bShowSpectatorsOnly) { C.DrawColor = KFPRI.HUDPerkColor; - if( KFPRI.ECurrentPerk!=None ) + if(KFPRI.ECurrentPerk!=None) { C.SetPos (0.f + PerkXPos, YOffset + 2.5); C.DrawRect (Height-5, Height-5, KFPRI.ECurrentPerk.Default.PerkIcon); @@ -314,7 +314,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa C.SetPos (0.f + PerkXPos + Height, YOffset); C.DrawText (S, , FontScalar, FontScalar); } - else if( KFPRI.bBot && KFPRI.CurrentPerkClass!=None ) + else if(KFPRI.bBot && KFPRI.CurrentPerkClass!=None) { C.SetPos (0.f + PerkXPos, YOffset + 2.5); C.DrawRect (Height-5, Height-5, KFPRI.CurrentPerkClass.Default.PerkIcon); @@ -333,7 +333,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa } // Avatar - if( KFPRI.Avatar!=None ) + if(KFPRI.Avatar!=None) { C.SetDrawColor(255,255,255,255); C.SetPos(0.f + PlayerXPos - (Height * 1.2), YOffset); @@ -342,17 +342,17 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa else { // Try to obtain avatar. - if( !KFPRI.bBot ) + if(!KFPRI.bBot) KFPRI.Avatar = FindAvatar(KFPRI.UniqueId); } // Rank - if( KFPRI.ShowAdminName() ) + if(KFPRI.ShowAdminName()) { S = KFPRI.GetAdminName(); C.DrawColor = KFPRI.GetAdminColorC(); } - else if( KFPRI.bIsDev ) + else if(KFPRI.bIsDev) { S = DeveloperText; C.DrawColor = MakeColor(130,255,235,255); @@ -373,7 +373,7 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa C.DrawColor = MakeColor(255,255,255,255); - if( !bShowSpectatorsOnly ) + if(!bShowSpectatorsOnly) { // Kill C.SetDrawColor(255,51,51,255); @@ -434,15 +434,15 @@ function DrawPlayerEntry( Canvas C, int Index, float YOffset, float Height, floa C.DrawText (S, , FontScalar, FontScalar); } -function ShowPlayerTooltip( int Index ) +function ShowPlayerTooltip(int Index) { local ExtPlayerReplicationInfo PRI; local string S; PRI = PRIList[Index]; - if( PRI!=None ) + if(PRI!=None) { - if( ToolTipItem==None ) + if(ToolTipItem==None) { ToolTipItem = New(None)Class'KFGUI_Tooltip_CD'; ToolTipItem.Owner = Owner; @@ -450,7 +450,7 @@ function ShowPlayerTooltip( int Index ) ToolTipItem.InitMenu(); } S = PlayerText$": "$PRI.TaggedPlayerName$"|"$HealthText$": "$(PRI.PlayerHealthPercent<=0 ? "0" : string(PRI.PlayerHealth)); - if( PRI.ShowAdminName() ) + if(PRI.ShowAdminName()) S = S$"|"$PRI.GetAdminName(); S = S$"|"$RClickForOptsText; ToolTipItem.SetText(S); @@ -490,7 +490,7 @@ function string ConvertValueLarge(int FValue) return StrValue; } -function SelectedRCItem( int Index ) +function SelectedRCItem(int Index) { local PlayerController PC; local KFPlayerReplicationInfo KFPRI; @@ -498,7 +498,7 @@ function SelectedRCItem( int Index ) PC = GetPlayer(); KFPRI = KFPlayerReplicationInfo(PC.PlayerReplicationInfo); - switch( Index ) + switch(Index) { case 3: // Vote kick. KFPRI.ServerStartKickVote(RightClickPlayer, KFPRI); diff --git a/ServerExt/Classes/UI_UnloadInfo.uc b/ServerExt/Classes/UI_UnloadInfo.uc index c170e7c..3814514 100644 --- a/ServerExt/Classes/UI_UnloadInfo.uc +++ b/ServerExt/Classes/UI_UnloadInfo.uc @@ -32,7 +32,7 @@ function InitMenu() InfoLabel = KFGUI_TextField(FindComponentID('Info')); Super.InitMenu(); } -final function SetupTo( class P ) +final function SetupTo(class P) { PerkToReset = P; WindowTitle = ResetPerkNotice$" "$P.Default.PerkName; @@ -42,9 +42,9 @@ final function SetupTo( class P ) ExtPlayerController(GetPlayer()).OnClientGetResponse = ReceivedInfo; ExtPlayerController(GetPlayer()).ServerGetUnloadInfo(CurCallCode,PerkToReset,false); } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Yes': ExtPlayerController(GetPlayer()).ServerGetUnloadInfo(0,PerkToReset,true); @@ -62,12 +62,12 @@ function CloseMenu() ExtPlayerController(GetPlayer()).OnClientGetResponse = ExtPlayerController(GetPlayer()).DefClientResponse; } -function ReceivedInfo( byte CallID, byte Code, int DataA, int DataB ) +function ReceivedInfo(byte CallID, byte Code, int DataA, int DataB) { - if( CurCallCode!=CallID ) + if(CurCallCode!=CallID) return; - switch( Code ) + switch(Code) { case 0: InfoLabel.SetText(ResetDisabledWarn); diff --git a/ServerExt/Classes/VSFPZedHands.uc b/ServerExt/Classes/VSFPZedHands.uc index d7a47ce..2881305 100644 --- a/ServerExt/Classes/VSFPZedHands.uc +++ b/ServerExt/Classes/VSFPZedHands.uc @@ -5,14 +5,14 @@ var SkeletalMeshComponent Mesh; var AnimNodeSlot HandsAnimNode,BodyNode; var name IdleAnimName; -simulated function InitHands( SkeletalMeshComponent C ) +simulated function InitHands(SkeletalMeshComponent C) { Mesh.SetSkeletalMesh(C.SkeletalMesh); Mesh.AnimSets = C.AnimSets; HandsAnimNode = AnimNodeSlot(Mesh.FindAnimNode('ArmsSlot')); BodyNode = AnimNodeSlot(Mesh.FindAnimNode('BodySlot')); } -simulated final function SetIdleAnim( name N ) +simulated final function SetIdleAnim(name N) { IdleAnimName = N; Timer(); @@ -21,7 +21,7 @@ simulated function Timer() { HandsAnimNode.PlayCustomAnim(IdleAnimName,1.f,0.15,,true); } -simulated final function PlayHandsAnim( name N, optional float Rate=1.f ) +simulated final function PlayHandsAnim(name N, optional float Rate=1.f) { SetTimer(HandsAnimNode.PlayCustomAnim(N,Rate,0.05,,,true),false); } diff --git a/ServerExt/Classes/VSZombie.uc b/ServerExt/Classes/VSZombie.uc index fa78034..8652a85 100644 --- a/ServerExt/Classes/VSZombie.uc +++ b/ServerExt/Classes/VSZombie.uc @@ -16,7 +16,7 @@ var() bool bBoss; replication { - if( true ) + if(true) ServerAttackMode; } @@ -34,8 +34,8 @@ function bool IsFiring() { local byte i; - for( i=0; i=ArrayCount(IsFiringMode) || WorldInfo.NetMode==NM_Client ) + if((bStart && bNoWeaponFiring) || Mode>=ArrayCount(IsFiringMode) || WorldInfo.NetMode==NM_Client) return; IsFiringMode[Mode] = byte(bStart); - if( bStart ) + if(bStart) PlayAttackAnim(Mode); } simulated function StartFire(byte FireModeNum) { - if( bNoWeaponFiring ) + if(bNoWeaponFiring) return; ServerModeFire(true,FireModeNum); } @@ -117,16 +117,16 @@ simulated function StopFire(byte FireModeNum) function DropProp(); // Handle animation replication. -function ServerAttackAnim( byte Num ) +function ServerAttackAnim(byte Num) { local float F; bAttacking = true; F = StartAttackAnim(Num); SetTimer(F,false,'AttackFinished'); - if( WorldInfo.NetMode!=NM_StandAlone ) + if(WorldInfo.NetMode!=NM_StandAlone) { Num+=1; - if( Num==ServerAttackMode ) + if(Num==ServerAttackMode) ServerAttackMode = ServerAttackMode | 128; else ServerAttackMode = Num; SetTimer(F+0.5,false,'ResetAttackTimer'); @@ -138,10 +138,10 @@ function ResetAttackTimer() } simulated event ReplicatedEvent(name VarName) { - switch( VarName ) + switch(VarName) { case 'ServerAttackMode': - if( ServerAttackMode!=0 ) + if(ServerAttackMode!=0) { ServerAttackMode = (ServerAttackMode & 127)-1; bAttacking = true; @@ -156,18 +156,18 @@ simulated event ReplicatedEvent(name VarName) // Handle melee damage. simulated function MeleeImpactNotify(KFAnimNotify_MeleeImpact Notify) { - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) MeleeDamageTarget(vector(Rotation)*MeleeDamage*500.f); } -function bool MeleeDamageTarget( vector pushdir ) +function bool MeleeDamageTarget(vector pushdir) { local Actor A; local vector Dir,HL,HN,Start; local byte T; local bool bResult,bHitActors; - if( WorldInfo.NetMode==NM_Client || Controller==None ) + if(WorldInfo.NetMode==NM_Client || Controller==None) Return False; // Never should be done on client. Start = GetPawnViewLocation(); @@ -177,9 +177,9 @@ function bool MeleeDamageTarget( vector pushdir ) // First try if can hit with a small extent trace. foreach TraceActors(Class'Actor',A,HL,HN,Start+Dir*120.f,Start,vect(8,8,8)) { - if( A.bWorldGeometry || A==WorldInfo ) + if(A.bWorldGeometry || A==WorldInfo) { - if( KFDoorActor(A)!=None ) + if(KFDoorActor(A)!=None) { DamageDoor(KFDoorActor(A),HL,pushdir); bHitActors = true; @@ -187,9 +187,9 @@ function bool MeleeDamageTarget( vector pushdir ) bResult = true; break; } - else if( Pawn(A)!=None ) + else if(Pawn(A)!=None) { - if( Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded) ) + if(Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded)) { DealMeleeDamage(A,HL,pushdir); bResult = true; @@ -198,7 +198,7 @@ function bool MeleeDamageTarget( vector pushdir ) } } - if( !bHitActors ) + if(!bHitActors) { // Then try with large extent. HN.X = GetCollisionRadius()*0.75; @@ -206,17 +206,17 @@ function bool MeleeDamageTarget( vector pushdir ) HN.Z = GetCollisionHeight()*0.5; foreach TraceActors(Class'Actor',A,HL,HN,Location+Dir*120.f,Location,HN) { - if( A.bWorldGeometry || A==WorldInfo ) + if(A.bWorldGeometry || A==WorldInfo) { - if( KFDoorActor(A)!=None ) + if(KFDoorActor(A)!=None) DamageDoor(KFDoorActor(A),HL,pushdir); else DealMeleeDamage(A,HL,pushdir); bResult = true; break; } - else if( Pawn(A)!=None ) + else if(Pawn(A)!=None) { - if( Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded) ) + if(Pawn(A).Health>0 && (Pawn(A).GetTeamNum()!=T || WorldInfo.Game.bGameEnded)) { DealMeleeDamage(A,HL,pushdir); bResult = true; @@ -227,13 +227,13 @@ function bool MeleeDamageTarget( vector pushdir ) } return bResult; } -function DealMeleeDamage( Actor Other, vector HL, vector pushdir ) +function DealMeleeDamage(Actor Other, vector HL, vector pushdir) { - if( KFPawn_Monster(Other)!=None && KFPawn_Monster(Other).GetTeamNum()==0 ) + if(KFPawn_Monster(Other)!=None && KFPawn_Monster(Other).GetTeamNum()==0) Other.TakeDamage(MeleeDamage*5, Controller, HL, pushdir, MeleeHitDT,,Self); // Almost insta-kill pet zeds. else Other.TakeDamage(MeleeDamage, Controller, HL, pushdir, MeleeHitDT,,Self); } -function DamageDoor( KFDoorActor D, vector HL, vector pushdir ) +function DamageDoor(KFDoorActor D, vector HL, vector pushdir) { local bool bIsP; @@ -251,29 +251,29 @@ function TakeHitZoneDamage(float Damage, class DamageType, int HitZo Super(KFPawn).TakeHitZoneDamage(Damage, DamageType, HitZoneIdx, InstigatorLocation); - if ( HitZoneIdx == HZI_Head && Health>0 ) // Don't remove head until zombie actually dies. + if (HitZoneIdx == HZI_Head && Health>0) // Don't remove head until zombie actually dies. HitZones[HZI_Head].GoreHealth = Max(HitZones[HZI_Head].GoreHealth,1); // When GoreHealth <= 0, check to see if this weapon can dismember limbs - if ( HitZones[HitZoneIdx].GoreHealth <= 0 && CanInjureHitZone(DamageType, HitZoneIdx) ) + if (HitZones[HitZoneIdx].GoreHealth <= 0 && CanInjureHitZone(DamageType, HitZoneIdx)) HitZoneInjured(HitZoneIdx); // Handle head injuries - if ( HitZoneIdx == HZI_Head ) + if (HitZoneIdx == HZI_Head) { // Based on head health, calculate number of head chunks we're allowed to remove - if( !bPlayedDeath && !bIsHeadless && !bTearOff ) + if(!bPlayedDeath && !bIsHeadless && !bTearOff) { HeadHealthPercentage = GetHeadHealthPercent(); - if( HeadHealthPercentage > 0.5 ) + if(HeadHealthPercentage > 0.5) { MaxHeadChunkGoreWhileAlive = 1; } - else if ( HeadHealthPercentage > 0.25 ) + else if (HeadHealthPercentage > 0.25) { MaxHeadChunkGoreWhileAlive = 2; } - else if ( HeadHealthPercentage > 0.0 ) + else if (HeadHealthPercentage > 0.0) { MaxHeadChunkGoreWhileAlive = 3; } @@ -288,26 +288,26 @@ simulated function SetMeshVisibility(bool bVisible) } // First person hands. -simulated function DrawHUD( HUD H ) +simulated function DrawHUD(HUD H) { Super.DrawHUD(H); - if( Health<=0 ) + if(Health<=0) return; - if( !bShowFPHands ) + if(!bShowFPHands) { - if( FPHandModel!=None && !FPHandModel.bHidden ) + if(FPHandModel!=None && !FPHandModel.bHidden) FPHandModel.SetHidden(true); } else { - if( FPHandModel==None ) + if(FPHandModel==None) { FPHandModel = Spawn(class'VSFPZedHands',Self); FPHandModel.InitHands(Mesh); FPHandModel.Mesh.SetLightingChannels(PawnLightingChannel); InitFPHands(); } - if( FPHandModel.bHidden ) + if(FPHandModel.bHidden) FPHandModel.SetHidden(false); FPHandModel.SetRotation(GetViewRotation()); FPHandModel.SetLocation(GetPawnViewLocation()+(FPHandOffset >> FPHandModel.Rotation)); @@ -323,18 +323,18 @@ simulated function InitFPHands() simulated function Destroyed() { DisableNightVision(); - if( FPHandModel!=None ) + if(FPHandModel!=None) FPHandModel.Destroy(); Super.Destroyed(); } simulated function PlayDying(class DamageType, vector HitLoc) { DisableNightVision(); - if( FPHandModel!=None ) + if(FPHandModel!=None) FPHandModel.Destroy(); Super.PlayDying(DamageType,HitLoc); } -exec function TestFPOffset( vector V ) +exec function TestFPOffset(vector V) { FPHandOffset = V; } @@ -343,17 +343,17 @@ simulated final function DisableNightVision() { local KFPlayerController KFPC; - if( IsLocallyControlled() ) + if(IsLocallyControlled()) { KFPC = KFPlayerController(Controller); - if( KFPC!=None && KFPC.bNightVisionActive ) + if(KFPC!=None && KFPC.bNightVisionActive) KFPC.SetNightVision(false); } } -function PossessedBy( Controller C, bool bVehicleTransition ) +function PossessedBy(Controller C, bool bVehicleTransition) { - Super(KFPawn).PossessedBy( C, bVehicleTransition ); + Super(KFPawn).PossessedBy(C, bVehicleTransition); bReducedZedOnZedPinchPointCollisionStateActive = false; bIgnoreTeamCollision = true; @@ -371,39 +371,39 @@ function AdjustDamage(out int InDamage, out vector Momentum, Controller Instigat // is vulnerable? DamageMod = 1.f; - if( IsVulnerableTo(DamageType,DamageMod) ) + if(IsVulnerableTo(DamageType,DamageMod)) { TempDamage *= DamageMod; } - else if( IsResistantTo(DamageType,DamageMod) ) + else if(IsResistantTo(DamageType,DamageMod)) { TempDamage *= DamageMod; } // Cached hit params - if( HitInfo.BoneName!='' && class(DamageType)==None && class(DamageType)==None ) + if(HitInfo.BoneName!='' && class(DamageType)==None && class(DamageType)==None) { HitZoneIdx = HitZones.Find('ZoneName', HitInfo.BoneName); - if( HitZoneIdx>=0 ) + if(HitZoneIdx>=0) TempDamage *= HitZones[HitZoneIdx].DmgScale; } - InDamage = FCeil( TempDamage ); + InDamage = FCeil(TempDamage); - if( InstigatedBy!=None && InstigatedBy!=Controller && InstigatedBy.GetTeamNum()==0 ) + if(InstigatedBy!=None && InstigatedBy!=Controller && InstigatedBy.GetTeamNum()==0) { // Give credits to pets owner. - if( Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None ) + if(Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None) InstigatedBy = Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo).OwnerController; - if( InstigatedBy!=None ) - AddTakenDamage( InstigatedBy, FMin(Health, InDamage), DamageCauser, class(DamageType) ); + if(InstigatedBy!=None) + AddTakenDamage(InstigatedBy, FMin(Health, InDamage), DamageCauser, class(DamageType)); } } event Landed(vector HitNormal, actor FloorActor) { Super.Landed(HitNormal, FloorActor); - if ( Velocity.Z < -200 ) + if (Velocity.Z < -200) { // Slow down after a jump. Velocity.X *= 0.02; @@ -411,13 +411,13 @@ event Landed(vector HitNormal, actor FloorActor) } } -function bool DoJump( bool bUpdating ) +function bool DoJump(bool bUpdating) { - if( bJumpCapable && (Physics == PHYS_Walking || Physics == PHYS_Ladder || Physics == PHYS_Spider) ) + if(bJumpCapable && (Physics == PHYS_Walking || Physics == PHYS_Ladder || Physics == PHYS_Spider)) { - if ( Physics == PHYS_Spider ) + if (Physics == PHYS_Spider) Velocity = Velocity + (JumpZ * Floor); - else if ( Physics == PHYS_Ladder ) + else if (Physics == PHYS_Ladder) Velocity.Z = 0; else Velocity.Z = JumpZ; if (Base != None && !Base.bWorldGeometry && Base.Velocity.Z > 0.f) @@ -437,7 +437,7 @@ function bool CanBeGrabbed(KFPawn GrabbingPawn, optional bool bIgnoreFalling, op // UI stuff. simulated function String GetHumanReadableName() { - if ( PlayerReplicationInfo != None ) + if (PlayerReplicationInfo != None) return PlayerReplicationInfo.PlayerName; return ZombieName; } diff --git a/ServerExt/Classes/VS_ZedClotBase.uc b/ServerExt/Classes/VS_ZedClotBase.uc index 960d15e..5470f90 100644 --- a/ServerExt/Classes/VS_ZedClotBase.uc +++ b/ServerExt/Classes/VS_ZedClotBase.uc @@ -3,18 +3,18 @@ class VS_ZedClotBase extends VSZombie simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) { - Super.PostInitAnimTree( SkelComp ); + Super.PostInitAnimTree(SkelComp); - if( bCanHeadTrack ) + if(bCanHeadTrack) { IK_Look_Head = SkelControlLookAt(Mesh.FindSkelControl('HeadLook')); //IK_Look_Spine = SkelControlLookAt(Mesh.FindSkelControl('SpineLook')); } } -simulated function float StartAttackAnim( byte Num ) // Return animation duration. +simulated function float StartAttackAnim(byte Num) // Return animation duration. { - if( FPHandModel!=None ) + if(FPHandModel!=None) FPHandModel.PlayHandsAnim('Atk_Combo1_V1'); return PlayBodyAnim('Atk_Combo1_V1',EAS_UpperBody); } diff --git a/ServerExt/Classes/VS_ZedRecentZed.uc b/ServerExt/Classes/VS_ZedRecentZed.uc index f6356f2..3820c0e 100644 --- a/ServerExt/Classes/VS_ZedRecentZed.uc +++ b/ServerExt/Classes/VS_ZedRecentZed.uc @@ -5,23 +5,23 @@ var transient float WakeUpAnimTime; replication { - if( true ) + if(true) bWasWoken; } -simulated function float StartAttackAnim( byte Num ) // Return animation duration. +simulated function float StartAttackAnim(byte Num) // Return animation duration. { - if( FPHandModel!=None ) + if(FPHandModel!=None) FPHandModel.PlayHandsAnim('Atk_Combo1_V3',1.5f); return PlayBodyAnim('Atk_Combo1_V3',EAS_UpperBody,1.5f); } simulated event ReplicatedEvent(name VarName) { - switch( VarName ) + switch(VarName) { case 'bWasWoken': - if( bWasWoken ) + if(bWasWoken) WakeUp(); break; default: @@ -38,16 +38,16 @@ simulated function WakeUp() // Just spawned from transformed into a zombie. } simulated function GotUp() { - if( Health<=0 ) + if(Health<=0) return; ClearTimer('GotUp'); bWasWoken = false; bNoWeaponFiring = false; - if( WorldInfo.NetMode!=NM_Client ) + if(WorldInfo.NetMode!=NM_Client) { - if( ExtPlayerController(Controller)!=None ) + if(ExtPlayerController(Controller)!=None) ExtPlayerController(Controller).EnterRagdollMode(false); - else if( Controller!=None ) + else if(Controller!=None) Controller.ReplicatedEvent('EndRagdollMove'); } GoToState('Auto'); @@ -70,7 +70,7 @@ Ignores TakeDamage, FaceRotation; simulated function NotifyTeamChanged() { // Applies Character Info for < ROLE_Authority - if( PlayerReplicationInfo != None ) + if(PlayerReplicationInfo != None) SetCharacterArch(GetCharacterInfo()); } @@ -83,31 +83,31 @@ simulated function SetCharacterAnimationInfo() // Keep monster animations. M = KFCharacterInfo_Monster'ZED_ARCH.ZED_Clot_UnDev_Archetype'; Mesh.AnimSets = M.AnimSets; - if ( Mesh.AnimTreeTemplate != M.AnimTreeTemplate ) + if (Mesh.AnimTreeTemplate != M.AnimTreeTemplate) Mesh.SetAnimTreeTemplate(M.AnimTreeTemplate); - if ( M.AnimArchetype != None ) + if (M.AnimArchetype != None) PawnAnimInfo = M.AnimArchetype; } simulated function KFCharacterInfoBase GetCharacterInfo() { - if( ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None ) + if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch(); return Super.GetCharacterInfo(); } -simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce ) +simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce) { local KFPlayerReplicationInfo KFPRI; - KFPRI = KFPlayerReplicationInfo( PlayerReplicationInfo ); + KFPRI = KFPlayerReplicationInfo(PlayerReplicationInfo); if (Info != CharacterArch) { // Set Family Info CharacterArch = Info; - CharacterArch.SetCharacterFromArch( self, KFPRI ); - class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI ); - class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI ); + CharacterArch.SetCharacterFromArch(self, KFPRI); + class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI); + class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI); SetCharacterAnimationInfo(); @@ -122,9 +122,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor WeaponAttachmentChanged(true); } } - if( CharacterArch != none ) + if(CharacterArch != none) { - if( CharacterArch.VoiceGroupArchName != "" ) + if(CharacterArch.VoiceGroupArchName != "") VoiceGroupArch = class(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class')); } } diff --git a/ServerExt/Classes/xUI_MapRank.uc b/ServerExt/Classes/xUI_MapRank.uc index a0c5614..3f8d731 100644 --- a/ServerExt/Classes/xUI_MapRank.uc +++ b/ServerExt/Classes/xUI_MapRank.uc @@ -33,9 +33,9 @@ function CloseMenu() RepInfo = None; } -function ButtonClicked( KFGUI_Button Sender ) +function ButtonClicked(KFGUI_Button Sender) { - switch( Sender.ID ) + switch(Sender.ID) { case 'Yes': RepInfo.ServerRankMap(true); diff --git a/ServerExt/Classes/xUI_MapVote.uc b/ServerExt/Classes/xUI_MapVote.uc index 320ad95..e8458e1 100644 --- a/ServerExt/Classes/xUI_MapVote.uc +++ b/ServerExt/Classes/xUI_MapVote.uc @@ -73,7 +73,7 @@ function CloseMenu() Super.CloseMenu(); RepInfo = None; } -function InitMapvote( xVotingReplication R ) +function InitMapvote(xVotingReplication R) { RepInfo = R; } @@ -81,7 +81,7 @@ function DrawMenu() { Super.DrawMenu(); - if( RepInfo!=None && RepInfo.bListDirty ) + if(RepInfo!=None && RepInfo.bListDirty) { RepInfo.bListDirty = false; UpdateList(); @@ -94,12 +94,12 @@ final function UpdateList() local float V; local KFGUI_ListItem Item,SItem; - if( GameModeCombo.Values.Length!=RepInfo.GameModes.Length ) + if(GameModeCombo.Values.Length!=RepInfo.GameModes.Length) { GameModeCombo.Values.Length = RepInfo.GameModes.Length; - for( i=0; i=0 && Sel==m ) + if(Sel>=0 && Sel==m) SItem = Item; } // Keep same row selected if possible. CurrentVotes.SelectedRowIndex = (SItem!=None ? SItem.Index : -1); } -function ChangeToMaplist( KFGUI_ComboBox Sender ) +function ChangeToMaplist(KFGUI_ComboBox Sender) { local int i,g; local float V; - if( RepInfo!=None ) + if(RepInfo!=None) { MapList.EmptyList(); g = Sender.SelectedIndex; - for( i=0; i CN; var const array CT; -static final function string GetClientCountryStr( string IP ) +static final function string GetClientCountryStr(string IP) { local int i; local array SA; // Convert dotted IP-address into integer. ParseStringIntoArray(IP,SA,".",false); - if( SA.Length<=1 ) + if(SA.Length<=1) return "???"; i = int(SA[0])<<16 | int(SA[1])<<8 | int(SA[2]); return GetClientCountryTag(i); } -static final function string GetClientCountryTag( int IP ) +static final function string GetClientCountryTag(int IP) { local byte V; local int End,i; V = IP>>16; // Grab last IP value for lookup table. - if( V<=50 ) + if(V<=50) V = 0; - else if( V<=100 ) + else if(V<=100) V = 1; - else if( V<=150 ) + else if(V<=150) V = 2; - else if( V<=200 ) + else if(V<=200) V = 3; else V = 4; // Speed up using lookup table. End = Default.EndIndex[V]; - for( i=Default.StartIndex[V]; i=Default.CT[i].S && IP<=Default.CT[i].E ) // See if entered range. + if(IP>=Default.CT[i].S && IP<=Default.CT[i].E) // See if entered range. return Default.CN[Default.CT[i].C]; } return "???"; diff --git a/ServerExtMut/Classes/ExtPlayerStat.uc b/ServerExtMut/Classes/ExtPlayerStat.uc index c0c454b..b88d541 100644 --- a/ServerExtMut/Classes/ExtPlayerStat.uc +++ b/ServerExtMut/Classes/ExtPlayerStat.uc @@ -8,13 +8,13 @@ var array Buffer; var array StrMap; const CurrentSaveVer=1; -final function bool LoadStatFile( PlayerController Other ) +final function bool LoadStatFile(PlayerController Other) { local string S; FlushData(); S = class'ServerExtMut'.Static.GetStatFile(Other.PlayerReplicationInfo.UniqueId); - if( Class'Engine'.Static.BasicLoadObject(Self,S,false,CurrentSaveVer) ) + if(Class'Engine'.Static.BasicLoadObject(Self,S,false,CurrentSaveVer)) { BufferSize = Buffer.Length; return true; @@ -23,7 +23,7 @@ final function bool LoadStatFile( PlayerController Other ) Buffer.Length = 0; return false; } -final function SaveStatFile( PlayerController Other ) +final function SaveStatFile(PlayerController Other) { local string S; @@ -31,59 +31,59 @@ final function SaveStatFile( PlayerController Other ) Class'Engine'.Static.BasicSaveObject(Self,S,false,CurrentSaveVer); } -function SaveInt( int Value, optional byte MaxVal ) +function SaveInt(int Value, optional byte MaxVal) { ++MaxVal; - if( (BufferOffset+MaxVal)>Buffer.Length ) + if((BufferOffset+MaxVal)>Buffer.Length) { Buffer.Length = (BufferOffset+MaxVal); BufferSize = Buffer.Length; } Buffer[BufferOffset++] = Value & 255; - if( MaxVal>1 ) + if(MaxVal>1) { Buffer[BufferOffset++] = (Value >> 8) & 255; - if( MaxVal>2 ) + if(MaxVal>2) { Buffer[BufferOffset++] = (Value >> 16) & 255; - if( MaxVal>3 ) + if(MaxVal>3) Buffer[BufferOffset++] = (Value >> 24) & 255; } } } -function int ReadInt( optional byte MaxVal ) +function int ReadInt(optional byte MaxVal) { local int Res; ++MaxVal; - if( (BufferOffset+MaxVal)>BufferSize ) + if((BufferOffset+MaxVal)>BufferSize) return 0; Res = Buffer[BufferOffset++]; - if( MaxVal>1 ) + if(MaxVal>1) { Res = Res | (Buffer[BufferOffset++] << 8); - if( MaxVal>2 ) + if(MaxVal>2) { Res = Res | (Buffer[BufferOffset++] << 16); - if( MaxVal>3 ) + if(MaxVal>3) Res = Res | (Buffer[BufferOffset++] << 24); } } return Res; } -function SaveStr( string S ) +function SaveStr(string S) { local int i; - if( S=="" ) + if(S=="") { SaveInt(0,1); return; } S = Left(S,255); i = StrMap.Find(S); - if( i==-1 ) + if(i==-1) { i = StrMap.Length; StrMap[StrMap.Length] = S; @@ -95,7 +95,7 @@ function string ReadStr() local int i; i = ReadInt(1); - if( i==0 || i>StrMap.Length ) + if(i==0 || i>StrMap.Length) return ""; return StrMap[i-1]; } @@ -104,7 +104,7 @@ function int TellOffset() { return BufferOffset; } -function SeekOffset( int Offset ) +function SeekOffset(int Offset) { BufferOffset = Clamp(Offset,0,BufferSize); } @@ -124,7 +124,7 @@ function bool AtEnd() { return (BufferOffset>=BufferSize); } -function SkipBytes( int Count ) +function SkipBytes(int Count) { BufferOffset = Clamp(BufferOffset+Count,0,BufferSize); } @@ -148,7 +148,7 @@ final function DebugData() GetData(B); `Log("DEBUG DATA: Data size: "$B.Length); - for( i=0; i Res ) +function GetData(out array Res) { local int i,l,o,j; @@ -174,16 +174,16 @@ function GetData( out array Res ) o = 3; // write each entry. - for( i=0; i S ) +function SetData(out array S) { local int i,o,l,j; @@ -195,11 +195,11 @@ function SetData( out array S ) o = 3; // read each string map entry. - for( i=0; i TopPlaytimes,TopKills,TopExp; -static final function SetTopPlayers( ExtPlayerController Other ) +static final function SetTopPlayers(ExtPlayerController Other) { local ExtPerkManager PM; local bool bDirty; @@ -19,10 +19,10 @@ static final function SetTopPlayers( ExtPlayerController Other ) bDirty = CheckBestTrack(Other.PlayerReplicationInfo,PM.TotalPlayTime,Default.TopPlaytimes); bDirty = CheckBestTrack(Other.PlayerReplicationInfo,PM.TotalKills,Default.TopKills) || bDirty; bDirty = CheckBestTrack(Other.PlayerReplicationInfo,PM.TotalEXP,Default.TopExp) || bDirty; - if( bDirty ) + if(bDirty) StaticSaveConfig(); } -static final function bool CheckBestTrack( PlayerReplicationInfo PRI, int Value, out array V ) +static final function bool CheckBestTrack(PlayerReplicationInfo PRI, int Value, out array V) { local string S; local int i,l; @@ -30,15 +30,15 @@ static final function bool CheckBestTrack( PlayerReplicationInfo PRI, int Value, S = class'OnlineSubsystem'.Static.UniqueNetIdToString(PRI.UniqueId); l = class'ServerExtMut'.Default.MaxTopPlayers; - if( V.Length>l ) // See if list has overflown incase an admin has changed the max stats value. + if(V.Length>l) // See if list has overflown incase an admin has changed the max stats value. V.Length = l; i = V.Find('ID',S); // First see if we have an entry from before. - if( i>=0 ) + if(i>=0) { - if( V[i].V==Value ) // Stat unchanged. + if(V[i].V==Value) // Stat unchanged. { - if( V[i].N!=PRI.PlayerName ) // Name has changed, update that. + if(V[i].N!=PRI.PlayerName) // Name has changed, update that. { V[i].N = PRI.PlayerName; return true; @@ -47,11 +47,11 @@ static final function bool CheckBestTrack( PlayerReplicationInfo PRI, int Value, } // Remove entry and insert it back in list only if rank changed. - if( (i>0 && V[i-1].VValue) ) + if((i>0 && V[i-1].VValue)) V.Remove(i,1); else // No change in rank. { - if( V[i].N!=PRI.PlayerName ) // Name has changed, update that. + if(V[i].N!=PRI.PlayerName) // Name has changed, update that. { V[i].N = PRI.PlayerName; return true; @@ -60,15 +60,15 @@ static final function bool CheckBestTrack( PlayerReplicationInfo PRI, int Value, } } - for( i=0; il ) // See if list has overflown. + if(V.Length>l) // See if list has overflown. V.Length = l; return true; } @@ -76,26 +76,26 @@ static final function bool CheckBestTrack( PlayerReplicationInfo PRI, int Value, return false; } -static final function bool GetStat( ExtPlayerController PC, byte ListNum, int StatIndex ) +static final function bool GetStat(ExtPlayerController PC, byte ListNum, int StatIndex) { local UniqueNetId ID; - switch( ListNum ) + switch(ListNum) { case 0: - if( StatIndex>=Default.TopPlaytimes.Length ) + if(StatIndex>=Default.TopPlaytimes.Length) return false; class'OnlineSubsystem'.Static.StringToUniqueNetId(Default.TopPlaytimes[StatIndex].ID,ID); PC.ClientGetStat(ListNum,false,Default.TopPlaytimes[StatIndex].N,ID,Default.TopPlaytimes[StatIndex].V); return true; case 1: - if( StatIndex>=Default.TopKills.Length ) + if(StatIndex>=Default.TopKills.Length) return false; class'OnlineSubsystem'.Static.StringToUniqueNetId(Default.TopKills[StatIndex].ID,ID); PC.ClientGetStat(ListNum,false,Default.TopKills[StatIndex].N,ID,Default.TopKills[StatIndex].V); return true; case 2: - if( StatIndex>=Default.TopExp.Length ) + if(StatIndex>=Default.TopExp.Length) return false; class'OnlineSubsystem'.Static.StringToUniqueNetId(Default.TopExp[StatIndex].ID,ID); PC.ClientGetStat(ListNum,false,Default.TopExp[StatIndex].N,ID,Default.TopExp[StatIndex].V); diff --git a/ServerExtMut/Classes/ExtWebApp.uc b/ServerExtMut/Classes/ExtWebApp.uc index 996ba19..206c7da 100644 --- a/ServerExtMut/Classes/ExtWebApp.uc +++ b/ServerExtMut/Classes/ExtWebApp.uc @@ -10,7 +10,7 @@ function cleanup() { webadmin = None; MyMutator = None; - if( ExtAdminUI!=None ) + if(ExtAdminUI!=None) { ExtAdminUI.Cleanup(); ExtAdminUI = None; @@ -35,14 +35,14 @@ function bool handleQuery(WebAdminQuery q) return false; } -final function IncludeFile( WebAdminQuery q, string file ) +final function IncludeFile(WebAdminQuery q, string file) { local string S; - if( webadmin.HTMLSubDirectory!="" ) + if(webadmin.HTMLSubDirectory!="") { S = webadmin.Path $ "/" $ webadmin.HTMLSubDirectory $ "/" $ file; - if ( q.response.FileExists(S) ) + if (q.response.FileExists(S)) { q.response.IncludeUHTM(S); return; @@ -50,7 +50,7 @@ final function IncludeFile( WebAdminQuery q, string file ) } q.response.IncludeUHTM(webadmin.Path $ "/" $ file); } -final function SendHeader( WebAdminQuery q, string Title ) +final function SendHeader(WebAdminQuery q, string Title) { local IQueryHandler handler; @@ -68,23 +68,23 @@ final function SendHeader( WebAdminQuery q, string Title ) IncludeFile(q,"header.inc"); q.response.SendText("

"$Title$"

"); } -final function SendFooter( WebAdminQuery q ) +final function SendFooter(WebAdminQuery q) { IncludeFile(q,"navigation.inc"); IncludeFile(q,"footer.inc"); q.response.ClearSubst(); } -final function AddConfigEditbox( WebAdminQuery q, string InfoStr, string CurVal, int MaxLen, string ResponseVar, string Tooltip, optional bool bSkipTrail ) +final function AddConfigEditbox(WebAdminQuery q, string InfoStr, string CurVal, int MaxLen, string ResponseVar, string Tooltip, optional bool bSkipTrail) { local string S; S = ""$InfoStr$":"; - if( !bSkipTrail ) + if(!bSkipTrail) S $= ""; q.response.SendText(S); } -final function AddConfigCheckbox( WebAdminQuery q, string InfoStr, bool bCur, string ResponseVar, string Tooltip ) +final function AddConfigCheckbox(WebAdminQuery q, string InfoStr, bool bCur, string ResponseVar, string Tooltip) { local string S; @@ -92,7 +92,7 @@ final function AddConfigCheckbox( WebAdminQuery q, string InfoStr, bool bCur, st S = ""$InfoStr$":"; q.response.SendText(S); } -final function AddConfigTextbox( WebAdminQuery q, string InfoStr, string CurVal, int Rows, string ResponseVar, string Tooltip ) +final function AddConfigTextbox(WebAdminQuery q, string InfoStr, string CurVal, int Rows, string ResponseVar, string Tooltip) { local string S; @@ -109,7 +109,7 @@ function handleExtMod(WebAdminQuery q) local delegate SetV; local bool bEditArray; - if( ExtAdminUI==None ) + if(ExtAdminUI==None) { ExtAdminUI = new (None) class'ExtWebAdmin_UI'; MyMutator.InitWebAdmin(ExtAdminUI); @@ -117,19 +117,19 @@ function handleExtMod(WebAdminQuery q) // First check if user is trying to get to another page. S = q.request.getVariable("GoToPage"); - if( S!="" ) + if(S!="") { - if( S=="Main Menu" ) + if(S=="Main Menu") EditPageIndex = -1; else EditPageIndex = ExtAdminUI.ConfigList.Find('PageName',S); } - if( EditPageIndex<0 || EditPageIndex>=ExtAdminUI.ConfigList.Length ) + if(EditPageIndex<0 || EditPageIndex>=ExtAdminUI.ConfigList.Length) { // Show main links page. SendHeader(q,"Ext Server Links page"); q.response.SendText(""); - for( i=0; i"); q.response.SendText("
Links
"); } @@ -137,51 +137,51 @@ function handleExtMod(WebAdminQuery q) { S = q.request.getVariable("edit"$EditPageIndex); bEditArray = false; - if( S=="Submit" ) + if(S=="Submit") { // Read setting values. - for( i=0; i=0; --j ) + for(j=z; j>=0; --j) { - if( q.request.getVariable("DEL"$j)=="1" ) + if(q.request.getVariable("DEL"$j)=="1") SetV(ExtAdminUI.ConfigList[EditPageIndex].Configs[i].PropName,j,"#DELETE"); else { S = q.request.getVariable("PR"$j,"New Line"); - if( S!="New Line" ) + if(S!="New Line") SetV(ExtAdminUI.ConfigList[EditPageIndex].Configs[i].PropName,j,S); } } @@ -192,29 +192,29 @@ function handleExtMod(WebAdminQuery q) SendHeader(q,ExtAdminUI.ConfigList[EditPageIndex].PageName$" ("$PathName(ExtAdminUI.ConfigList[EditPageIndex].ObjClass)$")"); q.response.SendText("
"); - if( bEditArray ) + if(bEditArray) { q.response.SendText("
"); GetV = ExtAdminUI.ConfigList[EditPageIndex].GetValue; z = int(GetV(ExtAdminUI.ConfigList[EditPageIndex].Configs[i].PropName,-1)); - for( j=0; j<=z; ++j ) + for(j=0; j<=z; ++j) { - if( j"); else q.response.SendText(""); break; case 2: // string AddConfigEditbox(q,"["$j$"]",S,80,"PR"$j,"",true); - if( j"); else q.response.SendText(""); break; @@ -226,9 +226,9 @@ function handleExtMod(WebAdminQuery q) else { q.response.SendText("
Edit Array "$ExtAdminUI.ConfigList[EditPageIndex].Configs[i].UIName$"Delete Line
"); - for( i=0; i StackedSect; event PreBeginPlay(); -final function DumpXML( ExtPerkManager M ) +final function DumpXML(ExtPerkManager M) { OpenFile(class'OnlineSubsystem'.Static.UniqueNetIdToString(M.PRIOwner.UniqueId),FWFT_Stats,".xml",false); M.OutputXML(Self); @@ -13,13 +13,13 @@ final function DumpXML( ExtPerkManager M ) ResetFile(); } -function WriteValue( string Key, string Value ) +function WriteValue(string Key, string Value) { Logf(Intendent$"<"$Key$">"$Value$""); } -function StartIntendent( string Section, optional string Key, optional string Value ) +function StartIntendent(string Section, optional string Key, optional string Value) { - if( Key!="" ) + if(Key!="") Logf(Intendent$"-<"$Section$" "$Key$"=\""$Value$"\">"); else Logf(Intendent$"-<"$Section$">"); Intendent $= Chr(9); diff --git a/ServerExtMut/Classes/ServerExtMut.uc b/ServerExtMut/Classes/ServerExtMut.uc index c2d5e4f..d40eb53 100644 --- a/ServerExtMut/Classes/ServerExtMut.uc +++ b/ServerExtMut/Classes/ServerExtMut.uc @@ -85,11 +85,11 @@ function PostBeginPlay() local bool bLock; Super.PostBeginPlay(); - if( WorldInfo.Game.BaseMutator==None ) + if(WorldInfo.Game.BaseMutator==None) WorldInfo.Game.BaseMutator = Self; else WorldInfo.Game.BaseMutator.AddMutator(Self); - if( bDeleteMe ) // This was a duplicate instance of the mutator. + if(bDeleteMe) // This was a duplicate instance of the mutator. return; SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo); // Start init world pathlist. @@ -98,7 +98,7 @@ function PostBeginPlay() //`Log("TEST"@class'OnlineSubsystem'.Static.UniqueNetIdToString(Id)); DevNetID.Length = DevList.Length; - for( i=0; i(DynamicLoadObject(PerkClasses[i],class'Class')); - if( PK!=None ) + if(PK!=None) { LoadedPerks.AddItem(PK); PK.Static.CheckConfig(); } } j = 0; - for( i=0; i0 ) + if(BonusGameSongs.Length>0) { BonusGameCue = SoundCue(DynamicLoadObject(BonusGameSongs[Rand(BonusGameSongs.Length)],class'SoundCue')); } - if( BonusGameFX.Length>0 ) + if(BonusGameFX.Length>0) { BonusGameFXObj = DynamicLoadObject(BonusGameFX[Rand(BonusGameFX.Length)],class'Object'); - if( SoundCue(BonusGameFXObj)==None && ObjectReferencer(BonusGameFXObj)==None ) // Check valid type. + if(SoundCue(BonusGameFXObj)==None && ObjectReferencer(BonusGameFXObj)==None) // Check valid type. BonusGameFXObj = None; } - if( ForcedMaxPlayers>0 ) + if(ForcedMaxPlayers>0) { SetMaxPlayers(); SetTimer(0.001,false,'SetMaxPlayers'); } bRespawnCheck = (PlayerRespawnTime>0); - if( bRespawnCheck ) + if(bRespawnCheck) SetTimer(1,true); - if( bEnableMapVote ) + if(bEnableMapVote) { foreach DynamicActors(class'xVotingHandler',MV) break; - if( MV==None ) + if(MV==None) MV = Spawn(class'xVotingHandler'); MV.BaseMutator = Class; } SetTimer(1,true,'CheckWave'); - if( !bNoWebAdmin && WorldInfo.NetMode!=NM_StandAlone ) + if(!bNoWebAdmin && WorldInfo.NetMode!=NM_StandAlone) SetTimer(0.1,false,'SetupWebAdmin'); - if( bDumpXMLStats ) + if(bDumpXMLStats) FileOutput = Spawn(class'ExtXMLOutput'); UpdateCustomZedXPArray(); @@ -387,7 +387,7 @@ function EditTraiderItems() } // Add custom items from WebAdmin - for( i=0; i weapdef) class'ExtPlayerReplicationInfo'.Static.SetWeaponInfo(WorldInfo.NetMode==NM_DedicatedServer,CustomTrader.SaleItems.Length,CI,CustomTrader); } -static final function string GetStatFile( const out UniqueNetId UID ) +static final function string GetStatFile(const out UniqueNetId UID) { return Repl(Default.StatFileDir,"%s","U_"$class'OnlineSubsystem'.Static.UniqueNetIdToString(UID)); } -final function bool IsDev( const out UniqueNetId UID ) +final function bool IsDev(const out UniqueNetId UID) { local int i; - for( i=(DevNetID.Length-1); i>=0; --i ) - if( DevNetID[i]==UID ) + for(i=(DevNetID.Length-1); i>=0; --i) + if(DevNetID[i]==UID) return true; return false; } @@ -440,27 +440,27 @@ function InitGRIList() KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomTrader; // Must sync up local client. - if( WorldInfo.NetMode==NM_StandAlone ) + if(WorldInfo.NetMode==NM_StandAlone) { foreach LocalPlayerControllers(class'ExtPlayerController',PC) - if( PC.PurchaseHelper!=None ) + if(PC.PurchaseHelper!=None) PC.PurchaseHelper.TraderItems = CustomTrader; } } function CheckWave() { - if( KF==None ) + if(KF==None) { KF = KFGameReplicationInfo(WorldInfo.GRI); - if( KF==None ) + if(KF==None) return; } - if( LastWaveNum!=KF.WaveNum ) + if(LastWaveNum!=KF.WaveNum) { LastWaveNum = KF.WaveNum; NotifyWaveChange(); } - if( !bGameHasEnded && KF.bMatchIsOver ) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! + if(!bGameHasEnded && KF.bMatchIsOver) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! { SaveAllPerks(true); bGameHasEnded = true; @@ -471,20 +471,20 @@ function NotifyWaveChange() local ExtPlayerController ExtPC; local KFProj_RicochetStickBullet KFBolt; - if( bRespawnCheck ) + if(bRespawnCheck) { bIsPostGame = (KF.WaveMax=0); - if( bRespawnCheck ) + if(bRespawnCheck) SavePlayerInventory(); } - if( StatAutoSaveWaves>0 && ++NumWaveSwitches>=StatAutoSaveWaves ) + if(StatAutoSaveWaves>0 && ++NumWaveSwitches>=StatAutoSaveWaves) { NumWaveSwitches = 0; SaveAllPerks(); } - if( !KF.bTraderIsOpen ) + if(!KF.bTraderIsOpen) { foreach WorldInfo.AllControllers(class'ExtPlayerController',ExtPC) ExtPC.bSetPerk = false; @@ -506,11 +506,11 @@ function SetupWebAdmin() foreach AllActors(class'WebServer',W) break; - if( W!=None ) + if(W!=None) { - for( i=0; (i<10 && A==None); ++i ) + for(i=0; (i<10 && A==None); ++i) A = WebAdmin(W.ApplicationObjects[i]); - if( A!=None ) + if(A!=None) { xW = new (None) class'ExtWebApp'; xW.MyMutator = Self; @@ -526,18 +526,18 @@ function SetMaxPlayers() WorldInfo.Game.MaxPlayers = ForcedMaxPlayers; WorldInfo.Game.MaxPlayersAllowed = ForcedMaxPlayers; - if( WorldInfo.Game.GameInterface!=None ) + if(WorldInfo.Game.GameInterface!=None) { GameSettings = WorldInfo.Game.GameInterface.GetGameSettings(WorldInfo.Game.PlayerReplicationInfoClass.default.SessionName); - if( GameSettings!=None ) + if(GameSettings!=None) GameSettings.NumPublicConnections = ForcedMaxPlayers; } } function AddMutator(Mutator M) { - if( M!=Self ) // Make sure we don't get added twice. + if(M!=Self) // Make sure we don't get added twice. { - if( M.Class==Class ) + if(M.Class==Class) M.Destroy(); else Super.AddMutator(M); } @@ -547,14 +547,14 @@ function bool IsFromMod(Object O) { local string PackageName; - if( O == None ) + if(O == None) return false; PackageName = string(O.GetPackageName()); - if( Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) + if(Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) { PackageName = string(O); - if( Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) + if(Len(PackageName)>1 && InStr(Caps(PackageName), "KF") == 0) return false; } @@ -573,23 +573,23 @@ function ScoreKill(Controller Killer, Controller Killed) local KFPlayerController KFPC; local ExtPerkManager KillersPerk; - if( bRespawnCheck && Killed.bIsPlayer ) + if(bRespawnCheck && Killed.bIsPlayer) CheckRespawn(Killed); KFM = KFPawn_Monster(Killed.Pawn); - if( KFM!=None && Killed.GetTeamNum()!=0 && Killer.bIsPlayer && Killer.GetTeamNum()==0 ) + if(KFM!=None && Killed.GetTeamNum()!=0 && Killer.bIsPlayer && Killer.GetTeamNum()==0) { - if( ExtPlayerController(Killer)!=None && ExtPlayerController(Killer).ActivePerkManager!=None ) + if(ExtPlayerController(Killer)!=None && ExtPlayerController(Killer).ActivePerkManager!=None) ExtPlayerController(Killer).ActivePerkManager.PlayerKilled(KFPawn_Monster(Killed.Pawn),LastKillDamageType); - if( bKillMessages && Killer.PlayerReplicationInfo!=None ) + if(bKillMessages && Killer.PlayerReplicationInfo!=None) BroadcastKillMessage(Killed.Pawn,Killer); - if( KFM.DamageHistory.Length > 0 ) + if(KFM.DamageHistory.Length > 0) { - for( i = 0; i 0.f && KillersPerk != none && KillersPerk.GetZedTimeExtensions( KFPC.GetLevel() ) > MyKFGI.ZedTimeExtensionsUsed ) + if (MyKFGI.ZedTimeRemaining > 0.f && KillersPerk != none && KillersPerk.GetZedTimeExtensions(KFPC.GetLevel()) > MyKFGI.ZedTimeExtensionsUsed) { MyKFGI.DramaticEvent(1.0); MyKFGI.ZedTimeExtensionsUsed++; } } } - if( ExtPlayerController(Killed)!=None ) + if(ExtPlayerController(Killed)!=None) CheckPerkChange(ExtPlayerController(Killed)); if (NextMutator != None) NextMutator.ScoreKill(Killer, Killed); @@ -664,27 +664,27 @@ function ScoreKill(Controller Killer, Controller Killed) } function bool PreventDeath(Pawn Killed, Controller Killer, class damageType, vector HitLocation) { - if( (KFPawn_Human(Killed)!=None && CheckPreventDeath(KFPawn_Human(Killed),Killer,damageType)) || Super.PreventDeath(Killed,Killer,damageType,HitLocation) ) + if((KFPawn_Human(Killed)!=None && CheckPreventDeath(KFPawn_Human(Killed),Killer,damageType)) || Super.PreventDeath(Killed,Killer,damageType,HitLocation)) return true; LastKillDamageType = damageType; - if( Killed.Controller!=None && KFPawn_Monster(Killed)!=None ) + if(Killed.Controller!=None && KFPawn_Monster(Killed)!=None) { // Hack for when pet kills a zed. - if( Killed.GetTeamNum()!=0 ) + if(Killed.GetTeamNum()!=0) { - if( Killer!=None && Killer!=Killed.Controller && Killer.GetTeamNum()==0 && Ext_T_MonsterPRI(Killer.PlayerReplicationInfo)!=None ) + if(Killer!=None && Killer!=Killed.Controller && Killer.GetTeamNum()==0 && Ext_T_MonsterPRI(Killer.PlayerReplicationInfo)!=None) GT_PlayerKilled(Ext_T_MonsterPRI(Killer.PlayerReplicationInfo).OwnerController,Killed.Controller,damageType); } // Broadcast pet's deathmessage. - else if( Killed.PlayerReplicationInfo!=None && PlayerController(Killed.Controller)==None && damageType!=class'KFDT_Healing' ) + else if(Killed.PlayerReplicationInfo!=None && PlayerController(Killed.Controller)==None && damageType!=class'KFDT_Healing') BroadcastFFDeath(Killer,Killed,damageType); } return false; } // Replica of KFGameInfo.Killed base. -final function GT_PlayerKilled( Controller Killer, Controller Killed, class damageType ) +final function GT_PlayerKilled(Controller Killer, Controller Killed, class damageType) { local ExtPlayerController KFPC; local KFPawn_Monster MonsterPawn; @@ -695,42 +695,42 @@ final function GT_PlayerKilled( Controller Killer, Controller Killed, class damageType ) +final function bool CheckPreventDeath(KFPawn_Human Victim, Controller Killer, class damageType) { local ExtPlayerController E; - if( Victim.IsA('KFPawn_Customization') ) + if(Victim.IsA('KFPawn_Customization')) return false; E = ExtPlayerController(Victim.Controller); return (E!=None && E.ActivePerkManager!=None && E.ActivePerkManager.CurrentPerk!=None && E.ActivePerkManager.CurrentPerk.PreventDeath(Victim,Killer,damageType)); } -final function BroadcastKillMessage( Pawn Killed, Controller Killer ) +final function BroadcastKillMessage(Pawn Killed, Controller Killer) { local ExtPlayerController E; - if( Killer==None || Killer.PlayerReplicationInfo==None ) + if(Killer==None || Killer.PlayerReplicationInfo==None) return; - if( Killed.Default.Health>=LargeMonsterHP ) + if(Killed.Default.Health>=LargeMonsterHP) { foreach WorldInfo.AllControllers(class'ExtPlayerController',E) - if( !E.bClientHideKillMsg ) + if(!E.bClientHideKillMsg) E.ReceiveKillMessage(Killed.Class,true,Killer.PlayerReplicationInfo); } - else if( ExtPlayerController(Killer)!=None && !ExtPlayerController(Killer).bClientHideKillMsg ) + else if(ExtPlayerController(Killer)!=None && !ExtPlayerController(Killer).bClientHideKillMsg) ExtPlayerController(Killer).ReceiveKillMessage(Killed.Class); } -final function BroadcastFFDeath( Controller Killer, Pawn Killed, class damageType ) +final function BroadcastFFDeath(Controller Killer, Pawn Killed, class damageType) { local ExtPlayerController E; local PlayerReplicationInfo KillerPRI; @@ -738,7 +738,7 @@ final function BroadcastFFDeath( Controller Killer, Pawn Killed, class0 && InstigatedBy!=None ) + if(Damage>0 && InstigatedBy!=None) { - if( KFPawn_Monster(Injured)!=None ) + if(KFPawn_Monster(Injured)!=None) { - if( Injured.GetTeamNum()!=0 ) + if(Injured.GetTeamNum()!=0) { LastDamageDealer = ExtPlayerController(InstigatedBy); - if( bDamageMessages && LastDamageDealer!=None && !LastDamageDealer.bNoDamageTracking ) + if(bDamageMessages && LastDamageDealer!=None && !LastDamageDealer.bNoDamageTracking) { // Must delay this until next to get accurate damage dealt result. LastHitZed = KFPawn(Injured); @@ -788,20 +788,20 @@ function NetDamage(int OriginalDamage, out int Damage, Pawn Injured, Controller { LastDamageDealer = None; // Give credits to pet's owner. - if( Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None ) + if(Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo)!=None) HackSetHistory(KFPawn(Injured),Injured,Ext_T_MonsterPRI(InstigatedBy.PlayerReplicationInfo).OwnerController,Damage,HitLocation); } } - else if( KFPawn(InstigatedBy.Pawn).GetTeamNum() != KFPawn(Injured).GetTeamNum() ) + else if(KFPawn(InstigatedBy.Pawn).GetTeamNum() != KFPawn(Injured).GetTeamNum()) { Momentum = vect(0,0,0); Damage = 0; } } - else if( bDamageMessages && KFPawn_Human(Injured)!=None && Injured.GetTeamNum()==0 && InstigatedBy.GetTeamNum()!=0 && ExtPlayerController(InstigatedBy)!=None ) + else if(bDamageMessages && KFPawn_Human(Injured)!=None && Injured.GetTeamNum()==0 && InstigatedBy.GetTeamNum()!=0 && ExtPlayerController(InstigatedBy)!=None) { LastDamageDealer = ExtPlayerController(InstigatedBy); - if( bDamageMessages && !LastDamageDealer.bClientHideNumbers ) + if(bDamageMessages && !LastDamageDealer.bClientHideNumbers) { // Must delay this until next to get accurate damage dealt result. LastHitZed = KFPawn(Injured); @@ -816,36 +816,36 @@ final function CheckDamageDone() { local int Damage; - if( LastDamageDealer!=None && LastHitZed!=None && LastHitHP!=LastHitZed.Health ) + if(LastDamageDealer!=None && LastHitZed!=None && LastHitHP!=LastHitZed.Health) { Damage = LastHitHP-Max(LastHitZed.Health,0); - if( Damage>0 ) + if(Damage>0) { - if( !LastDamageDealer.bClientHideDamageMsg && KFPawn_Monster(LastHitZed)!=None ) + if(!LastDamageDealer.bClientHideDamageMsg && KFPawn_Monster(LastHitZed)!=None) LastDamageDealer.ReceiveDamageMessage(LastHitZed.Class,Damage); - if( !LastDamageDealer.bClientHideNumbers ) + if(!LastDamageDealer.bClientHideNumbers) LastDamageDealer.ClientNumberMsg(Damage,LastDamagePosition,DMG_PawnDamage); } } LastDamageDealer = None; } -final function HackSetHistory( KFPawn C, Pawn Injured, Controller Player, int Damage, vector HitLocation ) +final function HackSetHistory(KFPawn C, Pawn Injured, Controller Player, int Damage, vector HitLocation) { local int i; local ExtPlayerController PC; - if( Player==None ) + if(Player==None) return; PC = ExtPlayerController(Player); - if( bDamageMessages && PC!=None ) + if(bDamageMessages && PC!=None) { - if( !PC.bClientHideDamageMsg ) + if(!PC.bClientHideDamageMsg) PC.ReceiveDamageMessage(Injured.Class,Damage); - if( !PC.bClientHideNumbers ) + if(!PC.bClientHideNumbers) PC.ClientNumberMsg(Damage,HitLocation,DMG_PawnDamage); } i = C.DamageHistory.Find('DamagerController',Player); - if( i==-1 ) + if(i==-1) { i = C.DamageHistory.Length; C.DamageHistory.Length = i+1; @@ -854,7 +854,7 @@ final function HackSetHistory( KFPawn C, Pawn Injured, Controller Player, int Da C.DamageHistory[i].DamagePerks.AddItem(class'ExtPerkManager'); C.DamageHistory[i].Damage = Damage; } - else if( (WorldInfo.TimeSeconds-C.DamageHistory[i].LastTimeDamaged)<10 ) + else if((WorldInfo.TimeSeconds-C.DamageHistory[i].LastTimeDamaged)<10) C.DamageHistory[i].Damage += Damage; else C.DamageHistory[i].Damage = Damage; @@ -864,7 +864,7 @@ final function HackSetHistory( KFPawn C, Pawn Injured, Controller Player, int Da function bool HandleRestartGame() { - if( !bGameHasEnded ) + if(!bGameHasEnded) { SaveAllPerks(true); bGameHasEnded = true; @@ -874,39 +874,39 @@ function bool HandleRestartGame() function NotifyLogout(Controller Exiting) { - if( KFPlayerController(Exiting)!=None ) + if(KFPlayerController(Exiting)!=None) RemoveRespawn(Exiting); - if( !bGameHasEnded && ExtPlayerController(Exiting)!=None ) + if(!bGameHasEnded && ExtPlayerController(Exiting)!=None) { CheckPerkChange(ExtPlayerController(Exiting)); SavePlayerPerk(ExtPlayerController(Exiting)); } - if ( NextMutator != None ) + if (NextMutator != None) NextMutator.NotifyLogout(Exiting); } function NotifyLogin(Controller NewPlayer) { - if( ExtPlayerController(NewPlayer)!=None ) + if(ExtPlayerController(NewPlayer)!=None) { - if( ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo)!=None ) + if(ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo)!=None) InitCustomChars(ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo)); - if( bAddCountryTags && NetConnection(PlayerController(NewPlayer).Player)!=None ) + if(bAddCountryTags && NetConnection(PlayerController(NewPlayer).Player)!=None) ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).SetPlayerNameTag(class'CtryDatabase'.Static.GetClientCountryStr(PlayerController(NewPlayer).GetPlayerNetworkAddress())); ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).bIsDev = IsDev(NewPlayer.PlayerReplicationInfo.UniqueId); - if( WorldInfo.NetMode!=NM_StandAlone ) + if(WorldInfo.NetMode!=NM_StandAlone) ExtPlayerReplicationInfo(NewPlayer.PlayerReplicationInfo).OnRepNextItem = GetNextItem; - if( BonusGameCue!=None || BonusGameFXObj!=None ) + if(BonusGameCue!=None || BonusGameFXObj!=None) ExtPlayerController(NewPlayer).ClientSetBonus(BonusGameCue,BonusGameFXObj); - if( bRespawnCheck ) + if(bRespawnCheck) CheckRespawn(NewPlayer); - if( !bGameHasEnded ) + if(!bGameHasEnded) InitializePerks(ExtPlayerController(NewPlayer)); SendMOTD(ExtPlayerController(NewPlayer)); } - if ( NextMutator != None ) + if (NextMutator != None) NextMutator.NotifyLogin(NewPlayer); } -final function InitializePerks( ExtPlayerController Other ) +final function InitializePerks(ExtPlayerController Other) { local ExtPerkManager PM; local Ext_PerkBase P; @@ -923,50 +923,50 @@ final function InitializePerks( ExtPlayerController Other ) Other.OnClientGetStat = class'ExtStatList'.Static.GetStat; PM = Other.ActivePerkManager; PM.InitPerks(); - for( i=0; i0 ) + if(Default.MaxTopPlayers>0) class'ExtStatList'.Static.SetTopPlayers(Other); } PM.ServerInitPerks(); PM.InitiateClientRep(); } -final function SendMOTD( ExtPlayerController PC ) +final function SendMOTD(ExtPlayerController PC) { local string S; local int i; S = ServerMOTD; - while( Len(S)>510 ) + while(Len(S)>510) { PC.ReceiveServerMOTD(Left(S,500),false); S = Mid(S,500); } PC.ReceiveServerMOTD(S,true); - for( i=0; i=0; --i ) - if( PlayerInv[i].OwnerPlayer==Other.Controller ) + for(i=(PlayerInv.Length-1); i>=0; --i) + if(PlayerInv[i].OwnerPlayer==Other.Controller) { KFInventoryManager(Other.InvManager).bInfiniteWeight = true; KFInventoryManager(Other.InvManager).GrenadeCount = PlayerInv[i].Gren; - for( j=(PlayerInv[i].Inv.Length-1); j>=0; --j ) + for(j=(PlayerInv[i].Inv.Length-1); j>=0; --j) { Inv = Other.InvManager.FindInventoryType(PlayerInv[i].Inv[j].ItemClass,false); - if( Inv==None ) + if(Inv==None) { Inv = Other.InvManager.CreateInventory(PlayerInv[i].Inv[j].ItemClass); } K = KFWeapon(Inv); - if( K!=None ) + if(K!=None) { K.SpareAmmoCount[0] = PlayerInv[i].Inv[j].Values[0]; K.SpareAmmoCount[1] = PlayerInv[i].Inv[j].Values[1]; @@ -1162,7 +1162,7 @@ final function bool AddPlayerSpecificInv( Pawn Other ) K.ClientForceSecondaryAmmoUpdate(K.AmmoCount[1]); } } - if( Other.InvManager.FindInventoryType(class'KFInventory_Money',true)==None ) + if(Other.InvManager.FindInventoryType(class'KFInventory_Money',true)==None) Other.InvManager.CreateInventory(class'KFInventory_Money'); KFInventoryManager(Other.InvManager).bInfiniteWeight = false; return true; @@ -1180,7 +1180,7 @@ final function Pawn SpawnDefaultPawnFor(Controller NewPlayer, Actor StartSpot) / ResultPawn = Spawn(PlayerClass,,,StartSpot.Location,R,,true); return ResultPawn; } -final function bool RespawnPlayer( Controller NewPlayer ) +final function bool RespawnPlayer(Controller NewPlayer) { local KFPlayerReplicationInfo KFPRI; local KFPlayerController KFPC; @@ -1190,7 +1190,7 @@ final function bool RespawnPlayer( Controller NewPlayer ) local SeqEvent_PlayerSpawned SpawnedEvent; local LocalPlayer LP; - if( NewPlayer.Pawn!=None ) + if(NewPlayer.Pawn!=None) NewPlayer.Pawn.Destroy(); // figure out the team number and find the start spot @@ -1219,19 +1219,19 @@ final function bool RespawnPlayer( Controller NewPlayer ) if (NewPlayer.Pawn == None) { NewPlayer.GotoState('Dead'); - if ( PlayerController(NewPlayer) != None ) + if (PlayerController(NewPlayer) != None) PlayerController(NewPlayer).ClientGotoState('Dead','Begin'); return false; } else { // initialize and start it up - if( NavigationPoint(startSpot)!=None ) + if(NavigationPoint(startSpot)!=None) NewPlayer.Pawn.SetAnchor(NavigationPoint(startSpot)); - if ( PlayerController(NewPlayer) != None ) + if (PlayerController(NewPlayer) != None) { PlayerController(NewPlayer).TimeMargin = -0.1; - if( NavigationPoint(startSpot)!=None ) + if(NavigationPoint(startSpot)!=None) NavigationPoint(startSpot).AnchoredPawn = None; // SetAnchor() will set this since IsHumanControlled() won't return true for the Pawn yet } NewPlayer.Pawn.LastStartSpot = PlayerStart(startSpot); @@ -1240,7 +1240,7 @@ final function bool RespawnPlayer( Controller NewPlayer ) NewPlayer.Pawn.PlayTeleportEffect(true, true); NewPlayer.ClientSetRotation(NewPlayer.Pawn.Rotation, TRUE); - if ( !WorldInfo.bNoDefaultInventoryForPlayer ) + if (!WorldInfo.bNoDefaultInventoryForPlayer) { AddPlayerSpecificInv(NewPlayer.Pawn); WorldInfo.Game.AddDefaultInventory(NewPlayer.Pawn); @@ -1282,71 +1282,71 @@ final function bool RespawnPlayer( Controller NewPlayer ) } } - KFGameInfo(WorldInfo.Game).SetTeam( NewPlayer, KFGameInfo(WorldInfo.Game).Teams[0] ); + KFGameInfo(WorldInfo.Game).SetTeam(NewPlayer, KFGameInfo(WorldInfo.Game).Teams[0]); - if( KFPC != none ) + if(KFPC != none) { // Initialize game play post process effects such as damage, low health, etc. KFPC.InitGameplayPostProcessFX(); } - if( KFPRI!=None ) + if(KFPRI!=None) { - if( KFPRI.Deaths == 0 ) + if(KFPRI.Deaths == 0) KFPRI.Score = KFGameInfo(WorldInfo.Game).DifficultyInfo.GetAdjustedStartingCash(); KFPRI.PlayerHealth = NewPlayer.Pawn.Health; - KFPRI.PlayerHealthPercent = FloatToByte( float(NewPlayer.Pawn.Health) / float(NewPlayer.Pawn.HealthMax) ); + KFPRI.PlayerHealthPercent = FloatToByte(float(NewPlayer.Pawn.Health) / float(NewPlayer.Pawn.HealthMax)); } return true; } -function PlayerBuyStats( ExtPlayerController PC, class Perk, int iStat, int Amount ) +function PlayerBuyStats(ExtPlayerController PC, class Perk, int iStat, int Amount) { local Ext_PerkBase P; local int i; - if( bGameHasEnded ) + if(bGameHasEnded) return; P = PC.ActivePerkManager.FindPerk(Perk); - if( P==None || !P.bPerkNetReady || iStat>=P.PerkStats.Length ) + if(P==None || !P.bPerkNetReady || iStat>=P.PerkStats.Length) return; Amount = Min(Amount,P.PerkStats[iStat].MaxValue-P.PerkStats[iStat].CurrentValue); - if( Amount<=0 ) + if(Amount<=0) return; i = Amount*P.PerkStats[iStat].CostPerValue; - if( i>P.CurrentSP ) + if(i>P.CurrentSP) { Amount = P.CurrentSP/P.PerkStats[iStat].CostPerValue; - if( Amount<=0 ) + if(Amount<=0) return; i = Amount*P.PerkStats[iStat].CostPerValue; } P.CurrentSP-=i; - if( !P.IncrementStat(iStat,Amount) ) + if(!P.IncrementStat(iStat,Amount)) PC.ClientMessage("Failed to buy stat."); } -function PlayerChangePerk( ExtPlayerController PC, class NewPerk ) +function PlayerChangePerk(ExtPlayerController PC, class NewPerk) { - if( bGameHasEnded ) + if(bGameHasEnded) return; - if( NewPerk==PC.ActivePerkManager.CurrentPerk.Class ) + if(NewPerk==PC.ActivePerkManager.CurrentPerk.Class) { - if( PC.PendingPerkClass!=None ) + if(PC.PendingPerkClass!=None) { PC.ClientMessage("You will remain the same perk now."); PC.PendingPerkClass = None; } } - else if( PC.ActivePerkManager.CurrentPerk==None || KFPawn_Customization(PC.Pawn)!=None || (!PC.bSetPerk && KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen) ) + else if(PC.ActivePerkManager.CurrentPerk==None || KFPawn_Customization(PC.Pawn)!=None || (!PC.bSetPerk && KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen)) { - if( PC.ActivePerkManager.ApplyPerkClass(NewPerk) ) + if(PC.ActivePerkManager.ApplyPerkClass(NewPerk)) { PC.ClientMessage("You have changed your perk to "$NewPerk.Default.PerkName); PC.bSetPerk = true; } else PC.ClientMessage("Invalid perk "$NewPerk.Default.PerkName); } - else if( PC.bSetPerk ) + else if(PC.bSetPerk) PC.ClientMessage("Can only change perks once per wave"); else { @@ -1354,11 +1354,11 @@ function PlayerChangePerk( ExtPlayerController PC, class NewPerk ) PC.PendingPerkClass = NewPerk; } } -function CheckPerkChange( ExtPlayerController PC ) +function CheckPerkChange(ExtPlayerController PC) { - if( PC.PendingPerkClass!=None ) + if(PC.PendingPerkClass!=None) { - if( PC.ActivePerkManager.ApplyPerkClass(PC.PendingPerkClass) ) + if(PC.ActivePerkManager.ApplyPerkClass(PC.PendingPerkClass)) { PC.ClientMessage("You have changed your perk to "$PC.PendingPerkClass.Default.PerkName); PC.bSetPerk = true; @@ -1372,36 +1372,36 @@ function Tick(float DeltaTime) local bool bCheckedWave; local ExtPlayerController ExtPC; - if( KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen && !bCheckedWave ) + if(KFGameReplicationInfo(WorldInfo.GRI).bTraderIsOpen && !bCheckedWave) { foreach WorldInfo.AllControllers(class'ExtPlayerController',ExtPC) CheckPerkChange(ExtPC); bCheckedWave = true; } - else if( bCheckedWave ) + else if(bCheckedWave) bCheckedWave = false; } -function PlayerBoughtTrait( ExtPlayerController PC, class PerkClass, class Trait ) +function PlayerBoughtTrait(ExtPlayerController PC, class PerkClass, class Trait) { local Ext_PerkBase P; local int i,cost; - if( bGameHasEnded ) + if(bGameHasEnded) return; P = PC.ActivePerkManager.FindPerk(PerkClass); - if( P==None || !P.bPerkNetReady ) + if(P==None || !P.bPerkNetReady) return; - for( i=0; i=Trait.Default.NumLevels ) + if(P.PerkTraits[i].CurrentLevel>=Trait.Default.NumLevels) return; cost = Trait.Static.GetTraitCost(P.PerkTraits[i].CurrentLevel); - if( cost>P.CurrentSP || !Trait.Static.MeetsRequirements(P.PerkTraits[i].CurrentLevel,P) ) + if(cost>P.CurrentSP || !Trait.Static.MeetsRequirements(P.PerkTraits[i].CurrentLevel,P)) return; PC.ActivePerkManager.bStatsDirty = true; @@ -1409,14 +1409,14 @@ function PlayerBoughtTrait( ExtPlayerController PC, class PerkClas P.bForceNetUpdate = true; ++P.PerkTraits[i].CurrentLevel; P.ClientReceiveTraitLvl(i,P.PerkTraits[i].CurrentLevel); - if( P.PerkTraits[i].CurrentLevel==1 ) + if(P.PerkTraits[i].CurrentLevel==1) P.PerkTraits[i].Data = Trait.Static.InitializeFor(P,PC); - if( PC.ActivePerkManager.CurrentPerk==P ) + if(PC.ActivePerkManager.CurrentPerk==P) { Trait.Static.TraitDeActivate(P,P.PerkTraits[i].CurrentLevel-1,P.PerkTraits[i].Data); Trait.Static.TraitActivate(P,P.PerkTraits[i].CurrentLevel,P.PerkTraits[i].Data); - if( KFPawn_Human(PC.Pawn)!=None ) + if(KFPawn_Human(PC.Pawn)!=None) { Trait.Static.CancelEffectOn(KFPawn_Human(PC.Pawn),P,P.PerkTraits[i].CurrentLevel-1,P.PerkTraits[i].Data); Trait.Static.ApplyEffectOn(KFPawn_Human(PC.Pawn),P,P.PerkTraits[i].CurrentLevel,P.PerkTraits[i].Data); @@ -1426,30 +1426,30 @@ function PlayerBoughtTrait( ExtPlayerController PC, class PerkClas } } } -function PlayerUnloadInfo( ExtPlayerController PC, byte CallID, class PerkClass, bool bUnload ) +function PlayerUnloadInfo(ExtPlayerController PC, byte CallID, class PerkClass, bool bUnload) { local Ext_PerkBase P; local int LostExp,NewLvl; // Verify if client tries to cause errors. - if( PC==None || PerkClass==None || PC.ActivePerkManager==None ) + if(PC==None || PerkClass==None || PC.ActivePerkManager==None) return; // Perk unloading disabled on this server. - if( MinUnloadPerkLevel==-1 ) + if(MinUnloadPerkLevel==-1) { - if( !bUnload ) + if(!bUnload) PC.ClientGotUnloadInfo(CallID,0); return; } P = PC.ActivePerkManager.FindPerk(PerkClass); - if( P==None ) // More client hack attempts. + if(P==None) // More client hack attempts. return; - if( P.CurrentLevel PerkClass, bool bPrestige ) +function ResetPlayerPerk(ExtPlayerController PC, class PerkClass, bool bPrestige) { local Ext_PerkBase P; - if( bGameHasEnded ) + if(bGameHasEnded) return; P = PC.ActivePerkManager.FindPerk(PerkClass); - if( P==None || !P.bPerkNetReady ) + if(P==None || !P.bPerkNetReady) return; - if( bPrestige ) + if(bPrestige) { - if( !P.CanPrestige() ) + if(!P.CanPrestige()) { PC.ClientMessage("Prestige for this perk is not allowed."); return; @@ -1502,56 +1502,56 @@ function ResetPlayerPerk( ExtPlayerController PC, class PerkClass, function bool CheckReplacement(Actor Other) { - if( bNoBoomstickJumping && KFWeap_Shotgun_DoubleBarrel(Other)!=None ) + if(bNoBoomstickJumping && KFWeap_Shotgun_DoubleBarrel(Other)!=None) KFWeap_Shotgun_DoubleBarrel(Other).DoubleBarrelKickMomentum = 5.f; return true; } -final function InitCustomChars( ExtPlayerReplicationInfo PRI ) +final function InitCustomChars(ExtPlayerReplicationInfo PRI) { PRI.CustomCharList = CustomCharList; } -final function bool HasPrivs( ExtPlayerReplicationInfo P ) +final function bool HasPrivs(ExtPlayerReplicationInfo P) { return WorldInfo.NetMode==NM_StandAlone || (P!=None && P.ShowAdminName() && (P.AdminType<=1 || P.AdminType==255)); } -function AdminCommand( ExtPlayerController PC, int PlayerID, int Action ) +function AdminCommand(ExtPlayerController PC, int PlayerID, int Action) { local ExtPlayerController E; local int i; - if( bNoAdminCommands ) + if(bNoAdminCommands) { PC.ClientMessage("Admin level commands are disabled.",'Priority'); return; } - if( !HasPrivs(ExtPlayerReplicationInfo(PC.PlayerReplicationInfo)) ) + if(!HasPrivs(ExtPlayerReplicationInfo(PC.PlayerReplicationInfo))) { PC.ClientMessage("You do not have enough admin priveleges.",'Priority'); return; } foreach WorldInfo.AllControllers(class'ExtPlayerController',E) - if( E.PlayerReplicationInfo.PlayerID==PlayerID ) + if(E.PlayerReplicationInfo.PlayerID==PlayerID) break; - if( E==None ) + if(E==None) { PC.ClientMessage("Action failed, missing playerID: "$PlayerID,'Priority'); return; } - if( Action>=100 ) // Set perk level. + if(Action>=100) // Set perk level. { - if( E.ActivePerkManager.CurrentPerk==None ) + if(E.ActivePerkManager.CurrentPerk==None) { PC.ClientMessage(E.PlayerReplicationInfo.PlayerName$" has no perk selected!!!",'Priority'); return; } - if( Action>=100000 ) // Set prestige level. + if(Action>=100000) // Set prestige level. { - if( E.ActivePerkManager.CurrentPerk.MinLevelForPrestige<0 ) + if(E.ActivePerkManager.CurrentPerk.MinLevelForPrestige<0) { PC.ClientMessage("Perk "$E.ActivePerkManager.CurrentPerk.Default.PerkName$" has prestige disabled!",'Priority'); return; @@ -1574,15 +1574,15 @@ function AdminCommand( ExtPlayerController PC, int PlayerID, int Action ) return; } - switch( Action ) + switch(Action) { case 0: // Reset ALL Stats - for( i=0; iWorldInfo.TimeSeconds ) + if(bSpectator==PC.PlayerReplicationInfo.bOnlySpectator || PC.NextSpectateChange>WorldInfo.TimeSeconds) return; PC.NextSpectateChange = WorldInfo.TimeSeconds+0.5; - if( WorldInfo.Game.bGameEnded ) + if(WorldInfo.Game.bGameEnded) PC.ClientMessage("Can't change spectate mode after end-game."); - else if( WorldInfo.Game.bWaitingToStartMatch ) + else if(WorldInfo.Game.bWaitingToStartMatch) PC.ClientMessage("Can't change spectate mode before game has started."); - else if( WorldInfo.Game.AtCapacity(bSpectator,PC.PlayerReplicationInfo.UniqueId) ) + else if(WorldInfo.Game.AtCapacity(bSpectator,PC.PlayerReplicationInfo.UniqueId)) PC.ClientMessage("Can't change spectate mode because game is at its maximum capacity."); - else if( bSpectator ) + else if(bSpectator) { PC.NextSpectateChange = WorldInfo.TimeSeconds+2.5; - if( PC.PlayerReplicationInfo.Team!=None ) + if(PC.PlayerReplicationInfo.Team!=None) PC.PlayerReplicationInfo.Team.RemoveFromTeam(PC); PC.PlayerReplicationInfo.bOnlySpectator = true; - if( PC.Pawn!=None ) + if(PC.Pawn!=None) PC.Pawn.KilledBy(None); PC.Reset(); --WorldInfo.Game.NumPlayers; @@ -1681,7 +1681,7 @@ function PlayerChangeSpec( ExtPlayerController PC, bool bSpectator ) else { PC.PlayerReplicationInfo.bOnlySpectator = false; - if( !WorldInfo.Game.ChangeTeam(PC,WorldInfo.Game.PickTeam(0,PC,PC.PlayerReplicationInfo.UniqueId),false) ) + if(!WorldInfo.Game.ChangeTeam(PC,WorldInfo.Game.PickTeam(0,PC,PC.PlayerReplicationInfo.UniqueId),false)) { PC.PlayerReplicationInfo.bOnlySpectator = true; PC.ClientMessage("Can't become an active player, failed to set a team."); @@ -1692,30 +1692,30 @@ function PlayerChangeSpec( ExtPlayerController PC, bool bSpectator ) --WorldInfo.Game.NumSpectators; PC.Reset(); WorldInfo.Game.Broadcast(PC,PC.PlayerReplicationInfo.GetHumanReadableName()@"became an active player"); - if( bRespawnCheck ) + if(bRespawnCheck) CheckRespawn(PC); } } -function bool GetNextItem( ExtPlayerReplicationInfo PRI, int RepIndex ) +function bool GetNextItem(ExtPlayerReplicationInfo PRI, int RepIndex) { - if( RepIndex>=CustomItemList.Length ) + if(RepIndex>=CustomItemList.Length) return false; PRI.ClientAddTraderItem(RepIndex,CustomItemList[RepIndex]); return true; } -function InitWebAdmin( ExtWebAdmin_UI UI ) +function InitWebAdmin(ExtWebAdmin_UI UI) { local int i; UI.AddSettingsPage("Main Server Ext",Class,WebConfigs,WebAdminGetValue,WebAdminSetValue); - for( i=0; i Ar, int Index, const out string Value ) +final function UpdateArray(out array Ar, int Index, const out string Value) { - if( Value=="#DELETE" ) + if(Value=="#DELETE") Ar.Remove(Index,1); else { - if( Index>=Ar.Length ) + if(Index>=Ar.Length) Ar.Length = Index+1; Ar[Index] = Value; } } -function WebAdminSetValue( name PropName, int ElementIndex, string Value ) +function WebAdminSetValue(name PropName, int ElementIndex, string Value) { - switch( PropName ) + switch(PropName) { case 'StatFileDir': StatFileDir = Value; break; diff --git a/ServerExtMut/Classes/xMapVoteHistory.uc b/ServerExtMut/Classes/xMapVoteHistory.uc index 4dd7a5d..693375e 100644 --- a/ServerExtMut/Classes/xMapVoteHistory.uc +++ b/ServerExtMut/Classes/xMapVoteHistory.uc @@ -9,24 +9,24 @@ struct FMapInfoEntry }; var config array N; -static final function int GetMapHistory( string MapName, string MapTitle ) +static final function int GetMapHistory(string MapName, string MapTitle) { local int i; MapName = Caps(MapName); i = Default.M.Find(MapName); - if( i==-1 ) + if(i==-1) { i = Default.M.Length; Default.M.Length = i+1; Default.M[i] = MapName; Default.N.Length = i+1; } - if( !(MapTitle~=MapName) && MapTitle!=Class'WorldInfo'.Default.Title && MapTitle!="" ) + if(!(MapTitle~=MapName) && MapTitle!=Class'WorldInfo'.Default.Title && MapTitle!="") Default.N[i].T = MapTitle; return i; } -static final function GetHistory( int i, out int UpVotes, out int DownVotes, out int Seq, out int NumP, out string Title ) +static final function GetHistory(int i, out int UpVotes, out int DownVotes, out int Seq, out int NumP, out string Title) { UpVotes = Default.N[i].U; DownVotes = Default.N[i].D; @@ -35,13 +35,13 @@ static final function GetHistory( int i, out int UpVotes, out int DownVotes, out Title = Default.N[i].T; } -static final function UpdateMapHistory( int iWon ) +static final function UpdateMapHistory(int iWon) { local int i; - for( i=(Default.M.Length-1); i>=0; --i ) + for(i=(Default.M.Length-1); i>=0; --i) { - if( i==iWon ) + if(i==iWon) { ++Default.N[i].N; Default.N[i].S = 0; @@ -49,9 +49,9 @@ static final function UpdateMapHistory( int iWon ) else ++Default.N[i].S; } } -static final function AddMapKarma( int i, bool bUp ) +static final function AddMapKarma(int i, bool bUp) { - if( bUp ) + if(bUp) ++Default.N[i].U; else ++Default.N[i].D; } diff --git a/ServerExtMut/Classes/xVoteBroadcast.uc b/ServerExtMut/Classes/xVoteBroadcast.uc index 0347bee..74848cc 100644 --- a/ServerExtMut/Classes/xVoteBroadcast.uc +++ b/ServerExtMut/Classes/xVoteBroadcast.uc @@ -8,26 +8,26 @@ function UpdateSentText() NextBroadcaster.UpdateSentText(); } -function Broadcast( Actor Sender, coerce string Msg, optional name Type ) +function Broadcast(Actor Sender, coerce string Msg, optional name Type) { - if( (Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None ) + if((Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None) Handler.ParseCommand(Mid(Msg,1),PlayerController(Sender)); NextBroadcaster.Broadcast(Sender,Msg,Type); } -function BroadcastTeam( Controller Sender, coerce string Msg, optional name Type ) +function BroadcastTeam(Controller Sender, coerce string Msg, optional name Type) { - if( (Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None ) + if((Type=='Say' || Type=='TeamSay') && Left(Msg,1)=="!" && PlayerController(Sender)!=None) Handler.ParseCommand(Mid(Msg,1),PlayerController(Sender)); NextBroadcaster.BroadcastTeam(Sender,Msg,Type); } -function AllowBroadcastLocalized( actor Sender, class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject ) +function AllowBroadcastLocalized(actor Sender, class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject) { NextBroadcaster.AllowBroadcastLocalized(Sender,Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject); } -event AllowBroadcastLocalizedTeam( int TeamIndex, actor Sender, class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject ) +event AllowBroadcastLocalizedTeam(int TeamIndex, actor Sender, class Message, optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2, optional Object OptionalObject) { NextBroadcaster.AllowBroadcastLocalizedTeam(TeamIndex,Sender,Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject); } diff --git a/ServerExtMut/Classes/xVoteWebApp.uc b/ServerExtMut/Classes/xVoteWebApp.uc index b7dbcf7..777cb93 100644 --- a/ServerExtMut/Classes/xVoteWebApp.uc +++ b/ServerExtMut/Classes/xVoteWebApp.uc @@ -27,14 +27,14 @@ function bool handleQuery(WebAdminQuery q) return false; } -final function IncludeFile( WebAdminQuery q, string file ) +final function IncludeFile(WebAdminQuery q, string file) { local string S; - if( webadmin.HTMLSubDirectory!="" ) + if(webadmin.HTMLSubDirectory!="") { S = webadmin.Path $ "/" $ webadmin.HTMLSubDirectory $ "/" $ file; - if ( q.response.FileExists(S) ) + if (q.response.FileExists(S)) { q.response.IncludeUHTM(S); return; @@ -42,7 +42,7 @@ final function IncludeFile( WebAdminQuery q, string file ) } q.response.IncludeUHTM(webadmin.Path $ "/" $ file); } -final function SendHeader( WebAdminQuery q, string Title ) +final function SendHeader(WebAdminQuery q, string Title) { local IQueryHandler handler; @@ -60,23 +60,23 @@ final function SendHeader( WebAdminQuery q, string Title ) IncludeFile(q,"header.inc"); q.response.SendText("

"$Title$"

"); } -final function SendFooter( WebAdminQuery q ) +final function SendFooter(WebAdminQuery q) { IncludeFile(q,"navigation.inc"); IncludeFile(q,"footer.inc"); q.response.ClearSubst(); } -final function AddConfigEditbox( WebAdminQuery q, string InfoStr, string CurVal, int MaxLen, string ResponseVar, string Tooltip, optional bool bNoTR ) +final function AddConfigEditbox(WebAdminQuery q, string InfoStr, string CurVal, int MaxLen, string ResponseVar, string Tooltip, optional bool bNoTR) { local string S; S = "
"; - if( !bNoTR ) + if(!bNoTR) S = ""$S$""; q.response.SendText(S); } -final function AddInLineEditbox( WebAdminQuery q, string CurVal, int MaxLen, string ResponseVar, string Tooltip ) +final function AddInLineEditbox(WebAdminQuery q, string CurVal, int MaxLen, string ResponseVar, string Tooltip) { q.response.SendText(""); } @@ -86,7 +86,7 @@ function handleMapVotes(WebAdminQuery q) local string S; S = q.request.getVariable("edit"); - if( S=="Submit" ) + if(S=="Submit") { class'xVotingHandler'.Default.VoteTime = int(q.request.getVariable("VT",string(class'xVotingHandler'.Default.VoteTime))); class'xVotingHandler'.Default.MidGameVotePct = float(q.request.getVariable("MV",string(class'xVotingHandler'.Default.MidGameVotePct))); @@ -96,7 +96,7 @@ function handleMapVotes(WebAdminQuery q) class'xVotingHandler'.Static.StaticSaveConfig(); EditSettingLine = -1; } - else if( S=="New" ) + else if(S=="New") { i = class'xVotingHandler'.Default.GameModes.Length; class'xVotingHandler'.Default.GameModes.Length = i+1; @@ -106,9 +106,9 @@ function handleMapVotes(WebAdminQuery q) EditSettingLine = i; class'xVotingHandler'.Static.StaticSaveConfig(); } - else if( S=="Save" ) + else if(S=="Save") { - if( EditSettingLine>=0 && EditSettingLine=0 && EditSettingLine
Settings
"$InfoStr$":
"); q.response.SendText(""); q.response.SendText(""); - for( i=0; i",false); AddInLineEditbox(q,class'xVotingHandler'.Default.GameModes[i].GameName,48,"GN","Game type long display name"); diff --git a/ServerExtMut/Classes/xVotingHandler.uc b/ServerExtMut/Classes/xVotingHandler.uc index 4f1f94d..7227af5 100644 --- a/ServerExtMut/Classes/xVotingHandler.uc +++ b/ServerExtMut/Classes/xVotingHandler.uc @@ -26,21 +26,21 @@ function PostBeginPlay() local int i,j,z,n,UpV,DownV,Seq,NumPl; local string S,MapFile; - if( WorldInfo.Game.BaseMutator==None ) + if(WorldInfo.Game.BaseMutator==None) WorldInfo.Game.BaseMutator = Self; else WorldInfo.Game.BaseMutator.AddMutator(Self); - if( bDeleteMe ) // This was a duplicate instance of the mutator. + if(bDeleteMe) // This was a duplicate instance of the mutator. return; MapFile = string(WorldInfo.GetPackageName()); iCurrentHistory = class'xMapVoteHistory'.Static.GetMapHistory(MapFile,WorldInfo.Title); - if( LastVotedGameInfo<0 || LastVotedGameInfo>=GameModes.Length ) + if(LastVotedGameInfo<0 || LastVotedGameInfo>=GameModes.Length) LastVotedGameInfo = 0; - if( MapChangeDelay==0 ) + if(MapChangeDelay==0) MapChangeDelay = 3; - if( GameModes.Length==0 ) // None specified, so use current settings. + if(GameModes.Length==0) // None specified, so use current settings. { GameModes.Length = 1; GameModes[0].GameName = "Killing Floor"; @@ -56,11 +56,11 @@ function PostBeginPlay() // Build maplist. z = 0; - for( i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i ) + for(i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i) { - for( j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j ) + for(j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j) { - if( MaxMapsOnList>0 && Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=MapFile ) // If we limit the maps count, remove current map. + if(MaxMapsOnList>0 && Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=MapFile) // If we limit the maps count, remove current map. continue; Maps.Length = z+1; Maps[z].MapName = Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]; @@ -76,10 +76,10 @@ function PostBeginPlay() } } - if( MaxMapsOnList>0 ) + if(MaxMapsOnList>0) { // Remove random maps from list. - while( Maps.Length>MaxMapsOnList ) + while(Maps.Length>MaxMapsOnList) Maps.Remove(Rand(Maps.Length),1); } @@ -88,9 +88,9 @@ function PostBeginPlay() } function AddMutator(Mutator M) { - if( M!=Self ) // Make sure we don't get added twice. + if(M!=Self) // Make sure we don't get added twice. { - if( M.Class==Class ) + if(M.Class==Class) M.Destroy(); else Super.AddMutator(M); } @@ -108,15 +108,15 @@ function SetupBroadcast() B.Handler = Self; B.NextBroadcaster = WorldInfo.Game.BroadcastHandler; WorldInfo.Game.BroadcastHandler = B; - if( !bNoWebAdmin ) + if(!bNoWebAdmin) { foreach AllActors(class'WebServer',W) break; - if( W!=None ) + if(W!=None) { - for( i=0; (i<10 && A==None); ++i ) + for(i=0; (i<10 && A==None); ++i) A = WebAdmin(W.ApplicationObjects[i]); - if( A!=None ) + if(A!=None) { xW = new (None) class'xVoteWebApp'; A.addQueryHandler(xW); @@ -126,54 +126,54 @@ function SetupBroadcast() else `Log("X-VoteWebAdmin ERROR: No WebServer object found!"); } } -final function AddVote( int Count, int MapIndex, int GameIndex ) +final function AddVote(int Count, int MapIndex, int GameIndex) { local int i,j; - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) return; - for( i=0; i=0; --j ) + for(j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].ClientReceiveVote(GameIndex,MapIndex,ActiveVotes[i].NumVotes); - if( ActiveVotes[i].NumVotes<=0 ) + if(ActiveVotes[i].NumVotes<=0) { - for( j=(ActiveVoters.Length-1); j>=0; --j ) - if( ActiveVoters[j].DownloadStage==2 && ActiveVoters[j].DownloadIndex>=i && ActiveVoters[j].DownloadIndex>0 ) // Make sure client doesn't skip a download at this point. + for(j=(ActiveVoters.Length-1); j>=0; --j) + if(ActiveVoters[j].DownloadStage==2 && ActiveVoters[j].DownloadIndex>=i && ActiveVoters[j].DownloadIndex>0) // Make sure client doesn't skip a download at this point. --ActiveVoters[j].DownloadIndex; ActiveVotes.Remove(i,1); } return; } - if( Count<=0 ) + if(Count<=0) return; ActiveVotes.Length = i+1; ActiveVotes[i].GameIndex = GameIndex; ActiveVotes[i].MapIndex = MapIndex; ActiveVotes[i].NumVotes = Count; - for( j=(ActiveVoters.Length-1); j>=0; --j ) + for(j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].ClientReceiveVote(GameIndex,MapIndex,Count); } -final function LogoutPlayer( PlayerController PC ) +final function LogoutPlayer(PlayerController PC) { local int i; - for( i=(ActiveVoters.Length-1); i>=0; --i ) - if( ActiveVoters[i].PlayerOwner==PC ) + for(i=(ActiveVoters.Length-1); i>=0; --i) + if(ActiveVoters[i].PlayerOwner==PC) { ActiveVoters[i].Destroy(); break; } } -final function LoginPlayer( PlayerController PC ) +final function LoginPlayer(PlayerController PC) { local xVotingReplication R; local int i; - for( i=(ActiveVoters.Length-1); i>=0; --i ) - if( ActiveVoters[i].PlayerOwner==PC ) + for(i=(ActiveVoters.Length-1); i>=0; --i) + if(ActiveVoters[i].PlayerOwner==PC) return; R = Spawn(class'xVotingReplication',PC); R.VoteHandler = Self; @@ -182,45 +182,45 @@ final function LoginPlayer( PlayerController PC ) function NotifyLogout(Controller Exiting) { - if( PlayerController(Exiting)!=None ) + if(PlayerController(Exiting)!=None) LogoutPlayer(PlayerController(Exiting)); - if ( NextMutator != None ) + if (NextMutator != None) NextMutator.NotifyLogout(Exiting); } function NotifyLogin(Controller NewPlayer) { - if( PlayerController(NewPlayer)!=None ) + if(PlayerController(NewPlayer)!=None) LoginPlayer(PlayerController(NewPlayer)); - if ( NextMutator != None ) + if (NextMutator != None) NextMutator.NotifyLogin(NewPlayer); } -function ClientDownloadInfo( xVotingReplication V ) +function ClientDownloadInfo(xVotingReplication V) { - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) { V.DownloadStage = 255; return; } - switch( V.DownloadStage ) + switch(V.DownloadStage) { case 0: // Game modes. - if( V.DownloadIndex>=GameModes.Length ) + if(V.DownloadIndex>=GameModes.Length) break; V.ClientReceiveGame(V.DownloadIndex,GameModes[V.DownloadIndex].GameName,GameModes[V.DownloadIndex].GameShortName,GameModes[V.DownloadIndex].Prefix); ++V.DownloadIndex; return; case 1: // Maplist. - if( V.DownloadIndex>=Maps.Length ) + if(V.DownloadIndex>=Maps.Length) break; - if( Maps[V.DownloadIndex].MapTitle=="" ) + if(Maps[V.DownloadIndex].MapTitle=="") V.ClientReceiveMap(V.DownloadIndex,Maps[V.DownloadIndex].MapName,Maps[V.DownloadIndex].UpVotes,Maps[V.DownloadIndex].DownVotes,Maps[V.DownloadIndex].Sequence,Maps[V.DownloadIndex].NumPlays); else V.ClientReceiveMap(V.DownloadIndex,Maps[V.DownloadIndex].MapName,Maps[V.DownloadIndex].UpVotes,Maps[V.DownloadIndex].DownVotes,Maps[V.DownloadIndex].Sequence,Maps[V.DownloadIndex].NumPlays,Maps[V.DownloadIndex].MapTitle); ++V.DownloadIndex; return; case 2: // Current votes. - if( V.DownloadIndex>=ActiveVotes.Length ) + if(V.DownloadIndex>=ActiveVotes.Length) break; V.ClientReceiveVote(ActiveVotes[V.DownloadIndex].GameIndex,ActiveVotes[V.DownloadIndex].MapIndex,ActiveVotes[V.DownloadIndex].NumVotes); ++V.DownloadIndex; @@ -233,81 +233,81 @@ function ClientDownloadInfo( xVotingReplication V ) ++V.DownloadStage; V.DownloadIndex = 0; } -function ClientCastVote( xVotingReplication V, int GameIndex, int MapIndex, bool bAdminForce ) +function ClientCastVote(xVotingReplication V, int GameIndex, int MapIndex, bool bAdminForce) { local int i; - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) return; - if( bAdminForce && V.PlayerOwner.PlayerReplicationInfo.bAdmin ) + if(bAdminForce && V.PlayerOwner.PlayerReplicationInfo.bAdmin) { SwitchToLevel(GameIndex,MapIndex,true); return; } - if( !Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[MapIndex].MapName,GameModes[GameIndex].Prefix) ) + if(!Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[MapIndex].MapName,GameModes[GameIndex].Prefix)) { V.PlayerOwner.ClientMessage("Error: Can't vote that map (wrong Prefix to that game mode)!"); return; } - if( V.CurrentVote[0]>=0 ) + if(V.CurrentVote[0]>=0) AddVote(-1,V.CurrentVote[1],V.CurrentVote[0]); V.CurrentVote[0] = GameIndex; V.CurrentVote[1] = MapIndex; AddVote(1,MapIndex,GameIndex); - for( i=(ActiveVoters.Length-1); i>=0; --i ) + for(i=(ActiveVoters.Length-1); i>=0; --i) ActiveVoters[i].ClientNotifyVote(V.PlayerOwner.PlayerReplicationInfo,GameIndex,MapIndex); TallyVotes(); } -function ClientRankMap( xVotingReplication V, bool bUp ) +function ClientRankMap(xVotingReplication V, bool bUp) { class'xMapVoteHistory'.Static.AddMapKarma(iCurrentHistory,bUp); } -function ClientDisconnect( xVotingReplication V ) +function ClientDisconnect(xVotingReplication V) { ActiveVoters.RemoveItem(V); - if( V.CurrentVote[0]>=0 ) + if(V.CurrentVote[0]>=0) AddVote(-1,V.CurrentVote[1],V.CurrentVote[0]); TallyVotes(); } -final function float GetPctOf( int Nom, int Denom ) +final function float GetPctOf(int Nom, int Denom) { local float R; R = float(Nom) / float(Denom); return R; } -final function TallyVotes( optional bool bForce ) +final function TallyVotes(optional bool bForce) { local int i,NumVotees,c,j; local array Candidates; - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) return; NumVotees = ActiveVoters.Length; c = 0; - if( bForce ) + if(bForce) { // First check for highest result. - for( i=(ActiveVotes.Length-1); i>=0; --i ) + for(i=(ActiveVotes.Length-1); i>=0; --i) c = Max(c,ActiveVotes[i].NumVotes); - if( c>0 ) + if(c>0) { // Then check how many votes for the best. - for( i=(ActiveVotes.Length-1); i>=0; --i ) - if( ActiveVotes[i].NumVotes==c ) + for(i=(ActiveVotes.Length-1); i>=0; --i) + if(ActiveVotes[i].NumVotes==c) Candidates.AddItem(i); // Finally pick a random winner from the best. c = Candidates[Rand(Candidates.Length)]; - if( NumVotees>=4 && ActiveVotes.Length==1 ) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. + if(NumVotees>=4 && ActiveVotes.Length==1) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. { - for( j=(ActiveVoters.Length-1); j>=0; --j ) + for(j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].PlayerOwner.ClientPlaySound(AnnouncerCues[13]); } SwitchToLevel(ActiveVotes[c].GameIndex,ActiveVotes[c].MapIndex,false); @@ -318,11 +318,11 @@ final function TallyVotes( optional bool bForce ) c = Rand(Maps.Length); // Pick a random gametype to win along with it. - for( i=(GameModes.Length-1); i>=0; --i ) - if( Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[c].MapName,GameModes[i].Prefix) ) + for(i=(GameModes.Length-1); i>=0; --i) + if(Class'xUI_MapVote'.Static.BelongsToPrefix(Maps[c].MapName,GameModes[i].Prefix)) Candidates.AddItem(i); - if( Candidates.Length==0 ) // Odd, a map without gametype... + if(Candidates.Length==0) // Odd, a map without gametype... i = Rand(GameModes.Length); else i = Candidates[Rand(Candidates.Length)]; @@ -332,14 +332,14 @@ final function TallyVotes( optional bool bForce ) } // Check for insta-win vote. - for( i=(ActiveVotes.Length-1); i>=0; --i ) + for(i=(ActiveVotes.Length-1); i>=0; --i) { c+=ActiveVotes[i].NumVotes; - if( GetPctOf(ActiveVotes[i].NumVotes,NumVotees)>=MapWinPct ) + if(GetPctOf(ActiveVotes[i].NumVotes,NumVotees)>=MapWinPct) { - if( NumVotees>=4 && ActiveVotes.Length==1 ) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. + if(NumVotees>=4 && ActiveVotes.Length==1) // If more then 4 voters and everyone voted same map?!!! Give the mapvote some orgy. { - for( j=(ActiveVoters.Length-1); j>=0; --j ) + for(j=(ActiveVoters.Length-1); j>=0; --j) ActiveVoters[j].PlayerOwner.ClientPlaySound(AnnouncerCues[13]); } SwitchToLevel(ActiveVotes[i].GameIndex,ActiveVotes[i].MapIndex,false); @@ -348,19 +348,19 @@ final function TallyVotes( optional bool bForce ) } // Check for mid-game voting timer. - if( !bMapVoteTimer && NumVotees>0 && GetPctOf(c,NumVotees)>=MidGameVotePct ) + if(!bMapVoteTimer && NumVotees>0 && GetPctOf(c,NumVotees)>=MidGameVotePct) StartMidGameVote(true); } -final function StartMidGameVote( bool bMidGame ) +final function StartMidGameVote(bool bMidGame) { local int i; - if( bMapVoteTimer || bMapvoteHasEnded ) + if(bMapVoteTimer || bMapvoteHasEnded) return; bMapVoteTimer = true; - if( bMidGame ) + if(bMidGame) { - for( i=(ActiveVoters.Length-1); i>=0; --i ) + for(i=(ActiveVoters.Length-1); i>=0; --i) ActiveVoters[i].ClientNotifyVoteTime(0); } ShowMenuDelay = 5; @@ -369,15 +369,15 @@ final function StartMidGameVote( bool bMidGame ) } function CheckEndGameEnded() { - if( KF==None ) + if(KF==None) { KF = KFGameReplicationInfo(WorldInfo.GRI); - if( KF==None ) + if(KF==None) return; } - if( KF.bMatchIsOver ) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! + if(KF.bMatchIsOver) // HACK, since KFGameInfo_Survival doesn't properly notify mutators of this! { - if( !bMapVoteTimer ) + if(!bMapVoteTimer) StartMidGameVote(false); ClearTimer('CheckEndGameEnded'); WorldInfo.Game.ClearTimer('ShowPostGameMenu'); @@ -385,7 +385,7 @@ function CheckEndGameEnded() } function bool HandleRestartGame() { - if( !bMapVoteTimer ) + if(!bMapVoteTimer) StartMidGameVote(false); return true; } @@ -394,9 +394,9 @@ function Timer() local int i; local SoundCue FX; - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) { - if( WorldInfo.NextSwitchCountdown<=0.f ) // Mapswitch failed, force to random other map. + if(WorldInfo.NextSwitchCountdown<=0.f) // Mapswitch failed, force to random other map. { ActiveVotes.Length = 0; bMapvoteHasEnded = false; @@ -404,47 +404,47 @@ function Timer() } return; } - if( ShowMenuDelay>0 && --ShowMenuDelay==0 ) + if(ShowMenuDelay>0 && --ShowMenuDelay==0) { - for( i=(ActiveVoters.Length-1); i>=0; --i ) + for(i=(ActiveVoters.Length-1); i>=0; --i) ActiveVoters[i].ClientOpenMapvote(true); } --VoteTimeLeft; - if( VoteTimeLeft==0 ) + if(VoteTimeLeft==0) { TallyVotes(true); } - else if( VoteTimeLeft<=10 || VoteTimeLeft==20 || VoteTimeLeft==30 || VoteTimeLeft==60 ) + else if(VoteTimeLeft<=10 || VoteTimeLeft==20 || VoteTimeLeft==30 || VoteTimeLeft==60) { FX = None; - if( VoteTimeLeft<=10 ) + if(VoteTimeLeft<=10) FX = AnnouncerCues[VoteTimeLeft-1]; - else if( VoteTimeLeft==20 ) + else if(VoteTimeLeft==20) FX = AnnouncerCues[10]; - else if( VoteTimeLeft==30 ) + else if(VoteTimeLeft==30) FX = AnnouncerCues[11]; - else if( VoteTimeLeft==60 ) + else if(VoteTimeLeft==60) FX = AnnouncerCues[12]; - for( i=(ActiveVoters.Length-1); i>=0; --i ) + for(i=(ActiveVoters.Length-1); i>=0; --i) { ActiveVoters[i].ClientNotifyVoteTime(VoteTimeLeft); - if( FX!=None ) + if(FX!=None) ActiveVoters[i].PlayerOwner.ClientPlaySound(FX); } } } -final function SwitchToLevel( int GameIndex, int MapIndex, bool bAdminForce ) +final function SwitchToLevel(int GameIndex, int MapIndex, bool bAdminForce) { local int i; local string S; - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) return; Default.LastVotedGameInfo = GameIndex; Class.Static.StaticSaveConfig(); bMapvoteHasEnded = true; - if( !bAdminForce && !bHistorySaved ) + if(!bAdminForce && !bHistorySaved) { class'xMapVoteHistory'.Static.UpdateMapHistory(Maps[MapIndex].History); class'xMapVoteHistory'.Static.StaticSaveConfig(); @@ -452,16 +452,16 @@ final function SwitchToLevel( int GameIndex, int MapIndex, bool bAdminForce ) } S = Maps[MapIndex].MapName$" ("$GameModes[GameIndex].GameName$")"; - for( i=(ActiveVoters.Length-1); i>=0; --i ) + for(i=(ActiveVoters.Length-1); i>=0; --i) { KFPlayerController(ActiveVoters[i].PlayerOwner).ShowConnectionProgressPopup(PMT_AdminMessage,"Switching to level:",S); ActiveVoters[i].ClientNotifyVoteWin(GameIndex,MapIndex,bAdminForce); } PendingMapURL = Maps[MapIndex].MapName$"?Game="$GameModes[GameIndex].GameClass$"?Mutator="$PathName(BaseMutator); - if( GameModes[GameIndex].Mutators!="" ) + if(GameModes[GameIndex].Mutators!="") PendingMapURL $= ","$GameModes[GameIndex].Mutators; - if( GameModes[GameIndex].Options!="" ) + if(GameModes[GameIndex].Options!="") PendingMapURL $= "?"$GameModes[GameIndex].Options; `Log("MapVote: Switch map to "$PendingMapURL); SetTimer(FMax(MapChangeDelay,0.1),false,'PendingSwitch'); @@ -472,62 +472,62 @@ function PendingSwitch() SetTimer(1,true); } -final function ParseCommand( string Cmd, PlayerController PC ) +final function ParseCommand(string Cmd, PlayerController PC) { - if( Cmd~="Help" ) + if(Cmd~="Help") { PC.ClientMessage("MapVote commands:"); PC.ClientMessage("!MapVote - Show mapvote menu"); PC.ClientMessage("!AddMap - Add map to mapvote"); PC.ClientMessage("!RemoveMap - Remove map from mapvote"); } - else if( Cmd~="MapVote" ) + else if(Cmd~="MapVote") ShowMapVote(PC); - else if( !PC.PlayerReplicationInfo.bAdmin && !PC.IsA('MessagingSpectator') ) + else if(!PC.PlayerReplicationInfo.bAdmin && !PC.IsA('MessagingSpectator')) return; - else if( Left(Cmd,7)~="AddMap " ) + else if(Left(Cmd,7)~="AddMap ") { Cmd = Mid(Cmd,7); PC.ClientMessage("Added map '"$Cmd$"'!"); AddMap(Cmd); } - else if( Left(Cmd,10)~="RemoveMap " ) + else if(Left(Cmd,10)~="RemoveMap ") { Cmd = Mid(Cmd,10); - if( RemoveMap(Cmd) ) + if(RemoveMap(Cmd)) PC.ClientMessage("Removed map '"$Cmd$"'!"); else PC.ClientMessage("Map '"$Cmd$"' not found!"); } } -function ShowMapVote( PlayerController PC ) +function ShowMapVote(PlayerController PC) { local int i; - if( bMapvoteHasEnded ) + if(bMapvoteHasEnded) return; - for( i=(ActiveVoters.Length-1); i>=0; --i ) - if( ActiveVoters[i].PlayerOwner==PC ) + for(i=(ActiveVoters.Length-1); i>=0; --i) + if(ActiveVoters[i].PlayerOwner==PC) { ActiveVoters[i].ClientOpenMapvote(false); return; } } -final function AddMap( string M ) +final function AddMap(string M) { - if( Class'KFGameInfo'.Default.GameMapCycles.Length==0 ) + if(Class'KFGameInfo'.Default.GameMapCycles.Length==0) Class'KFGameInfo'.Default.GameMapCycles.Length = 1; Class'KFGameInfo'.Default.GameMapCycles[0].Maps.AddItem(M); Class'KFGameInfo'.Static.StaticSaveConfig(); } -final function bool RemoveMap( string M ) +final function bool RemoveMap(string M) { local int i,j; - for( i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i ) + for(i=(Class'KFGameInfo'.Default.GameMapCycles.Length-1); i>=0; --i) { - for( j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j ) + for(j=(Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Length-1); j>=0; --j) { - if( Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=M ) + if(Class'KFGameInfo'.Default.GameMapCycles[i].Maps[j]~=M) { Class'KFGameInfo'.Default.GameMapCycles[i].Maps.Remove(j,1); Class'KFGameInfo'.Static.StaticSaveConfig();
Mapvote game modes
Game NameGame Short NameGame ClassMutatorsOptionsMap Prefix