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(); GetTraderItems();
EP = GetExtPerk(); EP = GetExtPerk();
if(EP==None || EP.AutoBuyLoadOutPath.length == 0) if (EP==None || EP.AutoBuyLoadOutPath.length == 0)
return; 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]); ItemIndex = TraderItems.SaleItems.Find('WeaponDef', EP.AutoBuyLoadOutPath[i]);
if(ItemIndex != INDEX_NONE) if (ItemIndex != INDEX_NONE)
OnPerkWeapons.AddItem(TraderItems.SaleItems[ItemIndex]); OnPerkWeapons.AddItem(TraderItems.SaleItems[ItemIndex]);
} }
@ -38,7 +38,7 @@ function DoAutoPurchase()
TopTierWeapon = GetTopTierWeapon(OnPerkWeapons); TopTierWeapon = GetTopTierWeapon(OnPerkWeapons);
//can I afford my top teir without selling my current weapon? //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); bUpgradeSuccess = AttemptUpgrade(TotalDosh, OnPerkWeapons, true);
} }
@ -49,9 +49,9 @@ function DoAutoPurchase()
} }
bAutoFillPurchasedItem = StartAutoFill(); bAutoFillPurchasedItem = StartAutoFill();
if(DoIOwnThisWeapon(TopTierWeapon)) if (DoIOwnThisWeapon(TopTierWeapon))
{ {
while(AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons)) while (AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons))
{ {
bSecondaryWeaponPurchased = true; bSecondaryWeaponPurchased = true;
AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons); AttemptToPurchaseNextLowerTier(TotalDosh, OnPerkWeapons);
@ -60,15 +60,15 @@ function DoAutoPurchase()
MyKFIM.ServerCloseTraderMenu(); MyKFIM.ServerCloseTraderMenu();
if(bUpgradeSuccess) if (bUpgradeSuccess)
{ {
AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.WeaponUpgradeComepleteString; AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.WeaponUpgradeComepleteString;
} }
else if(bSecondaryWeaponPurchased) else if (bSecondaryWeaponPurchased)
{ {
AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.SecondaryWeaponPurchasedString; AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.SecondaryWeaponPurchasedString;
} }
else if(bAutoFillPurchasedItem) else if (bAutoFillPurchasedItem)
{ {
AutoFillMessageString = class'KFCommon_LocalizedStrings'.default.AutoFillCompleteString; 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); MyGFxHUD.ShowNonCriticalMessage(class'KFCommon_LocalizedStrings'.default.AutoTradeCompleteString$AutoFillMessageString);
} }
@ -90,11 +90,11 @@ function SellOnPerkWeapons()
local class<KFPerk> Perk; local class<KFPerk> Perk;
Perk = GetBasePerk(); Perk = GetBasePerk();
if(Perk!=None) if (Perk!=None)
{ {
for (i = 0; i < OwnedItemList.length; i++) 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); SellWeapon(OwnedItemList[i], i);
i=-1; i=-1;
@ -112,9 +112,9 @@ function SellOffPerkWeapons()
for (i = 0; i < OwnedItemList.length; i++) 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); SellWeapon(OwnedItemList[i], i);
i=-1; i=-1;
@ -136,7 +136,7 @@ function InitializeOwnedItemList()
TraderItems = KFGameReplicationInfo(WorldInfo.GRI).TraderItems; TraderItems = KFGameReplicationInfo(WorldInfo.GRI).TraderItems;
KFP = KFPawn_Human(Pawn); KFP = KFPawn_Human(Pawn);
if(KFP != none) if (KFP != none)
{ {
// init armor purchase values // init armor purchase values
ArmorItem.SpareAmmoCount = KFP.Armor; ArmorItem.SpareAmmoCount = KFP.Armor;
@ -156,14 +156,14 @@ function InitializeOwnedItemList()
for (Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory) for (Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory)
{ {
KFW = KFWeapon(Inv); KFW = KFWeapon(Inv);
if(KFW != none) if (KFW != none)
{ {
// Set the weapon information and add it to the OwnedItemList // Set the weapon information and add it to the OwnedItemList
SetWeaponInformation(KFW); SetWeaponInformation(KFW);
} }
} }
if(MyGfxManager != none && MyGfxManager.TraderMenu != none) if (MyGfxManager != none && MyGfxManager.TraderMenu != none)
{ {
MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList; MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList;
} }
@ -183,23 +183,23 @@ function int AddItemByPriority(out SItemInformation WeaponInfo)
WeaponGroup = WeaponInfo.DefaultItem.InventoryGroup; WeaponGroup = WeaponInfo.DefaultItem.InventoryGroup;
WeaponPriority = WeaponInfo.DefaultItem.GroupPriority; 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 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; BestIndex = i;
break; 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 // if the weapon is in the same group but has a higher priority, we've found the spot
BestIndex = i; BestIndex = i;
break; 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 // if the weapons have the same priority give the slot to the on perk weapon
BestIndex = i; BestIndex = i;
@ -215,14 +215,14 @@ function int AddItemByPriority(out SItemInformation WeaponInfo)
OwnedItemList.InsertItem(BestIndex, WeaponInfo); OwnedItemList.InsertItem(BestIndex, WeaponInfo);
// Add secondary ammo immediately after the main weapon // Add secondary ammo immediately after the main weapon
if(WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo()) if (WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo())
{ {
WeaponInfo.bIsSecondaryAmmo = true; WeaponInfo.bIsSecondaryAmmo = true;
WeaponInfo.SellPrice = 0; WeaponInfo.SellPrice = 0;
OwnedItemList.InsertItem(BestIndex + 1, WeaponInfo); OwnedItemList.InsertItem(BestIndex + 1, WeaponInfo);
} }
if(MyGfxManager != none && MyGfxManager.TraderMenu != none) if (MyGfxManager != none && MyGfxManager.TraderMenu != none)
{ {
MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList; MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList;
} }
@ -234,7 +234,7 @@ function bool CanCarry(const out STraderItem Item, optional int OverrideLevelVal
{ {
local int Result; local int Result;
Result = TotalBlocks + MyKFIM.GetDisplayedBlocksRequiredFor(Item); Result = TotalBlocks + MyKFIM.GetDisplayedBlocksRequiredfor (Item);
if (Result > MaxBlocks) if (Result > MaxBlocks)
{ {
return false; return false;

View File

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

View File

@ -10,18 +10,18 @@ static final function CloneMIC(MaterialInstanceConstant B)
local LinearColor C; local LinearColor C;
M = MaterialInstanceConstant(B.Parent); M = MaterialInstanceConstant(B.Parent);
if(M==None) if (M==None)
return; return;
B.SetParent(M.Parent); B.SetParent(M.Parent);
for(i=0; i<M.TextureParameterValues.Length; ++i) for (i=0; i<M.TextureParameterValues.Length; ++i)
if(M.TextureParameterValues[i].ParameterValue!=None) if (M.TextureParameterValues[i].ParameterValue!=None)
B.SetTextureParameterValue(M.TextureParameterValues[i].ParameterName,M.TextureParameterValues[i].ParameterValue); 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); 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; C = M.VectorParameterValues[i].ParameterValue;
B.SetVectorParameterValue(M.VectorParameterValues[i].ParameterName,C); B.SetVectorParameterValue(M.VectorParameterValues[i].ParameterName,C);
@ -40,7 +40,7 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
{ {
local int i; local int i;
if(P.WorldInfo.NetMode == NM_DedicatedServer) if (P.WorldInfo.NetMode == NM_DedicatedServer)
{ {
return; return;
} }
@ -55,7 +55,7 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
} }
// head MIC // head MIC
if(P.ThirdPersonHeadMeshComponent != None) if (P.ThirdPersonHeadMeshComponent != None)
{ {
P.CharacterMICs[1] = P.ThirdPersonHeadMeshComponent.CreateAndSetMaterialInstanceConstant(C.HeadMaterialID); P.CharacterMICs[1] = P.ThirdPersonHeadMeshComponent.CreateAndSetMaterialInstanceConstant(C.HeadMaterialID);
@ -67,9 +67,9 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
} }
// attachment MIC // 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)); 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, // Must clear all attachments before trying to attach new ones,
// otherwise we might accidentally remove things we're not supposed to // 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 // Clear any previous attachments from other characters
C.DetachAttachment(AttachmentIdx, KFP); C.DetachAttachment(AttachmentIdx, KFP);
} }
// Cosmetic attachment mesh & skin. Index of 255 implies don't use any attachments (default) // 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]; CosmeticMeshIdx = bCustom ? EPRI.CustomCharacter.AttachmentMeshIndices[AttachmentIdx] : KFPRI.RepCustomizationInfo.AttachmentMeshIndices[AttachmentIdx];
if (CosmeticMeshIdx != `CLEARED_ATTACHMENT_INDEX && CosmeticMeshIdx != INDEX_NONE) if (CosmeticMeshIdx != `CLEARED_ATTACHMENT_INDEX && CosmeticMeshIdx != INDEX_NONE)
@ -159,7 +159,7 @@ static final function SetBodyMeshAndSkin(KFCharacterInfo_Human C,
} }
// Character Mesh // Character Mesh
if(C.BodyVariants.length > 0) if (C.BodyVariants.length > 0)
{ {
// Assign a skin to the body mesh as a material override // Assign a skin to the body mesh as a material override
CurrentBodyMeshIndex = (CurrentBodyMeshIndex < C.BodyVariants.length) ? CurrentBodyMeshIndex : 0; 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 (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 // Assign a skin to the body mesh as a material override
NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0; NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0;
@ -208,7 +208,7 @@ static final function SetBodySkinMaterial(KFCharacterInfo_Human C, OutfitVariant
else else
{ {
// Use material specified in the mesh asset // 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); KFP.Mesh.SetMaterial(i, none);
} }
@ -222,7 +222,7 @@ static final function SetHeadSkinMaterial(KFCharacterInfo_Human C, OutfitVariant
if (KFP.WorldInfo.NetMode != NM_DedicatedServer) 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 // Assign a skin to the body mesh as a material override
NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0; NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0;
@ -231,7 +231,7 @@ static final function SetHeadSkinMaterial(KFCharacterInfo_Human C, OutfitVariant
else else
{ {
// Use material specified in the mesh asset // 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); KFP.ThirdPersonHeadMeshComponent.SetMaterial(i, none);
} }
@ -287,7 +287,7 @@ static final function SetAttachmentSkinMaterial(KFCharacterInfo_Human C,
local int i; local int i;
if (KFP.WorldInfo.NetMode != NM_DedicatedServer) 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 // Assign a skin to the attachment mesh as a material override
if (NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length) if (NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length)
@ -329,7 +329,7 @@ static final function SetAttachmentSkinMaterial(KFCharacterInfo_Human C,
else else
{ {
// Use material specified in the mesh asset // 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); 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. // Set First Person Cosmetic if mesh exists for it.
if(CharAttachmentMeshName != "") if (CharAttachmentMeshName != "")
{ {
// Set Cosmetic Mesh // Set Cosmetic Mesh
SetAttachmentMesh(C, CurrentAttachmentMeshIndex, AttachmentSlotIndex, CharAttachmentMeshName, CharAttachmentSocketName, AttachmentMesh, KFP, bIsFirstPerson); SetAttachmentMesh(C, CurrentAttachmentMeshIndex, AttachmentSlotIndex, CharAttachmentMeshName, CharAttachmentSocketName, AttachmentMesh, KFP, bIsFirstPerson);
@ -400,7 +400,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C,
else else
{ {
// Make sure to clear out attachment if we're replacing with nothing. // Make sure to clear out attachment if we're replacing with nothing.
if(bIsFirstPerson) if (bIsFirstPerson)
{ {
KFP.FirstPersonAttachments[AttachmentSlotIndex] = none; KFP.FirstPersonAttachments[AttachmentSlotIndex] = none;
KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = ''; KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = '';
@ -418,7 +418,7 @@ static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C,
} }
// Treat `CLEARED_ATTACHMENT_INDEX as special value (for client detachment) // 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); C.RemoveAttachmentMeshAndSkin(AttachmentSlotIndex, KFP, KFPRI);
} }
@ -463,7 +463,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
} }
SkeletalAttachment.SetActorCollision(false, false); SkeletalAttachment.SetActorCollision(false, false);
if(bIsFirstPerson) if (bIsFirstPerson)
{ {
KFP.FirstPersonAttachments[AttachmentSlotIndex] = SkeletalAttachment; KFP.FirstPersonAttachments[AttachmentSlotIndex] = SkeletalAttachment;
} }
@ -503,7 +503,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
StaticAttachment = new(KFP) class'StaticMeshComponent'; StaticAttachment = new(KFP) class'StaticMeshComponent';
StaticAttachment.SetActorCollision(false, false); StaticAttachment.SetActorCollision(false, false);
if(bIsFirstPerson) if (bIsFirstPerson)
{ {
KFP.FirstPersonAttachments[AttachmentSlotIndex] = StaticAttachment; KFP.FirstPersonAttachments[AttachmentSlotIndex] = StaticAttachment;
} }
@ -533,7 +533,7 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
AttachmentSocket.RelativeScale * AttachmentScaleRelativeToSocket); AttachmentSocket.RelativeScale * AttachmentScaleRelativeToSocket);
} }
if(bIsFirstPerson) if (bIsFirstPerson)
{ {
KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = CharAttachmentSocketName; KFP.FirstPersonAttachmentSocketNames[AttachmentSlotIndex] = CharAttachmentSocketName;
} }
@ -563,14 +563,14 @@ static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int
// The socket that this attachment requires // The socket that this attachment requires
NewAttachmentSocketName = C.CosmeticVariants[NewAttachmentMeshIndex].AttachmentItem.SocketName; 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]; CurrentAttachmentIdx = EPRI.CustomCharacter.AttachmentMeshIndices[i];
if (CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX) if (CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX)
continue; continue;
// Remove the object if it is taking up our desired slot // Remove the object if it is taking up our desired slot
if(KFP.ThirdPersonAttachmentSocketNames[i] != '' && if (KFP.ThirdPersonAttachmentSocketNames[i] != '' &&
KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName) KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName)
{ {
C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); 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 // 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); C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI);
continue; continue;
} }
// Check inverse override // Check inverse override
if(C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx)) if (C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx))
{ {
C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI); C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI);
continue; continue;
@ -633,7 +633,7 @@ static final function SetFirstPersonArmsFromArch(KFCharacterInfo_Human C, KFPawn
} }
// Hack fix for a material bug on KF2 // 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); M = KFP.ArmsMesh.CreateAndSetMaterialInstanceConstant(0);
CloneMIC(M); CloneMIC(M);
@ -650,7 +650,7 @@ static function int GetAttachmentSlotIndex(
local ExtPlayerReplicationInfo EPRI; local ExtPlayerReplicationInfo EPRI;
local bool bCustom; local bool bCustom;
if(KFPRI == None) if (KFPRI == None)
{ {
`warn("GetAttachmentSlotIndex - NO KFPRI"); `warn("GetAttachmentSlotIndex - NO KFPRI");
return INDEX_NONE; return INDEX_NONE;
@ -660,10 +660,10 @@ static function int GetAttachmentSlotIndex(
bCustom = (EPRI!=None ? EPRI.UsesCustomChar() : false); bCustom = (EPRI!=None ? EPRI.UsesCustomChar() : false);
// Return the next available attachment index or the index that matches this mesh // 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]; CosmeticMeshIdx = bCustom ? EPRI.CustomCharacter.AttachmentMeshIndices[AttachmentIdx] : KFPRI.RepCustomizationInfo.AttachmentMeshIndices[AttachmentIdx];
if(CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex) if (CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex)
{ {
return AttachmentIdx; return AttachmentIdx;
} }

View File

@ -10,16 +10,16 @@ static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC)
local ExtPlayerReplicationInfo PRI; local ExtPlayerReplicationInfo PRI;
i = default.Emotes.Find('Id', ItemId); i = default.Emotes.Find('Id', ItemId);
if(i > -1) if (i > -1)
{ {
Anim = default.Emotes[i].AnimName; Anim = default.Emotes[i].AnimName;
PRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo); PRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo);
if(PRI == None) if (PRI == None)
return Anim; return Anim;
/* /*
if(InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255) if (InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255)
return 'NONE'; return 'NONE';
*/ */
else return Anim; else return Anim;
@ -30,7 +30,7 @@ static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC)
static final function SaveEquippedEmote(int ItemId, ExtPlayerController PC) static final function SaveEquippedEmote(int ItemId, ExtPlayerController PC)
{ {
if(PC == None) if (PC == None)
return; return;
PC.SelectedEmoteIndex = ItemId; PC.SelectedEmoteIndex = ItemId;
@ -46,7 +46,7 @@ static final function byte GetEmoteIndex(int ItemId)
{ {
local int i; local int i;
i = default.Emotes.Find('Id', ItemId); i = default.Emotes.Find('Id', ItemId);
if(i > -1) if (i > -1)
return i; return i;
return -1; return -1;
@ -54,7 +54,7 @@ static final function byte GetEmoteIndex(int ItemId)
static final function int GetEquippedEmoteId(ExtPlayerController PC) static final function int GetEquippedEmoteId(ExtPlayerController PC)
{ {
if(PC == None) if (PC == None)
return -1; return -1;
return PC.SelectedEmoteIndex; return PC.SelectedEmoteIndex;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,7 +29,7 @@ simulated function UpdateWeaponGroupOnHUD(byte GroupIndex)
for (i = 0; i < WeaponsList.Length; i++) for (i = 0; i < WeaponsList.Length; i++)
{ {
Index = TraderItems.SaleItems.Find('ClassName', WeaponsList[i].Class.Name); Index = TraderItems.SaleItems.Find('ClassName', WeaponsList[i].Class.Name);
if(Index != -1) if (Index != -1)
WPGroup[i] = TraderItems.SaleItems[Index].WeaponDef; WPGroup[i] = TraderItems.SaleItems[Index].WeaponDef;
} }
@ -52,7 +52,7 @@ simulated function SetWeaponGroupList(out array<KFWeapon> WeaponList, byte Group
{ {
TempObj = CreateObject("Object"); TempObj = CreateObject("Object");
if(WeaponGroup[i] != None) if (WeaponGroup[i] != None)
{ {
TempObj.SetString("weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName")); TempObj.SetString("weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName"));
TempObj.SetString("texturePath", "img://"$WeaponGroup[i].static.GetImagePath()); TempObj.SetString("texturePath", "img://"$WeaponGroup[i].static.GetImagePath());
@ -69,7 +69,7 @@ simulated function SetWeaponGroupList(out array<KFWeapon> WeaponList, byte Group
//secondary ammo shenanigans //secondary ammo shenanigans
TempObj.SetBool("bUsesSecondaryAmmo", WeaponList[i].UsesSecondaryAmmo()&&WeaponList[i].bCanRefillSecondaryAmmo); TempObj.SetBool("bUsesSecondaryAmmo", WeaponList[i].UsesSecondaryAmmo()&&WeaponList[i].bCanRefillSecondaryAmmo);
TempObj.SetBool("bEnabled", WeaponList[i].HasAnyAmmo()); 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.SetBool("bCanRefillSecondaryAmmo", WeaponList[i].SpareAmmoCapacity[1] > 0);
TempObj.SetInt("secondaryAmmoCount", WeaponList[i].AmmoCount[1]); TempObj.SetInt("secondaryAmmoCount", WeaponList[i].AmmoCount[1]);

View File

@ -18,17 +18,17 @@ var byte HealingShieldMod,HealingSpeedBoostMod,HealingDamageBoostMod;
replication replication
{ {
if(true) if (true)
bFeigningDeath,RepRegenHP,BackpackWeaponClass; bFeigningDeath,RepRegenHP,BackpackWeaponClass;
if(bNetOwner) if (bNetOwner)
bHasBunnyHop; bHasBunnyHop;
if(bNetDirty) if (bNetDirty)
HealingSpeedBoostMod, HealingDamageBoostMod, HealingShieldMod; HealingSpeedBoostMod, HealingDamageBoostMod, HealingShieldMod;
} }
function TakeDamage(int Damage, Controller InstigatedBy, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser) 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; Momentum *= KnockbackResist;
Super.TakeDamage(Damage,InstigatedBy,HitLocation,Momentum,DamageType,HitInfo,DamageCauser); 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 PlayerReplicationInfo KillerPRI;
local SeqAct_Latent Action; 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; KillerPRI = PlayerReplicationInfo;
KillerPawn = None; KillerPawn = None;
@ -50,10 +50,10 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
else else
{ {
KillerPRI = Killer.PlayerReplicationInfo; 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; 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; KillerPRI = None;
} }
else KillerPawn = None; else KillerPawn = None;
@ -62,7 +62,7 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
C.ClientKillMessage(damageType,PlayerReplicationInfo,KillerPRI,KillerPawn); 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 got killed by a zombie, turn player into a ragdoll and let em take control of a newly spawned ZED over the ragdoll.
if(bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0) if (bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0)
{ {
if (bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange) if (bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange)
return FALSE; return FALSE;
@ -75,7 +75,7 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
} }
Health = 0; Health = 0;
foreach LatentActions(Action) foreach LatentActions(Action)
Action.AbortFor(self); Action.Abortfor (self);
if (Controller != None) if (Controller != None)
WorldInfo.Game.Killed(Killer, Controller, self, damageType); WorldInfo.Game.Killed(Killer, Controller, self, damageType);
else WorldInfo.Game.Killed(Killer, Controller(Owner), 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(); InvManager.OwnerDied();
Health = 1; Health = 1;
if(!bFeigningDeath) if (!bFeigningDeath)
PlayFeignDeath(true,,true); PlayFeignDeath(true,,true);
Health = 0; Health = 0;
ClearTimer('UnsetFeignDeath'); ClearTimer('UnsetFeignDeath');
@ -123,92 +123,92 @@ event bool HealDamage(int Amount, Controller Healer, class<DamageType> DamageTyp
InstigatorPC = ExtPlayerController(Healer); InstigatorPC = ExtPlayerController(Healer);
InstigatorPerk = InstigatorPC.GetPerk(); InstigatorPerk = InstigatorPC.GetPerk();
if(InstigatorPerk != None && bCanRepairArmor) if (InstigatorPerk != None && bCanRepairArmor)
bRepairedArmor = InstigatorPC.GetPerk().RepairArmor(self); bRepairedArmor = InstigatorPC.GetPerk().RepairArmor(self);
EPRI = ExtPlayerReplicationInfo(InstigatorPC.PlayerReplicationInfo); EPRI = ExtPlayerReplicationInfo(InstigatorPC.PlayerReplicationInfo);
if(EPRI != none) if (EPRI != none)
{ {
InstigatorExtPerk = ExtPlayerController(Controller).ActivePerkManager.CurrentPerk; 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); UpdateHealingSpeedBoostMod(InstigatorPC);
if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost) if (Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost)
UpdateHealingDamageBoostMod(InstigatorPC); UpdateHealingDamageBoostMod(InstigatorPC);
if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield) if (Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield)
UpdateHealingShieldMod(InstigatorPC); UpdateHealingShieldMod(InstigatorPC);
} }
} }
if(Amount > 0 && IsAliveAndWell() && Health < HealthMax) if (Amount > 0 && IsAliveAndWell() && Health < HealthMax)
{ {
// Play any healing effects attached to this damage type // Play any healing effects attached to this damage type
KFDT = class<KFDamageType>(DamageType); KFDT = class<KFDamageType>(DamageType);
if(KFDT != none && KFDT.default.bNoPain) if (KFDT != none && KFDT.default.bNoPain)
PlayHeal(KFDT); PlayHeal(KFDT);
if(Role == ROLE_Authority) if (Role == ROLE_Authority)
{ {
if(Healer==None || Healer.PlayerReplicationInfo == None) if (Healer==None || Healer.PlayerReplicationInfo == None)
return false; return false;
InstigatorPRI = KFPlayerReplicationInfo(Healer.PlayerReplicationInfo); InstigatorPRI = KFPlayerReplicationInfo(Healer.PlayerReplicationInfo);
ScAmount = Amount; ScAmount = Amount;
if(InstigatorPerk != none) if (InstigatorPerk != none)
InstigatorPerk.ModifyHealAmount(ScAmount); InstigatorPerk.ModifyHealAmount(ScAmount);
UsedHealAmount = ScAmount; UsedHealAmount = ScAmount;
// You can never have a HealthToRegen value that's greater than HealthMax // 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); UsedHealAmount = Min(HealthMax - (Health + HealthToRegen),255-HealthToRegen);
else UsedHealAmount = Min(UsedHealAmount,255-HealthToRegen); else UsedHealAmount = Min(UsedHealAmount,255-HealthToRegen);
HealthToRegen += UsedHealAmount; HealthToRegen += UsedHealAmount;
RepRegenHP = HealthToRegen; RepRegenHP = HealthToRegen;
if(!IsTimerActive('GiveHealthOverTime')) if (!IsTimerActive('GiveHealthOverTime'))
SetTimer(HealthRegenRate, true, 'GiveHealthOverTime'); SetTimer(HealthRegenRate, true, 'GiveHealthOverTime');
// Give the healer money/XP for helping a teammate // 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; DoshEarned = (UsedHealAmount / float(HealthMax)) * HealerRewardScaler;
if(InstigatorPRI!=None) if (InstigatorPRI!=None)
InstigatorPRI.AddDosh(Max(DoshEarned, 0), true); InstigatorPRI.AddDosh(Max(DoshEarned, 0), true);
if(InstigatorPC!=None) if (InstigatorPC!=None)
InstigatorPC.AddHealPoints(UsedHealAmount); 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.ClientNumberMsg(UsedHealAmount,Location,DMG_Heal);
InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo); InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo);
} }
KFPC = ExtPlayerController(Controller); KFPC = ExtPlayerController(Controller);
if(KFPC!=None) if (KFPC!=None)
KFPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo); 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); InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedSelf, PlayerReplicationInfo);
} }
// don't play dialog for healing done through perk skills (e.g. berserker vampire skill) // don't play dialog for healing done through perk skills (e.g. berserker vampire skill)
if(bMessageHealer) if (bMessageHealer)
{ {
`DialogManager.PlayHealingDialog(KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax)); `DialogManager.PlayHealingDialog(KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax));
} }
// Reduce burn duration and damage in half if you heal while burning // 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].Duration *= 0.5;
DamageOverTimeArray[i].Damage *= 0.5; DamageOverTimeArray[i].Damage *= 0.5;
@ -231,7 +231,7 @@ function GiveHealthOverTime()
simulated event ReplicatedEvent(name VarName) simulated event ReplicatedEvent(name VarName)
{ {
switch(VarName) switch (VarName)
{ {
case 'bFeigningDeath': case 'bFeigningDeath':
PlayFeignDeath(bFeigningDeath); PlayFeignDeath(bFeigningDeath);
@ -248,11 +248,11 @@ simulated event ReplicatedEvent(name VarName)
// Feign death triggers: // Feign death triggers:
function PlayHit(float Damage, Controller InstigatedBy, vector HitLocation, class<DamageType> damageType, vector Momentum, TraceHitInfo HitInfo) 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. 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. SetFeignDeath(2.f+FRand()*3.f); // Randomly knockout a player if hit from behind.
} }
Super.PlayHit(Damage,InstigatedBy,HitLocation,damageType,Momentum,HitInfo); Super.PlayHit(Damage,InstigatedBy,HitLocation,damageType,Momentum,HitInfo);
@ -262,10 +262,10 @@ event Landed(vector HitNormal, actor FloorActor)
local float ExcessSpeed; local float ExcessSpeed;
Super.Landed(HitNormal, FloorActor); Super.Landed(HitNormal, FloorActor);
if(bRagdollFromFalling) if (bRagdollFromFalling)
{ {
ExcessSpeed = Velocity.Z / (-MaxFallSpeed); 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.Z = 0; // Dont go clip through floor now...
Velocity.X*=0.5; Velocity.X*=0.5;
@ -273,7 +273,7 @@ event Landed(vector HitNormal, actor FloorActor)
SetFeignDeath((3.f+FRand())*ExcessSpeed); 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. 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)) if (Super.DoJump(bUpdating))
{ {
// Accelerate if bunnyhopping. // 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; BHopSpeedMod = 1.f;
if(BHopAccelSpeed<5) if (BHopAccelSpeed<5)
V = 1.15; V = 1.15;
else 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. 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; BHopAccelSpeed = 0;
AirControl = Default.AirControl; AirControl = Default.AirControl;
GroundSpeed /= BHopSpeedMod; GroundSpeed /= BHopSpeedMod;
UpdateGroundSpeed(); UpdateGroundSpeed();
if(WorldInfo.NetMode==NM_Client && !bSkipRep) if (WorldInfo.NetMode==NM_Client && !bSkipRep)
NotifyHasStopped(); NotifyHasStopped();
} }
} }
@ -335,7 +335,7 @@ function UpdateGroundSpeed()
InvM = KFInventoryManager(InvManager); InvM = KFInventoryManager(InvManager);
HealthMod = (InvM != None) ? InvM.GetEncumbranceSpeedMod() : 1.f * (1.f - LowHealthSpeedPenalty); HealthMod = (InvM != None) ? InvM.GetEncumbranceSpeedMod() : 1.f * (1.f - LowHealthSpeedPenalty);
if(BHopAccelSpeed>0) if (BHopAccelSpeed>0)
HealthMod *= BHopSpeedMod; HealthMod *= BHopSpeedMod;
// First reset to default so multipliers do not stack // First reset to default so multipliers do not stack
@ -344,7 +344,7 @@ function UpdateGroundSpeed()
SprintSpeed = default.SprintSpeed * HealthMod; SprintSpeed = default.SprintSpeed * HealthMod;
// Ask our perk to set the new ground speed based on weapon type // Ask our perk to set the new ground speed based on weapon type
if(GetPerk() != none) if (GetPerk() != none)
{ {
GetPerk().ModifySpeed(GroundSpeed); GetPerk().ModifySpeed(GroundSpeed);
GetPerk().ModifySpeed(SprintSpeed); GetPerk().ModifySpeed(SprintSpeed);
@ -361,19 +361,19 @@ reliable server function NotifyHasStopped()
simulated function Tick(float Delta) simulated function Tick(float Delta)
{ {
Super.Tick(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 // 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); Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(Delta*2.f),0.f);
if(Mesh.PhysicsWeight<=0) if (Mesh.PhysicsWeight<=0)
StartFeignDeathRecoveryAnim(); 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); 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; PlayerOldWeapon = None;
SetBackpackWeapon(None); SetBackpackWeapon(None);
@ -390,7 +390,7 @@ exec function FeignDeath(float Time)
} }
function SetFeignDeath(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); Time = FMax(1.f,Time);
PlayFeignDeath(true); PlayFeignDeath(true);
@ -399,7 +399,7 @@ function SetFeignDeath(float Time)
} }
function UnsetFeignDeath() function UnsetFeignDeath()
{ {
if(bFeigningDeath) if (bFeigningDeath)
PlayFeignDeath(false); PlayFeignDeath(false);
} }
@ -409,7 +409,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
local rotator NewRotation; local rotator NewRotation;
local float UnFeignZAdjust; local float UnFeignZAdjust;
if(Health<=0 && WorldInfo.NetMode!=NM_Client) if (Health<=0 && WorldInfo.NetMode!=NM_Client)
return; // If dead, don't do it. return; // If dead, don't do it.
NotifyOutOfBattery(); // Stop nightvision on client. NotifyOutOfBattery(); // Stop nightvision on client.
@ -417,7 +417,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
bFeigningDeath = bEnable; bFeigningDeath = bEnable;
if (bEnable) if (bEnable)
{ {
if(bFPLegsAttached) if (bFPLegsAttached)
{ {
bFPLegsAttached = false; bFPLegsAttached = false;
DetachComponent(FPBodyMesh); DetachComponent(FPBodyMesh);
@ -427,7 +427,7 @@ simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional b
bPlayingFeignDeathRecovery = false; bPlayingFeignDeathRecovery = false;
ClearTimer('OnWakeUpFinished'); ClearTimer('OnWakeUpFinished');
if(!bTransformMode) if (!bTransformMode)
GotoState('FeigningDeath'); GotoState('FeigningDeath');
// if we had some other rigid body thing going on, cancel it // 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); 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!"); PlayerController(Controller).ClientMessage("Error: InitRagdoll() failed!");
return; 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 // 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). // and therefore have zero derived velocity (this happens in 1st person camera mode).
UnFeignZAdjust = VSize(Velocity); 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); Mesh.SetRBLinearVelocity((Velocity/UnFeignZAdjust)*700.f, false);
else Mesh.SetRBLinearVelocity(Velocity, 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. // Calculate how far we just moved the actor up.
UnFeignZAdjust = Location.Z - FeignLocation.Z; UnFeignZAdjust = Location.Z - FeignLocation.Z;
// If its positive, move back down by that amount until it hits the floor // 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); 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'; else FeignRecoverAnim = 'Getup_F_V1';
// Init wakeup anim. // Init wakeup anim.
if(Mesh.AnimSets.Find(WakeUpAnimSet)==-1) if (Mesh.AnimSets.Find(WakeUpAnimSet)==-1)
Mesh.AnimSets.AddItem(WakeUpAnimSet); Mesh.AnimSets.AddItem(WakeUpAnimSet);
BodyStanceNodes[EAS_FullBody].bNoNotifies = true; BodyStanceNodes[EAS_FullBody].bNoNotifies = true;
BodyStanceNodes[EAS_FullBody].PlayCustomAnim(FeignRecoverAnim,0.025f,,,,true); BodyStanceNodes[EAS_FullBody].PlayCustomAnim(FeignRecoverAnim,0.025f,,,,true);
@ -568,7 +568,7 @@ final function vector PickNearestNode()
foreach WorldInfo.AllNavigationPoints(class'NavigationPoint',N) foreach WorldInfo.AllNavigationPoints(class'NavigationPoint',N)
{ {
Dist = VSizeSq(N.Location-Location); Dist = VSizeSq(N.Location-Location);
if(Best==None || Dist<BestDist) if (Best==None || Dist<BestDist)
{ {
Best = N; Best = N;
BestDist = Dist; BestDist = Dist;
@ -629,7 +629,7 @@ simulated function bool CheckValidLocation(vector FeignLocation)
} }
simulated function SetPawnRBChannels(bool bRagdollMode) simulated function SetPawnRBChannels(bool bRagdollMode)
{ {
if(bRagdollMode) if (bRagdollMode)
{ {
Mesh.SetRBChannel(RBCC_DeadPawn); Mesh.SetRBChannel(RBCC_DeadPawn);
Mesh.SetRBCollidesWithChannel(RBCC_Default,TRUE); Mesh.SetRBCollidesWithChannel(RBCC_Default,TRUE);
@ -656,7 +656,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
Mesh.SetHasPhysicsAssetInstance(false); Mesh.SetHasPhysicsAssetInstance(false);
Mesh.SetHasPhysicsAssetInstance(true); Mesh.SetHasPhysicsAssetInstance(true);
if(bFPLegsAttached) if (bFPLegsAttached)
{ {
bFPLegsAttached = false; bFPLegsAttached = false;
DetachComponent(FPBodyMesh); DetachComponent(FPBodyMesh);
@ -682,7 +682,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
CheckHitInfo(HitInfo, Mesh, HitDirection, HitLoc); CheckHitInfo(HitInfo, Mesh, HitDirection, HitLoc);
// Play ragdoll death animation (bSkipReplication=TRUE) // 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); DoSpecialMove(SM_DeathAnim, TRUE,,,TRUE);
KFSM_DeathAnim(SpecialMoves[SM_DeathAnim]).PlayDeathAnimation(DamageType, HitDirection, HitInfo.BoneName); 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() simulated function StartFeignDeathRecoveryAnim()
{ {
if(FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs) if (FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs)
{ {
bFPLegsAttached = true; bFPLegsAttached = true;
AttachComponent(FPBodyMesh); AttachComponent(FPBodyMesh);
@ -729,7 +729,7 @@ function AddDefaultInventory()
local KFPerk MyPerk; local KFPerk MyPerk;
MyPerk = GetPerk(); MyPerk = GetPerk();
if(MyPerk != none) if (MyPerk != none)
MyPerk.AddDefaultInventory(self); MyPerk.AddDefaultInventory(self);
Super(KFPawn).AddDefaultInventory(); Super(KFPawn).AddDefaultInventory();
@ -748,7 +748,7 @@ simulated event OutsideWorldBounds()
simulated function KFCharacterInfoBase GetCharacterInfo() simulated function KFCharacterInfoBase GetCharacterInfo()
{ {
if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) if (ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch(); return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch();
return Super.GetCharacterInfo(); return Super.GetCharacterInfo();
} }
@ -779,7 +779,7 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor
WeaponAttachmentChanged(true); WeaponAttachmentChanged(true);
} }
} }
if(WorldInfo.NetMode != NM_DedicatedServer) if (WorldInfo.NetMode != NM_DedicatedServer)
{ {
// Attach/Reattach flashlight components when mesh is set // Attach/Reattach flashlight components when mesh is set
if (Flashlight == None && FlashLightTemplate != None) if (Flashlight == None && FlashLightTemplate != None)
@ -791,9 +791,9 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor
Flashlight.AttachFlashlight(Mesh); 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')); VoiceGroupArch = class<KFPawnVoiceGroup>(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class'));
} }
} }
@ -852,9 +852,9 @@ ignores FaceRotation, SetMovementPhysics;
{ {
local rotator NewRotation; 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 // 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; NewRotation = Controller.Rotation;
@ -862,7 +862,7 @@ ignores FaceRotation, SetMovementPhysics;
Controller.SetRotation(NewRotation); Controller.SetRotation(NewRotation);
} }
Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(DeltaTime*2.f),0.f); Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(DeltaTime*2.f),0.f);
if(Mesh.PhysicsWeight<=0) if (Mesh.PhysicsWeight<=0)
StartFeignDeathRecoveryAnim(); StartFeignDeathRecoveryAnim();
} }
} }
@ -872,7 +872,7 @@ ignores FaceRotation, SetMovementPhysics;
local KFWeapon UTWeap; local KFWeapon UTWeap;
// Abort current special move // Abort current special move
if(IsDoingSpecialMove()) if (IsDoingSpecialMove())
SpecialMoveHandler.EndSpecialMove(); SpecialMoveHandler.EndSpecialMove();
bCanPickupInventory = false; bCanPickupInventory = false;
@ -885,11 +885,11 @@ ignores FaceRotation, SetMovementPhysics;
UTWeap.SetIronSights(false); UTWeap.SetIronSights(false);
UTWeap.PlayWeaponPutDown(0.5f); 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); ExtPlayerController(Controller).EnterRagdollMode(true);
else if(Controller!=None) else if (Controller!=None)
Controller.ReplicatedEvent('RagdollMove'); Controller.ReplicatedEvent('RagdollMove');
} }
} }
@ -905,7 +905,7 @@ ignores FaceRotation, SetMovementPhysics;
} }
function bool CanBeRedeemed() function bool CanBeRedeemed()
{ {
if(bFeigningDeath) if (bFeigningDeath)
PlayFeignDeath(false,true); PlayFeignDeath(false,true);
NextRedeemTimer = WorldInfo.TimeSeconds+0.25; NextRedeemTimer = WorldInfo.TimeSeconds+0.25;
return false; return false;
@ -930,11 +930,11 @@ ignores FaceRotation, SetMovementPhysics;
Global.SetMovementPhysics(); Global.SetMovementPhysics();
bPlayingFeignDeathRecovery = false; bPlayingFeignDeathRecovery = false;
if(WorldInfo.NetMode!=NM_Client) if (WorldInfo.NetMode!=NM_Client)
{ {
if(ExtPlayerController(Controller)!=None) if (ExtPlayerController(Controller)!=None)
ExtPlayerController(Controller).EnterRagdollMode(false); ExtPlayerController(Controller).EnterRagdollMode(false);
else if(Controller!=None) else if (Controller!=None)
Controller.ReplicatedEvent('EndRagdollMove'); Controller.ReplicatedEvent('EndRagdollMove');
} }
@ -952,9 +952,9 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
{ {
bCanPickupInventory = false; bCanPickupInventory = false;
bNoWeaponFiring = true; bNoWeaponFiring = true;
if(ExtPlayerController(Controller)!=None) if (ExtPlayerController(Controller)!=None)
ExtPlayerController(Controller).EnterRagdollMode(true); ExtPlayerController(Controller).EnterRagdollMode(true);
else if(Controller!=None) else if (Controller!=None)
Controller.ReplicatedEvent('RagdollMove'); Controller.ReplicatedEvent('RagdollMove');
SetTimer(2,false,'TransformToZed'); SetTimer(2,false,'TransformToZed');
@ -970,7 +970,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
{ {
local VS_ZedRecentZed Z; local VS_ZedRecentZed Z;
if(Controller==None) if (Controller==None)
{ {
Destroy(); Destroy();
return; return;
@ -978,7 +978,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
PlayFeignDeath(false); PlayFeignDeath(false);
SetCollision(false,false); SetCollision(false,false);
Z = Spawn(class'VS_ZedRecentZed',,,Location,Rotation,,true); Z = Spawn(class'VS_ZedRecentZed',,,Location,Rotation,,true);
if(Z==None) if (Z==None)
{ {
Super.Died(None,Class'DamageType',Location); Super.Died(None,Class'DamageType',Location);
return; return;
@ -991,12 +991,12 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
Controller.Possess(Z,false); Controller.Possess(Z,false);
WorldInfo.Game.ChangeTeam(Controller,255,true); WorldInfo.Game.ChangeTeam(Controller,255,true);
WorldInfo.Game.SetPlayerDefaults(Z); WorldInfo.Game.SetPlayerDefaults(Z);
if(ExtPlayerController(Controller)!=None) if (ExtPlayerController(Controller)!=None)
Controller.GoToState('RagdollMove'); Controller.GoToState('RagdollMove');
else if(Controller!=None) else if (Controller!=None)
Controller.ReplicatedEvent('RagdollMove'); Controller.ReplicatedEvent('RagdollMove');
Z.WakeUp(); Z.WakeUp();
if(ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None) if (ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None)
{ {
ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealth = Min(Z.Health,255); ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealth = Min(Z.Health,255);
ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte(float(Z.Health) / float(Z.HealthMax)); ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte(float(Z.Health) / float(Z.HealthMax));
@ -1021,7 +1021,7 @@ simulated final function InitFPLegs()
FPBodyMesh.SetNotifyRigidBodyCollision(false); FPBodyMesh.SetNotifyRigidBodyCollision(false);
FPBodyMesh.SetTraceBlocking(false, 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.SetMaterial(i, Mesh.Materials[i]);
FPBodyMesh.HideBoneByName('neck', PBO_None); FPBodyMesh.HideBoneByName('neck', PBO_None);
@ -1035,10 +1035,10 @@ simulated function SetMeshVisibility(bool bVisible)
{ {
Super.SetMeshVisibility(bVisible); Super.SetMeshVisibility(bVisible);
if(Health>0) if (Health>0)
{ {
bOnFirstPerson = !bVisible; bOnFirstPerson = !bVisible;
if(AttachedBackItem!=None) if (AttachedBackItem!=None)
AttachedBackItem.SetHidden(bOnFirstPerson); AttachedBackItem.SetHidden(bOnFirstPerson);
UpdateFPLegs(); UpdateFPLegs();
} }
@ -1046,14 +1046,14 @@ simulated function SetMeshVisibility(bool bVisible)
simulated final function UpdateFPLegs() 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; bFPLegsAttached = true;
AttachComponent(FPBodyMesh); AttachComponent(FPBodyMesh);
if(!bFPLegsInit && CharacterArch!=None) if (!bFPLegsInit && CharacterArch!=None)
InitFPLegs(); InitFPLegs();
} }
FPBodyMesh.SetHidden(!bOnFirstPerson || !Class'ExtPlayerController'.Default.bShowFPLegs); FPBodyMesh.SetHidden(!bOnFirstPerson || !Class'ExtPlayerController'.Default.bShowFPLegs);
@ -1062,7 +1062,7 @@ simulated final function UpdateFPLegs()
simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp) 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); Super.PostInitAnimTree(SkelComp);
} }
@ -1075,19 +1075,19 @@ simulated final function SetBackpackWeapon(class<KFWeapon> WC)
local int i; local int i;
BackpackWeaponClass = WC; BackpackWeaponClass = WC;
if(WorldInfo.NetMode==NM_DedicatedServer) if (WorldInfo.NetMode==NM_DedicatedServer)
return; return;
if(WC!=None) if (WC!=None)
{ {
if(AttachedBackItem==None) if (AttachedBackItem==None)
{ {
AttachedBackItem = new(Self) class'SkeletalMeshComponent'; AttachedBackItem = new(Self) class'SkeletalMeshComponent';
AttachedBackItem.SetHidden(false); AttachedBackItem.SetHidden(false);
AttachedBackItem.SetLightingChannels(PawnLightingChannel); AttachedBackItem.SetLightingChannels(PawnLightingChannel);
} }
AttachedBackItem.SetSkeletalMesh(WC.Default.AttachmentArchetype.SkelMesh); 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]); 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]; MyCharacter = KFPlayerReplicationInfo(PlayerReplicationInfo).CharacterArchetypes[KFPlayerReplicationInfo(PlayerReplicationInfo).RepCustomizationInfo.CharacterIndex];
WM = WC.Default.AttachmentArchetype.SkelMesh.Name; 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); MyPos = vect(0,0,10);
MyRot = rot(-16384,-8192,0); MyRot = rot(-16384,-8192,0);
B = 'LeftUpLeg'; 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); MyPos = vect(0,0,10);
MyRot = rot(0,0,16384); MyRot = rot(0,0,16384);
B = 'LeftUpLeg'; B = 'LeftUpLeg';
} }
else if(ClassIsChildOf(WC, class'KFWeap_MeleeBase')) else if (ClassIsChildOf(WC, class'KFWeap_MeleeBase'))
{ {
MyPos = vect(-5,15,0); MyPos = vect(-5,15,0);
MyRot = rot(0,0,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; MyPos.Z = -20;
B = 'Spine'; B = 'Spine';
@ -1125,10 +1125,10 @@ simulated final function SetBackpackWeapon(class<KFWeapon> WC)
MyPos = vect(-18.5,16.5,-18); MyPos = vect(-18.5,16.5,-18);
MyRot = rot(0,0,0); 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; MyRot.Roll = 8192;
switch(WM) switch (WM)
{ {
case 'Wep_3rdP_MB500_Rig': case 'Wep_3rdP_MB500_Rig':
MyPos.X = -45; MyPos.X = -45;
@ -1153,14 +1153,14 @@ simulated final function SetBackpackWeapon(class<KFWeapon> WC)
Mesh.AttachComponent(AttachedBackItem, B); Mesh.AttachComponent(AttachedBackItem, B);
AttachedBackItem.SetHidden(bOnFirstPerson); AttachedBackItem.SetHidden(bOnFirstPerson);
} }
else if(AttachedBackItem!=None) else if (AttachedBackItem!=None)
AttachedBackItem.SetHidden(true); AttachedBackItem.SetHidden(true);
} }
simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
{ {
FPBodyMesh.SetHidden(true); FPBodyMesh.SetHidden(true);
if(AttachedBackItem!=None) if (AttachedBackItem!=None)
AttachedBackItem.SetHidden(true); AttachedBackItem.SetHidden(true);
Super.PlayDying(DamageType,HitLoc); Super.PlayDying(DamageType,HitLoc);
} }
@ -1169,7 +1169,7 @@ simulated function SetCharacterAnimationInfo()
{ {
Super.SetCharacterAnimationInfo(); Super.SetCharacterAnimationInfo();
if(!bFPLegsInit && bFPLegsAttached) if (!bFPLegsInit && bFPLegsAttached)
InitFPLegs(); InitFPLegs();
} }
@ -1182,11 +1182,11 @@ simulated function SetMeshLightingChannels(LightingChannelContainer NewLightingC
FPBodyMesh.SetLightingChannels(NewLightingChannels); 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); PlayerOldWeapon = KFWeapon(OldWeapon);
SetBackpackWeapon(PlayerOldWeapon!=None ? PlayerOldWeapon.Class : None); SetBackpackWeapon(PlayerOldWeapon!=None ? PlayerOldWeapon.Class : None);
@ -1198,7 +1198,7 @@ simulated function UpdateHealingSpeedBoostMod(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk; local Ext_PerkFieldMedic MedPerk;
MedPerk = GetMedicPerk(Healer); MedPerk = GetMedicPerk(Healer);
if(MedPerk == None) if (MedPerk == None)
return; return;
HealingSpeedBoostMod = Min(HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost()); HealingSpeedBoostMod = Min(HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost());
@ -1217,7 +1217,7 @@ simulated function ResetHealingSpeedBoost()
HealingSpeedBoostMod = 0; HealingSpeedBoostMod = 0;
UpdateGroundSpeed(); UpdateGroundSpeed();
if(IsTimerActive(nameOf(ResetHealingSpeedBoost))) if (IsTimerActive(nameOf(ResetHealingSpeedBoost)))
ClearTimer(nameOf(ResetHealingSpeedBoost)); ClearTimer(nameOf(ResetHealingSpeedBoost));
} }
@ -1226,7 +1226,7 @@ simulated function UpdateHealingDamageBoostMod(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk; local Ext_PerkFieldMedic MedPerk;
MedPerk = GetMedicPerk(Healer); MedPerk = GetMedicPerk(Healer);
if(MedPerk == None) if (MedPerk == None)
return; return;
HealingDamageBoostMod = Min(HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost()); HealingDamageBoostMod = Min(HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost());
@ -1241,7 +1241,7 @@ simulated function float GetHealingDamageBoostModifier()
simulated function ResetHealingDamageBoost() simulated function ResetHealingDamageBoost()
{ {
HealingDamageBoostMod = 0; HealingDamageBoostMod = 0;
if(IsTimerActive(nameOf(ResetHealingDamageBoost))) if (IsTimerActive(nameOf(ResetHealingDamageBoost)))
ClearTimer(nameOf(ResetHealingDamageBoost)); ClearTimer(nameOf(ResetHealingDamageBoost));
} }
@ -1250,7 +1250,7 @@ simulated function UpdateHealingShieldMod(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk; local Ext_PerkFieldMedic MedPerk;
MedPerk = GetMedicPerk(Healer); MedPerk = GetMedicPerk(Healer);
if(MedPerk == None) if (MedPerk == None)
return; return;
HealingShieldMod = Min(HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield()); HealingShieldMod = Min(HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield());
@ -1265,7 +1265,7 @@ simulated function float GetHealingShieldModifier()
simulated function ResetHealingShield() simulated function ResetHealingShield()
{ {
HealingShieldMod = 0; HealingShieldMod = 0;
if(IsTimerActive(nameOf(ResetHealingShield))) if (IsTimerActive(nameOf(ResetHealingShield)))
ClearTimer(nameOf(ResetHealingShield)); ClearTimer(nameOf(ResetHealingShield));
} }
@ -1276,7 +1276,7 @@ function SacrificeExplode()
Super.SacrificeExplode(); Super.SacrificeExplode();
DemoPerk = Ext_PerkDemolition(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk); DemoPerk = Ext_PerkDemolition(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk);
if(DemoPerk != none) if (DemoPerk != none)
DemoPerk.bUsedSacrifice = true; DemoPerk.bUsedSacrifice = true;
} }
@ -1285,7 +1285,7 @@ simulated function Ext_PerkFieldMedic GetMedicPerk(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk; local Ext_PerkFieldMedic MedPerk;
MedPerk = Ext_PerkFieldMedic(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk); MedPerk = Ext_PerkFieldMedic(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk);
if(MedPerk != None) if (MedPerk != None)
return MedPerk; return MedPerk;
return None; return None;

View File

@ -6,9 +6,9 @@ var transient byte MoneyTossCount;
reliable server function ServerThrowMoney() reliable server function ServerThrowMoney()
{ {
if(MoneyTossTime>WorldInfo.TimeSeconds) if (MoneyTossTime>WorldInfo.TimeSeconds)
{ {
if(MoneyTossCount>=10) if (MoneyTossCount>=10)
return; return;
++MoneyTossCount; ++MoneyTossCount;
MoneyTossTime = FMax(MoneyTossTime,WorldInfo.TimeSeconds+0.5); MoneyTossTime = FMax(MoneyTossTime,WorldInfo.TimeSeconds+0.5);
@ -29,9 +29,9 @@ simulated function Inventory CreateInventory(class<Inventory> NewInventoryItemCl
SupClass = Super.CreateInventory(NewInventoryItemClass, bDoNotActivate); SupClass = Super.CreateInventory(NewInventoryItemClass, bDoNotActivate);
Wep = KFWeapon(SupClass); 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(); Wep.Destroy();
return Super.CreateInventory(class'ExtWeap_Pistol_Dual9mm', bDoNotActivate); return Super.CreateInventory(class'ExtWeap_Pistol_Dual9mm', bDoNotActivate);
@ -47,7 +47,7 @@ simulated function CheckForExcessRemoval(KFWeapon NewWeap)
{ {
local Inventory RemoveInv, Inv; local Inventory RemoveInv, Inv;
if(KFWeap_Pistol_Dual9mm(NewWeap) != None) if (KFWeap_Pistol_Dual9mm(NewWeap) != None)
{ {
for (Inv = InventoryChain; Inv != None; Inv = Inv.Inventory) for (Inv = InventoryChain; Inv != None; Inv = Inv.Inventory)
{ {

View File

@ -25,11 +25,11 @@ function InitCharacterMenu()
{ {
ExtPRI = ExtPlayerReplicationInfo(GetPC().PlayerReplicationInfo); ExtPRI = ExtPlayerReplicationInfo(GetPC().PlayerReplicationInfo);
if(ExtPRI!=None && ExtPRI.bClientInitChars) if (ExtPRI!=None && ExtPRI.bClientInitChars)
CharListRecieved(); 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; bWaitingCharList = true;
return; return;
@ -45,7 +45,7 @@ function InitCharacterMenu()
event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget) event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
{ {
switch(WidgetName) switch (WidgetName)
{ {
case 'perkSelectionContainer': case 'perkSelectionContainer':
if (PerkSelectionContainer == none) if (PerkSelectionContainer == none)
@ -64,7 +64,7 @@ function OnOpen()
local PlayerController PC; local PlayerController PC;
PC = GetPC(); PC = GetPC();
if(PC == none) if (PC == none)
return; return;
CheckForCustomizationPawn(PC); CheckForCustomizationPawn(PC);
@ -82,10 +82,10 @@ function CheckForCustomizationPawn(PlayerController PC)
{ {
local KFPlayerController KFPC; 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); KFPC = KFPlayerController(PC);
if(KFPC != None) if (KFPC != None)
{ {
KFPC.SpawnMidGameCustomizationPawn(); KFPC.SpawnMidGameCustomizationPawn();
} }
@ -157,7 +157,7 @@ function UpdateCharacterList()
bWaitingCharList = false; bWaitingCharList = false;
ItemIndex = 0; ItemIndex = 0;
DataProvider = CreateArray(); DataProvider = CreateArray();
for(i=0; i<ExtPRI.CharacterArchetypes.length; i++) for (i=0; i<ExtPRI.CharacterArchetypes.length; i++)
{ {
SlotObject = CreateObject("Object"); SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i); SlotObject.SetInt("ItemIndex", i);
@ -168,9 +168,9 @@ function UpdateCharacterList()
DataProvider.SetElementObject(ItemIndex, SlotObject); DataProvider.SetElementObject(ItemIndex, SlotObject);
ItemIndex++; 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 = CreateObject("Object");
SlotObject.SetInt("ItemIndex", (ExtPRI.CharacterArchetypes.length+i)); SlotObject.SetInt("ItemIndex", (ExtPRI.CharacterArchetypes.length+i));
@ -188,7 +188,7 @@ function UpdateCharacterList()
function UpdateGear() function UpdateGear()
{ {
if(bWaitingCharList) if (bWaitingCharList)
return; return;
CurrentCharInfo = ExtPRI.GetSelectedArch(); CurrentCharInfo = ExtPRI.GetSelectedArch();
@ -216,7 +216,7 @@ final function string GetMenuNameStr(string ObjName)
local int i; local int i;
i = InStr(ObjName,".",true); i = InStr(ObjName,".",true);
if(i!=-1) if (i!=-1)
ObjName = Mid(ObjName,i+1); ObjName = Mid(ObjName,i+1);
return Repl(ObjName,"_"," "); return Repl(ObjName,"_"," ");
} }
@ -236,7 +236,7 @@ function UpdateMeshList(string OutfitKey, string SkinKey, array<OutfitVariants>
Outfit = Outfits[i]; Outfit = Outfits[i];
OutfitName = Localize(CharInfoPath, OutfitKey$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString); OutfitName = Localize(CharInfoPath, OutfitKey$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString);
if(bIsCustomChar) if (bIsCustomChar)
OutfitName = GetMenuNameStr(Outfit.MeshName); OutfitName = GetMenuNameStr(Outfit.MeshName);
if (InStr(OutfitName, "?INT?") != -1) if (InStr(OutfitName, "?INT?") != -1)
@ -247,7 +247,7 @@ function UpdateMeshList(string OutfitKey, string SkinKey, array<OutfitVariants>
SlotObject.SetString("label", OutfitName); SlotObject.SetString("label", OutfitName);
SlotObject.SetBool("enabled", true); SlotObject.SetBool("enabled", true);
FirstSkin = UpdateOutfitVariants(OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject); FirstSkin = UpdateOutfitVariants(OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject);
if(string(FirstSkin.UITexture) == "Bad") if (string(FirstSkin.UITexture) == "Bad")
continue; continue;
TexturePath = "img://"$PathName(FirstSkin.UITexture); TexturePath = "img://"$PathName(FirstSkin.UITexture);
@ -277,7 +277,7 @@ function SkinVariant UpdateOutfitVariants(string OutfitKey, string KeyName, out
for (i = 0; i < SkinVariations.length; i++) for (i = 0; i < SkinVariations.length; i++)
{ {
Skin = SkinVariations[i]; Skin = SkinVariations[i];
if(!bFoundFirst) if (!bFoundFirst)
{ {
FirstSkin = Skin; FirstSkin = Skin;
bFoundFirst = true; bFoundFirst = true;
@ -358,7 +358,7 @@ function SkinVariant UpdateCosmeticVariants(string OutfitKey, string KeyName, KF
for (i = 0; i < Attachment.SkinVariations.length; i++) for (i = 0; i < Attachment.SkinVariations.length; i++)
{ {
Skin = Attachment.SkinVariations[i]; Skin = Attachment.SkinVariations[i];
if(!bFoundFirst) if (!bFoundFirst)
{ {
FirstSkin = Skin; FirstSkin = Skin;
bFoundFirst = true; bFoundFirst = true;
@ -393,7 +393,7 @@ function SetCurrentCharacterButtons()
HeadSkinIndex = ExtPRI.RepCustomizationInfo.HeadSkinIndex; HeadSkinIndex = ExtPRI.RepCustomizationInfo.HeadSkinIndex;
BodyMeshIndex = ExtPRI.RepCustomizationInfo.BodyMeshIndex; BodyMeshIndex = ExtPRI.RepCustomizationInfo.BodyMeshIndex;
BodySkinIndex = ExtPRI.RepCustomizationInfo.BodySkinIndex; BodySkinIndex = ExtPRI.RepCustomizationInfo.BodySkinIndex;
if(bCustom) if (bCustom)
{ {
CharacterIndex = ExtPRI.CustomCharacter.CharacterIndex; CharacterIndex = ExtPRI.CustomCharacter.CharacterIndex;
HeadMeshIndex = ExtPRI.CustomCharacter.HeadMeshIndex; HeadMeshIndex = ExtPRI.CustomCharacter.HeadMeshIndex;
@ -426,7 +426,7 @@ function SetEmoteButton()
EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC()))); EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC())));
DataObject = CreateObject("Object"); DataObject = CreateObject("Object");
if(EmoteIndex == 255) if (EmoteIndex == 255)
{ {
DataObject.SetString("selectedEmote", ""); DataObject.SetString("selectedEmote", "");
DataObject.SetInt("selectedEmoteIndex", 0); DataObject.SetInt("selectedEmoteIndex", 0);
@ -449,18 +449,18 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski
local string SkinName, MeshName; local string SkinName, MeshName;
local GFxObject DataObject; local GFxObject DataObject;
if(bWaitingCharList) if (bWaitingCharList)
return; return;
DataObject = CreateObject("Object"); DataObject = CreateObject("Object");
if(MeshIndex == `CLEARED_ATTACHMENT_INDEX) if (MeshIndex == `CLEARED_ATTACHMENT_INDEX)
{ {
DataObject.SetString(sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString); DataObject.SetString(sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString);
} }
else if(bIsCustomChar) else if (bIsCustomChar)
{ {
if(MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey) if (MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey)
{ {
SkinName = GetMenuName(CurrentCharInfo.HeadVariants[MeshIndex].SkinVariations[SkinIndex].Skin); SkinName = GetMenuName(CurrentCharInfo.HeadVariants[MeshIndex].SkinVariations[SkinIndex].Skin);
MeshName = GetMenuNameStr(CurrentCharInfo.HeadVariants[MeshIndex].MeshName); MeshName = GetMenuNameStr(CurrentCharInfo.HeadVariants[MeshIndex].MeshName);
@ -496,16 +496,16 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa
local int i, AttachmentIndex; local int i, AttachmentIndex;
local bool bCustom; local bool bCustom;
if(bWaitingCharList) if (bWaitingCharList)
return; return;
bCustom = ExtPRI.UsesCustomChar(); bCustom = ExtPRI.UsesCustomChar();
DataObject = CreateObject("Object"); 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]; AttachmentIndex = bCustom ? ExtPRI.CustomCharacter.AttachmentMeshIndices[i] : ExtPRI.RepCustomizationInfo.AttachmentMeshIndices[i];
if(AttachmentIndex == `CLEARED_ATTACHMENT_INDEX) if (AttachmentIndex == `CLEARED_ATTACHMENT_INDEX)
{ {
DataObject.SetString("selectedAttachment_"$i, "----"); 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 // If we are alive, in game, with a playable pawn. switch back to first person view when leaving this menu
PC = GetPC(); PC = GetPC();
if(PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization')) if (PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization'))
{ {
PC.ServerCamera('FirstPerson'); PC.ServerCamera('FirstPerson');
} }
@ -560,7 +560,7 @@ function Callback_Emote(int Index)
local KFPlayerController KFPC; local KFPlayerController KFPC;
KFPC = KFPlayerController(GetPC()); KFPC = KFPlayerController(GetPC());
if(KFPC != none) if (KFPC != none)
{ {
class'ExtEmoteList'.static.SaveEquippedEmote(EmoteList[Index].ID, ExtPlayerController(KFPC)); class'ExtEmoteList'.static.SaveEquippedEmote(EmoteList[Index].ID, ExtPlayerController(KFPC));
@ -596,7 +596,7 @@ function Callback_Weapon(int ItemIndex, int SkinIndex)
local KFPawn_Customization KFP; local KFPawn_Customization KFP;
KFP = KFPawn_Customization(GetPC().Pawn); KFP = KFPawn_Customization(GetPC().Pawn);
if(KFP != none) if (KFP != none)
KFP.AttachWeaponByItemDefinition(SkinIndex); KFP.AttachWeaponByItemDefinition(SkinIndex);
} }
@ -620,7 +620,7 @@ function Callback_Character(int Index)
function Callback_Head(int MeshIndex, int SkinIndex) function Callback_Head(int MeshIndex, int SkinIndex)
{ {
if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server. if (!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server.
ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true); ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true);
ExtPRI.UpdateCustomization(CO_Head, MeshIndex, SkinIndex); ExtPRI.UpdateCustomization(CO_Head, MeshIndex, SkinIndex);
SetGearButtons(MeshIndex, SkinIndex, class'KFGFxMenu_Gear'.Default.HeadMeshKey, class'KFGFxMenu_Gear'.Default.HeadSkinKey, class'KFGFxMenu_Gear'.Default.HeadFunctionKey); 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) 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.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true);
ExtPRI.UpdateCustomization(CO_Body, MeshIndex, SkinIndex); ExtPRI.UpdateCustomization(CO_Body, MeshIndex, SkinIndex);
@ -646,19 +646,19 @@ function Callback_Attachment(int MeshIndex, int SkinIndex)
local int SlotIndex; local int SlotIndex;
local KFPawn KFP; 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); ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true);
KFP = KFPawn(GetPC().Pawn); 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(); ExtPRI.RemoveAttachments();
else else
{ {
class'ExtCharacterInfo'.Static.DetachConflictingAttachments(CurrentCharInfo, MeshIndex, KFP, ExtPRI); class'ExtCharacterInfo'.Static.DetachConflictingAttachments(CurrentCharInfo, MeshIndex, KFP, ExtPRI);
SlotIndex = class'ExtCharacterInfo'.Static.GetAttachmentSlotIndex(CurrentCharInfo, MeshIndex, KFP, ExtPRI); SlotIndex = class'ExtCharacterInfo'.Static.GetAttachmentSlotIndex(CurrentCharInfo, MeshIndex, KFP, ExtPRI);
if(SlotIndex == INDEX_NONE) if (SlotIndex == INDEX_NONE)
{ {
return; return;
} }

View File

@ -7,14 +7,14 @@ function bool IsItemActive(int ItemDefinition)
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition); ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
if(ItemIndex == INDEX_NONE) if (ItemIndex == INDEX_NONE)
{ {
return false; return false;
} }
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef; WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
if(WeaponDef != none) if (WeaponDef != none)
{ {
return class'ExtWeaponSkinList'.Static.IsSkinEquip(WeaponDef, ItemDefinition, ExtPlayerController(KFPC)); 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); ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
if(ItemIndex == INDEX_NONE) if (ItemIndex == INDEX_NONE)
{ {
return; return;
} }
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef; 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)); class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, 0, ExtPlayerController(KFPC));
if(class'WorldInfo'.static.IsConsoleBuild()) if (class'WorldInfo'.static.IsConsoleBuild())
{ {
Manager.CachedProfile.ClearWeaponSkin(WeaponDef.default.WeaponClassPath); Manager.CachedProfile.ClearWeaponSkin(WeaponDef.default.WeaponClassPath);
} }
@ -50,7 +50,7 @@ function Callback_Equip(int ItemDefinition)
else else
{ {
class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, ItemDefinition, ExtPlayerController(KFPC)); 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); Manager.CachedProfile.SaveWeaponSkin(WeaponDef.default.WeaponClassPath, ItemDefinition);
} }

View File

@ -6,17 +6,17 @@ var Ext_PerkBase ExtPrevPerk;
function OnOpen() function OnOpen()
{ {
KFPC = KFPlayerController(GetPC()); KFPC = KFPlayerController(GetPC());
if(ExtKFPC == none) if (ExtKFPC == none)
ExtKFPC = ExtPlayerController(KFPC); ExtKFPC = ExtPlayerController(KFPC);
if(ExtKFPC.ActivePerkManager==None) if (ExtKFPC.ActivePerkManager==None)
{ {
ExtKFPC.SetTimer(0.25,true,'OnOpen',Self); ExtKFPC.SetTimer(0.25,true,'OnOpen',Self);
return; return;
} }
ExtKFPC.ClearTimer('OnOpen',Self); ExtKFPC.ClearTimer('OnOpen',Self);
if(ExtPrevPerk==None) if (ExtPrevPerk==None)
ExtPrevPerk = ExtKFPC.ActivePerkManager.CurrentPerk; ExtPrevPerk = ExtKFPC.ActivePerkManager.CurrentPerk;
ExUpdateContainers(ExtPrevPerk); ExUpdateContainers(ExtPrevPerk);
@ -53,7 +53,7 @@ function PerkChanged(byte NewPerkIndex, bool bClickedIndex)
function OneSecondLoop() function OneSecondLoop()
{ {
if(ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel) if (ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel)
ExUpdateContainers(ExtPrevPerk); ExUpdateContainers(ExtPrevPerk);
} }

View File

@ -14,11 +14,11 @@ function int GetPerkIndex()
} }
function UpdatePlayerInfo() function UpdatePlayerInfo()
{ {
if(ExtKFPC != none && PlayerInfoContainer != none) if (ExtKFPC != none && PlayerInfoContainer != none)
{ {
PlayerInfoContainer.SetPerkInfo(); PlayerInfoContainer.SetPerkInfo();
PlayerInfoContainer.SetPerkList(); PlayerInfoContainer.SetPerkList();
if(ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass) if (ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass)
{ {
ExLastPerkClass = ExtKFPC.ActivePerkManager.CurrentPerk; ExLastPerkClass = ExtKFPC.ActivePerkManager.CurrentPerk;
OnPerkChanged(GetPerkIndex()); OnPerkChanged(GetPerkIndex());
@ -33,7 +33,7 @@ function Callback_PerkChanged(int PerkIndex)
ExtKFPC.PendingPerkClass = ExtKFPC.ActivePerkManager.UserPerks[PerkIndex].Class; ExtKFPC.PendingPerkClass = ExtKFPC.ActivePerkManager.UserPerks[PerkIndex].Class;
ExtKFPC.SwitchToPerk(ExtKFPC.PendingPerkClass); ExtKFPC.SwitchToPerk(ExtKFPC.PendingPerkClass);
if(PlayerInventoryContainer != none) if (PlayerInventoryContainer != none)
{ {
PlayerInventoryContainer.UpdateLock(); PlayerInventoryContainer.UpdateLock();
} }

View File

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

View File

@ -11,7 +11,7 @@ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
{ {
case 'gearMenu': case 'gearMenu':
PC = GetPC(); PC = GetPC();
if(PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun) if (PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun)
return true; return true;
if (EGearMenu == none) if (EGearMenu == none)
{ {
@ -35,13 +35,13 @@ function LaunchMenus(optional bool bForceSkipLobby)
WidgetBinding.WidgetClass = class'ExtWidget_PartyInGame'; WidgetBinding.WidgetClass = class'ExtWidget_PartyInGame';
ManagerObject.SetBool("backgroundVisible", false); ManagerObject.SetBool("backgroundVisible", false);
ManagerObject.SetBool("IISMovieVisible", false); ManagerObject.SetBool("IISMovieVisible", false);
if(bSkippedLobby) if (bSkippedLobby)
CurrentBackgroundMovie.Stop(); CurrentBackgroundMovie.Stop();
WidgetBindings.AddItem(WidgetBinding); WidgetBindings.AddItem(WidgetBinding);
// Load the platform-specific graphics options menu // Load the platform-specific graphics options menu
switch(class'KFGameEngine'.static.GetPlatform()) switch (class'KFGameEngine'.static.GetPlatform())
{ {
case PLATFORM_PC_DX10: case PLATFORM_PC_DX10:
WidgetBinding.WidgetName = 'optionsGraphicsMenu'; WidgetBinding.WidgetName = 'optionsGraphicsMenu';
@ -62,7 +62,7 @@ function LaunchMenus(optional bool bForceSkipLobby)
} }
// do this stuff in case CheckSkipLobby failed // do this stuff in case CheckSkipLobby failed
if(bForceSkipLobby) if (bForceSkipLobby)
{ {
bAfterLobby = true; bAfterLobby = true;
CloseMenus(true); CloseMenus(true);
@ -77,10 +77,10 @@ function OpenMenu(byte NewMenuIndex, optional bool bShowWidgets = true)
Super.OpenMenu(NewMenuIndex, bShowWidgets); Super.OpenMenu(NewMenuIndex, bShowWidgets);
if(bAfterLobby) if (bAfterLobby)
return; return;
if(NewMenuIndex == UI_Perks) if (NewMenuIndex == UI_Perks)
{ {
PerksPage = GUIController.OpenMenu(class'ExtGUI_PerkSelectionPage'); PerksPage = GUIController.OpenMenu(class'ExtGUI_PerkSelectionPage');
SetMovieCanReceiveInput(false); SetMovieCanReceiveInput(false);
@ -93,7 +93,7 @@ function CloseMenus(optional bool bForceClose=false)
{ {
local KF2GUIController GUIController; local KF2GUIController GUIController;
if(PerksPage != None) if (PerksPage != None)
{ {
GUIController = class'KF2GUIController'.Static.GetGUIController(GetPC()); GUIController = class'KF2GUIController'.Static.GetGUIController(GetPC());
GUIController.CloseMenu(class'ExtGUI_PerkSelectionPage'); GUIController.CloseMenu(class'ExtGUI_PerkSelectionPage');
@ -106,7 +106,7 @@ function OnMenuOpen(name WidgetPath, KFGFxObject_Menu Widget)
{ {
Super.OnMenuOpen(WidgetPath, Widget); Super.OnMenuOpen(WidgetPath, Widget);
if(!bAfterLobby && Widget == PerksMenu) if (!bAfterLobby && Widget == PerksMenu)
PerksMenu.ActionScriptVoid("closeContainer"); PerksMenu.ActionScriptVoid("closeContainer");
} }

View File

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

View File

@ -43,7 +43,7 @@ replication
final function SetGrenadeCap(byte AddedCap) final function SetGrenadeCap(byte AddedCap)
{ {
MaxGrenadeCount = Default.MaxGrenadeCount + AddedCap; MaxGrenadeCount = Default.MaxGrenadeCount + AddedCap;
if(RepState==REP_Done) if (RepState==REP_Done)
ClientSetGrenadeCap(MaxGrenadeCount); ClientSetGrenadeCap(MaxGrenadeCount);
} }
simulated reliable client function ClientSetGrenadeCap(byte NewCap) simulated reliable client function ClientSetGrenadeCap(byte NewCap)
@ -55,8 +55,8 @@ function bool ApplyPerkClass(class<Ext_PerkBase> P)
{ {
local int i; local int i;
for(i=0; i<UserPerks.Length; ++i) for (i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].Class==P) if (UserPerks[i].Class==P)
{ {
ApplyPerk(UserPerks[i]); ApplyPerk(UserPerks[i]);
return true; return true;
@ -67,8 +67,8 @@ function bool ApplyPerkName(string S)
{ {
local int i; local int i;
for(i=0; i<UserPerks.Length; ++i) for (i=0; i<UserPerks.Length; ++i)
if(string(UserPerks[i].Class.Name)~=S) if (string(UserPerks[i].Class.Name)~=S)
{ {
ApplyPerk(UserPerks[i]); ApplyPerk(UserPerks[i]);
return true; return true;
@ -82,13 +82,13 @@ function ApplyPerk(Ext_PerkBase P)
local Ext_T_ZEDHelper H; local Ext_T_ZEDHelper H;
local int i; local int i;
if(P==None) if (P==None)
return; return;
if(PlayerOwner.Pawn != None) if (PlayerOwner.Pawn != None)
{ {
InvMan = KFInventoryManager(PlayerOwner.Pawn.InvManager); InvMan = KFInventoryManager(PlayerOwner.Pawn.InvManager);
if(InvMan != None) if (InvMan != None)
InvMan.MaxCarryBlocks = InvMan.Default.MaxCarryBlocks; InvMan.MaxCarryBlocks = InvMan.Default.MaxCarryBlocks;
foreach PlayerOwner.Pawn.ChildActors(class'Ext_T_ZEDHelper',H) foreach PlayerOwner.Pawn.ChildActors(class'Ext_T_ZEDHelper',H)
@ -97,15 +97,15 @@ function ApplyPerk(Ext_PerkBase P)
} }
HP = KFPawn_Human(PlayerOwner.Pawn); HP = KFPawn_Human(PlayerOwner.Pawn);
if(HP != None) if (HP != None)
HP.DefaultInventory = HP.Default.DefaultInventory; HP.DefaultInventory = HP.Default.DefaultInventory;
} }
if(CurrentPerk != None) if (CurrentPerk != None)
{ {
CurrentPerk.DeactivateTraits(); 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); 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; bStatsDirty = true;
CurrentPerk = P; CurrentPerk = P;
if(PRIOwner!=None) if (PRIOwner!=None)
{ {
PRIOwner.ECurrentPerk = P.Class; PRIOwner.ECurrentPerk = P.Class;
PRIOwner.FCurrentPerk = P; PRIOwner.FCurrentPerk = P;
P.UpdatePRILevel(); P.UpdatePRILevel();
} }
if(CurrentPerk!=None) if (CurrentPerk!=None)
{ {
CurrentPerk.ActivateTraits(); CurrentPerk.ActivateTraits();
if(PlayerOwner.Pawn != None) if (PlayerOwner.Pawn != None)
{ {
HP = KFPawn_Human(PlayerOwner.Pawn); HP = KFPawn_Human(PlayerOwner.Pawn);
if(HP != None) if (HP != None)
{ {
HP.HealthMax = HP.default.Health; HP.HealthMax = HP.default.Health;
HP.MaxArmor = HP.default.MaxArmor; HP.MaxArmor = HP.default.MaxArmor;
@ -136,8 +136,8 @@ function ApplyPerk(Ext_PerkBase P)
ModifyHealth(HP.HealthMax); ModifyHealth(HP.HealthMax);
ModifyArmor(HP.MaxArmor); ModifyArmor(HP.MaxArmor);
if(HP.Health > HP.HealthMax) HP.Health = HP.HealthMax; if (HP.Health > HP.HealthMax) HP.Health = HP.HealthMax;
if(HP.Armor > HP.MaxArmor) HP.Armor = HP.MaxArmor; 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; local int i;
for(i=0; i<UserPerks.Length; ++i) for (i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].Class==P) if (UserPerks[i].Class==P)
return UserPerks[i]; return UserPerks[i];
return None; return None;
} }
@ -155,7 +155,7 @@ simulated final function Ext_PerkBase FindPerk(class<Ext_PerkBase> P)
simulated function PostBeginPlay() simulated function PostBeginPlay()
{ {
SetTimer(0.01,false,'InitPerks'); SetTimer(0.01,false,'InitPerks');
if(WorldInfo.NetMode!=NM_Client) if (WorldInfo.NetMode!=NM_Client)
SetTimer(1,true,'CheckPlayTime'); SetTimer(1,true,'CheckPlayTime');
} }
@ -163,18 +163,18 @@ simulated function InitPerks()
{ {
local Ext_PerkBase P; local Ext_PerkBase P;
if(WorldInfo.NetMode==NM_Client) if (WorldInfo.NetMode==NM_Client)
{ {
foreach DynamicActors(class'Ext_PerkBase',P) foreach DynamicActors(class'Ext_PerkBase',P)
if(P.PerkManager!=Self) if (P.PerkManager!=Self)
RegisterPerk(P); 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); PRIOwner = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
if(PRIOwner!=None) if (PRIOwner!=None)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
{ {
PRIOwner.ECurrentPerk = CurrentPerk.Class; PRIOwner.ECurrentPerk = CurrentPerk.Class;
CurrentPerk.UpdatePRILevel(); CurrentPerk.UpdatePRILevel();
@ -194,13 +194,13 @@ function ServerInitPerks()
{ {
local int i; local int i;
for(i=0; i<UserPerks.Length; ++i) for (i=0; i<UserPerks.Length; ++i)
UserPerks[i].SetInitialLevel(); UserPerks[i].SetInitialLevel();
bServerReady = true; bServerReady = true;
CurrentPerk = None; CurrentPerk = None;
if(StrPerkName!="") if (StrPerkName!="")
ApplyPerkName(StrPerkName); ApplyPerkName(StrPerkName);
if(CurrentPerk==None) if (CurrentPerk==None)
ApplyPerk(UserPerks[Rand(UserPerks.Length)]); ApplyPerk(UserPerks[Rand(UserPerks.Length)]);
} }
@ -219,7 +219,7 @@ function Destroyed()
{ {
local int i; 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].PerkManager = None;
UserPerks[i].Destroy(); UserPerks[i].Destroy();
@ -229,25 +229,25 @@ function Destroyed()
function EarnedEXP(int EXP, optional byte Mode) function EarnedEXP(int EXP, optional byte Mode)
{ {
// `log("EarnedEXP" @ GetScriptTrace()); // `log("EarnedEXP" @ GetScriptTrace());
if(CurrentPerk!=None) if (CurrentPerk!=None)
{ {
// Limit how much EXP we got for healing and welding. // Limit how much EXP we got for healing and welding.
switch(Mode) switch (Mode)
{ {
case 1: case 1:
ExpUpStatus[0]+=EXP; ExpUpStatus[0]+=EXP;
EXP = ExpUpStatus[0]/CurrentPerk.WeldExpUpNum; EXP = ExpUpStatus[0]/CurrentPerk.WeldExpUpNum;
if(EXP>0) if (EXP>0)
ExpUpStatus[0]-=(EXP*CurrentPerk.WeldExpUpNum); ExpUpStatus[0]-=(EXP*CurrentPerk.WeldExpUpNum);
break; break;
case 2: case 2:
ExpUpStatus[1]+=EXP; ExpUpStatus[1]+=EXP;
EXP = ExpUpStatus[1]/CurrentPerk.HealExpUpNum; EXP = ExpUpStatus[1]/CurrentPerk.HealExpUpNum;
if(EXP>0) if (EXP>0)
ExpUpStatus[1]-=(EXP*CurrentPerk.HealExpUpNum); ExpUpStatus[1]-=(EXP*CurrentPerk.HealExpUpNum);
break; break;
} }
if(EXP>0 && CurrentPerk.EarnedEXP(EXP)) if (EXP>0 && CurrentPerk.EarnedEXP(EXP))
{ {
TotalEXP+=EXP; TotalEXP+=EXP;
PRIOwner.RepEXP+=EXP; PRIOwner.RepEXP+=EXP;
@ -268,13 +268,13 @@ function OutputXML(ExtStatWriter Data)
Data.WriteValue("exp",string(TotalEXP)); Data.WriteValue("exp",string(TotalEXP));
Data.WriteValue("kills",string(TotalKills)); Data.WriteValue("kills",string(TotalKills));
Data.WriteValue("time",string(TotalPlayTime)); 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); S = string(ExtPlayerController(Owner).PendingPerkClass.Name);
else S = (CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "None"); else S = (CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "None");
Data.WriteValue("activeperk",S); Data.WriteValue("activeperk",S);
for(i=0; i<UserPerks.Length; ++i) for (i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].HasAnyProgress()) if (UserPerks[i].HasAnyProgress())
UserPerks[i].OutputXML(Data); UserPerks[i].OutputXML(Data);
Data.EndIntendent(); Data.EndIntendent();
@ -295,28 +295,28 @@ function SaveData(ExtSaveDataBase Data)
Data.SaveInt(TotalPlayTime,3); Data.SaveInt(TotalPlayTime,3);
// Write character. // Write character.
if(PRIOwner!=None) if (PRIOwner!=None)
PRIOwner.SaveCustomCharacter(Data); PRIOwner.SaveCustomCharacter(Data);
else class'ExtPlayerReplicationInfo'.Static.DummySaveChar(Data); else class'ExtPlayerReplicationInfo'.Static.DummySaveChar(Data);
// Write selected perk. // 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)); Data.SaveStr(string(ExtPlayerController(Owner).PendingPerkClass.Name));
else Data.SaveStr(CurrentPerk!=None ? string(CurrentPerk.Class.Name) : ""); else Data.SaveStr(CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "");
// Count how many progressed perks we have. // Count how many progressed perks we have.
o = 0; o = 0;
for(i=0; i<UserPerks.Length; ++i) for (i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].HasAnyProgress()) if (UserPerks[i].HasAnyProgress())
++o; ++o;
// Then write count we have. // Then write count we have.
Data.SaveInt(o); Data.SaveInt(o);
// Then perk stats. // 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; continue;
Data.SaveStr(string(UserPerks[i].Class.Name)); Data.SaveStr(string(UserPerks[i].Class.Name));
@ -346,7 +346,7 @@ function LoadData(ExtSaveDataBase Data)
TotalPlayTime = Data.ReadInt(3); TotalPlayTime = Data.ReadInt(3);
// Read character. // Read character.
if(PRIOwner!=None) if (PRIOwner!=None)
{ {
PRIOwner.RepKills = TotalKills; PRIOwner.RepKills = TotalKills;
PRIOwner.RepEXP = TotalEXP; PRIOwner.RepEXP = TotalEXP;
@ -360,13 +360,13 @@ function LoadData(ExtSaveDataBase Data)
StrPerkName = Data.ReadStr(); StrPerkName = Data.ReadStr();
l = Data.ReadInt(); // Perk stats length. l = Data.ReadInt(); // Perk stats length.
for(i=0; i<l; ++i) for (i=0; i<l; ++i)
{ {
S = Data.ReadStr(); S = Data.ReadStr();
o = Data.ReadInt(1); // Read skip offset. o = Data.ReadInt(1); // Read skip offset.
Data.PushEOFLimit(o); Data.PushEOFLimit(o);
for(j=0; j<UserPerks.Length; ++j) for (j=0; j<UserPerks.Length; ++j)
if(S~=string(UserPerks[j].Class.Name)) if (S~=string(UserPerks[j].Class.Name))
{ {
UserPerks[j].LoadData(Data); UserPerks[j].LoadData(Data);
break; break;
@ -381,29 +381,29 @@ function AddDefaultInventory(KFPawn P)
{ {
local KFInventoryManager KFIM; local KFInventoryManager KFIM;
if(P != none && P.InvManager != none) if (P != none && P.InvManager != none)
{ {
KFIM = KFInventoryManager(P.InvManager); KFIM = KFInventoryManager(P.InvManager);
if(KFIM != none) if (KFIM != none)
{ {
//Grenades added on spawn //Grenades added on spawn
KFIM.GiveInitialGrenadeCount(); KFIM.GiveInitialGrenadeCount();
} }
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.AddDefaultInventory(P); CurrentPerk.AddDefaultInventory(P);
} }
} }
simulated function PlayerDied() simulated function PlayerDied()
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.PlayerDied(); CurrentPerk.PlayerDied();
} }
function PreNotifyPlayerLeave() function PreNotifyPlayerLeave()
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.DeactivateTraits(); CurrentPerk.DeactivateTraits();
} }
@ -417,10 +417,10 @@ function InitiateClientRep()
} }
function ReplicateTimer() function ReplicateTimer()
{ {
switch(RepState) switch (RepState)
{ {
case REP_CustomCharacters: // Replicate custom characters. case REP_CustomCharacters: // Replicate custom characters.
if(RepIndex>=PRIOwner.CustomCharList.Length) if (RepIndex>=PRIOwner.CustomCharList.Length)
{ {
PRIOwner.AllCharReceived(); PRIOwner.AllCharReceived();
RepIndex = 0; RepIndex = 0;
@ -433,7 +433,7 @@ function ReplicateTimer()
} }
break; break;
case REP_CustomInventory: // Replicate custom trader inventory case REP_CustomInventory: // Replicate custom trader inventory
if(!PRIOwner.OnRepNextItem(PRIOwner,RepIndex)) if (!PRIOwner.OnRepNextItem(PRIOwner,RepIndex))
{ {
RepIndex = 0; RepIndex = 0;
++RepState; ++RepState;
@ -441,20 +441,20 @@ function ReplicateTimer()
else ++RepIndex; else ++RepIndex;
break; break;
case REP_PerkClasses: // Open up all actor channel connections. case REP_PerkClasses: // Open up all actor channel connections.
if(RepIndex>=UserPerks.Length) if (RepIndex>=UserPerks.Length)
{ {
RepIndex = 0; RepIndex = 0;
++RepState; ++RepState;
} }
else if(UserPerks[RepIndex].bClientAuthorized) else if (UserPerks[RepIndex].bClientAuthorized)
{ {
if(UserPerks[RepIndex].bPerkNetReady) if (UserPerks[RepIndex].bPerkNetReady)
++RepIndex; ++RepIndex;
} }
else else
{ {
UserPerks[RepIndex].RemoteRole = ROLE_SimulatedProxy; 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].NextAuthTime = WorldInfo.RealTimeSeconds+0.5;
UserPerks[RepIndex].ClientAuth(); UserPerks[RepIndex].ClientAuth();
@ -462,7 +462,7 @@ function ReplicateTimer()
} }
break; break;
default: default:
if(MaxGrenadeCount!=Default.MaxGrenadeCount) if (MaxGrenadeCount!=Default.MaxGrenadeCount)
ClientSetGrenadeCap(MaxGrenadeCount); ClientSetGrenadeCap(MaxGrenadeCount);
ClearTimer('ReplicateTimer'); ClearTimer('ReplicateTimer');
} }
@ -475,32 +475,32 @@ function bool CanEarnSmallRadiusKillXP(class<DamageType> DT)
simulated function ModifySpeed(out float Speed) simulated function ModifySpeed(out float Speed)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
Speed *= CurrentPerk.Modifiers[0]; 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) 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); CurrentPerk.ModifyDamageGiven(InDamage,DamageCauser,MyKFPM,DamageInstigator,DamageType,HitZoneIdx);
} }
simulated function ModifyDamageTaken(out int InDamage, optional class<DamageType> DamageType, optional Controller InstigatedBy) simulated function ModifyDamageTaken(out int InDamage, optional class<DamageType> DamageType, optional Controller InstigatedBy)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyDamageTaken(InDamage,DamageType,InstigatedBy); CurrentPerk.ModifyDamageTaken(InDamage,DamageType,InstigatedBy);
} }
simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW) simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyRecoil(CurrentRecoilModifier,KFW); CurrentPerk.ModifyRecoil(CurrentRecoilModifier,KFW);
} }
simulated function ModifySpread(out float InSpread) simulated function ModifySpread(out float InSpread)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifySpread(InSpread); CurrentPerk.ModifySpread(InSpread);
} }
simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyRateOfFire(InRate,KFW); CurrentPerk.ModifyRateOfFire(InRate,KFW);
} }
simulated function float GetReloadRateScale(KFWeapon KFW) simulated function float GetReloadRateScale(KFWeapon KFW)
@ -513,12 +513,12 @@ simulated function bool GetUsingTactialReload(KFWeapon KFW)
} }
function ModifyHealth(out int InHealth) function ModifyHealth(out int InHealth)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyHealth(InHealth); CurrentPerk.ModifyHealth(InHealth);
} }
function ModifyArmor(out byte MaxArmor) function ModifyArmor(out byte MaxArmor)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyArmor(MaxArmor); CurrentPerk.ModifyArmor(MaxArmor);
} }
function float GetKnockdownPowerModifier(optional class<DamageType> DamageType, optional byte BodyPart, optional bool bIsSprinting=false) 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) simulated function ModifyMeleeAttackSpeed(out float InDuration, KFWeapon KFW)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyMeleeAttackSpeed(InDuration); CurrentPerk.ModifyMeleeAttackSpeed(InDuration);
} }
simulated function class<KFProj_Grenade> GetGrenadeClass() 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) simulated function ModifyWeldingRate(out float FastenRate, out float UnfastenRate)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyWeldingRate(FastenRate,UnfastenRate); CurrentPerk.ModifyWeldingRate(FastenRate,UnfastenRate);
} }
simulated function bool HasNightVision() 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) 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); CurrentPerk.ModifyMagSizeAndNumber(KFW,MagazineCapacity,WeaponPerkClass,bSecondary,WeaponClassname);
} }
simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false) simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifySpareAmmoAmount(KFW,PrimarySpareAmmo,TraderItem,bSecondary); CurrentPerk.ModifySpareAmmoAmount(KFW,PrimarySpareAmmo,TraderItem,bSecondary);
} }
simulated function ModifyMaxSpareAmmoAmount(KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false) simulated function ModifyMaxSpareAmmoAmount(KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifySpareAmmoAmount(KFW,SpareAmmoCapacity,TraderItem,bSecondary); CurrentPerk.ModifySpareAmmoAmount(KFW,SpareAmmoCapacity,TraderItem,bSecondary);
} }
simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class<KFPerk> WeaponPerkClass) 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) simulated function ModifyHealerRechargeTime(out float RechargeRate)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyHealerRechargeTime(RechargeRate); CurrentPerk.ModifyHealerRechargeTime(RechargeRate);
} }
simulated function bool CanExplosiveWeld() simulated function bool CanExplosiveWeld()
@ -597,7 +597,7 @@ simulated function bool IsOnContactActive()
} }
function bool CanSpreadNapalm() 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. LastNapalmTime = WorldInfo.TimeSeconds; // Avoid infinite script recursion in KFPawn_Monster.
return true; return true;
@ -610,17 +610,17 @@ simulated function bool IsRangeActive()
} }
simulated function DrawSpecialPerkHUD(Canvas C) simulated function DrawSpecialPerkHUD(Canvas C)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.DrawSpecialPerkHUD(C); CurrentPerk.DrawSpecialPerkHUD(C);
} }
function PlayerKilled(KFPawn_Monster Victim, class<DamageType> DamageType) function PlayerKilled(KFPawn_Monster Victim, class<DamageType> DamageType)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.PlayerKilled(Victim,DamageType); CurrentPerk.PlayerKilled(Victim,DamageType);
} }
function ModifyBloatBileDoT(out float DoTScaler) function ModifyBloatBileDoT(out float DoTScaler)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.ModifyBloatBileDoT(DoTScaler); CurrentPerk.ModifyBloatBileDoT(DoTScaler);
} }
simulated function bool GetIsUberAmmoActive(KFWeapon KFW) 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) function UpdatePerkHeadShots(ImpactInfo Impact, class<DamageType> DamageType, int NumHit)
{ {
if(CurrentPerk!=None) if (CurrentPerk!=None)
CurrentPerk.UpdatePerkHeadShots(Impact,DamageType,NumHit); CurrentPerk.UpdatePerkHeadShots(Impact,DamageType,NumHit);
} }
function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int HealAmount) function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int HealAmount)
{ {
if(!bCurrentlyHealing && CurrentPerk!=None) if (!bCurrentlyHealing && CurrentPerk!=None)
{ {
// Using boolean to avoid infinite recursion. // Using boolean to avoid infinite recursion.
bCurrentlyHealing = true; bCurrentlyHealing = true;
@ -654,7 +654,7 @@ function bool IsAcidicCompoundActive()
} }
function ModifyACDamage(out int InDamage) function ModifyACDamage(out int InDamage)
{ {
if(CurrentPerk!=None && CurrentPerk.bToxicDart) if (CurrentPerk!=None && CurrentPerk.bToxicDart)
InDamage += CurrentPerk.ToxicDartDamage; InDamage += CurrentPerk.ToxicDartDamage;
} }
@ -723,7 +723,7 @@ simulated function bool ShouldNeverDud()
} }
function NotifyPerkSacrificeExploded() 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() simulated function float GetAoERadiusModifier()
{ {
@ -777,12 +777,12 @@ simulated function float GetPenetrationModifier(byte Level, class<KFDamageType>
// Other // Other
function ApplySkillsToPawn() function ApplySkillsToPawn()
{ {
if(CheckOwnerPawn()) if (CheckOwnerPawn())
{ {
OwnerPawn.UpdateGroundSpeed(); OwnerPawn.UpdateGroundSpeed();
OwnerPawn.bMovesFastInZedTime = false; OwnerPawn.bMovesFastInZedTime = false;
if(MyPRI == none) if (MyPRI == none)
MyPRI = KFPlayerReplicationInfo(OwnerPawn.PlayerReplicationInfo); MyPRI = KFPlayerReplicationInfo(OwnerPawn.PlayerReplicationInfo);
ApplyWeightLimits(); ApplyWeightLimits();

View File

@ -1,6 +1,6 @@
class ExtPerksContainer_Details extends KFGFxPerksContainer_Details; class ExtPerksContainer_Details extends KFGFxPerksContainer_Details;
`define AddWeaponsInfo(InClassDef) if(`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath()) `define AddWeaponsInfo(InClassDef) if (`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath())
final function ExUpdateDetails(Ext_PerkBase PerkClass) final function ExUpdateDetails(Ext_PerkBase PerkClass)
{ {
@ -21,7 +21,7 @@ final function ExUpdateDetails(Ext_PerkBase PerkClass)
DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP); DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP);
if(KFGRI != none) if (KFGRI != none)
{ {
`AddWeaponsInfo(PerkClass.PrimaryWeaponDef); `AddWeaponsInfo(PerkClass.PrimaryWeaponDef);
`AddWeaponsInfo(PerkClass.SecondaryWeaponDef); `AddWeaponsInfo(PerkClass.SecondaryWeaponDef);
@ -49,7 +49,7 @@ final function ExUpdatePassives(Ext_PerkBase PerkClass)
local int i; local int i;
PassivesProvider = CreateArray(); PassivesProvider = CreateArray();
for(i=0; i<PerkClass.PerkStats.Length; ++i) for (i=0; i<PerkClass.PerkStats.Length; ++i)
{ {
PassiveObject = CreateObject("Object"); PassiveObject = CreateObject("Object");
PassiveObject.SetString("PassiveTitle", PerkClass.GetStatUIStr(i)); PassiveObject.SetString("PassiveTitle", PerkClass.GetStatUIStr(i));

View File

@ -38,7 +38,7 @@ function UpdatePendingPerkInfo(byte SelectedPerkIndex)
local Ext_PerkBase PerkClass; local Ext_PerkBase PerkClass;
KFPC = ExtPlayerController(GetPC()); KFPC = ExtPlayerController(GetPC());
if(KFPC != none) if (KFPC != none)
{ {
PerkClass = KFPC.ActivePerkManager.UserPerks[SelectedPerkIndex]; PerkClass = KFPC.ActivePerkManager.UserPerks[SelectedPerkIndex];
SetPendingPerkChanges(PerkClass.PerkName, PerkClass.GetPerkIconPath(PerkClass.CurrentLevel), "Perk changes will be applied when you die."); 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() simulated function PostBeginPlay()
{ {
Super.PostBeginPlay(); Super.PostBeginPlay();
if(WorldInfo.NetMode!=NM_Client && ActivePerkManager==None) if (WorldInfo.NetMode!=NM_Client && ActivePerkManager==None)
{ {
ActivePerkManager = Spawn(class'ExtPerkManager',Self); ActivePerkManager = Spawn(class'ExtPerkManager',Self);
ActivePerkManager.PlayerOwner = Self; ActivePerkManager.PlayerOwner = Self;
ActivePerkManager.PRIOwner = ExtPlayerReplicationInfo(PlayerReplicationInfo); ActivePerkManager.PRIOwner = ExtPlayerReplicationInfo(PlayerReplicationInfo);
if(ActivePerkManager.PRIOwner!=None) if (ActivePerkManager.PRIOwner!=None)
ActivePerkManager.PRIOwner.PerkManager = ActivePerkManager; ActivePerkManager.PRIOwner.PerkManager = ActivePerkManager;
SetTimer(0.1,true,'CheckPerk'); SetTimer(0.1,true,'CheckPerk');
} }
} }
simulated function Destroyed() simulated function Destroyed()
{ {
if(ActivePerkManager!=None) if (ActivePerkManager!=None)
ActivePerkManager.PreNotifyPlayerLeave(); ActivePerkManager.PreNotifyPlayerLeave();
Super.Destroyed(); Super.Destroyed();
if(ActivePerkManager!=None) if (ActivePerkManager!=None)
ActivePerkManager.Destroy(); ActivePerkManager.Destroy();
} }
function CheckPerk() function CheckPerk()
{ {
if(CurrentPerk!=ActivePerkManager) if (CurrentPerk!=ActivePerkManager)
{ {
CurrentPerk = ActivePerkManager; CurrentPerk = ActivePerkManager;
if(KFPlayerReplicationInfo(PlayerReplicationInfo)!=None) if (KFPlayerReplicationInfo(PlayerReplicationInfo)!=None)
{ {
KFPlayerReplicationInfo(PlayerReplicationInfo).NetPerkIndex = 0; KFPlayerReplicationInfo(PlayerReplicationInfo).NetPerkIndex = 0;
KFPlayerReplicationInfo(PlayerReplicationInfo).CurrentPerkClass = ActivePerkManager.Class; KFPlayerReplicationInfo(PlayerReplicationInfo).CurrentPerkClass = ActivePerkManager.Class;
@ -94,7 +94,7 @@ reliable client function AddAdminCmd(string S)
j = InStr(S,":"); j = InStr(S,":");
i = AdminCommands.Length; i = AdminCommands.Length;
AdminCommands.Length = i+1; AdminCommands.Length = i+1;
if(j==-1) if (j==-1)
{ {
AdminCommands[i].Cmd = S; AdminCommands[i].Cmd = S;
AdminCommands[i].Info = S; AdminCommands[i].Info = S;
@ -117,7 +117,7 @@ reliable client function ClientSetBonus(SoundCue C, Object FX)
} }
simulated final function SendServerSettings() simulated final function SendServerSettings()
{ {
if(LocalPlayer(Player)!=None) if (LocalPlayer(Player)!=None)
ServerSetSettings(bHideKillMsg,bHideDamageMsg,bHideNumberMsg,bNoMonsterPlayer); ServerSetSettings(bHideKillMsg,bHideDamageMsg,bHideNumberMsg,bNoMonsterPlayer);
} }
reliable server function ServerSetSettings(bool bHideKill, bool bHideDmg, bool bHideNum, bool bNoZ) reliable server function ServerSetSettings(bool bHideKill, bool bHideDmg, bool bHideNum, bool bNoZ)
@ -130,24 +130,24 @@ reliable server function ServerSetSettings(bool bHideKill, bool bHideDmg, bool b
} }
unreliable server function NotifyFixed(byte Mode) unreliable server function NotifyFixed(byte Mode)
{ {
if(Mode==1 && (Pawn==None || (WorldInfo.TimeSeconds-Pawn.SpawnTime)<5.f)) if (Mode==1 && (Pawn==None || (WorldInfo.TimeSeconds-Pawn.SpawnTime)<5.f))
return; return;
OnClientFixed(Self,Mode); OnClientFixed(Self,Mode);
if(Default.bRenderModes && ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None) if (Default.bRenderModes && ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
ExtPlayerReplicationInfo(PlayerReplicationInfo).SetFixedData(Mode); ExtPlayerReplicationInfo(PlayerReplicationInfo).SetFixedData(Mode);
} }
delegate OnClientFixed(ExtPlayerController PC, byte 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) 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); Super.ReceiveLocalizedMessage(Message,Switch,RelatedPRI_1,RelatedPRI_2,OptionalObject);
} }
function AddZedKill(class<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT, bool bKiller) function AddZedKill(class<KFPawn_Monster> MonsterClass, byte Difficulty, class<DamageType> DT, bool bKiller)
{ {
// Stats. // Stats.
if(ActivePerkManager!=None) if (ActivePerkManager!=None)
{ {
ActivePerkManager.TotalKills++; ActivePerkManager.TotalKills++;
ActivePerkManager.PRIOwner.RepKills++; 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) 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); Super.ClientPlayCameraShake(Shake,Scale,bTryForceFeedback,PlaySpace,UserPlaySpaceRot);
} }
exec final function AwardXP(int XP, optional byte Mode) exec final function AwardXP(int XP, optional byte Mode)
{ {
if(WorldInfo.NetMode!=NM_Client && ActivePerkManager!=None) if (WorldInfo.NetMode!=NM_Client && ActivePerkManager!=None)
ActivePerkManager.EarnedEXP(XP,Mode); ActivePerkManager.EarnedEXP(XP,Mode);
} }
@ -192,11 +192,11 @@ function AddShotsHit(int AddedHits)
Super.AddShotsHit(AddedHits); Super.AddShotsHit(AddedHits);
W = KFWeapon(Pawn.Weapon); 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); NotifyFixed(8);
LastMisfireTime = WorldInfo.TimeSeconds+2.f; LastMisfireTime = WorldInfo.TimeSeconds+2.f;
return; return;
@ -206,11 +206,11 @@ function AddShotsHit(int AddedHits)
MisfireTimer = WorldInfo.TimeSeconds; MisfireTimer = WorldInfo.TimeSeconds;
return; 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); NotifyFixed(16);
LastMisfireTime = WorldInfo.TimeSeconds+2.f; LastMisfireTime = WorldInfo.TimeSeconds+2.f;
return; return;
@ -222,19 +222,19 @@ function AddShotsHit(int AddedHits)
} }
T = W.GetFireInterval(W.CurrentFireMode); T = W.GetFireInterval(W.CurrentFireMode);
ActivePerkManager.ModifyRateOfFire(T,W); 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; MisrateCounter = 0;
LastFireTime = WorldInfo.TimeSeconds; LastFireTime = WorldInfo.TimeSeconds;
if(MisrateCounter<5) if (MisrateCounter<5)
{ {
++MisrateCounter; ++MisrateCounter;
return; 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); NotifyFixed(2);
LastMisfireTime = WorldInfo.TimeSeconds+1.f; LastMisfireTime = WorldInfo.TimeSeconds+1.f;
return; return;
@ -256,7 +256,7 @@ reliable client function ReceiveServerMOTD(string S, bool bFinal)
reliable server function ServerSetMOTD(string S, bool bFinal) reliable server function ServerSetMOTD(string S, bool bFinal)
{ {
PendingMOTD $= S; PendingMOTD $= S;
if(bFinal && PendingMOTD!="") if (bFinal && PendingMOTD!="")
{ {
OnSetMOTD(Self,PendingMOTD); OnSetMOTD(Self,PendingMOTD);
PendingMOTD = ""; PendingMOTD = "";
@ -266,7 +266,7 @@ reliable server function ServerSetMOTD(string S, bool bFinal)
// TESTING: // TESTING:
reliable server function ServerItemDropGet(string Item) reliable server function ServerItemDropGet(string Item)
{ {
if(DropCount>5 || Len(Item)>100) if (DropCount>5 || Len(Item)>100)
return; return;
++DropCount; ++DropCount;
WorldInfo.Game.Broadcast(Self,PlayerReplicationInfo.GetHumanReadableName()$" got item: "$Item); 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) 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); 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) reliable client function ReceiveKillMessage(class<Pawn> Victim, optional bool bGlobal, optional PlayerReplicationInfo KillerPRI)
{ {
if(bHideKillMsg || (bGlobal && KillerPRI==None)) if (bHideKillMsg || (bGlobal && KillerPRI==None))
return; return;
if(bUseKF2KillMessages) if (bUseKF2KillMessages)
{ {
if(MyGFxHUD != none) if (MyGFxHUD != none)
{ {
ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX((bGlobal ? KillerPRI : None), None, ,false, Victim); ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX((bGlobal ? KillerPRI : None), None, ,false, Victim);
} }
} }
else if(KFExtendedHUD(myHUD)!=None && Victim!=None) else if (KFExtendedHUD(myHUD)!=None && Victim!=None)
KFExtendedHUD(myHUD).AddKillMessage(Victim,1,KillerPRI,byte(bGlobal)); KFExtendedHUD(myHUD).AddKillMessage(Victim,1,KillerPRI,byte(bGlobal));
} }
unreliable client function ReceiveDamageMessage(class<Pawn> Victim, int Damage) 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); KFExtendedHUD(myHUD).AddKillMessage(Victim,Damage,None,2);
} }
unreliable client function ClientNumberMsg(int Count, vector Pos, EDmgMsgType Type) unreliable client function ClientNumberMsg(int Count, vector Pos, EDmgMsgType Type)
{ {
if(!bHideNumberMsg && KFExtendedHUD(myHUD)!=None) if (!bHideNumberMsg && KFExtendedHUD(myHUD)!=None)
KFExtendedHUD(myHUD).AddNumberMsg(Count,Pos,Type); KFExtendedHUD(myHUD).AddNumberMsg(Count,Pos,Type);
} }
reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime ) reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, name Type, optional float MsgLifeTime )
{ {
//if(((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None)) //if (((Type == 'Say') || (Type == 'TeamSay')) && (PRI != None))
// SpeakTTS(S, PRI); <- KF built without TTS... // SpeakTTS(S, PRI); <- KF built without TTS...
// since this is on the client, we can assume that if Player exists, it is a LocalPlayer // 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; S = PRI.GetHumanReadableName()$": "$S;
LocalPlayer(Player).ViewportClient.ViewportConsole.OutputText("("$Type$") "$S); LocalPlayer(Player).ViewportClient.ViewportConsole.OutputText("("$Type$") "$S);
} }
if (MyGFxManager != none && MyGFxManager.PartyWidget != none) if (MyGFxManager != 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; return;
} }
if(MyGFxHUD != none) if (MyGFxHUD != none)
{ {
switch(Type) switch (Type)
{ {
case 'Log': case 'Log':
break; // Console only message. break; // Console only message.
@ -338,7 +338,7 @@ reliable client event TeamMessage(PlayerReplicationInfo PRI, coerce string S, na
break; break;
case 'Say': case 'Say':
case 'TeamSay': 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()); MyGFxHUD.HudChatBox.AddChatMessage("("$ExtPlayerReplicationInfo(PRI).GetAdminNameAbr()$")"$S, ExtPlayerReplicationInfo(PRI).GetAdminColor());
else MyGFxHUD.HudChatBox.AddChatMessage(S, "64FE2E"); else MyGFxHUD.HudChatBox.AddChatMessage(S, "64FE2E");
break; break;
@ -366,14 +366,14 @@ final function PopScreenMsg(string S)
// Get lower part. // Get lower part.
i = InStr(S,"|"); i = InStr(S,"|");
if(i!=-1) if (i!=-1)
{ {
L = Mid(S,i+1); L = Mid(S,i+1);
S = Left(S,i); S = Left(S,i);
// Get time. // Get time.
i = InStr(L,"|"); i = InStr(L,"|");
if(i!=-1) if (i!=-1)
{ {
T = float(Mid(L,i+1)); T = float(Mid(L,i+1));
L = Left(L,i); L = Left(L,i);
@ -386,18 +386,18 @@ reliable client function ClientKillMessage(class<DamageType> DamType, PlayerRepl
local string Msg,S; local string Msg,S;
local bool bFF; local bool bFF;
if(Player==None || Victim==None) if (Player==None || Victim==None)
return; 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); ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(None, Victim, ,true);
else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(KillerPRI, Victim, ,true, KillerPawn); 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); Msg = ParseSuicideMsg(Chr(6)$"O"$Victim.GetHumanReadableName(),DamType);
class'KFMusicStingerHelper'.static.PlayPlayerDiedStinger(Self); class'KFMusicStingerHelper'.static.PlayPlayerDiedStinger(Self);
@ -406,7 +406,7 @@ reliable client function ClientKillMessage(class<DamageType> DamType, PlayerRepl
} }
else 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; bFF = true;
S = KillerPRI.GetHumanReadableName(); S = KillerPRI.GetHumanReadableName();
@ -415,14 +415,14 @@ reliable client function ClientKillMessage(class<DamageType> DamType, PlayerRepl
else // Killed by monster. else // Killed by monster.
{ {
bFF = false; bFF = false;
if(KillerPRI!=None) if (KillerPRI!=None)
{ {
S = KillerPRI.GetHumanReadableName(); S = KillerPRI.GetHumanReadableName();
} }
else else
{ {
S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn); 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; S = "the "$S;
else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@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); Msg = ParseKillMsg(Victim.GetHumanReadableName(),S,bFF,DamType);
} }
S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg); S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg);
if(!bUseKF2DeathMessages) if (!bUseKF2DeathMessages)
KFExtendedHUD(myHUD).AddDeathMessage(Msg,S); KFExtendedHUD(myHUD).AddDeathMessage(Msg,S);
ClientMessage(S,'DeathMessage'); ClientMessage(S,'DeathMessage');
} }
@ -439,35 +439,35 @@ reliable client function ClientZedKillMessage(class<DamageType> DamType, string
{ {
local string Msg,S; local string Msg,S;
if(Player==None) if (Player==None)
return; 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); ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(None, None, Victim, true);
else ExtMoviePlayer_HUD(MyGFxHUD).ShowKillMessageX(KillerPRI, None, Victim, true, KillerPawn); 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); Msg = ParseSuicideMsg(Chr(6)$"O"$Victim,DamType);
} }
else else
{ {
if(KillerPRI!=None) // Team-kill if (KillerPRI!=None) // Team-kill
{ {
S = KillerPRI.GetHumanReadableName(); S = KillerPRI.GetHumanReadableName();
} }
else // Killed by monster. else // Killed by monster.
{ {
S = class'KFExtendedHUD'.Static.GetNameOf(KillerPawn); 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; S = "the "$S;
else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S; else S = class'KFExtendedHUD'.Static.GetNameArticle(S)@S;
} }
Msg = ParseKillMsg(Victim,S,bFFKill,DamType); Msg = ParseKillMsg(Victim,S,bFFKill,DamType);
} }
S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg); S = Class'KFExtendedHUD'.Static.StripMsgColors(Msg);
if(!bUseKF2DeathMessages) if (!bUseKF2DeathMessages)
KFExtendedHUD(myHUD).AddDeathMessage(Msg,S); KFExtendedHUD(myHUD).AddDeathMessage(Msg,S);
ClientMessage(S,'DeathMessage'); ClientMessage(S,'DeathMessage');
} }
@ -476,14 +476,14 @@ simulated final function string ParseSuicideMsg(string Victim, class<DamageType>
local string S; local string S;
S = string(DamType.Name); S = string(DamType.Name);
if(Left(S,15)~="KFDT_Ballistic_") if (Left(S,15)~="KFDT_Ballistic_")
{ {
S = Mid(S,15); // Weapon name. S = Mid(S,15); // Weapon name.
return Victim$Chr(6)$"M killed himself with "$S; 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"; 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 was blown into pieces";
return Victim$Chr(6)$"M had a sudden heart attack"; 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"); T = (bFF ? "O" : "K");
S = string(DamType.Name); S = string(DamType.Name);
if(Left(S,15)~="KFDT_Ballistic_") if (Left(S,15)~="KFDT_Ballistic_")
{ {
S = Mid(S,15); // Weapon name. 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; 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; 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 blown up by "$Chr(6)$T$Killer;
return Chr(6)$"O"$Victim$Chr(6)$"M was killed 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; bShowFPLegs = bEnable;
Class'ExtPlayerController'.Default.bShowFPLegs = bEnable; Class'ExtPlayerController'.Default.bShowFPLegs = bEnable;
if(ExtHumanPawn(Pawn)!=None) if (ExtHumanPawn(Pawn)!=None)
ExtHumanPawn(Pawn).UpdateFPLegs(); ExtHumanPawn(Pawn).UpdateFPLegs();
} }
/*exec function KickBan(string S) /*exec function KickBan(string S)
{ {
if(WorldInfo.Game!=None) if (WorldInfo.Game!=None)
WorldInfo.Game.KickBan(S); WorldInfo.Game.KickBan(S);
}*/ }*/
exec function Kick(string S) exec function Kick(string S)
{ {
if(WorldInfo.Game!=None) if (WorldInfo.Game!=None)
WorldInfo.Game.Kick(S); WorldInfo.Game.Kick(S);
} }
reliable server function SkipLobby(); reliable server function SkipLobby();
@ -543,7 +543,7 @@ Delegate OnChangePerk(ExtPlayerController PC, class<Ext_PerkBase> NewPerk);
reliable server function SwitchToPerk(class<Ext_PerkBase> PerkClass) reliable server function SwitchToPerk(class<Ext_PerkBase> PerkClass)
{ {
if(PerkClass!=None) if (PerkClass!=None)
OnChangePerk(Self,PerkClass); 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) 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); 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) 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); 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) reliable server function ServerResetPerk(class<Ext_PerkBase> PerkClass, bool bPrestige)
{ {
if(PerkClass!=None) if (PerkClass!=None)
OnPerkReset(Self,PerkClass,bPrestige); 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) simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessageType ProgressType, string ProgressTitle, string ProgressDescription, bool SuppressPasswordRetry = false)
{ {
switch(ProgressType) switch (ProgressType)
{ {
case PMT_ConnectionFailure : case PMT_ConnectionFailure :
case PMT_PeerConnectionFailure : case PMT_PeerConnectionFailure :
@ -598,7 +598,7 @@ simulated reliable client event bool ShowConnectionProgressPopup(EProgressMessag
simulated function CancelConnection() simulated function CancelConnection()
{ {
if(KFExtendedHUD(myHUD)!=None) if (KFExtendedHUD(myHUD)!=None)
KFExtendedHUD(myHUD).CancelConnection(); KFExtendedHUD(myHUD).CancelConnection();
else class'Engine'.Static.GetEngine().GameViewport.ConsoleCommand("Disconnect"); 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) 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; bNamePlateShown = true;
Super.ShowBossNameplate(KFBoss,PlayerName); Super.ShowBossNameplate(KFBoss,PlayerName);
@ -616,19 +616,19 @@ function ShowBossNameplate(KFInterface_MonsterBoss KFBoss, optional string Playe
} }
function HideBossNameplate() function HideBossNameplate()
{ {
if(!bNamePlateHidden) if (!bNamePlateHidden)
{ {
bNamePlateHidden = false; bNamePlateHidden = false;
Super.HideBossNameplate(); Super.HideBossNameplate();
ClearTimer('HideBossNameplate'); ClearTimer('HideBossNameplate');
if(MyGFxHUD!=None) if (MyGFxHUD!=None)
MyGFxHUD.MusicNotification.SetVisible(true); MyGFxHUD.MusicNotification.SetVisible(true);
} }
} }
function UpdateRotation(float DeltaTime) function UpdateRotation(float DeltaTime)
{ {
if(OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell()) if (OldViewRot!=Rotation && Pawn!=None && Pawn.IsAliveAndWell())
NotifyFixed(1); NotifyFixed(1);
Super.UpdateRotation(DeltaTime); Super.UpdateRotation(DeltaTime);
OldViewRot = Rotation; OldViewRot = Rotation;
@ -649,7 +649,7 @@ function DefClientResponse(byte CallID, byte Code, int DataA, int DataB);
reliable client function ClientUsedAmmo(Ext_T_SupplierInteract S) reliable client function ClientUsedAmmo(Ext_T_SupplierInteract S)
{ {
if(Pawn!=None && S!=None) if (Pawn!=None && S!=None)
S.UsedOnClient(Pawn); S.UsedOnClient(Pawn);
} }
@ -657,14 +657,14 @@ unreliable server function ServerNextSpectateMode()
{ {
local Pawn HumanViewTarget; local Pawn HumanViewTarget;
if(!IsSpectating()) if (!IsSpectating())
return; return;
// switch to roaming if human viewtarget is dead // switch to roaming if human viewtarget is dead
if(CurrentSpectateMode != SMODE_Roaming) if (CurrentSpectateMode != SMODE_Roaming)
{ {
HumanViewTarget = Pawn(ViewTarget); HumanViewTarget = Pawn(ViewTarget);
if(HumanViewTarget == none || !HumanViewTarget.IsAliveAndWell()) if (HumanViewTarget == none || !HumanViewTarget.IsAliveAndWell())
{ {
SpectateRoaming(); SpectateRoaming();
return; return;
@ -706,7 +706,7 @@ reliable server function ServerViewPlayerID(int ID)
{ {
local PlayerReplicationInfo PRI; local PlayerReplicationInfo PRI;
if(!IsSpectating()) if (!IsSpectating())
return; return;
// Find matching player by ID // Find matching player by ID
@ -715,12 +715,12 @@ reliable server function ServerViewPlayerID(int ID)
if (PRI.PlayerID==ID) if (PRI.PlayerID==ID)
break; 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; return;
SetViewTarget(PRI); SetViewTarget(PRI);
ClientMessage("Now viewing from "$PRI.GetHumanReadableName()); ClientMessage("Now viewing from "$PRI.GetHumanReadableName());
if(CurrentSpectateMode==SMODE_Roaming) if (CurrentSpectateMode==SMODE_Roaming)
SpectatePlayer(SMODE_PawnFreeCam); SpectatePlayer(SMODE_PawnFreeCam);
} }
@ -731,7 +731,7 @@ reliable server function SpectateRoaming()
P = Pawn(ViewTarget); P = Pawn(ViewTarget);
ClientMessage("Viewing from own camera."); ClientMessage("Viewing from own camera.");
Super.SpectateRoaming(); Super.SpectateRoaming();
if(P!=None) if (P!=None)
{ {
SetLocation(P.Location); SetLocation(P.Location);
SetRotation(P.GetViewRotation()); SetRotation(P.GetViewRotation());
@ -746,7 +746,7 @@ reliable client function ClientSetLocation(vector NewLocation, rotator NewRotati
unreliable server function ServerPlayLevelUpDialog() unreliable server function ServerPlayLevelUpDialog()
{ {
if(NextCommTime<WorldInfo.TimeSeconds) if (NextCommTime<WorldInfo.TimeSeconds)
{ {
NextCommTime = WorldInfo.TimeSeconds+2.f; NextCommTime = WorldInfo.TimeSeconds+2.f;
Super.ServerPlayLevelUpDialog(); Super.ServerPlayLevelUpDialog();
@ -754,7 +754,7 @@ unreliable server function ServerPlayLevelUpDialog()
} }
unreliable server function ServerPlayVoiceCommsDialog(int CommsIndex) unreliable server function ServerPlayVoiceCommsDialog(int CommsIndex)
{ {
if(NextCommTime<WorldInfo.TimeSeconds) if (NextCommTime<WorldInfo.TimeSeconds)
{ {
NextCommTime = WorldInfo.TimeSeconds+2.f; NextCommTime = WorldInfo.TimeSeconds+2.f;
Super.ServerPlayVoiceCommsDialog(CommsIndex); Super.ServerPlayVoiceCommsDialog(CommsIndex);
@ -765,17 +765,17 @@ unreliable server function ServerPlayVoiceCommsDialog(int CommsIndex)
// Setup bFire/bAltFire so that Auto-Fire trait will work. // Setup bFire/bAltFire so that Auto-Fire trait will work.
exec function StartFire(optional byte FireModeNum) exec function StartFire(optional byte FireModeNum)
{ {
if(FireModeNum==0) if (FireModeNum==0)
bFire = 1; bFire = 1;
else if(FireModeNum==1) else if (FireModeNum==1)
bAltFire = 1; bAltFire = 1;
Super.StartFire(FireModeNum); Super.StartFire(FireModeNum);
} }
exec function StopFire(optional byte FireModeNum) exec function StopFire(optional byte FireModeNum)
{ {
if(FireModeNum==0) if (FireModeNum==0)
bFire = 0; bFire = 0;
else if(FireModeNum==1) else if (FireModeNum==1)
bAltFire = 0; bAltFire = 0;
Super.StopFire(FireModeNum); Super.StopFire(FireModeNum);
} }
@ -808,7 +808,7 @@ state Spectating
ReplicateMove(DeltaTime, Acceleration, DCLICK_None, rot(0,0,0)); ReplicateMove(DeltaTime, Acceleration, DCLICK_None, rot(0,0,0));
// only done for clients, as LastActiveTime only affects idle kicking // 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; LastUpdateSpectatorActiveTime = WorldInfo.TimeSeconds+UpdateSpectatorActiveInterval;
ServerSetSpectatorActive(); ServerSetSpectatorActive();
@ -826,14 +826,14 @@ state Spectating
exec function SpectatePreviousPlayer() exec function SpectatePreviousPlayer()
{ {
ServerViewNextPlayer(); ServerViewNextPlayer();
if(Role == ROLE_Authority) if (Role == ROLE_Authority)
{ {
NotifyChangeSpectateViewTarget(); NotifyChangeSpectateViewTarget();
} }
} }
unreliable server function ServerViewNextPlayer() unreliable server function ServerViewNextPlayer()
{ {
if(CurrentSpectateMode==SMODE_Roaming) if (CurrentSpectateMode==SMODE_Roaming)
{ {
CurrentSpectateMode = SMODE_PawnFreeCam; CurrentSpectateMode = SMODE_PawnFreeCam;
SetCameraMode('FreeCam'); SetCameraMode('FreeCam');
@ -843,7 +843,7 @@ state Spectating
reliable client function ClientSetCameraMode(name NewCamMode) reliable client function ClientSetCameraMode(name NewCamMode)
{ {
Global.ClientSetCameraMode(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. MyGFxHUD.SpectatorInfoWidget.SetSpectatedKFPRI(None); // Possibly went to first person, hide player info.
} }
} }
@ -851,9 +851,9 @@ state Spectating
// Feign death: // Feign death:
function EnterRagdollMode(bool bEnable) function EnterRagdollMode(bool bEnable)
{ {
if(bEnable) if (bEnable)
GoToState('RagdollMove'); GoToState('RagdollMove');
else if(Pawn==None) else if (Pawn==None)
GotoState('Dead'); GotoState('Dead');
else if (Pawn.PhysicsVolume.bWaterVolume) else if (Pawn.PhysicsVolume.bWaterVolume)
GotoState(Pawn.WaterMovementState); GotoState(Pawn.WaterMovementState);
@ -873,14 +873,14 @@ simulated function EndGameCamFocus(vector Pos)
EndGameCamRot = CamRot; EndGameCamRot = CamRot;
EndGameCamTimer = WorldInfo.RealTimeSeconds; EndGameCamTimer = WorldInfo.RealTimeSeconds;
if(LocalPlayer(Player)==None) if (LocalPlayer(Player)==None)
ClientFocusView(Pos); ClientFocusView(Pos);
else if(KFPawn(ViewTarget)!=None) else if (KFPawn(ViewTarget)!=None)
KFPawn(ViewTarget).SetMeshVisibility(true); KFPawn(ViewTarget).SetMeshVisibility(true);
} }
reliable client function ClientFocusView(vector Pos) reliable client function ClientFocusView(vector Pos)
{ {
if(WorldInfo.NetMode==NM_Client) if (WorldInfo.NetMode==NM_Client)
EndGameCamFocus(Pos); EndGameCamFocus(Pos);
} }
final function bool CalcEndGameCam() final function bool CalcEndGameCam()
@ -888,15 +888,15 @@ final function bool CalcEndGameCam()
local float T,RT; local float T,RT;
local vector HL,HN; local vector HL,HN;
if(LastPlayerCalcView==WorldInfo.TimeSeconds) if (LastPlayerCalcView==WorldInfo.TimeSeconds)
return true; return true;
T = WorldInfo.RealTimeSeconds-EndGameCamTimer; T = WorldInfo.RealTimeSeconds-EndGameCamTimer;
if(T>=20.f) // Finished view. if (T>=20.f) // Finished view.
{ {
bEndGameCamFocus = false; bEndGameCamFocus = false;
if(LocalPlayer(Player)!=None && KFPawn(ViewTarget)!=None) if (LocalPlayer(Player)!=None && KFPawn(ViewTarget)!=None)
KFPawn(ViewTarget).SetMeshVisibility(!Global.UsingFirstPersonCamera()); KFPawn(ViewTarget).SetMeshVisibility(!Global.UsingFirstPersonCamera());
return false; return false;
} }
@ -905,17 +905,17 @@ final function bool CalcEndGameCam()
CalcViewLocation.Z = 1.f; CalcViewLocation.Z = 1.f;
RT = WorldInfo.RealTimeSeconds; RT = WorldInfo.RealTimeSeconds;
if(T<4.f) if (T<4.f)
RT += (4.f-T); RT += (4.f-T);
CalcViewLocation.X = Sin(RT*0.08f); CalcViewLocation.X = Sin(RT*0.08f);
CalcViewLocation.Y = Cos(RT*0.08f); CalcViewLocation.Y = Cos(RT*0.08f);
CalcViewLocation = EndGameCamFocusPos[0] + Normal(CalcViewLocation)*350.f; 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; CalcViewLocation = HL;
CalcViewRotation = rotator(EndGameCamFocusPos[0]-CalcViewLocation); 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; T*=0.25;
CalcViewLocation = CalcViewLocation*T + EndGameCamFocusPos[1]*(1.f-T); 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) simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation)
{ {
if(bEndGameCamFocus && CalcEndGameCam()) if (bEndGameCamFocus && CalcEndGameCam())
{ {
out_Location = CalcViewLocation; out_Location = CalcViewLocation;
out_Rotation = CalcViewRotation; out_Rotation = CalcViewRotation;
@ -935,7 +935,7 @@ simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rota
} }
exec function DebugRenderMode() exec function DebugRenderMode()
{ {
if(WorldInfo.NetMode!=NM_Client) if (WorldInfo.NetMode!=NM_Client)
{ {
bRenderModes = !bRenderModes; bRenderModes = !bRenderModes;
SaveConfig(); SaveConfig();
@ -946,7 +946,7 @@ exec function DebugRenderMode()
// Stats traffic. // Stats traffic.
reliable server function ServerRequestStats(byte ListNum) reliable server function ServerRequestStats(byte ListNum)
{ {
if(ListNum<3) if (ListNum<3)
{ {
TransitListNum = ListNum; TransitListNum = ListNum;
TransitIndex = 0; TransitIndex = 0;
@ -955,7 +955,7 @@ reliable server function ServerRequestStats(byte ListNum)
} }
function SendNextList() function SendNextList()
{ {
if(!OnClientGetStat(Self,TransitListNum,TransitIndex++)) if (!OnClientGetStat(Self,TransitListNum,TransitIndex++))
{ {
ClientGetStat(TransitListNum,true); ClientGetStat(TransitListNum,true);
ClearTimer('SendNextList'); ClearTimer('SendNextList');
@ -987,21 +987,21 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode;
{ {
FOVAngle = DesiredFOV; FOVAngle = DesiredFOV;
if(WorldInfo.NetMode!=NM_Client) if (WorldInfo.NetMode!=NM_Client)
SetCameraMode('ThirdPerson'); SetCameraMode('ThirdPerson');
} }
event EndState(Name NewState) event EndState(Name NewState)
{ {
FOVAngle = DesiredFOV; FOVAngle = DesiredFOV;
if(Pawn!=none && NewState!='Dead') if (Pawn!=none && NewState!='Dead')
Global.SetCameraMode('FirstPerson'); Global.SetCameraMode('FirstPerson');
} }
function PlayerMove(float DeltaTime) function PlayerMove(float DeltaTime)
{ {
local rotator OldRotation; local rotator OldRotation;
if(Pawn == None) if (Pawn == None)
GotoState('Dead'); GotoState('Dead');
else else
{ {
@ -1011,7 +1011,7 @@ Ignores NotifyPhysicsVolumeChange,ServerCamera,ResetCameraMode;
bDoubleJump = false; bDoubleJump = false;
bPressedJump = 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); ReplicateMove(DeltaTime, vect(0,0,0), DCLICK_None, OldRotation - Rotation);
else ProcessMove(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 Actor TheViewTarget;
local vector HL,HN,EndOffset; local vector HL,HN,EndOffset;
if(bEndGameCamFocus && CalcEndGameCam()) if (bEndGameCamFocus && CalcEndGameCam())
{ {
out_Location = CalcViewLocation; out_Location = CalcViewLocation;
out_Rotation = CalcViewRotation; out_Rotation = CalcViewRotation;
return; return;
} }
if(Global.UsingFirstPersonCamera()) if (Global.UsingFirstPersonCamera())
Global.GetPlayerViewPoint(out_Location,out_Rotation); Global.GetPlayerViewPoint(out_Location,out_Rotation);
else else
{ {
out_Rotation = Rotation; out_Rotation = Rotation;
TheViewTarget = GetViewTarget(); TheViewTarget = GetViewTarget();
if(TheViewTarget==None) if (TheViewTarget==None)
TheViewTarget = Self; TheViewTarget = Self;
out_Location = TheViewTarget.Location; out_Location = TheViewTarget.Location;
EndOffset = out_Location-vector(Rotation)*250.f; 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; out_Location = HL;
else out_Location = EndOffset; else out_Location = EndOffset;
} }
@ -1056,14 +1056,14 @@ ignores SeePlayer, HearNoise, Bump;
local rotator OldRotation; local rotator OldRotation;
local bool bSaveJump; local bool bSaveJump;
if(Pawn == None) if (Pawn == None)
{ {
GotoState('Dead'); GotoState('Dead');
} }
else else
{ {
GetAxes(Pawn.Rotation,X,Y,Z); GetAxes(Pawn.Rotation,X,Y,Z);
if(VSZombie(Pawn)!=None) if (VSZombie(Pawn)!=None)
VSZombie(Pawn).ModifyPlayerInput(Self,DeltaTime); VSZombie(Pawn).ModifyPlayerInput(Self,DeltaTime);
// Update acceleration. // Update acceleration.
@ -1083,7 +1083,7 @@ ignores SeePlayer, HearNoise, Bump;
UpdateRotation(DeltaTime); UpdateRotation(DeltaTime);
bDoubleJump = false; bDoubleJump = false;
if(bPressedJump && Pawn.CannotJumpNow()) if (bPressedJump && Pawn.CannotJumpNow())
{ {
bSaveJump = true; bSaveJump = true;
bPressedJump = false; bPressedJump = false;
@ -1093,7 +1093,7 @@ ignores SeePlayer, HearNoise, Bump;
bSaveJump = false; 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); ReplicateMove(DeltaTime, NewAccel, DoubleClickMove, OldRotation - Rotation);
} }
@ -1122,7 +1122,7 @@ state Dead
FindGoodView(); FindGoodView();
CleanOutSavedMoves(); CleanOutSavedMoves();
if(KFPawn(ViewTarget)!=none) if (KFPawn(ViewTarget)!=none)
{ {
KFPawn(ViewTarget).SetMeshVisibility(true); KFPawn(ViewTarget).SetMeshVisibility(true);
} }
@ -1130,17 +1130,17 @@ state Dead
// Deactivate any post process effects when we die // Deactivate any post process effects when we die
ResetGameplayPostProcessFX(); ResetGameplayPostProcessFX();
if(CurrentPerk != none) if (CurrentPerk != none)
CurrentPerk.PlayerDied(); CurrentPerk.PlayerDied();
KFPI = KFPlayerInput(PlayerInput); KFPI = KFPlayerInput(PlayerInput);
if(KFPI != none) if (KFPI != none)
KFPI.HideVoiceComms(); KFPI.HideVoiceComms();
if(MyGFxManager != none) if (MyGFxManager != none)
MyGFxManager.CloseMenus(); MyGFxManager.CloseMenus();
if(MyGFxHUD != none) if (MyGFxHUD != none)
MyGFxHUD.ClearBuffIcons(); MyGFxHUD.ClearBuffIcons();
} }
simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation) simulated event GetPlayerViewPoint(out vector out_Location, out Rotator out_Rotation)
@ -1148,7 +1148,7 @@ state Dead
local Actor TheViewTarget; local Actor TheViewTarget;
local vector HL,HN,EndOffset; local vector HL,HN,EndOffset;
if(bEndGameCamFocus && CalcEndGameCam()) if (bEndGameCamFocus && CalcEndGameCam())
{ {
out_Location = CalcViewLocation; out_Location = CalcViewLocation;
out_Rotation = CalcViewRotation; out_Rotation = CalcViewRotation;
@ -1156,12 +1156,12 @@ state Dead
} }
out_Rotation = Rotation; out_Rotation = Rotation;
TheViewTarget = GetViewTarget(); TheViewTarget = GetViewTarget();
if(TheViewTarget==None) if (TheViewTarget==None)
TheViewTarget = Self; TheViewTarget = Self;
out_Location = TheViewTarget.Location; out_Location = TheViewTarget.Location;
EndOffset = out_Location-vector(Rotation)*400.f; 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; out_Location = HL;
else out_Location = EndOffset; else out_Location = EndOffset;
} }

View File

@ -16,9 +16,9 @@ simulated exec function IronSights(optional bool bHoldButtonMode)
{ {
local KFWeapon KFW; local KFWeapon KFW;
if(Pawn != none) if (Pawn != none)
{ {
if(KFPawn_Monster(Pawn)!=None) if (KFPawn_Monster(Pawn)!=None)
Pawn.StartFire(1); Pawn.StartFire(1);
else else
{ {
@ -32,9 +32,9 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode)
{ {
local KFWeapon KFW; local KFWeapon KFW;
if(Pawn != none) if (Pawn != none)
{ {
if(KFPawn_Monster(Pawn)!=None) if (KFPawn_Monster(Pawn)!=None)
Pawn.StopFire(1); Pawn.StopFire(1);
else else
{ {
@ -47,7 +47,7 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode)
simulated exec function ToggleFlashlight() simulated exec function ToggleFlashlight()
{ {
if(KFPawn_Monster(Pawn)!=None && Pawn.Health>0) if (KFPawn_Monster(Pawn)!=None && Pawn.Health>0)
SetNightVision(!bNightVisionActive); SetNightVision(!bNightVisionActive);
else Super.ToggleFlashlight(); else Super.ToggleFlashlight();
} }
@ -55,10 +55,10 @@ simulated exec function ToggleFlashlight()
function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel) function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel)
{ {
Super.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel); Super.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel);
if(!bHandledTravel) if (!bHandledTravel)
{ {
bHandledTravel = true; bHandledTravel = true;
if(KFExtendedHUD(MyHUD)!=None) if (KFExtendedHUD(MyHUD)!=None)
KFExtendedHUD(MyHUD).NotifyLevelChange(true); 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 (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); MyGUIController = class'KF2GUIController'.Static.GetGUIController(Outer);
if(MyGUIController==None) if (MyGUIController==None)
{ {
ExtPlayerController(Outer).CancelConnection(); ExtPlayerController(Outer).CancelConnection();
return false; return false;
} }
} }
if(MyGUIController.bIsInMenuState) if (MyGUIController.bIsInMenuState)
{ {
return false; return false;
} }
else if(MyGFxManager.bMenusOpen) else if (MyGFxManager.bMenusOpen)
{ {
return MyGFxManager.ToggleMenus(); return MyGFxManager.ToggleMenus();
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -24,21 +24,21 @@ final function Actor PickBestSpawn()
BestScore = 0; BestScore = 0;
foreach ValidSpawnSpots(N) foreach ValidSpawnSpots(N)
{ {
if(Rand(4)==0) if (Rand(4)==0)
{ {
Score = FRand(); Score = FRand();
foreach WorldInfo.AllPawns(class'KFPawn',P,N.Location,2000.f) foreach WorldInfo.AllPawns(class'KFPawn',P,N.Location,2000.f)
{ {
if(!P.IsAliveAndWell()) if (!P.IsAliveAndWell())
continue; continue;
Dist = VSize(N.Location-P.Location); Dist = VSize(N.Location-P.Location);
if(FastTrace(P.Location,N.Location)) if (FastTrace(P.Location,N.Location))
Dist*=0.75; Dist*=0.75;
if(P.IsA('KFPawn_Human')) if (P.IsA('KFPawn_Human'))
Score+=(3000.f-Dist)/2000.f; Score+=(3000.f-Dist)/2000.f;
else Score-=(3500.f-Dist)/2500.f; else Score-=(3500.f-Dist)/2500.f;
} }
if(BestN==None || Score>BestScore) if (BestN==None || Score>BestScore)
{ {
BestN = N; BestN = N;
BestScore = Score; BestScore = Score;
@ -49,21 +49,21 @@ final function Actor PickBestSpawn()
// See if can spawn ontop of other players. // See if can spawn ontop of other players.
foreach WorldInfo.AllPawns(class'KFPawn_Human',H) 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; continue;
Score = FRand(); Score = FRand();
foreach WorldInfo.AllPawns(class'KFPawn',P,H.Location,2000.f) foreach WorldInfo.AllPawns(class'KFPawn',P,H.Location,2000.f)
{ {
if(!P.IsAliveAndWell()) if (!P.IsAliveAndWell())
continue; continue;
Dist = VSize(H.Location-P.Location); Dist = VSize(H.Location-P.Location);
if(FastTrace(P.Location,H.Location)) if (FastTrace(P.Location,H.Location))
Dist*=0.75; Dist*=0.75;
if(P.IsA('KFPawn_Human')) if (P.IsA('KFPawn_Human'))
Score+=(3000.f-Dist)/3000.f; Score+=(3000.f-Dist)/3000.f;
else Score-=(3500.f-Dist)/3500.f; else Score-=(3500.f-Dist)/3500.f;
} }
if(BestN==None || Score>BestScore) if (BestN==None || Score>BestScore)
{ {
BestN = H; BestN = H;
BestScore = Score; BestScore = Score;
@ -83,14 +83,14 @@ function InitChecker()
foreach WorldInfo.AllNavigationPoints(class'PlayerStart',PS) foreach WorldInfo.AllNavigationPoints(class'PlayerStart',PS)
{ {
Fallback = PS; Fallback = PS;
if(PS.bEnabled && PS.TeamIndex==0) if (PS.bEnabled && PS.TeamIndex==0)
{ {
CheckSpawn(PS); CheckSpawn(PS);
if(PendingList.Length!=0) if (PendingList.Length!=0)
break; break;
} }
} }
if(PendingList.Length==0 && Fallback!=None) if (PendingList.Length==0 && Fallback!=None)
CheckSpawn(Fallback); CheckSpawn(Fallback);
SetTimer(0.001,true,'NextCheck'); SetTimer(0.001,true,'NextCheck');
} }
@ -99,9 +99,9 @@ function NextCheck()
local NavigationPoint N; local NavigationPoint N;
local byte i; 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]; N = PendingList[PendingList.Length-1];
PendingList.Remove(PendingList.Length-1,1); PendingList.Remove(PendingList.Length-1,1);
@ -122,7 +122,7 @@ final function CheckSpawn(NavigationPoint N)
local KFPawnBlockingVolume P; local KFPawnBlockingVolume P;
V = N.Location; 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); //DrawDebugLine(V,V+vect(0,0,50),255,255,255,true);
ValidSpawnSpots.AddItem(N); ValidSpawnSpots.AddItem(N);
@ -132,22 +132,22 @@ final function CheckSpawn(NavigationPoint N)
foreach N.PathList(R) foreach N.PathList(R)
{ {
E = R.GetEnd(); 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); // DrawDebugLine(E.Location,N.Location,255,255,0,true);
continue; continue;
} }
if(CheckedList.Find(E)!=INDEX_NONE) if (CheckedList.Find(E)!=INDEX_NONE)
continue; continue;
// DO NOT go through any blocking volumes. // DO NOT go through any blocking volumes.
V = (N.Location+E.Location) * 0.5; V = (N.Location+E.Location) * 0.5;
foreach OverlappingActors(class'KFPawnBlockingVolume',P,VSize(N.Location-V),V) 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; break;
} }
if(P==None) if (P==None)
{ {
//DrawDebugLine(E.Location,N.Location,0,255,0,true); //DrawDebugLine(E.Location,N.Location,0,255,0,true);
PendingList.AddItem(E); PendingList.AddItem(E);

View File

@ -22,7 +22,7 @@ function SetPerkFilterData(byte FilterIndex)
SetInt("selectedIndex", i); SetInt("selectedIndex", i);
// Set the title of this filter based on either the perk or the off perk string // 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); SetString("filterText", PrM.UserPerks[FilterIndex].PerkName);
} }

View File

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

View File

@ -11,7 +11,7 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array<STraderItem>
EKFPC = ExtPlayerController(KFPC); EKFPC = ExtPlayerController(KFPC);
if (EKFPC!=none && EKFPC.ActivePerkManager!=None) if (EKFPC!=none && EKFPC.ActivePerkManager!=None)
{ {
if(FilterIndex<EKFPC.ActivePerkManager.UserPerks.Length) if (FilterIndex<EKFPC.ActivePerkManager.UserPerks.Length)
TargetPerkClass = EKFPC.ActivePerkManager.UserPerks[FilterIndex].BasePerk; TargetPerkClass = EKFPC.ActivePerkManager.UserPerks[FilterIndex].BasePerk;
SlotIndex = 0; SlotIndex = 0;
@ -30,7 +30,7 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array<STraderItem>
} }
else else
{ {
if(ItemList[i].AssociatedPerkClasses.length > 0) if (ItemList[i].AssociatedPerkClasses.length > 0)
{ {
switch (ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass)) 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) simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{ {
if(InstigatorPerkClass != None) if (InstigatorPerkClass != None)
return InstigatorPerkClass; return InstigatorPerkClass;
return default.AssociatedPerkClasses[0]; return default.AssociatedPerkClasses[0];
@ -32,7 +32,7 @@ simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> Instigator
simulated function KFPerk GetPerk() simulated function KFPerk GetPerk()
{ {
if(KFPlayer != None) if (KFPlayer != None)
return KFPlayer.GetPerk(); return KFPlayer.GetPerk();
return super.GetPerk(); return super.GetPerk();
} }

View File

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

View File

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

View File

@ -27,28 +27,28 @@ static function array<MaterialInterface> GetWeaponSkin(int ItemId, EWeaponSkinTy
local string FirstPMat; local string FirstPMat;
i = default.Skins.Find('Id', ItemId); i = default.Skins.Find('Id', ItemId);
if(i > -1) if (i > -1)
{ {
switch(Type) switch (Type)
{ {
case WST_FirstPerson: case WST_FirstPerson:
foreach default.Skins[i].MIC_1P(FirstPMat) foreach default.Skins[i].MIC_1P(FirstPMat)
{ {
LoadedMat = MaterialInterface(DynamicLoadObject(FirstPMat, class'MaterialInterface')); LoadedMat = MaterialInterface(DynamicLoadObject(FirstPMat, class'MaterialInterface'));
if(LoadedMat != None) if (LoadedMat != None)
Mats.AddItem(LoadedMat); Mats.AddItem(LoadedMat);
} }
break; break;
case WST_ThirdPerson: case WST_ThirdPerson:
LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_3P, class'MaterialInterface')); LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_3P, class'MaterialInterface'));
if(LoadedMat != None) if (LoadedMat != None)
Mats.AddItem(LoadedMat); Mats.AddItem(LoadedMat);
break; break;
case WST_Pickup: case WST_Pickup:
LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_Pickup, class'MaterialInterface')); LoadedMat = MaterialInterface(DynamicLoadObject(default.Skins[i].MIC_Pickup, class'MaterialInterface'));
if(LoadedMat != None) if (LoadedMat != None)
Mats.AddItem(LoadedMat); Mats.AddItem(LoadedMat);
break; break;
@ -63,7 +63,7 @@ static function SaveWeaponSkin(class<KFWeaponDefinition> WeaponDef, int ID, ExtP
local int ALen, i; local int ALen, i;
i = PC.SavedWeaponSkins.Find('WepDef', WeaponDef); i = PC.SavedWeaponSkins.Find('WepDef', WeaponDef);
if(i > -1) if (i > -1)
PC.SavedWeaponSkins.Remove(i, 1); PC.SavedWeaponSkins.Remove(i, 1);
ALen = PC.SavedWeaponSkins.Length; ALen = PC.SavedWeaponSkins.Length;
@ -77,7 +77,7 @@ static function bool IsSkinEquip(class<KFWeaponDefinition> WeaponDef, int ID, Ex
{ {
local int i; local int i;
i = PC.SavedWeaponSkins.Find('ID', ID); i = PC.SavedWeaponSkins.Find('ID', ID);
if(i > -1) if (i > -1)
return true; return true;
return false; return false;

View File

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

View File

@ -7,12 +7,12 @@ var transient bool bVisib,bHasInit;
function TickHud(float DeltaTime) 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; LastUpdateTime = KFPC.WorldInfo.RealTimeSeconds + UpdateTickTime;
if(!bVisib) if (!bVisib)
{ {
LastHP = -1; LastHP = -1;
LastShield = -1; LastShield = -1;
@ -22,12 +22,12 @@ function TickHud(float DeltaTime)
UpdateBossInfo(); UpdateBossInfo();
} }
} }
else if(bHasInit) else if (bHasInit)
{ {
NumBosses = 0; NumBosses = 0;
bHasInit = false; bHasInit = false;
BossList.Length = 0; BossList.Length = 0;
if(bVisib) if (bVisib)
{ {
bVisib = false; bVisib = false;
SetVisible(false); SetVisible(false);
@ -39,14 +39,14 @@ final function bool HasBossesAlive()
{ {
local int i; 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); BossList.Remove(i,1);
--NumBosses; --NumBosses;
} }
else if(!BossList[i].IsAliveAndWell()) else if (!BossList[i].IsAliveAndWell())
BossList.Remove(i,1); BossList.Remove(i,1);
} }
return (BossList.Length>0); return (BossList.Length>0);
@ -54,7 +54,7 @@ final function bool HasBossesAlive()
function SetBossPawn(KFInterface_MonsterBoss NewBoss) function SetBossPawn(KFInterface_MonsterBoss NewBoss)
{ {
if(!KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell()) if (!KFPC.bHideBossHealthBar && NewBoss!=None && NewBoss.GetMonsterPawn().IsAliveAndWell())
{ {
bHasInit = true; bHasInit = true;
++NumBosses; ++NumBosses;
@ -67,27 +67,27 @@ final function UpdateBossInfo()
local float V; local float V;
local KFPawn_Monster B; local KFPawn_Monster B;
if(NextBossDistTime<KFPC.WorldInfo.RealTimeSeconds) if (NextBossDistTime<KFPC.WorldInfo.RealTimeSeconds)
{ {
NextBossDistTime = KFPC.WorldInfo.RealTimeSeconds + 1.f; NextBossDistTime = KFPC.WorldInfo.RealTimeSeconds + 1.f;
CheckBestBoss(); CheckBestBoss();
} }
V = (BossPawn!=None ? FClamp(float(BossPawn.GetMonsterPawn().Health) / float(BossPawn.GetMonsterPawn().HealthMax),0.f,1.f) : 0.f); 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; LastHP = V;
SetFloat("currentHealthPercentValue",V); SetFloat("currentHealthPercentValue",V);
} }
V = 0.f; V = 0.f;
if(NumBosses>1) if (NumBosses>1)
{ {
foreach BossList(B) foreach BossList(B)
V += FClamp(float(B.Health) / float(B.HealthMax),0.f,1.f); V += FClamp(float(B.Health) / float(B.HealthMax),0.f,1.f);
V /= NumBosses; V /= NumBosses;
} }
if(LastShield!=V) if (LastShield!=V)
{ {
LastShield = V; LastShield = V;
SetFloat("currentShieldPercecntValue",V); SetFloat("currentShieldPercecntValue",V);
@ -104,14 +104,14 @@ final function CheckBestBoss()
foreach BossList(B) foreach BossList(B)
{ {
Dist = VSizeSq(Pos-B.Location); Dist = VSizeSq(Pos-B.Location);
if(Best==None || Dist<BestDist) if (Best==None || Dist<BestDist)
{ {
Best = B; Best = B;
BestDist = Dist; BestDist = Dist;
} }
} }
if(Best!=BossPawn) if (Best!=BossPawn)
{ {
BossPawn = Best; BossPawn = Best;
SetBossName(Best.static.GetLocalizedName()); SetBossName(Best.static.GetLocalizedName());

View File

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

View File

@ -9,22 +9,22 @@ final function vector PickPointNearOwner()
local vector V,HL,HN,Start; local vector V,HL,HN,Start;
Start = OwnerPawn.Location; 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; Start = HL;
} }
while(true) while (true)
{ {
++i; ++i;
V.X = FRand()-0.5; V.X = FRand()-0.5;
V.Y = FRand()-0.5; V.Y = FRand()-0.5;
V = Start + Normal2D(V) * (100.f+FRand()*500.f); 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; 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; continue;
break; break;
} }
@ -37,7 +37,7 @@ final function bool CanSeeOwner()
NextSightCheckTime = WorldInfo.TimeSeconds+1.f + FRand(); NextSightCheckTime = WorldInfo.TimeSeconds+1.f + FRand();
P = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None; 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 false;
return true; return true;
} }
@ -45,7 +45,7 @@ final function bool CanSeeOwner()
state ZedBaseCommand state ZedBaseCommand
{ {
Begin: Begin:
if(Pawn.Physics == PHYS_Falling) if (Pawn.Physics == PHYS_Falling)
{ {
DisableMeleeRangeEventProbing(); DisableMeleeRangeEventProbing();
WaitForLanding(); WaitForLanding();
@ -55,11 +55,11 @@ Begin:
CheckInterruptCombatTransitions(); CheckInterruptCombatTransitions();
// Select nearest enemy if current enemy is invalid // 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(); SelectEnemy();
// Handle special case if I'm supposed to be attacking a door // 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'); `AILog(self$" DoorEnemy: "$DoorEnemy$" starting melee attack", 'Command_Base');
UpdateHistoryString("[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]"); UpdateHistoryString("[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]");
@ -69,18 +69,18 @@ Begin:
// See if we are close to our owner // See if we are close to our owner
RecheckOwner: RecheckOwner:
OwnerPawn = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None; 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; OwnerPawn = None;
bWaitingOnMovementPlugIn = true; bWaitingOnMovementPlugIn = true;
SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving()); SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving());
NextSightCheckTime = WorldInfo.TimeSeconds+2.f; NextSightCheckTime = WorldInfo.TimeSeconds+2.f;
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) while (bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{ {
if(NextSightCheckTime<WorldInfo.TimeSeconds && !CanSeeOwner()) if (NextSightCheckTime<WorldInfo.TimeSeconds && !CanSeeOwner())
{ {
ClearMovementInfo(); ClearMovementInfo();
GoTo'RecheckOwner'; GoTo'RecheckOwner';
@ -88,12 +88,12 @@ RecheckOwner:
Sleep(0.03); 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; bWaitingOnMovementPlugIn = true;
SetMovePoint(PickPointNearOwner(),OwnerPawn,,300.f); SetMovePoint(PickPointNearOwner(),OwnerPawn,,300.f);
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) while (bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{ {
Sleep(0.03); Sleep(0.03);
} }
@ -104,19 +104,19 @@ RecheckOwner:
Sleep(0.2+FRand()*0.5); Sleep(0.2+FRand()*0.5);
} }
} }
else if(IsValidAttackTarget(KFPawn(Enemy))) else if (IsValidAttackTarget(KFPawn(Enemy)))
{ {
`AILog("Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base'); `AILog("Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base');
bWaitingOnMovementPlugIn = true; bWaitingOnMovementPlugIn = true;
SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving()); SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving());
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement) while (bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{ {
Sleep(0.03); Sleep(0.03);
} }
`AiLog("Back from waiting for the movement plug in!!!"); `AiLog("Back from waiting for the movement plug in!!!");
if(Enemy == none) if (Enemy == none)
{ {
Sleep(FRand() + 0.1f); Sleep(FRand() + 0.1f);
Goto('Begin'); Goto('Begin');
@ -130,9 +130,9 @@ RecheckOwner:
// Check combat transitions // Check combat transitions
CheckCombatTransition(); CheckCombatTransition();
if(bFailedToMoveToEnemy) if (bFailedToMoveToEnemy)
{ {
if(bFailedPathfind) if (bFailedPathfind)
{ {
bFailedPathfind = false; bFailedPathfind = false;
Sleep(0.f); 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) simulated function ModifyMeleeAttackSpeed(out float InDuration)
{ {
InDuration *= Modifiers[4]; InDuration *= Modifiers[4];
if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) if (ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f)
InDuration *= ZedTimeMeleeAtkRate; InDuration *= ZedTimeMeleeAtkRate;
} }
simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW) simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW)
{ {
if(IsWeaponOnPerk(KFW)) if (IsWeaponOnPerk(KFW))
{ {
InRate *= Modifiers[4]; InRate *= Modifiers[4];
if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f) if (ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f)
InRate *= ZedTimeMeleeAtkRate; InRate *= ZedTimeMeleeAtkRate;
} }
} }
function PlayerKilled(KFPawn_Monster Victim, class<DamageType> DT) 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); 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) 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; InDamage += InDamage * 0.03;
} }
@ -31,15 +31,15 @@ simulated function float GetZedTimeModifier(KFWeapon W)
local name StateName; local name StateName;
StateName = W.GetStateName(); StateName = W.GetStateName();
if(bUseProfessional && IsWeaponOnPerk(W)) if (bUseProfessional && IsWeaponOnPerk(W))
{ {
if(StateName == 'Reloading' || StateName == 'AltReloading') if (StateName == 'Reloading' || StateName == 'AltReloading')
return 1.f; return 1.f;
else if(StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping') else if (StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping')
return 0.3f; 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.5f;
return 0.f; 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); DefValue = Super.ApplyEffect(Type, Value, Progress);
MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo); MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
if(MyPRI != None && Type == 'KnockDown') if (MyPRI != None && Type == 'KnockDown')
MyPRI.bConcussiveActive = Modifiers[7] > 1.5; MyPRI.bConcussiveActive = Modifiers[7] > 1.5;
return DefValue; 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) 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; InDamage *= 1.25;
if(bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx)) if (bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx))
InDamage *= 1.5f; InDamage *= 1.5f;
} }
if(class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None) if (class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None)
InDamage *= NukeDamageMult; InDamage *= NukeDamageMult;
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx); 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) 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 TestPawn.HitZones[HitZoneIndex].DmgScale > 1.f;
return false; 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) 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]); PrimarySpareAmmo += (1 + Modifiers[11]);
Super.ModifySpareAmmoAmount(KFW, PrimarySpareAmmo, TraderItem, bSecondary); Super.ModifySpareAmmoAmount(KFW, PrimarySpareAmmo, TraderItem, bSecondary);

View File

@ -18,7 +18,7 @@ simulated function ModifyDamageGiven(out int InDamage, optional Actor DamageCaus
TempDamage = InDamage; 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; TempDamage += InDamage * 100;
InDamage = Round(TempDamage); 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) 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); MagazineCapacity = Min(MagazineCapacity*Modifiers[10], bSecondary ? 150 : 255);
} }
@ -36,10 +36,10 @@ function bool RepairArmor(Pawn HealTarget)
{ {
local KFPawn_Human KFPH; local KFPawn_Human KFPH;
if(RepairArmorRate>0) if (RepairArmorRate>0)
{ {
KFPH = KFPawn_Human(Healtarget); KFPH = KFPawn_Human(Healtarget);
if(KFPH != none && KFPH.Armor < KFPH.MaxArmor) if (KFPH != none && KFPH.Armor < KFPH.MaxArmor)
{ {
KFPH.AddArmor(Round(float(KFPH.MaxArmor) * RepairArmorRate)); KFPH.AddArmor(Round(float(KFPH.MaxArmor) * RepairArmorRate));
return true; return true;
@ -62,7 +62,7 @@ function bool ModifyHealAmount(out float HealAmount)
function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int 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); 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) 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) if (HealTarget == KFP)
KFP.HealDamage(RoundedExtraHealAmount, PlayerOwner, DamType); KFP.HealDamage(RoundedExtraHealAmount, PlayerOwner, DamType);
@ -103,13 +103,13 @@ function NotifyZedTimeStarted()
HPawn = KFPawn_Human(PlayerOwner.Pawn); HPawn = KFPawn_Human(PlayerOwner.Pawn);
if(bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell()) if (bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell())
HPawn.StartAirBorneAgentEvent(); HPawn.StartAirBorneAgentEvent();
} }
simulated function float GetSnarePower(optional class<DamageType> DamageType, optional byte HitZoneIdx) 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 100;
return 0.f; return 0.f;
@ -119,7 +119,7 @@ function AddDefaultInventory(KFPawn P)
{ {
local int i; local int i;
i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm'); i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm');
if(i != -1) if (i != -1)
P.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS'; P.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS';
super.AddDefaultInventory(P); super.AddDefaultInventory(P);
} }

View File

@ -23,10 +23,10 @@ simulated function float GetZedTimeModifier(KFWeapon W)
{ {
local name StateName; local name StateName;
if(bHasFanfire && IsWeaponOnPerk(W)) if (bHasFanfire && IsWeaponOnPerk(W))
{ {
StateName = W.GetStateName(); 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; 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) 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); 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); InDamage *= (1.f+RhythmComboDmg);
} }
@ -25,7 +25,7 @@ final function ResetRhythm()
function SubstractHeadShotCombo() function SubstractHeadShotCombo()
{ {
if(HeadShotComboCount > 0) if (HeadShotComboCount > 0)
UpdateDmgScale(false); UpdateDmgScale(false);
else else
ClearTimer(nameOf(SubstractHeadShotCombo)); ClearTimer(nameOf(SubstractHeadShotCombo));
@ -33,13 +33,13 @@ function SubstractHeadShotCombo()
final function UpdateDmgScale(bool bUp) final function UpdateDmgScale(bool bUp)
{ {
if(bUp) if (bUp)
{ {
HeadShotComboCount = Min(HeadShotComboCount+1,MaxRhythmCombo); HeadShotComboCount = Min(HeadShotComboCount+1,MaxRhythmCombo);
HeadShotMessage(HeadShotComboCount,false,MaxRhythmCombo); HeadShotMessage(HeadShotComboCount,false,MaxRhythmCombo);
SetTimer(HeadShotCountdownIntervall, true, nameOf(SubstractHeadShotCombo)); SetTimer(HeadShotCountdownIntervall, true, nameOf(SubstractHeadShotCombo));
} }
else if(HeadShotComboCount>0) else if (HeadShotComboCount>0)
{ {
--HeadShotComboCount; --HeadShotComboCount;
HeadShotMessage(HeadShotComboCount,true,MaxRhythmCombo); HeadShotMessage(HeadShotComboCount,true,MaxRhythmCombo);
@ -53,16 +53,16 @@ function UpdatePerkHeadShots(ImpactInfo Impact, class<DamageType> DamageType, in
local int HitZoneIdx; local int HitZoneIdx;
local KFPawn_Monster KFPM; local KFPawn_Monster KFPM;
if(MaxRhythmCombo<=0) if (MaxRhythmCombo<=0)
return; return;
KFPM = KFPawn_Monster(Impact.HitActor); KFPM = KFPawn_Monster(Impact.HitActor);
if(KFPM==none || KFPM.GetTeamNum()==0) if (KFPM==none || KFPM.GetTeamNum()==0)
return; return;
HitZoneIdx = KFPM.HitZones.Find('ZoneName', Impact.HitInfo.BoneName); 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); UpdateDmgScale(true);
} }
} }
@ -72,7 +72,7 @@ reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte Ma
local KFPlayerController PC; local KFPlayerController PC;
PC = KFPlayerController(PlayerOwner); PC = KFPlayerController(PlayerOwner);
if(PC==none || PC.MyGFxHUD==none) if (PC==none || PC.MyGFxHUD==none)
{ {
return; return;
} }
@ -80,24 +80,24 @@ reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte Ma
PC.MyGFxHUD.RhythmCounterWidget.SetInt("count", HeadShotNum); PC.MyGFxHUD.RhythmCounterWidget.SetInt("count", HeadShotNum);
PC.MyGFxHUD.RhythmCounterWidget.SetBonusPercentage(float(HeadShotNum) / float(MaxHits)); PC.MyGFxHUD.RhythmCounterWidget.SetBonusPercentage(float(HeadShotNum) / float(MaxHits));
if(HeadshotNum==0) if (HeadshotNum==0)
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Reset'; 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'); //PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShot');
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Hit'; TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Hit';
} }
} }
else if(!bMissed) else if (!bMissed)
{ {
//PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShotPing'); //PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShotPing');
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Top'; TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Top';
HeadshotNum = 6; HeadshotNum = 6;
} }
if(TempAkEvent != none) if (TempAkEvent != none)
PC.PlayRMEffect(TempAkEvent, 'R_Method', HeadshotNum); PC.PlayRMEffect(TempAkEvent, 'R_Method', HeadshotNum);
} }

View File

@ -23,7 +23,7 @@ simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
simulated function float GetZedTimeModifier(KFWeapon W) simulated function float GetZedTimeModifier(KFWeapon W)
{ {
if(bRapidAssault && WorldInfo.TimeDilation<1.f && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(W.GetStateName()) != INDEX_NONE) if (bRapidAssault && WorldInfo.TimeDilation<1.f && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(W.GetStateName()) != INDEX_NONE)
return 0.51f; return 0.51f;
return 0.f; return 0.f;
} }

View File

@ -12,13 +12,13 @@ replication
simulated function float GetReloadRateScale(KFWeapon KFW) 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)*DireReloadSpeed;
return Super.GetReloadRateScale(KFW); return Super.GetReloadRateScale(KFW);
} }
function float GetStunPowerModifier(optional class<DamageType> DamageType, optional byte HitZoneIdx) 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) + ZEDTimeStunPower;
return Super.GetStunPowerModifier(DamageType,HitZoneIdx); 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 ) simulated function float GetPenetrationModifier(byte Level, class<KFDamageType> DamageType, optional bool bForce )
{ {
local float PenetrationPower; 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; return 0;
PenetrationPower = bUseAPShot ? APShotMul : 0.f; 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; local int i;
if(Default.bLimitToOne) if (Default.bLimitToOne)
{ {
for(i=0; i<Perk.PerkTraits.Length; ++i) 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) if (Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class)
return true; return true;
} }
return false; return false;

View File

@ -15,15 +15,15 @@ static function bool GroupLimited(Ext_PerkBase Perk, class<Ext_TraitBase> Trait)
local byte n; local byte n;
n = GetMaxLimit(Perk); n = GetMaxLimit(Perk);
for(i=0; i<Perk.PerkTraits.Length; ++i) 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) if (Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0)
return true; return true;
return false; return false;
} }
static final function byte GetMaxLimit(Ext_PerkBase Perk) static final function byte GetMaxLimit(Ext_PerkBase Perk)
{ {
if(Perk.CurrentPrestige<1 || Perk.CurrentLevel<100) if (Perk.CurrentPrestige<1 || Perk.CurrentLevel<100)
return 1; return 1;
return ((Perk.CurrentPrestige<5 || Perk.CurrentLevel<150) ? 2 : 3); return ((Perk.CurrentPrestige<5 || Perk.CurrentLevel<150) ? 2 : 3);
} }

View File

@ -7,7 +7,7 @@ var float RegCount;
function PostBeginPlay() function PostBeginPlay()
{ {
PawnOwner = Pawn(Owner); PawnOwner = Pawn(Owner);
if(PawnOwner==None) if (PawnOwner==None)
Destroy(); Destroy();
else SetTimer(29+FRand(),true); else SetTimer(29+FRand(),true);
} }
@ -17,15 +17,15 @@ function Timer()
local byte i; local byte i;
local int ExtraAmmo; local int ExtraAmmo;
if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None) if (PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None)
Destroy(); Destroy();
else else
{ {
foreach PawnOwner.InvManager.InventoryActors(class'KFWeapon',W) 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); ExtraAmmo = FMax(float(W.SpareAmmoCapacity[i] + W.MagazineCapacity[i])*RegCount,1.f);
if (i==0) if (i==0)

View File

@ -3,9 +3,9 @@ Class Ext_T_ArmorRegHelp extends Ext_T_HealthRegHelp
function Timer() function Timer()
{ {
if(PawnOwner==None || PawnOwner.Health<=0) if (PawnOwner==None || PawnOwner.Health<=0)
Destroy(); Destroy();
else if(PawnOwner.Armor<PawnOwner.MaxArmor) else if (PawnOwner.Armor<PawnOwner.MaxArmor)
{ {
PawnOwner.Armor = Min(PawnOwner.Armor+RegCount,PawnOwner.MaxArmor); PawnOwner.Armor = Min(PawnOwner.Armor+RegCount,PawnOwner.MaxArmor);
} }

View File

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

View File

@ -8,28 +8,28 @@ var bool bTeleporting,bIsDelayed;
function bool CanResPlayer(KFPawn_Human Other, byte Level) function bool CanResPlayer(KFPawn_Human Other, byte Level)
{ {
if(bTeleporting) if (bTeleporting)
{ {
if(LastDied!=None) if (LastDied!=None)
LastDied.Health = 9999; LastDied.Health = 9999;
return true; return true;
} }
if(LastDied==Other) if (LastDied==Other)
{ {
if(Level==1 || LastDiedTimer>WorldInfo.TimeSeconds) if (Level==1 || LastDiedTimer>WorldInfo.TimeSeconds)
return false; return false;
} }
else if(Level==1 && Rand(2)==0) else if (Level==1 && Rand(2)==0)
return false; return false;
LastDied = Other; LastDied = Other;
bTeleporting = true; bTeleporting = true;
if(SpawnPointer==None) if (SpawnPointer==None)
SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo); SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo);
ResPoint = SpawnPointer.PickBestSpawn().Location; ResPoint = SpawnPointer.PickBestSpawn().Location;
LastDied.FindSpot(vect(36,36,86),ResPoint); 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; ResPoint.Z+=5;
Enable('Tick'); Enable('Tick');
StartResurrect(); StartResurrect();
@ -42,10 +42,10 @@ final function StartResurrect()
LastDied.Health = 9999; LastDied.Health = 9999;
LastDied.LastStartTime = WorldInfo.TimeSeconds; LastDied.LastStartTime = WorldInfo.TimeSeconds;
if(ExtHumanPawn(LastDied)!=None) if (ExtHumanPawn(LastDied)!=None)
{ {
ExtHumanPawn(LastDied).bCanBecomeRagdoll = false; ExtHumanPawn(LastDied).bCanBecomeRagdoll = false;
if(!ExtHumanPawn(LastDied).CanBeRedeemed()) if (!ExtHumanPawn(LastDied).CanBeRedeemed())
{ {
bIsDelayed = true; bIsDelayed = true;
return; return;
@ -63,24 +63,24 @@ final function StartResurrect()
function Tick(float Delta) function Tick(float Delta)
{ {
if(!bTeleporting) if (!bTeleporting)
{ {
Disable('Tick'); Disable('Tick');
return; return;
} }
if(LastDied==None || LastDied.Health<=0) if (LastDied==None || LastDied.Health<=0)
{ {
bTeleporting = false; bTeleporting = false;
return; return;
} }
if(bIsDelayed) if (bIsDelayed)
{ {
bIsDelayed = false; bIsDelayed = false;
StartResurrect(); StartResurrect();
return; return;
} }
Delta = (LastDiedTimer-WorldInfo.TimeSeconds); Delta = (LastDiedTimer-WorldInfo.TimeSeconds);
if(Delta<=0) if (Delta<=0)
{ {
EndGhostTeleport(); EndGhostTeleport();
return; return;
@ -88,7 +88,7 @@ function Tick(float Delta)
Delta /= TeleTime; Delta /= TeleTime;
LastDied.Velocity = Normal(ResPoint-TeleStartPoint)*900.f; LastDied.Velocity = Normal(ResPoint-TeleStartPoint)*900.f;
LastDied.SetLocation(TeleStartPoint*Delta+ResPoint*(1.f-Delta)); LastDied.SetLocation(TeleStartPoint*Delta+ResPoint*(1.f-Delta));
if(LastDied.Physics!=PHYS_None) if (LastDied.Physics!=PHYS_None)
LastDied.SetPhysics(PHYS_None); LastDied.SetPhysics(PHYS_None);
} }
@ -106,16 +106,16 @@ final function EndGhostTeleport()
LastDied.SetPhysics(PHYS_Falling); LastDied.SetPhysics(PHYS_Falling);
LastDied.Velocity = vect(0,0,0); LastDied.Velocity = vect(0,0,0);
LastDied.LastStartTime = WorldInfo.TimeSeconds; // For spawn protection, if any. 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(); LastDied.EndSpecialMove();
if(ExtHumanPawn(LastDied)!=None) if (ExtHumanPawn(LastDied)!=None)
ExtHumanPawn(LastDied).bCanBecomeRagdoll = true; ExtHumanPawn(LastDied).bCanBecomeRagdoll = true;
} }
function Destroyed() function Destroyed()
{ {
if(bTeleporting && LastDied!=None && LastDied.Health>0) if (bTeleporting && LastDied!=None && LastDied.Health>0)
EndGhostTeleport(); EndGhostTeleport();
} }

View File

@ -7,15 +7,15 @@ var byte RegCount;
function PostBeginPlay() function PostBeginPlay()
{ {
PawnOwner = KFPawn_Human(Owner); PawnOwner = KFPawn_Human(Owner);
if(PawnOwner==None) if (PawnOwner==None)
Destroy(); Destroy();
else SetTimer(9+FRand(),true); else SetTimer(9+FRand(),true);
} }
function Timer() function Timer()
{ {
if(PawnOwner==None || PawnOwner.Health<=0) if (PawnOwner==None || PawnOwner.Health<=0)
Destroy(); Destroy();
else if(PawnOwner.Health<PawnOwner.HealthMax) else if (PawnOwner.Health<PawnOwner.HealthMax)
{ {
PawnOwner.Health = Min(PawnOwner.Health+RegCount,PawnOwner.HealthMax); PawnOwner.Health = Min(PawnOwner.Health+RegCount,PawnOwner.HealthMax);
} }

View File

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

View File

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

View File

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

View File

@ -20,7 +20,7 @@ function PostBeginPlay()
{ {
PawnOwner = Pawn(Owner); PawnOwner = Pawn(Owner);
bNeedsKillZed = true; bNeedsKillZed = true;
if(PawnOwner==None) if (PawnOwner==None)
Destroy(); Destroy();
else else
{ {
@ -30,30 +30,30 @@ function PostBeginPlay()
} }
function Timer() function Timer()
{ {
if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.PlayerReplicationInfo==None) if (PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.PlayerReplicationInfo==None)
Destroy(); Destroy();
else if(bNeedsKillZed) else if (bNeedsKillZed)
{ {
if(RespawnHelperTime>1) if (RespawnHelperTime>1)
--RespawnHelperTime; --RespawnHelperTime;
if(OldKillsValue==PawnOwner.PlayerReplicationInfo.Kills) if (OldKillsValue==PawnOwner.PlayerReplicationInfo.Kills)
return; return;
bNeedsKillZed = false; bNeedsKillZed = false;
} }
else if(RespawnHelperTime>0) else if (RespawnHelperTime>0)
{ {
if(--RespawnHelperTime==0) if (--RespawnHelperTime==0)
SpawnHelper(); SpawnHelper();
} }
else if(LiveHelper==None || LiveHelper.Health<=0) else if (LiveHelper==None || LiveHelper.Health<=0)
{ {
OldKillsValue = PawnOwner.PlayerReplicationInfo.Kills; OldKillsValue = PawnOwner.PlayerReplicationInfo.Kills;
bNeedsKillZed = true; bNeedsKillZed = true;
RespawnHelperTime = 60; RespawnHelperTime = 60;
} }
else if(!HasLiveZeds()) else if (!HasLiveZeds())
{ {
if(NoLiveCounter==0) if (NoLiveCounter==0)
{ {
PrevMonster = LiveHelper.Class; PrevMonster = LiveHelper.Class;
PrevMonsterHP = (float(LiveHelper.Health) / LiveHelper.HealthMax); PrevMonsterHP = (float(LiveHelper.Health) / LiveHelper.HealthMax);
@ -66,18 +66,18 @@ function Timer()
} }
function Destroyed() function Destroyed()
{ {
if(LiveHelper!=None && LiveHelper.Health>0) if (LiveHelper!=None && LiveHelper.Health>0)
LiveHelper.Died(None,class'DmgType_Suicided',vect(0,0,0)); LiveHelper.Died(None,class'DmgType_Suicided',vect(0,0,0));
} }
final function bool HasLiveZeds() final function bool HasLiveZeds()
{ {
local KFPawn_Monster M; 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; return false;
foreach WorldInfo.AllPawns(Class'KFPawn_Monster',M) foreach WorldInfo.AllPawns(Class'KFPawn_Monster',M)
if(M.Health>0 && M.GetTeamNum()!=0) if (M.Health>0 && M.GetTeamNum()!=0)
return true; return true;
return false; return false;
} }
@ -92,41 +92,41 @@ final function SpawnHelper()
local AkBaseSoundObject TempSound; local AkBaseSoundObject TempSound;
local bool bFinalWave; local bool bFinalWave;
if(PawnOwner.PlayerReplicationInfo==None || !HasLiveZeds()) if (PawnOwner.PlayerReplicationInfo==None || !HasLiveZeds())
{ {
RespawnHelperTime = 3; RespawnHelperTime = 3;
return; return;
} }
NoLiveCounter = 5; NoLiveCounter = 5;
bFinalWave = KFGameReplicationInfo(WorldInfo.GRI).IsFinalWave(); bFinalWave = KFGameReplicationInfo(WorldInfo.GRI).IsFinalWave();
if(bFinalWave && Class<KFPawn_MonsterBoss>(PrevMonster)!=None) if (bFinalWave && Class<KFPawn_MonsterBoss>(PrevMonster)!=None)
PrevMonster = None; PrevMonster = None;
MC = (PrevMonster!=None ? PrevMonster : PickRandomMonster(CurLevel,bFinalWave)); MC = (PrevMonster!=None ? PrevMonster : PickRandomMonster(CurLevel,bFinalWave));
if(MC!=None) if (MC!=None)
{ {
R.Yaw = Rand(65536); R.Yaw = Rand(65536);
if(MC.Default.SoundGroupArch!=None) if (MC.Default.SoundGroupArch!=None)
{ {
// Make no entrance roam (for FP's and Scrakes). // Make no entrance roam (for FP's and Scrakes).
TempSound = MC.Default.SoundGroupArch.EntranceSound; TempSound = MC.Default.SoundGroupArch.EntranceSound;
MC.Default.SoundGroupArch.EntranceSound = None; MC.Default.SoundGroupArch.EntranceSound = None;
} }
for(i=0; i<40; ++i) for (i=0; i<40; ++i)
{ {
V = PawnOwner.Location; V = PawnOwner.Location;
V.X += (FRand()*300.f-150.f); V.X += (FRand()*300.f-150.f);
V.Y += (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; continue;
LiveHelper = Spawn(MC,,,V,R); LiveHelper = Spawn(MC,,,V,R);
if(LiveHelper!=None) if (LiveHelper!=None)
break; break;
} }
if(MC.Default.SoundGroupArch!=None) if (MC.Default.SoundGroupArch!=None)
MC.Default.SoundGroupArch.EntranceSound = TempSound; MC.Default.SoundGroupArch.EntranceSound = TempSound;
} }
if(LiveHelper==None) if (LiveHelper==None)
RespawnHelperTime = 2; RespawnHelperTime = 2;
else else
{ {
@ -136,7 +136,7 @@ final function SpawnHelper()
// Setup AI // Setup AI
C = Spawn(LiveHelper.ControllerClass); C = Spawn(LiveHelper.ControllerClass);
if(KFAIController(C)!=None) if (KFAIController(C)!=None)
{ {
KFAIController(C).bCanTeleportCloser = false; KFAIController(C).bCanTeleportCloser = false;
KFAIController(C).DefaultCommandClass = class'Ext_AICommandBasePet'; KFAIController(C).DefaultCommandClass = class'Ext_AICommandBasePet';
@ -155,14 +155,14 @@ final function SpawnHelper()
LiveHelper.bCanGrabAttack = false; LiveHelper.bCanGrabAttack = false;
// Scale by previous zed HP. // Scale by previous zed HP.
if(PrevMonster!=None) if (PrevMonster!=None)
{ {
LiveHelper.Health *= PrevMonsterHP; LiveHelper.Health *= PrevMonsterHP;
PrevMonster = None; PrevMonster = None;
} }
// Setup PRI. // Setup PRI.
if(C.PlayerReplicationInfo!=None) if (C.PlayerReplicationInfo!=None)
C.PlayerReplicationInfo.Destroy(); C.PlayerReplicationInfo.Destroy();
PRI = Spawn(class'Ext_T_MonsterPRI',LiveHelper); PRI = Spawn(class'Ext_T_MonsterPRI',LiveHelper);
LiveHelper.PlayerReplicationInfo = PRI; LiveHelper.PlayerReplicationInfo = PRI;
@ -174,10 +174,10 @@ final function SpawnHelper()
PRI.MonsterType = MC; PRI.MonsterType = MC;
PRI.PlayerName = PawnOwner.PlayerReplicationInfo.PlayerName$"'s "$PRI.MonsterName; PRI.PlayerName = PawnOwner.PlayerReplicationInfo.PlayerName$"'s "$PRI.MonsterName;
PRI.OwnerController = PawnOwner.Controller; PRI.OwnerController = PawnOwner.Controller;
if(PawnOwner.PlayerReplicationInfo.Team!=None) if (PawnOwner.PlayerReplicationInfo.Team!=None)
PawnOwner.PlayerReplicationInfo.Team.AddToTeam(C); PawnOwner.PlayerReplicationInfo.Team.AddToTeam(C);
PRI.Timer(); PRI.Timer();
if(WorldInfo.NetMode!=NM_DedicatedServer) if (WorldInfo.NetMode!=NM_DedicatedServer)
PRI.NotifyOwner(); PRI.NotifyOwner();
} }
} }
@ -185,7 +185,7 @@ final function SpawnHelper()
final function SetDamageScale(float Sc) final function SetDamageScale(float Sc)
{ {
DamageScale = Default.DamageScale*Sc; DamageScale = Default.DamageScale*Sc;
if(LiveHelper!=None) if (LiveHelper!=None)
LiveHelper.DamageScaling = DamageScale; LiveHelper.DamageScaling = DamageScale;
} }
final function SetHealthScale(float Sc) final function SetHealthScale(float Sc)
@ -201,19 +201,19 @@ static final function LoadMonsterList()
Default.ZedTypes.Length = class'Ext_TraitZED_Summon'.Default.ZedTypes.Length; 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; SA.Length = 0;
ParseStringIntoArray(class'Ext_TraitZED_Summon'.Default.ZedTypes[i],SA,",",true); 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')); C = class<KFPawn_Monster>(DynamicLoadObject(SA[j],Class'Class'));
if(C==None) if (C==None)
continue; continue;
Default.ZedTypes[i].Zeds[Default.ZedTypes[i].Zeds.Length] = C; 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'; 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; local class<KFPawn_Monster> Res;
Level = Min(Default.ZedTypes.Length-1,Level); 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)]; 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; break;
} }
if(bNotBoss && class<KFPawn_MonsterBoss>(Res)!=None) if (bNotBoss && class<KFPawn_MonsterBoss>(Res)!=None)
Res = Class'KFPawn_ZedFleshpound'; Res = Class'KFPawn_ZedFleshpound';
return Res; return Res;
} }

View File

@ -13,14 +13,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{ {
local int i; local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1) if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
return false; 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; return false;
else break; else break;
} }

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local Ext_T_AmmoRegHelp H; local Ext_T_AmmoRegHelp H;
H = Player.Spawn(class'Ext_T_AmmoRegHelp',Player); H = Player.Spawn(class'Ext_T_AmmoRegHelp',Player);
if(H!=None) if (H!=None)
H.RegCount = Default.RegenValues[Level-1]; H.RegCount = Default.RegenValues[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

View File

@ -5,7 +5,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local Ext_T_ArmorRegHelp H; local Ext_T_ArmorRegHelp H;
H = Player.Spawn(class'Ext_T_ArmorRegHelp',Player); H = Player.Spawn(class'Ext_T_ArmorRegHelp',Player);
if(H!=None) if (H!=None)
H.RegCount = Default.RegenValues[Level-1]; H.RegCount = Default.RegenValues[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

View File

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

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local KFInventoryManager M; local KFInventoryManager M;
M = KFInventoryManager(Player.InvManager); M = KFInventoryManager(Player.InvManager);
if(M!=None) if (M!=None)
M.MaxCarryBlocks = M.Default.MaxCarryBlocks+Default.CarryAdds[Level-1]; M.MaxCarryBlocks = M.Default.MaxCarryBlocks+Default.CarryAdds[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
@ -15,7 +15,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local KFInventoryManager M; local KFInventoryManager M;
M = KFInventoryManager(Player.InvManager); M = KFInventoryManager(Player.InvManager);
if(M!=None) if (M!=None)
M.MaxCarryBlocks = M.Default.MaxCarryBlocks; M.MaxCarryBlocks = M.Default.MaxCarryBlocks;
} }

View File

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

View File

@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{ {
local int i; local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3) if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
return false; return false;
if(Lvl==0) if (Lvl==0)
{ {
i = Perk.PerkStats.Find('StatType','Reload'); i = Perk.PerkStats.Find('StatType','Reload');
if(i>=0) if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30); 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) 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]); ExtHumanPawn(Player).SetBatteryRate(Default.BatteryCharges[Level-1]);
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(ExtHumanPawn(Player)!=None) if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).SetBatteryRate(1.f); ExtHumanPawn(Player).SetBatteryRate(1.f);
} }

View File

@ -4,13 +4,13 @@ static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Cl
{ {
local Controller C; 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. 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 // Abort current special move
if(Player.IsDoingSpecialMove()) if (Player.IsDoingSpecialMove())
Player.SpecialMoveHandler.EndSpecialMove(); Player.SpecialMoveHandler.EndSpecialMove();
// Notify AI to stop hunting me. // 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) static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(Level==1) if (Level==1)
Perk.GrenadeClass = Perk.SuperGrenade; Perk.GrenadeClass = Perk.SuperGrenade;
} }
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

View File

@ -2,15 +2,15 @@ Class Ext_TraitGrenadeUpg extends Ext_TraitBase;
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{ {
if(Lvl>=1 && Perk.CurrentLevel<50) if (Lvl>=1 && Perk.CurrentLevel<50)
return false; return false;
return Super.MeetsRequirements(Lvl,Perk); return Super.MeetsRequirements(Lvl,Perk);
} }
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(Level==1) if (Level==1)
Perk.GrenadeClass = Perk.PerkGrenade; Perk.GrenadeClass = Perk.PerkGrenade;
else if(Level==2) else if (Level==2)
Perk.GrenadeClass = Perk.SuperGrenade; Perk.GrenadeClass = Perk.SuperGrenade;
} }
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

View File

@ -7,7 +7,7 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local Ext_T_HealthRegHelp H; local Ext_T_HealthRegHelp H;
H = Player.Spawn(class'Ext_T_HealthRegHelp',Player); H = Player.Spawn(class'Ext_T_HealthRegHelp',Player);
if(H!=None) if (H!=None)
H.RegCount = Default.RegenValues[Level-1]; H.RegCount = Default.RegenValues[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

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) static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(Level <= 1) if (Level <= 1)
return; return;
Level == 2 ? Player.AddArmor(50) : Player.AddArmor(Player.MaxArmor); 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) 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]; ExtHumanPawn(Player).KnockbackResist = Default.ChanceValues[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(ExtHumanPawn(Player)!=None) if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).KnockbackResist = 1.f; ExtHumanPawn(Player).KnockbackResist = 1.f;
} }

View File

@ -11,7 +11,7 @@ static function string GetPerkDescription()
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) 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 false;
return true; return true;

View File

@ -4,7 +4,7 @@ static function AddDefaultInventory(KFPawn Player, Ext_PerkBase Perk, byte Level
{ {
local int i; local int i;
i = Player.DefaultInventory.Find(class'ExtWeap_Pistol_9mm'); i = Player.DefaultInventory.Find(class'ExtWeap_Pistol_9mm');
if(i != -1) if (i != -1)
Player.DefaultInventory[i] = class'ExtWeap_Pistol_MedicS'; 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; local Inventory Inv;
Inv = Player.FindInventoryType(class'ExtWeap_Pistol_9mm'); Inv = Player.FindInventoryType(class'ExtWeap_Pistol_9mm');
if(Inv!=None) if (Inv!=None)
Inv.Destroy(); 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); Inv = Player.CreateInventory(class'ExtWeap_Pistol_MedicS',Player.Weapon!=None);
if (KFWeapon(Inv)!=None) if (KFWeapon(Inv)!=None)

View File

@ -13,14 +13,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{ {
local int i; local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2) if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
return false; 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; return false;
else break; 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) 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]; ExtHumanPawn(Player).NoRagdollChance = Default.ChanceValues[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(ExtHumanPawn(Player)!=None) if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).NoRagdollChance = 0.f; 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; local ExtProj_SUPERGrenade P;
P = Player.Spawn(class'ExtProj_SUPERGrenade'); P = Player.Spawn(class'ExtProj_SUPERGrenade');
if(P!=None) if (P!=None)
{ {
P.bExplodeOnContact = false; // Nope! P.bExplodeOnContact = false; // Nope!
P.InstigatorController = Player.Controller; 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) 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; ExtHumanPawn(Player).bMovesFastInZedTime = true;
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(ExtHumanPawn(Player)!=None) if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).bMovesFastInZedTime = false; ExtHumanPawn(Player).bMovesFastInZedTime = false;
} }
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

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) 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; ExtHumanPawn(Player).bMovesFastInZedTime = true;
Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f/Default.AtkRates[Level-1]; Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f/Default.AtkRates[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{ {
if(ExtHumanPawn(Player)!=None) if (ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).bMovesFastInZedTime = false; ExtHumanPawn(Player).bMovesFastInZedTime = false;
Ext_PerkBerserker(Perk).ZedTimeMeleeAtkRate = 1.f; 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) final function SpawnSupplier(KFPawn_Human H, optional bool bGrenades)
{ {
if(SupplyInteraction!=None) if (SupplyInteraction!=None)
SupplyInteraction.Destroy(); SupplyInteraction.Destroy();
SupplyInteraction = Spawn(class'Ext_T_SupplierInteract', H,, H.Location, H.Rotation,, true); 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.PerkOwner = Perk;
SupplyInteraction.bGrenades = bGrenades; 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); ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = class<Ext_TraitSupply>(TraitClass);
} }
final function RemoveSupplier() final function RemoveSupplier()
{ {
if(SupplyInteraction!=None) if (SupplyInteraction!=None)
SupplyInteraction.Destroy(); SupplyInteraction.Destroy();
if(PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None) if (PlayerOwner!=None && ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo)!=None)
ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = None; ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo).HasSupplier = None;
} }
function Destroyed() function Destroyed()

View File

@ -13,13 +13,13 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{ {
local int i; local int i;
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1) if (Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
return false; return false;
if(Lvl==0) if (Lvl==0)
{ {
i = Perk.PerkStats.Find('StatType','Damage'); i = Perk.PerkStats.Find('StatType','Damage');
if(i>=0) if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30); 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; local Ext_T_UnCloakHelper H;
H = Player.Spawn(class'Ext_T_UnCloakHelper',Player); H = Player.Spawn(class'Ext_T_UnCloakHelper',Player);
if(H!=None) if (H!=None)
H.HandleRadius = Default.RadiusValues[Level-1]; H.HandleRadius = Default.RadiusValues[Level-1];
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)

View File

@ -9,7 +9,7 @@ var array<FLevelFX> LevelEffects;
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk) static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{ {
if(Lvl>=3 && (Perk.CurrentLevel<50 || !HasMaxCarry(Perk))) if (Lvl>=3 && (Perk.CurrentLevel<50 || !HasMaxCarry(Perk)))
return false; return false;
return Super.MeetsRequirements(Lvl,Perk); 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); Level = Min(Level-1,Default.LevelEffects.Length-1);
M = KFInventoryManager(Player.InvManager); M = KFInventoryManager(Player.InvManager);
if(M!=None) if (M!=None)
M.bInfiniteWeight = true; M.bInfiniteWeight = true;
foreach Default.LevelEffects[Level].LoadoutClasses(IC) foreach Default.LevelEffects[Level].LoadoutClasses(IC)
{ {
if(Player.FindInventoryType(IC)==None) if (Player.FindInventoryType(IC)==None)
{ {
Inv = Player.CreateInventory(IC,Player.Weapon!=None); Inv = Player.CreateInventory(IC,Player.Weapon!=None);
if (KFWeapon(Inv)!=None) if (KFWeapon(Inv)!=None)
KFWeapon(Inv).bGivenAtStart = true; KFWeapon(Inv).bGivenAtStart = true;
} }
} }
if(M!=None) if (M!=None)
M.bInfiniteWeight = false; M.bInfiniteWeight = false;
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
@ -61,13 +61,13 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local class<Inventory> IC; local class<Inventory> IC;
local Inventory Inv; local Inventory Inv;
if(Level==0) if (Level==0)
return; return;
Level = Min(Level-1,Default.LevelEffects.Length-1); Level = Min(Level-1,Default.LevelEffects.Length-1);
foreach Default.LevelEffects[Level].LoadoutClasses(IC) foreach Default.LevelEffects[Level].LoadoutClasses(IC)
{ {
Inv = Player.FindInventoryType(IC); Inv = Player.FindInventoryType(IC);
if(Inv!=None) if (Inv!=None)
Inv.Destroy(); Inv.Destroy();
} }
} }

View File

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

View File

@ -15,7 +15,7 @@ static function string GetPerkDescription()
local string S; local string S;
S = Super.GetPerkDescription(); S = Super.GetPerkDescription();
if(Default.FinalLevelPrestige>0) if (Default.FinalLevelPrestige>0)
S $= "|Level 6 requires prestige level: #{FF4000}"$Default.FinalLevelPrestige; S $= "|Level 6 requires prestige level: #{FF4000}"$Default.FinalLevelPrestige;
return S; return S;
} }
@ -24,14 +24,14 @@ static function CheckConfig()
{ {
local byte i,j; local byte i,j;
if(Default.ZedTypes.Length==0) if (Default.ZedTypes.Length==0)
{ {
Default.ZedTypes.Length = Default.DefZedTypes.Length; 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]); Default.ZedTypes[i] = PathName(Default.DefZedTypes[i].Zeds[j]);
else 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; Default.FinalLevelPrestige = 3;
StaticSaveConfig(); 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; 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]); Default.ZedTypes[i] = PathName(Default.DefZedTypes[i].Zeds[j]);
else 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.LevelCosts.AddItem(Default.DefLevelCosts[5]);
Default.FinalLevelPrestige = 3; Default.FinalLevelPrestige = 3;
StaticSaveConfig(); StaticSaveConfig();
} }
if(Default.ZedRespawnTime==0) if (Default.ZedRespawnTime==0)
{ {
Default.ZedRespawnTime = 60.f; Default.ZedRespawnTime = 60.f;
StaticSaveConfig(); StaticSaveConfig();
@ -71,14 +71,14 @@ static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
local int i; local int i;
// First check level. // 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; return false;
// Then check base trait. // Then check base trait.
if(Lvl==0 && Default.BaseTrait!=None) if (Lvl==0 && Default.BaseTrait!=None)
{ {
i = Perk.PerkStats.Find('StatType','Damage'); i = Perk.PerkStats.Find('StatType','Damage');
if(i>=0) if (i>=0)
return (Perk.PerkStats[i].CurrentValue>=30); return (Perk.PerkStats[i].CurrentValue>=30);
} }
return true; return true;
@ -89,12 +89,12 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local int i; local int i;
H = Player.Spawn(class'Ext_T_ZEDHelper',Player); H = Player.Spawn(class'Ext_T_ZEDHelper',Player);
if(H!=None) if (H!=None)
H.CurLevel = Level-1; H.CurLevel = Level-1;
// Make other traits refresh (apply HP/damage scalers). // Make other traits refresh (apply HP/damage scalers).
for(i=0; i<Perk.PerkTraits.Length; ++i) 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) 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); Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data);
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
@ -102,7 +102,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local Ext_T_ZEDHelper H; local Ext_T_ZEDHelper H;
foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) foreach Player.ChildActors(class'Ext_T_ZEDHelper',H)
if(!H.bIsExtra) if (!H.bIsExtra)
H.Destroy(); H.Destroy();
} }
@ -124,7 +124,7 @@ static function string ClientSetRepData(string S)
static function string GetValue(name PropName, int ElementIndex) static function string GetValue(name PropName, int ElementIndex)
{ {
switch(PropName) switch (PropName)
{ {
case 'ZedTypes': case 'ZedTypes':
return (ElementIndex==-1 ? string(Default.ZedTypes.Length) : Default.ZedTypes[ElementIndex]); 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) static function ApplyValue(name PropName, int ElementIndex, string Value)
{ {
switch(PropName) switch (PropName)
{ {
case 'ZedTypes': case 'ZedTypes':
if(Value!="#DELETE" && ElementIndex<Default.ZedTypes.Length) if (Value!="#DELETE" && ElementIndex<Default.ZedTypes.Length)
Default.ZedTypes[ElementIndex] = Value; Default.ZedTypes[ElementIndex] = Value;
break; break;
case 'ZedRespawnTime': case 'ZedRespawnTime':

View File

@ -7,14 +7,14 @@ static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level
local byte MaxLevel; local byte MaxLevel;
MaxLevel = 0; MaxLevel = 0;
for(i=0; i<Perk.PerkTraits.Length; ++i) for (i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].TraitType==Class'Ext_TraitZED_Summon') if (Perk.PerkTraits[i].TraitType==Class'Ext_TraitZED_Summon')
{ {
MaxLevel = Max(Perk.PerkTraits[i].CurrentLevel,1)-1; MaxLevel = Max(Perk.PerkTraits[i].CurrentLevel,1)-1;
break; break;
} }
switch(Level) switch (Level)
{ {
case 3: case 3:
AddHelperType(MaxLevel*0.8,Player); 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). // Make other traits refresh (apply HP/damage scalers).
for(i=0; i<Perk.PerkTraits.Length; ++i) 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) 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); Perk.PerkTraits[i].TraitType.Static.ApplyEffectOn(Player,Perk,Level,Data);
} }
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data) static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
@ -38,7 +38,7 @@ static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Leve
local Ext_T_ZEDHelper H; local Ext_T_ZEDHelper H;
foreach Player.ChildActors(class'Ext_T_ZEDHelper',H) foreach Player.ChildActors(class'Ext_T_ZEDHelper',H)
if(H.bIsExtra) if (H.bIsExtra)
H.Destroy(); H.Destroy();
} }
static final function AddHelperType(byte Lv, KFPawn_Human Player) 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; local Ext_T_ZEDHelper H;
H = Player.Spawn(class'Ext_T_ZEDHelper',Player); H = Player.Spawn(class'Ext_T_ZEDHelper',Player);
if(H!=None) if (H!=None)
{ {
H.CurLevel = Lv; H.CurLevel = Lv;
H.bIsExtra = true; H.bIsExtra = true;

View File

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

View File

@ -10,7 +10,7 @@ var transient Canvas Canvas;
function InitStyle() function InitStyle()
{ {
ItemTex = Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02",class'Texture2D')); ItemTex = Texture2D(DynamicLoadObject("UI_LevelChevrons_TEX.UI_LevelChevron_Icon_02",class'Texture2D'));
if(ItemTex==None) if (ItemTex==None)
ItemTex = Texture2D'EngineMaterials.DefaultWhiteGrid'; ItemTex = Texture2D'EngineMaterials.DefaultWhiteGrid';
} }
function RenderFramedWindow(KFGUI_FloatingWindow P); function RenderFramedWindow(KFGUI_FloatingWindow P);
@ -32,13 +32,13 @@ function PickDefaultFontSize(float YRes)
local string S; local string S;
DefaultFontSize = 0; DefaultFontSize = 0;
if(YRes>800) if (YRes>800)
++DefaultFontSize; ++DefaultFontSize;
if(YRes>1000) if (YRes>1000)
++DefaultFontSize; ++DefaultFontSize;
//if(YRes>1200) //if (YRes>1200)
//++DefaultFontSize; //++DefaultFontSize;
//if(YRes>1300) //if (YRes>1300)
//++DefaultFontSize; //++DefaultFontSize;
S = "ABC"; 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. final function DrawCornerTexNU(int SizeX, int SizeY, byte Dir) // Draw non-uniform corner.
{ {
switch(Dir) switch (Dir)
{ {
case 0: // Up-left case 0: // Up-left
Canvas.DrawTile(ItemTex,SizeX,SizeY,77,15,-66,58); 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) final function DrawCornerTex(int Size, byte Dir)
{ {
switch(Dir) switch (Dir)
{ {
case 0: // Up-left case 0: // Up-left
Canvas.DrawTile(ItemTex,Size,Size,77,15,-66,58); 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) 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. Edge = Min(FMin(Edge,(XS)*0.5),YS);// Verify size.
else Edge = Min(FMin(Edge,(XS)*0.5),(YS)*0.5);// 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); Canvas.SetPos(X,Y);
DrawCornerTex(Edge,0); DrawCornerTex(Edge,0);
if(Extrav<=1) if (Extrav<=1)
{ {
if(Extrav==0) if (Extrav==0)
{ {
// Top right // Top right
Canvas.SetPos(X+XS-Edge,Y); 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); Canvas.SetPos(X+XS-Edge,Y+Edge);
DrawWhiteBox(Edge,YS-Edge*2); DrawWhiteBox(Edge,YS-Edge*2);
} }
else if(Extrav==1) else if (Extrav==1)
{ {
// Top right // Top right
Canvas.SetPos(X+XS,Y); Canvas.SetPos(X+XS,Y);

View File

@ -23,12 +23,12 @@ static function KF2GUIController GetGUIController(PlayerController PC)
{ {
local KF2GUIController G; local KF2GUIController G;
if(PC.Player==None) if (PC.Player==None)
return None; return None;
foreach PC.ChildActors(class'KF2GUIController',G) foreach PC.ChildActors(class'KF2GUIController',G)
if(!G.bIsInvalid) if (!G.bIsInvalid)
break; break;
if(G==None) if (G==None)
G = PC.Spawn(class'KF2GUIController',PC); G = PC.Spawn(class'KF2GUIController',PC);
return G; return G;
} }
@ -43,25 +43,25 @@ simulated function PostBeginPlay()
simulated function Destroyed() simulated function Destroyed()
{ {
if(PlayerOwner!=None) if (PlayerOwner!=None)
SetMenuState(false); SetMenuState(false);
} }
simulated function HandleDrawMenu() simulated function HandleDrawMenu()
{ {
if(HackConsole==None) if (HackConsole==None)
{ {
HackConsole = new(ClientViewport)class'KFGUIConsoleHack'; HackConsole = new(ClientViewport)class'KFGUIConsoleHack';
HackConsole.OutputObject = Self; HackConsole.OutputObject = Self;
} }
if(HackConsole!=ClientViewport.ViewportConsole) if (HackConsole!=ClientViewport.ViewportConsole)
{ {
OrgConsole = ClientViewport.ViewportConsole; OrgConsole = ClientViewport.ViewportConsole;
ClientViewport.ViewportConsole = HackConsole; ClientViewport.ViewportConsole = HackConsole;
// Make sure nothing overrides these settings while menu is being open. // Make sure nothing overrides these settings while menu is being open.
PlayerOwner.PlayerInput = CustomInput; PlayerOwner.PlayerInput = CustomInput;
if(!ClientViewport.bDisplayHardwareMouseCursor) if (!ClientViewport.bDisplayHardwareMouseCursor)
{ {
ClientViewport.bDisplayHardwareMouseCursor = true; ClientViewport.bDisplayHardwareMouseCursor = true;
ClientViewport.ForceUpdateMouseCursor(TRUE); ClientViewport.ForceUpdateMouseCursor(TRUE);
@ -89,7 +89,7 @@ simulated function RenderMenu(Canvas C)
ClipX = C.ClipX; ClipX = C.ClipX;
ClipY = C.ClipY; 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].bWindowFocused = (i==0);
ActiveMenus[i].InputPos[0] = 0.f; ActiveMenus[i].InputPos[0] = 0.f;
@ -99,7 +99,7 @@ simulated function RenderMenu(Canvas C)
ActiveMenus[i].Canvas = C; ActiveMenus[i].Canvas = C;
ActiveMenus[i].PreDraw(); ActiveMenus[i].PreDraw();
} }
if(InputFocus!=None && InputFocus.bFocusedPostDrawItem) if (InputFocus!=None && InputFocus.bFocusedPostDrawItem)
{ {
InputFocus.InputPos[0] = 0.f; InputFocus.InputPos[0] = 0.f;
InputFocus.InputPos[1] = 0.f; InputFocus.InputPos[1] = 0.f;
@ -111,26 +111,26 @@ simulated function RenderMenu(Canvas C)
C.SetOrigin(OrgX,OrgY); C.SetOrigin(OrgX,OrgY);
C.SetClip(ClipX,ClipY); C.SetClip(ClipX,ClipY);
if(OrgConsole!=None) if (OrgConsole!=None)
OrgConsole.PostRender_Console(C); OrgConsole.PostRender_Console(C);
OrgConsole = None; OrgConsole = None;
} }
simulated final function SetMenuState(bool bActive) simulated final function SetMenuState(bool bActive)
{ {
if(PlayerOwner.PlayerInput==None) if (PlayerOwner.PlayerInput==None)
{ {
NotifyLevelChange(); NotifyLevelChange();
bActive = false; bActive = false;
} }
if(bIsInMenuState==bActive) if (bIsInMenuState==bActive)
return; return;
bIsInMenuState = bActive; bIsInMenuState = bActive;
if(bActive) if (bActive)
{ {
if(CustomInput==None) if (CustomInput==None)
{ {
CustomInput = new (KFPlayerController(PlayerOwner)) class'KF2GUIInput'; CustomInput = new (KFPlayerController(PlayerOwner)) class'KF2GUIInput';
CustomInput.ControllerOwner = Self; CustomInput.ControllerOwner = Self;
@ -146,7 +146,7 @@ simulated final function SetMenuState(bool bActive)
} }
else else
{ {
if(BackupInput!=None) if (BackupInput!=None)
{ {
PlayerOwner.PlayerInput = BackupInput; PlayerOwner.PlayerInput = BackupInput;
BackupInput.OnReceivedNativeInputKey = BackupInput.OnReceivedNativeInputKey; BackupInput.OnReceivedNativeInputKey = BackupInput.OnReceivedNativeInputKey;
@ -162,19 +162,19 @@ simulated function NotifyLevelChange()
{ {
local int i; local int i;
if(bIsInvalid) if (bIsInvalid)
return; return;
bIsInvalid = true; bIsInvalid = true;
if(InputFocus!=None) if (InputFocus!=None)
{ {
InputFocus.LostInputFocus(); InputFocus.LostInputFocus();
InputFocus = None; InputFocus = None;
} }
for(i=(ActiveMenus.Length-1); i>=0; --i) for (i=(ActiveMenus.Length-1); i>=0; --i)
ActiveMenus[i].NotifyLevelChange(); ActiveMenus[i].NotifyLevelChange();
for(i=(PersistentMenus.Length-1); i>=0; --i) for (i=(PersistentMenus.Length-1); i>=0; --i)
PersistentMenus[i].NotifyLevelChange(); PersistentMenus[i].NotifyLevelChange();
SetMenuState(false); SetMenuState(false);
@ -184,36 +184,36 @@ simulated function MenuInput(float DeltaTime)
{ {
local int i; local int i;
if(PlayerOwner.PlayerInput==None) if (PlayerOwner.PlayerInput==None)
{ {
NotifyLevelChange(); NotifyLevelChange();
return; return;
} }
if(InputFocus!=None) if (InputFocus!=None)
InputFocus.MenuTick(DeltaTime); InputFocus.MenuTick(DeltaTime);
for(i=0; i<ActiveMenus.Length; ++i) for (i=0; i<ActiveMenus.Length; ++i)
ActiveMenus[i].MenuTick(DeltaTime); ActiveMenus[i].MenuTick(DeltaTime);
// Check idle. // 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; bMouseWasIdle = false;
if(InputFocus!=None) if (InputFocus!=None)
InputFocus.InputMouseMoved(); InputFocus.InputMouseMoved();
} }
OldMousePos = MousePosition; OldMousePos = MousePosition;
MousePauseTime = 0.f; MousePauseTime = 0.f;
} }
else if(!bMouseWasIdle && (MousePauseTime+=DeltaTime)>0.5f) else if (!bMouseWasIdle && (MousePauseTime+=DeltaTime)>0.5f)
{ {
bMouseWasIdle = true; bMouseWasIdle = true;
if(MouseFocus!=None) if (MouseFocus!=None)
MouseFocus.NotifyMousePaused(); MouseFocus.NotifyMousePaused();
} }
if(ActiveMenus.Length>0) if (ActiveMenus.Length>0)
MenuTime+=DeltaTime; MenuTime+=DeltaTime;
} }
@ -227,15 +227,15 @@ simulated function MouseMove(float MouseX, float MouseY)
MousePosition.Y = Clamp(MouseY, 0, ScreenSize.Y); MousePosition.Y = Clamp(MouseY, 0, ScreenSize.Y);
// Capture mouse for GUI // Capture mouse for GUI
if(InputFocus!=None && InputFocus.bCanFocus) if (InputFocus!=None && InputFocus.bCanFocus)
{ {
if(InputFocus.CaptureMouse()) if (InputFocus.CaptureMouse())
{ {
F = InputFocus.GetMouseFocus(); F = InputFocus.GetMouseFocus();
if(F!=MouseFocus) if (F!=MouseFocus)
{ {
MousePauseTime = 0; MousePauseTime = 0;
if(MouseFocus!=None) if (MouseFocus!=None)
MouseFocus.MouseLeave(); MouseFocus.MouseLeave();
MouseFocus = F; MouseFocus = F;
F.MouseEnter(); F.MouseEnter();
@ -245,32 +245,32 @@ simulated function MouseMove(float MouseX, float MouseY)
} }
else 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(); F = ActiveMenus[i].GetMouseFocus();
if(F!=MouseFocus) if (F!=MouseFocus)
{ {
MousePauseTime = 0; MousePauseTime = 0;
if(MouseFocus!=None) if (MouseFocus!=None)
MouseFocus.MouseLeave(); MouseFocus.MouseLeave();
MouseFocus = F; MouseFocus = F;
F.MouseEnter(); F.MouseEnter();
} }
break; 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; i = ActiveMenus.Length;
break; break;
} }
} }
} }
if(MouseFocus!=None && i==ActiveMenus.Length) // Hovering over nothing. if (MouseFocus!=None && i==ActiveMenus.Length) // Hovering over nothing.
{ {
MousePauseTime = 0; MousePauseTime = 0;
if(MouseFocus!=None) if (MouseFocus!=None)
MouseFocus.MouseLeave(); MouseFocus.MouseLeave();
MouseFocus = None; MouseFocus = None;
} }
@ -280,8 +280,8 @@ simulated final function int GetFreeIndex(bool bNewAlwaysTop) // Find first allo
{ {
local int i; local int i;
for(i=0; i<ActiveMenus.Length; ++i) for (i=0; i<ActiveMenus.Length; ++i)
if(bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop) if (bNewAlwaysTop || !ActiveMenus[i].bAlwaysTop)
{ {
ActiveMenus.Insert(i,1); ActiveMenus.Insert(i,1);
return i; return i;
@ -295,12 +295,12 @@ simulated function KFGUI_Page OpenMenu(class<KFGUI_Page> MenuClass)
local int i; local int i;
local KFGUI_Page M; local KFGUI_Page M;
if(MenuClass==None) if (MenuClass==None)
return None; return None;
if(KeyboardFocus!=None) if (KeyboardFocus!=None)
GrabInputFocus(None); GrabInputFocus(None);
if(InputFocus!=None) if (InputFocus!=None)
{ {
InputFocus.LostInputFocus(); InputFocus.LostInputFocus();
InputFocus = None; InputFocus = None;
@ -310,12 +310,12 @@ simulated function KFGUI_Page OpenMenu(class<KFGUI_Page> MenuClass)
SetMenuState(true); SetMenuState(true);
// Check if should use pre-excisting menu. // Check if should use pre-excisting menu.
if(MenuClass.Default.bUnique) if (MenuClass.Default.bUnique)
{ {
for(i=0; i<ActiveMenus.Length; ++i) for (i=0; i<ActiveMenus.Length; ++i)
if(ActiveMenus[i].Class==MenuClass) 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]; M = ActiveMenus[i];
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i,1);
@ -325,10 +325,10 @@ simulated function KFGUI_Page OpenMenu(class<KFGUI_Page> MenuClass)
return M; return M;
} }
if(MenuClass.Default.bPersistant) if (MenuClass.Default.bPersistant)
{ {
for(i=0; i<PersistentMenus.Length; ++i) for (i=0; i<PersistentMenus.Length; ++i)
if(PersistentMenus[i].Class==MenuClass) if (PersistentMenus[i].Class==MenuClass)
{ {
M = PersistentMenus[i]; M = PersistentMenus[i];
PersistentMenus.Remove(i,1); PersistentMenus.Remove(i,1);
@ -341,7 +341,7 @@ simulated function KFGUI_Page OpenMenu(class<KFGUI_Page> MenuClass)
} }
M = New(None)MenuClass; M = New(None)MenuClass;
if(M==None) // Probably abstract class. if (M==None) // Probably abstract class.
return None; return None;
i = GetFreeIndex(M.bAlwaysTop); i = GetFreeIndex(M.bAlwaysTop);
@ -356,28 +356,28 @@ simulated function CloseMenu(class<KFGUI_Page> MenuClass, optional bool bCloseAl
local int i; local int i;
local KFGUI_Page M; local KFGUI_Page M;
if(!bCloseAll && MenuClass==None) if (!bCloseAll && MenuClass==None)
return; return;
if(KeyboardFocus!=None) if (KeyboardFocus!=None)
GrabInputFocus(None); GrabInputFocus(None);
if(InputFocus!=None) if (InputFocus!=None)
{ {
InputFocus.LostInputFocus(); InputFocus.LostInputFocus();
InputFocus = None; InputFocus = None;
} }
for(i=(ActiveMenus.Length-1); i>=0; --i) for (i=(ActiveMenus.Length-1); i>=0; --i)
if(bCloseAll || ActiveMenus[i].Class==MenuClass) if (bCloseAll || ActiveMenus[i].Class==MenuClass)
{ {
M = ActiveMenus[i]; M = ActiveMenus[i];
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i,1);
M.CloseMenu(); M.CloseMenu();
// Cache menu. // Cache menu.
if(M.bPersistant && M.bUnique) if (M.bPersistant && M.bUnique)
PersistentMenus[PersistentMenus.Length] = M; PersistentMenus[PersistentMenus.Length] = M;
} }
if(ActiveMenus.Length==0) if (ActiveMenus.Length==0)
SetMenuState(false); SetMenuState(false);
} }
simulated function PopCloseMenu(KFGUI_Base Item) simulated function PopCloseMenu(KFGUI_Base Item)
@ -385,46 +385,46 @@ simulated function PopCloseMenu(KFGUI_Base Item)
local int i; local int i;
local KFGUI_Page M; local KFGUI_Page M;
if(Item==None) if (Item==None)
return; return;
if(KeyboardFocus!=None) if (KeyboardFocus!=None)
GrabInputFocus(None); GrabInputFocus(None);
if(InputFocus!=None) if (InputFocus!=None)
{ {
InputFocus.LostInputFocus(); InputFocus.LostInputFocus();
InputFocus = None; InputFocus = None;
} }
for(i=(ActiveMenus.Length-1); i>=0; --i) for (i=(ActiveMenus.Length-1); i>=0; --i)
if(ActiveMenus[i]==Item) if (ActiveMenus[i]==Item)
{ {
M = ActiveMenus[i]; M = ActiveMenus[i];
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i,1);
M.CloseMenu(); M.CloseMenu();
// Cache menu. // Cache menu.
if(M.bPersistant && M.bUnique) if (M.bPersistant && M.bUnique)
PersistentMenus[PersistentMenus.Length] = M; PersistentMenus[PersistentMenus.Length] = M;
break; break;
} }
if(ActiveMenus.Length==0) if (ActiveMenus.Length==0)
SetMenuState(false); SetMenuState(false);
} }
simulated function BringMenuToFront(KFGUI_Page Page) simulated function BringMenuToFront(KFGUI_Page Page)
{ {
local int i; local int i;
if(ActiveMenus[0].bAlwaysTop && !Page.bAlwaysTop) if (ActiveMenus[0].bAlwaysTop && !Page.bAlwaysTop)
return; // Can't override this menu. return; // Can't override this menu.
// Try to remove from current position at stack. // Try to remove from current position at stack.
for(i=(ActiveMenus.Length-1); i>=0; --i) for (i=(ActiveMenus.Length-1); i>=0; --i)
if(ActiveMenus[i]==Page) if (ActiveMenus[i]==Page)
{ {
ActiveMenus.Remove(i,1); ActiveMenus.Remove(i,1);
break; break;
} }
if(i==-1) if (i==-1)
return; // Page isn't open. return; // Page isn't open.
// Put on front of stack. // Put on front of stack.
@ -435,25 +435,25 @@ simulated final function bool MenuIsOpen(optional class<KFGUI_Page> MenuClass)
{ {
local int i; local int i;
for(i=(ActiveMenus.Length-1); i>=0; --i) for (i=(ActiveMenus.Length-1); i>=0; --i)
if(MenuClass==None || ActiveMenus[i].Class==MenuClass) if (MenuClass==None || ActiveMenus[i].Class==MenuClass)
return true; return true;
return false; return false;
} }
simulated final function GrabInputFocus(KFGUI_Base Comp, optional bool bForce) simulated final function GrabInputFocus(KFGUI_Base Comp, optional bool bForce)
{ {
if(Comp==KeyboardFocus && !bForce) if (Comp==KeyboardFocus && !bForce)
return; return;
if(KeyboardFocus!=None) if (KeyboardFocus!=None)
KeyboardFocus.LostKeyFocus(); KeyboardFocus.LostKeyFocus();
if(Comp==None) if (Comp==None)
{ {
OnInputKey = InternalInputKey; OnInputKey = InternalInputKey;
OnReceivedInputChar = InternalReceivedInputChar; OnReceivedInputChar = InternalReceivedInputChar;
} }
else if(KeyboardFocus==None) else if (KeyboardFocus==None)
{ {
OnInputKey = Comp.NotifyInputKey; OnInputKey = Comp.NotifyInputKey;
OnReceivedInputChar = Comp.NotifyInputChar; OnReceivedInputChar = Comp.NotifyInputChar;
@ -467,17 +467,17 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight)
MousePauseTime = 0; MousePauseTime = 0;
if(bPressed) if (bPressed)
{ {
if(KeyboardFocus!=None && KeyboardFocus!=MouseFocus) if (KeyboardFocus!=None && KeyboardFocus!=MouseFocus)
{ {
GrabInputFocus(None); GrabInputFocus(None);
LastClickTimes[0] = 0; LastClickTimes[0] = 0;
LastClickTimes[1] = 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()); BringMenuToFront(MouseFocus.GetPageTop());
LastClickTimes[0] = 0; LastClickTimes[0] = 0;
@ -486,7 +486,7 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight)
else else
{ {
i = byte(bRight); 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; LastClickTimes[i] = 0;
MouseFocus.DoubleMouseClick(bRight); 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.LostInputFocus();
InputFocus = None; InputFocus = None;
@ -509,9 +509,9 @@ simulated final function GUI_InputMouse(bool bPressed, bool bRight)
} }
else else
{ {
if(InputFocus!=None) if (InputFocus!=None)
InputFocus.MouseRelease(bRight); InputFocus.MouseRelease(bRight);
else if(MouseFocus!=None) else if (MouseFocus!=None)
MouseFocus.MouseRelease(bRight); MouseFocus.MouseRelease(bRight);
} }
} }
@ -519,7 +519,7 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event)
{ {
if (Event == IE_Pressed) if (Event == IE_Pressed)
{ {
switch(Key) switch (Key)
{ {
case 'LeftMouseButton': case 'LeftMouseButton':
GUI_InputMouse(true,false); GUI_InputMouse(true,false);
@ -531,7 +531,7 @@ simulated final function bool CheckMouse(name Key, EInputEvent Event)
} }
else if (Event == IE_Released) else if (Event == IE_Released)
{ {
switch(Key) switch (Key)
{ {
case 'LeftMouseButton': case 'LeftMouseButton':
GUI_InputMouse(false,false); 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) simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent Event, optional float AmountDepressed=1.f, optional bool bGamepad)
{ {
if(!bIsInMenuState) if (!bIsInMenuState)
return false; 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': case 'Escape':
if(Event==IE_Pressed) if (Event==IE_Pressed)
ActiveMenus[0].UserPressedEsc(); // Pop top menu if possible. ActiveMenus[0].UserPressedEsc(); // Pop top menu if possible.
return true; return true;
case 'MouseScrollDown': case 'MouseScrollDown':
case 'MouseScrollUp': case 'MouseScrollUp':
if(Event==IE_Pressed && MouseFocus!=None) if (Event==IE_Pressed && MouseFocus!=None)
MouseFocus.ScrollMouseWheel(Key=='MouseScrollUp'); MouseFocus.ScrollMouseWheel(Key=='MouseScrollUp');
return true; return true;
} }
@ -567,7 +567,7 @@ simulated function bool ReceivedInputKey(int ControllerId, name Key, EInputEvent
} }
simulated function bool ReceivedInputChar(int ControllerId, string Unicode) simulated function bool ReceivedInputChar(int ControllerId, string Unicode)
{ {
if(!bIsInMenuState) if (!bIsInMenuState)
return false; return false;
return OnReceivedInputChar(ControllerId,Unicode); return OnReceivedInputChar(ControllerId,Unicode);
} }

View File

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

View File

@ -12,7 +12,7 @@ static function OpenMenuForClient(PlayerController PC, class<KFGUI_Page> Page)
foreach PC.ChildActors(class'KF2GUINetwork',G) foreach PC.ChildActors(class'KF2GUINetwork',G)
break; break;
if(G==None) if (G==None)
G = PC.Spawn(class'KF2GUINetwork',PC); G = PC.Spawn(class'KF2GUINetwork',PC);
G.ClientOpenMenu(Page); G.ClientOpenMenu(Page);
} }
@ -22,24 +22,24 @@ static function CloseMenuForClient(PlayerController PC, class<KFGUI_Page> Page,
foreach PC.ChildActors(class'KF2GUINetwork',G) foreach PC.ChildActors(class'KF2GUINetwork',G)
break; break;
if(G==None) if (G==None)
G = PC.Spawn(class'KF2GUINetwork',PC); G = PC.Spawn(class'KF2GUINetwork',PC);
G.ClientCloseMenu(Page,bCloseAll); G.ClientCloseMenu(Page,bCloseAll);
} }
simulated reliable client function ClientOpenMenu(class<KFGUI_Page> Page) simulated reliable client function ClientOpenMenu(class<KFGUI_Page> Page)
{ {
if(!bLocalClient) if (!bLocalClient)
return; return;
if(GUIController==None) if (GUIController==None)
GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner);
GUIController.OpenMenu(Page); GUIController.OpenMenu(Page);
} }
simulated reliable client function ClientCloseMenu(class<KFGUI_Page> Page, bool bCloseAll) simulated reliable client function ClientCloseMenu(class<KFGUI_Page> Page, bool bCloseAll)
{ {
if(!bLocalClient) if (!bLocalClient)
return; return;
if(GUIController==None) if (GUIController==None)
GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner);
GUIController.CloseMenu(Page,bCloseAll); GUIController.CloseMenu(Page,bCloseAll);
} }
@ -47,10 +47,10 @@ simulated reliable client function ClientCloseMenu(class<KFGUI_Page> Page, bool
simulated function PostBeginPlay() simulated function PostBeginPlay()
{ {
PlayerOwner = PlayerController(Owner); 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; bLocalClient = true;
if(PlayerOwner==None) if (PlayerOwner==None)
PlayerOwner = GetALocalPlayerController(); PlayerOwner = GetALocalPlayerController();
} }
} }

View File

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

View File

@ -71,7 +71,7 @@ simulated function PostBeginPlay()
KFPlayerOwner = KFPlayerController(Owner); KFPlayerOwner = KFPlayerController(Owner);
OnlineSub = class'GameEngine'.static.GetOnlineSubsystem(); OnlineSub = class'GameEngine'.static.GetOnlineSubsystem();
if(OnlineSub!=None) if (OnlineSub!=None)
{ {
OnlineSub.AddOnInventoryReadCompleteDelegate(SearchInventoryForNewItem); OnlineSub.AddOnInventoryReadCompleteDelegate(SearchInventoryForNewItem);
SetTimer(60,false,'SearchInventoryForNewItem'); SetTimer(60,false,'SearchInventoryForNewItem');
@ -86,17 +86,17 @@ simulated function Destroyed()
} }
simulated final function NotifyLevelChange(optional bool bMapswitch) simulated final function NotifyLevelChange(optional bool bMapswitch)
{ {
if(OnlineSub!=None) if (OnlineSub!=None)
{ {
OnlineSub.ClearOnInventoryReadCompleteDelegate(SearchInventoryForNewItem); OnlineSub.ClearOnInventoryReadCompleteDelegate(SearchInventoryForNewItem);
OnlineSub = None; OnlineSub = None;
} }
// Send to an empty stage to play the "waiting" game. // Send to an empty stage to play the "waiting" game.
if(bMapswitch) if (bMapswitch)
SetTimer(0.5,false,'PendingMapSwitch'); SetTimer(0.5,false,'PendingMapSwitch');
} }
simulated function PendingMapSwitch() simulated function PendingMapswitch ()
{ {
// Make sure we dont garbage collect the game: // Make sure we dont garbage collect the game:
class'MS_Game'.Static.SetReference(); class'MS_Game'.Static.SetReference();
@ -113,8 +113,8 @@ final function AddKillMessage(class<Pawn> Victim, int Value, PlayerReplicationIn
bDmg = (Type==2); bDmg = (Type==2);
bLcl = (Type==0); bLcl = (Type==0);
for(i=0; i<KillMessages.Length; ++i) 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)) 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].Counter+=Value;
KillMessages[i].MsgTime = WorldInfo.TimeSeconds; KillMessages[i].MsgTime = WorldInfo.TimeSeconds;
@ -141,17 +141,17 @@ final function AddDeathMessage(string S, string StrippedMsg)
} }
final function ShowProgressMsg(string S, optional bool bDis) final function ShowProgressMsg(string S, optional bool bDis)
{ {
if(S=="") if (S=="")
{ {
bShowProgress = false; bShowProgress = false;
return; return;
} }
bShowProgress = true; bShowProgress = true;
ParseStringIntoArray(S,ProgressLines,"|",false); ParseStringIntoArray(S,ProgressLines,"|",false);
if(!bProgressDC) if (!bProgressDC)
ProgressMsgTime = WorldInfo.TimeSeconds+4.f; ProgressMsgTime = WorldInfo.TimeSeconds+4.f;
bProgressDC = bDis; bProgressDC = bDis;
if(bDis) if (bDis)
{ {
LocalPlayer(KFPlayerOwner.Player).ViewportClient.ViewportConsole.OutputText(Repl(S,"|","\n")); 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 string S;
local class<KFPawn_Monster> KFM; local class<KFPawn_Monster> KFM;
if(Class<VSZombie>(Other)!=None) if (Class<VSZombie>(Other)!=None)
return Class<VSZombie>(Other).Default.ZombieName; return Class<VSZombie>(Other).Default.ZombieName;
KFM = class<KFPawn_Monster>(Other); 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"); return Localize("Zeds", string(KFM.default.LocalizationKey), "KFGame");
if(Other.Default.MenuName!="") if (Other.Default.MenuName!="")
return Other.Default.MenuName; return Other.Default.MenuName;
S = string(Other.Name); S = string(Other.Name);
if(Left(S,10)~="KFPawn_Zed") if (Left(S,10)~="KFPawn_Zed")
S = Mid(S,10); S = Mid(S,10);
else if(Left(S,7)~="KFPawn_") else if (Left(S,7)~="KFPawn_")
S = Mid(S,7); S = Mid(S,7);
S = Repl(S,"_"," "); S = Repl(S,"_"," ");
return S; return S;
} }
static final function string GetNameArticle(string S) static final function string GetNameArticle(string S)
{ {
switch(Caps(Left(S,1))) // Check if a vowel, then an. switch (Caps(Left(S,1))) // Check if a vowel, then an.
{ {
case "A": case "A":
case "E": case "E":
@ -195,10 +195,10 @@ static final function string StripMsgColors(string S)
{ {
local int i; local int i;
while(true) while (true)
{ {
i = InStr(S,Chr(6)); i = InStr(S,Chr(6));
if(i==-1) if (i==-1)
break; break;
S = Left(S,i)$Mid(S,i+2); S = Left(S,i)$Mid(S,i+2);
} }
@ -208,16 +208,16 @@ final function color GetMsgColor(bool bDamage, int Count)
{ {
local float T; local float T;
if(bDamage) if (bDamage)
{ {
if(Count>1500) if (Count>1500)
return MakeColor(148,0,0,255); return MakeColor(148,0,0,255);
else if(Count>1000) else if (Count>1000)
{ {
T = (Count-1000) / 500.f; T = (Count-1000) / 500.f;
return MakeColor(148,0,0,255)*T + MakeColor(255,0,0,255)*(1.f-T); 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; T = (Count-500) / 500.f;
return MakeColor(255,0,0,255)*T + MakeColor(255,255,0,255)*(1.f-T); 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; T = Count / 500.f;
return MakeColor(255,255,0,255)*T + MakeColor(0,255,0,255)*(1.f-T); 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); return MakeColor(255,0,0,255);
else if(Count>10) else if (Count>10)
{ {
T = (Count-10) / 10.f; T = (Count-10) / 10.f;
return MakeColor(148,0,0,255)*T + MakeColor(255,0,0,255)*(1.f-T); 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; T = (Count-5) / 5.f;
return MakeColor(255,0,0,255)*T + MakeColor(255,255,0,255)*(1.f-T); 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() event PostRender()
{ {
if(GUIController!=None && PlayerOwner.PlayerInput==None) if (GUIController!=None && PlayerOwner.PlayerInput==None)
GUIController.NotifyLevelChange(); GUIController.NotifyLevelChange();
if(KFGRI==None) if (KFGRI==None)
KFGRI = KFGameReplicationInfo(WorldInfo.GRI); KFGRI = KFGameReplicationInfo(WorldInfo.GRI);
if(GUIController==None || GUIController.bIsInvalid) if (GUIController==None || GUIController.bIsInvalid)
{ {
GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner); GUIController = Class'KF2GUIController'.Static.GetGUIController(PlayerOwner);
if(GUIController!=None) if (GUIController!=None)
GUIStyle = GUIController.CurrentStyle; GUIStyle = GUIController.CurrentStyle;
} }
GUIStyle.Canvas = Canvas; GUIStyle.Canvas = Canvas;
@ -266,41 +266,41 @@ event PostRender()
PLCameraDir = vector(PLCameraRot); PLCameraDir = vector(PLCameraRot);
PLCameraDot = (PLCameraDir Dot PLCameraLoc); PLCameraDot = (PLCameraDir Dot PLCameraLoc);
if(MyCurrentPet.Length>0) if (MyCurrentPet.Length>0)
DrawPetInfo(); DrawPetInfo();
if(EPRI==None) if (EPRI==None)
EPRI = ExtPlayerReplicationInfo(KFPlayerOwner.PlayerReplicationInfo); EPRI = ExtPlayerReplicationInfo(KFPlayerOwner.PlayerReplicationInfo);
else if(EPRI.RespawnCounter>0) else if (EPRI.RespawnCounter>0)
DrawRespawnCounter(); DrawRespawnCounter();
bMeAdmin = (EPRI!=None && EPRI.AdminType<=1); bMeAdmin = (EPRI!=None && EPRI.AdminType<=1);
if(KillMessages.Length>0) if (KillMessages.Length>0)
RenderKillMsg(); RenderKillMsg();
if(DeathMessages.Length>0) if (DeathMessages.Length>0)
RenderDMMessages(); RenderDMMessages();
if(NewItems.Length>0) if (NewItems.Length>0)
DrawItemsList(); DrawItemsList();
if(bShowProgress || PlayerOwner.Player==None) if (bShowProgress || PlayerOwner.Player==None)
{ {
if(ProgressMsgTime<WorldInfo.TimeSeconds) if (ProgressMsgTime<WorldInfo.TimeSeconds)
{ {
bShowProgress = false; bShowProgress = false;
if(PlayerOwner.Player==None) if (PlayerOwner.Player==None)
{ {
ShowProgressMsg("Downloading contents for next map, please wait...|Press [Escape] key to cancel connection!"); ShowProgressMsg("Downloading contents for next map, please wait...|Press [Escape] key to cancel connection!");
RenderProgress(); RenderProgress();
} }
else if(bProgressDC) else if (bProgressDC)
KFPlayerOwner.ConsoleCommand("Disconnect"); KFPlayerOwner.ConsoleCommand("Disconnect");
} }
else RenderProgress(); else RenderProgress();
} }
if(PlayerOwner.Player==None && OnlineSub!=None) if (PlayerOwner.Player==None && OnlineSub!=None)
NotifyLevelChange(); NotifyLevelChange();
} }
simulated function CancelConnection() simulated function CancelConnection()
{ {
if(!bConfirmDisconnect) if (!bConfirmDisconnect)
{ {
ShowProgressMsg("Are you sure you want to cancel connection?|Press [Escape] again to confirm..."); ShowProgressMsg("Are you sure you want to cancel connection?|Press [Escape] again to confirm...");
bConfirmDisconnect = true; bConfirmDisconnect = true;
@ -322,9 +322,9 @@ final function DrawRespawnCounter()
exec function SetShowScores(bool bNewValue) exec function SetShowScores(bool bNewValue)
{ {
bShowScores = bNewValue; bShowScores = bNewValue;
if(GUIController!=None) if (GUIController!=None)
{ {
if(bShowScores) if (bShowScores)
GUIController.OpenMenu(class'UI_Scoreboard_CD'); GUIController.OpenMenu(class'UI_Scoreboard_CD');
else GUIController.CloseMenu(class'UI_Scoreboard_CD'); else GUIController.CloseMenu(class'UI_Scoreboard_CD');
} }
@ -341,18 +341,18 @@ final function RenderKillMsg()
X = Canvas.ClipX*0.015; X = Canvas.ClipX*0.015;
Y = Canvas.ClipY*0.24; 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; T = WorldInfo.TimeSeconds-KillMessages[i].MsgTime;
if(T>6.f) if (T>6.f)
{ {
KillMessages.Remove(i--,1); KillMessages.Remove(i--,1);
continue; continue;
} }
if(KillMessages[i].bDamage) if (KillMessages[i].bDamage)
S = "-"$KillMessages[i].Counter$" HP "$KillMessages[i].Name; 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"); 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"); 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); Canvas.SetPos(X,Y);
@ -373,10 +373,10 @@ final function RenderDMMessages()
Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc); Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc);
Y = Canvas.ClipY*0.98; 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; T = WorldInfo.TimeSeconds-DeathMessages[i].MsgTime;
if(T>6.f) if (T>6.f)
{ {
DeathMessages.Remove(i--,1); DeathMessages.Remove(i--,1);
continue; continue;
@ -393,22 +393,22 @@ final function RenderDMMessages()
// Now strip text into color tag pieces. // Now strip text into color tag pieces.
S = DeathMessages[i].Msg; S = DeathMessages[i].Msg;
while(true) while (true)
{ {
Canvas.SetPos(X,Y); Canvas.SetPos(X,Y);
j = InStr(S,Chr(6)); j = InStr(S,Chr(6));
if(j==-1) if (j==-1)
{ {
Canvas.DrawText(S,,Sc,Sc); Canvas.DrawText(S,,Sc,Sc);
break; break;
} }
if(j>0) if (j>0)
{ {
Canvas.DrawText(Left(S,j),,Sc,Sc); Canvas.DrawText(Left(S,j),,Sc,Sc);
Canvas.TextSize(Left(S,j),XL,YL,Sc,Sc); Canvas.TextSize(Left(S,j),XL,YL,Sc,Sc);
X+=XL; X+=XL;
} }
switch(Mid(S,j+1,1)) switch (Mid(S,j+1,1))
{ {
case "O": // Blue victim color. case "O": // Blue victim color.
Canvas.SetDrawColor(32,32,255,a); Canvas.SetDrawColor(32,32,255,a);
@ -430,12 +430,12 @@ final function RenderProgress()
local int i; local int i;
Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc); Canvas.Font = GUIStyle.PickFont(GUIStyle.DefaultFontSize+1,Sc);
if(bProgressDC) if (bProgressDC)
Canvas.SetDrawColor(255,80,80,255); Canvas.SetDrawColor(255,80,80,255);
else Canvas.SetDrawColor(255,255,255,255); else Canvas.SetDrawColor(255,255,255,255);
Y = Canvas.ClipY*0.2; 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.TextSize(ProgressLines[i],XL,YL,Sc,Sc);
Canvas.SetPos((Canvas.ClipX-XL)*0.5,Y); Canvas.SetPos((Canvas.ClipX-XL)*0.5,Y);
@ -460,7 +460,7 @@ function DrawHUD()
local bool bSpec; local bool bSpec;
// Draw weapon HUD underneath everything else // 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); KFPlayerOwner.Pawn.Weapon.DrawHUD(self, Canvas);
} }
@ -468,32 +468,32 @@ function DrawHUD()
super.DrawHUD(); super.DrawHUD();
// Cache GRI // Cache GRI
if(KFGRI == none) if (KFGRI == none)
{ {
KFGRI = KFGameReplicationInfo(WorldInfo.GRI); KFGRI = KFGameReplicationInfo(WorldInfo.GRI);
} }
// Don't draw canvas HUD in cinematic mode // Don't draw canvas HUD in cinematic mode
if(KFPlayerOwner != none && KFPlayerOwner.bCinematicMode) if (KFPlayerOwner != none && KFPlayerOwner.bCinematicMode)
{ {
return; return;
} }
LocActor = KFPlayerOwner.ViewTarget != none ? KFPlayerOwner.ViewTarget : KFPlayerOwner; LocActor = KFPlayerOwner.ViewTarget != none ? KFPlayerOwner.ViewTarget : KFPlayerOwner;
// Draw the crosshair for casual mode // Draw the crosshair for casual mode
if(KFPlayerOwner != none && (bDrawCrosshair || bForceDrawCrosshair || KFPlayerOwner.GetTeamNum() == 255)) if (KFPlayerOwner != none && (bDrawCrosshair || bForceDrawCrosshair || KFPlayerOwner.GetTeamNum() == 255))
{ {
DrawCrosshair(); DrawCrosshair();
} }
// Friendly player status // Friendly player status
bSpec = (PlayerOwner.PlayerReplicationInfo!=None && PlayerOwner.PlayerReplicationInfo.bOnlySpectator); bSpec = (PlayerOwner.PlayerReplicationInfo!=None && PlayerOwner.PlayerReplicationInfo.bOnlySpectator);
if(bSpec || PlayerOwner.GetTeamNum()==0) if (bSpec || PlayerOwner.GetTeamNum()==0)
{ {
//Friendly player status //Friendly player status
if(!class'ExtPlayerController'.Default.bHideNameBeacons) if (!class'ExtPlayerController'.Default.bHideNameBeacons)
{ {
if(KFPlayerOwner != none) if (KFPlayerOwner != none)
{ {
KFPlayerOwner.GetPlayerViewPoint(ViewLocation, ViewRotation); KFPlayerOwner.GetPlayerViewPoint(ViewLocation, ViewRotation);
} }
@ -502,12 +502,12 @@ function DrawHUD()
Canvas.EnableStencilTest(true); Canvas.EnableStencilTest(true);
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFPH) 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)); 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); VisibleHumanPlayers.AddItem(KFPH.PlayerReplicationInfo);
} }
@ -536,7 +536,7 @@ function DrawHUD()
} }
} }
if(!KFGRI.bHidePawnIcons) if (!KFGRI.bHidePawnIcons)
{ {
// Draw hidden players // Draw hidden players
CheckAndDrawHiddenPlayerIcons(VisibleHumanPlayers, HiddenHumanPlayers); CheckAndDrawHiddenPlayerIcons(VisibleHumanPlayers, HiddenHumanPlayers);
@ -545,7 +545,7 @@ function DrawHUD()
CheckAndDrawRemainingZedIcons(); CheckAndDrawRemainingZedIcons();
//Draw our current objective location //Draw our current objective location
if(KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none) if (KFGRI.CurrentObjective != none && KFGRI.ObjectiveInterface != none)
{ {
KFGRI.ObjectiveInterface.DrawHUD(self, Canvas); KFGRI.ObjectiveInterface.DrawHUD(self, Canvas);
@ -564,7 +564,7 @@ function DrawHUD()
Canvas.EnableStencilTest(false); Canvas.EnableStencilTest(false);
} }
} }
else if(KFPawn_Monster(PlayerOwner.Pawn)!=None) else if (KFPawn_Monster(PlayerOwner.Pawn)!=None)
{ {
// Draw human health auras. // Draw human health auras.
DotScale = Canvas.ClipX*0.2f; DotScale = Canvas.ClipX*0.2f;
@ -572,19 +572,19 @@ function DrawHUD()
{ {
PawnLocation = KFPH.Location; PawnLocation = KFPH.Location;
if(IsZero(PawnLocation)) if (IsZero(PawnLocation))
{ {
continue; continue;
} }
ThisDot = (PLCameraDir Dot PawnLocation) - PLCameraDot; 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); 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; continue;
Canvas.DrawColor = GetHPColorScale(KFPH); Canvas.DrawColor = GetHPColorScale(KFPH);
if(PlayerOwner.FastTrace(PawnLocation,PLCameraLoc)) if (PlayerOwner.FastTrace(PawnLocation,PLCameraLoc))
ThisDot*=1.75f; ThisDot*=1.75f;
ThisDot = (DotScale/ThisDot)*350.f; ThisDot = (DotScale/ThisDot)*350.f;
Canvas.SetPos(V.X-ThisDot*0.25f,V.Y-ThisDot*0.5f); 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); Canvas.EnableStencilTest(true);
// Draw zed health bars. // Draw zed health bars.
foreach WorldInfo.AllPawns(class'KFPawn_Monster', M) foreach WorldInfo.AllPawns(class'KFPawn_Monster', M)
{ {
ThisDot = (PLCameraDir Dot (M.Location + M.CylinderComponent.CollisionHeight * vect(0,0,1))) - PLCameraDot; 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); DrawFriendlyHUDZ(M);
} }
Canvas.EnableStencilTest(false); Canvas.EnableStencilTest(false);
@ -611,14 +611,14 @@ simulated static final function color GetHPColorScale(Pawn P)
{ {
local color C; local color C;
if(P.Health<25) // Red if (P.Health<25) // Red
C.R = 255; 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.G = (P.Health-25) * 5.1f;
C.R = 255; C.R = 255;
} }
else if(P.Health<100) // Green -> Yellow else if (P.Health<100) // Green -> Yellow
{ {
C.G = 255; C.G = 255;
C.R = (100-P.Health) * 10.2f; 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; TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 1.2;
ScreenPos = Canvas.Project(TargetLocation); 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; return;
//Draw health bar //Draw health bar
@ -679,7 +679,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH)
ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale; ResModifier = WorldInfo.static.GetResolutionBasedHUDScale() * FriendlyHudScale;
KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo); KFPRI = ExtPlayerReplicationInfo(KFPH.PlayerReplicationInfo);
if(KFPRI == none) if (KFPRI == none)
{ {
return false; 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)); TargetLocation = KFPH.Mesh.GetPosition() + (KFPH.CylinderComponent.CollisionHeight * vect(0,0,2.5f));
ScreenPos = Canvas.Project(TargetLocation); 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; return false;
} }
@ -702,19 +702,19 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH)
// drop shadow for player name text // drop shadow for player name text
S = KFPRI.PlayerName; S = KFPRI.PlayerName;
if(KFPRI.bBot) if (KFPRI.bBot)
{ {
S = S$" (Bot)"; S = S$" (Bot)";
TextColor = KFPRI.HUDPerkColor; TextColor = KFPRI.HUDPerkColor;
} }
else if(KFPRI.ShowAdminName()) // Admin info. else if (KFPRI.ShowAdminName()) // Admin info.
{ {
S = S$" ("$KFPRI.GetAdminNameAbr()$")"; S = S$" ("$KFPRI.GetAdminNameAbr()$")";
TextColor = KFPRI.GetAdminColorC(); TextColor = KFPRI.GetAdminColorC();
} }
else TextColor = PlayerBarTextColor; else TextColor = PlayerBarTextColor;
if(bMeAdmin && KFPRI.FixedData>0) if (bMeAdmin && KFPRI.FixedData>0)
{ {
TextColor = MakeColor(255,0,0,255); TextColor = MakeColor(255,0,0,255);
S @= "-"$KFPRI.GetDesc(); S @= "-"$KFPRI.GetDesc();
@ -743,7 +743,7 @@ simulated function bool DrawFriendlyHumanPlayerInfo(KFPawn_Human KFPH)
CurrentHealthColor.A = FadeAlpha; CurrentHealthColor.A = FadeAlpha;
DrawPlayerInfoBar(KFPH, Percentage, BarLength, BarHeight, ScreenPos.X - (BarLength * 0.5f), ScreenPos.Y + BarHeight * 2 + (36 * FontScale * ResModifier), CurrentHealthColor, FadeAlpha, true); 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; return false;
} }
@ -800,7 +800,7 @@ simulated final function DrawPlayerInfoBar(KFPawn P, float BarPercentage, float
Canvas.SetPos(XPos, YPos); Canvas.SetPos(XPos, YPos);
Canvas.DrawTileStretched(PlayerStatusBarBGTexture, BarLength * BarPercentage, BarHeight, 0, 0, 32, 32); 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. // Draw to-regen bar.
XPos+=(BarLength * BarPercentage); XPos+=(BarLength * BarPercentage);
@ -887,7 +887,7 @@ simulated function DrawMonsterHUD(KFPawn KFPH)
local byte FadeAlpha; local byte FadeAlpha;
PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo); PRI = Ext_T_MonsterPRI(KFPH.PlayerReplicationInfo);
if(PRI==None) if (PRI==None)
return; return;
FadeAlpha = DrawToDistance(KFPH); FadeAlpha = DrawToDistance(KFPH);
@ -899,7 +899,7 @@ simulated function DrawMonsterHUD(KFPawn KFPH)
TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 0.8; TargetLocation = KFPH.Location + vect(0,0,1) * KFPH.GetCollisionHeight() * 0.8;
ScreenPos = Canvas.Project(TargetLocation); 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; return;
//Draw health bar //Draw health bar
@ -942,9 +942,9 @@ simulated function DrawPetInfo()
GUIStyle.DrawRectBox(X, Y + YS, BestPetXL * 1.04, YL * MyCurrentPet.Length, 4); GUIStyle.DrawRectBox(X, Y + YS, BestPetXL * 1.04, YL * MyCurrentPet.Length, 4);
Canvas.DrawColor = MakeColor(32,250,32,255); 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); MyCurrentPet.Remove(i--,1);
continue; continue;
@ -955,9 +955,9 @@ simulated function DrawPetInfo()
Canvas.SetPos(X,Y); Canvas.SetPos(X,Y);
Canvas.DrawText(S,,Sc,Sc); Canvas.DrawText(S,,Sc,Sc);
if(XL > BestPetXL) if (XL > BestPetXL)
BestPetXL = XL; BestPetXL = XL;
if(YL > BestPetYL) if (YL > BestPetYL)
BestPetYL = YL; BestPetYL = YL;
} }
} }
@ -1019,7 +1019,7 @@ final function AddNumberMsg(int Amount, vector Pos, byte Type)
} }
DamagePopups[NextDamagePopupIndex].FontColor = C; DamagePopups[NextDamagePopupIndex].FontColor = C;
if(++NextDamagePopupIndex >= DAMAGEPOPUP_COUNT) if (++NextDamagePopupIndex >= DAMAGEPOPUP_COUNT)
NextDamagePopupIndex=0; NextDamagePopupIndex=0;
} }
@ -1039,14 +1039,14 @@ final function DrawDamage()
KFPlayerController(Owner).GetPlayerViewPoint(CameraLocation, CameraRotation); KFPlayerController(Owner).GetPlayerViewPoint(CameraLocation, CameraRotation);
CamDir = vector(CameraRotation); CamDir = vector(CameraRotation);
for(i=0; i < DAMAGEPOPUP_COUNT ; i++) for (i=0; i < DAMAGEPOPUP_COUNT ; i++)
{ {
TimeSinceHit = WorldInfo.TimeSeconds - DamagePopups[i].HitTime; 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 || (Normal(DamagePopups[i].HitLocation - CameraLocation) dot Normal(CamDir) < 0.1)) //don't draw if player faced back to the hit location
continue; continue;
switch(DamagePopups[i].Type) switch (DamagePopups[i].Type)
{ {
case 0: // Pawn damage. case 0: // Pawn damage.
S = "-"$string(DamagePopups[i].Damage); S = "-"$string(DamagePopups[i].Damage);
@ -1087,18 +1087,18 @@ simulated function SearchInventoryForNewItem()
{ {
local int i,j; local int i,j;
if(WasNewlyAdded.Length!=OnlineSub.CurrentInventory.Length) if (WasNewlyAdded.Length!=OnlineSub.CurrentInventory.Length)
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; WasNewlyAdded[i] = 1;
if(WorldInfo.TimeSeconds<80.f || !bLoadedInitItems) // Skip initial inventory. if (WorldInfo.TimeSeconds<80.f || !bLoadedInitItems) // Skip initial inventory.
continue; continue;
j = OnlineSub.ItemPropertiesList.Find('Definition', OnlineSub.CurrentInventory[i].Definition); j = OnlineSub.ItemPropertiesList.Find('Definition', OnlineSub.CurrentInventory[i].Definition);
if(j != INDEX_NONE) if (j != INDEX_NONE)
{ {
NewItems.Insert(0,1); NewItems.Insert(0,1);
NewItems[0].Icon = Texture2D(DynamicLoadObject(OnlineSub.ItemPropertiesList[j].IconURL,Class'Texture2D')); 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) simulated final function string RarityStr(byte R)
{ {
switch(R) switch (R)
{ {
case ITR_Common: return "Common"; case ITR_Common: return "Common";
case ITR_Uncommon: return "Uncommon +"; case ITR_Uncommon: return "Uncommon +";
@ -1136,15 +1136,15 @@ simulated final function DrawItemsList()
YPos = Canvas.ClipY*0.82 - YSize; YPos = Canvas.ClipY*0.82 - YSize;
XPos = Canvas.ClipX - YSize*0.15; 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; T = WorldInfo.TimeSeconds-NewItems[i].MsgTime;
if(T>=10.f) if (T>=10.f)
{ {
NewItems.Remove(i--,1); NewItems.Remove(i--,1);
continue; continue;
} }
if(T>9.f) if (T>9.f)
{ {
T = 255.f * (10.f-T); T = 255.f * (10.f-T);
Canvas.SetDrawColor(255,255,255,T); Canvas.SetDrawColor(255,255,255,T);
@ -1153,7 +1153,7 @@ simulated final function DrawItemsList()
Canvas.TextSize(NewItems[i].Item,XS,YS,FontScale,FontScale); 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.SetPos(XPos-YSize,YPos);
Canvas.DrawRect(YSize,YSize,NewItems[i].Icon); Canvas.DrawRect(YSize,YSize,NewItems[i].Icon);
@ -1172,7 +1172,7 @@ simulated final function DrawItemsList()
simulated function CheckForItems() simulated function CheckForItems()
{ {
if(KFGameReplicationInfo(WorldInfo.GRI)!=none) if (KFGameReplicationInfo(WorldInfo.GRI)!=none)
KFGameReplicationInfo(WorldInfo.GRI).ProcessChanceDrop(); KFGameReplicationInfo(WorldInfo.GRI).ProcessChanceDrop();
SetTimer(260+FRand()*220.f,false,'CheckForItems'); SetTimer(260+FRand()*220.f,false,'CheckForItems');
} }

View File

@ -48,9 +48,9 @@ function CloseMenu(); // Menu was closed.
function MenuTick(float DeltaTime) function MenuTick(float DeltaTime)
{ {
if(bTimerActive && (TimerCounter-=DeltaTime)<=0.f) if (bTimerActive && (TimerCounter-=DeltaTime)<=0.f)
{ {
if(bLoopTimer) if (bLoopTimer)
TimerCounter = TimerRate; TimerCounter = TimerRate;
else bTimerActive = false; else bTimerActive = false;
Timer(); Timer();
@ -59,7 +59,7 @@ function MenuTick(float DeltaTime)
final function SetTimer(float Rate, optional bool bLoop) final function SetTimer(float Rate, optional bool bLoop)
{ {
bTimerActive = (Rate>0.f); bTimerActive = (Rate>0.f);
if(bTimerActive) if (bTimerActive)
{ {
bLoopTimer = bLoop; bLoopTimer = bLoop;
TimerRate = Rate; TimerRate = Rate;
@ -116,14 +116,14 @@ final function KFGUI_Base GetMouseFocus()
{ {
local KFGUI_Base M; local KFGUI_Base M;
for(M=Self; M.MouseArea!=None; M=M.MouseArea) for (M=Self; M.MouseArea!=None; M=M.MouseArea)
{} {}
return M; return M;
} }
function DoClose() function DoClose()
{ {
if(ParentComponent!=None) if (ParentComponent!=None)
ParentComponent.DoClose(); ParentComponent.DoClose();
else Owner.PopCloseMenu(Self); else Owner.PopCloseMenu(Self);
} }
@ -135,13 +135,13 @@ function byte GetCursorStyle()
function UserPressedEsc() // user pressed escape while this menu was active. function UserPressedEsc() // user pressed escape while this menu was active.
{ {
if(ParentComponent!=None) if (ParentComponent!=None)
ParentComponent.UserPressedEsc(); ParentComponent.UserPressedEsc();
else DoClose(); else DoClose();
} }
function bool BringPageToFront() function bool BringPageToFront()
{ {
if(ParentComponent!=None) if (ParentComponent!=None)
return ParentComponent.BringPageToFront(); return ParentComponent.BringPageToFront();
return true; // Allow user to bring this page to front. return true; // Allow user to bring this page to front.
} }
@ -153,32 +153,32 @@ final function KFGUI_Page GetPageTop()
{ {
local KFGUI_Base M; 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); return KFGUI_Page(M);
} }
function KFGUI_Base FindComponentID(name InID) function KFGUI_Base FindComponentID(name InID)
{ {
if(ID==InID) if (ID==InID)
return Self; return Self;
return None; return None;
} }
function FindAllComponentID(name InID, out array<KFGUI_Base> Res) function FindAllComponentID(name InID, out array<KFGUI_Base> Res)
{ {
if(ID==InID) if (ID==InID)
Res[Res.Length] = Self; Res[Res.Length] = Self;
} }
function RemoveComponent(KFGUI_Base B); function RemoveComponent(KFGUI_Base B);
function GetInputFocus() function GetInputFocus()
{ {
if(Owner.InputFocus!=None) if (Owner.InputFocus!=None)
Owner.InputFocus.LostInputFocus(); Owner.InputFocus.LostInputFocus();
Owner.InputFocus = Self; Owner.InputFocus = Self;
} }
function DropInputFocus() function DropInputFocus()
{ {
if(Owner.InputFocus==Self) if (Owner.InputFocus==Self)
{ {
Owner.InputFocus.LostInputFocus(); Owner.InputFocus.LostInputFocus();
Owner.InputFocus = None; Owner.InputFocus = None;
@ -193,7 +193,7 @@ final function GrabKeyFocus()
} }
final function ReleaseKeyFocus() final function ReleaseKeyFocus()
{ {
if(Owner.KeyboardFocus==Self) if (Owner.KeyboardFocus==Self)
Owner.GrabInputFocus(None); Owner.GrabInputFocus(None);
} }
function LostKeyFocus(); function LostKeyFocus();
@ -228,7 +228,7 @@ simulated final function PlayMenuSound(EMenuSound Slot)
{ {
/*local SoundCue S; /*local SoundCue S;
switch(Slot) switch (Slot)
{ {
case MN_Focus: case MN_Focus:
S = SoundCue'a_interface.menu.UT3MenuMouseOverCue'; S = SoundCue'a_interface.menu.UT3MenuMouseOverCue';
@ -252,7 +252,7 @@ simulated final function PlayMenuSound(EMenuSound Slot)
S = SoundCue'a_interface.menu.UT3MenuNavigateUpCue'; S = SoundCue'a_interface.menu.UT3MenuNavigateUpCue';
break; break;
} }
if(S!=None) if (S!=None)
GetPlayer().PlaySound(S,true,,false);*/ GetPlayer().PlaySound(S,true,,false);*/
} }
@ -275,7 +275,7 @@ static final function string MakeSortStr(int Value)
// Prefix with zeroes to properly sort this string. // Prefix with zeroes to properly sort this string.
S = string(Value); S = string(Value);
i = Len(S); i = Len(S);
if(i<10) if (i<10)
return Mid("0000000000",i)$S; return Mid("0000000000",i)$S;
return S; return S;
} }

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