# SFDecos.SFPickBox

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 |
    //=============================================================================
    // Spatial Fear
    // Class: SFPickBox
    // Descripton: A piece of decoration - a box that player can pick up, carry
    //             somewher and drop.
    //
    // Model: Ivan Tantziura
    // Code: Jacek 'moose' Zagrodzki
    //=============================================================================
    class SFPickBox expands SFDecoration;

    #exec TEXTURE IMPORT NAME=JSFPickBox FILE=TEXTURES\SFPickBox.PCX GROUP=Skins FLAGS=2 // 14 - Default

    var SFPickBoxTrigger	TheTrigger;

    function PostBeginPlay()
    {
    	TheTrigger = spawn(class'SFPickBoxTrigger', Self, , Location);
    	TheTrigger.TheBox = self;
    }

    function Tick(float DTime)
    {
    	if(TheTrigger.bCarried)
    	{
    		// setting location of a trigger, used to deactivate bot, in front of a player
    		if(TheTrigger.aPlayer.bBehindView)
    			PrePivot = 35*vector(TheTrigger.aPlayer.Rotation) + 0.35*TheTrigger.aPlayer.EyeHeight * vect(0,0,1);
    		else
    			PrePivot = 35*vector(TheTrigger.aPlayer.ViewRotation) + 0.35*TheTrigger.aPlayer.EyeHeight * vect(0,0,1);
    	}
    }

    function Destroyed()
    {
    	if(TheTrigger.bCarried)
    		TheTrigger.FireEvent(TheTrigger.aPlayer);
    }

    event Landed( vector HitNormal )
    {
    	local rotator	NewRot;
    	NewRot = rotator(HitNormal);

    	NewRot.roll = Rotation.roll;
    	NewRot.yaw = Rotation.yaw;
    	NewRot.pitch -= 16384;	// rotate by 90 degrees

    	SetRotation(NewRot);
    }

    defaultproperties
    {
         bStatic=False
         bTrailerSameRotation=True
         Physics=PHYS_Falling
         DrawType=DT_Mesh
         Mesh=LodMesh'SFDecos.SFMbox'
         DrawScale=0.500000
         MultiSkins(1)=Texture'SFDecos.Skins.JSFPickBox'
         CollisionRadius=18.000000
         CollisionHeight=13.000000
    }

class file time: 12/7/2003 3:58:26 PM - creation time: 12/7/2003 4:03:45 PM
Created with UnCodeX