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

OnslaughtSpecialsLiteV2.ACTION_HealPowerNode


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
/******************************************************************************
ACTION_HealNode

Creation date: 2010-08-26 17:38
Last change: $Id$
Copyright (c) 2010, Wormbo
******************************************************************************/

class ACTION_HealPowerNode extends ScriptedAction;


var() name NodeTag;
var() int HealAmount;
var() bool bWithEffect;

var ONSPowerCore Node;


function bool InitActionFor(ScriptedController C)
{
	if (Node == None && NodeTag != '') {
		foreach C.AllActors(class'ONSPowerCore', Node, NodeTag) {
			break;
		}
		if (Node == None) {
			log(C.SequenceScript@C.ActionNum@Name@"- No power node/core for tag '"$NodeTag$"'");
			NodeTag = '';
		}
	}

	if (Node == None || Node.Health == 0 || Node.Health == Node.DamageCapacity || HealAmount <= 0 || Node.CoreStage != 0 && Node.CoreStage != 2)
		return false;

	if (bWithEffect && Node.IsA('ONSPowerNodeSpecial')) {
		Node.HealDamage(HealAmount, None, None);
	}
	else {
		Node.Health = Min(Node.Health + HealAmount, Node.DamageCapacity);
		Node.NetUpdateTime = C.Level.TimeSeconds - 1;
	}

	if (Node.Health == Node.DamageCapacity && C.Level.TimeSeconds - Node.HealingTime < 0.5)
		Node.PlaySound(Node.HealedSound, SLOT_Misc, 5.0);
	return false;
}


//=============================================================================
// Default values
//=============================================================================

defaultproperties
{
	HealAmount = 10
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mo 23.9.2013 22:34:18.000 - Creation time: Do 14.8.2014 09:58:33.532 - Created with UnCodeX