style: brackets

This commit is contained in:
GenZmeY 2020-11-28 23:04:55 +03:00
parent 63b031b111
commit ee260f7a10
211 changed files with 3797 additions and 3797 deletions

View File

@ -24,10 +24,10 @@ function DoAutoPurchase()
GetTraderItems();
EP = GetExtPerk();
if( EP==None || EP.AutoBuyLoadOutPath.length == 0)
if(EP==None || EP.AutoBuyLoadOutPath.length == 0)
return;
for( i = 0; i<EP.AutoBuyLoadOutPath.length; i++ )
for(i = 0; i<EP.AutoBuyLoadOutPath.length; i++)
{
ItemIndex = TraderItems.SaleItems.Find('WeaponDef', EP.AutoBuyLoadOutPath[i]);
if(ItemIndex != INDEX_NONE)
@ -38,7 +38,7 @@ function DoAutoPurchase()
TopTierWeapon = GetTopTierWeapon(OnPerkWeapons);
//can I afford my top teir without selling my current weapon?
if(!DoIOwnThisWeapon(TopTierWeapon) && GetCanAfford( GetAdjustedBuyPriceFor(TopTierWeapon) + DoshBuffer ) && CanCarry( TopTierWeapon ) )
if(!DoIOwnThisWeapon(TopTierWeapon) && GetCanAfford(GetAdjustedBuyPriceFor(TopTierWeapon) + DoshBuffer) && CanCarry(TopTierWeapon))
{
bUpgradeSuccess = AttemptUpgrade(TotalDosh, OnPerkWeapons, true);
}
@ -80,7 +80,7 @@ function DoAutoPurchase()
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;
Perk = GetBasePerk();
if( Perk!=None )
if(Perk!=None)
{
for (i = 0; i < OwnedItemList.length; i++)
{
if( OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(Perk)!=INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1)
if(OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(Perk)!=INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1)
{
SellWeapon(OwnedItemList[i], i);
i=-1;
@ -112,7 +112,7 @@ function SellOffPerkWeapons()
for (i = 0; i < OwnedItemList.length; i++)
{
if( OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(EP.BasePerk)==INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1 && OwnedItemList[i].SellPrice != 0 )
if(OwnedItemList[i].DefaultItem.AssociatedPerkClasses.Find(EP.BasePerk)==INDEX_NONE && OwnedItemList[i].DefaultItem.BlocksRequired != -1 && OwnedItemList[i].SellPrice != 0)
{
if(EP.AutoBuyLoadOutPath.Find(OwnedItemList[i].DefaultItem.WeaponDef) == INDEX_NONE)
{
@ -133,10 +133,10 @@ function InitializeOwnedItemList()
EP = GetExtPerk();
OwnedItemList.length = 0;
TraderItems = KFGameReplicationInfo( WorldInfo.GRI ).TraderItems;
TraderItems = KFGameReplicationInfo(WorldInfo.GRI).TraderItems;
KFP = KFPawn_Human( Pawn );
if( KFP != none )
KFP = KFPawn_Human(Pawn);
if(KFP != none)
{
// init armor purchase values
ArmorItem.SpareAmmoCount = KFP.Armor;
@ -153,13 +153,13 @@ function InitializeOwnedItemList()
// @temp: fill in stuff that is normally serialized in the archetype
GrenadeItem.DefaultItem.AssociatedPerkClasses[0] = CurrentPerk.Class;
for ( Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory )
for (Inv = MyKFIM.InventoryChain; Inv != none; Inv = Inv.Inventory)
{
KFW = KFWeapon( Inv );
if( KFW != none )
KFW = KFWeapon(Inv);
if(KFW != none)
{
// Set the weapon information and add it to the OwnedItemList
SetWeaponInformation( KFW );
SetWeaponInformation(KFW);
}
}
@ -170,7 +170,7 @@ function InitializeOwnedItemList()
}
}
function int AddItemByPriority( out SItemInformation WeaponInfo )
function int AddItemByPriority(out SItemInformation WeaponInfo)
{
local byte i;
local byte WeaponGroup, WeaponPriority;
@ -183,23 +183,23 @@ function int AddItemByPriority( out SItemInformation WeaponInfo )
WeaponGroup = WeaponInfo.DefaultItem.InventoryGroup;
WeaponPriority = WeaponInfo.DefaultItem.GroupPriority;
for( i = 0; i < OwnedItemList.length; i++ )
for(i = 0; i < OwnedItemList.length; i++)
{
// If the weapon belongs in the group prior to the current weapon, we've found the spot
if( WeaponGroup < OwnedItemList[i].DefaultItem.InventoryGroup )
if(WeaponGroup < OwnedItemList[i].DefaultItem.InventoryGroup)
{
BestIndex = i;
break;
}
else if( WeaponGroup == OwnedItemList[i].DefaultItem.InventoryGroup )
else if(WeaponGroup == OwnedItemList[i].DefaultItem.InventoryGroup)
{
if( WeaponPriority > OwnedItemList[i].DefaultItem.GroupPriority )
if(WeaponPriority > OwnedItemList[i].DefaultItem.GroupPriority)
{
// if the weapon is in the same group but has a higher priority, we've found the spot
BestIndex = i;
break;
}
else if( WeaponPriority == OwnedItemList[i].DefaultItem.GroupPriority && WeaponInfo.DefaultItem.AssociatedPerkClasses.Find(Perk)>=0 )
else if(WeaponPriority == OwnedItemList[i].DefaultItem.GroupPriority && WeaponInfo.DefaultItem.AssociatedPerkClasses.Find(Perk)>=0)
{
// if the weapons have the same priority give the slot to the on perk weapon
BestIndex = i;
@ -212,17 +212,17 @@ function int AddItemByPriority( out SItemInformation WeaponInfo )
BestIndex = i + 1;
}
}
OwnedItemList.InsertItem( BestIndex, WeaponInfo );
OwnedItemList.InsertItem(BestIndex, WeaponInfo);
// Add secondary ammo immediately after the main weapon
if( WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo() )
if(WeaponInfo.DefaultItem.WeaponDef.static.UsesSecondaryAmmo())
{
WeaponInfo.bIsSecondaryAmmo = true;
WeaponInfo.SellPrice = 0;
OwnedItemList.InsertItem( BestIndex + 1, WeaponInfo );
OwnedItemList.InsertItem(BestIndex + 1, WeaponInfo);
}
if( MyGfxManager != none && MyGfxManager.TraderMenu != none )
if(MyGfxManager != none && MyGfxManager.TraderMenu != none)
{
MyGfxManager.TraderMenu.OwnedItemList = OwnedItemList;
}

View File

@ -9,7 +9,7 @@ final function FMyCustomChar LoadData()
{
local FMyCustomChar R;
if( HasInit==0 )
if(HasInit==0)
{
AttachmentMesh0 = 255;
AttachmentMesh1 = 255;
@ -27,7 +27,7 @@ final function FMyCustomChar LoadData()
R.AttachmentSkinIndices[2] = AttachmentSkin2;
return R;
}
final function SaveData( FMyCustomChar R )
final function SaveData(FMyCustomChar R)
{
HeadMeshIndex = R.HeadMeshIndex;
HeadSkinIndex = R.HeadSkinIndex;

View File

@ -3,32 +3,32 @@ class ExtCharacterInfo extends Object
abstract;
// Hack fix for not being able to compile materials in run-time.
static final function CloneMIC( MaterialInstanceConstant B )
static final function CloneMIC(MaterialInstanceConstant B)
{
local int i;
local MaterialInstanceConstant M;
local LinearColor C;
M = MaterialInstanceConstant(B.Parent);
if( M==None )
if(M==None)
return;
B.SetParent(M.Parent);
for( i=0; i<M.TextureParameterValues.Length; ++i )
if( M.TextureParameterValues[i].ParameterValue!=None )
for(i=0; i<M.TextureParameterValues.Length; ++i)
if(M.TextureParameterValues[i].ParameterValue!=None)
B.SetTextureParameterValue(M.TextureParameterValues[i].ParameterName,M.TextureParameterValues[i].ParameterValue);
for( i=0; i<M.ScalarParameterValues.Length; ++i )
for(i=0; i<M.ScalarParameterValues.Length; ++i)
B.SetScalarParameterValue(M.ScalarParameterValues[i].ParameterName,M.ScalarParameterValues[i].ParameterValue);
for( i=0; i<M.VectorParameterValues.Length; ++i )
for(i=0; i<M.VectorParameterValues.Length; ++i)
{
C = M.VectorParameterValues[i].ParameterValue;
B.SetVectorParameterValue(M.VectorParameterValues[i].ParameterName,C);
}
}
static final function Object SafeLoadObject( string S, Class ObjClass )
static final function Object SafeLoadObject(string S, Class ObjClass)
{
local Object O;
@ -40,7 +40,7 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
{
local int i;
if( P.WorldInfo.NetMode == NM_DedicatedServer )
if(P.WorldInfo.NetMode == NM_DedicatedServer)
{
return;
}
@ -48,18 +48,18 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
P.CharacterMICs.Remove(0, P.CharacterMICs.Length);
// body MIC
if ( P.Mesh != None )
if (P.Mesh != None)
{
P.CharacterMICs[0] = P.Mesh.CreateAndSetMaterialInstanceConstant(C.BodyMaterialID);
CloneMIC(P.CharacterMICs[0]);
}
// head MIC
if( P.ThirdPersonHeadMeshComponent != None )
if(P.ThirdPersonHeadMeshComponent != None)
{
P.CharacterMICs[1] = P.ThirdPersonHeadMeshComponent.CreateAndSetMaterialInstanceConstant(C.HeadMaterialID);
if ( bMaskHead )
if (bMaskHead)
{
// initial mask for new head MIC (also see ResetHeadMaskParam())
P.CharacterMICs[1].SetScalarParameterValue('Scalar_Mask', 1.f);
@ -67,9 +67,9 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
}
// attachment MIC
for( i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++ )
for(i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++)
{
if( P.ThirdPersonAttachments[i] != none )
if(P.ThirdPersonAttachments[i] != none)
{
P.CharacterMICs.AddItem(P.ThirdPersonAttachments[i].CreateAndSetMaterialInstanceConstant(0));
}
@ -82,13 +82,13 @@ static function InitCharacterMICs(KFCharacterInfo_Human C, KFPawn P, optional bo
}
/** Sets the pawns character mesh from it's CharacterInfo, and updates instance of player in map if there is one. */
static final function SetCharacterMeshFromArch( KFCharacterInfo_Human C, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI )
static final function SetCharacterMeshFromArch(KFCharacterInfo_Human C, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI)
{
local ExtPlayerReplicationInfo EPRI;
local int AttachmentIdx, CosmeticMeshIdx;
local bool bMaskHeadMesh, bCustom;
if ( KFPRI == none )
if (KFPRI == none)
{
`Warn("Does not have a KFPRI" @ C);
return;
@ -111,21 +111,21 @@ static final function SetCharacterMeshFromArch( KFCharacterInfo_Human C, KFPawn
KFPRI);
// skip dedicated for purely cosmetic stuff
if ( KFP.WorldInfo.NetMode != NM_DedicatedServer )
if (KFP.WorldInfo.NetMode != NM_DedicatedServer)
{
// Must clear all attachments before trying to attach new ones,
// otherwise we might accidentally remove things we're not supposed to
for( AttachmentIdx=0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++ )
for(AttachmentIdx=0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++)
{
// Clear any previous attachments from other characters
C.DetachAttachment(AttachmentIdx, KFP);
}
// Cosmetic attachment mesh & skin. Index of 255 implies don't use any attachments (default)
for( AttachmentIdx=0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++ )
for(AttachmentIdx=0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++)
{
CosmeticMeshIdx = bCustom ? EPRI.CustomCharacter.AttachmentMeshIndices[AttachmentIdx] : KFPRI.RepCustomizationInfo.AttachmentMeshIndices[AttachmentIdx];
if ( CosmeticMeshIdx != `CLEARED_ATTACHMENT_INDEX && CosmeticMeshIdx != INDEX_NONE )
if (CosmeticMeshIdx != `CLEARED_ATTACHMENT_INDEX && CosmeticMeshIdx != INDEX_NONE)
{
bMaskHeadMesh = bMaskHeadMesh || C.CosmeticVariants[CosmeticMeshIdx].bMaskHeadMesh;
@ -142,11 +142,11 @@ static final function SetCharacterMeshFromArch( KFCharacterInfo_Human C, KFPawn
}
}
static final function SetBodyMeshAndSkin( KFCharacterInfo_Human C,
static final function SetBodyMeshAndSkin(KFCharacterInfo_Human C,
byte CurrentBodyMeshIndex,
byte CurrentBodySkinIndex,
KFPawn KFP,
KFPlayerReplicationInfo KFPRI )
KFPlayerReplicationInfo KFPRI)
{
local string CharBodyMeshName;
local SkeletalMesh CharBodyMesh;
@ -159,7 +159,7 @@ static final function SetBodyMeshAndSkin( KFCharacterInfo_Human C,
}
// Character Mesh
if( C.BodyVariants.length > 0 )
if(C.BodyVariants.length > 0)
{
// Assign a skin to the body mesh as a material override
CurrentBodyMeshIndex = (CurrentBodyMeshIndex < C.BodyVariants.length) ? CurrentBodyMeshIndex : 0;
@ -176,7 +176,7 @@ static final function SetBodyMeshAndSkin( KFCharacterInfo_Human C,
CharBodyMesh = SkeletalMesh(SafeLoadObject(CharBodyMeshName, class'SkeletalMesh'));
// Assign the body mesh to the pawn
if ( CharBodyMesh != KFP.Mesh.SkeletalMesh )
if (CharBodyMesh != KFP.Mesh.SkeletalMesh)
{
KFP.Mesh.SetSkeletalMesh(CharBodyMesh);
KFP.OnCharacterMeshChanged();
@ -193,13 +193,13 @@ static final function SetBodyMeshAndSkin( KFCharacterInfo_Human C,
}
}
static final function SetBodySkinMaterial( KFCharacterInfo_Human C, OutfitVariants CurrentVariant, byte NewSkinIndex, KFPawn KFP)
static final function SetBodySkinMaterial(KFCharacterInfo_Human C, OutfitVariants CurrentVariant, byte NewSkinIndex, KFPawn KFP)
{
local int i;
if (KFP.WorldInfo.NetMode != NM_DedicatedServer)
{
if( CurrentVariant.SkinVariations.length > 0 )
if(CurrentVariant.SkinVariations.length > 0)
{
// Assign a skin to the body mesh as a material override
NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0;
@ -208,7 +208,7 @@ static final function SetBodySkinMaterial( KFCharacterInfo_Human C, OutfitVarian
else
{
// Use material specified in the mesh asset
for( i=0; i<KFP.Mesh.GetNumElements(); i++ )
for(i=0; i<KFP.Mesh.GetNumElements(); i++)
{
KFP.Mesh.SetMaterial(i, none);
}
@ -216,13 +216,13 @@ static final function SetBodySkinMaterial( KFCharacterInfo_Human C, OutfitVarian
}
}
static final function SetHeadSkinMaterial( KFCharacterInfo_Human C, OutfitVariants CurrentVariant, byte NewSkinIndex, KFPawn KFP )
static final function SetHeadSkinMaterial(KFCharacterInfo_Human C, OutfitVariants CurrentVariant, byte NewSkinIndex, KFPawn KFP)
{
local int i;
if (KFP.WorldInfo.NetMode != NM_DedicatedServer)
{
if( CurrentVariant.SkinVariations.length > 0 )
if(CurrentVariant.SkinVariations.length > 0)
{
// Assign a skin to the body mesh as a material override
NewSkinIndex = (NewSkinIndex < CurrentVariant.SkinVariations.length) ? NewSkinIndex : 0;
@ -231,7 +231,7 @@ static final function SetHeadSkinMaterial( KFCharacterInfo_Human C, OutfitVarian
else
{
// Use material specified in the mesh asset
for( i=0; i<KFP.ThirdPersonHeadMeshComponent.GetNumElements(); i++ )
for(i=0; i<KFP.ThirdPersonHeadMeshComponent.GetNumElements(); i++)
{
KFP.ThirdPersonHeadMeshComponent.SetMaterial(i, none);
}
@ -239,16 +239,16 @@ static final function SetHeadSkinMaterial( KFCharacterInfo_Human C, OutfitVarian
}
}
static final function SetHeadMeshAndSkin( KFCharacterInfo_Human C,
static final function SetHeadMeshAndSkin(KFCharacterInfo_Human C,
byte CurrentHeadMeshIndex,
byte CurrentHeadSkinIndex,
KFPawn KFP,
KFPlayerReplicationInfo KFPRI )
KFPlayerReplicationInfo KFPRI)
{
local string CharHeadMeshName;
local SkeletalMesh CharHeadMesh;
if ( C.HeadVariants.length > 0 )
if (C.HeadVariants.length > 0)
{
CurrentHeadMeshIndex = (CurrentHeadMeshIndex < C.HeadVariants.length) ? CurrentHeadMeshIndex : 0;
@ -277,7 +277,7 @@ static final function SetHeadMeshAndSkin( KFCharacterInfo_Human C,
}
}
static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C,
static final function SetAttachmentSkinMaterial(KFCharacterInfo_Human C,
int PawnAttachmentIndex,
const out AttachmentVariants CurrentVariant,
byte NewSkinIndex,
@ -287,10 +287,10 @@ static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C,
local int i;
if (KFP.WorldInfo.NetMode != NM_DedicatedServer)
{
if( CurrentVariant.AttachmentItem.SkinVariations.length > 0 )
if(CurrentVariant.AttachmentItem.SkinVariations.length > 0)
{
// Assign a skin to the attachment mesh as a material override
if ( NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length )
if (NewSkinIndex < CurrentVariant.AttachmentItem.SkinVariations.length)
{
if (bIsFirstPerson)
{
@ -329,7 +329,7 @@ static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C,
else
{
// Use material specified in the mesh asset
for( i=0; i < KFP.ThirdPersonAttachments[PawnAttachmentIndex].GetNumElements(); i++ )
for(i=0; i < KFP.ThirdPersonAttachments[PawnAttachmentIndex].GetNumElements(); i++)
{
KFP.ThirdPersonAttachments[PawnAttachmentIndex].SetMaterial(i, none);
}
@ -338,12 +338,12 @@ static final function SetAttachmentSkinMaterial( KFCharacterInfo_Human C,
}
}
static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C,
static final function SetAttachmentMeshAndSkin(KFCharacterInfo_Human C,
int CurrentAttachmentMeshIndex,
int CurrentAttachmentSkinIndex,
KFPawn KFP,
KFPlayerReplicationInfo KFPRI,
optional bool bIsFirstPerson )
optional bool bIsFirstPerson)
{
local string CharAttachmentMeshName;
local name CharAttachmentSocketName;
@ -367,8 +367,8 @@ static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C,
// Since cosmetic attachments are optional, do not choose index 0 if none is
// specified unlike the the head and body meshes
if ( C.CosmeticVariants.Length > 0 &&
CurrentAttachmentMeshIndex < C.CosmeticVariants.Length )
if (C.CosmeticVariants.Length > 0 &&
CurrentAttachmentMeshIndex < C.CosmeticVariants.Length)
{
if (KFPRI.StartLoadCosmeticContent(C, ECOSMETICTYPE_Attachment, CurrentAttachmentMeshIndex))
{
@ -382,9 +382,9 @@ static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C,
// If previously attached and we could have changed outfits (e.g. local player UI) then re-validate
// required skeletal mesh socket. Must be after body mesh DLO, but before AttachComponent.
if ( KFP.IsLocallyControlled() )
if (KFP.IsLocallyControlled())
{
if ( CharAttachmentSocketName != '' && KFP.Mesh.GetSocketByName(CharAttachmentSocketName) == None )
if (CharAttachmentSocketName != '' && KFP.Mesh.GetSocketByName(CharAttachmentSocketName) == None)
{
C.RemoveAttachmentMeshAndSkin(AttachmentSlotIndex, KFP, KFPRI);
return;
@ -418,7 +418,7 @@ static final function SetAttachmentMeshAndSkin( KFCharacterInfo_Human C,
}
// Treat `CLEARED_ATTACHMENT_INDEX as special value (for client detachment)
if( CurrentAttachmentMeshIndex == `CLEARED_ATTACHMENT_INDEX )
if(CurrentAttachmentMeshIndex == `CLEARED_ATTACHMENT_INDEX)
{
C.RemoveAttachmentMeshAndSkin(AttachmentSlotIndex, KFP, KFPRI);
}
@ -547,45 +547,45 @@ static final function SetAttachmentMesh(KFCharacterInfo_Human C, int CurrentAtta
* Removes any attachments that exist in the same socket or have overriding cases
* Network: Local Player
*/
static final function DetachConflictingAttachments( KFCharacterInfo_Human C, int NewAttachmentMeshIndex, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI)
static final function DetachConflictingAttachments(KFCharacterInfo_Human C, int NewAttachmentMeshIndex, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI)
{
local name NewAttachmentSocketName;
local int i, CurrentAttachmentIdx;
local ExtPlayerReplicationInfo EPRI;
EPRI = ExtPlayerReplicationInfo(KFPRI);
if ( EPRI==none || !EPRI.UsesCustomChar() )
if (EPRI==none || !EPRI.UsesCustomChar())
return;
if ( C.CosmeticVariants.length > 0 &&
NewAttachmentMeshIndex < C.CosmeticVariants.length )
if (C.CosmeticVariants.length > 0 &&
NewAttachmentMeshIndex < C.CosmeticVariants.length)
{
// The socket that this attachment requires
NewAttachmentSocketName = C.CosmeticVariants[NewAttachmentMeshIndex].AttachmentItem.SocketName;
for( i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++ )
for(i=0; i < `MAX_COSMETIC_ATTACHMENTS; i++)
{
CurrentAttachmentIdx = EPRI.CustomCharacter.AttachmentMeshIndices[i];
if ( CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX )
if (CurrentAttachmentIdx == `CLEARED_ATTACHMENT_INDEX)
continue;
// Remove the object if it is taking up our desired slot
if( KFP.ThirdPersonAttachmentSocketNames[i] != '' &&
KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName )
if(KFP.ThirdPersonAttachmentSocketNames[i] != '' &&
KFP.ThirdPersonAttachmentSocketNames[i] == NewAttachmentSocketName)
{
C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI);
continue;
}
// Remove the object if it cannot exist at the same time as another equipped item
if( C.GetOverrideCase(CurrentAttachmentIdx, NewAttachmentMeshIndex) )
if(C.GetOverrideCase(CurrentAttachmentIdx, NewAttachmentMeshIndex))
{
C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI);
continue;
}
// Check inverse override
if( C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx) )
if(C.GetOverrideCase(NewAttachmentMeshIndex, CurrentAttachmentIdx))
{
C.RemoveAttachmentMeshAndSkin(i, KFP, KFPRI);
continue;
@ -595,14 +595,14 @@ static final function DetachConflictingAttachments( KFCharacterInfo_Human C, int
}
/** Assign an arm mesh and material to this pawn */
static final function SetFirstPersonArmsFromArch( KFCharacterInfo_Human C, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI )
static final function SetFirstPersonArmsFromArch(KFCharacterInfo_Human C, KFPawn KFP, optional KFPlayerReplicationInfo KFPRI)
{
local MaterialInstanceConstant M;
local ExtPlayerReplicationInfo EPRI;
local bool bCustom;
local int AttachmentIdx, CosmeticMeshIdx;
if ( KFPRI == none )
if (KFPRI == none)
{
`Warn("Does not have a KFPRI" @ C);
return;
@ -633,7 +633,7 @@ static final function SetFirstPersonArmsFromArch( KFCharacterInfo_Human C, KFPaw
}
// Hack fix for a material bug on KF2
if( bCustom && KFP.ArmsMesh.SkeletalMesh!=None && KFP.ArmsMesh.GetMaterial(0)!=None )
if(bCustom && KFP.ArmsMesh.SkeletalMesh!=None && KFP.ArmsMesh.GetMaterial(0)!=None)
{
M = KFP.ArmsMesh.CreateAndSetMaterialInstanceConstant(0);
CloneMIC(M);
@ -650,7 +650,7 @@ static function int GetAttachmentSlotIndex(
local ExtPlayerReplicationInfo EPRI;
local bool bCustom;
if( KFPRI == None )
if(KFPRI == None)
{
`warn("GetAttachmentSlotIndex - NO KFPRI");
return INDEX_NONE;
@ -660,10 +660,10 @@ static function int GetAttachmentSlotIndex(
bCustom = (EPRI!=None ? EPRI.UsesCustomChar() : false);
// Return the next available attachment index or the index that matches this mesh
for( AttachmentIdx = 0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++ )
for(AttachmentIdx = 0; AttachmentIdx < `MAX_COSMETIC_ATTACHMENTS; AttachmentIdx++)
{
CosmeticMeshIdx = bCustom ? EPRI.CustomCharacter.AttachmentMeshIndices[AttachmentIdx] : KFPRI.RepCustomizationInfo.AttachmentMeshIndices[AttachmentIdx];
if( CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex )
if(CosmeticMeshIdx == INDEX_NONE || CosmeticMeshIdx == CurrentAttachmentMeshIndex)
{
return AttachmentIdx;
}
@ -673,7 +673,7 @@ static function int GetAttachmentSlotIndex(
static function bool IsAttachmentAvailable(KFCharacterInfo_Human C, const out AttachmentVariants Attachment, Pawn PreviewPawn)
{
if ( Attachment.AttachmentItem.SocketName != '' && PreviewPawn.Mesh.GetSocketByName(Attachment.AttachmentItem.SocketName) == None )
if (Attachment.AttachmentItem.SocketName != '' && PreviewPawn.Mesh.GetSocketByName(Attachment.AttachmentItem.SocketName) == None)
{
return false;
}

View File

@ -3,23 +3,23 @@ class ExtEmoteList extends Object
var const array<Emote> Emotes;
static final function name GetUnlockedEmote( int ItemId, ExtPlayerController PC )
static final function name GetUnlockedEmote(int ItemId, ExtPlayerController PC)
{
local int i;
local name Anim;
local ExtPlayerReplicationInfo PRI;
i = default.Emotes.Find('Id', ItemId);
if( i > -1 )
if(i > -1)
{
Anim = default.Emotes[i].AnimName;
PRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo);
if( PRI == None )
if(PRI == None)
return Anim;
/*
if( InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255 )
if(InStr(string(Anim), "Deluxe") != INDEX_NONE && PRI.AdminType == 255)
return 'NONE';
*/
else return Anim;
@ -28,9 +28,9 @@ static final function name GetUnlockedEmote( int ItemId, ExtPlayerController PC
return 'NONE';
}
static final function SaveEquippedEmote( int ItemId, ExtPlayerController PC )
static final function SaveEquippedEmote(int ItemId, ExtPlayerController PC)
{
if( PC == None )
if(PC == None)
return;
PC.SelectedEmoteIndex = ItemId;
@ -42,11 +42,11 @@ static final function array<Emote> GetEmoteArray()
return default.Emotes;
}
static final function byte GetEmoteIndex( int ItemId )
static final function byte GetEmoteIndex(int ItemId)
{
local int i;
i = default.Emotes.Find('Id', ItemId);
if( i > -1 )
if(i > -1)
return i;
return -1;
@ -54,7 +54,7 @@ static final function byte GetEmoteIndex( int ItemId )
static final function int GetEquippedEmoteId(ExtPlayerController PC)
{
if( PC == None )
if(PC == None)
return -1;
return PC.SelectedEmoteIndex;

View File

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

View File

@ -11,11 +11,11 @@ function UpdateGrenades()
CurrentGrenades = MyKFInvManager.GrenadeCount;
//Update the icon the for grenade type.
if( ExtPlayerController(MyKFPC)!=None )
if(ExtPlayerController(MyKFPC)!=None)
{
PM = ExtPlayerController(MyKFPC).ActivePerkManager;
if( PM!=None && PM.CurrentPerk!=None && EPerkClass!=PM.CurrentPerk.Class )
if(PM!=None && PM.CurrentPerk!=None && EPerkClass!=PM.CurrentPerk.Class)
{
SetString("backpackGrenadeType", "img://"$PM.CurrentPerk.GrenadeWeaponDef.Static.GetImagePath());
EPerkClass = PM.CurrentPerk.Class;

View File

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

View File

@ -15,30 +15,30 @@ function LocalizeText()
SetObject("localizedText", TempObject);
}
function UpdatePlayerInfo( optional bool bForceUpdate )
function UpdatePlayerInfo(optional bool bForceUpdate)
{
local GFxObject TempObject;
local ExtPlayerReplicationInfo E;
if( SpectatedKFPRI == None )
if(SpectatedKFPRI == None)
return;
E = ExtPlayerReplicationInfo(SpectatedKFPRI);
if( LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate )
if(LastPerkLevel != E.ECurrentPerkLevel || LastPerkLevel != E.ECurrentPerkLevel || bForceUpdate)
{
LastPerkLevel = E.ECurrentPerkLevel;
ExtLastPerkClass = E.ECurrentPerk;
TempObject = CreateObject( "Object" );
TempObject.SetString( "playerName", SpectatedKFPRI.GetHumanReadableName() );
if( ExtLastPerkClass!=None && TempObject !=None )
TempObject = CreateObject("Object");
TempObject.SetString("playerName", SpectatedKFPRI.GetHumanReadableName());
if(ExtLastPerkClass!=None && TempObject !=None)
{
TempObject.SetString( "playerPerk", SpectatedKFPRI.CurrentPerkClass.default.LevelString @LastPerkLevel @ExtLastPerkClass.default.PerkName );
TempObject.SetString( "iconPath", ExtLastPerkClass.Static.GetPerkIconPath(LastPerkLevel) );
SetObject( "playerData", TempObject );
TempObject.SetString("playerPerk", SpectatedKFPRI.CurrentPerkClass.default.LevelString @LastPerkLevel @ExtLastPerkClass.default.PerkName);
TempObject.SetString("iconPath", ExtLastPerkClass.Static.GetPerkIconPath(LastPerkLevel));
SetObject("playerData", TempObject);
}
else TempObject.SetString( "playerPerk","No perk" );
SetVisible( true );
else TempObject.SetString("playerPerk","No perk");
SetVisible(true);
}
}

View File

@ -35,10 +35,10 @@ function TickHud(float DeltaTime)
}
// Current wave we're on.
if( LastWave!=KFGRI.WaveNum )
if(LastWave!=KFGRI.WaveNum)
{
LastWave = KFGRI.WaveNum;
if( LastWave>LastWaveMax )
if(LastWave>LastWaveMax)
{
SetInt("currentWave",0); // Force text to refresh.
SetString("finalText", "END");

View File

@ -2,7 +2,7 @@ class ExtHUD_WeaponSelectWidget extends KFGFxHUD_WeaponSelectWidget;
var transient array< class<KFWeaponDefinition> > WeaponGroup;
simulated function UpdateWeaponGroupOnHUD( byte GroupIndex )
simulated function UpdateWeaponGroupOnHUD(byte GroupIndex)
{
local Inventory Inv;
local KFWeapon KFW;
@ -14,22 +14,22 @@ simulated function UpdateWeaponGroupOnHUD( byte GroupIndex )
local array< class<KFWeaponDefinition> > WPGroup;
P = GetPC().Pawn;
if ( P == none || P.InvManager == none )
if (P == none || P.InvManager == none)
return;
for ( Inv = P.InvManager.InventoryChain; Inv != none; Inv = Inv.Inventory )
for (Inv = P.InvManager.InventoryChain; Inv != none; Inv = Inv.Inventory)
{
KFW = KFWeapon( Inv );
if ( KFW != none && KFW.InventoryGroup == GroupIndex )
KFW = KFWeapon(Inv);
if (KFW != none && KFW.InventoryGroup == GroupIndex)
WeaponsList.AddItem(KFW);
}
WPGroup.Length = WeaponsList.Length;
TraderItems = KFGameReplicationInfo( P.WorldInfo.GRI ).TraderItems;
for ( i = 0; i < WeaponsList.Length; i++ )
TraderItems = KFGameReplicationInfo(P.WorldInfo.GRI).TraderItems;
for (i = 0; i < WeaponsList.Length; i++)
{
Index = TraderItems.SaleItems.Find('ClassName', WeaponsList[i].Class.Name);
if( Index != -1 )
if(Index != -1)
WPGroup[i] = TraderItems.SaleItems[Index].WeaponDef;
}
@ -45,42 +45,42 @@ simulated function SetWeaponGroupList(out array<KFWeapon> WeaponList, byte Group
local bool bUsesAmmo;
DataProvider = CreateArray();
if ( DataProvider == None )
if (DataProvider == None)
return; // gfx has been shut down
for (i = 0; i < WeaponList.length; i++)
{
TempObj = CreateObject( "Object" );
TempObj = CreateObject("Object");
if( WeaponGroup[i] != None )
if(WeaponGroup[i] != None)
{
TempObj.SetString( "weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName") );
TempObj.SetString( "texturePath", "img://"$WeaponGroup[i].static.GetImagePath() );
TempObj.SetString("weaponName", WeaponGroup[i].static.GetItemLocalization("ItemName"));
TempObj.SetString("texturePath", "img://"$WeaponGroup[i].static.GetImagePath());
}
else
{
TempObj.SetString( "weaponName", WeaponList[i].ItemName );
TempObj.SetString( "texturePath", "img://"$PathName(WeaponList[i].WeaponSelectTexture));
TempObj.SetString("weaponName", WeaponList[i].ItemName);
TempObj.SetString("texturePath", "img://"$PathName(WeaponList[i].WeaponSelectTexture));
}
TempObj.SetInt("weaponTier", WeaponList[i].CurrentWeaponUpgradeIndex);
TempObj.SetInt( "ammoCount", WeaponList[i].AmmoCount[0]);
TempObj.SetInt( "spareAmmoCount", WeaponList[i].SpareAmmoCount[0]);
TempObj.SetInt("ammoCount", WeaponList[i].AmmoCount[0]);
TempObj.SetInt("spareAmmoCount", WeaponList[i].SpareAmmoCount[0]);
//secondary ammo shenanigans
TempObj.SetBool("bUsesSecondaryAmmo", WeaponList[i].UsesSecondaryAmmo()&&WeaponList[i].bCanRefillSecondaryAmmo);
TempObj.SetBool("bEnabled", WeaponList[i].HasAnyAmmo());
if(WeaponList[i].UsesSecondaryAmmo() && WeaponList[i].bCanRefillSecondaryAmmo)
{
TempObj.SetBool("bCanRefillSecondaryAmmo", WeaponList[i].SpareAmmoCapacity[1] > 0);
TempObj.SetInt( "secondaryAmmoCount", WeaponList[i].AmmoCount[1]);
TempObj.SetInt( "secondarySpareAmmoCount", WeaponList[i].SpareAmmoCount[1]);
TempObj.SetInt("secondaryAmmoCount", WeaponList[i].AmmoCount[1]);
TempObj.SetInt("secondarySpareAmmoCount", WeaponList[i].SpareAmmoCount[1]);
}
TempObj.SetBool( "throwable", WeaponList[i].CanThrow());
TempObj.SetBool("throwable", WeaponList[i].CanThrow());
bUsesAmmo = (WeaponList[i].static.UsesAmmo());
TempObj.SetBool( "bUsesAmmo", bUsesAmmo);
DataProvider.SetElementObject( i, TempObj );
TempObj.SetBool("bUsesAmmo", bUsesAmmo);
DataProvider.SetElementObject(i, TempObj);
}
SetWeaponList(DataProvider, GroupIndex);

View File

@ -18,17 +18,17 @@ var byte HealingShieldMod,HealingSpeedBoostMod,HealingDamageBoostMod;
replication
{
if( true )
if(true)
bFeigningDeath,RepRegenHP,BackpackWeaponClass;
if( bNetOwner )
if(bNetOwner)
bHasBunnyHop;
if( bNetDirty )
if(bNetDirty)
HealingSpeedBoostMod, HealingDamageBoostMod, HealingShieldMod;
}
function TakeDamage(int Damage, Controller InstigatedBy, vector HitLocation, vector Momentum, class<DamageType> DamageType, optional TraceHitInfo HitInfo, optional Actor DamageCauser)
{
if( KnockbackResist<1 )
if(KnockbackResist<1)
Momentum *= KnockbackResist;
Super.TakeDamage(Damage,InstigatedBy,HitLocation,Momentum,DamageType,HitInfo,DamageCauser);
}
@ -40,9 +40,9 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
local PlayerReplicationInfo KillerPRI;
local SeqAct_Latent Action;
if( WorldInfo.NetMode!=NM_Client && PlayerReplicationInfo!=None )
if(WorldInfo.NetMode!=NM_Client && PlayerReplicationInfo!=None)
{
if( Killer==None || Killer==Controller )
if(Killer==None || Killer==Controller)
{
KillerPRI = PlayerReplicationInfo;
KillerPawn = None;
@ -50,10 +50,10 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
else
{
KillerPRI = Killer.PlayerReplicationInfo;
if( KillerPRI==None || KillerPRI.Team!=PlayerReplicationInfo.Team )
if(KillerPRI==None || KillerPRI.Team!=PlayerReplicationInfo.Team)
{
KillerPawn = Killer.Pawn!=None ? Killer.Pawn.Class : None;
if( PlayerController(Killer)==None ) // If was killed by a monster, don't broadcast PRI along with it.
if(PlayerController(Killer)==None) // If was killed by a monster, don't broadcast PRI along with it.
KillerPRI = None;
}
else KillerPawn = None;
@ -62,12 +62,12 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
C.ClientKillMessage(damageType,PlayerReplicationInfo,KillerPRI,KillerPawn);
}
// If got killed by a zombie, turn player into a ragdoll and let em take control of a newly spawned ZED over the ragdoll.
if( bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0 )
if(bRedeadMode && WorldInfo.NetMode!=NM_Client && damageType!=None && Killer!=None && Killer!=Controller && Killer.GetTeamNum()!=0)
{
if ( bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange )
if (bDeleteMe || WorldInfo.Game == None || WorldInfo.Game.bLevelChange)
return FALSE;
bPendingRedead = true;
if ( WorldInfo.Game.PreventDeath(self, Killer, damageType, HitLocation) )
if (WorldInfo.Game.PreventDeath(self, Killer, damageType, HitLocation))
{
bPendingRedead = false;
Health = max(Health, 1);
@ -76,15 +76,15 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
Health = 0;
foreach LatentActions(Action)
Action.AbortFor(self);
if ( Controller != None )
if (Controller != None)
WorldInfo.Game.Killed(Killer, Controller, self, damageType);
else WorldInfo.Game.Killed(Killer, Controller(Owner), self, damageType);
if ( InvManager != None )
if (InvManager != None)
InvManager.OwnerDied();
Health = 1;
if( !bFeigningDeath )
if(!bFeigningDeath)
PlayFeignDeath(true,,true);
Health = 0;
ClearTimer('UnsetFeignDeath');
@ -93,15 +93,15 @@ simulated function bool Died(Controller Killer, class<DamageType> damageType, ve
}
return Super.Died(Killer, DamageType, HitLocation);
}
simulated function BroadcastDeathMessage( Controller Killer );
simulated function BroadcastDeathMessage(Controller Killer);
function SetBatteryRate( float Rate )
function SetBatteryRate(float Rate)
{
BatteryDrainRate = Default.BatteryDrainRate*Rate;
NVGBatteryDrainRate = Default.NVGBatteryDrainRate*Rate;
ClientSetBatteryRate(Rate);
}
simulated reliable client function ClientSetBatteryRate( float Rate )
simulated reliable client function ClientSetBatteryRate(float Rate)
{
BatteryDrainRate = Default.BatteryDrainRate*Rate;
NVGBatteryDrainRate = Default.NVGBatteryDrainRate*Rate;
@ -123,92 +123,92 @@ event bool HealDamage(int Amount, Controller Healer, class<DamageType> DamageTyp
InstigatorPC = ExtPlayerController(Healer);
InstigatorPerk = InstigatorPC.GetPerk();
if( InstigatorPerk != None && bCanRepairArmor )
bRepairedArmor = InstigatorPC.GetPerk().RepairArmor( self );
if(InstigatorPerk != None && bCanRepairArmor)
bRepairedArmor = InstigatorPC.GetPerk().RepairArmor(self);
EPRI = ExtPlayerReplicationInfo(InstigatorPC.PlayerReplicationInfo);
if( EPRI != none )
if(EPRI != none)
{
InstigatorExtPerk = ExtPlayerController(Controller).ActivePerkManager.CurrentPerk;
if( InstigatorExtPerk != none && Ext_PerkFieldMedic(InstigatorExtPerk) != none )
if(InstigatorExtPerk != none && Ext_PerkFieldMedic(InstigatorExtPerk) != none)
{
if( Ext_PerkFieldMedic(InstigatorExtPerk).bHealingBoost )
if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingBoost)
UpdateHealingSpeedBoostMod(InstigatorPC);
if( Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost )
if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingDamageBoost)
UpdateHealingDamageBoostMod(InstigatorPC);
if( Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield )
if(Ext_PerkFieldMedic(InstigatorExtPerk).bHealingShield)
UpdateHealingShieldMod(InstigatorPC);
}
}
if( Amount > 0 && IsAliveAndWell() && Health < HealthMax )
if(Amount > 0 && IsAliveAndWell() && Health < HealthMax)
{
// Play any healing effects attached to this damage type
KFDT = class<KFDamageType>(DamageType);
if( KFDT != none && KFDT.default.bNoPain )
PlayHeal( KFDT );
if(KFDT != none && KFDT.default.bNoPain)
PlayHeal(KFDT);
if( Role == ROLE_Authority )
if(Role == ROLE_Authority)
{
if( Healer==None || Healer.PlayerReplicationInfo == None )
if(Healer==None || Healer.PlayerReplicationInfo == None)
return false;
InstigatorPRI = KFPlayerReplicationInfo(Healer.PlayerReplicationInfo);
ScAmount = Amount;
if( InstigatorPerk != none )
InstigatorPerk.ModifyHealAmount( ScAmount );
if(InstigatorPerk != none)
InstigatorPerk.ModifyHealAmount(ScAmount);
UsedHealAmount = ScAmount;
// You can never have a HealthToRegen value that's greater than HealthMax
if( Health + HealthToRegen + UsedHealAmount > HealthMax )
if(Health + HealthToRegen + UsedHealAmount > HealthMax)
UsedHealAmount = Min(HealthMax - (Health + HealthToRegen),255-HealthToRegen);
else UsedHealAmount = Min(UsedHealAmount,255-HealthToRegen);
HealthToRegen += UsedHealAmount;
RepRegenHP = HealthToRegen;
if( !IsTimerActive('GiveHealthOverTime') )
if(!IsTimerActive('GiveHealthOverTime'))
SetTimer(HealthRegenRate, true, 'GiveHealthOverTime');
// Give the healer money/XP for helping a teammate
if( Healer.Pawn != none && Healer.Pawn != self )
if(Healer.Pawn != none && Healer.Pawn != self)
{
DoshEarned = ( UsedHealAmount / float(HealthMax) ) * HealerRewardScaler;
if( InstigatorPRI!=None )
DoshEarned = (UsedHealAmount / float(HealthMax)) * HealerRewardScaler;
if(InstigatorPRI!=None)
InstigatorPRI.AddDosh(Max(DoshEarned, 0), true);
if( InstigatorPC!=None )
InstigatorPC.AddHealPoints( UsedHealAmount );
if(InstigatorPC!=None)
InstigatorPC.AddHealPoints(UsedHealAmount);
}
if( Healer.bIsPlayer )
if(Healer.bIsPlayer)
{
if( Healer != Controller )
if(Healer != Controller)
{
if( InstigatorPC!=None )
if(InstigatorPC!=None)
{
if( !InstigatorPC.bClientHideNumbers )
if(!InstigatorPC.bClientHideNumbers)
InstigatorPC.ClientNumberMsg(UsedHealAmount,Location,DMG_Heal);
InstigatorPC.ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo );
InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedPlayer, PlayerReplicationInfo);
}
KFPC = ExtPlayerController(Controller);
if( KFPC!=None )
KFPC.ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo );
if(KFPC!=None)
KFPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedBy, Healer.PlayerReplicationInfo);
}
else if( bMessageHealer && InstigatorPC!=None )
InstigatorPC.ReceiveLocalizedMessage( class'KFLocalMessage_Game', GMT_HealedSelf, PlayerReplicationInfo );
else if(bMessageHealer && InstigatorPC!=None)
InstigatorPC.ReceiveLocalizedMessage(class'KFLocalMessage_Game', GMT_HealedSelf, PlayerReplicationInfo);
}
// don't play dialog for healing done through perk skills (e.g. berserker vampire skill)
if( bMessageHealer )
if(bMessageHealer)
{
`DialogManager.PlayHealingDialog( KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax) );
`DialogManager.PlayHealingDialog(KFPawn(Healer.Pawn), self, float(Health + HealthToRegen) / float(HealthMax));
}
// Reduce burn duration and damage in half if you heal while burning
for( i = 0; i < DamageOverTimeArray.Length; ++i )
for(i = 0; i < DamageOverTimeArray.Length; ++i)
{
if( DamageOverTimeArray[i].DoT_Type == DOT_Fire )
if(DamageOverTimeArray[i].DoT_Type == DOT_Fire)
{
DamageOverTimeArray[i].Duration *= 0.5;
DamageOverTimeArray[i].Damage *= 0.5;
@ -231,7 +231,7 @@ function GiveHealthOverTime()
simulated event ReplicatedEvent(name VarName)
{
switch( VarName )
switch(VarName)
{
case 'bFeigningDeath':
PlayFeignDeath(bFeigningDeath);
@ -248,11 +248,11 @@ simulated event ReplicatedEvent(name VarName)
// Feign death triggers:
function PlayHit(float Damage, Controller InstigatedBy, vector HitLocation, class<DamageType> damageType, vector Momentum, TraceHitInfo HitInfo)
{
if( damageType!=class'DmgType_Fell' ) // Not from falling!
if(damageType!=class'DmgType_Fell') // Not from falling!
{
if( bRagdollFromMomentum && Damage>2 && VSizeSq(Momentum)>1000000.f && Rand(3)==0 ) // Square(1000)
if(bRagdollFromMomentum && Damage>2 && VSizeSq(Momentum)>1000000.f && Rand(3)==0) // Square(1000)
SetFeignDeath(3.f+FRand()*2.5f); // Randomly knockout a player if hit by a huge force.
else if( bRagdollFromBackhit && Damage>20 && VSizeSq(Momentum)>40000.f && (vector(Rotation) Dot Momentum)>0.f && Rand(4)==0 )
else if(bRagdollFromBackhit && Damage>20 && VSizeSq(Momentum)>40000.f && (vector(Rotation) Dot Momentum)>0.f && Rand(4)==0)
SetFeignDeath(2.f+FRand()*3.f); // Randomly knockout a player if hit from behind.
}
Super.PlayHit(Damage,InstigatedBy,HitLocation,damageType,Momentum,HitInfo);
@ -262,10 +262,10 @@ event Landed(vector HitNormal, actor FloorActor)
local float ExcessSpeed;
Super.Landed(HitNormal, FloorActor);
if( bRagdollFromFalling )
if(bRagdollFromFalling)
{
ExcessSpeed = Velocity.Z / (-MaxFallSpeed);
if( ExcessSpeed>1.25 ) // Knockout a player after landed from too high.
if(ExcessSpeed>1.25) // Knockout a player after landed from too high.
{
Velocity.Z = 0; // Dont go clip through floor now...
Velocity.X*=0.5;
@ -273,27 +273,27 @@ event Landed(vector HitNormal, actor FloorActor)
SetFeignDeath((3.f+FRand())*ExcessSpeed);
}
}
else if( BHopAccelSpeed>0 )
else if(BHopAccelSpeed>0)
SetTimer((IsLocallyControlled() ? 0.17 : 1.f),false,'ResetBHopAccel'); // Replicating from client to server here because Server Tickrate may screw clients over from executing bunny hopping.
}
// ==================================================================
// Bunny hopping:
function bool DoJump( bool bUpdating )
function bool DoJump(bool bUpdating)
{
local float V;
if ( Super.DoJump(bUpdating) )
if (Super.DoJump(bUpdating))
{
// Accelerate if bunnyhopping.
if( bHasBunnyHop && VSizeSq2D(Velocity)>Square(GroundSpeed*0.75) )
if(bHasBunnyHop && VSizeSq2D(Velocity)>Square(GroundSpeed*0.75))
{
if( BHopAccelSpeed<20 )
if(BHopAccelSpeed<20)
{
if( BHopAccelSpeed==0 )
if(BHopAccelSpeed==0)
BHopSpeedMod = 1.f;
if( BHopAccelSpeed<5 )
if(BHopAccelSpeed<5)
V = 1.15;
else
{
@ -313,15 +313,15 @@ function bool DoJump( bool bUpdating )
}
return false;
}
simulated function ResetBHopAccel( optional bool bSkipRep ) // Set on Landed, or Tick if falling 2D speed is too low.
simulated function ResetBHopAccel(optional bool bSkipRep) // Set on Landed, or Tick if falling 2D speed is too low.
{
if( BHopAccelSpeed>0 )
if(BHopAccelSpeed>0)
{
BHopAccelSpeed = 0;
AirControl = Default.AirControl;
GroundSpeed /= BHopSpeedMod;
UpdateGroundSpeed();
if( WorldInfo.NetMode==NM_Client && !bSkipRep )
if(WorldInfo.NetMode==NM_Client && !bSkipRep)
NotifyHasStopped();
}
}
@ -330,12 +330,12 @@ function UpdateGroundSpeed()
local KFInventoryManager InvM;
local float HealthMod;
if ( Role < ROLE_Authority )
if (Role < ROLE_Authority)
return;
InvM = KFInventoryManager(InvManager);
HealthMod = (InvM != None) ? InvM.GetEncumbranceSpeedMod() : 1.f * (1.f - LowHealthSpeedPenalty);
if( BHopAccelSpeed>0 )
if(BHopAccelSpeed>0)
HealthMod *= BHopSpeedMod;
// First reset to default so multipliers do not stack
@ -344,7 +344,7 @@ function UpdateGroundSpeed()
SprintSpeed = default.SprintSpeed * HealthMod;
// Ask our perk to set the new ground speed based on weapon type
if( GetPerk() != none )
if(GetPerk() != none)
{
GetPerk().ModifySpeed(GroundSpeed);
GetPerk().ModifySpeed(SprintSpeed);
@ -358,22 +358,22 @@ reliable server function NotifyHasStopped()
// ==================================================================
// Feign death (UT3):
simulated function Tick( float Delta )
simulated function Tick(float Delta)
{
Super.Tick(Delta);
if( bPlayingFeignDeathRecovery )
if(bPlayingFeignDeathRecovery)
{
// interpolate Controller yaw to our yaw so that we don't get our rotation snapped around when we get out of feign death
Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(Delta*2.f),0.f);
if( Mesh.PhysicsWeight<=0 )
if(Mesh.PhysicsWeight<=0)
StartFeignDeathRecoveryAnim();
}
if( BHopAccelSpeed>0 )
if(BHopAccelSpeed>0)
{
if( Physics==PHYS_Falling && VSizeSq2D(Velocity)<Square(GroundSpeed*0.7) )
if(Physics==PHYS_Falling && VSizeSq2D(Velocity)<Square(GroundSpeed*0.7))
ResetBHopAccel(true);
}
if( WorldInfo.NetMode!=NM_Client && BackpackWeaponClass!=none && (PlayerOldWeapon==None || PlayerOldWeapon.Instigator==None) )
if(WorldInfo.NetMode!=NM_Client && BackpackWeaponClass!=none && (PlayerOldWeapon==None || PlayerOldWeapon.Instigator==None))
{
PlayerOldWeapon = None;
SetBackpackWeapon(None);
@ -384,13 +384,13 @@ function DelayedRagdoll()
{
SetFeignDeath(2.f+FRand()*3.f);
}
exec function FeignDeath( float Time )
exec function FeignDeath(float Time)
{
SetFeignDeath(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);
PlayFeignDeath(true);
@ -399,25 +399,25 @@ function SetFeignDeath( float Time )
}
function UnsetFeignDeath()
{
if( bFeigningDeath )
if(bFeigningDeath)
PlayFeignDeath(false);
}
simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional bool bTransformMode )
simulated function PlayFeignDeath(bool bEnable, optional bool bForce, optional bool bTransformMode)
{
local vector FeignLocation, HitLocation, HitNormal, TraceEnd, Impulse;
local rotator NewRotation;
local float UnFeignZAdjust;
if( Health<=0 && WorldInfo.NetMode!=NM_Client )
if(Health<=0 && WorldInfo.NetMode!=NM_Client)
return; // If dead, don't do it.
NotifyOutOfBattery(); // Stop nightvision on client.
bFeigningDeath = bEnable;
if ( bEnable )
if (bEnable)
{
if( bFPLegsAttached )
if(bFPLegsAttached)
{
bFPLegsAttached = false;
DetachComponent(FPBodyMesh);
@ -427,7 +427,7 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional
bPlayingFeignDeathRecovery = false;
ClearTimer('OnWakeUpFinished');
if( !bTransformMode )
if(!bTransformMode)
GotoState('FeigningDeath');
// if we had some other rigid body thing going on, cancel it
@ -452,9 +452,9 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional
Mesh.SetHasPhysicsAssetInstance(false);
if( !InitRagdoll() ) // Ragdoll error!
if(!InitRagdoll()) // Ragdoll error!
{
if( PlayerController(Controller)!=None )
if(PlayerController(Controller)!=None)
PlayerController(Controller).ClientMessage("Error: InitRagdoll() failed!");
return;
}
@ -467,7 +467,7 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional
// Set all kinematic bodies to the current root velocity, since they may not have been updated during normal animation
// and therefore have zero derived velocity (this happens in 1st person camera mode).
UnFeignZAdjust = VSize(Velocity);
if( UnFeignZAdjust>700.f ) // Limit by a maximum velocity force to prevent from going through walls.
if(UnFeignZAdjust>700.f) // Limit by a maximum velocity force to prevent from going through walls.
Mesh.SetRBLinearVelocity((Velocity/UnFeignZAdjust)*700.f, false);
else Mesh.SetRBLinearVelocity(Velocity, false);
@ -485,14 +485,14 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional
FeignLocation = Location;
CollisionComponent = CylinderComponent;
TraceEnd = Location + vect(0,0,1) * GetCollisionHeight();
if (Trace(HitLocation, HitNormal, TraceEnd, Location, true, GetCollisionExtent()) == None )
if (Trace(HitLocation, HitNormal, TraceEnd, Location, true, GetCollisionExtent()) == None)
{
HitLocation = TraceEnd;
}
if ( !SetFeignEndLocation(HitLocation, FeignLocation) && WorldInfo.NetMode!=NM_Client )
if (!SetFeignEndLocation(HitLocation, FeignLocation) && WorldInfo.NetMode!=NM_Client)
{
UnfeignFailedCount++;
if ( UnFeignfailedCount > 4 || bForce )
if (UnFeignfailedCount > 4 || bForce)
{
SetLocation(PickNearestNode()); // Just teleport to nearest pathnode.
}
@ -552,7 +552,7 @@ simulated function PlayFeignDeath( bool bEnable, optional bool bForce, optional
else FeignRecoverAnim = 'Getup_F_V1';
// Init wakeup anim.
if( Mesh.AnimSets.Find(WakeUpAnimSet)==-1 )
if(Mesh.AnimSets.Find(WakeUpAnimSet)==-1)
Mesh.AnimSets.AddItem(WakeUpAnimSet);
BodyStanceNodes[EAS_FullBody].bNoNotifies = true;
BodyStanceNodes[EAS_FullBody].PlayCustomAnim(FeignRecoverAnim,0.025f,,,,true);
@ -568,7 +568,7 @@ final function vector PickNearestNode()
foreach WorldInfo.AllNavigationPoints(class'NavigationPoint',N)
{
Dist = VSizeSq(N.Location-Location);
if( Best==None || Dist<BestDist )
if(Best==None || Dist<BestDist)
{
Best = N;
BestDist = Dist;
@ -580,29 +580,29 @@ simulated function bool SetFeignEndLocation(vector HitLocation, vector FeignLoca
{
local vector NewDest;
if ( SetLocation(HitLocation) && CheckValidLocation(FeignLocation) )
if (SetLocation(HitLocation) && CheckValidLocation(FeignLocation))
{
return true;
}
// try crouching
ForceCrouch();
if ( SetLocation(HitLocation) && CheckValidLocation(FeignLocation) )
if (SetLocation(HitLocation) && CheckValidLocation(FeignLocation))
{
return true;
}
newdest = HitLocation + GetCollisionRadius() * vect(1,1,0);
if ( SetLocation(newdest) && CheckValidLocation(FeignLocation) )
if (SetLocation(newdest) && CheckValidLocation(FeignLocation))
return true;
newdest = HitLocation + GetCollisionRadius() * vect(1,-1,0);
if ( SetLocation(newdest) && CheckValidLocation(FeignLocation) )
if (SetLocation(newdest) && CheckValidLocation(FeignLocation))
return true;
newdest = HitLocation + GetCollisionRadius() * vect(-1,1,0);
if ( SetLocation(newdest) && CheckValidLocation(FeignLocation) )
if (SetLocation(newdest) && CheckValidLocation(FeignLocation))
return true;
newdest = HitLocation + GetCollisionRadius() * vect(-1,-1,0);
if ( SetLocation(newdest) && CheckValidLocation(FeignLocation) )
if (SetLocation(newdest) && CheckValidLocation(FeignLocation))
return true;
return false;
@ -620,8 +620,8 @@ simulated function bool CheckValidLocation(vector FeignLocation)
// try trace straight up, then sideways to final location
DestFinalZ = FeignLocation;
FeignLocation.Z = Location.Z;
if ( Trace(HitLocation, HitNormal, DestFinalZ, FeignLocation, false, vect(10,10,10)) == None &&
Trace(HitLocation, HitNormal, Location, DestFinalZ, false, vect(10,10,10),, TRACEFLAG_Bullet) == None )
if (Trace(HitLocation, HitNormal, DestFinalZ, FeignLocation, false, vect(10,10,10)) == None &&
Trace(HitLocation, HitNormal, Location, DestFinalZ, false, vect(10,10,10),, TRACEFLAG_Bullet) == None)
{
return true;
}
@ -656,7 +656,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
Mesh.SetHasPhysicsAssetInstance(false);
Mesh.SetHasPhysicsAssetInstance(true);
if( bFPLegsAttached )
if(bFPLegsAttached)
{
bFPLegsAttached = false;
DetachComponent(FPBodyMesh);
@ -667,7 +667,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
PrepareRagdoll();
if ( InitRagdoll() )
if (InitRagdoll())
{
// Switch to a good RigidBody TickGroup to fix projectiles passing through the mesh
// https://udn.unrealengine.com/questions/190581/projectile-touch-not-called.html
@ -682,7 +682,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
CheckHitInfo(HitInfo, Mesh, HitDirection, HitLoc);
// Play ragdoll death animation (bSkipReplication=TRUE)
if( CanDoSpecialMove(SM_DeathAnim) && ClassIsChildOf(DamageType, class'KFDamageType') )
if(CanDoSpecialMove(SM_DeathAnim) && ClassIsChildOf(DamageType, class'KFDamageType'))
{
DoSpecialMove(SM_DeathAnim, TRUE,,,TRUE);
KFSM_DeathAnim(SpecialMoves[SM_DeathAnim]).PlayDeathAnimation(DamageType, HitDirection, HitInfo.BoneName);
@ -695,7 +695,7 @@ simulated function PlayRagdollDeath(class<DamageType> DamageType, vector HitLoc)
}
simulated function StartFeignDeathRecoveryAnim()
{
if( FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs )
if(FPBodyMesh!=None && !bFPLegsAttached && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs)
{
bFPLegsAttached = true;
AttachComponent(FPBodyMesh);
@ -729,7 +729,7 @@ function AddDefaultInventory()
local KFPerk MyPerk;
MyPerk = GetPerk();
if( MyPerk != none )
if(MyPerk != none)
MyPerk.AddDefaultInventory(self);
Super(KFPawn).AddDefaultInventory();
@ -737,34 +737,34 @@ function AddDefaultInventory()
simulated event FellOutOfWorld(class<DamageType> dmgType)
{
if ( Role==ROLE_Authority && NextRedeemTimer<WorldInfo.TimeSeconds ) // Make sure to not to spam deathmessages while ghosting.
if (Role==ROLE_Authority && NextRedeemTimer<WorldInfo.TimeSeconds) // Make sure to not to spam deathmessages while ghosting.
Super.FellOutOfWorld(dmgType);
}
simulated event OutsideWorldBounds()
{
if ( Role==ROLE_Authority && NextRedeemTimer<WorldInfo.TimeSeconds )
if (Role==ROLE_Authority && NextRedeemTimer<WorldInfo.TimeSeconds)
Super.OutsideWorldBounds();
}
simulated function KFCharacterInfoBase GetCharacterInfo()
{
if( ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None )
if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch();
return Super.GetCharacterInfo();
}
simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce )
simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce)
{
local KFPlayerReplicationInfo KFPRI;
KFPRI = KFPlayerReplicationInfo( PlayerReplicationInfo );
KFPRI = KFPlayerReplicationInfo(PlayerReplicationInfo);
if (Info != CharacterArch || bForce)
{
// Set Family Info
CharacterArch = Info;
CharacterArch.SetCharacterFromArch( self, KFPRI );
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI );
class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI );
CharacterArch.SetCharacterFromArch(self, KFPRI);
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI);
class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI);
SetCharacterAnimationInfo();
@ -779,21 +779,21 @@ simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bFor
WeaponAttachmentChanged(true);
}
}
if( WorldInfo.NetMode != NM_DedicatedServer )
if(WorldInfo.NetMode != NM_DedicatedServer)
{
// Attach/Reattach flashlight components when mesh is set
if ( Flashlight == None && FlashLightTemplate != None )
if (Flashlight == None && FlashLightTemplate != None)
{
Flashlight = new(self) Class'KFFlashlightAttachment' (FlashLightTemplate);
}
if ( FlashLight != None )
if (FlashLight != None)
{
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'));
}
}
@ -807,7 +807,7 @@ ignores FaceRotation, SetMovementPhysics;
{
bIsSprinting = false;
}
simulated event RigidBodyCollision( PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent, const out CollisionImpactData RigidCollisionData, int ContactIndex )
simulated event RigidBodyCollision(PrimitiveComponent HitComponent, PrimitiveComponent OtherComponent, const out CollisionImpactData RigidCollisionData, int ContactIndex)
{
// only check fall damage for Z axis collisions
if (Abs(RigidCollisionData.ContactInfos[0].ContactNormal.Z) > 0.5)
@ -852,9 +852,9 @@ ignores FaceRotation, SetMovementPhysics;
{
local rotator NewRotation;
if( bPlayingFeignDeathRecovery )
if(bPlayingFeignDeathRecovery)
{
if( PlayerController(Controller) != None )
if(PlayerController(Controller) != None)
{
// interpolate Controller yaw to our yaw so that we don't get our rotation snapped around when we get out of feign death
NewRotation = Controller.Rotation;
@ -862,7 +862,7 @@ ignores FaceRotation, SetMovementPhysics;
Controller.SetRotation(NewRotation);
}
Mesh.PhysicsWeight = FMax(Mesh.PhysicsWeight-(DeltaTime*2.f),0.f);
if( Mesh.PhysicsWeight<=0 )
if(Mesh.PhysicsWeight<=0)
StartFeignDeathRecoveryAnim();
}
}
@ -872,7 +872,7 @@ ignores FaceRotation, SetMovementPhysics;
local KFWeapon UTWeap;
// Abort current special move
if( IsDoingSpecialMove() )
if(IsDoingSpecialMove())
SpecialMoveHandler.EndSpecialMove();
bCanPickupInventory = false;
@ -885,11 +885,11 @@ ignores FaceRotation, SetMovementPhysics;
UTWeap.SetIronSights(false);
UTWeap.PlayWeaponPutDown(0.5f);
}
if( WorldInfo.NetMode!=NM_Client )
if(WorldInfo.NetMode!=NM_Client)
{
if( ExtPlayerController(Controller)!=None )
if(ExtPlayerController(Controller)!=None)
ExtPlayerController(Controller).EnterRagdollMode(true);
else if( Controller!=None )
else if(Controller!=None)
Controller.ReplicatedEvent('RagdollMove');
}
}
@ -905,7 +905,7 @@ ignores FaceRotation, SetMovementPhysics;
}
function bool CanBeRedeemed()
{
if( bFeigningDeath )
if(bFeigningDeath)
PlayFeignDeath(false,true);
NextRedeemTimer = WorldInfo.TimeSeconds+0.25;
return false;
@ -916,13 +916,13 @@ ignores FaceRotation, SetMovementPhysics;
Mesh.AnimSets.RemoveItem(WakeUpAnimSet);
BodyStanceNodes[EAS_FullBody].bNoNotifies = false;
if (NextStateName != 'Dying' )
if (NextStateName != 'Dying')
{
bNoWeaponFiring = default.bNoWeaponFiring;
bCanPickupInventory = default.bCanPickupInventory;
UTWeap = KFWeapon(Weapon);
if ( UTWeap != None )
if (UTWeap != None)
{
WeaponAttachmentTemplate = UTWeap.AttachmentArchetype;
UTWeap.PlayWeaponEquip(0.5f);
@ -930,11 +930,11 @@ ignores FaceRotation, SetMovementPhysics;
Global.SetMovementPhysics();
bPlayingFeignDeathRecovery = false;
if( WorldInfo.NetMode!=NM_Client )
if(WorldInfo.NetMode!=NM_Client)
{
if( ExtPlayerController(Controller)!=None )
if(ExtPlayerController(Controller)!=None)
ExtPlayerController(Controller).EnterRagdollMode(false);
else if( Controller!=None )
else if(Controller!=None)
Controller.ReplicatedEvent('EndRagdollMove');
}
@ -952,9 +952,9 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
{
bCanPickupInventory = false;
bNoWeaponFiring = true;
if( ExtPlayerController(Controller)!=None )
if(ExtPlayerController(Controller)!=None)
ExtPlayerController(Controller).EnterRagdollMode(true);
else if( Controller!=None )
else if(Controller!=None)
Controller.ReplicatedEvent('RagdollMove');
SetTimer(2,false,'TransformToZed');
@ -970,7 +970,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
{
local VS_ZedRecentZed Z;
if( Controller==None )
if(Controller==None)
{
Destroy();
return;
@ -978,7 +978,7 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
PlayFeignDeath(false);
SetCollision(false,false);
Z = Spawn(class'VS_ZedRecentZed',,,Location,Rotation,,true);
if( Z==None )
if(Z==None)
{
Super.Died(None,Class'DamageType',Location);
return;
@ -991,15 +991,15 @@ Ignores FaceRotation, SetMovementPhysics, UnsetFeignDeath, Tick, TakeDamage, Die
Controller.Possess(Z,false);
WorldInfo.Game.ChangeTeam(Controller,255,true);
WorldInfo.Game.SetPlayerDefaults(Z);
if( ExtPlayerController(Controller)!=None )
if(ExtPlayerController(Controller)!=None)
Controller.GoToState('RagdollMove');
else if( Controller!=None )
else if(Controller!=None)
Controller.ReplicatedEvent('RagdollMove');
Z.WakeUp();
if( ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None )
if(ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo)!=None)
{
ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealth = Min(Z.Health,255);
ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte( float(Z.Health) / float(Z.HealthMax) );
ExtPlayerReplicationInfo(Controller.PlayerReplicationInfo).PlayerHealthPercent = FloatToByte(float(Z.Health) / float(Z.HealthMax));
}
}
Controller = None;
@ -1021,7 +1021,7 @@ simulated final function InitFPLegs()
FPBodyMesh.SetNotifyRigidBodyCollision(false);
FPBodyMesh.SetTraceBlocking(false, false);
for( i=0; i<Mesh.Materials.length; i++ )
for(i=0; i<Mesh.Materials.length; i++)
FPBodyMesh.SetMaterial(i, Mesh.Materials[i]);
FPBodyMesh.HideBoneByName('neck', PBO_None);
@ -1035,10 +1035,10 @@ simulated function SetMeshVisibility(bool bVisible)
{
Super.SetMeshVisibility(bVisible);
if( Health>0 )
if(Health>0)
{
bOnFirstPerson = !bVisible;
if( AttachedBackItem!=None )
if(AttachedBackItem!=None)
AttachedBackItem.SetHidden(bOnFirstPerson);
UpdateFPLegs();
}
@ -1046,14 +1046,14 @@ simulated function SetMeshVisibility(bool bVisible)
simulated final function UpdateFPLegs()
{
if( FPBodyMesh!=None )
if(FPBodyMesh!=None)
{
if( !bFPLegsAttached && Physics!=PHYS_RigidBody && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs )
if(!bFPLegsAttached && Physics!=PHYS_RigidBody && bOnFirstPerson && Class'ExtPlayerController'.Default.bShowFPLegs)
{
bFPLegsAttached = true;
AttachComponent(FPBodyMesh);
if( !bFPLegsInit && CharacterArch!=None )
if(!bFPLegsInit && CharacterArch!=None)
InitFPLegs();
}
FPBodyMesh.SetHidden(!bOnFirstPerson || !Class'ExtPlayerController'.Default.bShowFPLegs);
@ -1062,11 +1062,11 @@ simulated final function UpdateFPLegs()
simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
{
if( SkelComp==Mesh ) // Do not allow first person legs eat up animation slots.
if(SkelComp==Mesh) // Do not allow first person legs eat up animation slots.
Super.PostInitAnimTree(SkelComp);
}
simulated final function SetBackpackWeapon( class<KFWeapon> WC )
simulated final function SetBackpackWeapon(class<KFWeapon> WC)
{
local KFCharacterInfo_Human MyCharacter;
local Rotator MyRot;
@ -1075,19 +1075,19 @@ simulated final function SetBackpackWeapon( class<KFWeapon> WC )
local int i;
BackpackWeaponClass = WC;
if( WorldInfo.NetMode==NM_DedicatedServer )
if(WorldInfo.NetMode==NM_DedicatedServer)
return;
if( WC!=None )
if(WC!=None)
{
if( AttachedBackItem==None )
if(AttachedBackItem==None)
{
AttachedBackItem = new(Self) class'SkeletalMeshComponent';
AttachedBackItem.SetHidden(false);
AttachedBackItem.SetLightingChannels(PawnLightingChannel);
}
AttachedBackItem.SetSkeletalMesh(WC.Default.AttachmentArchetype.SkelMesh);
for( i=0; i<WC.Default.AttachmentArchetype.SkelMesh.Materials.length; i++ )
for(i=0; i<WC.Default.AttachmentArchetype.SkelMesh.Materials.length; i++)
{
AttachedBackItem.SetMaterial(i, WC.Default.AttachmentArchetype.SkelMesh.Materials[i]);
}
@ -1097,25 +1097,25 @@ simulated final function SetBackpackWeapon( class<KFWeapon> WC )
MyCharacter = KFPlayerReplicationInfo(PlayerReplicationInfo).CharacterArchetypes[KFPlayerReplicationInfo(PlayerReplicationInfo).RepCustomizationInfo.CharacterIndex];
WM = WC.Default.AttachmentArchetype.SkelMesh.Name;
if( ClassIsChildOf(WC, class'KFWeap_Edged_Knife') )
if(ClassIsChildOf(WC, class'KFWeap_Edged_Knife'))
{
MyPos = vect(0,0,10);
MyRot = rot(-16384,-8192,0);
B = 'LeftUpLeg';
}
else if( class<KFWeap_Welder>(WC) != none || class<KFWeap_Healer_Syringe>(WC) != none || class<KFWeap_Pistol_Medic>(WC) != none || class<KFWeap_SMG_Medic>(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase') )
else if(class<KFWeap_Welder>(WC) != none || class<KFWeap_Healer_Syringe>(WC) != none || class<KFWeap_Pistol_Medic>(WC) != none || class<KFWeap_SMG_Medic>(WC) != none || ClassIsChildOf(WC, class'KFWeap_PistolBase') || ClassIsChildOf(WC, class'KFWeap_SMGBase') || ClassIsChildOf(WC, class'KFWeap_ThrownBase'))
{
MyPos = vect(0,0,10);
MyRot = rot(0,0,16384);
B = 'LeftUpLeg';
}
else if( ClassIsChildOf(WC, class'KFWeap_MeleeBase') )
else if(ClassIsChildOf(WC, class'KFWeap_MeleeBase'))
{
MyPos = vect(-5,15,0);
MyRot = rot(0,0,0);
if( class<KFWeap_Edged_Katana>(WC) != none || class<KFWeap_Edged_Zweihander>(WC) != none )
if(class<KFWeap_Edged_Katana>(WC) != none || class<KFWeap_Edged_Zweihander>(WC) != none)
MyPos.Z = -20;
B = 'Spine';
@ -1125,10 +1125,10 @@ simulated final function SetBackpackWeapon( class<KFWeapon> WC )
MyPos = vect(-18.5,16.5,-18);
MyRot = rot(0,0,0);
if( MyCharacter == KFCharacterInfo_Human'CHR_Playable_ARCH.chr_DJSkully_archetype' )
if(MyCharacter == KFCharacterInfo_Human'CHR_Playable_ARCH.chr_DJSkully_archetype')
MyRot.Roll = 8192;
switch( WM )
switch(WM)
{
case 'Wep_3rdP_MB500_Rig':
MyPos.X = -45;
@ -1153,14 +1153,14 @@ simulated final function SetBackpackWeapon( class<KFWeapon> WC )
Mesh.AttachComponent(AttachedBackItem, B);
AttachedBackItem.SetHidden(bOnFirstPerson);
}
else if( AttachedBackItem!=None )
else if(AttachedBackItem!=None)
AttachedBackItem.SetHidden(true);
}
simulated function PlayDying(class<DamageType> DamageType, vector HitLoc)
{
FPBodyMesh.SetHidden(true);
if( AttachedBackItem!=None )
if(AttachedBackItem!=None)
AttachedBackItem.SetHidden(true);
Super.PlayDying(DamageType,HitLoc);
}
@ -1169,7 +1169,7 @@ simulated function SetCharacterAnimationInfo()
{
Super.SetCharacterAnimationInfo();
if( !bFPLegsInit && bFPLegsAttached )
if(!bFPLegsInit && bFPLegsAttached)
InitFPLegs();
}
@ -1186,7 +1186,7 @@ simulated function PlayWeaponSwitch(Weapon OldWeapon, Weapon NewWeapon)
{
Super.PlayWeaponSwitch(OldWeapon, NewWeapon);
if( WorldInfo.NetMode!=NM_Client )
if(WorldInfo.NetMode!=NM_Client)
{
PlayerOldWeapon = KFWeapon(OldWeapon);
SetBackpackWeapon(PlayerOldWeapon!=None ? PlayerOldWeapon.Class : None);
@ -1198,11 +1198,11 @@ simulated function UpdateHealingSpeedBoostMod(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk;
MedPerk = GetMedicPerk(Healer);
if( MedPerk == None )
if(MedPerk == None)
return;
HealingSpeedBoostMod = Min( HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost() );
SetTimer( MedPerk.GetHealingSpeedBoostDuration(),, nameOf(ResetHealingSpeedBoost) );
HealingSpeedBoostMod = Min(HealingSpeedBoostMod + MedPerk.GetHealingSpeedBoost(), MedPerk.GetMaxHealingSpeedBoost());
SetTimer(MedPerk.GetHealingSpeedBoostDuration(),, nameOf(ResetHealingSpeedBoost));
UpdateGroundSpeed();
}
@ -1217,8 +1217,8 @@ simulated function ResetHealingSpeedBoost()
HealingSpeedBoostMod = 0;
UpdateGroundSpeed();
if( IsTimerActive( nameOf( ResetHealingSpeedBoost ) ) )
ClearTimer( nameOf( ResetHealingSpeedBoost ) );
if(IsTimerActive(nameOf(ResetHealingSpeedBoost)))
ClearTimer(nameOf(ResetHealingSpeedBoost));
}
simulated function UpdateHealingDamageBoostMod(ExtPlayerController Healer)
@ -1226,11 +1226,11 @@ simulated function UpdateHealingDamageBoostMod(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk;
MedPerk = GetMedicPerk(Healer);
if( MedPerk == None )
if(MedPerk == None)
return;
HealingDamageBoostMod = Min( HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost() );
SetTimer( MedPerk.GetHealingDamageBoostDuration(),, nameOf(ResetHealingDamageBoost) );
HealingDamageBoostMod = Min(HealingDamageBoostMod + MedPerk.GetHealingDamageBoost(), MedPerk.GetMaxHealingDamageBoost());
SetTimer(MedPerk.GetHealingDamageBoostDuration(),, nameOf(ResetHealingDamageBoost));
}
simulated function float GetHealingDamageBoostModifier()
@ -1241,8 +1241,8 @@ simulated function float GetHealingDamageBoostModifier()
simulated function ResetHealingDamageBoost()
{
HealingDamageBoostMod = 0;
if( IsTimerActive( nameOf( ResetHealingDamageBoost ) ) )
ClearTimer( nameOf( ResetHealingDamageBoost ) );
if(IsTimerActive(nameOf(ResetHealingDamageBoost)))
ClearTimer(nameOf(ResetHealingDamageBoost));
}
simulated function UpdateHealingShieldMod(ExtPlayerController Healer)
@ -1250,11 +1250,11 @@ simulated function UpdateHealingShieldMod(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk;
MedPerk = GetMedicPerk(Healer);
if( MedPerk == None )
if(MedPerk == None)
return;
HealingShieldMod = Min( HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield() );
SetTimer( MedPerk.GetHealingShieldDuration(),, nameOf(ResetHealingShield) );
HealingShieldMod = Min(HealingShieldMod + MedPerk.GetHealingShield(), MedPerk.GetMaxHealingShield());
SetTimer(MedPerk.GetHealingShieldDuration(),, nameOf(ResetHealingShield));
}
simulated function float GetHealingShieldModifier()
@ -1265,8 +1265,8 @@ simulated function float GetHealingShieldModifier()
simulated function ResetHealingShield()
{
HealingShieldMod = 0;
if( IsTimerActive( nameOf( ResetHealingShield ) ) )
ClearTimer( nameOf( ResetHealingShield ) );
if(IsTimerActive(nameOf(ResetHealingShield)))
ClearTimer(nameOf(ResetHealingShield));
}
function SacrificeExplode()
@ -1276,7 +1276,7 @@ function SacrificeExplode()
Super.SacrificeExplode();
DemoPerk = Ext_PerkDemolition(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk);
if( DemoPerk != none )
if(DemoPerk != none)
DemoPerk.bUsedSacrifice = true;
}
@ -1285,7 +1285,7 @@ simulated function Ext_PerkFieldMedic GetMedicPerk(ExtPlayerController Healer)
local Ext_PerkFieldMedic MedPerk;
MedPerk = Ext_PerkFieldMedic(ExtPlayerController(Controller).ActivePerkManager.CurrentPerk);
if( MedPerk != None )
if(MedPerk != None)
return MedPerk;
return None;

View File

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

View File

@ -12,24 +12,24 @@ var array<Emote> EmoteList;
var bool bWaitingCharList,bIsCustomChar;
function InitializeMenu( KFGFxMoviePlayer_Manager InManager )
function InitializeMenu(KFGFxMoviePlayer_Manager InManager)
{
super(KFGFxObject_Menu).InitializeMenu(InManager);
CheckForCustomizationPawn( GetPC() );
CheckForCustomizationPawn(GetPC());
LocalizeText();
EmoteList = class'ExtEmoteList'.static.GetEmoteArray();
InitCharacterMenu();
// TraderItems = KFGameReplicationInfo( GetPC().WorldInfo.GRI ).TraderItems;
// TraderItems = KFGameReplicationInfo(GetPC().WorldInfo.GRI).TraderItems;
}
function InitCharacterMenu()
{
ExtPRI = ExtPlayerReplicationInfo(GetPC().PlayerReplicationInfo);
if( ExtPRI!=None && ExtPRI.bClientInitChars )
if(ExtPRI!=None && ExtPRI.bClientInitChars)
CharListRecieved();
else if( ExtPRI==None )
else if(ExtPRI==None)
{
if( GetPC().PlayerReplicationInfo!=None ) // Faulty mod setup.
if(GetPC().PlayerReplicationInfo!=None) // Faulty mod setup.
{
bWaitingCharList = true;
return;
@ -48,9 +48,9 @@ event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
switch(WidgetName)
{
case 'perkSelectionContainer':
if ( PerkSelectionContainer == none )
if (PerkSelectionContainer == none)
{
PerkSelectionContainer = KFGFxGearContainer_PerksSelection( Widget );
PerkSelectionContainer = KFGFxGearContainer_PerksSelection(Widget);
PerkSelectionContainer.Initialize(self);
}
break;
@ -64,13 +64,13 @@ function OnOpen()
local PlayerController PC;
PC = GetPC();
if( PC == none )
if(PC == none)
return;
CheckForCustomizationPawn( PC );
CheckForCustomizationPawn(PC);
//GetGameViewportClient().HandleInputAxis = OnAxisModified;
if ( PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun )
if (PC.PlayerReplicationInfo.bReadyToPlay && PC.WorldInfo.GRI.bMatchHasBegun)
{
// Players cannot change characters if they are in a game
SetBool("characterButtonEnabled", false);
@ -78,14 +78,14 @@ function OnOpen()
}
/** The customization pawn won't exist if this menu was opened mid-match */
function CheckForCustomizationPawn( PlayerController PC )
function CheckForCustomizationPawn(PlayerController PC)
{
local KFPlayerController KFPC;
if( PC.Pawn == None || (!PC.Pawn.IsAliveAndWell() && KFPawn_Customization(PC.Pawn) == None) )
if(PC.Pawn == None || (!PC.Pawn.IsAliveAndWell() && KFPawn_Customization(PC.Pawn) == None))
{
KFPC = KFPlayerController( PC );
if( KFPC != None )
KFPC = KFPlayerController(PC);
if(KFPC != None)
{
KFPC.SpawnMidGameCustomizationPawn();
}
@ -128,9 +128,9 @@ function UpdateEmoteList()
for (i = 0; i < EmoteList.length; i++)
{
if ( class'ExtEmoteList'.static.GetUnlockedEmote(EmoteList[i].Id, ExtPlayerController(GetPC())) != 'NONE')
if (class'ExtEmoteList'.static.GetUnlockedEmote(EmoteList[i].Id, ExtPlayerController(GetPC())) != 'NONE')
{
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
SlotObject.SetString("label", Localize(EmoteList[i].ItemName, "EmoteName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString));
TexturePath = "img://"$EmoteList[i].IconPath;
@ -157,9 +157,9 @@ function UpdateCharacterList()
bWaitingCharList = false;
ItemIndex = 0;
DataProvider = CreateArray();
for( i=0; i<ExtPRI.CharacterArchetypes.length; i++)
for(i=0; i<ExtPRI.CharacterArchetypes.length; i++)
{
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
SlotObject.SetString("label", Localize(String(ExtPRI.CharacterArchetypes[i].Name), "CharacterName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString));
SlotObject.SetBool("enabled", true);
@ -168,11 +168,11 @@ function UpdateCharacterList()
DataProvider.SetElementObject(ItemIndex, SlotObject);
ItemIndex++;
}
for( i=0; i<ExtPRI.CustomCharList.length; i++)
for(i=0; i<ExtPRI.CustomCharList.length; i++)
{
if( !ExtPRI.IsClientCharLocked(ExtPRI.CharacterArchetypes.length+i) )
if(!ExtPRI.IsClientCharLocked(ExtPRI.CharacterArchetypes.length+i))
{
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", (ExtPRI.CharacterArchetypes.length+i));
SlotObject.SetString("label", Repl(string(ExtPRI.CustomCharList[i].Char.Name),"_"," "));
SlotObject.SetBool("enabled", true);
@ -188,7 +188,7 @@ function UpdateCharacterList()
function UpdateGear()
{
if( bWaitingCharList )
if(bWaitingCharList)
return;
CurrentCharInfo = ExtPRI.GetSelectedArch();
@ -207,16 +207,16 @@ function UpdateGear()
SetCurrentCharacterButtons();
}
final function string GetMenuName( Object Obj )
final function string GetMenuName(Object Obj)
{
return Obj==None ? "Empty" : Repl(string(Obj.Name),"_"," ");
}
final function string GetMenuNameStr( string ObjName )
final function string GetMenuNameStr(string ObjName)
{
local int i;
i = InStr(ObjName,".",true);
if( i!=-1 )
if(i!=-1)
ObjName = Mid(ObjName,i+1);
return Repl(ObjName,"_"," ");
}
@ -236,18 +236,18 @@ function UpdateMeshList(string OutfitKey, string SkinKey, array<OutfitVariants>
Outfit = Outfits[i];
OutfitName = Localize(CharInfoPath, OutfitKey$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString);
if( bIsCustomChar )
if(bIsCustomChar)
OutfitName = GetMenuNameStr(Outfit.MeshName);
if ( InStr(OutfitName, "?INT?") != -1 )
if (InStr(OutfitName, "?INT?") != -1)
continue;
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
SlotObject.SetString("label", OutfitName);
SlotObject.SetBool("enabled", true);
FirstSkin = UpdateOutfitVariants( OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject );
if( string(FirstSkin.UITexture) == "Bad" )
FirstSkin = UpdateOutfitVariants(OutfitKey, SkinKey, Outfit.SkinVariations, i, SlotObject);
if(string(FirstSkin.UITexture) == "Bad")
continue;
TexturePath = "img://"$PathName(FirstSkin.UITexture);
@ -282,7 +282,7 @@ function SkinVariant UpdateOutfitVariants(string OutfitKey, string KeyName, out
FirstSkin = Skin;
bFoundFirst = true;
}
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
SlotObject.SetString("label", Localize(SectionPath, KeyName$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString));
TexturePath = "img://"$PathName(Skin.UITexture);
@ -312,7 +312,7 @@ function UpdateAttachmentsList(array<AttachmentVariants> Attachments)
MyPawn = GetPC().Pawn;
// Insert blank object
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetString("label", class'KFGFxMenu_Gear'.default.NoneString);
SlotObject.SetString("source", "img://"$class'KFGFxMenu_Gear'.default.ClearImagePath);
SlotObject.SetInt("ItemIndex", INDEX_NONE);
@ -323,11 +323,11 @@ function UpdateAttachmentsList(array<AttachmentVariants> Attachments)
for (i = 0; i < Attachments.Length; i++)
{
Variant = Attachments[i];
if ( class'ExtCharacterInfo'.static.IsAttachmentAvailable(CurrentCharInfo, Variant, MyPawn) )
if (class'ExtCharacterInfo'.static.IsAttachmentAvailable(CurrentCharInfo, Variant, MyPawn))
{
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
FirstSkin = UpdateCosmeticVariants( class'KFGFxMenu_Gear'.default.AttachmentKey, class'KFGFxMenu_Gear'.default.AttachmentSkinKey, Variant.AttachmentItem, i, SlotObject );
FirstSkin = UpdateCosmeticVariants(class'KFGFxMenu_Gear'.default.AttachmentKey, class'KFGFxMenu_Gear'.default.AttachmentSkinKey, Variant.AttachmentItem, i, SlotObject);
AttachmentName = bIsCustomChar ? GetMenuNameStr(Variant.MeshName) : Localize(string(Variant.AttachmentItem.Name), class'KFGFxMenu_Gear'.default.AttachmentKey, class'KFGFxMenu_Gear'.default.KFCharacterInfoString);
SlotObject.SetString("label", AttachmentName);
SlotObject.SetBool("enabled", true);
@ -363,7 +363,7 @@ function SkinVariant UpdateCosmeticVariants(string OutfitKey, string KeyName, KF
FirstSkin = Skin;
bFoundFirst = true;
}
SlotObject = CreateObject( "Object" );
SlotObject = CreateObject("Object");
SlotObject.SetInt("ItemIndex", i);
SkinName = Localize(string(Attachment.Name), KeyName$i, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString);
SlotObject.SetString("label", SkinName);
@ -393,7 +393,7 @@ function SetCurrentCharacterButtons()
HeadSkinIndex = ExtPRI.RepCustomizationInfo.HeadSkinIndex;
BodyMeshIndex = ExtPRI.RepCustomizationInfo.BodyMeshIndex;
BodySkinIndex = ExtPRI.RepCustomizationInfo.BodySkinIndex;
if( bCustom )
if(bCustom)
{
CharacterIndex = ExtPRI.CustomCharacter.CharacterIndex;
HeadMeshIndex = ExtPRI.CustomCharacter.HeadMeshIndex;
@ -402,11 +402,11 @@ function SetCurrentCharacterButtons()
BodySkinIndex = ExtPRI.CustomCharacter.BodySkinIndex;
}
DataObject.SetString( "selectedCharacter", (bIsCustomChar ? Repl(string(CurrentCharInfo.Name),"_"," ") : Localize(CharInfoPath, "CharacterName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)) );
DataObject.SetString( "characterBio", (bIsCustomChar ? Repl(CurrentCharInfo.ArmMeshPackageName,"|","\n") : Localize(CharInfoPath, "Description", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)) );
DataObject.SetInt( "selectedCharacterIndex", CharacterIndex );
DataObject.SetString("selectedCharacter", (bIsCustomChar ? Repl(string(CurrentCharInfo.Name),"_"," ") : Localize(CharInfoPath, "CharacterName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)));
DataObject.SetString("characterBio", (bIsCustomChar ? Repl(CurrentCharInfo.ArmMeshPackageName,"|","\n") : Localize(CharInfoPath, "Description", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString)));
DataObject.SetInt("selectedCharacterIndex", CharacterIndex);
SetObject( "selectedCharacter", DataObject);
SetObject("selectedCharacter", DataObject);
//set head
SetGearButtons(HeadMeshIndex, HeadSkinIndex, class'KFGFxMenu_Gear'.Default.HeadMeshKey, class'KFGFxMenu_Gear'.Default.HeadSkinKey, class'KFGFxMenu_Gear'.Default.HeadFunctionKey);
@ -423,18 +423,18 @@ function SetEmoteButton()
local GFxObject DataObject;
local int EmoteIndex;
EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex( class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC())));
EmoteIndex = class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(GetPC())));
DataObject = CreateObject("Object");
if(EmoteIndex == 255)
{
DataObject.SetString( "selectedEmote", "");
DataObject.SetInt( "selectedEmoteIndex", 0 );
DataObject.SetString("selectedEmote", "");
DataObject.SetInt("selectedEmoteIndex", 0);
}
else
{
DataObject.SetString( "selectedEmote", Localize(EmoteList[EmoteIndex].ItemName, "EmoteName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString));
DataObject.SetInt( "selectedEmoteIndex", 0 );
DataObject.SetString("selectedEmote", Localize(EmoteList[EmoteIndex].ItemName, "EmoteName", class'KFGFxMenu_Gear'.Default.KFCharacterInfoString));
DataObject.SetInt("selectedEmoteIndex", 0);
}
@ -449,18 +449,18 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski
local string SkinName, MeshName;
local GFxObject DataObject;
if( bWaitingCharList )
if(bWaitingCharList)
return;
DataObject = CreateObject("Object");
if(MeshIndex == `CLEARED_ATTACHMENT_INDEX)
{
DataObject.SetString( sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString );
DataObject.SetString(sectionFunctionName, class'KFGFxMenu_Gear'.Default.NoneString);
}
else if( bIsCustomChar )
else if(bIsCustomChar)
{
if( MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey )
if(MeshKey==class'KFGFxMenu_Gear'.Default.HeadMeshKey)
{
SkinName = GetMenuName(CurrentCharInfo.HeadVariants[MeshIndex].SkinVariations[SkinIndex].Skin);
MeshName = GetMenuNameStr(CurrentCharInfo.HeadVariants[MeshIndex].MeshName);
@ -471,7 +471,7 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski
MeshName = GetMenuNameStr(CurrentCharInfo.BodyVariants[MeshIndex].MeshName);
}
DataObject.SetString( sectionFunctionName, MeshName @"\n" @SkinName );
DataObject.SetString(sectionFunctionName, MeshName @"\n" @SkinName);
}
else
{
@ -480,13 +480,13 @@ function SetGearButtons(int MeshIndex, int SkinIndex, string MeshKey, string Ski
SkinName = Localize(SectionPath, SkinKey$SkinIndex, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString);
MeshName = Localize(CharInfoPath, CurrentMesh, class'KFGFxMenu_Gear'.Default.KFCharacterInfoString);
DataObject.SetString( sectionFunctionName, MeshName @"\n" @SkinName );
DataObject.SetString(sectionFunctionName, MeshName @"\n" @SkinName);
}
DataObject.SetInt( (sectionFunctionName$"Index"), MeshIndex);
DataObject.SetInt( (sectionFunctionName$"SkinIndex"), SkinIndex);
DataObject.SetInt((sectionFunctionName$"Index"), MeshIndex);
DataObject.SetInt((sectionFunctionName$"SkinIndex"), SkinIndex);
SetObject( sectionFunctionName, DataObject);
SetObject(sectionFunctionName, DataObject);
}
/** Update the labels for our currently equipped attachments */
@ -496,7 +496,7 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa
local int i, AttachmentIndex;
local bool bCustom;
if( bWaitingCharList )
if(bWaitingCharList)
return;
bCustom = ExtPRI.UsesCustomChar();
@ -505,7 +505,7 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa
for(i = 0; i < `MAX_COSMETIC_ATTACHMENTS; i++)
{
AttachmentIndex = bCustom ? ExtPRI.CustomCharacter.AttachmentMeshIndices[i] : ExtPRI.RepCustomizationInfo.AttachmentMeshIndices[i];
if( AttachmentIndex == `CLEARED_ATTACHMENT_INDEX )
if(AttachmentIndex == `CLEARED_ATTACHMENT_INDEX)
{
DataObject.SetString("selectedAttachment_"$i, "----");
}
@ -515,7 +515,7 @@ function SetAttachmentButtons(string AttachmentMeshKey, string sectionFunctionNa
}
}
SetObject( sectionFunctionName, DataObject);
SetObject(sectionFunctionName, DataObject);
}
event OnClose()
@ -526,24 +526,24 @@ event OnClose()
//GetGameViewportClient().HandleInputAxis = none;
if ( class'WorldInfo'.static.IsMenuLevel() )
if (class'WorldInfo'.static.IsMenuLevel())
{
Manager.ManagerObject.SetBool("backgroundVisible", true);
}
// If we are alive, in game, with a playable pawn. switch back to first person view when leaving this menu
PC = GetPC();
if( PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization') )
if(PC != none && PC.WorldInfo.GRI.bMatchHasBegun && PC.Pawn != none && !PC.Pawn.IsA('KFPawn_Customization'))
{
PC.ServerCamera( 'FirstPerson' );
PC.ServerCamera('FirstPerson');
}
}
event bool OnAxisModified( int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad )
event bool OnAxisModified(int ControllerId, name Key, float Delta, float DeltaTime, bool bGamepad)
{
if ( GetPC().PlayerInput.bUsingGamepad )
if (GetPC().PlayerInput.bUsingGamepad)
{
if ( Key == 'XboxTypeS_RightX' && Abs(Delta) > class'KFGFxMenu_Gear'.Default.ControllerRotationThreshold)
if (Key == 'XboxTypeS_RightX' && Abs(Delta) > class'KFGFxMenu_Gear'.Default.ControllerRotationThreshold)
{
Callback_RotateCamera(Delta * class'KFGFxMenu_Gear'.Default.ControllerRotationRate);
}
@ -560,11 +560,11 @@ function Callback_Emote(int Index)
local KFPlayerController KFPC;
KFPC = KFPlayerController(GetPC());
if( KFPC != none )
if(KFPC != none)
{
class'ExtEmoteList'.static.SaveEquippedEmote(EmoteList[Index].ID, ExtPlayerController(KFPC));
if ( ExtPawn_Customization(KFPC.Pawn) != none )
if (ExtPawn_Customization(KFPC.Pawn) != none)
{
ExtPawn_Customization(KFPC.Pawn).PlayEmoteAnimation();
}
@ -573,25 +573,25 @@ function Callback_Emote(int Index)
SetEmoteButton();
}
function Callback_RotateCamera( int RotationDirection )
function Callback_RotateCamera(int RotationDirection)
{
local KFPlayerCamera PlayerCamera;
PlayerCamera = KFPlayerCamera( GetPC().PlayerCamera );
if ( PlayerCamera != none )
PlayerCamera.CustomizationCam.RotatedCamera( RotationDirection );
PlayerCamera = KFPlayerCamera(GetPC().PlayerCamera);
if (PlayerCamera != none)
PlayerCamera.CustomizationCam.RotatedCamera(RotationDirection);
}
function Callback_EndRotateCamera()
{
local KFPlayerCamera PlayerCamera;
PlayerCamera = KFPlayerCamera( GetPC().PlayerCamera );
if ( PlayerCamera != none )
PlayerCamera = KFPlayerCamera(GetPC().PlayerCamera);
if (PlayerCamera != none)
PlayerCamera.CustomizationCam.StartFadeRotation();
}
function Callback_Weapon( int ItemIndex, int SkinIndex )
function Callback_Weapon(int ItemIndex, int SkinIndex)
{
local KFPawn_Customization KFP;
@ -602,14 +602,14 @@ function Callback_Weapon( int ItemIndex, int SkinIndex )
function Callback_BodyCamera()
{
if ( KFPlayerCamera( GetPC().PlayerCamera ) != none )
KFPlayerCamera( GetPC().PlayerCamera ).CustomizationCam.SetBodyView( 0 );
if (KFPlayerCamera(GetPC().PlayerCamera) != none)
KFPlayerCamera(GetPC().PlayerCamera).CustomizationCam.SetBodyView(0);
}
function Callback_HeadCamera()
{
if ( KFPlayerCamera( GetPC().PlayerCamera ) != none )
KFPlayerCamera( GetPC().PlayerCamera ).CustomizationCam.SetBodyView( 1 );
if (KFPlayerCamera(GetPC().PlayerCamera) != none)
KFPlayerCamera(GetPC().PlayerCamera).CustomizationCam.SetBodyView(1);
}
function Callback_Character(int Index)
@ -618,17 +618,17 @@ function Callback_Character(int Index)
UpdateGear();
}
function Callback_Head( int MeshIndex, int SkinIndex )
function Callback_Head(int MeshIndex, int SkinIndex)
{
if( !ExtPRI.UsesCustomChar() ) // Force client to setup custom character now for this server.
if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server.
ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true);
ExtPRI.UpdateCustomization(CO_Head, MeshIndex, SkinIndex);
SetGearButtons(MeshIndex, SkinIndex, class'KFGFxMenu_Gear'.Default.HeadMeshKey, class'KFGFxMenu_Gear'.Default.HeadSkinKey, class'KFGFxMenu_Gear'.Default.HeadFunctionKey);
}
function Callback_Body( int MeshIndex, int SkinIndex )
function Callback_Body(int MeshIndex, int SkinIndex)
{
if( !ExtPRI.UsesCustomChar() ) // Force client to setup custom character now for this server.
if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server.
ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true);
ExtPRI.UpdateCustomization(CO_Body, MeshIndex, SkinIndex);
@ -641,18 +641,18 @@ function Callback_Body( int MeshIndex, int SkinIndex )
SetGearButtons(MeshIndex, SkinIndex, class'KFGFxMenu_Gear'.Default.BodyMeshKey, class'KFGFxMenu_Gear'.Default.BodySkinKey, class'KFGFxMenu_Gear'.Default.BodyFunctionKey);
}
function Callback_Attachment( int MeshIndex, int SkinIndex )
function Callback_Attachment(int MeshIndex, int SkinIndex)
{
local int SlotIndex;
local KFPawn KFP;
if( !ExtPRI.UsesCustomChar() ) // Force client to setup custom character now for this server.
if(!ExtPRI.UsesCustomChar()) // Force client to setup custom character now for this server.
ExtPRI.ChangeCharacter(ExtPRI.RepCustomizationInfo.CharacterIndex,true);
KFP = KFPawn(GetPC().Pawn);
if( KFP!=None && ExtPRI!=None )
if(KFP!=None && ExtPRI!=None)
{
if( MeshIndex==`CLEARED_ATTACHMENT_INDEX )
if(MeshIndex==`CLEARED_ATTACHMENT_INDEX)
ExtPRI.RemoveAttachments();
else
{

View File

@ -22,7 +22,7 @@ function bool IsItemActive(int ItemDefinition)
return false;
}
function Callback_Equip( int ItemDefinition )
function Callback_Equip(int ItemDefinition)
{
local class<KFWeaponDefinition> WeaponDef;
local int ItemIndex;
@ -42,7 +42,7 @@ function Callback_Equip( int ItemDefinition )
{
class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, 0, ExtPlayerController(KFPC));
if(class'WorldInfo'.static.IsConsoleBuild( ))
if(class'WorldInfo'.static.IsConsoleBuild())
{
Manager.CachedProfile.ClearWeaponSkin(WeaponDef.default.WeaponClassPath);
}
@ -50,7 +50,7 @@ function Callback_Equip( int ItemDefinition )
else
{
class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, ItemDefinition, ExtPlayerController(KFPC));
if(class'WorldInfo'.static.IsConsoleBuild( ))
if(class'WorldInfo'.static.IsConsoleBuild())
{
Manager.CachedProfile.SaveWeaponSkin(WeaponDef.default.WeaponClassPath, ItemDefinition);
}

View File

@ -5,34 +5,34 @@ var Ext_PerkBase ExtPrevPerk;
function OnOpen()
{
KFPC = KFPlayerController( GetPC() );
if( ExtKFPC == none )
KFPC = KFPlayerController(GetPC());
if(ExtKFPC == none)
ExtKFPC = ExtPlayerController(KFPC);
if( ExtKFPC.ActivePerkManager==None )
if(ExtKFPC.ActivePerkManager==None)
{
ExtKFPC.SetTimer(0.25,true,'OnOpen',Self);
return;
}
ExtKFPC.ClearTimer('OnOpen',Self);
if( ExtPrevPerk==None )
if(ExtPrevPerk==None)
ExtPrevPerk = ExtKFPC.ActivePerkManager.CurrentPerk;
ExUpdateContainers(ExtPrevPerk);
SetBool( "locked", true);
SetBool("locked", true);
}
final function ExUpdateContainers( Ext_PerkBase PerkClass )
final function ExUpdateContainers(Ext_PerkBase PerkClass)
{
LastPerkLevel = PerkClass.CurrentLevel;
if ( ExtPerksContainer_Header(HeaderContainer)!=none )
ExtPerksContainer_Header(HeaderContainer).ExUpdatePerkHeader( PerkClass );
if ( ExtPerksContainer_Details(DetailsContainer)!=none )
if (ExtPerksContainer_Header(HeaderContainer)!=none)
ExtPerksContainer_Header(HeaderContainer).ExUpdatePerkHeader(PerkClass);
if (ExtPerksContainer_Details(DetailsContainer)!=none)
{
ExtPerksContainer_Details(DetailsContainer).ExUpdateDetails( PerkClass );
ExtPerksContainer_Details(DetailsContainer).ExUpdatePassives( PerkClass );
ExtPerksContainer_Details(DetailsContainer).ExUpdateDetails(PerkClass);
ExtPerksContainer_Details(DetailsContainer).ExUpdatePassives(PerkClass);
}
if ( SelectionContainer != none )
if (SelectionContainer != none)
SelectionContainer.UpdatePerkSelection(ExtKFPC.ActivePerkManager.UserPerks.Find(PerkClass));
}
@ -41,19 +41,19 @@ function CheckTiersForPopup();
event OnClose()
{
ExtPrevPerk = None;
if ( ExtKFPC != none )
if (ExtKFPC != none)
ExtKFPC.ClearTimer('OnOpen',Self);
super.OnClose();
}
function PerkChanged( byte NewPerkIndex, bool bClickedIndex)
function PerkChanged(byte NewPerkIndex, bool bClickedIndex)
{
ExUpdateContainers(ExtPrevPerk);
}
function OneSecondLoop()
{
if( ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel )
if(ExtPrevPerk!=None && LastPerkLevel!=ExtPrevPerk.CurrentLevel)
ExUpdateContainers(ExtPrevPerk);
}

View File

@ -3,10 +3,10 @@ class ExtMenu_Trader extends KFGFxMenu_Trader;
var ExtPlayerController ExtKFPC;
var Ext_PerkBase ExLastPerkClass;
function InitializeMenu( KFGFxMoviePlayer_Manager InManager )
function InitializeMenu(KFGFxMoviePlayer_Manager InManager)
{
Super.InitializeMenu(InManager);
ExtKFPC = ExtPlayerController ( GetPC() );
ExtKFPC = ExtPlayerController (GetPC());
}
function int GetPerkIndex()
{
@ -14,11 +14,11 @@ function int GetPerkIndex()
}
function UpdatePlayerInfo()
{
if( ExtKFPC != none && PlayerInfoContainer != none )
if(ExtKFPC != none && PlayerInfoContainer != none)
{
PlayerInfoContainer.SetPerkInfo();
PlayerInfoContainer.SetPerkList();
if( ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass)
if(ExtKFPC.ActivePerkManager!=None && ExtKFPC.ActivePerkManager.CurrentPerk!=ExLastPerkClass)
{
ExLastPerkClass = ExtKFPC.ActivePerkManager.CurrentPerk;
OnPerkChanged(GetPerkIndex());
@ -33,7 +33,7 @@ function Callback_PerkChanged(int PerkIndex)
ExtKFPC.PendingPerkClass = ExtKFPC.ActivePerkManager.UserPerks[PerkIndex].Class;
ExtKFPC.SwitchToPerk(ExtKFPC.PendingPerkClass);
if( PlayerInventoryContainer != none )
if(PlayerInventoryContainer != none)
{
PlayerInventoryContainer.UpdateLock();
}

View File

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

View File

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

View File

@ -2,23 +2,23 @@ class ExtPawn_Customization extends KFPawn_Customization;
simulated function KFCharacterInfoBase GetCharacterInfo()
{
if( ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None )
if(ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None)
return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch();
return Super.GetCharacterInfo();
}
simulated function SetCharacterArch( KFCharacterInfoBase Info, optional bool bForce )
simulated function SetCharacterArch(KFCharacterInfoBase Info, optional bool bForce)
{
local KFPlayerReplicationInfo KFPRI;
KFPRI = KFPlayerReplicationInfo( PlayerReplicationInfo );
KFPRI = KFPlayerReplicationInfo(PlayerReplicationInfo);
if (Info != CharacterArch || bForce)
{
// Set Family Info
CharacterArch = Info;
CharacterArch.SetCharacterFromArch( self, KFPRI );
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI );
class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch( KFCharacterInfo_Human(CharacterArch), self, KFPRI );
CharacterArch.SetCharacterFromArch(self, KFPRI);
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI);
class'ExtCharacterInfo'.Static.SetFirstPersonArmsFromArch(KFCharacterInfo_Human(CharacterArch), self, KFPRI);
SetCharacterAnimationInfo();
@ -35,9 +35,9 @@ simulated function SetCharacterArch( KFCharacterInfoBase Info, optional bool bFo
}
}
if( CharacterArch != none )
if(CharacterArch != none)
{
if( CharacterArch.VoiceGroupArchName != "" )
if(CharacterArch.VoiceGroupArchName != "")
VoiceGroupArch = class<KFPawnVoiceGroup>(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class'));
}
}
@ -54,18 +54,18 @@ simulated function PlayEmoteAnimation(optional bool bNewCharacter)
local name AnimName;
local float BlendInTime;
AnimName = class'ExtEmoteList'.static.GetUnlockedEmote( class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(Controller)), ExtPlayerController(Controller) );
AnimName = class'ExtEmoteList'.static.GetUnlockedEmote(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(Controller)), ExtPlayerController(Controller));
BlendInTime = (bNewCharacter) ? 0.f : 0.4;
// Briefly turn off notify so that PlayCustomAnim won't call OnAnimEnd (e.g. character swap)
BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification( FALSE );
BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification(FALSE);
BodyStanceNodes[EAS_FullBody].PlayCustomAnim(AnimName, 1.f, BlendInTime, 0.4, false, true);
BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification( TRUE );
BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification(TRUE);
}
function AttachWeaponByItemDefinition( int ItemDefinition )
function AttachWeaponByItemDefinition(int ItemDefinition)
{
local class<KFWeaponDefinition> WeaponDef;
local int ItemINdex;
@ -89,7 +89,7 @@ function AttachWeaponByItemDefinition( int ItemDefinition )
}
//load in and add object .
WeaponPreview = KFWeaponAttachment ( DynamicLoadObject( WeaponDef.default.AttachmentArchtypePath, class'KFWeaponAttachment' ) );
WeaponPreview = KFWeaponAttachment (DynamicLoadObject(WeaponDef.default.AttachmentArchtypePath, class'KFWeaponAttachment'));
//attatch it to player
WeaponAttachmentTemplate = WeaponPreview;

View File

@ -36,59 +36,59 @@ var bool bStatsDirty,bServerReady,bUserStatsBroken,bCurrentlyHealing;
replication
{
// Things the server should send to the client.
if ( bNetDirty )
if (bNetDirty)
CurrentPerk;
}
final function SetGrenadeCap( byte AddedCap )
final function SetGrenadeCap(byte AddedCap)
{
MaxGrenadeCount = Default.MaxGrenadeCount + AddedCap;
if( RepState==REP_Done )
if(RepState==REP_Done)
ClientSetGrenadeCap(MaxGrenadeCount);
}
simulated reliable client function ClientSetGrenadeCap( byte NewCap )
simulated reliable client function ClientSetGrenadeCap(byte NewCap)
{
MaxGrenadeCount = NewCap;
}
function bool ApplyPerkClass( class<Ext_PerkBase> P )
function bool ApplyPerkClass(class<Ext_PerkBase> P)
{
local int i;
for( i=0; i<UserPerks.Length; ++i )
if( UserPerks[i].Class==P )
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].Class==P)
{
ApplyPerk(UserPerks[i]);
return true;
}
return false;
}
function bool ApplyPerkName( string S )
function bool ApplyPerkName(string S)
{
local int i;
for( i=0; i<UserPerks.Length; ++i )
if( string(UserPerks[i].Class.Name)~=S )
for(i=0; i<UserPerks.Length; ++i)
if(string(UserPerks[i].Class.Name)~=S)
{
ApplyPerk(UserPerks[i]);
return true;
}
return false;
}
function ApplyPerk( Ext_PerkBase P )
function ApplyPerk(Ext_PerkBase P)
{
local KFPawn_Human HP;
local KFInventoryManager InvMan;
local Ext_T_ZEDHelper H;
local int i;
if( P==None )
if(P==None)
return;
if( PlayerOwner.Pawn != None )
if(PlayerOwner.Pawn != None)
{
InvMan = KFInventoryManager(PlayerOwner.Pawn.InvManager);
if( InvMan != None )
if(InvMan != None)
InvMan.MaxCarryBlocks = InvMan.Default.MaxCarryBlocks;
foreach PlayerOwner.Pawn.ChildActors(class'Ext_T_ZEDHelper',H)
@ -97,15 +97,15 @@ function ApplyPerk( Ext_PerkBase P )
}
HP = KFPawn_Human(PlayerOwner.Pawn);
if( HP != None )
if(HP != None)
HP.DefaultInventory = HP.Default.DefaultInventory;
}
if( CurrentPerk != None )
if(CurrentPerk != None)
{
CurrentPerk.DeactivateTraits();
for( i=0; i<CurrentPerk.PerkTraits.Length; ++i )
for(i=0; i<CurrentPerk.PerkTraits.Length; ++i)
{
CurrentPerk.PerkTraits[i].TraitType.Static.CancelEffectOn(KFPawn_Human(PlayerOwner.Pawn),CurrentPerk,CurrentPerk.PerkTraits[i].CurrentLevel,CurrentPerk.PerkTraits[i].Data);
}
@ -114,21 +114,21 @@ function ApplyPerk( Ext_PerkBase P )
bStatsDirty = true;
CurrentPerk = P;
if( PRIOwner!=None )
if(PRIOwner!=None)
{
PRIOwner.ECurrentPerk = P.Class;
PRIOwner.FCurrentPerk = P;
P.UpdatePRILevel();
}
if( CurrentPerk!=None )
if(CurrentPerk!=None)
{
CurrentPerk.ActivateTraits();
if( PlayerOwner.Pawn != None )
if(PlayerOwner.Pawn != None)
{
HP = KFPawn_Human(PlayerOwner.Pawn);
if( HP != None )
if(HP != None)
{
HP.HealthMax = HP.default.Health;
HP.MaxArmor = HP.default.MaxArmor;
@ -136,18 +136,18 @@ function ApplyPerk( Ext_PerkBase P )
ModifyHealth(HP.HealthMax);
ModifyArmor(HP.MaxArmor);
if( HP.Health > HP.HealthMax ) HP.Health = HP.HealthMax;
if( HP.Armor > HP.MaxArmor ) HP.Armor = HP.MaxArmor;
if(HP.Health > HP.HealthMax) HP.Health = HP.HealthMax;
if(HP.Armor > HP.MaxArmor) HP.Armor = HP.MaxArmor;
}
}
}
}
simulated final function Ext_PerkBase FindPerk( class<Ext_PerkBase> P )
simulated final function Ext_PerkBase FindPerk(class<Ext_PerkBase> P)
{
local int i;
for( i=0; i<UserPerks.Length; ++i )
if( UserPerks[i].Class==P )
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].Class==P)
return UserPerks[i];
return None;
}
@ -155,7 +155,7 @@ simulated final function Ext_PerkBase FindPerk( class<Ext_PerkBase> P )
simulated function PostBeginPlay()
{
SetTimer(0.01,false,'InitPerks');
if( WorldInfo.NetMode!=NM_Client )
if(WorldInfo.NetMode!=NM_Client)
SetTimer(1,true,'CheckPlayTime');
}
@ -163,18 +163,18 @@ simulated function InitPerks()
{
local Ext_PerkBase P;
if( WorldInfo.NetMode==NM_Client )
if(WorldInfo.NetMode==NM_Client)
{
foreach DynamicActors(class'Ext_PerkBase',P)
if( P.PerkManager!=Self )
if(P.PerkManager!=Self)
RegisterPerk(P);
}
else if( PRIOwner!=PlayerOwner.PlayerReplicationInfo ) // See if was assigned an inactive PRI.
else if(PRIOwner!=PlayerOwner.PlayerReplicationInfo) // See if was assigned an inactive PRI.
{
PRIOwner = ExtPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
if( PRIOwner!=None )
if(PRIOwner!=None)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
{
PRIOwner.ECurrentPerk = CurrentPerk.Class;
CurrentPerk.UpdatePRILevel();
@ -194,22 +194,22 @@ function ServerInitPerks()
{
local int i;
for( i=0; i<UserPerks.Length; ++i )
for(i=0; i<UserPerks.Length; ++i)
UserPerks[i].SetInitialLevel();
bServerReady = true;
CurrentPerk = None;
if( StrPerkName!="" )
if(StrPerkName!="")
ApplyPerkName(StrPerkName);
if( CurrentPerk==None )
if(CurrentPerk==None)
ApplyPerk(UserPerks[Rand(UserPerks.Length)]);
}
simulated function RegisterPerk( Ext_PerkBase P )
simulated function RegisterPerk(Ext_PerkBase P)
{
UserPerks[UserPerks.Length] = P;
P.PerkManager = Self;
}
simulated function UnregisterPerk( Ext_PerkBase P )
simulated function UnregisterPerk(Ext_PerkBase P)
{
UserPerks.RemoveItem(P);
P.PerkManager = None;
@ -219,35 +219,35 @@ function Destroyed()
{
local int i;
for( i=(UserPerks.Length-1); i>=0; --i )
for(i=(UserPerks.Length-1); i>=0; --i)
{
UserPerks[i].PerkManager = None;
UserPerks[i].Destroy();
}
}
function EarnedEXP( int EXP, optional byte Mode )
function EarnedEXP(int EXP, optional byte Mode)
{
// `log("EarnedEXP" @ GetScriptTrace());
if( CurrentPerk!=None )
if(CurrentPerk!=None)
{
// Limit how much EXP we got for healing and welding.
switch( Mode )
switch(Mode)
{
case 1:
ExpUpStatus[0]+=EXP;
EXP = ExpUpStatus[0]/CurrentPerk.WeldExpUpNum;
if( EXP>0 )
if(EXP>0)
ExpUpStatus[0]-=(EXP*CurrentPerk.WeldExpUpNum);
break;
case 2:
ExpUpStatus[1]+=EXP;
EXP = ExpUpStatus[1]/CurrentPerk.HealExpUpNum;
if( EXP>0 )
if(EXP>0)
ExpUpStatus[1]-=(EXP*CurrentPerk.HealExpUpNum);
break;
}
if( EXP>0 && CurrentPerk.EarnedEXP(EXP) )
if(EXP>0 && CurrentPerk.EarnedEXP(EXP))
{
TotalEXP+=EXP;
PRIOwner.RepEXP+=EXP;
@ -257,7 +257,7 @@ function EarnedEXP( int EXP, optional byte Mode )
}
// XML stat writing
function OutputXML( ExtStatWriter Data )
function OutputXML(ExtStatWriter Data)
{
local string S;
local int i;
@ -268,20 +268,20 @@ function OutputXML( ExtStatWriter Data )
Data.WriteValue("exp",string(TotalEXP));
Data.WriteValue("kills",string(TotalKills));
Data.WriteValue("time",string(TotalPlayTime));
if( ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None )
if(ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None)
S = string(ExtPlayerController(Owner).PendingPerkClass.Name);
else S = (CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "None");
Data.WriteValue("activeperk",S);
for( i=0; i<UserPerks.Length; ++i )
if( UserPerks[i].HasAnyProgress() )
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].HasAnyProgress())
UserPerks[i].OutputXML(Data);
Data.EndIntendent();
}
// Data saving.
function SaveData( ExtSaveDataBase Data )
function SaveData(ExtSaveDataBase Data)
{
local int i,o;
@ -295,28 +295,28 @@ function SaveData( ExtSaveDataBase Data )
Data.SaveInt(TotalPlayTime,3);
// Write character.
if( PRIOwner!=None )
if(PRIOwner!=None)
PRIOwner.SaveCustomCharacter(Data);
else class'ExtPlayerReplicationInfo'.Static.DummySaveChar(Data);
// Write selected perk.
if( ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None )
if(ExtPlayerController(Owner)!=None && ExtPlayerController(Owner).PendingPerkClass!=None)
Data.SaveStr(string(ExtPlayerController(Owner).PendingPerkClass.Name));
else Data.SaveStr(CurrentPerk!=None ? string(CurrentPerk.Class.Name) : "");
// Count how many progressed perks we have.
o = 0;
for( i=0; i<UserPerks.Length; ++i )
if( UserPerks[i].HasAnyProgress() )
for(i=0; i<UserPerks.Length; ++i)
if(UserPerks[i].HasAnyProgress())
++o;
// Then write count we have.
Data.SaveInt(o);
// Then perk stats.
for( i=0; i<UserPerks.Length; ++i )
for(i=0; i<UserPerks.Length; ++i)
{
if( !UserPerks[i].HasAnyProgress() ) // Skip this perk.
if(!UserPerks[i].HasAnyProgress()) // Skip this perk.
continue;
Data.SaveStr(string(UserPerks[i].Class.Name));
@ -332,7 +332,7 @@ function SaveData( ExtSaveDataBase Data )
}
// Data loading.
function LoadData( ExtSaveDataBase Data )
function LoadData(ExtSaveDataBase Data)
{
local int i,j,l,o;
local string S;
@ -346,7 +346,7 @@ function LoadData( ExtSaveDataBase Data )
TotalPlayTime = Data.ReadInt(3);
// Read character.
if( PRIOwner!=None )
if(PRIOwner!=None)
{
PRIOwner.RepKills = TotalKills;
PRIOwner.RepEXP = TotalEXP;
@ -360,13 +360,13 @@ function LoadData( ExtSaveDataBase Data )
StrPerkName = Data.ReadStr();
l = Data.ReadInt(); // Perk stats length.
for( i=0; i<l; ++i )
for(i=0; i<l; ++i)
{
S = Data.ReadStr();
o = Data.ReadInt(1); // Read skip offset.
Data.PushEOFLimit(o);
for( j=0; j<UserPerks.Length; ++j )
if( S~=string(UserPerks[j].Class.Name) )
for(j=0; j<UserPerks.Length; ++j)
if(S~=string(UserPerks[j].Class.Name))
{
UserPerks[j].LoadData(Data);
break;
@ -377,33 +377,33 @@ function LoadData( ExtSaveDataBase Data )
bStatsDirty = false;
}
function AddDefaultInventory( KFPawn P )
function AddDefaultInventory(KFPawn P)
{
local KFInventoryManager KFIM;
if( P != none && P.InvManager != none )
if(P != none && P.InvManager != none)
{
KFIM = KFInventoryManager(P.InvManager);
if( KFIM != none )
if(KFIM != none)
{
//Grenades added on spawn
KFIM.GiveInitialGrenadeCount();
}
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.AddDefaultInventory(P);
}
}
simulated function PlayerDied()
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.PlayerDied();
}
function PreNotifyPlayerLeave()
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.DeactivateTraits();
}
@ -417,10 +417,10 @@ function InitiateClientRep()
}
function ReplicateTimer()
{
switch( RepState )
switch(RepState)
{
case REP_CustomCharacters: // Replicate custom characters.
if( RepIndex>=PRIOwner.CustomCharList.Length )
if(RepIndex>=PRIOwner.CustomCharList.Length)
{
PRIOwner.AllCharReceived();
RepIndex = 0;
@ -433,7 +433,7 @@ function ReplicateTimer()
}
break;
case REP_CustomInventory: // Replicate custom trader inventory
if( !PRIOwner.OnRepNextItem(PRIOwner,RepIndex) )
if(!PRIOwner.OnRepNextItem(PRIOwner,RepIndex))
{
RepIndex = 0;
++RepState;
@ -441,20 +441,20 @@ function ReplicateTimer()
else ++RepIndex;
break;
case REP_PerkClasses: // Open up all actor channel connections.
if( RepIndex>=UserPerks.Length )
if(RepIndex>=UserPerks.Length)
{
RepIndex = 0;
++RepState;
}
else if( UserPerks[RepIndex].bClientAuthorized )
else if(UserPerks[RepIndex].bClientAuthorized)
{
if( UserPerks[RepIndex].bPerkNetReady )
if(UserPerks[RepIndex].bPerkNetReady)
++RepIndex;
}
else
{
UserPerks[RepIndex].RemoteRole = ROLE_SimulatedProxy;
if( UserPerks[RepIndex].NextAuthTime<WorldInfo.RealTimeSeconds )
if(UserPerks[RepIndex].NextAuthTime<WorldInfo.RealTimeSeconds)
{
UserPerks[RepIndex].NextAuthTime = WorldInfo.RealTimeSeconds+0.5;
UserPerks[RepIndex].ClientAuth();
@ -462,100 +462,100 @@ function ReplicateTimer()
}
break;
default:
if( MaxGrenadeCount!=Default.MaxGrenadeCount )
if(MaxGrenadeCount!=Default.MaxGrenadeCount)
ClientSetGrenadeCap(MaxGrenadeCount);
ClearTimer('ReplicateTimer');
}
}
function bool CanEarnSmallRadiusKillXP( class<DamageType> DT )
function bool CanEarnSmallRadiusKillXP(class<DamageType> DT)
{
return true;
}
simulated function ModifySpeed( out float Speed )
simulated function ModifySpeed(out float Speed)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
Speed *= CurrentPerk.Modifiers[0];
}
function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<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);
}
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);
}
simulated function ModifyRecoil( out float CurrentRecoilModifier, KFWeapon KFW )
simulated function ModifyRecoil(out float CurrentRecoilModifier, KFWeapon KFW)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyRecoil(CurrentRecoilModifier,KFW);
}
simulated function ModifySpread( out float InSpread )
simulated function ModifySpread(out float InSpread)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifySpread(InSpread);
}
simulated function ModifyRateOfFire( out float InRate, KFWeapon KFW )
simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyRateOfFire(InRate,KFW);
}
simulated function float GetReloadRateScale(KFWeapon KFW)
{
return (CurrentPerk!=None ? CurrentPerk.GetReloadRateScale(KFW) : 1.f);
}
simulated function bool GetUsingTactialReload( KFWeapon KFW )
simulated function bool GetUsingTactialReload(KFWeapon KFW)
{
return (CurrentPerk!=None ? CurrentPerk.GetUsingTactialReload(KFW) : false);
}
function ModifyHealth( out int InHealth )
function ModifyHealth(out int InHealth)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyHealth(InHealth);
}
function ModifyArmor( out byte MaxArmor )
function ModifyArmor(out byte MaxArmor)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyArmor(MaxArmor);
}
function float GetKnockdownPowerModifier( optional class<DamageType> DamageType, optional byte BodyPart, optional bool bIsSprinting=false )
function float GetKnockdownPowerModifier(optional class<DamageType> DamageType, optional byte BodyPart, optional bool bIsSprinting=false)
{
return (CurrentPerk!=None ? CurrentPerk.GetKnockdownPowerModifier() : 1.f);
}
function float GetStumblePowerModifier( optional KFPawn KFP, optional class<KFDamageType> DamageType, optional out float CooldownModifier, optional byte BodyPart )
function float GetStumblePowerModifier(optional KFPawn KFP, optional class<KFDamageType> DamageType, optional out float CooldownModifier, optional byte BodyPart)
{
return (CurrentPerk!=None ? CurrentPerk.GetKnockdownPowerModifier() : 1.f);
}
function float GetStunPowerModifier( optional class<DamageType> DamageType, optional byte HitZoneIdx )
function float GetStunPowerModifier(optional class<DamageType> DamageType, optional byte HitZoneIdx)
{
return (CurrentPerk!=None ? CurrentPerk.GetStunPowerModifier(DamageType,HitZoneIdx) : 1.f);
}
simulated function ModifyMeleeAttackSpeed( out float InDuration, KFWeapon KFW )
simulated function ModifyMeleeAttackSpeed(out float InDuration, KFWeapon KFW)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyMeleeAttackSpeed(InDuration);
}
simulated function class<KFProj_Grenade> GetGrenadeClass()
{
return (CurrentPerk!=None ? CurrentPerk.GrenadeClass : GrenadeClass);
}
simulated function ModifyWeldingRate( out float FastenRate, out float UnfastenRate )
simulated function ModifyWeldingRate(out float FastenRate, out float UnfastenRate)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyWeldingRate(FastenRate,UnfastenRate);
}
simulated function bool HasNightVision()
{
return (CurrentPerk!=None ? CurrentPerk.bHasNightVision : false);
}
function bool RepairArmor( Pawn HealTarget )
function bool RepairArmor(Pawn HealTarget)
{
return (CurrentPerk!=None ? CurrentPerk.RepairArmor(HealTarget) : false);
}
function bool ModifyHealAmount( out float HealAmount )
function bool ModifyHealAmount(out float HealAmount)
{
return (CurrentPerk!=None ? CurrentPerk.ModifyHealAmount(HealAmount) : false);
}
@ -563,28 +563,28 @@ function bool CanNotBeGrabbed()
{
return (CurrentPerk!=None ? !CurrentPerk.bCanBeGrabbed : false);
}
simulated function ModifyMagSizeAndNumber( KFWeapon KFW, out int MagazineCapacity, optional array< Class<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);
}
simulated function ModifySpareAmmoAmount( KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false )
simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary=false)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifySpareAmmoAmount(KFW,PrimarySpareAmmo,TraderItem,bSecondary);
}
simulated function ModifyMaxSpareAmmoAmount( KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false )
simulated function ModifyMaxSpareAmmoAmount(KFWeapon KFW, out int SpareAmmoCapacity, optional const out STraderItem TraderItem, optional bool bSecondary=false)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifySpareAmmoAmount(KFW,SpareAmmoCapacity,TraderItem,bSecondary);
}
simulated function bool ShouldMagSizeModifySpareAmmo( KFWeapon KFW, optional Class<KFPerk> WeaponPerkClass )
simulated function bool ShouldMagSizeModifySpareAmmo(KFWeapon KFW, optional Class<KFPerk> WeaponPerkClass)
{
return (CurrentPerk!=None ? CurrentPerk.ShouldMagSizeModifySpareAmmo(KFW,WeaponPerkClass) : false);
}
simulated function ModifyHealerRechargeTime( out float RechargeRate )
simulated function ModifyHealerRechargeTime(out float RechargeRate)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyHealerRechargeTime(RechargeRate);
}
simulated function bool CanExplosiveWeld()
@ -597,7 +597,7 @@ simulated function bool IsOnContactActive()
}
function bool CanSpreadNapalm()
{
if( CurrentPerk!=None && CurrentPerk.bNapalmFire && LastNapalmTime!=WorldInfo.TimeSeconds )
if(CurrentPerk!=None && CurrentPerk.bNapalmFire && LastNapalmTime!=WorldInfo.TimeSeconds)
{
LastNapalmTime = WorldInfo.TimeSeconds; // Avoid infinite script recursion in KFPawn_Monster.
return true;
@ -610,31 +610,31 @@ simulated function bool IsRangeActive()
}
simulated function DrawSpecialPerkHUD(Canvas C)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.DrawSpecialPerkHUD(C);
}
function PlayerKilled( KFPawn_Monster Victim, class<DamageType> DamageType )
function PlayerKilled(KFPawn_Monster Victim, class<DamageType> DamageType)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.PlayerKilled(Victim,DamageType);
}
function ModifyBloatBileDoT( out float DoTScaler )
function ModifyBloatBileDoT(out float DoTScaler)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.ModifyBloatBileDoT(DoTScaler);
}
simulated function bool GetIsUberAmmoActive( KFWeapon KFW )
simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
{
return (CurrentPerk!=None ? CurrentPerk.GetIsUberAmmoActive(KFW) : false);
}
function UpdatePerkHeadShots( ImpactInfo Impact, class<DamageType> DamageType, int NumHit )
function UpdatePerkHeadShots(ImpactInfo Impact, class<DamageType> DamageType, int NumHit)
{
if( CurrentPerk!=None )
if(CurrentPerk!=None)
CurrentPerk.UpdatePerkHeadShots(Impact,DamageType,NumHit);
}
function CheckForAirborneAgent( KFPawn HealTarget, class<DamageType> DamType, int HealAmount )
function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int HealAmount)
{
if( !bCurrentlyHealing && CurrentPerk!=None )
if(!bCurrentlyHealing && CurrentPerk!=None)
{
// Using boolean to avoid infinite recursion.
bCurrentlyHealing = true;
@ -642,7 +642,7 @@ function CheckForAirborneAgent( KFPawn HealTarget, class<DamageType> DamType, in
bCurrentlyHealing = false;
}
}
simulated function float GetZedTimeModifier( KFWeapon W )
simulated function float GetZedTimeModifier(KFWeapon W)
{
return (CurrentPerk!=None ? CurrentPerk.GetZedTimeModifier(W) : 0.f);
}
@ -652,14 +652,14 @@ function bool IsAcidicCompoundActive()
{
return (CurrentPerk!=None ? CurrentPerk.bToxicDart : false);
}
function ModifyACDamage( out int InDamage )
function ModifyACDamage(out int InDamage)
{
if( CurrentPerk!=None && CurrentPerk.bToxicDart )
if(CurrentPerk!=None && CurrentPerk.bToxicDart)
InDamage += CurrentPerk.ToxicDartDamage;
}
// Zombie explosion!
function bool CouldBeZedShrapnel( class<KFDamageType> KFDT )
function bool CouldBeZedShrapnel(class<KFDamageType> KFDT)
{
return (CurrentPerk!=None ? (CurrentPerk.bFireExplode && class<KFDT_Fire>(KFDT)!=None) : false);
}
@ -681,7 +681,7 @@ function NotifyZedTimeStarted()
{
CurrentPerk.NotifyZedTimeStarted();
}
simulated function float GetZedTimeExtensions( byte Level )
simulated function float GetZedTimeExtensions(byte Level)
{
return CurrentPerk.GetZedTimeExtensions(Level);
}
@ -691,11 +691,11 @@ simulated function bool HasHeavyArmor()
{
return (CurrentPerk!=None && CurrentPerk.bHeavyArmor);
}
simulated function float GetIronSightSpeedModifier( KFWeapon KFW )
simulated function float GetIronSightSpeedModifier(KFWeapon KFW)
{
return (CurrentPerk!=None ? CurrentPerk.GetIronSightSpeedModifier(KFW) : 1.f);
}
simulated function float GetCrouchSpeedModifier( KFWeapon KFW )
simulated function float GetCrouchSpeedModifier(KFWeapon KFW)
{
return (CurrentPerk!=None ? CurrentPerk.GetIronSightSpeedModifier(KFW) : 1.f);
}
@ -723,7 +723,7 @@ simulated function bool ShouldNeverDud()
}
function NotifyPerkSacrificeExploded()
{
if( Ext_PerkDemolition(CurrentPerk) != none ) Ext_PerkDemolition(CurrentPerk).bUsedSacrifice = true;
if(Ext_PerkDemolition(CurrentPerk) != none) Ext_PerkDemolition(CurrentPerk).bUsedSacrifice = true;
}
simulated function float GetAoERadiusModifier()
{
@ -755,11 +755,11 @@ static function class<KFDamageType> GetToxicDmgTypeClass()
{
return class'Ext_PerkFieldMedic'.static.GetToxicDmgTypeClass();
}
static function ModifyToxicDmg( out int ToxicDamage )
static function ModifyToxicDmg(out int ToxicDamage)
{
ToxicDamage = class'Ext_PerkFieldMedic'.static.ModifyToxicDmg(ToxicDamage);
}
simulated function float GetSnarePower( optional class<DamageType> DamageType, optional byte HitZoneIdx )
simulated function float GetSnarePower(optional class<DamageType> DamageType, optional byte HitZoneIdx)
{
return (Ext_PerkFieldMedic(CurrentPerk)!=None ? Ext_PerkFieldMedic(CurrentPerk).GetSnarePower(DamageType, HitZoneIdx) : 0.f);
}
@ -769,7 +769,7 @@ simulated function bool CanRepairDoors()
{
return (Ext_PerkSupport(CurrentPerk)!=None ? Ext_PerkSupport(CurrentPerk).CanRepairDoors() : false);
}
simulated function float GetPenetrationModifier( byte Level, class<KFDamageType> DamageType, optional bool bForce )
simulated function float GetPenetrationModifier(byte Level, class<KFDamageType> DamageType, optional bool bForce )
{
return (Ext_PerkSupport(CurrentPerk)!=None ? Ext_PerkSupport(CurrentPerk).GetPenetrationModifier(Level, DamageType, bForce) : 0.f);
}
@ -777,12 +777,12 @@ simulated function float GetPenetrationModifier( byte Level, class<KFDamageType>
// Other
function ApplySkillsToPawn()
{
if( CheckOwnerPawn() )
if(CheckOwnerPawn())
{
OwnerPawn.UpdateGroundSpeed();
OwnerPawn.bMovesFastInZedTime = false;
if( MyPRI == none )
if(MyPRI == none)
MyPRI = KFPlayerReplicationInfo(OwnerPawn.PlayerReplicationInfo);
ApplyWeightLimits();

View File

@ -1,8 +1,8 @@
class ExtPerksContainer_Details extends KFGFxPerksContainer_Details;
`define AddWeaponsInfo(InClassDef) if( `InClassDef!=None ) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath())
`define AddWeaponsInfo(InClassDef) if(`InClassDef!=None) AddWeaponInfo(WeaponNames, WeaponSources, `InClassDef.static.GetItemName(), `InClassDef.static.GetImagePath())
final function ExUpdateDetails( Ext_PerkBase PerkClass )
final function ExUpdateDetails(Ext_PerkBase PerkClass)
{
local GFxObject DetailsProvider;
local KFPlayerController KFPC;
@ -11,15 +11,15 @@ final function ExUpdateDetails( Ext_PerkBase PerkClass )
local array<string> WeaponSources;
local int i;
DetailsProvider = CreateObject( "Object" );
DetailsProvider = CreateObject("Object");
KFPC = KFPlayerController( GetPC() );
KFPC = KFPlayerController(GetPC());
if ( KFPC != none)
if (KFPC != none)
{
KFGRI = KFGameReplicationInfo(KFPC.WorldInfo.GRI);
DetailsProvider.SetString( "ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP );
DetailsProvider.SetString("ExperienceMessage", ExperienceString @ PerkClass.CurrentEXP);
if(KFGRI != none)
{
@ -31,31 +31,31 @@ final function ExUpdateDetails( Ext_PerkBase PerkClass )
for (i = 0; i < WeaponNames.length; i++)
{
DetailsProvider.SetString( "WeaponName" $ i, WeaponNames[i] );
DetailsProvider.SetString( "WeaponImage" $ i, "img://"$WeaponSources[i] );
DetailsProvider.SetString("WeaponName" $ i, WeaponNames[i]);
DetailsProvider.SetString("WeaponImage" $ i, "img://"$WeaponSources[i]);
}
DetailsProvider.SetString( "EXPAction1", "Kill zombies" );
//DetailsProvider.SetString( "EXPAction2", PerkClass.default.EXPAction2 );
DetailsProvider.SetString("EXPAction1", "Kill zombies");
//DetailsProvider.SetString("EXPAction2", PerkClass.default.EXPAction2);
SetObject( "detailsData", DetailsProvider );
SetObject("detailsData", DetailsProvider);
}
}
final function ExUpdatePassives( Ext_PerkBase PerkClass )
final function ExUpdatePassives(Ext_PerkBase PerkClass)
{
local GFxObject PassivesProvider;
local GFxObject PassiveObject;
local int i;
PassivesProvider = CreateArray();
for( i=0; i<PerkClass.PerkStats.Length; ++i )
for(i=0; i<PerkClass.PerkStats.Length; ++i)
{
PassiveObject = CreateObject( "Object" );
PassiveObject.SetString( "PassiveTitle", PerkClass.GetStatUIStr(i) );
PassiveObject.SetString( "PerkBonusModifier", "");
PassiveObject.SetString( "PerkBonusAmount", "" );
PassivesProvider.SetElementObject( i, PassiveObject );
PassiveObject = CreateObject("Object");
PassiveObject.SetString("PassiveTitle", PerkClass.GetStatUIStr(i));
PassiveObject.SetString("PerkBonusModifier", "");
PassiveObject.SetString("PerkBonusAmount", "");
PassivesProvider.SetElementObject(i, PassiveObject);
}
SetObject( "passivesData", PassivesProvider );
SetObject("passivesData", PassivesProvider);
}

View File

@ -1,17 +1,17 @@
class ExtPerksContainer_Header extends KFGFxPerksContainer_Header;
final function ExUpdatePerkHeader( Ext_PerkBase PerkClass )
final function ExUpdatePerkHeader(Ext_PerkBase PerkClass)
{
local GFxObject PerkDataProvider;
PerkDataProvider = CreateObject( "Object" );
PerkDataProvider.SetString( "perkTitle", PerkClass.PerkName );
PerkDataProvider.SetString( "perkLevel", LevelString@PerkClass.CurrentLevel);
PerkDataProvider.SetString( "iconSource", PerkClass.GetPerkIconPath(PerkClass.CurrentLevel) );
PerkDataProvider.SetString( "prestigeLevel", ""); //not used yet so not point to populating with data
PerkDataProvider.SetString( "xpString", PerkClass.CurrentEXP$"/"$PerkClass.NextLevelEXP );
PerkDataProvider.SetFloat( "xpPercent", PerkClass.GetProgressPercent() );
SetObject( "perkData", PerkDataProvider );
PerkDataProvider = CreateObject("Object");
PerkDataProvider.SetString("perkTitle", PerkClass.PerkName);
PerkDataProvider.SetString("perkLevel", LevelString@PerkClass.CurrentLevel);
PerkDataProvider.SetString("iconSource", PerkClass.GetPerkIconPath(PerkClass.CurrentLevel));
PerkDataProvider.SetString("prestigeLevel", ""); //not used yet so not point to populating with data
PerkDataProvider.SetString("xpString", PerkClass.CurrentEXP$"/"$PerkClass.NextLevelEXP);
PerkDataProvider.SetFloat("xpPercent", PerkClass.GetProgressPercent());
SetObject("perkData", PerkDataProvider);
}
defaultproperties

View File

@ -8,24 +8,24 @@ function UpdatePerkSelection(byte SelectedPerkIndex)
local ExtPlayerController KFPC;
local Ext_PerkBase PerkClass;
KFPC = ExtPlayerController( GetPC() );
KFPC = ExtPlayerController(GetPC());
if ( KFPC!=none && KFPC.ActivePerkManager!=None )
if (KFPC!=none && KFPC.ActivePerkManager!=None)
{
DataProvider = CreateArray();
for (i = 0; i < KFPC.ActivePerkManager.UserPerks.Length; i++)
{
PerkClass = KFPC.ActivePerkManager.UserPerks[i];
TempObj = CreateObject( "Object" );
TempObj.SetInt( "PerkLevel", PerkClass.CurrentLevel );
TempObj.SetString( "Title", PerkClass.PerkName );
TempObj.SetString( "iconSource", PerkClass.GetPerkIconPath(PerkClass.CurrentLevel) );
TempObj = CreateObject("Object");
TempObj.SetInt("PerkLevel", PerkClass.CurrentLevel);
TempObj.SetString("Title", PerkClass.PerkName);
TempObj.SetString("iconSource", PerkClass.GetPerkIconPath(PerkClass.CurrentLevel));
TempObj.SetBool("bTierUnlocked", true);
DataProvider.SetElementObject( i, TempObj );
DataProvider.SetElementObject(i, TempObj);
}
SetObject( "perkData", DataProvider );
SetObject("perkData", DataProvider);
SetInt("SelectedIndex", SelectedPerkIndex);
UpdatePendingPerkInfo(SelectedPerkIndex);
@ -37,8 +37,8 @@ function UpdatePendingPerkInfo(byte SelectedPerkIndex)
local ExtPlayerController KFPC;
local Ext_PerkBase PerkClass;
KFPC = ExtPlayerController( GetPC() );
if( KFPC != none )
KFPC = ExtPlayerController(GetPC());
if(KFPC != none)
{
PerkClass = KFPC.ActivePerkManager.UserPerks[SelectedPerkIndex];
SetPendingPerkChanges(PerkClass.PerkName, PerkClass.GetPerkIconPath(PerkClass.CurrentLevel), "Perk changes will be applied when you die.");

File diff suppressed because it is too large Load Diff

View File

@ -16,14 +16,14 @@ simulated exec function IronSights(optional bool bHoldButtonMode)
{
local KFWeapon KFW;
if( Pawn != none )
if(Pawn != none)
{
if( KFPawn_Monster(Pawn)!=None )
if(KFPawn_Monster(Pawn)!=None)
Pawn.StartFire(1);
else
{
KFW = KFWeapon(Pawn.Weapon);
if ( KFW != None )
if (KFW != None)
KFW.SetIronSights((bHoldButtonMode) ? true : !KFW.bUsingSights);
}
}
@ -32,14 +32,14 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode)
{
local KFWeapon KFW;
if( Pawn != none )
if(Pawn != none)
{
if( KFPawn_Monster(Pawn)!=None )
if(KFPawn_Monster(Pawn)!=None)
Pawn.StopFire(1);
else
{
KFW = KFWeapon(Pawn.Weapon);
if ( !KFW.bHasIronSights || bHoldButtonMode )
if (!KFW.bHasIronSights || bHoldButtonMode)
KFW.SetIronSights(false);
}
}
@ -47,40 +47,40 @@ simulated exec function IronSightsRelease(optional bool bHoldButtonMode)
simulated exec function ToggleFlashlight()
{
if( KFPawn_Monster(Pawn)!=None && Pawn.Health>0 )
if(KFPawn_Monster(Pawn)!=None && Pawn.Health>0)
SetNightVision(!bNightVisionActive);
else Super.ToggleFlashlight();
}
function PreClientTravel( string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel)
function PreClientTravel(string PendingURL, ETravelType TravelType, bool bIsSeamlessTravel)
{
Super.PreClientTravel(PendingURL,TravelType,bIsSeamlessTravel);
if( !bHandledTravel )
if(!bHandledTravel)
{
bHandledTravel = true;
if( KFExtendedHUD(MyHUD)!=None )
if(KFExtendedHUD(MyHUD)!=None)
KFExtendedHUD(MyHUD).NotifyLevelChange(true);
}
}
event bool FilterButtonInput(int ControllerId, Name Key, EInputEvent Event, float AmountDepressed, bool bGamepad)
{
if ( MyGfxManager.bAfterLobby && Event==IE_Pressed && (Key == 'Escape' || Key == 'XboxTypeS_Start') )
if (MyGfxManager.bAfterLobby && Event==IE_Pressed && (Key == 'Escape' || Key == 'XboxTypeS_Start'))
{
if( MyGUIController==None || MyGUIController.bIsInvalid )
if(MyGUIController==None || MyGUIController.bIsInvalid)
{
MyGUIController = class'KF2GUIController'.Static.GetGUIController(Outer);
if( MyGUIController==None )
if(MyGUIController==None)
{
ExtPlayerController(Outer).CancelConnection();
return false;
}
}
if( MyGUIController.bIsInMenuState )
if(MyGUIController.bIsInMenuState)
{
return false;
}
else if( MyGFxManager.bMenusOpen )
else if(MyGFxManager.bMenusOpen)
{
return MyGFxManager.ToggleMenus();
}

View File

@ -69,7 +69,7 @@ var repnotify class<Ext_TraitSupply> HasSupplier;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
RespawnCounter,AdminType,ECurrentPerk,ECurrentPerkLevel,ECurrentPerkPrestige,RepKills,RepEXP,RepLevelProgress,bIsDev,NameTag,FixedData,bHiddenUser,CustomCharacter,HasSupplier;
if (bNetInitial || bInitialPT)
RepPlayTime;
@ -81,22 +81,22 @@ simulated function PostBeginPlay()
Super.PostBeginPlay();
SetTimer(1,true,'TickPT');
if( WorldInfo.NetMode!=NM_DedicatedServer )
if(WorldInfo.NetMode!=NM_DedicatedServer)
{
HUDPerkColor = PickPerkColor();
PC = GetALocalPlayerController();
if( PC!=None )
if(PC!=None)
LocalOwnerPRI = ExtPlayerReplicationInfo(PC.PlayerReplicationInfo);
}
else LocalOwnerPRI = Self; // Dedicated server can use self PRI.
}
// Resupply traits:
simulated final function bool CanUseSupply( Pawn P )
simulated final function bool CanUseSupply(Pawn P)
{
return (SupplierLimit.SuppliedPawn!=P || SupplierLimit.NextSupplyTimer<WorldInfo.TimeSeconds);
}
simulated final function UsedSupply( Pawn P, float NextTime )
simulated final function UsedSupply(Pawn P, float NextTime)
{
SupplierLimit.SuppliedPawn = P;
SupplierLimit.NextSupplyTimer = WorldInfo.TimeSeconds+NextTime;
@ -108,7 +108,7 @@ simulated function ClientInitialize(Controller C)
Super.ClientInitialize(C);
if( WorldInfo.NetMode!=NM_DedicatedServer )
if(WorldInfo.NetMode!=NM_DedicatedServer)
{
LocalOwnerPRI = Self;
@ -125,7 +125,7 @@ simulated function TickPT()
simulated event ReplicatedEvent(name VarName)
{
switch( VarName )
switch(VarName)
{
case 'RepLevelProgress':
HUDPerkColor = PickPerkColor();
@ -148,7 +148,7 @@ function SetPlayerName(string S)
Super.SetPlayerName(S);
UpdateNameTag();
}
function SetPlayerNameTag( string S )
function SetPlayerNameTag(string S)
{
NameTag = S;
UpdateNameTag();
@ -163,11 +163,11 @@ function OverrideWith(PlayerReplicationInfo PRI)
}
simulated final function UpdateNameTag()
{
if( NameTag!="" )
if(NameTag!="")
TaggedPlayerName = "["$NameTag$"] "$PlayerName;
else TaggedPlayerName = PlayerName;
}
final function SetLevelProgress( int CurLevel, int CurPrest, int MinLevel, int MaxLevel )
final function SetLevelProgress(int CurLevel, int CurPrest, int MinLevel, int MaxLevel)
{
local float V;
@ -177,7 +177,7 @@ final function SetLevelProgress( int CurLevel, int CurPrest, int MinLevel, int M
RepLevelProgress = V;
bForceNetUpdate = true;
if( WorldInfo.NetMode!=NM_DedicatedServer )
if(WorldInfo.NetMode!=NM_DedicatedServer)
HUDPerkColor = PickPerkColor();
}
simulated final function string GetPerkLevelStr()
@ -189,20 +189,20 @@ simulated final function color PickPerkColor()
local float P;
local byte i;
if( RepLevelProgress==0 )
if(RepLevelProgress==0)
return MakeColor(255,255,255,255);
P = float(RepLevelProgress) / 255.f;
if( P<0.25f ) // White - Blue
if(P<0.25f) // White - Blue
{
i = 255 - (P*1020.f);
return MakeColor(i,i,255,255);
}
if( P<0.5f ) // Blue - Green
if(P<0.5f) // Blue - Green
{
i = ((P-0.25f)*1020.f);
return MakeColor(0,i,255-i,255);
}
if( P<0.75f ) // Green - Red
if(P<0.75f) // Green - Red
{
i = ((P-0.5f)*1020.f);
return MakeColor(i,255-i,0,255);
@ -212,7 +212,7 @@ simulated final function color PickPerkColor()
return MakeColor(255,i,0,255);
}
function SetInitPlayTime( int T )
function SetInitPlayTime(int T)
{
bInitialPT = true;
bForceNetUpdate = true;
@ -224,17 +224,17 @@ function UnsetPT()
bInitialPT = false;
}
Delegate bool OnRepNextItem( ExtPlayerReplicationInfo PRI, int RepIndex )
Delegate bool OnRepNextItem(ExtPlayerReplicationInfo PRI, int RepIndex)
{
return false;
}
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.
if( WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None) )
if(WorldInfo.NetMode!=NM_Client && (PlayerController(Owner)==None || LocalPlayer(PlayerController(Owner).Player)==None))
return;
if( CustomList==None )
if(CustomList==None)
{
CustomList = CreateNewList();
RecheckGRI();
@ -254,17 +254,17 @@ simulated static final function KFGFxObject_TraderItems CreateNewList()
return L;
}
simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCustomTraderItem Item, KFGFxObject_TraderItems List )
simulated static final function SetWeaponInfo(bool bDedicated, int Index, FCustomTraderItem Item, KFGFxObject_TraderItems List)
{
local array<STraderItemWeaponStats> S;
local int i;
if( List.SaleItems.Length<=Index )
if(List.SaleItems.Length<=Index)
List.SaleItems.Length = Index+1;
List.SaleItems[Index].WeaponDef = Item.WeaponDef;
List.SaleItems[Index].ClassName = Item.WeaponClass.Name;
if( class<KFWeap_DualBase>(Item.WeaponClass)!=None && class<KFWeap_DualBase>(Item.WeaponClass).Default.SingleClass!=None )
if(class<KFWeap_DualBase>(Item.WeaponClass)!=None && class<KFWeap_DualBase>(Item.WeaponClass).Default.SingleClass!=None)
List.SaleItems[Index].SingleClassName = class<KFWeap_DualBase>(Item.WeaponClass).Default.SingleClass.Name;
else List.SaleItems[Index].SingleClassName = '';
List.SaleItems[Index].DualClassName = Item.WeaponClass.Default.DualClass!=None ? Item.WeaponClass.Default.DualClass.Name : '';
@ -284,7 +284,7 @@ simulated static final function SetWeaponInfo( bool bDedicated, int Index, FCust
List.SaleItems[Index].WeaponUpgradeDmgMultiplier[i+1] = Item.WeaponClass.Static.GetUpgradeStatScale(EWUS_Damage0, i+1);
}
if( !bDedicated )
if(!bDedicated)
{
List.SaleItems[Index].SecondaryAmmoImagePath = Item.WeaponClass.Default.SecondaryAmmoTexture!=None ? PathName(Item.WeaponClass.Default.SecondaryAmmoTexture) : "UI_SecondaryAmmo_TEX.GasTank";
List.SaleItems[Index].TraderFilter = Item.WeaponClass.Static.GetTraderFilter();
@ -299,14 +299,14 @@ simulated function RecheckGRI()
{
local ExtPlayerController PC;
if( KFGameReplicationInfo(WorldInfo.GRI)==None )
if(KFGameReplicationInfo(WorldInfo.GRI)==None)
SetTimer(0.1,false,'RecheckGRI');
else
{
KFGameReplicationInfo(WorldInfo.GRI).TraderItems = CustomList;
foreach LocalPlayerControllers(class'ExtPlayerController',PC)
{
if( PC.PurchaseHelper!=None )
if(PC.PurchaseHelper!=None)
{
PC.PurchaseHelper.TraderItems = CustomList;
}
@ -320,7 +320,7 @@ simulated final function bool ShowAdminName()
}
simulated function string GetAdminName()
{
switch( AdminType )
switch(AdminType)
{
case 0:
return "Super Admin";
@ -337,7 +337,7 @@ simulated function string GetAdminName()
}
simulated function string GetAdminNameAbr()
{
switch( AdminType )
switch(AdminType)
{
case 0:
return "S";
@ -354,7 +354,7 @@ simulated function string GetAdminNameAbr()
}
simulated function string GetAdminColor()
{
switch( AdminType )
switch(AdminType)
{
case 0:
return "FF6600";
@ -371,7 +371,7 @@ simulated function string GetAdminColor()
}
simulated function color GetAdminColorC()
{
switch( AdminType )
switch(AdminType)
{
case 0:
return MakeColor(255,102,0,255);
@ -392,7 +392,7 @@ simulated function string GetHumanReadableName()
return TaggedPlayerName;
}
function SetFixedData( byte M )
function SetFixedData(byte M)
{
OnModeSet(Self,M);
FixedData = FixedData | M;
@ -406,30 +406,30 @@ simulated final function string GetDesc()
{
local string S;
if( (FixedData & 1)!=0 )
if((FixedData & 1)!=0)
S = "A.";
if( (FixedData & 2)!=0 )
if((FixedData & 2)!=0)
S $= "WF.";
if( (FixedData & 4)!=0 )
if((FixedData & 4)!=0)
S $= "G.";
if( (FixedData & 8)!=0 )
if((FixedData & 8)!=0)
S $= "NW.";
if( (FixedData & 16)!=0 )
if((FixedData & 16)!=0)
S $= "WA.";
return S;
}
delegate OnModeSet( ExtPlayerReplicationInfo PRI, byte Num );
delegate OnModeSet(ExtPlayerReplicationInfo PRI, byte Num);
simulated final function bool LoadPlayerCharacter( byte CharIndex, out FMyCustomChar CharInfo )
simulated final function bool LoadPlayerCharacter(byte CharIndex, out FMyCustomChar CharInfo)
{
local KFCharacterInfo_Human C;
if( CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length) )
if(CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length))
return false;
if( SaveDataObjects.Length<=CharIndex )
if(SaveDataObjects.Length<=CharIndex)
SaveDataObjects.Length = CharIndex+1;
if( SaveDataObjects[CharIndex]==None )
if(SaveDataObjects[CharIndex]==None)
{
C = (CharIndex<CharacterArchetypes.Length) ? CharacterArchetypes[CharIndex] : CustomCharList[CharIndex-CharacterArchetypes.Length].Char;
SaveDataObjects[CharIndex] = new(None,PathName(C)) class'ExtCharDataInfo';
@ -441,12 +441,12 @@ simulated final function bool SavePlayerCharacter()
{
local KFCharacterInfo_Human C;
if( CustomCharacter.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) )
if(CustomCharacter.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length))
return false;
if( SaveDataObjects.Length<=CustomCharacter.CharacterIndex )
if(SaveDataObjects.Length<=CustomCharacter.CharacterIndex)
SaveDataObjects.Length = CustomCharacter.CharacterIndex+1;
if( SaveDataObjects[CustomCharacter.CharacterIndex]==None )
if(SaveDataObjects[CustomCharacter.CharacterIndex]==None)
{
C = (CustomCharacter.CharacterIndex<CharacterArchetypes.Length) ? CharacterArchetypes[CustomCharacter.CharacterIndex] : CustomCharList[CustomCharacter.CharacterIndex-CharacterArchetypes.Length].Char;
SaveDataObjects[CustomCharacter.CharacterIndex] = new(None,PathName(C)) class'ExtCharDataInfo';
@ -454,39 +454,39 @@ simulated final function bool SavePlayerCharacter()
SaveDataObjects[CustomCharacter.CharacterIndex].SaveData(CustomCharacter);
return true;
}
simulated function ChangeCharacter( byte CharIndex, optional bool bFirstSet )
simulated function ChangeCharacter(byte CharIndex, optional bool bFirstSet)
{
local FMyCustomChar NewChar;
local byte i;
if( CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(CharIndex) )
if(CharIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(CharIndex))
CharIndex = 0;
if( bFirstSet && RepCustomizationInfo.CharacterIndex==CharIndex )
if(bFirstSet && RepCustomizationInfo.CharacterIndex==CharIndex)
{
// Copy properties from default character info.
NewChar.HeadMeshIndex = RepCustomizationInfo.HeadMeshIndex;
NewChar.HeadSkinIndex = RepCustomizationInfo.HeadSkinIndex;
NewChar.BodyMeshIndex = RepCustomizationInfo.BodyMeshIndex;
NewChar.BodySkinIndex = RepCustomizationInfo.BodySkinIndex;
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
{
NewChar.AttachmentMeshIndices[i] = RepCustomizationInfo.AttachmentMeshIndices[i];
NewChar.AttachmentSkinIndices[i] = RepCustomizationInfo.AttachmentSkinIndices[i];
}
}
if( LoadPlayerCharacter(CharIndex,NewChar) )
if(LoadPlayerCharacter(CharIndex,NewChar))
{
NewChar.CharacterIndex = CharIndex;
CustomCharacter = NewChar;
ServerSetCharacterX(NewChar);
if( WorldInfo.NetMode==NM_Client )
if(WorldInfo.NetMode==NM_Client)
CharacterCustomizationChanged();
}
}
simulated function UpdateCustomization( byte Type, byte MeshIndex, byte SkinIndex, optional byte SlotIndex )
simulated function UpdateCustomization(byte Type, byte MeshIndex, byte SkinIndex, optional byte SlotIndex)
{
switch( Type )
switch(Type)
{
case CO_Head:
CustomCharacter.HeadMeshIndex = MeshIndex;
@ -503,26 +503,26 @@ simulated function UpdateCustomization( byte Type, byte MeshIndex, byte SkinInde
}
SavePlayerCharacter();
ServerSetCharacterX(CustomCharacter);
if( WorldInfo.NetMode==NM_Client )
if(WorldInfo.NetMode==NM_Client)
CharacterCustomizationChanged();
}
simulated final function RemoveAttachments()
{
local byte i;
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
{
CustomCharacter.AttachmentMeshIndices[i] = `CLEARED_ATTACHMENT_INDEX;
CustomCharacter.AttachmentSkinIndices[i] = 0;
}
SavePlayerCharacter();
ServerSetCharacterX(CustomCharacter);
if( WorldInfo.NetMode==NM_Client )
if(WorldInfo.NetMode==NM_Client)
CharacterCustomizationChanged();
}
simulated function ClearCharacterAttachment(int AttachmentIndex)
{
if( UsesCustomChar() )
if(UsesCustomChar())
{
CustomCharacter.AttachmentMeshIndices[AttachmentIndex] = `CLEARED_ATTACHMENT_INDEX;
CustomCharacter.AttachmentSkinIndices[AttachmentIndex] = 0;
@ -530,42 +530,42 @@ simulated function ClearCharacterAttachment(int AttachmentIndex)
else Super.ClearCharacterAttachment(AttachmentIndex);
}
reliable server final function ServerSetCharacterX( FMyCustomChar NewMeshInfo )
reliable server final function ServerSetCharacterX(FMyCustomChar NewMeshInfo)
{
if( NewMeshInfo.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(NewMeshInfo.CharacterIndex) )
if(NewMeshInfo.CharacterIndex>=(CharacterArchetypes.Length+CustomCharList.Length) || IsClientCharLocked(NewMeshInfo.CharacterIndex))
return;
CustomCharacter = NewMeshInfo;
if ( Role == Role_Authority )
if (Role == Role_Authority)
{
CharacterCustomizationChanged();
}
}
simulated final function bool IsClientCharLocked( byte Index )
simulated final function bool IsClientCharLocked(byte Index)
{
if( Index<CharacterArchetypes.Length )
if(Index<CharacterArchetypes.Length)
return false;
Index-=CharacterArchetypes.Length;
return (Index<CustomCharList.Length && CustomCharList[Index].bLock && !ShowAdminName());
}
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;
if( CustomCharList.Length<=Index )
if(CustomCharList.Length<=Index)
CustomCharList.Length = Index+1;
CustomCharList[Index] = C;
}
simulated reliable client function AllCharReceived()
{
if( WorldInfo.NetMode==NM_DedicatedServer )
if(WorldInfo.NetMode==NM_DedicatedServer)
return;
if( !bClientInitChars )
if(!bClientInitChars)
{
OnCharListDone();
NotifyCharListDone();
@ -581,19 +581,19 @@ simulated final function NotifyCharListDone()
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFP)
{
EPRI = ExtPlayerReplicationInfo(KFP.PlayerReplicationInfo);
if( EPRI!=None )
if(EPRI!=None)
{
NewCharArch = EPRI.GetSelectedArch();
if( NewCharArch != KFP.CharacterArch )
if(NewCharArch != KFP.CharacterArch)
{
// selected a new character
KFP.SetCharacterArch( NewCharArch );
KFP.SetCharacterArch(NewCharArch);
}
else if( WorldInfo.NetMode != NM_DedicatedServer )
else if(WorldInfo.NetMode != NM_DedicatedServer)
{
// refresh cosmetics only
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch( NewCharArch, KFP, EPRI );
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(NewCharArch, KFP, EPRI);
}
}
}
@ -604,7 +604,7 @@ simulated delegate OnCharListDone();
// Player has a server specific setting for a character selected.
simulated final function bool UsesCustomChar()
{
if( LocalOwnerPRI==None )
if(LocalOwnerPRI==None)
return false; // Not yet init on client.
return CustomCharacter.CharacterIndex<(LocalOwnerPRI.CustomCharList.Length+CharacterArchetypes.Length);
}
@ -612,13 +612,13 @@ simulated final function bool UsesCustomChar()
// Client uses a server specific custom character.
simulated final function bool ReallyUsingCustomChar()
{
if( !UsesCustomChar() )
if(!UsesCustomChar())
return false;
return (CustomCharacter.CharacterIndex>=CharacterArchetypes.Length);
}
simulated final function KFCharacterInfo_Human GetSelectedArch()
{
if( UsesCustomChar() )
if(UsesCustomChar())
return (CustomCharacter.CharacterIndex<CharacterArchetypes.Length) ? CharacterArchetypes[CustomCharacter.CharacterIndex] : LocalOwnerPRI.CustomCharList[CustomCharacter.CharacterIndex-CharacterArchetypes.Length].Char;
return CharacterArchetypes[RepCustomizationInfo.CharacterIndex];
}
@ -630,35 +630,35 @@ simulated event CharacterCustomizationChanged()
foreach WorldInfo.AllPawns(class'KFPawn_Human', KFP)
{
if( KFP.PlayerReplicationInfo == self || (KFP.DrivenVehicle != None && KFP.DrivenVehicle.PlayerReplicationInfo == self) )
if(KFP.PlayerReplicationInfo == self || (KFP.DrivenVehicle != None && KFP.DrivenVehicle.PlayerReplicationInfo == self))
{
NewCharArch = GetSelectedArch();
if( NewCharArch != KFP.CharacterArch )
if(NewCharArch != KFP.CharacterArch)
{
// selected a new character
KFP.SetCharacterArch( NewCharArch );
KFP.SetCharacterArch(NewCharArch);
}
else if( WorldInfo.NetMode != NM_DedicatedServer )
else if(WorldInfo.NetMode != NM_DedicatedServer)
{
// refresh cosmetics only
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch( NewCharArch, KFP, self );
class'ExtCharacterInfo'.Static.SetCharacterMeshFromArch(NewCharArch, KFP, self);
}
}
}
}
// Save/Load custom character information.
final function SaveCustomCharacter( ExtSaveDataBase Data )
final function SaveCustomCharacter(ExtSaveDataBase Data)
{
local byte i,c;
local string S;
// Write the name of custom character.
if( UsesCustomChar() )
if(UsesCustomChar())
S = string(GetSelectedArch().Name);
Data.SaveStr(S);
if( S=="" )
if(S=="")
return;
// Write selected accessories.
@ -668,9 +668,9 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
Data.SaveInt(CustomCharacter.BodySkinIndex);
c = 0;
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
{
if( CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX )
if(CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX)
++c;
}
@ -678,9 +678,9 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
Data.SaveInt(c);
// Write attachments.
for( i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i )
for(i=0; i<`MAX_COSMETIC_ATTACHMENTS; ++i)
{
if( CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX )
if(CustomCharacter.AttachmentMeshIndices[i]!=`CLEARED_ATTACHMENT_INDEX)
{
Data.SaveInt(i);
Data.SaveInt(CustomCharacter.AttachmentMeshIndices[i]);
@ -688,35 +688,35 @@ final function SaveCustomCharacter( ExtSaveDataBase Data )
}
}
}
final function LoadCustomCharacter( ExtSaveDataBase Data )
final function LoadCustomCharacter(ExtSaveDataBase Data)
{
local string S;
local byte i,n,j;
if( Data.GetArVer()>=2 )
if(Data.GetArVer()>=2)
S = Data.ReadStr();
if( S=="" ) // Stock skin.
if(S=="") // Stock skin.
return;
for( i=0; i<CharacterArchetypes.Length; ++i )
for(i=0; i<CharacterArchetypes.Length; ++i)
{
if( string(CharacterArchetypes[i].Name)~=S )
if(string(CharacterArchetypes[i].Name)~=S)
break;
}
if( i==CharacterArchetypes.Length )
if(i==CharacterArchetypes.Length)
{
for( i=0; i<CustomCharList.Length; ++i )
for(i=0; i<CustomCharList.Length; ++i)
{
if( string(CustomCharList[i].Char.Name)~=S )
if(string(CustomCharList[i].Char.Name)~=S)
break;
}
if( i==CharacterArchetypes.Length )
if(i==CharacterArchetypes.Length)
{
// Character not found = Skip data.
Data.SkipBytes(4);
n = Data.ReadInt();
for( i=0; i<n; ++i )
for(i=0; i<n; ++i)
Data.SkipBytes(3);
return;
}
@ -730,7 +730,7 @@ final function LoadCustomCharacter( ExtSaveDataBase Data )
CustomCharacter.BodySkinIndex = Data.ReadInt();
n = Data.ReadInt();
for( i=0; i<n; ++i )
for(i=0; i<n; ++i)
{
j = Min(Data.ReadInt(),`MAX_COSMETIC_ATTACHMENTS-1);
CustomCharacter.AttachmentMeshIndices[j] = Data.ReadInt();
@ -740,22 +740,22 @@ final function LoadCustomCharacter( ExtSaveDataBase Data )
}
// Only used to skip offset (in case of an error).
static final function DummyLoadChar( ExtSaveDataBase Data )
static final function DummyLoadChar(ExtSaveDataBase Data)
{
local string S;
local byte i,n;
if( Data.GetArVer()>=2 )
if(Data.GetArVer()>=2)
S = Data.ReadStr();
if( S=="" ) // Stock skin.
if(S=="") // Stock skin.
return;
Data.SkipBytes(4);
n = Data.ReadInt();
for( i=0; i<n; ++i )
for(i=0; i<n; ++i)
Data.SkipBytes(3);
}
static final function DummySaveChar( ExtSaveDataBase Data )
static final function DummySaveChar(ExtSaveDataBase Data)
{
Data.SaveStr("");
}
@ -773,7 +773,7 @@ simulated function Texture2D GetCurrentIconToDisplay()
// Set admin levels without having to hard-reference to this mod.
event BeginState(Name N)
{
switch( N )
switch(N)
{
case 'Global':
AdminType = 0;

View File

@ -14,13 +14,13 @@ simulated function ExplodeTimer()
local Actor HitActor;
local vector HitLocation, HitNormal;
if( WorldInfo.NetMode!=NM_Client && InstigatorController==none )
if(WorldInfo.NetMode!=NM_Client && InstigatorController==none)
{
Destroy();
return;
}
GetExplodeEffectLocation(HitLocation, HitNormal, HitActor);
if( --NumCrackers==0 )
if(--NumCrackers==0)
TriggerExplosion(HitLocation, HitNormal, HitActor);
else SmallExplosion(HitLocation, HitNormal, HitActor);
}
@ -45,10 +45,10 @@ simulated function SmallExplosion(Vector HitLocation, Vector HitNormal, Actor Hi
PrepareExplosionTemplate();
// If the locations are zero (probably because this exploded in the air) set defaults
if( IsZero(HitLocation) )
if(IsZero(HitLocation))
HitLocation = Location;
if( IsZero(HitNormal) )
if(IsZero(HitNormal))
{
HitNormal = vect(0,0,1);
}

View File

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

View File

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

View File

@ -1,47 +1,47 @@
class ExtSM_Player_Emote extends KFSM_Player_Emote;
static function byte PackFlagsBase( KFPawn P )
static function byte PackFlagsBase(KFPawn P)
{
return class'ExtEmoteList'.static.GetEmoteIndex( class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(P.Controller)) );
return class'ExtEmoteList'.static.GetEmoteIndex(class'ExtEmoteList'.static.GetEquippedEmoteId(ExtPlayerController(P.Controller)));
}
function PlayAnimation()
{
AnimName = class'ExtEmoteList'.static.GetEmoteFromIndex( KFPOwner.SpecialMoveFlags );
AnimName = class'ExtEmoteList'.static.GetEmoteFromIndex(KFPOwner.SpecialMoveFlags);
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
LastCameraMode = 'FirstPerson';
if( PCOwner != none && PCOwner.PlayerCamera != none )
if(PCOwner != none && PCOwner.PlayerCamera != none)
{
LastCameraMode = PCOwner.PlayerCamera.CameraStyle;
}
// Set camera to emote third person camera
if( PCOwner == none || !PawnOwner.IsLocallyControlled() )
if(PCOwner == none || !PawnOwner.IsLocallyControlled())
{
KFPOwner.SetWeaponAttachmentVisibility( false );
KFPOwner.SetWeaponAttachmentVisibility(false);
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';
// 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');
}
KFPOwner.SetWeaponAttachmentVisibility( false );
KFPOwner.SetWeaponAttachmentVisibility(false);
}
}

View File

@ -8,35 +8,35 @@ Interface ExtSaveDataBase;
2: 0-16777215
3: -2147483647 - 2147483647
*/
function SaveInt( int Value, optional byte MaxVal );
function int ReadInt( optional byte MaxVal );
function SaveStr( string S );
function SaveInt(int Value, optional byte MaxVal);
function int ReadInt(optional byte MaxVal);
function SaveStr(string S);
function string ReadStr();
// File offset management.
function int TellOffset();
function SeekOffset( int Offset );
function SeekOffset(int Offset);
function int TotalSize();
function ToEnd();
function ToStart();
function bool AtEnd();
function SkipBytes( int Count );
function SkipBytes(int Count);
// Wipe out any saved data.
function FlushData();
// Get file contents in a byte array line.
function GetData( out array<byte> Res );
function SetData( out array<byte> S );
function GetData(out array<byte> Res);
function SetData(out array<byte> S);
// Archive version (to allow modder to make upgraded stat binarily compatible)
function int GetArVer();
function SetArVer( int Ver );
function SetArVer(int Ver);
// Push/Pop file limitators (to prevent it from reading EoF in sub sections).
function PushEOFLimit( int EndOffset );
function PushEOFLimit(int EndOffset);
function PopEOFLimit();
// Get most recent save version for this user.
function int GetSaveVersion();
function SetSaveVersion( int Num );
function SetSaveVersion(int Num);

View File

@ -5,7 +5,7 @@ Class ExtSpawnPointHelper extends Info
var transient array<NavigationPoint> PendingList,CheckedList;
var array<Actor> ValidSpawnSpots;
static final function ExtSpawnPointHelper FindHelper( WorldInfo Level )
static final function ExtSpawnPointHelper FindHelper(WorldInfo Level)
{
local ExtSpawnPointHelper H;
@ -24,21 +24,21 @@ final function Actor PickBestSpawn()
BestScore = 0;
foreach ValidSpawnSpots(N)
{
if( Rand(4)==0 )
if(Rand(4)==0)
{
Score = FRand();
foreach WorldInfo.AllPawns(class'KFPawn',P,N.Location,2000.f)
{
if( !P.IsAliveAndWell() )
if(!P.IsAliveAndWell())
continue;
Dist = VSize(N.Location-P.Location);
if( FastTrace(P.Location,N.Location) )
if(FastTrace(P.Location,N.Location))
Dist*=0.75;
if( P.IsA('KFPawn_Human') )
if(P.IsA('KFPawn_Human'))
Score+=(3000.f-Dist)/2000.f;
else Score-=(3500.f-Dist)/2500.f;
}
if( BestN==None || Score>BestScore )
if(BestN==None || Score>BestScore)
{
BestN = N;
BestScore = Score;
@ -49,21 +49,21 @@ final function Actor PickBestSpawn()
// See if can spawn ontop of other players.
foreach WorldInfo.AllPawns(class'KFPawn_Human',H)
{
if( !H.IsAliveAndWell() || H.Physics==PHYS_Falling || (ExtHumanPawn(H)!=None && ExtHumanPawn(H).bFeigningDeath) )
if(!H.IsAliveAndWell() || H.Physics==PHYS_Falling || (ExtHumanPawn(H)!=None && ExtHumanPawn(H).bFeigningDeath))
continue;
Score = FRand();
foreach WorldInfo.AllPawns(class'KFPawn',P,H.Location,2000.f)
{
if( !P.IsAliveAndWell() )
if(!P.IsAliveAndWell())
continue;
Dist = VSize(H.Location-P.Location);
if( FastTrace(P.Location,H.Location) )
if(FastTrace(P.Location,H.Location))
Dist*=0.75;
if( P.IsA('KFPawn_Human') )
if(P.IsA('KFPawn_Human'))
Score+=(3000.f-Dist)/3000.f;
else Score-=(3500.f-Dist)/3500.f;
}
if( BestN==None || Score>BestScore )
if(BestN==None || Score>BestScore)
{
BestN = H;
BestScore = Score;
@ -83,14 +83,14 @@ function InitChecker()
foreach WorldInfo.AllNavigationPoints(class'PlayerStart',PS)
{
Fallback = PS;
if( PS.bEnabled && PS.TeamIndex==0 )
if(PS.bEnabled && PS.TeamIndex==0)
{
CheckSpawn(PS);
if( PendingList.Length!=0 )
if(PendingList.Length!=0)
break;
}
}
if( PendingList.Length==0 && Fallback!=None )
if(PendingList.Length==0 && Fallback!=None)
CheckSpawn(Fallback);
SetTimer(0.001,true,'NextCheck');
}
@ -99,9 +99,9 @@ function NextCheck()
local NavigationPoint N;
local byte i;
if( PendingList.Length!=0 )
if(PendingList.Length!=0)
{
while( ++i<5 && PendingList.Length!=0 )
while(++i<5 && PendingList.Length!=0)
{
N = PendingList[PendingList.Length-1];
PendingList.Remove(PendingList.Length-1,1);
@ -114,7 +114,7 @@ function NextCheck()
CheckedList.Length = 0;
}
}
final function CheckSpawn( NavigationPoint N )
final function CheckSpawn(NavigationPoint N)
{
local vector V;
local ReachSpec R;
@ -122,7 +122,7 @@ final function CheckSpawn( NavigationPoint N )
local KFPawnBlockingVolume P;
V = N.Location;
if( N.MaxPathSize.Radius>30 && N.MaxPathSize.Height>80 && FindSpot(vect(36,36,86),V) && KFDoorMarker(N)==None && PickupFactory(N)==None )
if(N.MaxPathSize.Radius>30 && N.MaxPathSize.Height>80 && FindSpot(vect(36,36,86),V) && KFDoorMarker(N)==None && PickupFactory(N)==None)
{
//DrawDebugLine(V,V+vect(0,0,50),255,255,255,true);
ValidSpawnSpots.AddItem(N);
@ -132,22 +132,22 @@ final function CheckSpawn( NavigationPoint N )
foreach N.PathList(R)
{
E = R.GetEnd();
if( E==None || R.CollisionRadius<30 || R.CollisionHeight<80 || R.Class==Class'ProscribedReachSpec' )
if(E==None || R.CollisionRadius<30 || R.CollisionHeight<80 || R.Class==Class'ProscribedReachSpec')
{
//if( E!=None )
//if(E!=None)
// DrawDebugLine(E.Location,N.Location,255,255,0,true);
continue;
}
if( CheckedList.Find(E)!=INDEX_NONE )
if(CheckedList.Find(E)!=INDEX_NONE)
continue;
// DO NOT go through any blocking volumes.
V = (N.Location+E.Location) * 0.5;
foreach OverlappingActors(class'KFPawnBlockingVolume',P,VSize(N.Location-V),V)
{
if( P.bBlockPlayers && TraceComponent(V,V,P.CollisionComponent,E.Location,N.Location,vect(36,36,50)) )
if(P.bBlockPlayers && TraceComponent(V,V,P.CollisionComponent,E.Location,N.Location,vect(36,36,50)))
break;
}
if( P==None )
if(P==None)
{
//DrawDebugLine(E.Location,N.Location,0,255,0,true);
PendingList.AddItem(E);

View File

@ -1,7 +1,7 @@
// Interface class for outputting stats into a file or something.
Interface ExtStatWriter;
function WriteValue( string Key, string Value );
function StartIntendent( string Section, optional string Key, optional string Value );
function WriteValue(string Key, string Value);
function StartIntendent(string Section, optional string Key, optional string Value);
function EndIntendent();
function ResetFile();

View File

@ -11,18 +11,18 @@ function SetPerkFilterData(byte FilterIndex)
SetBool("filterVisibliity", true);
KFPC = ExtPlayerController( GetPC() );
if ( KFPC != none )
KFPC = ExtPlayerController(GetPC());
if (KFPC != none)
{
PrM = KFPC.ActivePerkManager;
KFPRI = KFPlayerReplicationInfo(KFPC.PlayerReplicationInfo);
if ( KFPRI != none && PrM!=None )
if (KFPRI != none && PrM!=None)
{
i = Max(PrM.UserPerks.Find(PrM.CurrentPerk),0);
SetInt("selectedIndex", i);
// Set the title of this filter based on either the perk or the off perk string
if( FilterIndex < PrM.UserPerks.Length )
if(FilterIndex < PrM.UserPerks.Length)
{
SetString("filterText", PrM.UserPerks[FilterIndex].PerkName);
}
@ -34,16 +34,16 @@ function SetPerkFilterData(byte FilterIndex)
DataProvider = CreateArray();
for (i = 0; i < PrM.UserPerks.Length; i++)
{
FilterObject = CreateObject( "Object" );
FilterObject = CreateObject("Object");
FilterObject.SetString("source", PrM.UserPerks[i].GetPerkIconPath(PrM.UserPerks[i].CurrentLevel));
DataProvider.SetElementObject( i, FilterObject );
DataProvider.SetElementObject(i, FilterObject);
}
FilterObject = CreateObject( "Object" );
FilterObject = CreateObject("Object");
FilterObject.SetString("source", "img://"$class'KFGFxObject_TraderItems'.default.OffPerkIconPath);
DataProvider.SetElementObject( i, FilterObject );
DataProvider.SetElementObject(i, FilterObject);
SetObject( "filterSource", DataProvider );
SetObject("filterSource", DataProvider);
}
}
}

View File

@ -7,7 +7,7 @@ function SetPerkInfo()
local float V;
KFPC = ExtPlayerController(GetPC());
if( KFPC!=none && KFPC.ActivePerkManager!=None && KFPC.ActivePerkManager.CurrentPerk!=None )
if(KFPC!=none && KFPC.ActivePerkManager!=None && KFPC.ActivePerkManager.CurrentPerk!=None)
{
CurrentPerk = KFPC.ActivePerkManager.CurrentPerk;
SetString("perkName", CurrentPerk.PerkName);
@ -28,14 +28,14 @@ function SetPerkList()
local Ext_PerkBase P;
KFPC = ExtPlayerController(GetPC());
if( KFPC != none && KFPC.ActivePerkManager!=None )
if(KFPC != none && KFPC.ActivePerkManager!=None)
{
DataProvider = CreateArray();
for (i = 0; i < KFPC.ActivePerkManager.UserPerks.Length; i++)
{
P = KFPC.ActivePerkManager.UserPerks[i];
PerkObject = CreateObject( "Object" );
PerkObject = CreateObject("Object");
PerkObject.SetString("name", P.PerkName);
PerkObject.SetString("perkIconSource", P.GetPerkIconPath(P.CurrentLevel));
PerkObject.SetInt("level", P.CurrentLevel);

View File

@ -9,9 +9,9 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array<STraderItem>
local ExtPlayerController EKFPC;
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;
SlotIndex = 0;
@ -19,12 +19,12 @@ function RefreshWeaponListByPerk(byte FilterIndex, const out array<STraderItem>
for (i = 0; i < ItemList.Length; i++)
{
if ( IsItemFiltered(ItemList[i]) )
if (IsItemFiltered(ItemList[i]))
{
continue; // Skip this item if it's in our inventory
}
else if ( ItemList[i].AssociatedPerkClasses.length > 0 && ItemList[i].AssociatedPerkClasses[0] != none && TargetPerkClass != class'KFPerk_Survivalist'
&& (TargetPerkClass==None || ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass) == INDEX_NONE ) )
else if (ItemList[i].AssociatedPerkClasses.length > 0 && ItemList[i].AssociatedPerkClasses[0] != none && TargetPerkClass != class'KFPerk_Survivalist'
&& (TargetPerkClass==None || ItemList[i].AssociatedPerkClasses.Find(TargetPerkClass) == INDEX_NONE))
{
continue; // filtered by perk
}

View File

@ -17,12 +17,12 @@ simulated static function bool AllowedForAllPerks()
return true;
}
simulated function ConsumeAmmo( byte FireModeNum )
simulated function ConsumeAmmo(byte FireModeNum)
{
}
simulated static event class<KFPerk> GetWeaponPerkClass( class<KFPerk> InstigatorPerkClass )
simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{
if(InstigatorPerkClass != None)
return InstigatorPerkClass;

View File

@ -17,12 +17,12 @@ simulated static function bool AllowedForAllPerks()
return true;
}
simulated function ConsumeAmmo( byte FireModeNum )
simulated function ConsumeAmmo(byte FireModeNum)
{
}
simulated static event class<KFPerk> GetWeaponPerkClass( class<KFPerk> InstigatorPerkClass )
simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{
if(InstigatorPerkClass != None)
return InstigatorPerkClass;

View File

@ -24,13 +24,13 @@ simulated static function bool AllowedForAllPerks()
return true;
}
simulated function ConsumeAmmo( byte FireModeNum )
simulated function ConsumeAmmo(byte FireModeNum)
{
if(FireModeNum == ALTFIRE_FIREMODE)
super.ConsumeAmmo(FireModeNum);
}
simulated static event class<KFPerk> GetWeaponPerkClass( class<KFPerk> InstigatorPerkClass )
simulated static event class<KFPerk> GetWeaponPerkClass(class<KFPerk> InstigatorPerkClass)
{
if(InstigatorPerkClass != None)
return InstigatorPerkClass;

View File

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

View File

@ -33,19 +33,19 @@ struct FPropGroup
var array<FPropGroup> ConfigList;
// Value accessors.
Delegate string OnGetValue( name PropName, int ElementIndex );
Delegate OnSetValue( name PropName, int ElementIndex, string Value );
Delegate string OnGetValue(name PropName, int ElementIndex);
Delegate OnSetValue(name PropName, int ElementIndex, string Value);
final function Cleanup()
{
ConfigList.Length = 0;
}
final function AddSettingsPage( string PageName, class<Object> Obj, const out array<FWebAdminConfigInfo> Configs, delegate<OnGetValue> GetFunc, delegate<OnSetValue> SetFunc )
final function AddSettingsPage(string PageName, class<Object> Obj, const out array<FWebAdminConfigInfo> Configs, delegate<OnGetValue> GetFunc, delegate<OnSetValue> SetFunc)
{
local int i;
i = ConfigList.Find('PageName',PageName);
if( i>=0 ) // Make sure no dupe pages.
if(i>=0) // Make sure no dupe pages.
PageName $= "_"$(ConfigList[i].Dupes++);
i = ConfigList.Length;
@ -56,7 +56,7 @@ final function AddSettingsPage( string PageName, class<Object> Obj, const out ar
ConfigList[i].GetValue = GetFunc;
ConfigList[i].SetValue = SetFunc;
}
final function bool HasConfigFor( class<Object> Obj )
final function bool HasConfigFor(class<Object> Obj)
{
return (ConfigList.Find('ObjClass',Obj)>=0);
}

View File

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

View File

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

View File

@ -9,22 +9,22 @@ final function vector PickPointNearOwner()
local vector V,HL,HN,Start;
Start = OwnerPawn.Location;
if( OwnerPawn.Physics==PHYS_Falling )
if(OwnerPawn.Physics==PHYS_Falling)
{
if( Pawn.Trace(HL,HN,OwnerPawn.Location-vect(0,0,5000),OwnerPawn.Location,false,vect(20,20,60))!=None )
if(Pawn.Trace(HL,HN,OwnerPawn.Location-vect(0,0,5000),OwnerPawn.Location,false,vect(20,20,60))!=None)
Start = HL;
}
while( true )
while(true)
{
++i;
V.X = FRand()-0.5;
V.Y = FRand()-0.5;
V = Start + Normal2D(V) * (100.f+FRand()*500.f);
if( i<20 && !FastTrace(V,Start) ) // Destination is inside a wall.
if(i<20 && !FastTrace(V,Start)) // Destination is inside a wall.
continue;
if( i<20 && FastTrace(V-vect(0,0,100),V) ) // Destination is above a pit.
if(i<20 && FastTrace(V-vect(0,0,100),V)) // Destination is above a pit.
continue;
break;
}
@ -37,7 +37,7 @@ final function bool CanSeeOwner()
NextSightCheckTime = WorldInfo.TimeSeconds+1.f + FRand();
P = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None;
if( P!=None && !LineOfSightTo(P) )
if(P!=None && !LineOfSightTo(P))
return false;
return true;
}
@ -45,7 +45,7 @@ final function bool CanSeeOwner()
state ZedBaseCommand
{
Begin:
if( Pawn.Physics == PHYS_Falling )
if(Pawn.Physics == PHYS_Falling)
{
DisableMeleeRangeEventProbing();
WaitForLanding();
@ -55,32 +55,32 @@ Begin:
CheckInterruptCombatTransitions();
// Select nearest enemy if current enemy is invalid
if( Enemy == none || Enemy.Health <= 0 || !IsValidAttackTarget(KFPawn(Enemy)) )
if(Enemy == none || Enemy.Health <= 0 || !IsValidAttackTarget(KFPawn(Enemy)))
SelectEnemy();
// Handle special case if I'm supposed to be attacking a door
if( DoorEnemy != none && DoorEnemy.Health > 0 && VSizeSq( DoorEnemy.Location - Pawn.Location ) < (DoorMeleeDistance * DoorMeleeDistance) ) //200UU
if(DoorEnemy != none && DoorEnemy.Health > 0 && VSizeSq(DoorEnemy.Location - Pawn.Location) < (DoorMeleeDistance * DoorMeleeDistance)) //200UU
{
`AILog( self$" DoorEnemy: "$DoorEnemy$" starting melee attack", 'Command_Base' );
UpdateHistoryString( "[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]" );
class'AICommand_Attack_Melee'.static.Melee( Outer, DoorEnemy );
`AILog(self$" DoorEnemy: "$DoorEnemy$" starting melee attack", 'Command_Base');
UpdateHistoryString("[Attacking : "$DoorEnemy$" at "$WorldInfo.TimeSeconds$"]");
class'AICommand_Attack_Melee'.static.Melee(Outer, DoorEnemy);
}
// See if we are close to our owner
RecheckOwner:
OwnerPawn = Ext_T_MonsterPRI(PlayerReplicationInfo)!=None ? Ext_T_MonsterPRI(PlayerReplicationInfo).OwnerController.Pawn : None;
if( OwnerPawn!=None )
if(OwnerPawn!=None)
{
if( Enemy!=None && LineOfSightTo(OwnerPawn) && LineOfSightTo(Enemy) ) // We have sight to our owner and can see enemy, go for it!
if(Enemy!=None && LineOfSightTo(OwnerPawn) && LineOfSightTo(Enemy)) // We have sight to our owner and can see enemy, go for it!
{
OwnerPawn = None;
bWaitingOnMovementPlugIn = true;
SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving() );
SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving());
NextSightCheckTime = WorldInfo.TimeSeconds+2.f;
while( bWaitingOnMovementPlugIn && bUsePluginsForMovement )
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{
if( NextSightCheckTime<WorldInfo.TimeSeconds && !CanSeeOwner() )
if(NextSightCheckTime<WorldInfo.TimeSeconds && !CanSeeOwner())
{
ClearMovementInfo();
GoTo'RecheckOwner';
@ -88,12 +88,12 @@ RecheckOwner:
Sleep(0.03);
}
}
else if( VSizeSq(OwnerPawn.Location-Pawn.Location)>640000.f || !LineOfSightTo(OwnerPawn) ) // 800.f - Need to move closer to our owner.
else if(VSizeSq(OwnerPawn.Location-Pawn.Location)>640000.f || !LineOfSightTo(OwnerPawn)) // 800.f - Need to move closer to our owner.
{
bWaitingOnMovementPlugIn = true;
SetMovePoint(PickPointNearOwner(),OwnerPawn,,300.f);
while( bWaitingOnMovementPlugIn && bUsePluginsForMovement )
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{
Sleep(0.03);
}
@ -104,22 +104,22 @@ RecheckOwner:
Sleep(0.2+FRand()*0.5);
}
}
else if( IsValidAttackTarget(KFPawn(Enemy)) )
else if(IsValidAttackTarget(KFPawn(Enemy)))
{
`AILog( "Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base' );
`AILog("Calling SetEnemyMoveGoal [Dist:"$VSize(Enemy.Location - Pawn.Location)$"] using offset of "$AttackRange$", because IsWithinBasicMeleeRange() returned false ", 'Command_Base');
bWaitingOnMovementPlugIn = true;
SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving() );
SetEnemyMoveGoal(self, true,,, ShouldAttackWhileMoving());
while( bWaitingOnMovementPlugIn && bUsePluginsForMovement )
while(bWaitingOnMovementPlugIn && bUsePluginsForMovement)
{
Sleep(0.03);
}
`AiLog("Back from waiting for the movement plug in!!!");
if( Enemy == none )
if(Enemy == none)
{
Sleep( FRand() + 0.1f );
Goto( 'Begin' );
Sleep(FRand() + 0.1f);
Goto('Begin');
}
}
else
@ -130,18 +130,18 @@ RecheckOwner:
// Check combat transitions
CheckCombatTransition();
if( bFailedToMoveToEnemy )
if(bFailedToMoveToEnemy)
{
if( bFailedPathfind )
if(bFailedPathfind)
{
bFailedPathfind = false;
Sleep( 0.f );
Sleep(0.f);
}
else
{
Sleep( 0.f );
Sleep(0.f);
}
SetEnemy( GetClosestEnemy( Enemy ) );
SetEnemy(GetClosestEnemy(Enemy));
}
else
{

File diff suppressed because it is too large Load Diff

View File

@ -5,30 +5,30 @@ var float VampRegenRate,ZedTimeMeleeAtkRate;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
ZedTimeMeleeAtkRate;
}
simulated function ModifyMeleeAttackSpeed( out float InDuration )
simulated function ModifyMeleeAttackSpeed(out float InDuration)
{
InDuration *= Modifiers[4];
if( ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f )
if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f)
InDuration *= ZedTimeMeleeAtkRate;
}
simulated function ModifyRateOfFire( out float InRate, KFWeapon KFW )
simulated function ModifyRateOfFire(out float InRate, KFWeapon KFW)
{
if( IsWeaponOnPerk(KFW) )
if(IsWeaponOnPerk(KFW))
{
InRate *= Modifiers[4];
if( ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f )
if(ZedTimeMeleeAtkRate<1.f && WorldInfo.TimeDilation<1.f)
InRate *= ZedTimeMeleeAtkRate;
}
}
function PlayerKilled( KFPawn_Monster Victim, class<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 )
PlayerOwner.Pawn.HealDamage( Max(PlayerOwner.Pawn.HealthMax*VampRegenRate,1), PlayerOwner, class'KFDT_Healing', false, false );
if(VampRegenRate>0 && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health>0 && class<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);
}
defaultproperties

View File

@ -6,46 +6,46 @@ var float ZTExtCount;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
bUseProfessional,bUseMachineGunner;
}
simulated function bool GetUsingTactialReload( KFWeapon KFW )
simulated function bool GetUsingTactialReload(KFWeapon KFW)
{
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.65 : false);
}
simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<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;
}
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx);
}
simulated function float GetZedTimeModifier( KFWeapon W )
simulated function float GetZedTimeModifier(KFWeapon W)
{
local name StateName;
StateName = W.GetStateName();
if( bUseProfessional && IsWeaponOnPerk( W ) )
if(bUseProfessional && IsWeaponOnPerk(W))
{
if( StateName == 'Reloading' || StateName == 'AltReloading' )
if(StateName == 'Reloading' || StateName == 'AltReloading')
return 1.f;
else if( StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping' )
else if(StateName == 'WeaponPuttingDown' || StateName == 'WeaponEquipping')
return 0.3f;
}
if( bUseMachineGunner && IsWeaponOnPerk( W ) && BasePerk.Default.ZedTimeModifyingStates.Find( StateName ) != INDEX_NONE )
if(bUseMachineGunner && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE)
return 0.5f;
return 0.f;
}
simulated function float GetZedTimeExtensions( byte Level )
simulated function float GetZedTimeExtensions(byte Level)
{
return ZTExtCount;
}

View File

@ -7,7 +7,7 @@ var float AOEMult, NukeDamageMult;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
NukeDamageMult,bDirectHit,bCriticalHit,bProfessionalActive,AOEMult;
}
@ -16,12 +16,12 @@ simulated function float GetAoERadiusModifier()
return AOEMult;
}
simulated function bool GetUsingTactialReload( KFWeapon KFW )
simulated function bool GetUsingTactialReload(KFWeapon KFW)
{
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.85 : false);
}
simulated function float ApplyEffect( name Type, float Value, float Progress )
simulated function float ApplyEffect(name Type, float Value, float Progress)
{
local KFPlayerReplicationInfo MyPRI;
local float DefValue;
@ -29,7 +29,7 @@ simulated function float ApplyEffect( name Type, float Value, float Progress )
DefValue = Super.ApplyEffect(Type, Value, Progress);
MyPRI = KFPlayerReplicationInfo(PlayerOwner.PlayerReplicationInfo);
if( MyPRI != None && Type == 'KnockDown' )
if(MyPRI != None && Type == 'KnockDown')
MyPRI.bConcussiveActive = Modifiers[7] > 1.5;
return DefValue;
@ -40,37 +40,37 @@ function OnWaveEnded()
bUsedSacrifice = false;
}
simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<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;
if( bCriticalHit && MyKFPM != none && IsCriticalHitZone( MyKFPM, HitZoneIdx ) )
if(bCriticalHit && MyKFPM != none && IsCriticalHitZone(MyKFPM, HitZoneIdx))
InDamage *= 1.5f;
}
if( class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None )
if(class<KFDT_DemoNuke_Toxic_Lingering>(DamageType) != None)
InDamage *= NukeDamageMult;
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx);
}
function bool IsCriticalHitZone( KFPawn TestPawn, int HitZoneIndex )
function bool IsCriticalHitZone(KFPawn TestPawn, int HitZoneIndex)
{
if( TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length )
if(TestPawn != none && HitzoneIndex >= 0 && HitzoneIndex < TestPawn.HitZones.length)
return TestPawn.HitZones[HitZoneIndex].DmgScale > 1.f;
return false;
}
simulated function ModifySpareAmmoAmount( KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary )
simulated function ModifySpareAmmoAmount(KFWeapon KFW, out int PrimarySpareAmmo, optional const out STraderItem TraderItem, optional bool bSecondary)
{
if( KFW != None && KFWeap_Thrown_C4(KFW) != None )
if(KFW != None && KFWeap_Thrown_C4(KFW) != None)
PrimarySpareAmmo += (1 + Modifiers[11]);
Super.ModifySpareAmmoAmount( KFW, PrimarySpareAmmo, TraderItem, bSecondary );
Super.ModifySpareAmmoAmount(KFW, PrimarySpareAmmo, TraderItem, bSecondary);
}
defaultproperties

View File

@ -12,13 +12,13 @@ var bool bUseToxicDamage,bUseSlug,bUseAirborneAgent;
var const class<KFDamageType> ToxicDmgTypeClass;
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)
{
local float TempDamage;
TempDamage = InDamage;
if( bUseSlug && WorldInfo.TimeDilation < 1.f && DamageType != none && ClassIsChildOf( DamageType, class'KFDT_Toxic' ) )
if(bUseSlug && WorldInfo.TimeDilation < 1.f && DamageType != none && ClassIsChildOf(DamageType, class'KFDT_Toxic'))
TempDamage += InDamage * 100;
InDamage = Round(TempDamage);
@ -26,60 +26,60 @@ simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCau
Super.ModifyDamageGiven(InDamage, DamageCauser, MyKFPM, DamageInstigator, DamageType, HitZoneIdx);
}
simulated function ModifyMagSizeAndNumber( KFWeapon KFW, out int MagazineCapacity, optional array< Class<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);
}
function bool RepairArmor( Pawn HealTarget )
function bool RepairArmor(Pawn HealTarget)
{
local KFPawn_Human KFPH;
if( RepairArmorRate>0 )
if(RepairArmorRate>0)
{
KFPH = KFPawn_Human(Healtarget);
if( KFPH != none && KFPH.Armor < KFPH.MaxArmor )
if(KFPH != none && KFPH.Armor < KFPH.MaxArmor)
{
KFPH.AddArmor( Round( float(KFPH.MaxArmor) * RepairArmorRate ) );
KFPH.AddArmor(Round(float(KFPH.MaxArmor) * RepairArmorRate));
return true;
}
}
return false;
}
function bool ModifyHealAmount( out float HealAmount )
function bool ModifyHealAmount(out float HealAmount)
{
HealAmount*=Modifiers[9];
return (RepairArmorRate>0);
}
// Di
// simulated function ModifyHealerRechargeTime( out float RechargeRate )
// simulated function ModifyHealerRechargeTime(out float RechargeRate)
// {
// super.ModifyHealerRechargeTime(RechargeRate)
// RechargeRate /= Clamp(Modifiers[9] * 2, 1.f, 3.f);
// }
function CheckForAirborneAgent( KFPawn HealTarget, class<DamageType> DamType, int HealAmount )
function CheckForAirborneAgent(KFPawn HealTarget, class<DamageType> DamType, int HealAmount)
{
if( (AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1 )
GiveMedicAirborneAgentHealth( HealTarget, DamType, HealAmount );
if((AirborneAgentLevel==1 && WorldInfo.TimeDilation<1.f) || AirborneAgentLevel>1)
GiveMedicAirborneAgentHealth(HealTarget, DamType, HealAmount);
}
function GiveMedicAirborneAgentHealth( KFPawn HealTarget, class<DamageType> DamType, int HealAmount )
function GiveMedicAirborneAgentHealth(KFPawn HealTarget, class<DamageType> DamType, int HealAmount)
{
local KFPawn KFP;
local int RoundedExtraHealAmount;
RoundedExtraHealAmount = FCeil( float(HealAmount) * AirborneAgentHealRate );
RoundedExtraHealAmount = FCeil(float(HealAmount) * AirborneAgentHealRate);
foreach WorldInfo.Allpawns(class'KFPawn', KFP, HealTarget.Location, 500.f)
{
if( KFP.IsAliveAndWell() && WorldInfo.GRI.OnSameTeam( HealTarget, KFP ) )
if(KFP.IsAliveAndWell() && WorldInfo.GRI.OnSameTeam(HealTarget, KFP))
{
if ( HealTarget == KFP )
KFP.HealDamage( RoundedExtraHealAmount, PlayerOwner, DamType );
else KFP.HealDamage( RoundedExtraHealAmount + HealAmount, PlayerOwner, DamType );
if (HealTarget == KFP)
KFP.HealDamage(RoundedExtraHealAmount, PlayerOwner, DamType);
else KFP.HealDamage(RoundedExtraHealAmount + HealAmount, PlayerOwner, DamType);
}
}
}
@ -94,7 +94,7 @@ static function int ModifyToxicDmg(int ToxicDamage)
local float TempDamage;
TempDamage = float(ToxicDamage) * 1.2;
return FCeil( TempDamage );
return FCeil(TempDamage);
}
function NotifyZedTimeStarted()
@ -103,19 +103,19 @@ function NotifyZedTimeStarted()
HPawn = KFPawn_Human(PlayerOwner.Pawn);
if( bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell() )
if(bUseAirborneAgent && HPawn != none && HPawn.IsAliveAndWell())
HPawn.StartAirBorneAgentEvent();
}
simulated function float GetSnarePower( optional class<DamageType> 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 0.f;
}
function AddDefaultInventory( KFPawn P )
function AddDefaultInventory(KFPawn P)
{
local int i;
i = P.DefaultInventory.Find(class'ExtWeap_Pistol_9mm');

View File

@ -5,28 +5,28 @@ var bool bHasUberAmmo,bHasFanfire;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
bHasUberAmmo,bHasFanfire;
}
simulated function bool GetUsingTactialReload( KFWeapon KFW )
simulated function bool GetUsingTactialReload(KFWeapon KFW)
{
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.8 : false);
}
simulated function bool GetIsUberAmmoActive( KFWeapon KFW )
simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
{
return bHasUberAmmo && IsWeaponOnPerk(KFW) && WorldInfo.TimeDilation < 1.f;
}
simulated function float GetZedTimeModifier( KFWeapon W )
simulated function float GetZedTimeModifier(KFWeapon W)
{
local name StateName;
if( bHasFanfire && IsWeaponOnPerk( W ) )
if(bHasFanfire && IsWeaponOnPerk(W))
{
StateName = W.GetStateName();
if( BasePerk.Default.ZedTimeModifyingStates.Find( StateName ) != INDEX_NONE || StateName == 'Reloading' )
if(BasePerk.Default.ZedTimeModifyingStates.Find(StateName) != INDEX_NONE || StateName == 'Reloading')
return 1.f;
}

View File

@ -4,14 +4,14 @@ var byte HeadShotComboCount,MaxRhythmCombo;
var float RhythmComboDmg;
var private const float HeadShotCountdownIntervall;
simulated function ModifyDamageGiven( out int InDamage, optional Actor DamageCauser, optional KFPawn_Monster MyKFPM, optional KFPlayerController DamageInstigator, optional class<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);
if( RhythmComboDmg>0 && BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || IsWeaponOnPerk(KFWeapon(DamageCauser)) )
if(RhythmComboDmg>0 && BasePerk==None || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk)>=0) || IsWeaponOnPerk(KFWeapon(DamageCauser)))
InDamage *= (1.f+RhythmComboDmg);
}
final function SetMaxRhythm( byte MaxCombo )
final function SetMaxRhythm(byte MaxCombo)
{
MaxRhythmCombo = MaxCombo;
}
@ -25,21 +25,21 @@ final function ResetRhythm()
function SubstractHeadShotCombo()
{
if( HeadShotComboCount > 0 )
if(HeadShotComboCount > 0)
UpdateDmgScale(false);
else
ClearTimer( nameOf( SubstractHeadShotCombo ) );
ClearTimer(nameOf(SubstractHeadShotCombo));
}
final function UpdateDmgScale( bool bUp )
final function UpdateDmgScale(bool bUp)
{
if( bUp )
if(bUp)
{
HeadShotComboCount = Min(HeadShotComboCount+1,MaxRhythmCombo);
HeadShotMessage(HeadShotComboCount,false,MaxRhythmCombo);
SetTimer( HeadShotCountdownIntervall, true, nameOf( SubstractHeadShotCombo ) );
SetTimer(HeadShotCountdownIntervall, true, nameOf(SubstractHeadShotCombo));
}
else if( HeadShotComboCount>0)
else if(HeadShotComboCount>0)
{
--HeadShotComboCount;
HeadShotMessage(HeadShotComboCount,true,MaxRhythmCombo);
@ -48,31 +48,31 @@ final function UpdateDmgScale( bool bUp )
RhythmComboDmg = HeadShotComboCount*0.075;
}
function UpdatePerkHeadShots( ImpactInfo Impact, class<DamageType> DamageType, int NumHit )
function UpdatePerkHeadShots(ImpactInfo Impact, class<DamageType> DamageType, int NumHit)
{
local int HitZoneIdx;
local KFPawn_Monster KFPM;
if( MaxRhythmCombo<=0 )
if(MaxRhythmCombo<=0)
return;
KFPM = KFPawn_Monster(Impact.HitActor);
if( KFPM==none || KFPM.GetTeamNum()==0 )
if(KFPM==none || KFPM.GetTeamNum()==0)
return;
HitZoneIdx = KFPM.HitZones.Find('ZoneName', Impact.HitInfo.BoneName);
if( HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell() )
if(HitZoneIdx == HZI_Head && KFPM.IsAliveAndWell())
{
if( class<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);
}
}
reliable client function HeadShotMessage( byte HeadShotNum, bool bMissed, byte MaxHits )
reliable client function HeadShotMessage(byte HeadShotNum, bool bMissed, byte MaxHits)
{
local AkEvent TempAkEvent;
local KFPlayerController PC;
PC = KFPlayerController(PlayerOwner);
if( PC==none || PC.MyGFxHUD==none )
if(PC==none || PC.MyGFxHUD==none)
{
return;
}
@ -80,25 +80,25 @@ reliable client function HeadShotMessage( byte HeadShotNum, bool bMissed, byte M
PC.MyGFxHUD.RhythmCounterWidget.SetInt("count", HeadShotNum);
PC.MyGFxHUD.RhythmCounterWidget.SetBonusPercentage(float(HeadShotNum) / float(MaxHits));
if( HeadshotNum==0 )
if(HeadshotNum==0)
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Reset';
else if( HeadShotNum<MaxHits )
else if(HeadShotNum<MaxHits)
{
if( !bMissed )
if(!bMissed)
{
//PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShot');
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Hit';
}
}
else if( !bMissed )
else if(!bMissed)
{
//PC.ClientSpawnCameraLensEffect(class'KFCameraLensEmit_RackemHeadShotPing');
TempAkEvent = AkEvent'WW_UI_PlayerCharacter.Play_R_Method_Top';
HeadshotNum = 6;
}
if( TempAkEvent != none )
PC.PlayRMEffect( TempAkEvent, 'R_Method', HeadshotNum );
if(TempAkEvent != none)
PC.PlayRMEffect(TempAkEvent, 'R_Method', HeadshotNum);
}
defaultproperties

View File

@ -7,23 +7,23 @@ var bool bRapidAssault;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
RepTacticalMove, bRapidAssault;
}
simulated function float GetIronSightSpeedModifier( KFWeapon KFW )
simulated function float GetIronSightSpeedModifier(KFWeapon KFW)
{
return ((RepTacticalMove>0 && IsWeaponOnPerk(KFW)) ? MoveSpeedMods[RepTacticalMove-1] : 1.f);
}
simulated function bool GetIsUberAmmoActive( KFWeapon KFW )
simulated function bool GetIsUberAmmoActive(KFWeapon KFW)
{
return bRapidAssault && IsWeaponOnPerk(KFW) && WorldInfo.TimeDilation < 1.f;
}
simulated function float GetZedTimeModifier( KFWeapon W )
simulated function float GetZedTimeModifier(KFWeapon W)
{
if( bRapidAssault && WorldInfo.TimeDilation<1.f && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(W.GetStateName()) != INDEX_NONE )
if(bRapidAssault && WorldInfo.TimeDilation<1.f && IsWeaponOnPerk(W) && BasePerk.Default.ZedTimeModifyingStates.Find(W.GetStateName()) != INDEX_NONE)
return 0.51f;
return 0.f;
}

View File

@ -6,19 +6,19 @@ var float ZEDTimeStunPower,DireReloadSpeed;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
bHasDireReload;
}
simulated function float GetReloadRateScale(KFWeapon KFW)
{
if( bHasDireReload && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health<40 )
if(bHasDireReload && PlayerOwner.Pawn!=None && PlayerOwner.Pawn.Health<40)
return Super.GetReloadRateScale(KFW)*DireReloadSpeed;
return Super.GetReloadRateScale(KFW);
}
function float GetStunPowerModifier( optional class<DamageType> 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);
}

View File

@ -6,11 +6,11 @@ var float APShotMul;
replication
{
// Things the server should send to the client.
if ( true )
if (true)
bCanRepairDoors, bUseAPShot, bUsePerforate, APShotMul;
}
simulated function bool GetUsingTactialReload( KFWeapon KFW )
simulated function bool GetUsingTactialReload(KFWeapon KFW)
{
return (IsWeaponOnPerk(KFW) ? Modifiers[5]<0.75 : false);
}
@ -20,10 +20,10 @@ simulated function bool CanRepairDoors()
return bCanRepairDoors;
}
simulated function float GetPenetrationModifier( byte Level, class<KFDamageType> DamageType, optional bool bForce )
simulated function float GetPenetrationModifier(byte Level, class<KFDamageType> DamageType, optional bool bForce )
{
local float PenetrationPower;
if( !bForce && (DamageType == none || ( DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk) == INDEX_NONE )))
if(!bForce && (DamageType == none || (DamageType!=None && DamageType.Default.ModifierPerkList.Find(BasePerk) == INDEX_NONE)))
return 0;
PenetrationPower = bUseAPShot ? APShotMul : 0.f;

View File

@ -5,7 +5,7 @@ Class Ext_TGroupBase extends Object
var() localized string GroupInfo;
var() bool bLimitToOne; // Limit to only one trait for this group.
static function string GetUIInfo( Ext_PerkBase Perk )
static function string GetUIInfo(Ext_PerkBase Perk)
{
return (Default.bLimitToOne ? Default.GroupInfo$" (MAX 1)" : Default.GroupInfo);
}
@ -15,14 +15,14 @@ static function string GetUIDesc()
}
// See if group is already using up limitation.
static function bool GroupLimited( Ext_PerkBase Perk, class<Ext_TraitBase> Trait )
static function bool GroupLimited(Ext_PerkBase Perk, class<Ext_TraitBase> Trait)
{
local int i;
if( Default.bLimitToOne )
if(Default.bLimitToOne)
{
for( i=0; i<Perk.PerkTraits.Length; ++i )
if( Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class )
for(i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class)
return true;
}
return false;

View File

@ -1,6 +1,6 @@
class Ext_TGroupRegen extends Ext_TGroupBase;
static function string GetUIInfo( Ext_PerkBase Perk )
static function string GetUIInfo(Ext_PerkBase Perk)
{
return Default.GroupInfo$" (MAX "$GetMaxLimit(Perk)$")";
}
@ -9,21 +9,21 @@ static function string GetUIDesc()
return Super.GetUIDesc()$"|To buy additional regen abilities:|-Prestige level 1 + Perk level 100 = MAX 2 traits|-Prestige level 5 + Perk level 150 = MAX 3 traits";
}
static function bool GroupLimited( Ext_PerkBase Perk, class<Ext_TraitBase> Trait )
static function bool GroupLimited(Ext_PerkBase Perk, class<Ext_TraitBase> Trait)
{
local int i;
local byte n;
n = GetMaxLimit(Perk);
for( i=0; i<Perk.PerkTraits.Length; ++i )
if( Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0 )
for(i=0; i<Perk.PerkTraits.Length; ++i)
if(Perk.PerkTraits[i].CurrentLevel>0 && Perk.PerkTraits[i].TraitType!=Trait && Perk.PerkTraits[i].TraitType.Default.TraitGroup==Default.Class && --n==0)
return true;
return false;
}
static final function byte GetMaxLimit( Ext_PerkBase Perk )
static final function byte GetMaxLimit(Ext_PerkBase Perk)
{
if( Perk.CurrentPrestige<1 || Perk.CurrentLevel<100 )
if(Perk.CurrentPrestige<1 || Perk.CurrentLevel<100)
return 1;
return ((Perk.CurrentPrestige<5 || Perk.CurrentLevel<150) ? 2 : 3);
}

View File

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

View File

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

View File

@ -8,46 +8,46 @@ var bool bNetworkOwner;
replication
{
if ( bNetOwner )
if (bNetOwner)
PawnOwner,AssociatedPerkClass;
}
function PostBeginPlay()
{
PawnOwner = Pawn(Owner);
if( PawnOwner==None )
if(PawnOwner==None)
Destroy();
else SetTimer(0.5+FRand()*0.4,true);
}
function Timer()
{
if( PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None )
if(PawnOwner==None || PawnOwner.Health<=0 || PawnOwner.InvManager==None)
Destroy();
}
simulated function Tick( float Delta )
simulated function Tick(float Delta)
{
if ( WorldInfo.NetMode==NM_DedicatedServer
if (WorldInfo.NetMode==NM_DedicatedServer
|| PawnOwner==None
|| PawnOwner.InvManager==None
|| KFWeapon(PawnOwner.Weapon)==None
|| ( KFWeapon(PawnOwner.Weapon).GetWeaponPerkClass(AssociatedPerkClass) != AssociatedPerkClass && AssociatedPerkClass != class'KFPerk_Survivalist' ))
|| (KFWeapon(PawnOwner.Weapon).GetWeaponPerkClass(AssociatedPerkClass) != AssociatedPerkClass && AssociatedPerkClass != class'KFPerk_Survivalist'))
return;
// Find local playercontroller.
if( LocalPC==None )
if(LocalPC==None)
{
LocalPC = PlayerController(PawnOwner.Controller);
if( LocalPC==None )
if(LocalPC==None)
return;
bNetworkOwner = (LocalPlayer(LocalPC.Player)!=None);
}
if( !bNetworkOwner )
if(!bNetworkOwner)
return;
// Force always to pending fire.
if( LocalPC.bFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,0) )
if(LocalPC.bFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,0))
PawnOwner.Weapon.StartFire(0);
else if( LocalPC.bAltFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,1) )
else if(LocalPC.bAltFire!=0 && !PawnOwner.InvManager.IsPendingFire(None,1))
PawnOwner.Weapon.StartFire(1);
}

