style: controls

This commit is contained in:
GenZmeY 2020-11-28 23:12:58 +03:00
parent ee260f7a10
commit 8fa925e1e5
165 changed files with 2625 additions and 2625 deletions

View File

@ -24,13 +24,13 @@ function DoAutoPurchase()
GetTraderItems();
EP = GetExtPerk();
if(EP==None || EP.AutoBuyLoadOutPath.length == 0)
if (EP==None || EP.AutoBuyLoadOutPath.length == 0)
return;
for(i = 0; i<EP.AutoBuyLoadOutPath.length; i++)
for (i = 0; i<EP.AutoBuyLoadOutPath.length; i++)
{
ItemIndex = TraderItems.SaleItems.Find('WeaponDef', EP.AutoBuyLoadOutPath[i]);
if(ItemIndex != INDEX_NONE)
if (ItemIndex != INDEX_NONE)
OnPerkWeapons.AddItem(TraderItems.SaleItems[ItemIndex]);
}
@ -38,7 +38,7 @@ function DoAutoPurchase()
TopTierWeapon = GetTopTierWeapon(OnPerkWeapons);
//can I afford my top teir without selling my current weapon?
if(!DoIOwnThisWeapon(TopTierWeapon) && GetCanAfford(GetAdjustedBuyPriceFor(TopTierWeapon) + DoshBuffer) && CanCarry(TopTierWeapon))
if (!DoIOwnThisWeapon(TopTierWeapon) && GetCanAfford(GetAdjustedBuyPricefor (TopTierWeapon) + DoshBuffer) && CanCarry(TopTierWeapon))
{
bUpgradeSuccess = AttemptUpgrade(TotalDosh, OnPerkWeapons, true);
}
@ -49,9 +49,9 @@ function DoAutoPurchase()
}
bAutoFillPurchasedItem = StartAutoFill();
if(DoIOwnThisWeapon(TopTierWeapon))
if (DoIOwnThisWeapon(TopTierWeapon))
{
while(AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons))
while (AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons))
{
bSecondaryWeaponPurchased = true;
AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons);
@ -60,15 +60,15 @@ function DoAutoPurchase()
MyKFIM.ServerCloseTraderMenu();
if(bUpgradeSuccess)
if (bUpgradeSuccess)
{
AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.WeaponUpgradeComepleteString;
}
else if(bSecondaryWeaponPurchased)
else if (bSecondaryWeaponPurchased)
{
AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.SecondaryWeaponPurchasedString;
}
else if(bAutoFillPurchasedItem)
else if (bAutoFillPurchasedItem)
{
AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.AutoFillCompleteString;
}
@ -78,7 +78,7 @@ function DoAutoPurchase()
}
if(MyGFxHUD != none)
if (MyGFxHUD != none)
{
MyGFxHUD.ShowNonCriticalMessage(class'KFCommon_LocalizedStrings'.default.AutoTradeCompleteString$AutoFillMessageString);
}
@ -90,11 +90,11 @@ function SellOnPerkWeapons()
local class<KFPerk> 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,9 +112,9 @@ 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)
if (EP.AutoBuyLoadOutPath.Find(OwnedItemList[i].DefaultItem.WeaponDef) == INDEX_NONE)
{
SellWeapon(OwnedItemList[i], i);
i=-1;
@ -136,7 +136,7 @@ function InitializeOwnedItemList()
TraderItems = KFGameReplicationInfo(WorldInfo.GRI).TraderItems;
KFP = KFPawn_Human(Pawn);
if(KFP != none)
if (KFP != none)
{
// init armor purchase values
ArmorItem.SpareAmmoCount = KFP.Armor;
@ -156,14 +156,14 @@ function InitializeOwnedItemList()
for (Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory)
{
KFW = KFWeapon(Inv);
if(KFW != none)
if (KFW != none)
{
// Set the weapon information and add it to the OwnedItemList
SetWeaponInformation(KFW);
}
}
if(MyGfxManager != none && MyGfxManager.TraderMenu != none)
if (MyGfxManager != none && MyGfxManager.TraderMenu != none)
{
MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList;
}
@ -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;
@ -215,14 +215,14 @@ function int AddItemByPriority(out SItemInformation 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);
}
if(MyGfxManager != none && MyGfxManager.TraderMenu != none)
if (MyGfxManager != none && MyGfxManager.TraderMenu != none)
{
MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList;
}
@ -234,7 +234,7 @@ function bool CanCarry(const out STraderItem Item, optional int OverrideLevelVal
{
local int Result;
Result = TotalBlocks + MyKFIM.GetDisplayedBlocksRequiredFor(Item);
Result = TotalBlocks + MyKFIM.GetDisplayedBlocksRequiredfor (Item);
if (Result > MaxBlocks)
{
return false;

View File

@ -9,7 +9,7 @@ final function FMyCustomChar LoadData()
{
local FMyCustomChar R;
if(HasInit==0)
if (HasInit==0)
{
AttachmentMesh0 = 255;
AttachmentMesh1 = 255;

View File

@ -10,18 +10,18 @@ static final function CloneMIC(MaterialInstanceConstant B)
local LinearColor C;
M = MaterialInstanceConstant(B.Parent);
if(M==None)
if (M==None)
return;
B.SetParent(M.Parent);
for(i=0; i<M.TextureParameterValues.Length; ++i)
if(M.TextureParameterValues[i].ParameterValue!=None)
for (i=0; i<M.TextureParameterValues.Length; ++i)
if (M.TextureParameterValues[i].ParameterValue!=None)
B.SetTextureParameterValue(M.TextureParameterValues[i].ParameterName,M.TextureParameterValues[i].ParameterValue);
for(i=0; i<M.ScalarParameterValues.Length; ++i)
for (i=0; i<M.ScalarParameterValues.Length; ++i)
B.SetScalarParameterValue(M.ScalarParameterValues[i].ParameterName,M.ScalarParameterValues[i].ParameterValue);
for(i=0; i<M.VectorParameterValues.Length; ++i)
for (i=0; i<M.VectorParameterValues.Length; ++i)
{
C = M.VectorParameterValues[i].ParameterValue;
B.SetVectorParameterValue(M.VectorParameterValues[i].ParameterName,C);
@ -40,7 +40,7 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
{
local int i;
if(P.WorldInfo.NetMode == NM_DedicatedServer)
if (P.WorldInfo.NetMode == NM_DedicatedServer)
{
return;
}
@ -55,7 +55,7 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
}
// head MIC
if(P.ThirdPersonHeadMeshComponent != None)
if (P.ThirdPersonHeadMeshComponent != None)
{
P.CharacterMICs[1] = P.ThirdPersonHeadMeshComponent.CreateAndSetMaterialInstanceConstant(C.HeadMaterialID);
@ -67,9 +67,9 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
}
// attachment MIC
for(i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++)
for (i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++)
{
if(P.ThirdPersonAttachments[i] != none)
if (P.ThirdPersonAttachments[i] != none)
{
P.CharacterMICs.AddItem(P.ThirdPersonAttachments[i].CreateAndSetMaterialInstanceConstant(0));
}
@ -115,14 +115,14 @@ static final function SetCharacterMeshFromArch(KFCharacterInfo_Human C, KFPawn K
{
// Must clear all attachments before trying to attach new ones,
// otherwise we might accidentally remove things we're not supposed to
for(AttachmentIdx=0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++)
for (AttachmentIdx=0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++)
{
// Clear any previous attachments from other characters
C.DetachAttachment(AttachmentIdx, KFP);
}
// Cosmetic attachment mesh & skin. Index of 255 implies don't use any attachments (default)
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 != `CLEARED_ATTACHMENT_INDEX && CosmeticMeshIdx != INDEX_NONE)
@ -159,7 +159,7 @@ static final function SetBodyMeshAndSkin(KFCharacterInfo_Human C,
}
// Character Mesh
if(C.BodyVariants.length > 0)
if (C.BodyVariants.length > 0)
{
// Assign a skin to the body mesh as a material override
CurrentBodyMeshIndex = (CurrentBodyMeshIndex < C.BodyVariants.length) ? CurrentBodyMeshIndex : 0;
@ -199,7 +199,7 @@ static final function SetBodySkinMaterial(KFCharacterInfo_Human C, OutfitVariant
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, OutfitVariant
else
{
// Use material specified in the mesh asset
for(i=0; i<KFP.Mesh.GetNumElements(); i++)
for (i=0; i<KFP.Mesh.GetNumElements(); i++)
{
KFP.Mesh.SetMaterial(i, none);
}
@ -222,7 +222,7 @@ static final function SetHeadSkinMaterial(KFCharacterInfo_Human C, OutfitVariant
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;
@ -231,7 +231,7 @@ static final function SetHeadSkinMaterial(KFCharacterInfo_Human C, OutfitVariant
else
{
// Use material specified in the mesh asset
for(i=0; i<KFP.ThirdPersonHeadMeshComponent.GetNumElements(); i++)
for (i=0; i<KFP.ThirdPersonHeadMeshComponent.GetNumElements(); i++)
{
KFP.ThirdPersonHeadMeshComponent.SetMaterial(i, none);
}
@ -287,7 +287,7 @@ 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)
@ -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);
}
@ -392,7 +392,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C,
}
// Set First Person Cosmetic if mesh exists for it.
if(CharAttachmentMeshName != "")
if (CharAttachmentMeshName != "")
{
// Set Cosmetic Mesh
SetAttachmentMesh(C, CurrentAttachmentMeshIndex, AttachmentSlotIndex, CharAttachmentMeshName, CharAttachmentSocketName, AttachmentMesh, KFP, bIsFirstPerson);
@ -400,7 +400,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C,
else
{
// Make sure to clear out attachment if we're replacing with nothing.
if(bIsFirstPerson)
if (bIsFirstPerson)
{
KFP.FirstPersonAttachments[AttachmentSlotIndex] = none;
KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = '';
@ -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);
}
@ -463,7 +463,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
}
SkeletalAttachment.SetActorCollision(false, false);
if(bIsFirstPerson)
if (bIsFirstPerson)
{
KFP.FirstPersonAttachments[AttachmentSlotIndex] = SkeletalAttachment;
}
@ -503,7 +503,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
StaticAttachment = new(KFP) class'StaticMeshComponent';
StaticAttachment.SetActorCollision(false, false);
if(bIsFirstPerson)
if (bIsFirstPerson)
{
KFP.FirstPersonAttachments[AttachmentSlotIndex] = StaticAttachment;
}
@ -533,7 +533,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
AttachmentSocket.RelativeScale * AttachmentScaleRelativeToSocket);
}
if(bIsFirstPerson)
if (bIsFirstPerson)
{
KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = CharAttachmentSocketName;
}
@ -563,14 +563,14 @@ static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int
// 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)
continue;
// Remove the object if it is taking up our desired slot
if(KFP.ThirdPersonAttachmentSocketNames[i] != '' &&
if (KFP.ThirdPersonAttachmentSocketNames[i] != '' &&
KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName)
{
C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI);
@ -578,14 +578,14 @@ static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int
}
// 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;
@ -633,7 +633,7 @@ static final function SetFirstPersonArmsFromArch(KFCharacterInfo_Human C, KFPawn
}
// 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;
}

View File

@ -10,16 +10,16 @@ static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC)
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;
@ -30,7 +30,7 @@ static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC)
static final function SaveEquippedEmote(int ItemId, ExtPlayerController PC)
{
if(PC == None)
if (PC == None)
return;
PC.SelectedEmoteIndex = ItemId;
@ -46,7 +46,7 @@ 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;

View File

@ -1,6 +1,6 @@
class ExtExplosion_SirenScream extends KFExplosion_SirenScream;
protected function SpecialCringeEffectsFor(Actor Victim, float VictimDist)
protected function SpecialCringeEffectsfor (Actor Victim, float VictimDist)
{
return;
}

View File

@ -8,7 +8,7 @@ function InitMenu()
PageSwitcher = KFGUI_SwitchMenuBar(FindComponentID('Pager'));
Super(KFGUI_Page).InitMenu();
for(i=0; i<Pages.Length; ++i)
for (i=0; i<Pages.Length; ++i)
{
PageSwitcher.AddPage(Pages[i],B).InitMenu();
}
@ -28,14 +28,14 @@ function PreDraw()
Viewport = LocalPlayer(GetPlayer().Player).ViewportClient;
MovieManager = ExtMoviePlayer_Manager(KFPlayerController(GetPlayer()).MyGFxManager);
if(CaptureMouse())
if (CaptureMouse())
{
Viewport.bDisplayHardwareMouseCursor = true;
Viewport.ForceUpdateMouseCursor(true);
MovieManager.SetMovieCanReceiveInput(false);
}
else if(Viewport.bDisplayHardwareMouseCursor)
else if (Viewport.bDisplayHardwareMouseCursor)
{
Viewport.bDisplayHardwareMouseCursor = false;
Viewport.ForceUpdateMouseCursor(true);

View File

@ -7,22 +7,22 @@ function UpdateGrenades()
local int CurrentGrenades;
local ExtPerkManager PM;
if(MyKFInvManager != none)
if (MyKFInvManager != none)
CurrentGrenades = MyKFInvManager.GrenadeCount;
//Update the icon the for grenade type.
if(ExtPlayerController(MyKFPC)!=None)
if (ExtPlayerController(MyKFPC)!=None)
{
PM = ExtPlayerController(MyKFPC).ActivePerkManager;
if(PM!=None && PM.CurrentPerk!=None && EPerkClass!=PM.CurrentPerk.Class)
if (PM!=None && PM.CurrentPerk!=None && EPerkClass!=PM.CurrentPerk.Class)
{
SetString("backpackGrenadeType", "img://"$PM.CurrentPerk.GrenadeWeaponDef.Static.GetImagePath());
EPerkClass = PM.CurrentPerk.Class;
}
}
// Update the grenades count value
if(CurrentGrenades != LastGrenades)
if (CurrentGrenades != LastGrenades)
{
SetInt("backpackGrenades" , Min(CurrentGrenades,9));
LastGrenades = CurrentGrenades;

View File

@ -16,7 +16,7 @@ function UpdatePerk()
local Ext_PerkBase CurrentPerk;
local GFxObject PerkIconObject;
if(ExPC == none || ExPC.ActivePerkManager==None || ExPC.ActivePerkManager.CurrentPerk==None)
if (ExPC == none || ExPC.ActivePerkManager==None || ExPC.ActivePerkManager.CurrentPerk==None)
return;
CurrentPerk = ExPC.ActivePerkManager.CurrentPerk;
@ -24,7 +24,7 @@ function UpdatePerk()
CurrentPerkEXP = CurrentPerk.CurrentEXP;
// Update the perk class.
if((ExLastPerkClass != CurrentPerk.Class) || (LastPerkLevel != CurrentPerkLevel))
if ((ExLastPerkClass != CurrentPerk.Class) || (LastPerkLevel != CurrentPerkLevel))
{
CurPerkPath = CurrentPerk.GetPerkIconPath(CurrentPerkLevel);
@ -33,7 +33,7 @@ function UpdatePerk()
SetObject("playerPerkIcon", PerkIconObject);
SetInt("playerPerkXPPercent", CurrentPerk.GetProgressPercent() * 100.f);
if(LastPerkLevel != CurrentPerkLevel && ExLastPerkClass==CurrentPerk.Class)
if (LastPerkLevel != CurrentPerkLevel && ExLastPerkClass==CurrentPerk.Class)
{
SetBool("bLevelUp", true);
ShowXPBark(CurrentPerkEXP-LastEXPValue,CurPerkPath,true);
@ -44,7 +44,7 @@ function UpdatePerk()
LastPerkLevel = CurrentPerkLevel;
LastEXPValue = CurrentPerkEXP;
}
else if(LastEXPValue!=CurrentPerkEXP)
else if (LastEXPValue!=CurrentPerkEXP)
{
SetBool("bLevelUp", false);
SetInt("playerPerkXPPercent", CurrentPerk.GetProgressPercent() * 100.f);
@ -59,12 +59,12 @@ function ShowXPBark(int DeltaXP, string IconPath, bool bIsCurrentPerk)
function UpdateHealth()
{
if(MyPC.Pawn == none)
if (MyPC.Pawn == none)
{
LastHealth = 0;
SetInt("playerHealth" , LastHealth);
}
else if(LastHealth != MyPC.Pawn.Health)
else if (LastHealth != MyPC.Pawn.Health)
{
LastHealth = MyPC.Pawn.Health;
SetInt("playerHealth" , LastHealth);

View File

@ -20,18 +20,18 @@ function UpdatePlayerInfo(optional bool bForceUpdate)
local GFxObject TempObject;
local ExtPlayerReplicationInfo E;
if(SpectatedKFPRI == None)
if (SpectatedKFPRI == None)
return;
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
if(LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate)
if (LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate)
{
LastPerkLevel = E.ECurrentPerkLevel;
ExtLastPerkClass = E.ECurrentPerk;
TempObject = CreateObject("Object");
TempObject.SetString("playerName", SpectatedKFPRI.GetHumanReadableName());
if(ExtLastPerkClass!=None && TempObject !=None)
if (ExtLastPerkClass!=None && TempObject !=None)
{
TempObject.SetString("playerPerk", SpectatedKFPRI.CurrentPerkClass.default.LevelString @LastPerkLevel @ExtLastPerkClass.default.PerkName);
TempObject.SetString("iconPath", ExtLastPerkClass.Static.GetPerkIconPath(LastPerkLevel));

View File

@ -4,14 +4,14 @@ function TickHud(float DeltaTime)
{
local int i;
if(KFGRI == none)
if (KFGRI == none)
KFGRI = KFGameReplicationInfo(GetPC().WorldInfo.GRI);
else
{
if(KFGRI.bTraderIsOpen)
if (KFGRI.bTraderIsOpen)
{
i = KFGRI.GetTraderTimeRemaining();
if(LastTraderTimeRemaining != i)
if (LastTraderTimeRemaining != i)
{
SetInt("remainingTraderTime" ,i);
LastTraderTimeRemaining = i;
@ -20,7 +20,7 @@ function TickHud(float DeltaTime)
else
{
i = KFGRI.IsFinalWave() ? INDEX_NONE : Max(KFGRI.AIRemaining,0);
if(LastZEDCount != i)
if (LastZEDCount != i)
{
SetInt("remainingZEDs" ,i);
LastZEDCount = i;
@ -28,17 +28,17 @@ function TickHud(float DeltaTime)
}
// Max # of waves.
if(LastWaveMax != KFGRI.WaveMax)
if (LastWaveMax != KFGRI.WaveMax)
{
LastWaveMax = KFGRI.WaveMax;
SetInt("maxWaves" ,LastWaveMax-1);
}
// Current wave we're on.
if(LastWave!=KFGRI.WaveNum)
if (LastWave!=KFGRI.WaveNum)
{
LastWave = KFGRI.WaveNum;
if(LastWave>LastWaveMax)
if (LastWave>LastWaveMax)
{
SetInt("currentWave",0); // Force text to refresh.
SetString("finalText", "END");

View File

@ -29,7 +29,7 @@ simulated function UpdateWeaponGroupOnHUD(byte GroupIndex)
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;
}
@ -52,7 +52,7 @@ simulated function SetWeaponGroupList(out array<KFWeapon> WeaponList, byte Group
{
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());
@ -69,7 +69,7 @@ simulated function SetWeaponGroupList(out array<KFWeapon> WeaponList, byte Group
//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)
if (WeaponList[i].UsesSecondaryAmmo() && WeaponList[i].bCanRefillSecondaryAmmo)
{
TempObj.SetBool("bCanRefillSecondaryAmmo", WeaponList[i].SpareAmmoCapacity[1] > 0);
TempObj.SetInt("secondaryAmmoCount", WeaponList[i].AmmoCount[1]);

View File

@ -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> 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> 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> 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,7 +62,7 @@ simulated function bool Died(Controller Killer, class<DamageType> 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)
return FALSE;
@ -75,7 +75,7 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
}
Health = 0;
foreach LatentActions(Action)
Action.AbortFor(self);
Action.Abortfor (self);
if (Controller != None)
WorldInfo.Game.Killed(Killer, Controller, self, damageType);
else WorldInfo.Game.Killed(Killer, Controller(Owner), self, damageType);
@ -84,7 +84,7 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
InvManager.OwnerDied();
Health = 1;
if(!bFeigningDeath)
if (!bFeigningDeath)
PlayFeignDeath(true,,true);
Health = 0;
ClearTimer('UnsetFeignDeath');
@ -123,92 +123,92 @@ event bool HealDamage(int Amount, Controller Healer, class<DamageType> DamageTyp
InstigatorPC = ExtPlayerController(Healer);
InstigatorPerk = InstigatorPC.GetPerk();
if(InstigatorPerk != None && bCanRepairArmor)
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<KFDamageType>(DamageType);
if(KFDT != none && KFDT.default.bNoPain)
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)
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)
if (InstigatorPRI!=None)
InstigatorPRI.AddDosh(Max(DoshEarned, 0), true);
if(InstigatorPC!=None)
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);
}
KFPC = ExtPlayerController(Controller);
if(KFPC!=None)
if (KFPC!=None)
KFPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo);
}
else if(bMessageHealer && InstigatorPC!=None)
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));
}
// 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> 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,7 +273,7 @@ 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.
}
@ -286,14 +286,14 @@ function bool DoJump(bool 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
{
@ -315,13 +315,13 @@ function bool DoJump(bool bUpdating)
}
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();
}
}
@ -335,7 +335,7 @@ function UpdateGroundSpeed()
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);
@ -361,19 +361,19 @@ reliable server function NotifyHasStopped()
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)<Square(GroundSpeed*0.7))
if (Physics==PHYS_Falling && VSizeSq2D(Velocity)<Square(GroundSpeed*0.7))
ResetBHopAccel(true);
}
if(WorldInfo.NetMode!=NM_Client && BackpackWeaponClass!=none && (PlayerOldWeapon==None || PlayerOldWeapon.Instigator==None))
if (WorldInfo.NetMode!=NM_Client && BackpackWeaponClass!=none && (PlayerOldWeapon==None || PlayerOldWeapon.Instigator==None))
{
PlayerOldWeapon = None;
SetBackpackWeapon(None);
@ -390,7 +390,7 @@ exec function FeignDeath(float Time)
}
function SetFeignDeath(float Time)
{
if(WorldInfo.NetMode!=NM_Client && !bFeigningDeath && Health>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,7 +399,7 @@ function SetFeignDeath(float Time)
}
function UnsetFeignDeath()
{
if(bFeigningDeath)
if (bFeigningDeath)
PlayFeignDeath(false);
}
@ -409,7 +409,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
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.
@ -417,7 +417,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
bFeigningDeath = bEnable;
if (bEnable)
{
if(bFPLegsAttached)
if (bFPLegsAttached)
{
bFPLegsAttached = false;
DetachComponent(FPBodyMesh);
@ -427,7 +427,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
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 b
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 b
// 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);
@ -514,7 +514,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
// Calculate how far we just moved the actor up.
UnFeignZAdjust = Location.Z - FeignLocation.Z;
// If its positive, move back down by that amount until it hits the floor
if(UnFeignZAdjust > 0.0)
if (UnFeignZAdjust > 0.0)
{
moveSmooth(vect(0,0,-1) * UnFeignZAdjust);
}
@ -552,7 +552,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
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<BestDist)
if (Best==None || Dist<BestDist)
{
Best = N;
BestDist = Dist;
@ -629,7 +629,7 @@ simulated function bool CheckValidLocation(vector FeignLocation)
}
simulated function SetPawnRBChannels(bool bRagdollMode)
{
if(bRagdollMode)
if (bRagdollMode)
{
Mesh.SetRBChannel(RBCC_DeadPawn);
Mesh.SetRBCollidesWithChannel(RBCC_Default,TRUE);
@ -656,7 +656,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
Mesh.SetHasPhysicsAssetInstance(false);
Mesh.SetHasPhysicsAssetInstance(true);
if(bFPLegsAttached)
if (bFPLegsAttached)
{
bFPLegsAttached = false;
DetachComponent(FPBodyMesh);
@ -682,7 +682,7 @@ simulated function PlayRagdollDeath(class<DamageType> 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> 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();
@ -748,7 +748,7 @@ simulated event OutsideWorldBounds()
simulated function KFCharacterInfoBase GetCharacterInfo()
{
if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
if (ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch();
return Super.GetCharacterInfo();
}
@ -779,7 +779,7 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor
WeaponAttachmentChanged(true);
}
}
if(WorldInfo.NetMode != NM_DedicatedServer)
if (WorldInfo.NetMode != NM_DedicatedServer)
{
// Attach/Reattach flashlight components when mesh is set
if (Flashlight == None && FlashLightTemplate != None)
@ -791,9 +791,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor
Flashlight.AttachFlashlight(Mesh);
}
}
if(CharacterArch != none)
if (CharacterArch != none)
{
if(CharacterArch.VoiceGroupArchName != "")
if (CharacterArch.VoiceGroupArchName != "")
VoiceGroupArch = class<KFPawnVoiceGroup>(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class'));
}
}
@ -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;
@ -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,12 +991,12 @@ 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));
@ -1021,7 +1021,7 @@ simulated final function InitFPLegs()
FPBodyMesh.SetNotifyRigidBodyCollision(false);
FPBodyMesh.SetTraceBlocking(false, false);
for(i=0; i<Mesh.Materials.length; i++)
for (i=0; i<Mesh.Materials.length; i++)
FPBodyMesh.SetMaterial(i, Mesh.Materials[i]);
FPBodyMesh.HideBoneByName('neck', PBO_None);
@ -1035,10 +1035,10 @@ simulated function SetMeshVisibility(bool bVisible)
{
Super.SetMeshVisibility(bVisible);
if(Health>0)
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,7 +1062,7 @@ 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);
}
@ -1075,19 +1075,19 @@ simulated final function SetBackpackWeapon(class<KFWeapon> 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.Default.AttachmentArchetype.SkelMesh.Materials.length; i++)
for (i=0; i<WC.Default.AttachmentArchetype.SkelMesh.Materials.length; i++)
{
AttachedBackItem.SetMaterial(i, WC.Default.AttachmentArchetype.SkelMesh.Materials[i]);
}
@ -1097,25 +1097,25 @@ simulated final function SetBackpackWeapon(class<KFWeapon> 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<KFWeap_Welder>(WC) != none || class<KFWeap_Healer_Syringe>(WC) != none || class<KFWeap_Pistol_Medic>(WC) != none || class<KFWeap_SMG_Medic>(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase'))
else if (class<KFWeap_Welder>(WC) != none || class<KFWeap_Healer_Syringe>(WC) != none || class<KFWeap_Pistol_Medic>(WC) != none || class<KFWeap_SMG_Medic>(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<KFWeap_Edged_Katana>(WC) != none || class<KFWeap_Edged_Zweihander>(WC) != none)
if (class<KFWeap_Edged_Katana>(WC) != none || class<KFWeap_Edged_Zweihander>(WC) != none)
MyPos.Z = -20;
B = 'Spine';
@ -1125,10 +1125,10 @@ simulated final function SetBackpackWeapon(class<KFWeapon> 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<KFWeapon> WC)
Mesh.AttachComponent(AttachedBackItem, B);
AttachedBackItem.SetHidden(bOnFirstPerson);
}
else if(AttachedBackItem!=None)
else if (AttachedBackItem!=None)
AttachedBackItem.SetHidden(true);
}
simulated function PlayDying(class<DamageType> 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();
}
@ -1182,11 +1182,11 @@ simulated function SetMeshLightingChannels(LightingChannelContainer NewLightingC
FPBodyMesh.SetLightingChannels(NewLightingChannels);
}
simulated function PlayWeaponSwitch(Weapon OldWeapon, Weapon NewWeapon)
simulated function PlayWeaponswitch (Weapon OldWeapon, Weapon NewWeapon)
{
Super.PlayWeaponSwitch(OldWeapon, 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,7 +1198,7 @@ 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());
@ -1217,7 +1217,7 @@ simulated function ResetHealingSpeedBoost()
HealingSpeedBoostMod = 0;
UpdateGroundSpeed();
if(IsTimerActive(nameOf(ResetHealingSpeedBoost)))
if (IsTimerActive(nameOf(ResetHealingSpeedBoost)))
ClearTimer(nameOf(ResetHealingSpeedBoost));
}
@ -1226,7 +1226,7 @@ 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());
@ -1241,7 +1241,7 @@ simulated function float GetHealingDamageBoostModifier()
simulated function ResetHealingDamageBoost()
{
HealingDamageBoostMod = 0;
if(IsTimerActive(nameOf(ResetHealingDamageBoost)))
if (IsTimerActive(nameOf(ResetHealingDamageBoost)))
ClearTimer(nameOf(ResetHealingDamageBoost));
}
@ -1250,7 +1250,7 @@ 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());
@ -1265,7 +1265,7 @@ simulated function float GetHealingShieldModifier()
simulated function ResetHealingShield()
{
HealingShieldMod = 0;
if(IsTimerActive(nameOf(ResetHealingShield)))
if (IsTimerActive(nameOf(ResetHealingShield)))
ClearTimer(nameOf(ResetHealingShield));
}
@ -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;

View File

@ -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<Inventory> 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)
{

View File

@ -25,11 +25,11 @@ 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;
@ -45,7 +45,7 @@ function InitCharacterMenu()
event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
{
switch(WidgetName)
switch (WidgetName)
{
case 'perkSelectionContainer':
if (PerkSelectionContainer == none)
@ -64,7 +64,7 @@ function OnOpen()
local PlayerController PC;
PC = GetPC();
if(PC == none)
if (PC == none)
return;
CheckForCustomizationPawn(PC);
@ -82,10 +82,10 @@ 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)
if (KFPC != None)
{
KFPC.SpawnMidGameCustomizationPawn();
}
@ -157,7 +157,7 @@ function UpdateCharacterList()
bWaitingCharList = false;
ItemIndex = 0;
DataProvider = CreateArray();
for(i=0; i<ExtPRI.CharacterArchetypes.length; i++)
for (i=0; i<ExtPRI.CharacterArchetypes.length; i++)
{
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
@ -168,9 +168,9 @@ function UpdateCharacterList()
DataProvider.SetElementObject(ItemIndex, SlotObject);
ItemIndex++;
}
for(i=0; i<ExtPRI.CustomCharList.length; i++)
for (i=0; i<ExtPRI.CustomCharList.length; i++)
{
if(!ExtPRI.IsClientCharLocked(ExtPRI.CharacterArchetypes.length+i))
if (!ExtPRI.IsClientCharLocked(ExtPRI.CharacterArchetypes.length+i))
{
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", (ExtPRI.CharacterArchetypes.length+i));
@ -188,7 +188,7 @@ function UpdateCharacterList()
function UpdateGear()
{
if(bWaitingCharList)
if (bWaitingCharList)
return;
CurrentCharInfo = ExtPRI.GetSelectedArch();
@ -216,7 +216,7 @@ final function string GetMenuNameStr(string ObjName)
local int i;
i = InStr(ObjName,".",true);
if(i!=-1)
if (i!=-1)
ObjName = Mid(ObjName,i+1);
return Repl(ObjName,"_"," ");
}
@ -236,7 +236,7 @@ function UpdateMeshList(string OutfitKey, string SkinKey, array<OutfitVariants>
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)
@ -247,7 +247,7 @@ function UpdateMeshList(string OutfitKey, string SkinKey, array<OutfitVariants>
SlotObject.SetString("label", OutfitName);
SlotObject.SetBool("enabled", true);
FirstSkin = UpdateOutfitVariants(OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject);
if(string(FirstSkin.UITexture) == "Bad")
if (string(FirstSkin.UITexture) == "Bad")
continue;
TexturePath = "img://"$PathName(FirstSkin.UITexture);
@ -277,7 +277,7 @@ function SkinVariant UpdateOutfitVariants(string OutfitKey, string KeyName, out
for (i = 0; i < SkinVariations.length; i++)
{
Skin = SkinVariations[i];
if(!bFoundFirst)
if (!bFoundFirst)
{
FirstSkin = Skin;
bFoundFirst = true;
@ -358,7 +358,7 @@ function SkinVariant UpdateCosmeticVariants(string OutfitKey, string KeyName, KF
for (i = 0; i < Attachment.SkinVariations.length; i++)
{
Skin = Attachment.SkinVariations[i];
if(!bFoundFirst)
if (!bFoundFirst)
{
FirstSkin = Skin;
bFoundFirst = true;
@ -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;
@ -426,7 +426,7 @@ function SetEmoteButton()
EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC())));
DataObject = CreateObject("Object");
if(EmoteIndex == 255)
if (EmoteIndex == 255)
{
DataObject.SetString("selectedEmote", "");
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)
if (MeshIndex == `CLEARED_ATTACHMENT_INDEX)
{
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);
@ -496,16 +496,16 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa
local int i, AttachmentIndex;
local bool bCustom;
if(bWaitingCharList)
if (bWaitingCharList)
return;
bCustom = ExtPRI.UsesCustomChar();
DataObject = CreateObject("Object");
for(i = 0; i < `MAX_COSMETIC_ATTACHMENTS; i++)
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, "----");
}
@ -533,7 +533,7 @@ event OnClose()
// 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');
}
@ -560,7 +560,7 @@ 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));
@ -596,7 +596,7 @@ function Callback_Weapon(int ItemIndex, int SkinIndex)
local KFPawn_Customization KFP;
KFP = KFPawn_Customization(GetPC().Pawn);
if(KFP != none)
if (KFP != none)
KFP.AttachWeaponByItemDefinition(SkinIndex);
}
@ -620,7 +620,7 @@ function Callback_Character(int Index)
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);
@ -628,7 +628,7 @@ function Callback_Head(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);
@ -646,19 +646,19 @@ 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
{
class'ExtCharacterInfo'.Static.DetachConflictingAttachments(CurrentCharInfo, MeshIndex, KFP, ExtPRI);
SlotIndex = class'ExtCharacterInfo'.Static.GetAttachmentSlotIndex(CurrentCharInfo, MeshIndex, KFP, ExtPRI);
if(SlotIndex == INDEX_NONE)
if (SlotIndex == INDEX_NONE)
{
return;
}

View File

@ -7,14 +7,14 @@ function bool IsItemActive(int ItemDefinition)
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
if(ItemIndex == INDEX_NONE)
if (ItemIndex == INDEX_NONE)
{
return false;
}
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
if(WeaponDef != none)
if (WeaponDef != none)
{
return class'ExtWeaponSkinList'.Static.IsSkinEquip(WeaponDef, ItemDefinition, ExtPlayerController(KFPC));
}
@ -29,20 +29,20 @@ function Callback_Equip(int ItemDefinition)
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
if(ItemIndex == INDEX_NONE)
if (ItemIndex == INDEX_NONE)
{
return;
}
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
if(WeaponDef != none)
if (WeaponDef != none)
{
if(IsItemActive(ItemDefinition))
if (IsItemActive(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);
}

View File

@ -6,17 +6,17 @@ var Ext_PerkBase ExtPrevPerk;
function OnOpen()
{
KFPC = KFPlayerController(GetPC());
if(ExtKFPC == none)
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);
@ -53,7 +53,7 @@ function PerkChanged(byte NewPerkIndex, bool bClickedIndex)
function OneSecondLoop()
{
if(ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel)
if (ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel)
ExUpdateContainers(ExtPrevPerk);
}

View File

@ -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();
}

View File

@ -5,7 +5,7 @@ function TickHud(float DeltaTime)
local PlayerController PC;
PC = GetPC();
if(PC!=none && PC.PlayerInput!=None)
if (PC!=none && PC.PlayerInput!=None)
Super.TickHud(DeltaTime);
}
@ -16,14 +16,14 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf
local string KilledName, KillerName, KilledIconpath, KillerIconPath;
local string KillerTextColor, KilledTextColor;
if(KFPC == none)
if (KFPC == none)
return;
if(KFGXHUDManager != none)
if (KFGXHUDManager != none)
{
if(PawnOther != none)
if (PawnOther != none)
{
if(bDeathMessage)
if (bDeathMessage)
{
KillerTextColor = ZEDTeamTextColor;
KillerName = class'KFExtendedHUD'.Static.GetNameOf(PawnOther);
@ -34,9 +34,9 @@ final function ShowKillMessageX(PlayerReplicationInfo PRI1, PlayerReplicationInf
bHumanDeath = false;
}
}
if((PawnOther==None || !bDeathMessage) && PRI1 != none)
if ((PawnOther==None || !bDeathMessage) && PRI1 != none)
{
if(PRI1.GetTeamNum() == 255)
if (PRI1.GetTeamNum() == 255)
{
KillerTextColor = ZEDTeamTextColor;
KillerIconpath = "img://"$class'KFPerk_Monster'.static.GetPerkIconPath();
@ -44,15 +44,15 @@ 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;
}
if(PRI2 != none)
if (PRI2 != none)
{
if(PRI2.GetTeamNum() == class'KFTeamInfo_Human'.default.TeamIndex)
if (PRI2.GetTeamNum() == class'KFTeamInfo_Human'.default.TeamIndex)
{
bHumanDeath = true;
KilledTextColor = HumanTeamTextColor;
@ -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();

View File

@ -11,7 +11,7 @@ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
{
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)
{
@ -35,13 +35,13 @@ function LaunchMenus(optional bool bForceSkipLobby)
WidgetBinding.WidgetClass = class'ExtWidget_PartyInGame';
ManagerObject.SetBool("backgroundVisible", false);
ManagerObject.SetBool("IISMovieVisible", false);
if(bSkippedLobby)
if (bSkippedLobby)
CurrentBackgroundMovie.Stop();
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,7 +62,7 @@ function LaunchMenus(optional bool bForceSkipLobby)
}
// do this stuff in case CheckSkipLobby failed
if(bForceSkipLobby)
if (bForceSkipLobby)
{
bAfterLobby = true;
CloseMenus(true);
@ -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');
@ -106,7 +106,7 @@ function OnMenuOpen(name WidgetPath, KFGFxObject_Menu Widget)
{
Super.OnMenuOpen(WidgetPath, Widget);
if(!bAfterLobby && Widget == PerksMenu)
if (!bAfterLobby && Widget == PerksMenu)
PerksMenu.ActionScriptVoid("closeContainer");
}

View File

@ -2,7 +2,7 @@ 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();
}
@ -35,9 +35,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor
}
}
if(CharacterArch != none)
if (CharacterArch != none)
{
if(CharacterArch.VoiceGroupArchName != "")
if (CharacterArch.VoiceGroupArchName != "")
VoiceGroupArch = class<KFPawnVoiceGroup>(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class'));
}
}
@ -74,7 +74,7 @@ function AttachWeaponByItemDefinition(int ItemDefinition)
//find weapon def
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
if(ItemIndex == INDEX_NONE)
if (ItemIndex == INDEX_NONE)
{
`log("Could not find item" @ItemDefinition);
return;
@ -82,7 +82,7 @@ function AttachWeaponByItemDefinition(int ItemDefinition)
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
if(WeaponDef == none)
if (WeaponDef == none)
{
`log("Weapon def NONE for : " @ItemDefinition);
return;

View File

@ -43,7 +43,7 @@ replication
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)
@ -55,8 +55,8 @@ function bool ApplyPerkClass(class<Ext_PerkBase> P)
{
local int i;
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].Class==P)
for (i=0; i<UserPerks.Length; ++i)
if (UserPerks[i].Class==P)
{
ApplyPerk(UserPerks[i]);
return true;
@ -67,8 +67,8 @@ function bool ApplyPerkName(string S)
{
local int i;
for(i=0; i<UserPerks.Length; ++i)
if(string(UserPerks[i].Class.Name)~=S)
for (i=0; i<UserPerks.Length; ++i)
if (string(UserPerks[i].Class.Name)~=S)
{
ApplyPerk(UserPerks[i]);
return true;
@ -82,13 +82,13 @@ function ApplyPerk(Ext_PerkBase P)
local Ext_T_ZEDHelper H;
local int i;
if(P==None)
if (P==None)
return;
if(PlayerOwner.Pawn != None)
if (PlayerOwner.Pawn != None)
{
InvMan = KFInventoryManager(PlayerOwner.Pawn.InvManager);
if(InvMan != None)
if (InvMan != None)
InvMan.MaxCarryBlocks = InvMan.Default.MaxCarryBlocks;
foreach PlayerOwner.Pawn.ChildActors(class'Ext_T_ZEDHelper',H)
@ -97,15 +97,15 @@ function ApplyPerk(Ext_PerkBase P)
}
HP = KFPawn_Human(PlayerOwner.Pawn);
if(HP != None)
if (HP != None)
HP.DefaultInventory = HP.Default.DefaultInventory;
}
if(CurrentPerk != None)
if (CurrentPerk != None)
{
CurrentPerk.DeactivateTraits();
for(i=0; i<CurrentPerk.PerkTraits.Length; ++i)
for (i=0; i<CurrentPerk.PerkTraits.Length; ++i)
{
CurrentPerk.PerkTraits[i].TraitType.Static.CancelEffectOn(KFPawn_Human(PlayerOwner.Pawn),CurrentPerk,CurrentPerk.PerkTraits[i].CurrentLevel,CurrentPerk.PerkTraits[i].Data);
}
@ -114,21 +114,21 @@ function ApplyPerk(Ext_PerkBase P)
bStatsDirty = true;
CurrentPerk = P;
if(PRIOwner!=None)
if (PRIOwner!=None)
{
PRIOwner.ECurrentPerk = P.Class;
PRIOwner.FCurrentPerk = P;
P.UpdatePRILevel();
}
if(CurrentPerk!=None)
if (CurrentPerk!=None)
{
CurrentPerk.ActivateTraits();
if(PlayerOwner.Pawn != None)
if (PlayerOwner.Pawn != None)
{
HP = KFPawn_Human(PlayerOwner.Pawn);
if(HP != None)
if (HP != None)
{
HP.HealthMax = HP.default.Health;
HP.MaxArmor = HP.default.MaxArmor;
@ -136,8 +136,8 @@ function ApplyPerk(Ext_PerkBase P)
ModifyHealth(HP.HealthMax);
ModifyArmor(HP.MaxArmor);
if(HP.Health > 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;
}
}
}
@ -146,8 +146,8 @@ simulated final function Ext_PerkBase FindPerk(class<Ext_PerkBase> P)
{
local int i;
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].Class==P)
for (i=0; i<UserPerks.Length; ++i)
if (UserPerks[i].Class==P)
return UserPerks[i];
return None;
}
@ -155,7 +155,7 @@ simulated final function Ext_PerkBase FindPerk(class<Ext_PerkBase> 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,13 +194,13 @@ function ServerInitPerks()
{
local int i;
for(i=0; i<UserPerks.Length; ++i)
for (i=0; i<UserPerks.Length; ++i)
UserPerks[i].SetInitialLevel();
bServerReady = true;
CurrentPerk = None;
if(StrPerkName!="")
if (StrPerkName!="")
ApplyPerkName(StrPerkName);
if(CurrentPerk==None)
if (CurrentPerk==None)
ApplyPerk(UserPerks[Rand(UserPerks.Length)]);
}
@ -219,7 +219,7 @@ function Destroyed()
{
local int i;
for(i=(UserPerks.Length-1); i>=0; --i)
for (i=(UserPerks.Length-1); i>=0; --i)
{
UserPerks[i].PerkManager = None;
UserPerks[i].Destroy();
@ -229,25 +229,25 @@ function Destroyed()
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;
@ -268,13 +268,13 @@ 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<UserPerks.Length; ++i)
if(UserPerks[i].HasAnyProgress())
for (i=0; i<UserPerks.Length; ++i)
if (UserPerks[i].HasAnyProgress())
UserPerks[i].OutputXML(Data);
Data.EndIntendent();
@ -295,28 +295,28 @@ function SaveData(ExtSaveDataBase Data)
Data.SaveInt(TotalPlayTime,3);
// Write character.
if(PRIOwner!=None)
if (PRIOwner!=None)
PRIOwner.SaveCustomCharacter(Data);
else class'ExtPlayerReplicationInfo'.Static.DummySaveChar(Data);
// Write selected perk.
if(ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None)
if (ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None)
Data.SaveStr(string(ExtPlayerController(Owner).PendingPerkClass.Name));
else Data.SaveStr(CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "");
// Count how many progressed perks we have.
o = 0;
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].HasAnyProgress())
for (i=0; i<UserPerks.Length; ++i)
if (UserPerks[i].HasAnyProgress())
++o;
// Then write count we have.
Data.SaveInt(o);
// Then perk stats.
for(i=0; i<UserPerks.Length; ++i)
for (i=0; i<UserPerks.Length; ++i)
{
if(!UserPerks[i].HasAnyProgress()) // Skip this perk.
if (!UserPerks[i].HasAnyProgress()) // Skip this perk.
continue;
Data.SaveStr(string(UserPerks[i].Class.Name));
@ -346,7 +346,7 @@ function LoadData(ExtSaveDataBase Data)
TotalPlayTime = Data.ReadInt(3);
// Read character.
if(PRIOwner!=None)
if (PRIOwner!=None)
{
PRIOwner.RepKills = TotalKills;
PRIOwner.RepEXP = TotalEXP;
@ -360,13 +360,13 @@ function LoadData(ExtSaveDataBase Data)
StrPerkName = Data.ReadStr();
l = Data.ReadInt(); // Perk stats length.
for(i=0; i<l; ++i)
for (i=0; i<l; ++i)
{
S = Data.ReadStr();
o = Data.ReadInt(1); // Read skip offset.
Data.PushEOFLimit(o);
for(j=0; j<UserPerks.Length; ++j)
if(S~=string(UserPerks[j].Class.Name))
for (j=0; j<UserPerks.Length; ++j)
if (S~=string(UserPerks[j].Class.Name))
{
UserPerks[j].LoadData(Data);
break;
@ -381,29 +381,29 @@ function AddDefaultInventory(KFPawn P)
{
local KFInventoryManager KFIM;
if(P != none && P.InvManager != none)
if (P != none && P.InvManager != none)
{
KFIM = KFInventoryManager(P.InvManager);
if(KFIM != none)
if (KFIM != none)
{
//Grenades added on spawn
KFIM.GiveInitialGrenadeCount();
}
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.AddDefaultInventory(P);
}
}
simulated function PlayerDied()
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.PlayerDied();
}
function PreNotifyPlayerLeave()
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.DeactivateTraits();
}
@ -417,10 +417,10 @@ function InitiateClientRep()
}
function ReplicateTimer()
{
switch(RepState)
switch (RepState)
{
case REP_CustomCharacters: // Replicate custom characters.
if(RepIndex>=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<WorldInfo.RealTimeSeconds)
if (UserPerks[RepIndex].NextAuthTime<WorldInfo.RealTimeSeconds)
{
UserPerks[RepIndex].NextAuthTime = WorldInfo.RealTimeSeconds+0.5;
UserPerks[RepIndex].ClientAuth();
@ -462,7 +462,7 @@ function ReplicateTimer()
}
break;
default:
if(MaxGrenadeCount!=Default.MaxGrenadeCount)
if (MaxGrenadeCount!=Default.MaxGrenadeCount)
ClientSetGrenadeCap(MaxGrenadeCount);
ClearTimer('ReplicateTimer');
}
@ -475,32 +475,32 @@ function bool CanEarnSmallRadiusKillXP(class<DamageType> DT)
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<KFDamageType> 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> DamageType, optional Controller InstigatedBy)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyDamageTaken(InDamage,DamageType,InstigatedBy);
}
simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyRecoil(CurrentRecoilModifier,KFW);
}
simulated function ModifySpread(out float InSpread)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifySpread(InSpread);
}
simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyRateOfFire(InRate,KFW);
}
simulated function float GetReloadRateScale(KFWeapon KFW)
@ -513,12 +513,12 @@ simulated function bool GetUsingTactialReload(KFWeapon KFW)
}
function ModifyHealth(out int InHealth)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyHealth(InHealth);
}
function ModifyArmor(out byte MaxArmor)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyArmor(MaxArmor);
}
function float GetKnockdownPowerModifier(optional class<DamageType> DamageType, optional byte BodyPart, optional bool bIsSprinting=false)
@ -535,7 +535,7 @@ function float GetStunPowerModifier(optional class<DamageType> DamageType, optio
}
simulated function ModifyMeleeAttackSpeed(out float InDuration, KFWeapon KFW)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyMeleeAttackSpeed(InDuration);
}
simulated function class<KFProj_Grenade> GetGrenadeClass()
@ -544,7 +544,7 @@ simulated function class<KFProj_Grenade> GetGrenadeClass()
}
simulated function ModifyWeldingRate(out float FastenRate, out float UnfastenRate)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyWeldingRate(FastenRate,UnfastenRate);
}
simulated function bool HasNightVision()
@ -565,17 +565,17 @@ function bool CanNotBeGrabbed()
}
simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class<KFPerk> > 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)
{
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)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifySpareAmmoAmount(KFW,SpareAmmoCapacity,TraderItem,bSecondary);
}
simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class<KFPerk> WeaponPerkClass)
@ -584,7 +584,7 @@ simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Clas
}
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,17 +610,17 @@ 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> DamageType)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.PlayerKilled(Victim,DamageType);
}
function ModifyBloatBileDoT(out float DoTScaler)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.ModifyBloatBileDoT(DoTScaler);
}
simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
@ -629,12 +629,12 @@ simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
}
function UpdatePerkHeadShots(ImpactInfo Impact, class<DamageType> DamageType, int NumHit)
{
if(CurrentPerk!=None)
if (CurrentPerk!=None)
CurrentPerk.UpdatePerkHeadShots(Impact,DamageType,NumHit);
}
function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int HealAmount)
{
if(!bCurrentlyHealing && CurrentPerk!=None)
if (!bCurrentlyHealing && CurrentPerk!=None)
{
// Using boolean to avoid infinite recursion.
bCurrentlyHealing = true;
@ -654,7 +654,7 @@ function bool IsAcidicCompoundActive()
}
function ModifyACDamage(out int InDamage)
{
if(CurrentPerk!=None && CurrentPerk.bToxicDart)
if (CurrentPerk!=None && CurrentPerk.bToxicDart)
InDamage += CurrentPerk.ToxicDartDamage;
}
@ -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()
{
@ -777,12 +777,12 @@ simulated function float GetPenetrationModifier(byte Level, class<KFDamageType>
// Other
function ApplySkillsToPawn()
{
if(CheckOwnerPawn())
if (CheckOwnerPawn())
{
OwnerPawn.UpdateGroundSpeed();
OwnerPawn.bMovesFastInZedTime = false;
if(MyPRI == none)
if (MyPRI == none)
MyPRI = KFPlayerReplicationInfo(OwnerPawn.PlayerReplicationInfo);
ApplyWeightLimits();

View File

@ -1,6 +1,6 @@
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)
{
@ -21,7 +21,7 @@ final function ExUpdateDetails(Ext_PerkBase PerkClass)
DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP);
if(KFGRI != none)
if (KFGRI != none)
{
`AddWeaponsInfo(PerkClass.PrimaryWeaponDef);
`AddWeaponsInfo(PerkClass.SecondaryWeaponDef);
@ -49,7 +49,7 @@ final function ExUpdatePassives(Ext_PerkBase PerkClass)
local int i;
PassivesProvider = CreateArray();
for(i=0; i<PerkClass.PerkStats.Length; ++i)
for (i=0; i<PerkClass.PerkStats.Length; ++i)
{
PassiveObject = CreateObject("Object");
PassiveObject.SetString("PassiveTitle", PerkClass.GetStatUIStr(i));

View File

@ -38,7 +38,7 @@ function UpdatePendingPerkInfo(byte SelectedPerkIndex)
local Ext_PerkBase PerkClass;
KFPC = ExtPlayerController(GetPC());
if(KFPC != none)
if (KFPC != none)
{
PerkClass = KFPC.ActivePerkManager.UserPerks[SelectedPerkIndex];
SetPendingPerkChanges(PerkClass.PerkName, PerkClass.GetPerkIconPath(PerkClass.CurrentLevel), "Perk changes will be applied when you die.");

View File

@ -56,30 +56,30 @@ replication
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;
@ -94,7 +94,7 @@ reliable client function AddAdminCmd(string S)
j = InStr(S,":");
i = AdminCommands.Length;
AdminCommands.Length = i+1;
if(j==-1)
if (j==-1)
{
AdminCommands[i].Cmd = S;
AdminCommands[i].Info = S;
@ -117,7 +117,7 @@ reliable client function ClientSetBonus(SoundCue C, Object 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)
@ -130,24 +130,24 @@ reliable server function ServerSetSettings(bool bHideKill, bool bHideDmg, bool b
}
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);
reliable client event ReceiveLocalizedMessage(class<LocalMessage> 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<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT, bool bKiller)
{
// Stats.
if(ActivePerkManager!=None)
if (ActivePerkManager!=None)
{
ActivePerkManager.TotalKills++;
ActivePerkManager.PRIOwner.RepKills++;
@ -156,13 +156,13 @@ function AddZedKill(class<KFPawn_Monster> MonsterClass, byte Difficulty, class<D
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)
{
if(WorldInfo.NetMode!=NM_Client && ActivePerkManager!=None)
if (WorldInfo.NetMode!=NM_Client && ActivePerkManager!=None)
ActivePerkManager.EarnedEXP(XP,Mode);
}
@ -192,11 +192,11 @@ function AddShotsHit(int AddedHits)
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;
@ -256,7 +256,7 @@ reliable client function ReceiveServerMOTD(string S, bool bFinal)
reliable server function ServerSetMOTD(string S, bool bFinal)
{
PendingMOTD $= S;
if(bFinal && PendingMOTD!="")
if (bFinal && PendingMOTD!="")
{
OnSetMOTD(Self,PendingMOTD);
PendingMOTD = "";
@ -266,7 +266,7 @@ reliable server function ServerSetMOTD(string S, bool bFinal)
// TESTING:
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);
@ -274,56 +274,56 @@ reliable server function ServerItemDropGet(string Item)
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<Pawn> 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);
}
}
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<Pawn> 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)
{
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 )
{
//if(((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None))
//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);
}
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, na
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;
@ -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);
@ -386,18 +386,18 @@ reliable client function ClientKillMessage(class<DamageType> DamType, PlayerRepl
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
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<DamageType> DamType, PlayerRepl
}
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<DamageType> DamType, PlayerRepl
else // Killed by monster.
{
bFF = false;
if(KillerPRI!=None)
if (KillerPRI!=None)
{
S = KillerPRI.GetHumanReadableName();
}
else
{
S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn);
if(class<KFPawn_Monster>(KillerPawn)!=None && class<KFPawn_Monster>(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type.
if (class<KFPawn_Monster>(KillerPawn)!=None && class<KFPawn_Monster>(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type.
S = "the "$S;
else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S;
}
@ -431,7 +431,7 @@ reliable client function ClientKillMessage(class<DamageType> DamType, PlayerRepl
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');
}
@ -439,35 +439,35 @@ reliable client function ClientZedKillMessage(class<DamageType> DamType, string
{
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
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<KFPawn_Monster>(KillerPawn)!=None && class<KFPawn_Monster>(KillerPawn).Default.MinSpawnSquadSizeType==EST_Boss) // Boss type.
if (class<KFPawn_Monster>(KillerPawn)!=None && class<KFPawn_Monster>(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');
}
@ -476,14 +476,14 @@ simulated final function string ParseSuicideMsg(string Victim, class<DamageType>
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<KFDT_Fire>(DamType)!=None)
else if (class<KFDT_Fire>(DamType)!=None)
return Victim$Chr(6)$"M was burned to death";
else if(class<KFDT_Explosive>(DamType)!=None)
else if (class<KFDT_Explosive>(DamType)!=None)
return Victim$Chr(6)$"M was blown into pieces";
return Victim$Chr(6)$"M had a sudden heart attack";
}
@ -493,14 +493,14 @@ simulated final function string ParseKillMsg(string Victim, string Killer, bool
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<KFDT_Fire>(DamType)!=None)
else if (class<KFDT_Fire>(DamType)!=None)
return Chr(6)$"O"$Victim$Chr(6)$"M was incinerated by "$Chr(6)$T$Killer;
else if(class<KFDT_Explosive>(DamType)!=None)
else if (class<KFDT_Explosive>(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;
}
@ -523,18 +523,18 @@ 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)
{
if(WorldInfo.Game!=None)
if (WorldInfo.Game!=None)
WorldInfo.Game.KickBan(S);
}*/
exec function Kick(string S)
{
if(WorldInfo.Game!=None)
if (WorldInfo.Game!=None)
WorldInfo.Game.Kick(S);
}
reliable server function SkipLobby();
@ -543,7 +543,7 @@ Delegate OnChangePerk(ExtPlayerController PC, class<Ext_PerkBase> NewPerk);
reliable server function SwitchToPerk(class<Ext_PerkBase> PerkClass)
{
if(PerkClass!=None)
if (PerkClass!=None)
OnChangePerk(Self,PerkClass);
}
@ -551,7 +551,7 @@ Delegate OnBoughtStats(ExtPlayerController PC, class<Ext_PerkBase> PerkClass, in
reliable server function BuyPerkStat(class<Ext_PerkBase> PerkClass, int iStat, int Amount)
{
if(PerkClass!=None && Amount>0 && iStat>=0)
if (PerkClass!=None && Amount>0 && iStat>=0)
OnBoughtStats(Self,PerkClass,iStat,Amount);
}
@ -559,7 +559,7 @@ Delegate OnBoughtTrait(ExtPlayerController PC, class<Ext_PerkBase> PerkClass, cl
reliable server function BoughtTrait(class<Ext_PerkBase> PerkClass, class<Ext_TraitBase> Trait)
{
if(PerkClass!=None && Trait!=None)
if (PerkClass!=None && Trait!=None)
OnBoughtTrait(Self,PerkClass,Trait);
}
@ -567,7 +567,7 @@ Delegate OnPerkReset(ExtPlayerController PC, class<Ext_PerkBase> PerkClass, bool
reliable server function ServerResetPerk(class<Ext_PerkBase> PerkClass, bool bPrestige)
{
if(PerkClass!=None)
if (PerkClass!=None)
OnPerkReset(Self,PerkClass,bPrestige);
}
@ -580,7 +580,7 @@ reliable server function AdminRPGHandle(int PlayerID, int Action)
simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false)
{
switch(ProgressType)
switch (ProgressType)
{
case PMT_ConnectionFailure :
case PMT_PeerConnectionFailure :
@ -598,7 +598,7 @@ simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessag
simulated function CancelConnection()
{
if(KFExtendedHUD(myHUD)!=None)
if (KFExtendedHUD(myHUD)!=None)
KFExtendedHUD(myHUD).CancelConnection();
else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect");
}
@ -607,7 +607,7 @@ function NotifyLevelUp(class<KFPerk> PerkClass, byte PerkLevel, byte NewPrestige
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,19 +616,19 @@ function ShowBossNameplate(KFInterface_MonsterBoss KFBoss, optional string Playe
}
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)
{
if(OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell())
if (OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell())
NotifyFixed(1);
Super.UpdateRotation(DeltaTime);
OldViewRot = Rotation;
@ -649,7 +649,7 @@ function DefClientResponse(byte CallID, byte Code, int DataA, int DataB);
reliable client function ClientUsedAmmo(Ext_T_SupplierInteract S)
{
if(Pawn!=None && S!=None)
if (Pawn!=None && S!=None)
S.UsedOnClient(Pawn);
}
@ -657,14 +657,14 @@ 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;
@ -706,7 +706,7 @@ reliable server function ServerViewPlayerID(int ID)
{
local PlayerReplicationInfo PRI;
if(!IsSpectating())
if (!IsSpectating())
return;
// Find matching player by ID
@ -715,12 +715,12 @@ reliable server function ServerViewPlayerID(int 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)
if (CurrentSpectateMode==SMODE_Roaming)
SpectatePlayer(SMODE_PawnFreeCam);
}
@ -731,7 +731,7 @@ 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());
@ -746,7 +746,7 @@ reliable client function ClientSetLocation(vector NewLocation, rotator NewRotati
unreliable server function ServerPlayLevelUpDialog()
{
if(NextCommTime<WorldInfo.TimeSeconds)
if (NextCommTime<WorldInfo.TimeSeconds)
{
NextCommTime = WorldInfo.TimeSeconds+2.f;
Super.ServerPlayLevelUpDialog();
@ -754,7 +754,7 @@ unreliable server function ServerPlayLevelUpDialog()
}
unreliable server function ServerPlayVoiceCommsDialog(int CommsIndex)
{
if(NextCommTime<WorldInfo.TimeSeconds)
if (NextCommTime<WorldInfo.TimeSeconds)
{
NextCommTime = WorldInfo.TimeSeconds+2.f;
Super.ServerPlayVoiceCommsDialog(CommsIndex);
@ -765,17 +765,17 @@ unreliable server function ServerPlayVoiceCommsDialog(int CommsIndex)
// Setup bFire/bAltFire so that Auto-Fire trait will work.
exec function StartFire(optional byte FireModeNum)
{
if(FireModeNum==0)
if (FireModeNum==0)
bFire = 1;
else if(FireModeNum==1)
else if (FireModeNum==1)
bAltFire = 1;
Super.StartFire(FireModeNum);
}
exec function StopFire(optional byte FireModeNum)
{
if(FireModeNum==0)
if (FireModeNum==0)
bFire = 0;
else if(FireModeNum==1)
else if (FireModeNum==1)
bAltFire = 0;
Super.StopFire(FireModeNum);
}
@ -808,7 +808,7 @@ state Spectating
ReplicateMove(DeltaTime, Acceleration, DCLICK_None, rot(0,0,0));
// only done for clients, as LastActiveTime only affects idle kicking
if((!IsZero(Acceleration) || OldRotation != Rotation) && LastUpdateSpectatorActiveTime<WorldInfo.TimeSeconds)
if ((!IsZero(Acceleration) || OldRotation != Rotation) && LastUpdateSpectatorActiveTime<WorldInfo.TimeSeconds)
{
LastUpdateSpectatorActiveTime = WorldInfo.TimeSeconds+UpdateSpectatorActiveInterval;
ServerSetSpectatorActive();
@ -826,14 +826,14 @@ state Spectating
exec function SpectatePreviousPlayer()
{
ServerViewNextPlayer();
if(Role == ROLE_Authority)
if (Role == ROLE_Authority)
{
NotifyChangeSpectateViewTarget();
}
}
unreliable server function ServerViewNextPlayer()
{
if(CurrentSpectateMode==SMODE_Roaming)
if (CurrentSpectateMode==SMODE_Roaming)
{
CurrentSpectateMode = SMODE_PawnFreeCam;
SetCameraMode('FreeCam');
@ -843,7 +843,7 @@ state Spectating
reliable client function ClientSetCameraMode(name NewCamMode)
{
Global.ClientSetCameraMode(NewCamMode);
if(NewCamMode=='FirstPerson' && ViewTarget==Self && MyGFxHUD!=None)
if (NewCamMode=='FirstPerson' && ViewTarget==Self && MyGFxHUD!=None)
MyGFxHUD.SpectatorInfoWidget.SetSpectatedKFPRI(None); // Possibly went to first person, hide player info.
}
}
@ -851,9 +851,9 @@ state Spectating
// Feign death:
function EnterRagdollMode(bool bEnable)
{
if(bEnable)
if (bEnable)
GoToState('RagdollMove');
else if(Pawn==None)
else if (Pawn==None)
GotoState('Dead');
else if (Pawn.PhysicsVolume.bWaterVolume)
GotoState(Pawn.WaterMovementState);
@ -873,14 +873,14 @@ simulated function EndGameCamFocus(vector Pos)
EndGameCamRot = CamRot;
EndGameCamTimer = WorldInfo.RealTimeSeconds;
if(LocalPlayer(Player)==None)
if (LocalPlayer(Player)==None)
ClientFocusView(Pos);
else if(KFPawn(ViewTarget)!=None)
else if (KFPawn(ViewTarget)!=None)
KFPawn(ViewTarget).SetMeshVisibility(true);
}
reliable client function ClientFocusView(vector Pos)
{
if(WorldInfo.NetMode==NM_Client)
if (WorldInfo.NetMode==NM_Client)
EndGameCamFocus(Pos);
}
final function bool CalcEndGameCam()
@ -888,15 +888,15 @@ final function bool CalcEndGameCam()
local float T,RT;
local vector HL,HN;
if(LastPlayerCalcView==WorldInfo.TimeSeconds)
if (LastPlayerCalcView==WorldInfo.TimeSeconds)
return true;
T = WorldInfo.RealTimeSeconds-EndGameCamTimer;
if(T>=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);
@ -925,7 +925,7 @@ final function bool CalcEndGameCam()
}
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_Rota
}
exec function DebugRenderMode()
{
if(WorldInfo.NetMode!=NM_Client)
if (WorldInfo.NetMode!=NM_Client)
{
bRenderModes = !bRenderModes;
SaveConfig();
@ -946,7 +946,7 @@ exec function DebugRenderMode()
// Stats traffic.
reliable server function ServerRequestStats(byte ListNum)
{
if(ListNum<3)
if (ListNum<3)
{
TransitListNum = ListNum;
TransitIndex = 0;
@ -955,7 +955,7 @@ reliable server function ServerRequestStats(byte ListNum)
}
function SendNextList()
{
if(!OnClientGetStat(Self,TransitListNum,TransitIndex++))
if (!OnClientGetStat(Self,TransitListNum,TransitIndex++))
{
ClientGetStat(TransitListNum,true);
ClearTimer('SendNextList');
@ -987,21 +987,21 @@ 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)
{
local rotator OldRotation;
if(Pawn == None)
if (Pawn == None)
GotoState('Dead');
else
{
@ -1011,7 +1011,7 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode;
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);
}
@ -1021,24 +1021,24 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode;
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;
}
@ -1056,14 +1056,14 @@ ignores SeePlayer, HearNoise, Bump;
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.
@ -1083,7 +1083,7 @@ ignores SeePlayer, HearNoise, Bump;
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);
}
@ -1122,7 +1122,7 @@ state Dead
FindGoodView();
CleanOutSavedMoves();
if(KFPawn(ViewTarget)!=none)
if (KFPawn(ViewTarget)!=none)
{
KFPawn(ViewTarget).SetMeshVisibility(true);
}
@ -1130,17 +1130,17 @@ state Dead
// Deactivate any post process effects when we die
ResetGameplayPostProcessFX();
if(CurrentPerk != none)
if (CurrentPerk != none)
CurrentPerk.PlayerDied();
KFPI = KFPlayerInput(PlayerInput);
if(KFPI != none)
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)
@ -1148,7 +1148,7 @@ state Dead
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;
}

View File

@ -16,9 +16,9 @@ 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
{
@ -32,9 +32,9 @@ 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
{
@ -47,7 +47,7 @@ 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();
}
@ -55,10 +55,10 @@ simulated exec function ToggleFlashlight()
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);
}
}
@ -67,20 +67,20 @@ event bool FilterButtonInput(int ControllerId, Name Key, EInputEvent Event, floa
{
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();
}

View File

@ -81,11 +81,11 @@ 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.
@ -108,7 +108,7 @@ simulated function ClientInitialize(Controller C)
Super.ClientInitialize(C);
if(WorldInfo.NetMode!=NM_DedicatedServer)
if (WorldInfo.NetMode!=NM_DedicatedServer)
{
LocalOwnerPRI = Self;
@ -125,7 +125,7 @@ simulated function TickPT()
simulated event ReplicatedEvent(name VarName)
{
switch(VarName)
switch (VarName)
{
case 'RepLevelProgress':
HUDPerkColor = PickPerkColor();
@ -163,7 +163,7 @@ function OverrideWith(PlayerReplicationInfo PRI)
}
simulated final function UpdateNameTag()
{
if(NameTag!="")
if (NameTag!="")
TaggedPlayerName = "["$NameTag$"] "$PlayerName;
else TaggedPlayerName = PlayerName;
}
@ -177,7 +177,7 @@ final function SetLevelProgress(int CurLevel, int CurPrest, int MinLevel, int Ma
RepLevelProgress = V;
bForceNetUpdate = true;
if(WorldInfo.NetMode!=NM_DedicatedServer)
if (WorldInfo.NetMode!=NM_DedicatedServer)
HUDPerkColor = PickPerkColor();
}
simulated final function string GetPerkLevelStr()
@ -189,20 +189,20 @@ simulated final function color PickPerkColor()
local float P;
local byte i;
if(RepLevelProgress==0)
if (RepLevelProgress==0)
return MakeColor(255,255,255,255);
P = float(RepLevelProgress) / 255.f;
if(P<0.25f) // White - Blue
if (P<0.25f) // White - Blue
{
i = 255 - (P*1020.f);
return MakeColor(i,i,255,255);
}
if(P<0.5f) // Blue - Green
if (P<0.5f) // Blue - Green
{
i = ((P-0.25f)*1020.f);
return MakeColor(0,i,255-i,255);
}
if(P<0.75f) // Green - Red
if (P<0.75f) // Green - Red
{
i = ((P-0.5f)*1020.f);
return MakeColor(i,255-i,0,255);
@ -231,10 +231,10 @@ Delegate bool OnRepNextItem(ExtPlayerReplicationInfo PRI, int RepIndex)
simulated reliable client function ClientAddTraderItem(int Index, FCustomTraderItem Item)
{
// Make sure to not execute on server.
if(WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None))
if (WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None))
return;
if(CustomList==None)
if (CustomList==None)
{
CustomList = CreateNewList();
RecheckGRI();
@ -259,12 +259,12 @@ simulated static final function SetWeaponInfo(bool bDedicated, int Index, FCusto
local array<STraderItemWeaponStats> 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<KFWeap_DualBase>(Item.WeaponClass)!=None && class<KFWeap_DualBase>(Item.WeaponClass).Default.SingleClass!=None)
if (class<KFWeap_DualBase>(Item.WeaponClass)!=None && class<KFWeap_DualBase>(Item.WeaponClass).Default.SingleClass!=None)
List.SaleItems[Index].SingleClassName = class<KFWeap_DualBase>(Item.WeaponClass).Default.SingleClass.Name;
else List.SaleItems[Index].SingleClassName = '';
List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : '';
@ -278,13 +278,13 @@ simulated static final function SetWeaponInfo(bool bDedicated, int Index, FCusto
List.SaleItems[Index].InitialSecondaryAmmo = Item.WeaponClass.Default.InitialSpareMags[1];
List.SaleItems[Index].WeaponUpgradeDmgMultiplier[0] = 1.0;
for(i = 0;i<Min(Item.WeaponClass.Default.WeaponUpgrades.Length, 5);i++)
for (i = 0;i<Min(Item.WeaponClass.Default.WeaponUpgrades.Length, 5);i++)
{
List.SaleItems[Index].WeaponUpgradeWeight[i+1] = Item.WeaponClass.Static.GetUpgradeStatAdd(EWUS_Weight, i+1);
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);
@ -406,15 +406,15 @@ 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;
}
@ -424,12 +424,12 @@ simulated final function bool LoadPlayerCharacter(byte CharIndex, out FMyCustomC
{
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) ? CharacterArchetypes[CharIndex] : CustomCharList[CharIndex-CharacterArchetypes.Length].Char;
SaveDataObjects[CharIndex] = new(None,PathName(C)) class'ExtCharDataInfo';
@ -441,12 +441,12 @@ simulated final function bool SavePlayerCharacter()
{
local KFCharacterInfo_Human C;
if(CustomCharacter.CharacterIndex>=(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) ? CharacterArchetypes[CustomCharacter.CharacterIndex] : CustomCharList[CustomCharacter.CharacterIndex-CharacterArchetypes.Length].Char;
SaveDataObjects[CustomCharacter.CharacterIndex] = new(None,PathName(C)) class'ExtCharDataInfo';
@ -459,34 +459,34 @@ simulated function ChangeCharacter(byte CharIndex, optional bool bFirstSet)
local FMyCustomChar NewChar;
local byte i;
if(CharIndex>=(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)
{
switch(Type)
switch (Type)
{
case CO_Head:
CustomCharacter.HeadMeshIndex = MeshIndex;
@ -503,26 +503,26 @@ simulated function UpdateCustomization(byte Type, byte MeshIndex, byte SkinIndex
}
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;
@ -532,7 +532,7 @@ simulated function ClearCharacterAttachment(int AttachmentIndex)
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;
@ -544,7 +544,7 @@ reliable server final function ServerSetCharacterX(FMyCustomChar NewMeshInfo)
}
simulated final function bool IsClientCharLocked(byte Index)
{
if(Index<CharacterArchetypes.Length)
if (Index<CharacterArchetypes.Length)
return false;
Index-=CharacterArchetypes.Length;
return (Index<CustomCharList.Length && CustomCharList[Index].bLock && !ShowAdminName());
@ -552,20 +552,20 @@ simulated final function bool IsClientCharLocked(byte Index)
simulated reliable client function ReceivedCharacter(byte Index, FCustomCharEntry C)
{
if(WorldInfo.NetMode==NM_DedicatedServer)
if (WorldInfo.NetMode==NM_DedicatedServer)
return;
if(CustomCharList.Length<=Index)
if (CustomCharList.Length<=Index)
CustomCharList.Length = Index+1;
CustomCharList[Index] = C;
}
simulated reliable client function AllCharReceived()
{
if(WorldInfo.NetMode==NM_DedicatedServer)
if (WorldInfo.NetMode==NM_DedicatedServer)
return;
if(!bClientInitChars)
if (!bClientInitChars)
{
OnCharListDone();
NotifyCharListDone();
@ -581,16 +581,16 @@ simulated final function NotifyCharListDone()
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFP)
{
EPRI = ExtPlayerReplicationInfo(KFP.PlayerReplicationInfo);
if(EPRI!=None)
if (EPRI!=None)
{
NewCharArch = EPRI.GetSelectedArch();
if(NewCharArch != KFP.CharacterArch)
if (NewCharArch != KFP.CharacterArch)
{
// selected a new character
KFP.SetCharacterArch(NewCharArch);
}
else if(WorldInfo.NetMode != NM_DedicatedServer)
else if (WorldInfo.NetMode != NM_DedicatedServer)
{
// refresh cosmetics only
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(NewCharArch, KFP, EPRI);
@ -604,7 +604,7 @@ simulated delegate OnCharListDone();
// Player has a server specific setting for a character selected.
simulated final function bool UsesCustomChar()
{
if(LocalOwnerPRI==None)
if (LocalOwnerPRI==None)
return false; // Not yet init on client.
return CustomCharacter.CharacterIndex<(LocalOwnerPRI.CustomCharList.Length+CharacterArchetypes.Length);
}
@ -612,13 +612,13 @@ simulated final function bool UsesCustomChar()
// Client uses a server specific custom character.
simulated final function bool ReallyUsingCustomChar()
{
if(!UsesCustomChar())
if (!UsesCustomChar())
return false;
return (CustomCharacter.CharacterIndex>=CharacterArchetypes.Length);
}
simulated final function KFCharacterInfo_Human GetSelectedArch()
{
if(UsesCustomChar())
if (UsesCustomChar())
return (CustomCharacter.CharacterIndex<CharacterArchetypes.Length) ? CharacterArchetypes[CustomCharacter.CharacterIndex] : LocalOwnerPRI.CustomCharList[CustomCharacter.CharacterIndex-CharacterArchetypes.Length].Char;
return CharacterArchetypes[RepCustomizationInfo.CharacterIndex];
}
@ -630,16 +630,16 @@ simulated event CharacterCustomizationChanged()
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFP)
{
if(KFP.PlayerReplicationInfo == self || (KFP.DrivenVehicle != None && KFP.DrivenVehicle.PlayerReplicationInfo == self))
if (KFP.PlayerReplicationInfo == self || (KFP.DrivenVehicle != None && KFP.DrivenVehicle.PlayerReplicationInfo == self))
{
NewCharArch = GetSelectedArch();
if(NewCharArch != KFP.CharacterArch)
if (NewCharArch != KFP.CharacterArch)
{
// selected a new character
KFP.SetCharacterArch(NewCharArch);
}
else if(WorldInfo.NetMode != NM_DedicatedServer)
else if (WorldInfo.NetMode != NM_DedicatedServer)
{
// refresh cosmetics only
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(NewCharArch, KFP, self);
@ -655,10 +655,10 @@ final function SaveCustomCharacter(ExtSaveDataBase Data)
local string S;
// Write the name of custom character.
if(UsesCustomChar())
if (UsesCustomChar())
S = string(GetSelectedArch().Name);
Data.SaveStr(S);
if(S=="")
if (S=="")
return;
// Write selected accessories.
@ -668,9 +668,9 @@ final function SaveCustomCharacter(ExtSaveDataBase Data)
Data.SaveInt(CustomCharacter.BodySkinIndex);
c = 0;
for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
for (i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
{
if(CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX)
if (CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX)
++c;
}
@ -678,9 +678,9 @@ final function SaveCustomCharacter(ExtSaveDataBase Data)
Data.SaveInt(c);
// Write attachments.
for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
for (i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
{
if(CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX)
if (CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX)
{
Data.SaveInt(i);
Data.SaveInt(CustomCharacter.AttachmentMeshIndices[i]);
@ -693,30 +693,30 @@ final function LoadCustomCharacter(ExtSaveDataBase Data)
local string S;
local byte i,n,j;
if(Data.GetArVer()>=2)
if (Data.GetArVer()>=2)
S = Data.ReadStr();
if(S=="") // Stock skin.
if (S=="") // Stock skin.
return;
for(i=0; i<CharacterArchetypes.Length; ++i)
for (i=0; i<CharacterArchetypes.Length; ++i)
{
if(string(CharacterArchetypes[i].Name)~=S)
if (string(CharacterArchetypes[i].Name)~=S)
break;
}
if(i==CharacterArchetypes.Length)
if (i==CharacterArchetypes.Length)
{
for(i=0; i<CustomCharList.Length; ++i)
for (i=0; i<CustomCharList.Length; ++i)
{
if(string(CustomCharList[i].Char.Name)~=S)
if (string(CustomCharList[i].Char.Name)~=S)
break;
}
if(i==CharacterArchetypes.Length)
if (i==CharacterArchetypes.Length)
{
// Character not found = Skip data.
Data.SkipBytes(4);
n = Data.ReadInt();
for(i=0; i<n; ++i)
for (i=0; i<n; ++i)
Data.SkipBytes(3);
return;
}
@ -730,7 +730,7 @@ final function LoadCustomCharacter(ExtSaveDataBase Data)
CustomCharacter.BodySkinIndex = Data.ReadInt();
n = Data.ReadInt();
for(i=0; i<n; ++i)
for (i=0; i<n; ++i)
{
j = Min(Data.ReadInt(),`MAX_COSMETIC_ATTACHMENTS-1);
CustomCharacter.AttachmentMeshIndices[j] = Data.ReadInt();
@ -745,14 +745,14 @@ static final function DummyLoadChar(ExtSaveDataBase Data)
local string S;
local byte i,n;
if(Data.GetArVer()>=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<n; ++i)
for (i=0; i<n; ++i)
Data.SkipBytes(3);
}
static final function DummySaveChar(ExtSaveDataBase Data)
@ -762,7 +762,7 @@ static final function DummySaveChar(ExtSaveDataBase Data)
simulated function Texture2D GetCurrentIconToDisplay()
{
if(CurrentVoiceCommsRequest == VCT_NONE && ECurrentPerk != none)
if (CurrentVoiceCommsRequest == VCT_NONE && ECurrentPerk != none)
{
return ECurrentPerk.default.PerkIcon;
}
@ -773,7 +773,7 @@ simulated function Texture2D GetCurrentIconToDisplay()
// Set admin levels without having to hard-reference to this mod.
event BeginState(Name N)
{
switch(N)
switch (N)
{
case 'Global':
AdminType = 0;

View File

@ -14,13 +14,13 @@ simulated function ExplodeTimer()
local Actor HitActor;
local vector HitLocation, HitNormal;
if(WorldInfo.NetMode!=NM_Client && InstigatorController==none)
if (WorldInfo.NetMode!=NM_Client && InstigatorController==none)
{
Destroy();
return;
}
GetExplodeEffectLocation(HitLocation, HitNormal, HitActor);
if(--NumCrackers==0)
if (--NumCrackers==0)
TriggerExplosion(HitLocation, HitNormal, HitActor);
else SmallExplosion(HitLocation, HitNormal, HitActor);
}
@ -45,10 +45,10 @@ simulated function SmallExplosion(Vector HitLocation, Vector HitNormal, Actor Hi
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if(IsZero(HitLocation))
if (IsZero(HitLocation))
HitLocation = Location;
if(IsZero(HitNormal))
if (IsZero(HitNormal))
{
HitNormal = vect(0,0,1);
}
@ -59,7 +59,7 @@ simulated function SmallExplosion(Vector HitLocation, Vector HitNormal, Actor Hi
ExplosionTemplate.HitNormal = HitNormal;
// If desired, attach to mover if we hit one
if(bAttachExplosionToHitMover && InterpActor(HitActor) != None)
if (bAttachExplosionToHitMover && InterpActor(HitActor) != None)
{
ExplosionActor.Attachee = HitActor;
ExplosionTemplate.bAttachExplosionEmitterToAttachee = TRUE;

View File

@ -14,21 +14,21 @@ simulated function PostBeginPlay()
local KFPawn InstigatorPawn;
InstigatorPawn = KFPawn(Instigator);
if(InstigatorPawn != none)
if (InstigatorPawn != none)
{
InstigatorPerk = InstigatorPawn.GetPerk();
if(InstigatorPerk != none)
if (InstigatorPerk != none)
bExplodeOnContact = InstigatorPerk.IsOnContactActive();
}
Super.PostBeginPlay();
if(Instigator!=None && ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo)!=None && ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ECurrentPerk!=None)
if (Instigator!=None && ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo)!=None && ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ECurrentPerk!=None)
ClusterNades = ExtPlayerReplicationInfo(Instigator.PlayerReplicationInfo).ECurrentPerk.Default.PerkGrenade;
}
simulated function ProcessTouch(Actor Other, Vector HitLocation, Vector HitNormal)
{
if(bExplodeOnContact && Other != Instigator && !Other.bWorldGeometry && Pawn(Other)!=None && Pawn(Other).GetTeamNum() != GetTeamNum())
if (bExplodeOnContact && Other != Instigator && !Other.bWorldGeometry && Pawn(Other)!=None && Pawn(Other).GetTeamNum() != GetTeamNum())
{
// For opposing team, make the grenade explode instantly
GetExplodeEffectLocation(HitLocation, HitNormal, Other);
@ -44,20 +44,20 @@ simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor
local byte i;
local KFProj_Grenade P;
if(bHasExploded)
if (bHasExploded)
return;
if(InstigatorController==None && WorldInfo.NetMode!=NM_Client) // Prevent Team-Kill.
if (InstigatorController==None && WorldInfo.NetMode!=NM_Client) // Prevent Team-Kill.
{
Destroy();
return;
}
Super.TriggerExplosion(HitLocation,HitNormal,HitActor);
if(WorldInfo.NetMode!=NM_Client)
if (WorldInfo.NetMode!=NM_Client)
{
for(i=0; i<NumClusters; ++i)
for (i=0; i<NumClusters; ++i)
{
P = Spawn(ClusterNades,,,Location);
if(P!=None)
if (P!=None)
{
P.InstigatorController = InstigatorController;
P.Init(VRand());
@ -73,7 +73,7 @@ simulated function Destroyed()
local vector HitLocation, HitNormal;
// Final Failsafe check for explosion effect
if(!bHasExploded && WorldInfo.NetMode==NM_Client)
if (!bHasExploded && WorldInfo.NetMode==NM_Client)
{
GetExplodeEffectLocation(HitLocation, HitNormal, HitActor);
TriggerExplosion(HitLocation, HitNormal, HitActor);

View File

@ -11,20 +11,20 @@ simulated function TriggerExplosion(Vector HitLocation, Vector HitNormal, Actor
local byte i;
local KFProj_MedicGrenade P;
if(bHasExploded)
if (bHasExploded)
return;
if(InstigatorController==None && WorldInfo.NetMode!=NM_Client) // Prevent Team-Kill.
if (InstigatorController==None && WorldInfo.NetMode!=NM_Client) // Prevent Team-Kill.
{
Destroy();
return;
}
Super.TriggerExplosion(HitLocation,HitNormal,HitActor);
if(WorldInfo.NetMode!=NM_Client)
if (WorldInfo.NetMode!=NM_Client)
{
for(i=0; i<NumClusters; ++i)
for (i=0; i<NumClusters; ++i)
{
P = Spawn(class'KFProj_MedicGrenade',,,Location);
if(P!=None)
if (P!=None)
{
P.InstigatorController = InstigatorController;
P.Init(VRand());
@ -40,7 +40,7 @@ simulated function Destroyed()
local vector HitLocation, HitNormal;
// Final Failsafe check for explosion effect
if(!bHasExploded && WorldInfo.NetMode==NM_Client)
if (!bHasExploded && WorldInfo.NetMode==NM_Client)
{
GetExplodeEffectLocation(HitLocation, HitNormal, HitActor);
TriggerExplosion(HitLocation, HitNormal, HitActor);

View File

@ -11,32 +11,32 @@ function PlayAnimation()
PlaySpecialMoveAnim(AnimName, AnimStance, BlendInTime, BlendOutTime, 1.f);
if(KFPOwner.Role == ROLE_Authority)
if (KFPOwner.Role == ROLE_Authority)
{
KFGameInfo(KFPOwner.WorldInfo.Game).DialogManager.PlayDialogEvent(KFPOwner, 31);
}
// Store camera mode for restoration after move ends
LastCameraMode = 'FirstPerson';
if(PCOwner != none && PCOwner.PlayerCamera != none)
if (PCOwner != none && PCOwner.PlayerCamera != none)
{
LastCameraMode = PCOwner.PlayerCamera.CameraStyle;
}
// Set camera to emote third person camera
if(PCOwner == none || !PawnOwner.IsLocallyControlled())
if (PCOwner == none || !PawnOwner.IsLocallyControlled())
{
KFPOwner.SetWeaponAttachmentVisibility(false);
return;
}
if(PCOwner.CanViewCinematics())
if (PCOwner.CanViewCinematics())
{
PCOwner.ClientSetCameraFade(true, FadeInColor, vect2d(1.f, 0.f), FadeInTime, true);
PCOwner.PlayerCamera.CameraStyle = 'Emote';
// Switch camera modes immediately in single player or on client
if(PCOwner.WorldInfo.NetMode != NM_DedicatedServer)
if (PCOwner.WorldInfo.NetMode != NM_DedicatedServer)
{
PCOwner.ClientSetCameraMode('Emote');
}

View File

@ -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);
@ -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);

View File

@ -22,7 +22,7 @@ function SetPerkFilterData(byte FilterIndex)
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);
}

View File

@ -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,7 +28,7 @@ function SetPerkList()
local Ext_PerkBase P;
KFPC = ExtPlayerController(GetPC());
if(KFPC != none && KFPC.ActivePerkManager!=None)
if (KFPC != none && KFPC.ActivePerkManager!=None)
{
DataProvider = CreateArray();

View File

@ -11,7 +11,7 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array<STraderItem>
EKFPC = ExtPlayerController(KFPC);
if (EKFPC!=none && EKFPC.ActivePerkManager!=None)
{
if(FilterIndex<EKFPC.ActivePerkManager.UserPerks.Length)
if (FilterIndex<EKFPC.ActivePerkManager.UserPerks.Length)
TargetPerkClass = EKFPC.ActivePerkManager.UserPerks[FilterIndex].BasePerk;
SlotIndex = 0;
@ -30,7 +30,7 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array<STraderItem>
}
else
{
if(ItemList[i].AssociatedPerkClasses.length > 0)
if (ItemList[i].AssociatedPerkClasses.length > 0)
{
switch (ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass))
{

View File

@ -24,7 +24,7 @@ simulated function ConsumeAmmo(byte FireModeNum)
simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{
if(InstigatorPerkClass != None)
if (InstigatorPerkClass != None)
return InstigatorPerkClass;
return default.AssociatedPerkClasses[0];
@ -32,7 +32,7 @@ simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> Instigator
simulated function KFPerk GetPerk()
{
if(KFPlayer != None)
if (KFPlayer != None)
return KFPlayer.GetPerk();
return super.GetPerk();
}

View File

@ -24,7 +24,7 @@ simulated function ConsumeAmmo(byte FireModeNum)
simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{
if(InstigatorPerkClass != None)
if (InstigatorPerkClass != None)
return InstigatorPerkClass;
return default.AssociatedPerkClasses[0];

View File

@ -26,13 +26,13 @@ simulated static function bool AllowedForAllPerks()
simulated function ConsumeAmmo(byte FireModeNum)
{
if(FireModeNum == ALTFIRE_FIREMODE)
if (FireModeNum == ALTFIRE_FIREMODE)
super.ConsumeAmmo(FireModeNum);
}
simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{
if(InstigatorPerkClass != None)
if (InstigatorPerkClass != None)
return InstigatorPerkClass;
return default.AssociatedPerkClasses[0];
@ -40,7 +40,7 @@ simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> Instigator
simulated function KFPerk GetPerk()
{
if(KFPlayer != None)
if (KFPlayer != None)
return KFPlayer.GetPerk();
return super.GetPerk();
}

View File

@ -27,28 +27,28 @@ static function array<MaterialInterface> 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;
@ -63,7 +63,7 @@ static function SaveWeaponSkin(class<KFWeaponDefinition> WeaponDef, int ID, ExtP
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<KFWeaponDefinition> WeaponDef, int ID, Ex
{
local int i;
i = PC.SavedWeaponSkins.Find('ID', ID);
if(i > -1)
if (i > -1)
return true;
return false;

View File

@ -45,7 +45,7 @@ final function AddSettingsPage(string PageName, class<Object> Obj, const out arr
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<Object> Obj, const out arr
ConfigList[i].GetValue = GetFunc;
ConfigList[i].SetValue = SetFunc;
}
final function bool HasConfigFor(class<Object> Obj)
final function bool HasConfigfor (class<Object> Obj)
{
return (ConfigList.Find('ObjClass',Obj)>=0);
}

View File

@ -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(NextBossDistTime<KFPC.WorldInfo.RealTimeSeconds)
if (NextBossDistTime<KFPC.WorldInfo.RealTimeSeconds)
{
NextBossDistTime = KFPC.WorldInfo.RealTimeSeconds + 1.f;
CheckBestBoss();
}
V = (BossPawn!=None ? FClamp(float(BossPawn.GetMonsterPawn().Health) / float(BossPawn.GetMonsterPawn().HealthMax),0.f,1.f) : 0.f);
if(LastHP!=V)
if (LastHP!=V)
{
LastHP = V;
SetFloat("currentHealthPercentValue",V);
}
V = 0.f;
if(NumBosses>1)
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<BestDist)
if (Best==None || Dist<BestDist)
{
Best = B;
BestDist = Dist;
}
}
if(Best!=BossPawn)
if (Best!=BossPawn)
{
BossPawn = Best;
SetBossName(Best.static.GetLocalizedName());

View File

@ -27,11 +27,11 @@ function GFxObject RefreshSlot(int SlotIndex, KFPlayerReplicationInfo KFPRI)
PlayerInfoObject = CreateObject("Object");
EPC = ExtPlayerController(GetPC());
if(KFPRI != none)
if (KFPRI != none)
{
EPRI = ExtPlayerReplicationInfo(KFPRI);
}
if(OnlineLobby != none)
if (OnlineLobby != none)
{
OnlineLobby.GetLobbyAdmin(OnlineLobby.GetCurrentLobbyId(), AdminId);
}
@ -40,7 +40,7 @@ function GFxObject RefreshSlot(int SlotIndex, KFPlayerReplicationInfo KFPRI)
bIsMyPlayer = EPC.PlayerReplicationInfo.UniqueId == KFPRI.UniqueId;
ExtMemberSlots[SlotIndex].PerkClass = EPRI.ECurrentPerk;
PlayerInfoObject.SetBool("myPlayer", bIsMyPlayer);
if(ExtMemberSlots[SlotIndex].PerkClass != none)
if (ExtMemberSlots[SlotIndex].PerkClass != none)
{
PerkIconObject = CreateObject("Object");
PerkIconObject.SetString("perkIcon", ExtMemberSlots[SlotIndex].PerkClass.static.GetPerkIconPath(EPRI.ECurrentPerkLevel));
@ -48,11 +48,11 @@ function GFxObject RefreshSlot(int SlotIndex, KFPlayerReplicationInfo KFPRI)
PlayerInfoObject.SetString("perkLevel", string(EPRI.ECurrentPerkLevel));
}
if(!bIsMyPlayer)
if (!bIsMyPlayer)
{
PlayerInfoObject.SetBool("muted", EPC.IsPlayerMuted(EPRI.UniqueId));
}
if(class'WorldInfo'.static.IsE3Build())
if (class'WorldInfo'.static.IsE3Build())
{
PlayerName = EPRI.PlayerName;
}
@ -61,7 +61,7 @@ function GFxObject RefreshSlot(int SlotIndex, KFPlayerReplicationInfo KFPRI)
PlayerName = EPRI.PlayerName;
}
PlayerInfoObject.SetString("playerName", PlayerName);
if(class'WorldInfo'.static.IsConsoleBuild(CONSOLE_Orbis))
if (class'WorldInfo'.static.IsConsoleBuild(CONSOLE_Orbis))
{
PlayerInfoObject.SetString("profileImageSource", "img://"$KFPC.GetPS4Avatar(PlayerName));
}
@ -69,7 +69,7 @@ function GFxObject RefreshSlot(int SlotIndex, KFPlayerReplicationInfo KFPRI)
{
PlayerInfoObject.SetString("profileImageSource", "img://"$KFPC.GetSteamAvatar(EPRI.UniqueId));
}
if(KFGRI != none)
if (KFGRI != none)
{
PlayerInfoObject.SetBool("ready", EPRI.bReadyToPlay && !KFGRI.bMatchHasBegun);
}

View File

@ -9,22 +9,22 @@ final function vector PickPointNearOwner()
local vector V,HL,HN,Start;
Start = OwnerPawn.Location;
if(OwnerPawn.Physics==PHYS_Falling)
if (OwnerPawn.Physics==PHYS_Falling)
{
if(Pawn.Trace(HL,HN,OwnerPawn.Location-vect(0,0,5000),OwnerPawn.Location,false,vect(20,20,60))!=None)
if (Pawn.Trace(HL,HN,OwnerPawn.Location-vect(0,0,5000),OwnerPawn.Location,false,vect(20,20,60))!=None)
Start = HL;
}
while(true)
while (true)
{
++i;
V.X = FRand()-0.5;
V.Y = FRand()-0.5;
V = Start + Normal2D(V) * (100.f+FRand()*500.f);
if(i<20 && !FastTrace(V,Start)) // Destination is inside a wall.
if (i<20 && !FastTrace(V,Start)) // Destination is inside a wall.
continue;
if(i<20 && FastTrace(V-vect(0,0,100),V)) // Destination is above a pit.
if (i<20 && FastTrace(V-vect(0,0,100),V)) // Destination is above a pit.
continue;
break;
}
@ -37,7 +37,7 @@ final function bool CanSeeOwner()
NextSightCheckTime = WorldInfo.TimeSeconds+1.f + FRand();
P = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None;
if(P!=None && !LineOfSightTo(P))
if (P!=None && !LineOfSightTo(P))
return false;
return true;
}
@ -45,7 +45,7 @@ final function bool CanSeeOwner()
state ZedBaseCommand
{
Begin:
if(Pawn.Physics == PHYS_Falling)
if (Pawn.Physics == PHYS_Falling)
{
DisableMeleeRangeEventProbing();
WaitForLanding();
@ -55,11 +55,11 @@ Begin:
CheckInterruptCombatTransitions();
// Select nearest enemy if current enemy is invalid
if(Enemy == none || Enemy.Health <= 0 || !IsValidAttackTarget(KFPawn(Enemy)))
if (Enemy == none || Enemy.Health <= 0 || !IsValidAttackTarget(KFPawn(Enemy)))
SelectEnemy();
// Handle special case if I'm supposed to be attacking a door
if(DoorEnemy != none && DoorEnemy.Health > 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$"]");
@ -69,18 +69,18 @@ Begin:
// 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());
NextSightCheckTime = WorldInfo.TimeSeconds+2.f;
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement)
while (bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{
if(NextSightCheckTime<WorldInfo.TimeSeconds && !CanSeeOwner())
if (NextSightCheckTime<WorldInfo.TimeSeconds && !CanSeeOwner())
{
ClearMovementInfo();
GoTo'RecheckOwner';
@ -88,12 +88,12 @@ RecheckOwner:
Sleep(0.03);
}
}
else if(VSizeSq(OwnerPawn.Location-Pawn.Location)>640000.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,19 +104,19 @@ 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');
bWaitingOnMovementPlugIn = true;
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');
@ -130,9 +130,9 @@ RecheckOwner:
// Check combat transitions
CheckCombatTransition();
if(bFailedToMoveToEnemy)
if (bFailedToMoveToEnemy)
{
if(bFailedPathfind)
if (bFailedPathfind)
{
bFailedPathfind = false;
Sleep(0.f);

File diff suppressed because it is too large Load Diff

View File

@ -12,22 +12,22 @@ replication
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)
{
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<DamageType> DT)
{
if(VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class<KFDamageType>(DT)!=None && class<KFDamageType>(DT).Default.ModifierPerkList.Find(BasePerk)>=0)
if (VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class<KFDamageType>(DT)!=None && class<KFDamageType>(DT).Default.ModifierPerkList.Find(BasePerk)>=0)
PlayerOwner.Pawn.HealDamage(Max(PlayerOwner.Pawn.HealthMax*VampRegenRate,1), PlayerOwner, class'KFDT_Healing', false, false);
}

View File

@ -17,9 +17,9 @@ simulated function bool GetUsingTactialReload(KFWeapon KFW)
simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<KFDamageType> 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;
}
@ -31,15 +31,15 @@ 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;

View File

@ -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;
@ -42,16 +42,16 @@ function OnWaveEnded()
simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<KFDamageType> 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<KFDT_Ballistic_Shell>(DamageType) != none)
if (bDirectHit && class<KFDT_Ballistic_Shell>(DamageType) != none)
InDamage *= 1.25;
if(bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx))
if (bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx))
InDamage *= 1.5f;
}
if(class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None)
if (class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None)
InDamage *= NukeDamageMult;
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx);
@ -59,7 +59,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus
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;
@ -67,7 +67,7 @@ function bool IsCriticalHitZone(KFPawn TestPawn, int HitZoneIndex)
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);

View File

@ -18,7 +18,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus
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);
@ -28,7 +28,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus
simulated function ModifyMagSizeAndNumber(KFWeapon KFW, out int MagazineCapacity, optional array< Class<KFPerk> > 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);
}
@ -36,10 +36,10 @@ 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));
return true;
@ -62,7 +62,7 @@ function bool ModifyHealAmount(out float HealAmount)
function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int HealAmount)
{
if((AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1)
if ((AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1)
GiveMedicAirborneAgentHealth(HealTarget, DamType, HealAmount);
}
@ -75,7 +75,7 @@ function GiveMedicAirborneAgentHealth(KFPawn HealTarget, class<DamageType> DamTy
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);
@ -103,13 +103,13 @@ 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> DamageType, optional byte HitZoneIdx)
{
if(bUseSlug && WorldInfo.TimeDilation < 1.f && class<KFDamageType>(DamageType)!=None && class<KFDamageType>(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)
if (bUseSlug && WorldInfo.TimeDilation < 1.f && class<KFDamageType>(DamageType)!=None && class<KFDamageType>(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0)
return 100;
return 0.f;
@ -119,7 +119,7 @@ function AddDefaultInventory(KFPawn P)
{
local int i;
i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm');
if(i != -1)
if (i != -1)
P.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS';
super.AddDefaultInventory(P);
}

View File

@ -23,10 +23,10 @@ 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;
}

View File

@ -7,7 +7,7 @@ var private const float HeadShotCountdownIntervall;
simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<KFDamageType> 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);
}
@ -25,7 +25,7 @@ final function ResetRhythm()
function SubstractHeadShotCombo()
{
if(HeadShotComboCount > 0)
if (HeadShotComboCount > 0)
UpdateDmgScale(false);
else
ClearTimer(nameOf(SubstractHeadShotCombo));
@ -33,13 +33,13 @@ function SubstractHeadShotCombo()
final function UpdateDmgScale(bool bUp)
{
if(bUp)
if (bUp)
{
HeadShotComboCount = Min(HeadShotComboCount+1,MaxRhythmCombo);
HeadShotMessage(HeadShotComboCount,false,MaxRhythmCombo);
SetTimer(HeadShotCountdownIntervall, true, nameOf(SubstractHeadShotCombo));
}
else if(HeadShotComboCount>0)
else if (HeadShotComboCount>0)
{
--HeadShotComboCount;
HeadShotMessage(HeadShotComboCount,true,MaxRhythmCombo);
@ -53,16 +53,16 @@ function UpdatePerkHeadShots(ImpactInfo Impact, class<DamageType> DamageType, in
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<KFDamageType>(DamageType)!=None && (class<KFDamageType>(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0))
if (class<KFDamageType>(DamageType)!=None && (class<KFDamageType>(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0))
UpdateDmgScale(true);
}
}
@ -72,7 +72,7 @@ reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte Ma
local KFPlayerController PC;
PC = KFPlayerController(PlayerOwner);
if(PC==none || PC.MyGFxHUD==none)
if (PC==none || PC.MyGFxHUD==none)
{
return;
}
@ -80,24 +80,24 @@ reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte Ma
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(HeadShotNum<MaxHits)
else if (HeadShotNum<MaxHits)
{
if(!bMissed)
if (!bMissed)
{
//PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShot');
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Hit';
}
}
else if(!bMissed)
else if (!bMissed)
{
//PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShotPing');
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Top';
HeadshotNum = 6;
}
if(TempAkEvent != none)
if (TempAkEvent != none)
PC.PlayRMEffect(TempAkEvent, 'R_Method', HeadshotNum);
}

View File

@ -23,7 +23,7 @@ simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
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;
}

View File

@ -12,13 +12,13 @@ replication
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> DamageType, optional byte HitZoneIdx)
{
if(ZEDTimeStunPower>0 && HitZoneIdx==HZI_Head && WorldInfo.TimeDilation<1.f && (class<KFDamageType>(DamageType)!=None && class<KFDamageType>(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0))
if (ZEDTimeStunPower>0 && HitZoneIdx==HZI_Head && WorldInfo.TimeDilation<1.f && (class<KFDamageType>(DamageType)!=None && class<KFDamageType>(DamageType).Default.ModifierPerkList.Find(BasePerk)>=0))
return Super.GetStunPowerModifier(DamageType,HitZoneIdx) + ZEDTimeStunPower;
return Super.GetStunPowerModifier(DamageType,HitZoneIdx);
}

View File

@ -23,7 +23,7 @@ simulated function bool CanRepairDoors()
simulated function float GetPenetrationModifier(byte Level, class<KFDamageType> 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;

View File

@ -19,10 +19,10 @@ static function bool GroupLimited(Ext_PerkBase Perk, class<Ext_TraitBase> Trait)
{
local int i;
if(Default.bLimitToOne)
if (Default.bLimitToOne)
{
for(i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class)
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class)
return true;
}
return false;

View File

@ -15,15 +15,15 @@ static function bool GroupLimited(Ext_PerkBase Perk, class<Ext_TraitBase> Trait)
local byte n;
n = GetMaxLimit(Perk);
for(i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0)
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].CurrentLevel>0 && 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)
{
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);
}

View File

@ -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,15 +17,15 @@ 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)

View File

@ -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.Armor<PawnOwner.MaxArmor)
else if (PawnOwner.Armor<PawnOwner.MaxArmor)
{
PawnOwner.Armor = Min(PawnOwner.Armor+RegCount,PawnOwner.MaxArmor);
}

View File

@ -15,13 +15,13 @@ replication
function PostBeginPlay()
{
PawnOwner = Pawn(Owner);
if(PawnOwner==None)
if (PawnOwner==None)
Destroy();
else SetTimer(0.5+FRand()*0.4,true);
}
function Timer()
{
if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None)
if (PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None)
Destroy();
}
simulated function Tick(float Delta)
@ -34,20 +34,20 @@ simulated function Tick(float Delta)
return;
// Find local playercontroller.
if(LocalPC==None)
if (LocalPC==None)
{
LocalPC = PlayerController(PawnOwner.Controller);
if(LocalPC==None)
if (LocalPC==None)
return;
bNetworkOwner = (LocalPlayer(LocalPC.Player)!=None);
}
if(!bNetworkOwner)
if (!bNetworkOwner)
return;
// Force always to pending fire.
if(LocalPC.bFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,0))
if (LocalPC.bFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,0))
PawnOwner.Weapon.StartFire(0);
else if(LocalPC.bAltFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,1))
else if (LocalPC.bAltFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,1))
PawnOwner.Weapon.StartFire(1);
}

View File

@ -8,28 +8,28 @@ var bool bTeleporting,bIsDelayed;
function bool CanResPlayer(KFPawn_Human Other, byte Level)
{
if(bTeleporting)
if (bTeleporting)
{
if(LastDied!=None)
if (LastDied!=None)
LastDied.Health = 9999;
return true;
}
if(LastDied==Other)
if (LastDied==Other)
{
if(Level==1 || LastDiedTimer>WorldInfo.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;
@ -63,24 +63,24 @@ final function StartResurrect()
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();
}

View File

@ -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<PawnOwner.HealthMax)
else if (PawnOwner.Health<PawnOwner.HealthMax)
{
PawnOwner.Health = Min(PawnOwner.Health+RegCount,PawnOwner.HealthMax);
}

View File

@ -18,12 +18,12 @@ replication
// Make no efforts with this one.
simulated event PostBeginPlay()
{
if(WorldInfo.NetMode!=NM_Client)
if (WorldInfo.NetMode!=NM_Client)
SetTimer(1,true);
}
simulated event Destroyed()
{
if(OwnerHUD!=None)
if (OwnerHUD!=None)
{
OwnerHUD.MyCurrentPet.RemoveItem(Self);
OwnerHUD = None;
@ -33,16 +33,16 @@ simulated event Destroyed()
}
simulated event ReplicatedEvent(name VarName)
{
if(VarName=='OwnerPRI' && OwnerPRI!=None)
if (VarName=='OwnerPRI' && OwnerPRI!=None)
NotifyOwner();
else if(VarName=='MonsterType' && MonsterType!=None)
else if (VarName=='MonsterType' && MonsterType!=None)
MonsterName = Class'KFExtendedHUD'.Static.GetNameOf(MonsterType);
}
simulated function Timer()
{
if(PawnOwner==None || PawnOwner.Health<=0)
if (PawnOwner==None || PawnOwner.Health<=0)
Destroy();
else if(HealthStatus!=PawnOwner.Health)
else if (HealthStatus!=PawnOwner.Health)
HealthStatus = PawnOwner.Health;
}
simulated final function NotifyOwner()
@ -50,7 +50,7 @@ simulated final function NotifyOwner()
local PlayerController PC;
PC = GetALocalPlayerController();
if(PC==None || PC.PlayerReplicationInfo!=OwnerPRI || KFExtendedHUD(PC.MyHUD)==None)
if (PC==None || PC.PlayerReplicationInfo!=OwnerPRI || KFExtendedHUD(PC.MyHUD)==None)
return;
OwnerHUD = KFExtendedHUD(PC.MyHUD);
OwnerHUD.MyCurrentPet.AddItem(Self);

View File

@ -15,13 +15,13 @@ var bool bGrenades;
replication
{
if(true)
if (true)
PlayerOwner,bGrenades;
}
simulated event ReplicatedEvent(name VarName)
{
if(VarName=='PlayerOwner' && PlayerOwner!=None)
if (VarName=='PlayerOwner' && PlayerOwner!=None)
{
SetLocation(PlayerOwner.Location);
SetBase(PlayerOwner);
@ -40,7 +40,7 @@ simulated event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocat
Super.Touch(Other, OtherComp, HitLocation, HitNormal);
KFP = KFPawn_Human(Other);
if(KFP != none && KFP.Controller != none && KFP != PlayerOwner)
if (KFP != none && KFP.Controller != none && KFP != PlayerOwner)
{
KFPlayerController(KFP.Controller).SetPendingInteractionMessage();
}
@ -53,7 +53,7 @@ simulated event UnTouch(Actor Other)
super.UnTouch(Other);
KFP = KFPawn_Human(Other);
if(KFP != none && KFP.Controller != none && KFP != PlayerOwner)
if (KFP != none && KFP.Controller != none && KFP != PlayerOwner)
{
KFPlayerController(KFP.Controller).SetPendingInteractionMessage();
}
@ -66,7 +66,7 @@ simulated function RecheckUser()
// Notify local player owner that this is available again.
foreach TouchingActors(class'KFPawn_Human', Toucher)
{
if(Toucher.IsLocallyControlled())
if (Toucher.IsLocallyControlled())
Touch(Toucher,None,Location,vect(1,0,0));
}
}
@ -76,33 +76,33 @@ simulated function bool GetCanInteract(Pawn User, optional bool bInteractIfTrue
local int i;
local ExtPlayerReplicationInfo PRI;
if(PlayerOwner==None || User==PlayerOwner || KFPawn_Human(User)==None || User.Health<=0)
if (PlayerOwner==None || User==PlayerOwner || KFPawn_Human(User)==None || User.Health<=0)
return false;
if(WorldInfo.NetMode==NM_Client)
if (WorldInfo.NetMode==NM_Client)
{
PRI = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
if(!User.IsLocallyControlled() || PRI==None || !PRI.CanUseSupply(User))
if (!User.IsLocallyControlled() || PRI==None || !PRI.CanUseSupply(User))
return false;
if(bInteractIfTrue)
if (bInteractIfTrue)
{
PRI.UsedSupply(User,ReuseTime);
SetTimer(ReuseTime+0.1,false,'RecheckUser');
if(KFPlayerController(User.Controller)!=None)
if (KFPlayerController(User.Controller)!=None)
KFPlayerController(User.Controller).SetPendingInteractionMessage();
}
}
else
{
i = ActiveUsers.Find('Player',User);
if(i>=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,43 +123,43 @@ 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<WorldInfo.TimeSeconds)
for (i=(ActiveUsers.Length-1); i>=0; --i)
if (ActiveUsers[i].Player==None || ActiveUsers[i].Player.Health<=0 || ActiveUsers[i].NextUseTime<WorldInfo.TimeSeconds)
ActiveUsers.Remove(i,1);
if(ActiveUsers.Length==0)
if (ActiveUsers.Length==0)
ClearTimer('CleanupUsers');
}
final function GiveAmmunition(KFPawn_Human Other)
{
local KFWeapon KFW;
if(PlayerController(PlayerOwner.Controller)!=None)
if (PlayerController(PlayerOwner.Controller)!=None)
PlayerController(PlayerOwner.Controller).ReceiveLocalizedMessage(class'KFLocalMessage_Game', (bGrenades ? GMT_GaveGrenadesTo : GMT_GaveAmmoTo), Other.PlayerReplicationInfo);
if(PlayerController(Other.Controller)!=None)
if (PlayerController(Other.Controller)!=None)
{
PlayerController(Other.Controller).ReceiveLocalizedMessage(class'KFLocalMessage_Game', (bGrenades ? GMT_ReceivedGrenadesFrom : GMT_ReceivedAmmoFrom), PlayerOwner.PlayerReplicationInfo);
if(ExtPlayerController(Other.Controller)!=None)
if (ExtPlayerController(Other.Controller)!=None)
ExtPlayerController(Other.Controller).ClientUsedAmmo(Self);
}
if(PerkOwner!=None)
if (PerkOwner!=None)
PerkOwner.EarnedEXP(25);
if(bGrenades)
if (bGrenades)
{
if(KFInventoryManager(Other.InvManager)!=None)
if (KFInventoryManager(Other.InvManager)!=None)
KFInventoryManager(Other.InvManager).AddGrenades(1);
}
else
{
foreach Other.InvManager.InventoryActors(class'KFWeapon', KFW)
{
if(KFW.DenyPerkResupply())
if (KFW.DenyPerkResupply())
continue;
// resupply 1 mag for every 5 initial mags
KFW.AddAmmo(Max(KFW.InitialSpareMags[0] / 3, 1) * KFW.MagazineCapacity[0]);
if(KFW.CanRefillSecondaryAmmo())
if (KFW.CanRefillSecondaryAmmo())
{
// resupply 1 mag for every 5 initial mags
KFW.AddSecondaryAmmo(Max(KFW.InitialSpareMags[1] / 3, 1));
@ -172,11 +172,11 @@ simulated final function UsedOnClient(Pawn User)
local ExtPlayerReplicationInfo PRI;
PRI = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
if(PRI!=None)
if (PRI!=None)
PRI.UsedSupply(User,ReuseTime);
SetTimer(ReuseTime+0.1,false,'RecheckUser');
if(WorldInfo.NetMode==NM_Client && KFPlayerController(User.Controller)!=None)
if (WorldInfo.NetMode==NM_Client && KFPlayerController(User.Controller)!=None)
KFPlayerController(User.Controller).SetPendingInteractionMessage();
}

View File

@ -7,7 +7,7 @@ var float HandleRadius;
function PostBeginPlay()
{
PawnOwner = Pawn(Owner);
if(PawnOwner==None)
if (PawnOwner==None)
Destroy();
else SetTimer(0.5+FRand()*0.1,true);
}
@ -15,12 +15,12 @@ function Timer()
{
local KFPawn_Monster M;
if(PawnOwner==None || PawnOwner.Health<=0)
if (PawnOwner==None || PawnOwner.Health<=0)
Destroy();
else
{
foreach WorldInfo.AllPawns(class'KFPawn_Monster',M,PawnOwner.Location,HandleRadius)
if(M.bCanCloak)
if (M.bCanCloak)
M.CallOutCloaking();
}
}

View File

@ -20,7 +20,7 @@ function PostBeginPlay()
{
PawnOwner = Pawn(Owner);
bNeedsKillZed = true;
if(PawnOwner==None)
if (PawnOwner==None)
Destroy();
else
{
@ -30,30 +30,30 @@ function PostBeginPlay()
}
function Timer()
{
if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.PlayerReplicationInfo==None)
if (PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.PlayerReplicationInfo==None)
Destroy();
else if(bNeedsKillZed)
else if (bNeedsKillZed)
{
if(RespawnHelperTime>1)
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<KFPawn_MonsterBoss>(PrevMonster)!=None)
if (bFinalWave && Class<KFPawn_MonsterBoss>(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,10 +174,10 @@ 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();
}
}
@ -185,7 +185,7 @@ final function SpawnHelper()
final function SetDamageScale(float Sc)
{
DamageScale = Default.DamageScale*Sc;
if(LiveHelper!=None)
if (LiveHelper!=None)
LiveHelper.DamageScaling = DamageScale;
}
final function SetHealthScale(float Sc)
@ -201,19 +201,19 @@ static final function LoadMonsterList()
Default.ZedTypes.Length = class'Ext_TraitZED_Summon'.Default.ZedTypes.Length;
for(i=0; i<Default.ZedTypes.Length; ++i)
for (i=0; i<Default.ZedTypes.Length; ++i)
{
SA.Length = 0;
ParseStringIntoArray(class'Ext_TraitZED_Summon'.Default.ZedTypes[i],SA,",",true);
for(j=0; j<SA.Length; ++j)
for (j=0; j<SA.Length; ++j)
{
C = class<KFPawn_Monster>(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';
}
}
@ -223,13 +223,13 @@ static final function class<KFPawn_Monster> PickRandomMonster(byte Level, bool b
local class<KFPawn_Monster> 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<KFPawn_MonsterBoss>(Res)==None)
if (!bNotBoss || class<KFPawn_MonsterBoss>(Res)==None)
break;
}
if(bNotBoss && class<KFPawn_MonsterBoss>(Res)!=None)
if (bNotBoss && class<KFPawn_MonsterBoss>(Res)!=None)
Res = Class'KFPawn_ZedFleshpound';
return Res;
}

View File

@ -13,14 +13,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
return false;
for(i=0; i<Perk.PerkTraits.Length; ++i)
for (i=0; i<Perk.PerkTraits.Length; ++i)
{
if(Perk.PerkTraits[i].TraitType==Class'Ext_TraitGrenadeUpg')
if (Perk.PerkTraits[i].TraitType==Class'Ext_TraitGrenadeUpg')
{
if(Perk.PerkTraits[i].CurrentLevel <= 0)
if (Perk.PerkTraits[i].CurrentLevel <= 0)
return false;
else break;
}

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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)

View File

@ -5,7 +5,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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)

View File

@ -36,11 +36,11 @@ static function bool IsEnabled(Ext_PerkBase Perk)
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
// First check level.
if(Perk.CurrentLevel<Default.MinLevel)
if (Perk.CurrentLevel<Default.MinLevel)
return false;
// Then check grouping.
if(Lvl==0 && Default.TraitGroup!=None && Default.TraitGroup.Static.GroupLimited(Perk,Default.Class))
if (Lvl==0 && Default.TraitGroup!=None && Default.TraitGroup.Static.GroupLimited(Perk,Default.Class))
return false;
return true;
}
@ -51,14 +51,14 @@ static function string GetPerkDescription()
local string S;
local byte i;
for(i=0; i<Default.NumLevels; ++i)
for (i=0; i<Default.NumLevels; ++i)
{
if(i==0)
if (i==0)
S = string(GetTraitCost(i));
else S $= ", "$GetTraitCost(i);
}
S = "Max level: #{9FF781}"$Default.NumLevels$"#{DEF}|Level costs: #{F3F781}"$S$"#{DEF}";
if(Default.MinLevel>0)
if (Default.MinLevel>0)
S = "Min perk level: #{FF4000}"$Default.MinLevel$"#{DEF}|"$S;
return Default.Description$"||"$S;
}
@ -72,9 +72,9 @@ static function string GetTooltipInfo()
// Return level specific trait prices.
static function int GetTraitCost(byte LevelNum)
{
if(Default.LevelCosts.Length>0)
if (Default.LevelCosts.Length>0)
{
if(LevelNum<Default.LevelCosts.Length)
if (LevelNum<Default.LevelCosts.Length)
return Default.LevelCosts[LevelNum];
return Default.LevelCosts[Default.LevelCosts.Length-1];
}
@ -82,12 +82,12 @@ static function int GetTraitCost(byte LevelNum)
}
// Trait initialization/cleanup.
static function Ext_TraitDataStore InitializeFor(Ext_PerkBase Perk, ExtPlayerController Player)
static function Ext_TraitDataStore Initializefor (Ext_PerkBase Perk, ExtPlayerController Player)
{
local Ext_TraitDataStore T;
T = None;
if(Default.TraitData!=None)
if (Default.TraitData!=None)
{
T = Player.Spawn(Default.TraitData,Player);
T.Perk = Perk;
@ -98,7 +98,7 @@ static function Ext_TraitDataStore InitializeFor(Ext_PerkBase Perk, ExtPlayerCon
}
static function CleanupTrait(ExtPlayerController Player, Ext_PerkBase Perk, optional Ext_TraitDataStore Data)
{
if(Data!=None)
if (Data!=None)
Data.Destroy();
}
@ -122,7 +122,7 @@ static function AddDefaultInventory(KFPawn Player, Ext_PerkBase Perk, byte Level
// 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.
{
switch(MaxVal)
switch (MaxVal)
{
case 0: // 0-65535
return Chr(Max(Value,0)+1);
@ -138,7 +138,7 @@ static final function int StrToInt(out string Value, optional byte MaxVal) // Re
{
local int Res;
switch(MaxVal)
switch (MaxVal)
{
case 0: // 0-65535
Res = Asc(Left(Value,1))-1;
@ -168,7 +168,7 @@ static function string GetRepData()
local int i;
S = IntToStr(Default.MinLevel)$IntToStr(Default.LevelCosts.Length);
for(i=0; i<Default.LevelCosts.Length; ++i)
for (i=0; i<Default.LevelCosts.Length; ++i)
S $= IntToStr(Default.LevelCosts[i]);
return S;
}
@ -178,7 +178,7 @@ static function string ClientSetRepData(string S)
Default.MinLevel = StrToInt(S);
Default.LevelCosts.Length = StrToInt(S);
for(i=0; i<Default.LevelCosts.Length; ++i)
for (i=0; i<Default.LevelCosts.Length; ++i)
Default.LevelCosts[i] = StrToInt(S);
return S;
}
@ -186,7 +186,7 @@ static function string ClientSetRepData(string S)
// Configure initialization.
static function CheckConfig()
{
if(Default.ConfigVersion!=Default.CurrentConfigVer)
if (Default.ConfigVersion!=Default.CurrentConfigVer)
{
UpdateConfigs(Default.ConfigVersion);
Default.ConfigVersion = Default.CurrentConfigVer;
@ -195,7 +195,7 @@ static function CheckConfig()
}
static function UpdateConfigs(int OldVer)
{
if(OldVer==0)
if (OldVer==0)
{
Default.LevelCosts = Default.DefLevelCosts;
Default.MinLevel = Default.DefMinLevel;
@ -209,7 +209,7 @@ static function InitWebAdmin(ExtWebAdmin_UI UI)
}
static function string GetValue(name PropName, int ElementIndex)
{
switch(PropName)
switch (PropName)
{
case 'MinLevel':
return string(Default.MinLevel);
@ -221,13 +221,13 @@ static function string GetValue(name PropName, int ElementIndex)
}
static function ApplyValue(name PropName, int ElementIndex, string Value)
{
switch(PropName)
switch (PropName)
{
case 'MinLevel':
Default.MinLevel = int(Value); break;
case 'LevelCosts':
Default.LevelCosts.Length = Default.DefLevelCosts.Length;
if(Value!="#DELETE" && ElementIndex<Default.LevelCosts.Length)
if (Value!="#DELETE" && ElementIndex<Default.LevelCosts.Length)
Default.LevelCosts[ElementIndex] = int(Value);
break;
case 'bDisabled':

View File

@ -2,12 +2,12 @@ Class Ext_TraitBunnyHop extends Ext_TraitBase;
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).bHasBunnyHop = true;
}
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).bHasBunnyHop = false;
}

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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)
@ -15,7 +15,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local KFInventoryManager M;
M = KFInventoryManager(Player.InvManager);
if(M!=None)
if (M!=None)
M.MaxCarryBlocks = M.Default.MaxCarryBlocks;
}

View File

@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
return false;
if(Lvl==0)
if (Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Damage');
if(i>=0)
if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}
@ -31,7 +31,7 @@ static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitD
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;
@ -43,7 +43,7 @@ static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_Trai
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;

View File

@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
return false;
if(Lvl==0)
if (Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Reload');
if(i>=0)
if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}

View File

@ -4,12 +4,12 @@ var array<float> BatteryCharges;
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)
{
if(ExtHumanPawn(Player)!=None)
if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).SetBatteryRate(1.f);
}

View File

@ -4,13 +4,13 @@ static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Cl
{
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.

View File

@ -2,7 +2,7 @@ Class Ext_TraitGrenadeSUpg extends Ext_TraitBase;
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)

View File

@ -2,15 +2,15 @@ Class Ext_TraitGrenadeUpg extends Ext_TraitBase;
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)
{
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)

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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)

View File

@ -11,7 +11,7 @@ static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_Trai
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);

View File

@ -2,12 +2,12 @@ Class Ext_TraitKnockback extends Ext_TraitRagdoll;
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)
{
if(ExtHumanPawn(Player)!=None)
if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).KnockbackResist = 1.f;
}

View File

@ -11,7 +11,7 @@ static function string GetPerkDescription()
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
return false;
return true;

View File

@ -4,7 +4,7 @@ static function AddDefaultInventory(KFPawn Player, Ext_PerkBase Perk, byte Level
{
local int i;
i = Player.DefaultInventory.Find(class'ExtWeap_Pistol_9mm');
if(i != -1)
if (i != -1)
Player.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS';
}
@ -13,10 +13,10 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local Inventory Inv;
Inv = Player.FindInventoryType(class'ExtWeap_Pistol_9mm');
if(Inv!=None)
if (Inv!=None)
Inv.Destroy();
if(Player.FindInventoryType(class'ExtWeap_Pistol_MedicS')==None)
if (Player.FindInventoryType(class'ExtWeap_Pistol_MedicS')==None)
{
Inv = Player.CreateInventory(class'ExtWeap_Pistol_MedicS',Player.Weapon!=None);
if (KFWeapon(Inv)!=None)

View File

@ -13,14 +13,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
return false;
for(i=0; i<Perk.PerkTraits.Length; ++i)
for (i=0; i<Perk.PerkTraits.Length; ++i)
{
if(Perk.PerkTraits[i].TraitType==Class'Ext_TraitAPShots')
if (Perk.PerkTraits[i].TraitType==Class'Ext_TraitAPShots')
{
if(Perk.PerkTraits[i].CurrentLevel <= 0)
if (Perk.PerkTraits[i].CurrentLevel <= 0)
return false;
else break;
}

View File

@ -4,12 +4,12 @@ var float ChanceValues[4];
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)
{
if(ExtHumanPawn(Player)!=None)
if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).NoRagdollChance = 0.f;
}

View File

@ -5,7 +5,7 @@ static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Cl
local ExtProj_SUPERGrenade P;
P = Player.Spawn(class'ExtProj_SUPERGrenade');
if(P!=None)
if (P!=None)
{
P.bExplodeOnContact = false; // Nope!
P.InstigatorController = Player.Controller;

View File

@ -2,12 +2,12 @@ Class Ext_TraitSWATEnforcer extends Ext_TraitBase;
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)
{
if(ExtHumanPawn(Player)!=None)
if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).bMovesFastInZedTime = false;
}
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

View File

@ -4,13 +4,13 @@ var array<float> AtkRates;
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)
{
if(ExtHumanPawn(Player)!=None)
if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).bMovesFastInZedTime = false;
Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f;
}

View File

@ -4,7 +4,7 @@ var Ext_T_SupplierInteract SupplyInteraction;
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);
@ -13,15 +13,15 @@ final function SpawnSupplier(KFPawn_Human H, optional bool bGrenades)
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<Ext_TraitSupply>(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()

View File

@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
return false;
if(Lvl==0)
if (Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Damage');
if(i>=0)
if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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)

View File

@ -9,7 +9,7 @@ var array<FLevelFX> LevelEffects;
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);
}
@ -42,18 +42,18 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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)
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)
@ -61,13 +61,13 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local class<Inventory> 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();
}
}

View File

@ -9,14 +9,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
local int i;
// First check level.
if(Perk.CurrentLevel<Default.MinLevel)
if (Perk.CurrentLevel<Default.MinLevel)
return false;
// Then check stats.
if(Lvl==0 && Default.BaseTrait!=None)
if (Lvl==0 && Default.BaseTrait!=None)
{
i = Perk.PerkTraits.Find('TraitType',Default.BaseTrait);
if(i>=0)
if (i>=0)
return (Perk.PerkTraits[i].CurrentLevel>0);
}
return true;

View File

@ -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<Default.ZedTypes.Length; ++i)
for (i=0; i<Default.ZedTypes.Length; ++i)
{
for(j=0; j<Default.DefZedTypes[i].Zeds.Length; ++j)
for (j=0; j<Default.DefZedTypes[i].Zeds.Length; ++j)
{
if(j==0)
if (j==0)
Default.ZedTypes[i] = PathName(Default.DefZedTypes[i].Zeds[j]);
else Default.ZedTypes[i] $= ","$PathName(Default.DefZedTypes[i].Zeds[j]);
}
@ -40,24 +40,24 @@ static function CheckConfig()
Default.FinalLevelPrestige = 3;
StaticSaveConfig();
}
else if(Default.ZedTypes.Length==5) // Upgrade config from old version.
else if (Default.ZedTypes.Length==5) // Upgrade config from old version.
{
Default.ZedTypes.Length = Default.DefZedTypes.Length;
for(i=5; i<Default.ZedTypes.Length; ++i)
for (i=5; i<Default.ZedTypes.Length; ++i)
{
for(j=0; j<Default.DefZedTypes[i].Zeds.Length; ++j)
for (j=0; j<Default.DefZedTypes[i].Zeds.Length; ++j)
{
if(j==0)
if (j==0)
Default.ZedTypes[i] = PathName(Default.DefZedTypes[i].Zeds[j]);
else Default.ZedTypes[i] $= ","$PathName(Default.DefZedTypes[i].Zeds[j]);
}
}
if(Default.LevelCosts.Length==5)
if (Default.LevelCosts.Length==5)
Default.LevelCosts.AddItem(Default.DefLevelCosts[5]);
Default.FinalLevelPrestige = 3;
StaticSaveConfig();
}
if(Default.ZedRespawnTime==0)
if (Default.ZedRespawnTime==0)
{
Default.ZedRespawnTime = 60.f;
StaticSaveConfig();
@ -71,14 +71,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
local int i;
// First check level.
if(Perk.CurrentLevel<Default.MinLevel || (Lvl>=5 && Perk.CurrentPrestige<Default.FinalLevelPrestige))
if (Perk.CurrentLevel<Default.MinLevel || (Lvl>=5 && Perk.CurrentPrestige<Default.FinalLevelPrestige))
return false;
// Then check base trait.
if(Lvl==0 && Default.BaseTrait!=None)
if (Lvl==0 && Default.BaseTrait!=None)
{
i = Perk.PerkStats.Find('StatType','Damage');
if(i>=0)
if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}
return true;
@ -89,12 +89,12 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
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; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].CurrentLevel>0 && Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType)!=None && !Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType).Default.bIsSummoner)
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].CurrentLevel>0 && Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType)!=None && !Class<Ext_TraitZEDBase>(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)
@ -102,7 +102,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local Ext_T_ZEDHelper H;
foreach Player.ChildActors(class'Ext_T_ZEDHelper',H)
if(!H.bIsExtra)
if (!H.bIsExtra)
H.Destroy();
}
@ -124,7 +124,7 @@ static function string ClientSetRepData(string S)
static function string GetValue(name PropName, int ElementIndex)
{
switch(PropName)
switch (PropName)
{
case 'ZedTypes':
return (ElementIndex==-1 ? string(Default.ZedTypes.Length) : Default.ZedTypes[ElementIndex]);
@ -138,10 +138,10 @@ static function string GetValue(name PropName, int ElementIndex)
}
static function ApplyValue(name PropName, int ElementIndex, string Value)
{
switch(PropName)
switch (PropName)
{
case 'ZedTypes':
if(Value!="#DELETE" && ElementIndex<Default.ZedTypes.Length)
if (Value!="#DELETE" && ElementIndex<Default.ZedTypes.Length)
Default.ZedTypes[ElementIndex] = Value;
break;
case 'ZedRespawnTime':

View File

@ -7,14 +7,14 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local byte MaxLevel;
MaxLevel = 0;
for(i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].TraitType==Class'Ext_TraitZED_Summon')
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].TraitType==Class'Ext_TraitZED_Summon')
{
MaxLevel = Max(Perk.PerkTraits[i].CurrentLevel,1)-1;
break;
}
switch(Level)
switch (Level)
{
case 3:
AddHelperType(MaxLevel*0.8,Player);
@ -29,8 +29,8 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
}
// Make other traits refresh (apply HP/damage scalers).
for(i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].CurrentLevel>0 && Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType)!=None && !Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType).Default.bIsSummoner)
for (i=0; i<Perk.PerkTraits.Length; ++i)
if (Perk.PerkTraits[i].CurrentLevel>0 && Class<Ext_TraitZEDBase>(Perk.PerkTraits[i].TraitType)!=None && !Class<Ext_TraitZEDBase>(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)
@ -38,7 +38,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
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)
@ -46,7 +46,7 @@ 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;

