77 lines
1.3 KiB
Ucode
77 lines
1.3 KiB
Ucode
class MutChaChaFastWeaponSwitch extends Mutator;
|
|
|
|
var config float CfgPutDownTime;
|
|
var config float CfgBringUpTime;
|
|
|
|
var float PutDownTime;
|
|
var float BringUpTime;
|
|
|
|
|
|
replication
|
|
{
|
|
unreliable if( ROLE==ROLE_Authority)
|
|
PutDownTime,BringUpTime;
|
|
}
|
|
|
|
simulated function PreBeginPlay()
|
|
{
|
|
if( ROLE==ROLE_Authority)
|
|
Level.GRI.bFastWeaponSwitching = true;
|
|
|
|
Super.PreBeginPlay();
|
|
|
|
PutDownTime = CfgPutDownTime;
|
|
BringUpTime = CfgBringUpTime;
|
|
|
|
|
|
class'Weapon'.default.PutDownTime = PutDownTime;
|
|
class'Weapon'.default.BringUpTime = BringUpTime;
|
|
|
|
setTimer(0.5,True);
|
|
|
|
}
|
|
|
|
|
|
|
|
simulated event Timer()
|
|
{
|
|
local Weapon aWeapon;
|
|
|
|
foreach AllActors(class'Weapon', aWeapon) {
|
|
aWeapon.PutDownTime = PutDownTime;
|
|
aWeapon.BringUpTime = BringUpTime;
|
|
aWeapon.default.PutDownTime = PutDownTime;
|
|
aWeapon.default.BringUpTime = BringUpTime;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto state Startup
|
|
{
|
|
function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
|
|
{
|
|
bSuperRelevant = 0;
|
|
|
|
if ( GameReplicationInfo(Other) != None )
|
|
{
|
|
GameReplicationInfo(Other).bFastWeaponSwitching = true;
|
|
GotoState('');
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
defaultproperties
|
|
{
|
|
GroupName="MutFastWeapSwitch"
|
|
FriendlyName="Very Fast Weapons Switch"
|
|
Description="Very Fast Weapon Switching"
|
|
CfgPutDownTime=0.01
|
|
CfgBringUpTime=0.01
|
|
Role=ROLE_Authority
|
|
RemoteRole=ROLE_SimulatedProxy
|
|
bAlwaysRelevant=true
|
|
}
|