KF2-Server-Extension/ServerExt/Classes/ExtPawn_Customization.uc
Forrest Keller 88f2c71e54 Added perk changing without dying
Fixed scoreboard avatars not working
Added the ServerExt perk menu to the lobby
Made the perk buttons look better (Reset, Unload, Prestige)
Added a better damage popup system
Added a better pet info hud system
Made player info bars fade out with distance
Added missing traits from most of the perks
Made lobby menu support 12 players
Medic Pistol from the trait can't be dropped, sold and has infinite ammo
9mm Pistol now has infinite ammo
Pet sirens do not blow up grenades
Unlocked all cosmetics and emotes
Hide bad cosmetics that were debug
Hans pet no longer forces the camera on his death
Custom weapons in the trader now support the proper weapon names
Updated character info system to support alot of added items
2017-10-20 02:02:53 -05:00

108 lines
3.0 KiB
Ucode

class ExtPawn_Customization extends KFPawn_Customization;
simulated function KFCharacterInfoBase GetCharacterInfo()
{
if( ExtPlayerReplicationInfo(PlayerReplicationInfo)!=None )
return ExtPlayerReplicationInfo(PlayerReplicationInfo).GetSelectedArch();
return Super.GetCharacterInfo();
}
simulated function SetCharacterArch( KFCharacterInfoBase Info, optional bool bForce )
{
local KFPlayerReplicationInfo KFPRI;
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 );
SetCharacterAnimationInfo();
// Sounds
SoundGroupArch = Info.SoundGroupArch;
if (WorldInfo.NetMode != NM_DedicatedServer)
{
// refresh weapon attachment (attachment bone may have changed)
if (WeaponAttachmentTemplate != None)
{
WeaponAttachmentChanged(true);
}
}
}
if( CharacterArch != none )
{
if( CharacterArch.VoiceGroupArchName != "" )
VoiceGroupArch = class<KFPawnVoiceGroup>(class'ExtCharacterInfo'.Static.SafeLoadObject(CharacterArch.VoiceGroupArchName, class'Class'));
}
}
function bool Died(Controller Killer, class<DamageType> DamageType, vector HitLocation)
{
// Destroy this pawn if player leaves.
Destroy();
return true;
}
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) );
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].PlayCustomAnim(AnimName, 1.f, BlendInTime, 0.4, false, true);
BodyStanceNodes[EAS_FullBody].SetActorAnimEndNotification( TRUE );
}
function AttachWeaponByItemDefinition( int ItemDefinition )
{
local class<KFWeaponDefinition> WeaponDef;
local int ItemINdex;
local KFWeaponAttachment WeaponPreview;
//find weapon def
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
if(ItemIndex == INDEX_NONE)
{
`log("Could not find item" @ItemDefinition);
return;
}
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
if(WeaponDef == none)
{
`log("Weapon def NONE for : " @ItemDefinition);
return;
}
//load in and add object .
WeaponPreview = KFWeaponAttachment ( DynamicLoadObject( WeaponDef.default.AttachmentArchtypePath, class'KFWeaponAttachment' ) );
//attatch it to player
WeaponAttachmentTemplate = WeaponPreview;
WeaponAttachmentChanged();
//setweapon skin
WeaponAttachment.SetWeaponSkin(ItemDefinition);
}
defaultproperties
{
bCollideActors=false
bBlockActors=false
}