View File

@ -6,30 +6,30 @@ var vector ResPoint,TeleStartPoint;
var ExtSpawnPointHelper SpawnPointer;
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;
return true;
}
if( LastDied==Other )
if(LastDied==Other)
{
if( Level==1 || LastDiedTimer>WorldInfo.TimeSeconds )
if(Level==1 || LastDiedTimer>WorldInfo.TimeSeconds)
return false;
}
else if( Level==1 && Rand(2)==0 )
else if(Level==1 && Rand(2)==0)
return false;
LastDied = Other;
bTeleporting = true;
if( SpawnPointer==None )
if(SpawnPointer==None)
SpawnPointer = class'ExtSpawnPointHelper'.Static.FindHelper(WorldInfo);
ResPoint = SpawnPointer.PickBestSpawn().Location;
LastDied.FindSpot(vect(36,36,86),ResPoint);
if( VSizeSq(LastDied.Location-ResPoint)<1.f ) // Prevent division by zero errors in future.
if(VSizeSq(LastDied.Location-ResPoint)<1.f) // Prevent division by zero errors in future.
ResPoint.Z+=5;
Enable('Tick');
StartResurrect();
@ -42,10 +42,10 @@ final function StartResurrect()
LastDied.Health = 9999;
LastDied.LastStartTime = WorldInfo.TimeSeconds;
if( ExtHumanPawn(LastDied)!=None )
if(ExtHumanPawn(LastDied)!=None)
{
ExtHumanPawn(LastDied).bCanBecomeRagdoll = false;
if( !ExtHumanPawn(LastDied).CanBeRedeemed() )
if(!ExtHumanPawn(LastDied).CanBeRedeemed())
{
bIsDelayed = true;
return;
@ -61,26 +61,26 @@ final function StartResurrect()
LastDiedTimer = WorldInfo.TimeSeconds+TeleTime;
}
function Tick( float Delta )
function Tick(float Delta)
{
if( !bTeleporting )
if(!bTeleporting)
{
Disable('Tick');
return;
}
if( LastDied==None || LastDied.Health<=0 )
if(LastDied==None || LastDied.Health<=0)
{
bTeleporting = false;
return;
}
if( bIsDelayed )
if(bIsDelayed)
{
bIsDelayed = false;
StartResurrect();
return;
}
Delta = (LastDiedTimer-WorldInfo.TimeSeconds);
if( Delta<=0 )
if(Delta<=0)
{
EndGhostTeleport();
return;
@ -88,7 +88,7 @@ function Tick( float Delta )
Delta /= TeleTime;
LastDied.Velocity = Normal(ResPoint-TeleStartPoint)*900.f;
LastDied.SetLocation(TeleStartPoint*Delta+ResPoint*(1.f-Delta));
if( LastDied.Physics!=PHYS_None )
if(LastDied.Physics!=PHYS_None)
LastDied.SetPhysics(PHYS_None);
}
@ -106,16 +106,16 @@ final function EndGhostTeleport()
LastDied.SetPhysics(PHYS_Falling);
LastDied.Velocity = vect(0,0,0);
LastDied.LastStartTime = WorldInfo.TimeSeconds; // For spawn protection, if any.
if( LastDied.IsDoingSpecialMove() ) // Stop any grabbing zeds.
if(LastDied.IsDoingSpecialMove()) // Stop any grabbing zeds.
LastDied.EndSpecialMove();
if( ExtHumanPawn(LastDied)!=None )
if(ExtHumanPawn(LastDied)!=None)
ExtHumanPawn(LastDied).bCanBecomeRagdoll = true;
}
function Destroyed()
{
if( bTeleporting && LastDied!=None && LastDied.Health>0 )
if(bTeleporting && LastDied!=None && LastDied.Health>0)
EndGhostTeleport();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,21 +1,21 @@
Class Ext_TraitAPShots extends Ext_TraitBase;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSupport(Perk).APShotMul = 1 + (0.25 + (((float(Level) - 1.f) * 5.f) / 100.f));
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSupport(Perk).APShotMul = 0.f;
}
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSupport(Perk).bUseAPShot = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSupport(Perk).bUseAPShot = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitAcidicCompound extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).bUseToxicDamage = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).bUseToxicDamage = false;
}

