## XIII
Class SkillDocumentPick

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Pickup
             |
             +--XIII.XIIIPickup
                |
                +--XIII.XIIIDocumentPick
                   |
                   +--XIII.SkillDocumentPick

Direct Known Subclasses:BreathSkillPick, DualWeaponSkillPick, FirstAidSkillPick, PickLockSkillPick, SilentWalkSkillPick, SixSenseSkillPick, SniperSkillPick, StunningSkillPick

class SkillDocumentPick
extends XIII.XIIIDocumentPick

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

Variables
`class` | `SkillGiven` skill to give at the same time we pick up the doc.

Function Summary
`Inventory` | `SpawnCopy(Pawn Other)`
    //_____________________________________________________________________________

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class SkillDocumentPick extends XIIIDocumentPick
    00005	    abstract;
    00006
    00007	var class<XIIISkill> SkillGiven;    // skill to give at the same time we pick up the doc.
    00008
    00009	//_____________________________________________________________________________
    00010	function inventory SpawnCopy(Pawn Other)
    00011	{
    00012	    local XIIISkill Skill;
    00013	    local inventory Inv;
    00014	    local Inventory Copy;
    00015
    00016	    Skill = XIIISkill(Other.FindInventoryType(SkillGiven));
    00017	    if ( Skill == none )
    00018	    {
    00019	      Copy = spawn(SkillGiven,Other,,,rot(0,0,0));
    00020	      Copy.GiveTo( Other );
    00021	      Skill = XIIISkill(Copy);
    00022	      Inv = Super.SpawnCopy(other);
    00023	      SkillDocument(Inv).RelatedSkill = Skill;
    00024	    }
    00025	    else
    00026	    {
    00027	      for( Inv=Other.Inventory; Inv!=None; Inv=Inv.Inventory )
    00028	      {
    00029	        if ( (SkillDocument(Inv) != none) && (SkillDocument(Inv).RelatedSkill == Skill) )
    00030	          return Inv;
    00031	      }
    00032	      // Should never be there.
    00033	//      Level.Game.Broadcast( self, "WARNING :: Skill "$Skill$" already in inventory but no document related, CHEATING HAVE OCCURED" );
    00034	      return none;
    00035	    }
    00036	}
    00037
    00038
    00039
    00040	defaultproperties
    00041	{
    00042	     InventoryType=Class'XIII.SkillDocument'
    00043	     PickupMessage="IMPORTANT DOCUMENT"
    00044	     StaticMesh=StaticMesh'MeshObjetsPickup.dossierXIII'
    00045	     MessageClass=Class'XIII.DocumentPickupMessage'
    00046	}

End Source Code