-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBagpack.uc
78 lines (70 loc) · 3.53 KB
/
Bagpack.uc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
class Bagpack extends KFWeapon;
#exec OBJ LOAD FILE=bagpack_t.utx package=ServerPerksDZ.bagpack_t
var int AddWeight;
var Name OldVeterancy;
var bool bAlreadyAdded, bAlreadySubstracted;
function Tick(float dt)
{
local KFPlayerReplicationInfo KFPRI;
if(Instigator!=none)
{
KFPRI=KFPlayerReplicationInfo(Instigator.PlayerReplicationInfo);
if(KFPRI!=none)
{
if(OldVeterancy!=KFPRI.ClientVeteranSkill.Name)
bAlreadyAdded=false;
if(!bAlreadyAdded)
{
KFHumanPawn(Instigator).MaxCarryWeight+=AddWeight;
bAlreadyAdded=true;
OldVeterancy=KFPRI.ClientVeteranSkill.Name;
}
}
}
Super.Tick(dt);
}
event Destroyed()
{
if(!bAlreadySubstracted)
{
KFHumanPawn(Instigator).MaxCarryWeight-=AddWeight;
bAlreadySubstracted=true;
}
Super.Destroyed();
}
simulated function Weapon WeaponChange(byte F, bool bSilent)
{
if(Inventory == None)
return None;
else
return Inventory.WeaponChange(F,bSilent);
}
simulated function WeaponTick(float dt)
{
//Instigator.PendingWeapon=Weapon(self.Inventory);
if(Role<ROLE_Authority)
{
Instigator.PendingWeapon = Instigator.Inventory.PrevWeapon(None, self);
Log("self.Inventory"@Instigator.PendingWeapon);
//BringUp(Instigator.PendingWeapon);
Instigator.Weapon = Instigator.PendingWeapon;
//Instigator.PendingWeapon;
Instigator.Controller.ChangedWeapon();
}
Super.WeaponTick(dt);
}
defaultproperties
{
FireModeClass(0)=Class'KFMod.NoFire'
FireModeClass(1)=Class'KFMod.NoFire'
InventoryGroup=5
PickupClass=Class'BagpackPickup'
ItemName="Bagpack"
bKFNeverThrow=false
bCanThrow=false
Weight=0.00
TraderInfoTexture=Texture'ServerPerksDZ.bagpack_t.trader_bagpack'
Description="Bagpack, adds some weight"
AddWeight=10
Priority=1
}