View File

@ -2,12 +2,12 @@ Class Ext_TraitAirborne extends Ext_TraitBase;
var array<float> HealRates;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).AirborneAgentHealRate = Default.HealRates[Level-1];
Ext_PerkFieldMedic(Perk).AirborneAgentLevel = (Level<4 ? 1 : 2);
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).AirborneAgentLevel = 0;
}

View File

@ -9,18 +9,18 @@ static function string GetPerkDescription()
return S;
}
static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk )
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if( Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1 )
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<1)
return false;
for( i=0; i<Perk.PerkTraits.Length; ++i )
for(i=0; i<Perk.PerkTraits.Length; ++i)
{
if( Perk.PerkTraits[i].TraitType==Class'Ext_TraitGrenadeUpg' )
if(Perk.PerkTraits[i].TraitType==Class'Ext_TraitGrenadeUpg')
{
if( Perk.PerkTraits[i].CurrentLevel <= 0 )
if(Perk.PerkTraits[i].CurrentLevel <= 0)
return false;
else break;
}
@ -29,11 +29,11 @@ static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk )
return true;
}
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).bUseAirborneAgent = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).bUseAirborneAgent = false;
}

View File

@ -2,15 +2,15 @@ Class Ext_TraitAmmoReg extends Ext_TraitBase;
var array<float> RegenValues;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Ext_T_AmmoRegHelp H;
H = Player.Spawn(class'Ext_T_AmmoRegHelp',Player);
if( H!=None )
if(H!=None)
H.RegCount = Default.RegenValues[Level-1];
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Ext_T_AmmoRegHelp H;

