## XIII
Class HookProjectile

source: C:\XIII\XIII\Classes\HookProjectile.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Projectile
             |
             +--XIII.XIIIProjectile
                |
                +--XIII.HookProjectile

Direct Known Subclasses:None

class HookProjectile
extends XIII.XIIIProjectile

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`sound` | `hHookLockSound`

States
Locked

Function Summary
`simulated` | `Explode(vector HitLocation, vector HitNormal)`
    //_____________________________________________________________________________
    // Maybe use this for the hook to destroy the link when DeActivated.
`simulated` | `HitWall(vector HitNormal, Actor Wall)`
    //_____________________________________________________________________________
    // & Override HitWall
`simulated` | `PostBeginPlay()`
    //_____________________________________________________________________________
    // Set up speed
`simulated` | `ProcessTouch(Actor Other, Vector HitLocation)`
    //_____________________________________________________________________________
    // Override ProcessTouch

State Locked Function Summary
`void` | `BeginState()`

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class HookProjectile extends XIIIProjectile;
    00005
    00006	var sound hHookLockSound;
    00007
    00008	//_____________________________________________________________________________
    00009	// Set up speed
    00010	simulated function PostBeginPlay()
    00011	{
    00012	    Super(Projectile).PostBeginPlay();
    00013	    if ( (StaticMesh == none) && (StaticMeshName != "") )
    00014	    {
    00015	      StaticMesh = StaticMesh(dynamicloadobject(StaticMeshName, class'StaticMesh'));
    00016	      default.StaticMesh = StaticMesh;
    00017	      SetDrawType(DT_StaticMesh);
    00018	//      Log("PostBeginPlay DYNAMICLOAD StaticMesh "$StaticMeshName@"result "$StaticMesh);
    00019	    }
    00020	    vWaterEntry = Location;
    00021	    OrgFrom = Location;
    00022	    Velocity = Vector(Rotation) * Speed;
    00023	}
    00024
    00025	//_____________________________________________________________________________
    00026	// Override ProcessTouch
    00027	simulated function ProcessTouch(Actor Other, Vector HitLocation)
    00028	{
    00029	    local rotator R;
    00030
    00031	//    Log(self@"ProcessTouch"@Other);
    00032	    if (Other == Instigator)
    00033	      return;
    00034	    if ( HookPoint(Other)!= none )
    00035	    {
    00036	      TriggerEvent(Other.Event, self, Instigator);
    00037	      Velocity = vector(Rotation) * 0.0;
    00038	      SetPhysics(PHYS_None);
    00039	      SetCollision(false,false,false);
    00040	      SetLocation(Other.Location);
    00041	      R = rotator(vect(0,0,1));
    00042	      SetRotation(R);
    00043	      gotostate('Locked');
    00044	      return;
    00045	    }
    00046	    // Else deactivate
    00047	//    Log("Releasing hook because Projectile hit actor.");
    00048	    Hook(Owner).Release();
    00049	}
    00050
    00051	//_____________________________________________________________________________
    00052	// & Override HitWall
    00053	simulated function HitWall (vector HitNormal, actor Wall)
    00054	{
    00055	    // Deactivate
    00056	    Log("Releasing hook because Projectile hit wall"@Wall@"(should not happen...).");
    00057	    Hook(Owner).Release();
    00058	/*
    00059	    Velocity = vector(Rotation) * 0.0;
    00060	    SetPhysics(PHYS_None);
    00061	    gotostate('Locked');
    00062	*/
    00063	}
    00064
    00065	//_____________________________________________________________________________
    00066	// Maybe use this for the hook to destroy the link when DeActivated.
    00067	simulated function Explode(vector HitLocation, vector HitNormal)
    00068	{
    00069	    Destroy();
    00070	}
    00071
    00072	//_____________________________________________________________________________
    00073	state Locked
    00074	{
    00075	    ignores Touch, ProcessTouch, HitWall;
    00076	    function BeginState()
    00077	    {
    00078	      Hook(Owner).PlaySound(hHookLockSound);
    00079	    }
    00080	}
    00081
    00082	//    DrawType=DT_Mesh
    00083	//    Mesh=VertMesh'XIIIArmes.GrappinM'
    00084
    00085
    00086	defaultproperties
    00087	{
    00088	     hHookLockSound=Sound'XIIIsound.SpecActions.HookCatch'
    00089	     Speed=1200.000000
    00090	     MaxSpeed=3600.000000
    00091	     MyDamageType=Class'XIII.DTPierced'
    00092	     DrawType=DT_StaticMesh
    00093	     LifeSpan=0.000000
    00094	     StaticMesh=StaticMesh'MeshArmesPickup.grappin'
    00095	     CollisionRadius=5.000000
    00096	     CollisionHeight=5.000000
    00097	}

End Source Code