View File

@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
return false;
if(Lvl==0)
if (Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Heal');
if(i>=0)
if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=25);
}

View File

@ -10,7 +10,7 @@ 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);
@ -32,13 +32,13 @@ function PickDefaultFontSize(float YRes)
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";
@ -55,7 +55,7 @@ final function DrawText(byte Res, string S)
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);
@ -72,7 +72,7 @@ final function DrawCornerTexNU(int SizeX, int SizeY, byte Dir) // Draw non-unifo
}
final function DrawCornerTex(int Size, byte Dir)
{
switch(Dir)
switch (Dir)
{
case 0: // Up-left
Canvas.DrawTile(ItemTex,Size,Size,77,15,-66,58);
@ -94,7 +94,7 @@ final function DrawWhiteBox(int XS, int YS)
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 byte
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 byte
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);

View File

@ -23,12 +23,12 @@ 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,25 +43,25 @@ 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);
@ -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)
{
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,36 +184,36 @@ 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; i<ActiveMenus.Length; ++i)
for (i=0; i<ActiveMenus.Length; ++i)
ActiveMenus[i].MenuTick(DeltaTime);
// Check idle.
if(Abs(MousePosition.X-OldMousePos.X)>5.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;
}
@ -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,32 +245,32 @@ simulated function MouseMove(float MouseX, float MouseY)
}
else
{
for(i=0; i<ActiveMenus.Length; ++i)
for (i=0; i<ActiveMenus.Length; ++i)
{
if(ActiveMenus[i].CaptureMouse())
if (ActiveMenus[i].CaptureMouse())
{
F = ActiveMenus[i].GetMouseFocus();
if(F!=MouseFocus)
if (F!=MouseFocus)
{
MousePauseTime = 0;
if(MouseFocus!=None)
if (MouseFocus!=None)
MouseFocus.MouseLeave();
MouseFocus = F;
F.MouseEnter();
}
break;
}
else if(ActiveMenus[i].bOnlyThisFocus) // Discard any other menus after this one.
else if (ActiveMenus[i].bOnlyThisFocus) // Discard any other menus after this one.
{
i = ActiveMenus.Length;
break;
}
}
}
if(MouseFocus!=None && i==ActiveMenus.Length) // Hovering over nothing.
if (MouseFocus!=None && i==ActiveMenus.Length) // Hovering over nothing.
{
MousePauseTime = 0;
if(MouseFocus!=None)
if (MouseFocus!=None)
MouseFocus.MouseLeave();
MouseFocus = None;
}
@ -280,8 +280,8 @@ simulated final function int GetFreeIndex(bool bNewAlwaysTop) // Find first allo
{
local int i;
for(i=0; i<ActiveMenus.Length; ++i)
if(bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop)
for (i=0; i<ActiveMenus.Length; ++i)
if (bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop)
{
ActiveMenus.Insert(i,1);
return i;
@ -295,12 +295,12 @@ simulated function KFGUI_Page OpenMenu(class<KFGUI_Page> 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<KFGUI_Page> MenuClass)
SetMenuState(true);
// Check if should use pre-excisting menu.
if(MenuClass.Default.bUnique)
if (MenuClass.Default.bUnique)
{
for(i=0; i<ActiveMenus.Length; ++i)
if(ActiveMenus[i].Class==MenuClass)
for (i=0; i<ActiveMenus.Length; ++i)
if (ActiveMenus[i].Class==MenuClass)
{
if(i>0 && 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<KFGUI_Page> MenuClass)
return M;
}
if(MenuClass.Default.bPersistant)
if (MenuClass.Default.bPersistant)
{
for(i=0; i<PersistentMenus.Length; ++i)
if(PersistentMenus[i].Class==MenuClass)
for (i=0; i<PersistentMenus.Length; ++i)
if (PersistentMenus[i].Class==MenuClass)
{
M = PersistentMenus[i];
PersistentMenus.Remove(i,1);
@ -341,7 +341,7 @@ simulated function KFGUI_Page OpenMenu(class<KFGUI_Page> MenuClass)
}
M = New(None)MenuClass;
if(M==None) // Probably abstract class.
if (M==None) // Probably abstract class.
return None;
i = GetFreeIndex(M.bAlwaysTop);
@ -356,28 +356,28 @@ simulated function CloseMenu(class<KFGUI_Page> MenuClass, optional bool bCloseAl
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)
@ -385,46 +385,46 @@ 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)
{
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.
@ -435,25 +435,25 @@ simulated final function bool MenuIsOpen(optional class<KFGUI_Page> 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)
{
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;
@ -467,17 +467,17 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight)
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,9 +509,9 @@ 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);
}
}
@ -519,7 +519,7 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event)
{
if (Event == IE_Pressed)
{
switch(Key)
switch (Key)
{
case 'LeftMouseButton':
GUI_InputMouse(true,false);
@ -531,7 +531,7 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event)
}
else if (Event == IE_Released)
{
switch(Key)
switch (Key)
{
case 'LeftMouseButton':
GUI_InputMouse(false,false);
@ -545,19 +545,19 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event)
}
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;
}
@ -567,7 +567,7 @@ simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent
}
simulated function bool ReceivedInputChar(int ControllerId, string Unicode)
{
if(!bIsInMenuState)
if (!bIsInMenuState)
return false;
return OnReceivedInputChar(ControllerId,Unicode);
}

