# SpatialFear.SFDamageMover

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 |
    //=============================================================================
    // Spatial Fear
    // Class: SFDamageMover
    // Descripton: Subclasses of Mover, remebers damage applied to it, in contrast
    //						to a normal Mover, that is triggered only when the
    //						applied damage if bigger than the configured DamageThreshold
    //
    // Author: Markus Nuebel
    //=============================================================================

    class SFDamageMover extends Mover;

    var float	m_fCurrentDamageThreshold;	// Private: Keeps track of current damage threshold

    // Just initializes the current threshold with the configured one.
    function resetThreshold()
    {
    	m_fCurrentDamageThreshold = DamageThreshold;
    }

    // Base class override, to keep track of taken damage
    // and fire event, when the taken damage exeeds a treshold after
    // multiple damage events
    function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation,
    						Vector momentum, name damageType)
    {
    	m_fCurrentDamageThreshold	-= Damage;
    	if ( bDamageTriggered && (0 >= m_fCurrentDamageThreshold) )
    	{
    		self.Trigger(self, instigatedBy);
    		resetThreshold();
    	}
    }

    defaultproperties
    {
    }

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