View File

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

View File

@ -1,10 +1,10 @@
Class Ext_TraitArmorRep extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).RepairArmorRate = float(Level)*0.05f;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkFieldMedic(Perk).RepairArmorRate = 0;
}

View File

@ -1,13 +1,13 @@
Class Ext_TraitAutoFire extends Ext_TraitBase;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Ext_T_AutoFireHelper H;
H = Player.Spawn(class'Ext_T_AutoFireHelper',Player);
H.AssociatedPerkClass = Perk.BasePerk;
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Ext_T_AutoFireHelper H;

View File

@ -27,20 +27,20 @@ var() bool bGroupLimitToOne, // TraitGroup should limit so you can only buy one
bPostApplyEffect; // Apply effects on second pass (relies on that another trait is activated first).
// Check if trait is enabled and usable on this perk.
static function bool IsEnabled( Ext_PerkBase Perk )
static function bool IsEnabled(Ext_PerkBase Perk)
{
return !Default.bDisabled && (Default.SupportedPerk==None || ClassIsChildOf(Perk.Class,Default.SupportedPerk));
}
// Check if player meets the requirements to buy this trait.
static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk )
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
// First check level.
if( Perk.CurrentLevel<Default.MinLevel )
if(Perk.CurrentLevel<Default.MinLevel)
return false;
// Then check grouping.
if( Lvl==0 && Default.TraitGroup!=None && Default.TraitGroup.Static.GroupLimited(Perk,Default.Class) )
if(Lvl==0 && Default.TraitGroup!=None && Default.TraitGroup.Static.GroupLimited(Perk,Default.Class))
return false;
return true;
}
@ -51,14 +51,14 @@ static function string GetPerkDescription()
local string S;
local byte i;
for( i=0; i<Default.NumLevels; ++i )
for(i=0; i<Default.NumLevels; ++i)
{
if( i==0 )
if(i==0)
S = string(GetTraitCost(i));
else S $= ", "$GetTraitCost(i);
}
S = "Max level: #{9FF781}"$Default.NumLevels$"#{DEF}|Level costs: #{F3F781}"$S$"#{DEF}";
if( Default.MinLevel>0 )
if(Default.MinLevel>0)
S = "Min perk level: #{FF4000}"$Default.MinLevel$"#{DEF}|"$S;
return Default.Description$"||"$S;
}
@ -70,11 +70,11 @@ static function string GetTooltipInfo()
}
// Return level specific trait prices.
static function int GetTraitCost( byte LevelNum )
static function int GetTraitCost(byte LevelNum)
{
if( Default.LevelCosts.Length>0 )
if(Default.LevelCosts.Length>0)
{
if( LevelNum<Default.LevelCosts.Length )
if(LevelNum<Default.LevelCosts.Length)
return Default.LevelCosts[LevelNum];
return Default.LevelCosts[Default.LevelCosts.Length-1];
}
@ -82,12 +82,12 @@ static function int GetTraitCost( byte LevelNum )
}
// Trait initialization/cleanup.
static function Ext_TraitDataStore InitializeFor( Ext_PerkBase Perk, ExtPlayerController Player )
static function Ext_TraitDataStore InitializeFor(Ext_PerkBase Perk, ExtPlayerController Player)
{
local Ext_TraitDataStore T;
T = None;
if( Default.TraitData!=None )
if(Default.TraitData!=None)
{
T = Player.Spawn(Default.TraitData,Player);
T.Perk = Perk;
@ -96,33 +96,33 @@ static function Ext_TraitDataStore InitializeFor( Ext_PerkBase Perk, ExtPlayerCo
}
return T;
}
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();
}
// Called when trait is first activated/deactivated (might even have a dead pawn).
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
// Called everytime player spawns in on the game (cancel effect is called on level up/level reset/perk change).
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
// Owner died with this trait active.
static function PlayerDied( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function PlayerDied(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
// Prevent death.
static function bool PreventDeath( KFPawn_Human Player, Controller Instigator, Class<DamageType> DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class<DamageType> DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
// Give/modify default inventory.
static function AddDefaultInventory( KFPawn Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function AddDefaultInventory(KFPawn Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
// Data that server should replicate to client.
static final function string IntToStr( int Value, optional byte MaxVal ) // Helper function to put integer into one character of string.
static final function string IntToStr(int Value, optional byte MaxVal) // Helper function to put integer into one character of string.
{
switch( MaxVal )
switch(MaxVal)
{
case 0: // 0-65535
return Chr(Max(Value,0)+1);
@ -130,15 +130,15 @@ static final function string IntToStr( int Value, optional byte MaxVal ) // Help
return Chr((Value & 32767)+1) $ Chr(((Value >> 15) & 32767)+1);
}
}
static final function string InlineString( string Str ) // Helper function to append a string line to a text using a length char in front.
static final function string InlineString(string Str) // Helper function to append a string line to a text using a length char in front.
{
return IntToStr(Len(Str))$Str;
}
static final function int StrToInt( out string Value, optional byte MaxVal ) // Reverse.
static final function int StrToInt(out string Value, optional byte MaxVal) // Reverse.
{
local int Res;
switch( MaxVal )
switch(MaxVal)
{
case 0: // 0-65535
Res = Asc(Left(Value,1))-1;
@ -151,7 +151,7 @@ static final function int StrToInt( out string Value, optional byte MaxVal ) //
}
return Res;
}
static final function string GetInlineStr( out string S ) // Reverse.
static final function string GetInlineStr(out string S) // Reverse.
{
local int l;
local string Res;
@ -168,17 +168,17 @@ static function string GetRepData()
local int i;
S = IntToStr(Default.MinLevel)$IntToStr(Default.LevelCosts.Length);
for( i=0; i<Default.LevelCosts.Length; ++i )
for(i=0; i<Default.LevelCosts.Length; ++i)
S $= IntToStr(Default.LevelCosts[i]);
return S;
}
static function string ClientSetRepData( string S )
static function string ClientSetRepData(string S)
{
local int i;
Default.MinLevel = StrToInt(S);
Default.LevelCosts.Length = StrToInt(S);
for( i=0; i<Default.LevelCosts.Length; ++i )
for(i=0; i<Default.LevelCosts.Length; ++i)
Default.LevelCosts[i] = StrToInt(S);
return S;
}
@ -186,16 +186,16 @@ static function string ClientSetRepData( string S )
// Configure initialization.
static function CheckConfig()
{
if( Default.ConfigVersion!=Default.CurrentConfigVer )
if(Default.ConfigVersion!=Default.CurrentConfigVer)
{
UpdateConfigs(Default.ConfigVersion);
Default.ConfigVersion = Default.CurrentConfigVer;
StaticSaveConfig();
}
}
static function UpdateConfigs( int OldVer )
static function UpdateConfigs(int OldVer)
{
if( OldVer==0 )
if(OldVer==0)
{
Default.LevelCosts = Default.DefLevelCosts;
Default.MinLevel = Default.DefMinLevel;
@ -203,13 +203,13 @@ static function UpdateConfigs( int OldVer )
}
// WebAdmin UI
static function InitWebAdmin( ExtWebAdmin_UI UI )
static function InitWebAdmin(ExtWebAdmin_UI UI)
{
UI.AddSettingsPage("Trait "$Default.TraitName,Default.Class,Default.WebConfigs,GetValue,ApplyValue);
}
static function string GetValue( name PropName, int ElementIndex )
static function string GetValue(name PropName, int ElementIndex)
{
switch( PropName )
switch(PropName)
{
case 'MinLevel':
return string(Default.MinLevel);
@ -219,15 +219,15 @@ static function string GetValue( name PropName, int ElementIndex )
return string(Default.bDisabled);
}
}
static function ApplyValue( name PropName, int ElementIndex, string Value )
static function ApplyValue(name PropName, int ElementIndex, string Value)
{
switch( PropName )
switch(PropName)
{
case 'MinLevel':
Default.MinLevel = int(Value); break;
case 'LevelCosts':
Default.LevelCosts.Length = Default.DefLevelCosts.Length;
if( Value!="#DELETE" && ElementIndex<Default.LevelCosts.Length )
if(Value!="#DELETE" && ElementIndex<Default.LevelCosts.Length)
Default.LevelCosts[ElementIndex] = int(Value);
break;
case 'bDisabled':

View File

@ -1,11 +1,11 @@
Class Ext_TraitBoomWeld extends Ext_TraitBase
abstract;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bExplosiveWeld = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bExplosiveWeld = false;
}

View File

@ -1,13 +1,13 @@
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;
}
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;
}

View File

@ -2,20 +2,20 @@ Class Ext_TraitCarryCap extends Ext_TraitBase;
var array<byte> CarryAdds;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local KFInventoryManager M;
M = KFInventoryManager(Player.InvManager);
if( M!=None )
if(M!=None)
M.MaxCarryBlocks = M.Default.MaxCarryBlocks+Default.CarryAdds[Level-1];
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local KFInventoryManager M;
M = KFInventoryManager(Player.InvManager);
if( M!=None )
if(M!=None)
M.MaxCarryBlocks = M.Default.MaxCarryBlocks;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitContactNade extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bExplodeOnContact = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bExplodeOnContact = false;
}

View File

@ -1,11 +1,11 @@
Class Ext_TraitDemoAOE extends Ext_TraitBase;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).AOEMult = 1 + (0.15 + (((float(Level) - 1.f) * 5.f) / 100.f));
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).AOEMult = 1.0f;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitDemoCriticalHit extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bCriticalHit = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bCriticalHit = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitDemoDirectHit extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bDirectHit = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bDirectHit = false;
}

View File

@ -9,41 +9,41 @@ static function string GetPerkDescription()
return S;
}
static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk )
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if( Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3 )
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
return false;
if( Lvl==0 )
if(Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Damage');
if( i>=0 )
if(i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}
return true;
}
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local ExtPlayerReplicationInfo MyPRI;
MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo);
if( MyPRI == None || Ext_PerkDemolition(Perk) == None )
if(MyPRI == None || Ext_PerkDemolition(Perk) == None)
return;
MyPRI.bNukeActive = true;
Ext_PerkDemolition(Perk).NukeDamageMult = 1.0 + (((float(Level) - 1.f) * 5.f) / 100.f);
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local ExtPlayerReplicationInfo MyPRI;
MyPRI = ExtPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo);
if( MyPRI == None || Ext_PerkDemolition(Perk) == None )
if(MyPRI == None || Ext_PerkDemolition(Perk) == None)
return;
MyPRI.bNukeActive = false;

