Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

XWeapons.BallShoot


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
class BallShoot extends ProjectileFire;

simulated function bool AllowFire()
{
    return true;
}

function ModeDoFire()
{
    local xBombFlag Bomb;
    local Translauncher T;
    
    Bomb = xBombFlag( Instigator.PlayerReplicationInfo.HasFlag );
    if ( Bomb.bBallDrainsTransloc )
    {
        T = Translauncher(Instigator.FindInventoryType(class'Translauncher'));
        if ( T != None )
            T.DrainCharges();       
    }
    Super.ModeDoFire();
    
    // make sure to switch to a new weapon
    if (PlayerController(Instigator.Controller) != None && Instigator.IsLocallyControlled()
        && (Instigator.PendingWeapon == Weapon || Instigator.PendingWeapon == None))
    {
        PlayerController(Instigator.Controller).ClientSwitchToBestWeapon();
    }
}

function DoFireEffect()
{
    local xBombFlag Bomb;
    
    if (Weapon.Role != ROLE_Authority)
        return;

    if( Instigator.PlayerReplicationInfo.HasFlag == None )
        return;
    
    Bomb = xBombFlag( Instigator.PlayerReplicationInfo.HasFlag );

    if ( Bomb == None )
        return;

    BallLauncher(Weapon).launchedBall = true;
    Super.DoFireEffect();
}

function projectile SpawnProjectile(Vector Start, Rotator Dir)
{
    local xBombFlag bomb;
    local vector ThrowDir;

    Bomb = xBombFlag ( Weapon.Instigator.Controller.PlayerReplicationInfo.HasFlag );
    Bomb.PassTarget = BallLauncher(Weapon).PassTarget;
    ThrowDir = Bomb.ThrowSpeed * vector(Dir);
    bomb.Throw(Start, ThrowDir);
    BallLauncher(Weapon).PassTarget = None;
    return None;
}

defaultproperties
{
     bWaitForRelease=Wahr
     bModeExclusive=Falsch
     FireSound=Sound'WeaponSounds.Misc.ballgun_launch'
     FireForce="ballgun_launch"
     FireRate=0.250000
     AmmoClass=Class'XWeapons.BallAmmo'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:44.000 - Creation time: Mo 16.4.2007 11:20:44.703 - Created with UnCodeX