All pastes #884651 Raw Edit

Stuff

public text v1 · immutable
#884651 ·published 2008-01-30 14:43 UTC
rendered paste body
simulated function HitWall(vector HitNormal, Actor HitWall) {
  StickToWall(HitNormal);
}

simulated function Landed(vector HitNormal) {
  StickToWall(HitNormal);
}

simulated function StickToWall(vector HitNormal) {
  if(bStickingToPawn || bStickingToWall) return;

  PlayAnim('Still');
  SetPhysics(PHYS_None);
  //TimeLeft=StickyTime;
  HitLocation=HitNormal;
  bStickingToWall=true;
  SetTimer(0.2,false);
}














	simulated function HitWall (vector HitNormal, actor Wall)
	{
		if ( bAlreadyHit )
		{
			bBounce = false;
			return;
		}
		bAlreadyHit = ( HitNormal.Z > 0.7 );
		PlaySound(ImpactSound, SLOT_Misc);	  // hit wall sound
		Velocity = 0.3*(( Velocity dot HitNormal ) * HitNormal * (-2.0) + Velocity);   // Reflect off Wall w/damping
		speed = VSize(Velocity);
	}

	simulated event Landed( vector HitNormal )
	{
		local rotator newRot;

		SetTimer(2.5, false);
		newRot = Rotation;
		newRot.Pitch = 0;
		newRot.Roll = 0;
		SetRotation(newRot);
		PlayAnim('Open',0.1);
		if ( Role == ROLE_Authority )
		{
			RemoteRole = ROLE_DumbProxy;
			RealLocation = Location;
			if ( Master.Owner.IsA('Bot') )
			{
				if ( Pawn(Master.Owner).Weapon == Master )
					Bot(Master.Owner).SwitchToBestWeapon();
				LifeSpan = 10;
			}
			Disable('Tick');
		}
	}