## XIII
Class CWndHeadShot

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Effects
             |
             +--XIII.CWndBase
                |
                +--XIII.CWndHeadShot

Direct Known Subclasses:None

class CWndHeadShot
extends XIII.CWndBase

    // Specific FX to be displayed when a HeadShot occured
    //-----------------------------------------------------------

Variables
`Texture` | `CornerTexture` should be the dying guy
`XIIIPawn` | `Killed` should be the dying guy
`campos3,` | `MemDir` should be the dying guy
`rotator` | `RotMem` should be the dying guy
`bool` | `bAnimateInRealTime` should be the dying guy
`int` | `iPhase`

Source Code

    00001	// Specific FX to be displayed when a HeadShot occured
    00002	//-----------------------------------------------------------
    00003	class CWndHeadShot extends CWndBase;
    00004
    00005	var int iPhase;
    00006	var XIIIPawn Killed;  // should be the dying guy
    00007	var texture CornerTexture;
    00008	var vector campos1, campos2, campos3, MemDir;
    00009	var rotator RotMem;
    00010
    00011	var bool bAnimateInRealTime;
    00012	CONST WNDSIZE=128;
    00013	CONST SFXDURATION=3.0;
    00014	CONST SPACEX=17;
    00015
    00016	//_____________________________________________________________________________
    00017	event PostBeginPlay()
    00018	{
    00019	    Super.PostBeginPlay();
    00020	    if ( (Level.Game != none) && (Level.Game.DetailLevel > 1) )
    00021	    {
    00022	//      Log("Plateform ="$XIIIGameInfo(Level.Game).PlateForme@"XBOX, enable tick");
    00023	      bAnimateInRealTime = true;
    00024	//      Enable('Tick'); // why dis/en able don't work ?
    00025	    }
    00026	    else
    00027	    {
    00028	//      Log("Plateform ="$XIIIGameInfo(Level.Game).PlateForme@"NOT XBOX, disable tick");
    00029	      bAnimateInRealTime = false;
    00030	//      Disable('Tick'); // why dis/en able don't work ?
    00031	    }
    00032	}
    00033
    00034	//_____________________________________________________________________________
    00035	//SOUTHEND Moving frame code
    00036	event Tick(float DeltaT)
    00037	{
    00038	    if ( bAnimateInRealTime )
    00039	    {
    00040	      HideUnwanted();
    00041	      MyHudForFX.PlayerOwner.Pawn.bOwnerNoSee = true;
    00042	      switch (iPhase)
    00043	      {
    00044	        Case 1:
    00045	          MyHudForFX.CWndMat.Update( 0, 0, WNDSIZE, WNDSIZE, killed.GetBoneCoords('X Head').Origin + campos1, RotMem, 20, FilterColor,HighLight,FilterTexture );
    00046	        break;
    00047	        Case 2:
    00048	          MyHudForFX.CWndMat.Update( WNDSIZE, 0, WNDSIZE, WNDSIZE, killed.GetBoneCoords('X Head').Origin + campos2, RotMem, 17, FilterColor,HighLight,FilterTexture );
    00049	        break;
    00050	        Case 3:
    00051	          MyHudForFX.CWndMat.Update( 0, WNDSIZE, WNDSIZE, WNDSIZE, killed.GetBoneCoords('X Head').Origin + campos3, RotMem, 14, FilterColor,HighLight,FilterTexture );
    00052	        break;
    00053	      }
    00054	      RestoreUnwanted();
    00055	    }
    00056	}
    00057
    00058	//_____________________________________________________________________________
    00059	event Timer()
    00060	{
    00061	    local HudCartoonWindow temp;
    00062	    if (iPhase==0)
    00063	    {
    00064	      if (MyHudForFX.HudWnd!=none)
    00065	      {
    00066	        Destroy();
    00067	        return;
    00068	      }
    00069	    }
    00070	    else
    00071	    {
    00072	      temp = MyHudForFX.HudWnd;
    00073	      while (temp != none)
    00074	      {
    00075	        if (!temp.bLowPriority)
    00076	        {
    00077	          Destroy();
    00078	          return;
    00079	        }
    00080	        temp = temp.NextHudWnd;
    00081	      }
    00082	    }
    00083
    00084	    iPhase ++;
    00085	    HideUnwanted();
    00086	    MyHudForFX.PlayerOwner.Pawn.bOwnerNoSee = true;
    00087	    switch (iPhase)
    00088	    {
    00089	      Case 1:
    00090	        FilterColor.A = 200;
    00091	        MemDir = normal(killed.Location - owner.location);
    00092	        campos1 = vect(0,0,3) - 120*MemDir;
    00093	        RotMem = rotator(killed.Location - owner.location);
    00094	        MyHudForFX.CWndMat.Update( 0, 0, WNDSIZE, WNDSIZE, killed.GetBoneCoords('X Head').Origin + CamPos1, RotMem, 20, FilterColor,HighLight,FilterTexture );
    00095	        Owner.PlaySound(hCWndSound);
    00096	        AddWnd(0, 0, WNDSIZE-10, (WNDSIZE-10)*3/4, MyHudForFX.CWndMat, 0, WNDSIZE*1/8, WNDSIZE, WNDSIZE*3/4, SFXDURATION, true);
    00097	        SetTimer(0.2, false);
    00098	        break;
    00099	      case 2:
    00100	        FilterColor.A = 200;
    00101	        campos2 = campos1 - vect(0,0,1);
    00102	        MyHudForFX.CWndMat.Update( WNDSIZE, 0, WNDSIZE, WNDSIZE, killed.GetBoneCoords('X Head').Origin + CamPos2, RotMem, 17, FilterColor,HighLight,FilterTexture );
    00103	        Owner.PlaySound(hCWndSound);
    00104	        AddWnd(WNDSIZE-10+SPACEX, 0, WNDSIZE, WNDSIZE*3/4, MyHudForFX.CWndMat, WNDSIZE, WNDSIZE*1/8, WNDSIZE, WNDSIZE*3/4, SFXDURATION, true);
    00105	        SetTimer(0.2, false);
    00106	        break;
    00107	      Case 3:
    00108	        FilterColor.A = 200;
    00109	        campos3 = campos1 - vect(0,0,2);
    00110	        MyHudForFX.CWndMat.Update( 0, WNDSIZE, WNDSIZE, WNDSIZE, killed.GetBoneCoords('X Head').Origin + CamPos3, RotMem, 14, FilterColor,HighLight,FilterTexture );
    00111	        Owner.PlaySound(hCWndSound);
    00112	        AddWnd(WNDSIZE-10+SPACEX+WNDSIZE+SPACEX, 0, WNDSIZE+10, (WNDSIZE+10)*3/4, MyHudForFX.CWndMat, 0, WNDSIZE*9/8, WNDSIZE, WNDSIZE*3/4, SFXDURATION, true);
    00113	        if ( Killed.MyDeathOno != none )
    00114	        {
    00115	          CWndBorderColor = class'canvas'.static.MakeColor(0,0,0,0);
    00116	          AddWnd(WNDSIZE-10+SPACEX+WNDSIZE+SPACEX-60, -50, Killed.MyDeathOno.Emitters[0].Texture.USize, Killed.MyDeathOno.Emitters[0].Texture.VSize*3/4, Killed.MyDeathOno.Emitters[0].Texture, 0, 0, Killed.MyDeathOno.Emitters[0].Texture.USize, Killed.MyDeathOno.Emitters[0].Texture.VSize, SFXDURATION, true);
    00117	          CWndBorderColor = class'canvas'.static.MakeColor(255,0,0,255);
    00118	        }
    00119
    00120	        // send splash at the same time to synchronize erasing windows after headshot
    00121	        if ( Level.Game.GoreLevel == 0 )
    00122	        {
    00123	          CWndBorderColor = class'canvas'.static.MakeColor(0,0,0,0);
    00124	          if ( Level.bLonePlayer && Level.Game.bAlternateMode )
    00125	            CornerTexture = texture'XIIICine.effets.vignetteblood_2';
    00126	          AddWnd(WNDSIZE-10+SPACEX+WNDSIZE+SPACEX+WNDSIZE+10-48, 0+(WNDSIZE+10)*3/4-48, CornerTexture.USize, CornerTexture.VSize, CornerTexture, 0, 0, CornerTexture.USize, CornerTexture.VSize, SFXDURATION-0.2, true);
    00127	          CWndBorderColor = class'canvas'.static.MakeColor(255,0,0,255);
    00128	        }
    00129	        SetTimer(0.2, false);
    00130	        break;
    00131	      Case 4:
    00132	/*
    00133	        CWndBorderColor = class'canvas'.static.MakeColor(0,0,0,0);
    00134	        if ( Level.bLonePlayer && Level.Game.bAlternateMode )
    00135	          CornerTexture = texture'XIIICine.effets.vignetteblood_2';
    00136	        AddWnd(WNDSIZE-10+SPACEX+WNDSIZE+SPACEX+WNDSIZE+10-48, 0+(WNDSIZE+10)*3/4-48, CornerTexture.USize, CornerTexture.VSize, CornerTexture, 0, 0, CornerTexture.USize, CornerTexture.VSize, SFXDURATION-0.2, true);
    00137	        CWndBorderColor = class'canvas'.static.MakeColor(255,0,0,255);
    00138	        SetTimer(0.2, false);
    00139	        break;
    00140	      Case 5:
    00141	*/
    00142	        Destroy();
    00143	        break;
    00144	    }
    00145	    RestoreUnwanted();
    00146	}
    00147
    00148
    00149	defaultproperties
    00150	{
    00151	     CornerTexture=Texture'XIIICine.effets.vignetteblood'
    00152	     hCWndSound=Sound'XIIIsound.Interface__VignettesFx.VignettesFx__hHeadshot'
    00153	     FilterColor=(B=0,G=116,R=244,A=150)
    00154	     HighLight=0.300000
    00155	     CWndSoundType=0
    00156	}

End Source Code