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

XGame.xBombDeliveryHole


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
class xBombDeliveryHole extends Decoration
    notplaceable;

#exec OBJ LOAD File=XGame_StaticMeshes.usx

function Touch(Actor Other)
{
    local xBombFlag bomb;

    bomb = xBombFlag(Other);

    if (bomb != None)
        TryThrowScore(bomb);
    else
        TryJumpScore(Pawn(Other));
}

function bool CheckScorer(Pawn P, bool bKill)
{
	local vector NewVel;
	local Controller ScoreController;
	
    // valid player
    if ( P == None )
		return false;
	if ( P.IsPlayerPawn() )
		ScoreController = P.Controller;
	else if ( !bKill && (P.Controller == None) && P.WasPlayerPawn() )
		ScoreController = xPawn(P).OldController;
	else
		return false;
		
    // opposing team delivery
    if ( (ScoreController == None)
		|| (ScoreController.PlayerReplicationInfo == None)
		|| (ScoreController.PlayerReplicationInfo.Team.TeamIndex == xBombDelivery(Owner).Team) )
    {
		if ( (Bot(ScoreController) != None) && ScoreController.IsInState('Testing') )
			return false;
			
		if ( bKill && (P.Controller != None) )
		{
			// propel him on through
			NewVel = 300 * Normal(P.Velocity);
			NewVel.Z = 100;
			P.AddVelocity(NewVel);
			P.Died( P.Controller, class'Suicided', P.Location );
		}
        return false;
	}
    return true;
}

function TryThrowScore(xBombFlag bomb)
{
	local Controller ScoreController;

    if ( !Bomb.bThrownBomb || !CheckScorer(Bomb.Instigator, false) )
        return;

	if ( Bomb.Instigator.Controller != None )
		ScoreController = Bomb.Instigator.Controller;
	else
		ScoreController = xPawn(Bomb.Instigator).OldController;

    // throwing score!            
    xBombingRun(Level.Game).ScoreBomb(ScoreController, bomb);
    xBombDelivery(Owner).ScoreEffect(false);
}

function TryJumpScore(Pawn holder)
{
    if ( !CheckScorer(holder, true) )
        return;

    if (holder.Controller.PlayerReplicationInfo.HasFlag == None)
        return;

    // contact score!
    xBombingRun(Level.Game).ScoreBomb(holder.Controller, xBombFlag(holder.Controller.PlayerReplicationInfo.HasFlag));			
	TriggerEvent(Event,self, Holder);
    xBombDelivery(Owner).ScoreEffect(true);
}

// !! this uses a simple staticmesh for collision, a cylinder wouldn't suffice.

defaultproperties
{
	RemoteRole=ROLE_None
    bHidden=true
    bCollideActors=true   
    bStatic=false
    bNoDelete=false
    CollisionRadius=60.000000
    CollisionHeight=60.000000
    DrawScale=1.00
    DrawType=DT_StaticMesh
    StaticMesh=XGame_StaticMeshes.BombGateCol
    Style=STY_Normal
    bUseCylinderCollision=false
    LightType=LT_None
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:36:26.000 - Creation time: Do 14.8.2014 09:58:55.892 - Created with UnCodeX