# SFDecos.SFPlantA

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 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 |
    //=============================================================================
    // SFPlantA.
    //=============================================================================
    class SFPlantA expands SFDecoration;

    #exec MESH IMPORT MESH=SFPlantA ANIVFILE=MODELS\SFPlantA_a.3d DATAFILE=MODELS\SFPlantA_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFPlantA X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFPlantA SEQ=All      STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFPlantA SEQ=SFPlanta STARTFRAME=0 NUMFRAMES=1

    #exec TEXTURE IMPORT NAME=JSFPlanta1 FILE=TEXTURES\SFPlant1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFPlanta2 FILE=TEXTURES\SFPlant2.PCX GROUP=Skins PALETTE=JSFPlanta1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFPlanta3 FILE=TEXTURES\SFPlant3.PCX GROUP=Skins PALETTE=JSFPlanta1 // 2 - Default

    #exec MESHMAP NEW   MESHMAP=SFPlantA MESH=SFPlantA
    #exec MESHMAP SCALE MESHMAP=SFPlantA X=0.1 Y=0.1 Z=0.2

    #exec MESHMAP SETTEXTURE MESHMAP=SFPlantA NUM=1 TEXTURE=JSFPlanta1
    #exec MESHMAP SETTEXTURE MESHMAP=SFPlantA NUM=2 TEXTURE=JSFPlanta2

    /*
    simulated function skinnedFrag(class<fragment> FragType, texture FragSkin, vector Momentum, float DSize, int NumFrags)
    {
    	local int i;
    	local actor A, Toucher;
    	local Fragment s;

    	if ( bOnlyTriggerable )
    		return;
    	if (Event!='')
    		foreach AllActors( class 'Actor', A, Event )
    			A.Trigger( Toucher, pawn(Toucher) );
    	if ( Region.Zone.bDestructive )
    	{
    		Destroy();
    		return;
    	}
    	for (i=0 ; i<NumFrags ; i++)
    	{
    		s = Spawn( FragType, Owner);
    		s.Style = STY_Masked;
    		s.CalcVelocity(Momentum/100,0);
    		s.Skin = FragSkin;
    		s.DrawScale = DSize*0.5+0.7*DSize*FRand();
    	}

    	Destroy();
    }
    */

    event TakeDamage( int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, name DamageType)
    {
    	local Actor DestroyEffect;
    	local Actor DamageEffect;
    	local float tempX;

    	if(bDestroyable)
    	{
    		ModifyDamage(Damage, EventInstigator, HitLocation, Momentum, DamageType);	// modify damage if necessary
    		Health -= Damage;
    		if(Health <= 0)	// destroy object
    		{
    			DestroyEffect = spawn(EffectWhenDestroyed, Self,, Location);

    			if(bCustomChunkSkin)
    				skinnedFrag(ChunkType, ChunkSkin, Momentum, ChunkScale, ChunksNumber);
    			else
    				Frag(ChunkType, Momentum, ChunkScale, ChunksNumber);

    			Destroy();
    		}
    	}

    	if(Health > 0)
    	{
    		DamageEffect = spawn(EffectWhenDamaged, Self, , HitLocation, rotator(Momentum));
    	}
    }

    defaultproperties
    {
         bDestroyable=True
         Health=50
         EffectWhenDestroyed=Class'SFDecos.SFLeavesEffect'
         ChunkType=Class'UnrealShare.WoodFragments'
         ChunksNumber=8
         ChunkScale=1.200000
         bCustomChunkSkin=True
         ChunkSkin=Texture'SFDecos.Skins.JSFPlanta3'
         bPushable=True
         bStatic=False
         Physics=PHYS_Falling
         DrawType=DT_Mesh
         Mesh=LodMesh'SFDecos.SFPlantA'
         DrawScale=4.000000
         CollisionRadius=16.000000
         CollisionHeight=36.000000
    }

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