1
0
forked from 0ad/0ad

Entities default to run speed = 0

Notification event

This was SVN commit r3340.
This commit is contained in:
pyrolink 2006-01-08 08:23:59 +00:00
parent ee0227092a
commit 8f7202f00b
2 changed files with 18 additions and 1 deletions

View File

@ -19,5 +19,6 @@
<Script File="entities/template_entity_script.js" />
<Event On="Generic" Function="entityEventGeneric" />
<Event On="TargetChanged" Function="entityEventTargetChanged" />
<Event On="Notification" Function="entityEventNotification" />
</Entity>

View File

@ -512,7 +512,23 @@ function entityEventGeneric( evt )
console.write( "Unknown generic action: " + evt.action );
}
}
function entityEventNotification( evt )
{
switch( evt.type )
{
case NOTIFY_GOTO:
this.Order( ORDER_GENERIC, evt.location.x, evt.location.y );
case NOTIFY_ATTACK:
case NOTIFY_DAMAGE:
this.Order( ORDER_GENERIC, evt.target, ACTION_ATTACK);
this.Order( ORDER_GENERIC, evt.target, ACTION_ATTACK);
case NOTIFY_HEAL:
this.Order( ORDER_GENERIC, evt.target, ACTION_HEAL);
case NOTIFY_GATHER:
this.Order( ORDER_GENERIC, evt.target, ACTION_GATHER);
}
}
// ====================================================================
function entityEventTargetChanged( evt )