RuneI
Class SpongeMushroom

source: c:\runehov\RuneI\Classes\SpongeMushroom.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Decoration
         |
         +--RuneI.DecorationRune
            |
            +--RuneI.Plants
               |
               +--RuneI.SpongeMushroom
Direct Known Subclasses:SpongeMushroom1, SpongeMushroom2, SpongeMushroom3, SpongeMushroom4, SpongeMushroom5

class SpongeMushroom
extends RuneI.Plants

//============================================================================= // SpongeMushroom. //=============================================================================
Variables
 float LastPuff
 bool bSpawnPuff


Function Summary
 bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
 
simulated
JointTouchedBy(Actor Other, int joint)
 void SpawnPuff(int joint)



Source Code


00001	//=============================================================================
00002	// SpongeMushroom.
00003	//=============================================================================
00004	class SpongeMushroom extends Plants;
00005	
00006	var float LastPuff;
00007	var() bool bSpawnPuff;
00008	
00009	
00010	function SpawnPuff(int joint)
00011	{
00012		local actor a;
00013	
00014		if(!bSpawnPuff)
00015			return;
00016	
00017		if (Level.TimeSeconds - LastPuff > 1.0)
00018		{
00019			LastPuff = Level.TimeSeconds;
00020			a = Spawn(class'MushroomPuff', self,, GetJointPos(joint));
00021			if (a!=None)
00022			{
00023				a.Velocity = vect(0,0,20);
00024				a.SetPhysics(PHYS_Projectile);
00025			}
00026		}
00027	
00028	}
00029	
00030	simulated function JointTouchedBy(actor Other, int joint)
00031	{
00032		Super.JointTouchedBy(Other, joint);
00033		SpawnPuff(joint);
00034	}
00035	
00036	function bool JointDamaged(int Damage, Pawn EventInstigator, vector HitLoc, vector Momentum, name DamageType, int joint)
00037	{
00038		if (joint != 0)
00039			SpawnPuff(joint);
00040	
00041		return Super.JointDamaged(Damage, EventInstigator, HitLoc, Momentum, DamageType, joint);
00042	}
00043	
00044	defaultproperties
00045	{
00046	     bSpawnPuff=True
00047	     TouchFactor=0.030000
00048	     CollisionRadius=12.000000
00049	     CollisionHeight=12.000000
00050	     Skeletal=SkelModel'plants.Sponge_Mushroom'
00051	}

End Source Code