Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UnrealShare.WoodenBox


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
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
//=============================================================================
// WoodenBox.
//=============================================================================
class WoodenBox extends Decoration;

#exec OBJ LOAD FILE=Detail.utx

#exec AUDIO IMPORT FILE="Sounds\General\bPush1.wav" NAME="ObjectPush" GROUP="General"
#exec AUDIO IMPORT FILE="Sounds\General\EndPush.wav" NAME="Endpush" GROUP="General"

#exec MESH IMPORT MESH=WoodenBoxM ANIVFILE=Models\Box_a.3d DATAFILE=ModelsFX\Box_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=WoodenBoxM X=0 Y=0 Z=0 YAW=64
#exec MESH SEQUENCE MESH=WoodenBoxM SEQ=All    STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=WoodenBoxM SEQ=Still  STARTFRAME=0   NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JWoodenBox1 FILE=Models\Box.pcx GROUP=Skins Specular=0.5 DETAIL=wood2
#exec MESHMAP SCALE MESHMAP=WoodenBoxM X=0.08 Y=0.08 Z=0.16
#exec MESHMAP SETTEXTURE MESHMAP=WoodenBoxM NUM=1 TEXTURE=JWoodenBox1

var() int Health;
var() int FragChunks;
var() Float Fragsize;

function PreBeginPlay()
{
	// some boxes will float (randomly)
	if ( Buoyancy == Default.Buoyancy)
		Buoyancy = Mass * (0.9 + 0.6 * FRand());

	Super.PreBeginPlay();
}

Auto State Animate
{

	function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation,
	Vector momentum, name damageType)
	{
		if (bStatic || bDeleteme)
			return;
		Instigator = InstigatedBy;
		if (Health<0) Return;
		if ( Instigator != None )
			MakeNoise(1.0);
		bBobbing = false;
		Health -= NDamage;
		if (Health <0)
			Frag(Class'WoodFragments',Momentum,FragSize,FragChunks);
		else
		{
			SetPhysics(PHYS_Falling);
			Momentum.Z = 1000;
			Velocity=Momentum*0.016;
		}
	}
}

defaultproperties
{
				Health=20
				FragChunks=12
				Fragsize=1.750000
				bPushable=True
				PushSound=Sound'UnrealShare.General.ObjectPush'
				EndPushSound=Sound'UnrealShare.General.Endpush'
				bStatic=False
				DrawType=DT_Mesh
				Mesh=LodMesh'UnrealShare.WoodenBoxM'
				CollisionRadius=29.000000
				CollisionHeight=26.000000
				bCollideActors=True
				bCollideWorld=True
				bBlockActors=True
				bBlockPlayers=True
				Mass=50.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: zo 11-11-2012 21:10:28.000 - Creation time: zo 11-11-2012 21:14:23.084 - Created with UnCodeX