View File

@ -9,29 +9,29 @@ static function string GetPerkDescription()
return S;
}
static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk )
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
local int i;
if( Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3 )
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<3)
return false;
if( Lvl==0 )
if(Lvl==0)
{
i = Perk.PerkStats.Find('StatType','Reload');
if( i>=0 )
if(i>=0)
return (Perk.PerkStats[i].CurrentValue>=30);
}
return true;
}
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bProfessionalActive = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bProfessionalActive = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitDemoReactiveArmor extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bCanUseSacrifice = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkDemolition(Perk).bCanUseSacrifice = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitDireReload extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSharpshooter(Perk).bHasDireReload = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSharpshooter(Perk).bHasDireReload = false;
}

View File

@ -1,11 +1,11 @@
Class Ext_TraitDoorRepair extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSupport(Perk).bCanRepairDoors = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkSupport(Perk).bCanRepairDoors = false;
}

View File

@ -2,14 +2,14 @@ Class Ext_TraitDuracell extends Ext_TraitBase;
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]);
}
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);
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitEliteReload extends Ext_TraitBase;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bTacticalReload = true;
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bTacticalReload = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitEnemyHP extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.EnemyHealthRange = Level;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.EnemyHealthRange = 0;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitFanfire extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkGunslinger(Perk).bHasFanfire = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkGunslinger(Perk).bHasFanfire = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitFireExplode extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bFireExplode = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bFireExplode = false;
}

