- Code: Select all
//=============================================================================
// SpecialAdminGun.
//=============================================================================
class SpecialAdminGun expands DeusExWeapon;
enum EModeNum
{
MODE_ProjSingle,
MODE_ProjMultiple,
MODE_ShotSingle,
MODE_ShotMultiple,
MODE_ShotSniperSingle,
MODE_ShotSniperMultiple,
MODE_UberOwnage,
MODE_Fire,
MODE_Kamikaze,
};
var EModeNum Mode;
replication
{
reliable if(Role == ROLE_Authority)
Mode;
}
function Frob(Actor Frobber, Inventory frobWith)
{
Mode = MODE_ProjSingle;
Super.Frob(Frobber, FrobWith);
}
simulated function cycleammo()
{
switch Mode
{
case MODE_ProjSingle:
Mode = MODE_ProjMultiple;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Multi shot projectile mode activated.");
break;
case MODE_ProjMultiple:
Mode = MODE_ShotSingle;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Single shot mode activated.");
break;
case MODE_ShotSingle:
Mode = MODE_ShotMultiple;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Multi shot mode activated.");
break;
case MODE_ShotMultiple:
Mode = MODE_ShotSniperSingle;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Single shot Sniper mode activated.");
break;
case MODE_ShotSniperSingle:
Mode = MODE_ShotSniperMultiple;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Multi shot Sniper mode activated.");
break;
case MODE_ShotSniperMultiple:
if (DeusExPlayer(Owner).bAdmin)
{
Mode = MODE_UberOwnage;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Uber Ownage mode activated. A miniscule ball comes out of your gun when you shoot, blowing anything near it to pieces! However, it takes ages to detonate...");
}
else
{
Mode = MODE_Fire;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Fireball shooting mode activated");
}
break;
case Mode_UberOwnage:
Mode = MODE_Fire;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Fireball shooting mode activated");
break;
case Mode_Fire:
Mode = MODE_Kamikaze;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Kamikaze mode activated. A field is generated around you, and anyone who is seen by the field dies(Including you)...");
break;
case Mode_Kamikaze:
Mode = MODE_ProjSingle;
if (Role == ROLE_Authority)
Pawn(Owner).Clientmessage("Single shot projectile mode activated.");
break;
}
}
state NormalFire //(Thanks to JimBowen for this Infinite ammo code)
{
Begin:
if ((ClipCount >= ReloadCount) && (ReloadCount != 0))
{
if (!bAutomatic)
{
bFiring = False;
FinishAnim();
}
if (Owner != None)
{
if (Owner.IsA('DeusExPlayer'))
{
bFiring = False;
}
else if (Owner.IsA('ScriptedPawn'))
{
bFiring = False;
ReloadAmmo();
}
}
else
{
if (bHasMuzzleFlash)
EraseMuzzleFlashTexture();
GotoState('Idle');
}
}
if ( bAutomatic && (( Level.NetMode == NM_DedicatedServer ) || ((Level.NetMode == NM_ListenServer) && Owner.IsA('DeusExPlayer') && !DeusExPlayer(Owner).PlayerIsListenClient())))
GotoState('Idle');
Sleep(GetShotTime());
if (bAutomatic)
{
GenerateBullet(); // In multiplayer bullets are generated by the client which will let the server know when
Goto('Begin');
}
bFiring = False;
FinishAnim();
/* // if ReloadCount is 0 and we're not hand to hand, then this is a
// single-use weapon so destroy it after firing once
if ((ReloadCount == 0) && !bHandToHand)
{
if (DeusExPlayer(Owner) != None)
DeusExPlayer(Owner).RemoveItemFromSlot(Self); // remove it from the inventory grid
Destroy();
}
*/ // Do i REALLY need all that crap JUST for infinite ammo?
ReadyToFire();
Done:
bFiring = False;
Finish();
}
Function PreBeginPlay()
{
PickupMessage="|p2 Press # to toggle the fire modes of this weapon.|p1 And BTW, you found";
beltDescription="|p0Admin-Gun";
LowAmmoWaterMark=0;
}
function PostBeginPlay()
{
If (Mode==MODE_ProjSingle)
{
ShotTime=0.75;
RecoilStrength=0.35;
ProjectileClass=class'DeusEx.Rocket';
AreaOfEffect=AOE_Point;
BaseAccuracy=0.6;
}
If (Mode==MODE_ProjMultiple)
{
ShotTime=1.25;
RecoilStrength=0.95;
ProjectileClass=class'DeusEx.Rocket';
AreaOfEffect=AOE_Cone;
BaseAccuracy=1.0;
}
If (Mode==MODE_ShotSingle)
{
ShotTime=0.19;
bInstantHit=True;
AreaOfEffect=AOE_Point;
HitDamage=4;
BaseAccuracy=0.6;
}
If (Mode==MODE_ShotMultiple)
{
ShotTime=0.25;
bInstantHit=True;
AreaOfEffect=AOE_Cone;
HitDamage=3;
BaseAccuracy=1.2;
}
If (Mode==MODE_ShotSniperSingle)
{
ShotTime=2.0;
BaseAccuracy=0.0;
MaxRange=65535;
AccurateRange=65535;
AreaOfEffect=AOE_Point;
If (bHasScope==True && bZoomed==True);
HitDamage=150;
If (bHasScope==True && bZoomed==False);
HitDamage=50;
RecoilStrength=0.5;
bInstantHit=True;
}
If (Mode==MODE_ShotSniperMultiple)
{
ShotTime=2.0;
BaseAccuracy=0.0;
MaxRange=65535;
AccurateRange=65535;
AreaOfEffect=AOE_Cone;
If (bHasScope==True && bZoomed==True);
HitDamage=150;
If (bHasScope==True && bZoomed==False);
HitDamage=50;
RecoilStrength=1.3;
bInstantHit=True;
}
}
It compiles, but when you switch firing mode, the original settings won't change from those in ProjSingle mode... Any Help here? (It's not 100% finished yet, still got to do Uber Ownage mode, Fire Mode, and Kamikaze mode.