View File

@ -10,7 +10,7 @@ function DrawHUD(HUD H)
}
function PostRender(Canvas Canvas)
{
if(ControllerOwner.bIsInMenuState)
if (ControllerOwner.bIsInMenuState)
ControllerOwner.HandleDrawMenu();
//ControllerOwner.RenderMenu(Canvas);
}
@ -21,7 +21,7 @@ function PlayerInput(float DeltaTime)
// Do not move.
ControllerOwner.MenuInput(DeltaTime);
if(!ControllerOwner.bAbsorbInput)
if (!ControllerOwner.bAbsorbInput)
{
aMouseX = 0;
aMouseY = 0;

View File

@ -12,7 +12,7 @@ static function OpenMenuForClient(PlayerController PC, class<KFGUI_Page> Page)
foreach PC.ChildActors(class'KF2GUINetwork',G)
break;
if(G==None)
if (G==None)
G = PC.Spawn(class'KF2GUINetwork',PC);
G.ClientOpenMenu(Page);
}
@ -22,24 +22,24 @@ static function CloseMenuForClient(PlayerController PC, class<KFGUI_Page> Page,
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<KFGUI_Page> 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<KFGUI_Page> 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<KFGUI_Page> 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();
}
}

View File

@ -13,16 +13,16 @@ function InitStyle()
LoadedTex[0] = Texture2D(DynamicLoadObject("EditorMaterials.CASC_ModuleEnable",class'Texture2D'));
LoadedTex[1] = Texture2D(DynamicLoadObject("EditorMaterials.Tick",class'Texture2D'));
for(i=0; i<ArrayCount(LoadedTex); ++i)
if(LoadedTex[i]==None)
for (i=0; i<ArrayCount(LoadedTex); ++i)
if (LoadedTex[i]==None)
LoadedTex[i] = Texture2D'EngineMaterials.DefaultWhiteGrid';
// TODO: SmallFont/TinyFont not support unicode
DrawFonts[0] = Font(DynamicLoadObject("UI_Canvas_Fonts.Font_General",class'Font'));
DrawFonts[1] = Font(DynamicLoadObject("EngineFonts.SmallFont",class'Font'));
DrawFonts[2] = Font(DynamicLoadObject("EngineFonts.TinyFont",class'Font'));
for(i=0; i<ArrayCount(DrawFonts); ++i)
for (i=0; i<ArrayCount(DrawFonts); ++i)
{
if(DrawFonts[i]==None)
if (DrawFonts[i]==None)
DrawFonts[i] = class'Engine'.Static.GetMediumFont();
}
}
@ -36,7 +36,7 @@ function RenderFramedWindow(KFGUI_FloatingWindow P)
TitleHeight = DefaultHeight;
// Frame Header
if(P.bWindowFocused)
if (P.bWindowFocused)
Canvas.SetDrawColor(220,2,2,255);
else Canvas.SetDrawColor(100,1,1,P.FrameOpacity);
Canvas.SetPos(0,0);
@ -55,7 +55,7 @@ function RenderFramedWindow(KFGUI_FloatingWindow P)
DrawWhiteBox(XS-(CornerSlope*2),CornerSlope);
// Frame itself.
if(P.bWindowFocused)
if (P.bWindowFocused)
Canvas.SetDrawColor(32,6,6,255);
else Canvas.SetDrawColor(16,2,2,P.FrameOpacity);
Canvas.SetPos(0,TitleHeight);
@ -76,7 +76,7 @@ function RenderFramedWindow(KFGUI_FloatingWindow P)
DrawWhiteBox(CornerSlope,YS-(CornerSlope*2)-TitleHeight);
// Title.
if(P.WindowTitle!="")
if (P.WindowTitle!="")
{
Canvas.SetDrawColor(250,250,250,P.FrameOpacity);
Canvas.SetPos(CornerSlope,0);
@ -92,7 +92,7 @@ function RenderWindow(KFGUI_Page P)
CornerSlope = DefaultHeight*0.4;
// Frame itself.
if(P.bWindowFocused)
if (P.bWindowFocused)
Canvas.SetDrawColor(64,64,64,255);
else Canvas.SetDrawColor(32,32,32,P.FrameOpacity);
Canvas.SetPos(0,0);
@ -121,9 +121,9 @@ function RenderToolTip(KFGUI_Tooltip TT)
// First compute textbox size.
TY = DefaultHeight*TT.Lines.Length;
for(i=0; i<TT.Lines.Length; ++i)
for (i=0; i<TT.Lines.Length; ++i)
{
if(TT.Lines[i]!="")
if (TT.Lines[i]!="")
Canvas.TextSize(TT.Lines[i],XS,YS);
TX = FMax(XS,TX);
}
@ -137,12 +137,12 @@ function RenderToolTip(KFGUI_Tooltip TT)
Y = TT.CompPos[1]+24.f;
// Then check if too close to window edge, then move it to another pivot.
if((X+TX)>TT.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,7 +161,7 @@ function RenderToolTip(KFGUI_Tooltip TT)
Canvas.SetDrawColor(255,255,255,TT.CurrentAlpha);
X+=TOOLTIP_BORDER;
Y+=TOOLTIP_BORDER;
for(i=0; i<TT.Lines.Length; ++i)
for (i=0; i<TT.Lines.Length; ++i)
{
Canvas.SetPos(X,Y);
Canvas.DrawText(TT.Lines[i],,TS,TS,TT.TextFontInfo);
@ -173,15 +173,15 @@ function RenderButton(KFGUI_Button B)
local float XL,YL,TS;
local byte i;
if(B.bDisabled)
if (B.bDisabled)
Canvas.SetDrawColor(32,0,0,255);
else if(B.bPressedDown)
else if (B.bPressedDown)
Canvas.SetDrawColor(255,64,64,255);
else if(B.bFocused)
else if (B.bFocused)
Canvas.SetDrawColor(180,45,45,255);
else Canvas.SetDrawColor(164,8,8,255);
if(B.bIsHighlighted)
if (B.bIsHighlighted)
{
Canvas.DrawColor.R = Min(Canvas.DrawColor.R+25,255);
Canvas.DrawColor.G = Min(Canvas.DrawColor.G+25,255);
@ -189,29 +189,29 @@ function RenderButton(KFGUI_Button B)
}
Canvas.SetPos(0.f,0.f);
if(B.ExtravDir==255)
if (B.ExtravDir==255)
DrawWhiteBox(B.CompPos[2],B.CompPos[3]);
else DrawRectBox(0,0,B.CompPos[2],B.CompPos[3],Min(B.CompPos[2],B.CompPos[3])*0.2,B.ExtravDir);
if(B.OverlayTexture.Texture!=None)
if (B.OverlayTexture.Texture!=None)
{
Canvas.SetPos(0.f,0.f);
Canvas.DrawTile(B.OverlayTexture.Texture,B.CompPos[2],B.CompPos[3],B.OverlayTexture.U,B.OverlayTexture.V,B.OverlayTexture.UL,B.OverlayTexture.VL);
}
if(B.ButtonText!="")
if (B.ButtonText!="")
{
// Chose the best font to fit this button.
i = Min(B.FontScale+DefaultFontSize,MaxFontScale);
while(true)
while (true)
{
Canvas.Font = PickFont(i,TS);
Canvas.TextSize(B.ButtonText,XL,YL,TS,TS);
if(i==0 || (XL<(B.CompPos[2]*0.95) && YL<(B.CompPos[3]*0.95)))
if (i==0 || (XL<(B.CompPos[2]*0.95) && YL<(B.CompPos[3]*0.95)))
break;
--i;
}
Canvas.SetPos((B.CompPos[2]-XL)*0.5,(B.CompPos[3]-YL)*0.5);
if(B.bDisabled)
if (B.bDisabled)
Canvas.DrawColor = B.TextColor*0.5f;
else Canvas.DrawColor = B.TextColor;
Canvas.DrawText(B.ButtonText,,TS,TS,B.TextFontInfo);
@ -221,17 +221,17 @@ function RenderEditBox(KFGUI_EditBox E)
{
local color C;
if(E.bDisabled)
if (E.bDisabled)
{
Canvas.SetDrawColor(4,4,32,255);
C = MakeColor(52,52,52,255);
}
else if(E.bPressedDown)
else if (E.bPressedDown)
{
Canvas.SetDrawColor(110,110,255,255);
C = MakeColor(16,16,186,255);
}
else if(E.bFocused || E.bIsTyping)
else if (E.bFocused || E.bIsTyping)
{
Canvas.SetDrawColor(120,120,230,255);
C = MakeColor(8,8,96,255);
@ -254,28 +254,28 @@ function RenderScrollBar(KFGUI_ScrollBarBase S)
local float A;
local byte i;
if(S.bDisabled)
if (S.bDisabled)
Canvas.SetDrawColor(48,2,2,255);
else if(S.bFocused || S.bGrabbedScroller)
else if (S.bFocused || S.bGrabbedScroller)
Canvas.SetDrawColor(86,8,8,255);
else Canvas.SetDrawColor(74,4,4,255);
Canvas.SetPos(0.f,0.f);
DrawWhiteBox(S.CompPos[2],S.CompPos[3]);
if(S.bDisabled)
if (S.bDisabled)
return;
if(S.bVertical)
if (S.bVertical)
i = 3;
else i = 2;
S.SliderScale = FMax(S.PageStep * (S.CompPos[i] - 32.f) / (S.MaxRange + S.PageStep),S.CalcButtonScale);
if(S.bGrabbedScroller)
if (S.bGrabbedScroller)
{
// Track mouse.
if(S.bVertical)
if (S.bVertical)
A = S.Owner.MousePosition.Y - S.CompPos[1] - S.GrabbedOffset;
else A = S.Owner.MousePosition.X - S.CompPos[0] - S.GrabbedOffset;
@ -286,13 +286,13 @@ function RenderScrollBar(KFGUI_ScrollBarBase S)
A = float(S.CurrentScroll) / float(S.MaxRange);
S.ButtonOffset = A*(S.CompPos[i]-S.SliderScale);
if(S.bGrabbedScroller)
if (S.bGrabbedScroller)
Canvas.SetDrawColor(140,86,8,255);
else if(S.bFocused)
else if (S.bFocused)
Canvas.SetDrawColor(175,48,8,255);
else Canvas.SetDrawColor(150,36,4,255);
if(S.bVertical)
if (S.bVertical)
{
Canvas.SetPos(0.f,S.ButtonOffset);
DrawWhiteBox(S.CompPos[2],S.SliderScale);
@ -307,13 +307,13 @@ function RenderColumnHeader(KFGUI_ColumnTop C, float XPos, float Width, int Inde
{
local int XS;
if(bSort)
if (bSort)
{
if(bFocus)
if (bFocus)
Canvas.SetDrawColor(175,240,8,255);
else Canvas.SetDrawColor(128,200,56,255);
}
else if(bFocus)
else if (bFocus)
Canvas.SetDrawColor(220,220,8,255);
else Canvas.SetDrawColor(220,86,56,255);
@ -331,20 +331,20 @@ function RenderColumnHeader(KFGUI_ColumnTop C, float XPos, float Width, int Inde
}
function RenderCheckbox(KFGUI_CheckBox C)
{
if(C.bDisabled)
if (C.bDisabled)
Canvas.SetDrawColor(86,86,86,255);
else if(C.bPressedDown)
else if (C.bPressedDown)
Canvas.SetDrawColor(128,255,128,255);
else if(C.bFocused)
else if (C.bFocused)
Canvas.SetDrawColor(150,200,128,255);
else Canvas.SetDrawColor(128,186,128,255);
Canvas.SetPos(0.f,0.f);
Canvas.DrawTileStretched(LoadedTex[0],C.CompPos[2],C.CompPos[3],0,0,LoadedTex[0].GetSurfaceWidth(),LoadedTex[0].GetSurfaceHeight());
if(C.bChecked)
if (C.bChecked)
{
if(C.bDisabled)
if (C.bDisabled)
Canvas.SetDrawColor(128,128,128,255);
else Canvas.SetDrawColor(255,255,255,255);
Canvas.SetPos(0.f,0.f);
@ -353,21 +353,21 @@ function RenderCheckbox(KFGUI_CheckBox C)
}
function RenderComboBox(KFGUI_ComboBox C)
{
if(C.bDisabled)
if (C.bDisabled)
Canvas.SetDrawColor(64,4,4,255);
else if(C.bPressedDown)
else if (C.bPressedDown)
Canvas.SetDrawColor(220,56,56,255);
else if(C.bFocused)
else if (C.bFocused)
Canvas.SetDrawColor(190,48,48,255);
else Canvas.SetDrawColor(186,4,4,255);
Canvas.SetPos(0.f,0.f);
DrawWhiteBox(C.CompPos[2],C.CompPos[3]);
if(C.SelectedIndex<C.Values.Length && C.Values[C.SelectedIndex]!="")
if (C.SelectedIndex<C.Values.Length && C.Values[C.SelectedIndex]!="")
{
Canvas.SetPos(C.BorderSize,(C.CompPos[3]-C.TextHeight)*0.5);
if(C.bDisabled)
if (C.bDisabled)
Canvas.DrawColor = C.TextColor*0.5f;
else Canvas.DrawColor = C.TextColor;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX-C.BorderSize,Canvas.ClipY);
@ -403,9 +403,9 @@ function RenderComboList(KFGUI_ComboSelector C)
C.CurrentRow = -1;
Canvas.PushMaskRegion(Canvas.OrgX,Canvas.OrgY,Canvas.ClipX,Canvas.ClipY);
for(i=0; i<C.Combo.Values.Length; ++i)
for (i=0; i<C.Combo.Values.Length; ++i)
{
if(bCheckMouse && Y>=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,7 +424,7 @@ 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);
@ -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<C.ItemRows.Length; ++i)
for (i=0; i<C.ItemRows.Length; ++i)
{
if(bCheckMouse && Y>=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,7 +485,7 @@ 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);
@ -494,7 +494,7 @@ function RenderRightClickMenu(KFGUI_RightClickMenu C)
function Font PickFont(byte i, out float Scaler)
{
switch(i)
switch (i)
{
case 0:
Scaler = 0.3;

View File

@ -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');
@ -86,17 +86,17 @@ simulated function Destroyed()
}
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()
simulated function PendingMapswitch ()
{
// Make sure we dont garbage collect the game:
class'MS_Game'.Static.SetReference();
@ -113,8 +113,8 @@ final function AddKillMessage(class<Pawn> Victim, int Value, PlayerReplicationIn
bDmg = (Type==2);
bLcl = (Type==0);
for(i=0; i<KillMessages.Length; ++i)
if(KillMessages[i].bDamage==bDmg && KillMessages[i].bLocal==bLcl && KillMessages[i].Type==Victim && (bDmg || bLcl || KillMessages[i].OwnerPRI==PRI))
for (i=0; i<KillMessages.Length; ++i)
if (KillMessages[i].bDamage==bDmg && KillMessages[i].bLocal==bLcl && KillMessages[i].Type==Victim && (bDmg || bLcl || KillMessages[i].OwnerPRI==PRI))
{
KillMessages[i].Counter+=Value;
KillMessages[i].MsgTime = WorldInfo.TimeSeconds;
@ -141,17 +141,17 @@ final function AddDeathMessage(string S, string StrippedMsg)
}
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"));
}
@ -161,26 +161,26 @@ static final function string GetNameOf(class<Pawn> Other)
local string S;
local class<KFPawn_Monster> KFM;
if(Class<VSZombie>(Other)!=None)
if (Class<VSZombie>(Other)!=None)
return Class<VSZombie>(Other).Default.ZombieName;
KFM = class<KFPawn_Monster>(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)
{
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":
@ -195,10 +195,10 @@ 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);
}
@ -208,16 +208,16 @@ 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(ProgressMsgTime<WorldInfo.TimeSeconds)
if (ProgressMsgTime<WorldInfo.TimeSeconds)
{
bShowProgress = false;
if(PlayerOwner.Player==None)
if (PlayerOwner.Player==None)
{
ShowProgressMsg("Downloading contents for next map, please wait...|Press [Escape] key to cancel connection!");
RenderProgress();
}
else if(bProgressDC)
else if (bProgressDC)
KFPlayerOwner.ConsoleCommand("Disconnect");
}
else RenderProgress();
}
if(PlayerOwner.Player==None && OnlineSub!=None)
if (PlayerOwner.Player==None && OnlineSub!=None)
NotifyLevelChange();
}
simulated function CancelConnection()
{
if(!bConfirmDisconnect)
if (!bConfirmDisconnect)
{
ShowProgressMsg("Are you sure you want to cancel connection?|Press [Escape] again to confirm...");
bConfirmDisconnect = true;
@ -322,9 +322,9 @@ final function DrawRespawnCounter()
exec function SetShowScores(bool bNewValue)
{
bShowScores = bNewValue;
if(GUIController!=None)
if (GUIController!=None)
{
if(bShowScores)
if (bShowScores)
GUIController.OpenMenu(class'UI_Scoreboard_CD');
else GUIController.CloseMenu(class'UI_Scoreboard_CD');
}
@ -341,18 +341,18 @@ final function RenderKillMsg()
X = Canvas.ClipX*0.015;
Y = Canvas.ClipY*0.24;
for(i=0; i<KillMessages.Length; ++i)
for (i=0; i<KillMessages.Length; ++i)
{
T = WorldInfo.TimeSeconds-KillMessages[i].MsgTime;
if(T>6.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; i<DeathMessages.Length; ++i)
for (i=0; i<DeathMessages.Length; ++i)
{
T = WorldInfo.TimeSeconds-DeathMessages[i].MsgTime;
if(T>6.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<ProgressLines.Length; ++i)
for (i=0; i<ProgressLines.Length; ++i)
{
Canvas.TextSize(ProgressLines[i],XL,YL,Sc,Sc);
Canvas.SetPos((Canvas.ClipX-XL)*0.5,Y);
@ -460,7 +460,7 @@ function DrawHUD()
local bool bSpec;
// Draw weapon HUD underneath everything else
if(KFPlayerOwner != none && KFPlayerOwner.Pawn != none && KFPlayerOwner.Pawn.Weapon != none)
if (KFPlayerOwner != none && KFPlayerOwner.Pawn != none && KFPlayerOwner.Pawn.Weapon != none)
{
KFPlayerOwner.Pawn.Weapon.DrawHUD(self, Canvas);
}
@ -468,32 +468,32 @@ function DrawHUD()
super.DrawHUD();
// Cache GRI
if(KFGRI == none)
if (KFGRI == none)
{
KFGRI = KFGameReplicationInfo(WorldInfo.GRI);
}
// Don't draw canvas HUD in cinematic mode
if(KFPlayerOwner != none && KFPlayerOwner.bCinematicMode)
if (KFPlayerOwner != none && KFPlayerOwner.bCinematicMode)
{
return;
}
LocActor = KFPlayerOwner.ViewTarget != none ? KFPlayerOwner.ViewTarget : KFPlayerOwner;
// Draw the crosshair for casual mode
if(KFPlayerOwner != none && (bDrawCrosshair || bForceDrawCrosshair || KFPlayerOwner.GetTeamNum() == 255))
if (KFPlayerOwner != none && (bDrawCrosshair || bForceDrawCrosshair || KFPlayerOwner.GetTeamNum() == 255))
{
DrawCrosshair();
}
// Friendly player status
bSpec = (PlayerOwner.PlayerReplicationInfo!=None && PlayerOwner.PlayerReplicationInfo.bOnlySpectator);
if(bSpec || PlayerOwner.GetTeamNum()==0)
if (bSpec || PlayerOwner.GetTeamNum()==0)
{
//Friendly player status
if(!class'ExtPlayerController'.Default.bHideNameBeacons)
if (!class'ExtPlayerController'.Default.bHideNameBeacons)
{
if(KFPlayerOwner != none)
if (KFPlayerOwner != none)
{
KFPlayerOwner.GetPlayerViewPoint(ViewLocation, ViewRotation);
}
@ -502,12 +502,12 @@ function DrawHUD()
Canvas.EnableStencilTest(true);
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFPH)
{
if(KFPH.IsAliveAndWell() && KFPH != KFPlayerOwner.Pawn && KFPH.Mesh.SkeletalMesh != none && KFPH.Mesh.bAnimTreeInitialised)
if (KFPH.IsAliveAndWell() && KFPH != KFPlayerOwner.Pawn && KFPH.Mesh.SkeletalMesh != none && KFPH.Mesh.bAnimTreeInitialised)
{
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 (`TimeSince(KFPH.Mesh.LastRenderTime) < 0.2f && Normal(PlayerPartyInfoLocation - ViewLocation) dot ViewVector > 0.f)
{
if(DrawFriendlyHumanPlayerInfo(KFPH))
if (DrawFriendlyHumanPlayerInfo(KFPH))
{
VisibleHumanPlayers.AddItem(KFPH.PlayerReplicationInfo);
}
@ -536,7 +536,7 @@ function DrawHUD()
}
}
if(!KFGRI.bHidePawnIcons)
if (!KFGRI.bHidePawnIcons)
{
// Draw hidden players
CheckAndDrawHiddenPlayerIcons(VisibleHumanPlayers, HiddenHumanPlayers);
@ -545,7 +545,7 @@ function DrawHUD()
CheckAndDrawRemainingZedIcons();
//Draw our current objective location
if(KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none)
if (KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none)
{
KFGRI.ObjectiveInterface.DrawHUD(self, Canvas);
@ -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);
@ -611,14 +611,14 @@ 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;
@ -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
@ -679,7 +679,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH)
ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale;
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
if(KFPRI == none)
if (KFPRI == none)
{
return false;
}
@ -691,7 +691,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH)
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)
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;
}
@ -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.Health<P.HealthMax && ExtHumanPawn(P).RepRegenHP>0)
if (bDrawingHealth && ExtHumanPawn(P) != None && P.Health<P.HealthMax && ExtHumanPawn(P).RepRegenHP>0)
{
// Draw to-regen bar.
XPos+=(BarLength * BarPercentage);
@ -887,7 +887,7 @@ simulated function DrawMonsterHUD(KFPawn KFPH)
local byte FadeAlpha;
PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo);
if(PRI==None)
if (PRI==None)
return;
FadeAlpha = DrawToDistance(KFPH);
@ -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
@ -942,9 +942,9 @@ simulated function DrawPetInfo()
GUIStyle.DrawRectBox(X, Y + YS, BestPetXL * 1.04, YL * MyCurrentPet.Length, 4);
Canvas.DrawColor = MakeColor(32,250,32,255);
for(i=0; i<MyCurrentPet.Length; ++i)
for (i=0; i<MyCurrentPet.Length; ++i)
{
if(MyCurrentPet[i]==None)
if (MyCurrentPet[i]==None)
{
MyCurrentPet.Remove(i--,1);
continue;
@ -955,9 +955,9 @@ simulated function DrawPetInfo()
Canvas.SetPos(X,Y);
Canvas.DrawText(S,,Sc,Sc);
if(XL > BestPetXL)
if (XL > BestPetXL)
BestPetXL = XL;
if(YL > BestPetYL)
if (YL > BestPetYL)
BestPetYL = YL;
}
}
@ -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
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);
@ -1087,18 +1087,18 @@ 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<OnlineSub.CurrentInventory.Length; ++i)
for (i=0; i<OnlineSub.CurrentInventory.Length; ++i)
{
if(OnlineSub.CurrentInventory[i].NewlyAdded==1 && WasNewlyAdded[i]==0)
if (OnlineSub.CurrentInventory[i].NewlyAdded==1 && WasNewlyAdded[i]==0)
{
WasNewlyAdded[i] = 1;
if(WorldInfo.TimeSeconds<80.f || !bLoadedInitItems) // Skip initial inventory.
if (WorldInfo.TimeSeconds<80.f || !bLoadedInitItems) // Skip initial inventory.
continue;
j = OnlineSub.ItemPropertiesList.Find('Definition', OnlineSub.CurrentInventory[i].Definition);
if(j != INDEX_NONE)
if (j != INDEX_NONE)
{
NewItems.Insert(0,1);
NewItems[0].Icon = Texture2D(DynamicLoadObject(OnlineSub.ItemPropertiesList[j].IconURL,Class'Texture2D'));
@ -1112,7 +1112,7 @@ simulated function SearchInventoryForNewItem()
}
simulated final function string RarityStr(byte R)
{
switch(R)
switch (R)
{
case ITR_Common: return "Common";
case ITR_Uncommon: return "Uncommon +";
@ -1136,15 +1136,15 @@ simulated final function DrawItemsList()
YPos = Canvas.ClipY*0.82 - YSize;
XPos = Canvas.ClipX - YSize*0.15;
for(i=0; i<NewItems.Length; ++i)
for (i=0; i<NewItems.Length; ++i)
{
T = WorldInfo.TimeSeconds-NewItems[i].MsgTime;
if(T>=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');
}

View File

@ -48,9 +48,9 @@ function CloseMenu(); // Menu was closed.
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();
@ -59,7 +59,7 @@ function MenuTick(float DeltaTime)
final function SetTimer(float Rate, optional bool bLoop)
{
bTimerActive = (Rate>0.f);
if(bTimerActive)
if (bTimerActive)
{
bLoopTimer = bLoop;
TimerRate = Rate;
@ -116,14 +116,14 @@ 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)
{
if(ID==InID)
if (ID==InID)
return Self;
return None;
}
function FindAllComponentID(name InID, out array<KFGUI_Base> Res)
{
if(ID==InID)
if (ID==InID)
Res[Res.Length] = Self;
}
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,7 +193,7 @@ final function GrabKeyFocus()
}
final function ReleaseKeyFocus()
{
if(Owner.KeyboardFocus==Self)
if (Owner.KeyboardFocus==Self)
Owner.GrabInputFocus(None);
}
function LostKeyFocus();
@ -228,7 +228,7 @@ simulated final function PlayMenuSound(EMenuSound Slot)
{
/*local SoundCue S;
switch(Slot)
switch (Slot)
{
case MN_Focus:
S = SoundCue'a_interface.menu.UT3MenuMouseOverCue';
@ -252,7 +252,7 @@ simulated final function PlayMenuSound(EMenuSound Slot)
S = SoundCue'a_interface.menu.UT3MenuNavigateUpCue';
break;
}
if(S!=None)
if (S!=None)
GetPlayer().PlaySound(S,true,,false);*/
}
@ -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;
}

Some files were not shown because too many files have changed in this diff Show More