View File

@ -1,10 +1,10 @@
Class Ext_TraitFireRange extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
KFPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo).bExtraFireRange = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
KFPlayerReplicationInfo(Perk.PlayerOwner.PlayerReplicationInfo).bExtraFireRange = false;
}

View File

@ -1,16 +1,16 @@
Class Ext_TraitGhost extends Ext_TraitBase;
static function bool PreventDeath( KFPawn_Human Player, Controller Instigator, Class<DamageType> DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function bool PreventDeath(KFPawn_Human Player, Controller Instigator, Class<DamageType> DamType, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Controller C;
if( (Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided' )
if((Instigator==None || Instigator==Player.Controller) && DamType==Class'DmgType_Suicided')
return false; // Allow normal suicide to go ahead.
if( Ext_T_GhostHelper(Data).CanResPlayer(Player,Level) )
if(Ext_T_GhostHelper(Data).CanResPlayer(Player,Level))
{
// Abort current special move
if( Player.IsDoingSpecialMove() )
if(Player.IsDoingSpecialMove())
Player.SpecialMoveHandler.EndSpecialMove();
// Notify AI to stop hunting me.

View File

@ -1,13 +1,13 @@
Class Ext_TraitGrenadeCap extends Ext_TraitCarryCap;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data );
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data);
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.PerkManager.SetGrenadeCap(Default.CarryAdds[Level-1]);
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.PerkManager.SetGrenadeCap(0);
}

View File

@ -1,11 +1,11 @@
Class Ext_TraitGrenadeSUpg extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
if( Level==1 )
if(Level==1)
Perk.GrenadeClass = Perk.SuperGrenade;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.GrenadeClass = Perk.Default.GrenadeClass;
}

View File

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

View File

@ -2,15 +2,15 @@ Class Ext_TraitHealthReg extends Ext_TraitBase;
var array<byte> RegenValues;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Ext_T_HealthRegHelp H;
H = Player.Spawn(class'Ext_T_HealthRegHelp',Player);
if( H!=None )
if(H!=None)
H.RegCount = Default.RegenValues[Level-1];
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
local Ext_T_HealthRegHelp H;

View File

@ -1,17 +1,17 @@
Class Ext_TraitHeavyArmor extends Ext_TraitBase;
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bHeavyArmor = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Perk.bHeavyArmor = false;
}
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
if( Level <= 1 )
if(Level <= 1)
return;
Level == 2 ? Player.AddArmor(50) : Player.AddArmor(Player.MaxArmor);

View File

@ -1,13 +1,13 @@
Class Ext_TraitKnockback extends Ext_TraitRagdoll;
static function ApplyEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function ApplyEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
if( ExtHumanPawn(Player)!=None )
if(ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).KnockbackResist = Default.ChanceValues[Level-1];
}
static function CancelEffectOn( KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function CancelEffectOn(KFPawn_Human Player, Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
if( ExtHumanPawn(Player)!=None )
if(ExtHumanPawn(Player)!=None)
ExtHumanPawn(Player).KnockbackResist = 1.f;
}

View File

@ -9,20 +9,20 @@ static function string GetPerkDescription()
return S;
}
static function bool MeetsRequirements( byte Lvl, Ext_PerkBase Perk )
static function bool MeetsRequirements(byte Lvl, Ext_PerkBase Perk)
{
if( Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2 )
if(Perk.CurrentLevel<Default.MinLevel || Perk.CurrentPrestige<2)
return false;
return true;
}
static function TraitActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkCommando(Perk).bUseMachineGunner = true;
}
static function TraitDeActivate( Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data )
static function TraitDeActivate(Ext_PerkBase Perk, byte Level, optional Ext_TraitDataStore Data)
{
Ext_PerkCommando(Perk).bUseMachineGunner = false;
}

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