Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 |
//============================================================================= // Dual 50 Cal Inventory class //============================================================================= class DualDeagle extends Dualies; function bool HandlePickupQuery( pickup Item ) { if ( Item.InventoryType==Class'Deagle' || Item.InventoryType==Class'GoldenDeagle' ) { if( LastHasGunMsgTime < Level.TimeSeconds && PlayerController(Instigator.Controller) != none ) { LastHasGunMsgTime = Level.TimeSeconds + 0.5; PlayerController(Instigator.Controller).ReceiveLocalizedMessage(Class'KFMainMessages', 1); } return True; } return Super.HandlePickupQuery(Item); } function AttachToPawn(Pawn P) { local name BoneName; Super.AttachToPawn(P); if(altThirdPersonActor == None) { altThirdPersonActor = Spawn(AttachmentClass,Owner); InventoryAttachment(altThirdPersonActor).InitFor(self); } else altThirdPersonActor.NetUpdateTime = Level.TimeSeconds - 1; BoneName = P.GetOffhandBoneFor(self); if(BoneName == '') { altThirdPersonActor.SetLocation(P.Location); altThirdPersonActor.SetBase(P); } else P.AttachToBone(altThirdPersonActor,BoneName); if(altThirdPersonActor != None) DualDeagleAttachment(altThirdPersonActor).bIsOffHand = true; if(altThirdPersonActor != None && ThirdPersonActor != None) { DualDeagleAttachment(altThirdPersonActor).brother = DualDeagleAttachment(ThirdPersonActor); DualDeagleAttachment(ThirdPersonActor).brother = DualDeagleAttachment(altThirdPersonActor); altThirdPersonActor.LinkMesh(DualDeagleAttachment(ThirdPersonActor).BrotherMesh); } } function GiveTo( pawn Other, optional Pickup Pickup ) { local Inventory I; local int OldAmmo; local bool bNoPickup; MagAmmoRemaining = 0; For( I = Other.Inventory; I != None; I =I.Inventory ) { if ( Deagle(I) != none ) { if( WeaponPickup(Pickup)!= none ) { WeaponPickup(Pickup).AmmoAmount[0] += Weapon(I).AmmoAmount(0); } else { OldAmmo = Weapon(I).AmmoAmount(0); bNoPickup = true; } MagAmmoRemaining = Deagle(I).MagAmmoRemaining; I.Destroyed(); I.Destroy(); Break; } } if ( KFWeaponPickup(Pickup) != None && Pickup.bDropped ) { MagAmmoRemaining = Clamp(MagAmmoRemaining + KFWeaponPickup(Pickup).MagAmmoRemaining, 0, MagCapacity); } else { MagAmmoRemaining = Clamp(MagAmmoRemaining + Class'Deagle'.Default.MagCapacity, 0, MagCapacity); } Super(Weapon).GiveTo(Other, Pickup); if ( bNoPickup ) { AddAmmo(OldAmmo, 0); Clamp(Ammo[0].AmmoAmount, 0, MaxAmmo(0)); } } function DropFrom(vector StartLocation) { local int m; local Pickup Pickup; local Inventory I; local int AmmoThrown, OtherAmmo; if( !bCanThrow ) return; AmmoThrown = AmmoAmount(0); ClientWeaponThrown(); for (m = 0; m < NUM_FIRE_MODES; m++) { if (FireMode[m].bIsFiring) StopFire(m); } if ( Instigator != None ) DetachFromPawn(Instigator); if( Instigator.Health > 0 ) { OtherAmmo = AmmoThrown / 2; AmmoThrown -= OtherAmmo; I = Spawn(Class'Deagle'); I.GiveTo(Instigator); Weapon(I).Ammo[0].AmmoAmount = OtherAmmo; Deagle(I).MagAmmoRemaining = MagAmmoRemaining / 2; MagAmmoRemaining = Max(MagAmmoRemaining-Deagle(I).MagAmmoRemaining,0); } Pickup = Spawn(Class'DeaglePickup',,, StartLocation); if ( Pickup != None ) { Pickup.InitDroppedPickupFor(self); Pickup.Velocity = Velocity; WeaponPickup(Pickup).AmmoAmount[0] = AmmoThrown; if( KFWeaponPickup(Pickup)!=None ) KFWeaponPickup(Pickup).MagAmmoRemaining = MagAmmoRemaining; if (Instigator.Health > 0) WeaponPickup(Pickup).bThrown = true; } Destroyed(); Destroy(); } simulated function bool PutDown() { if ( Instigator.PendingWeapon.class == class'Deagle' ) { bIsReloading = false; } return super.PutDown(); } defaultproperties { altFlashBoneName="tip01" MagCapacity=16 FlashBoneName="tip" HudImage=Texture'KillingFloorHUD.WeaponSelect.dual_handcannon_unselected' SelectedHudImage=Texture'KillingFloorHUD.WeaponSelect.dual_handcannon' bTorchEnabled=False StandardDisplayFOV=60.000000 TraderInfoTexture=Texture'KillingFloorHUD.Trader_Weapon_Images.Trader_Dual_Handcannons' bIsTier2Weapon=True ZoomedDisplayFOV=50.000000 FireModeClass(0)=Class'KFMod.DualDeagleFire' FireModeClass(1)=Class'KFMod.NoFire' SelectSound=Sound'KF_HandcannonSnd.50AE_Select' AIRating=0.450000 CurrentRating=0.450000 Description="Dual .50 calibre action express handgun. Dual 50's is double the fun." DisplayFOV=60.000000 Priority=125 GroupOffset=4 PickupClass=Class'KFMod.DualDeaglePickup' PlayerViewOffset=(X=25.000000) BobDamping=6.000000 AttachmentClass=Class'KFMod.DualDeagleAttachment' IconCoords=(X1=250,Y1=110,X2=330,Y2=145) ItemName="Dual Handcannons" Mesh=SkeletalMesh'KF_Weapons_Trip.Dual50_Trip' DrawScale=1.000000 Skins(0)=Combiner'KF_Weapons_Trip_T.Pistols.deagle_cmb' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |