Added health regen/decay with time delay, corrected continual run bug (once running, disregards reorders to walk until destination reached).
This was SVN commit r3377.
This commit is contained in:
parent
c2c5e87c61
commit
5383104a4f
@ -26,6 +26,9 @@
|
||||
<Health>
|
||||
<Bar_Height>-1.0</Bar_Height>
|
||||
<Bar_Size>20</Bar_Size>
|
||||
<Regen_Rate>30.0</Regen_Rate>
|
||||
<Regen_Start>15.0</Regen_Start>
|
||||
<Decay_Rate>30.0</Decay_Rate>
|
||||
</Health>
|
||||
<Stamina>
|
||||
<Bar_Height>-1.0</Bar_Height>
|
||||
|
@ -557,14 +557,19 @@ function entityEventNotification( evt )
|
||||
{
|
||||
case NOTIFY_GOTO:
|
||||
this.Order( ORDER_GENERIC, evt.location.x, evt.location.y );
|
||||
break;
|
||||
case NOTIFY_ATTACK:
|
||||
case NOTIFY_DAMAGE:
|
||||
this.Order( ORDER_GENERIC, evt.target, ACTION_ATTACK);
|
||||
break;
|
||||
case NOTIFY_HEAL:
|
||||
this.Order( ORDER_GENERIC, evt.target, ACTION_HEAL );
|
||||
break;
|
||||
case NOTIFY_GATHER:
|
||||
this.Order( ORDER_GENERIC, evt.target, ACTION_GATHER );
|
||||
|
||||
break;
|
||||
default:
|
||||
console.wrote( "Unknown notification request" + evt.type );
|
||||
}
|
||||
}
|
||||
// ====================================================================
|
||||
@ -580,9 +585,12 @@ function entityEventTargetChanged( evt )
|
||||
|
||||
evt.defaultOrder = NMT_Goto;
|
||||
evt.defaultCursor = "arrow-default";
|
||||
evt.secondaryOrder = NMT_Run;
|
||||
|
||||
evt.secondaryCursor = "arrow-default";
|
||||
|
||||
if ( this.actions.run && this.actions.run.speed > 0 )
|
||||
{
|
||||
evt.secondaryOrder = NMT_Run;
|
||||
}
|
||||
if( evt.target && this.actions )
|
||||
{
|
||||
if( this.actions.attack &&
|
||||
|
@ -31,11 +31,12 @@
|
||||
<Max>100</Max>
|
||||
<Bar_Height>5.0</Bar_Height>
|
||||
<Bar_Size>20</Bar_Size>
|
||||
|
||||
</Health>
|
||||
|
||||
<Stamina>
|
||||
<Max>5.0</Max>
|
||||
<Bar_Height>5.2</Bar_Height>
|
||||
<Bar_Height>5.3</Bar_Height>
|
||||
<Bar_Size>20</Bar_Size>
|
||||
</Stamina>
|
||||
|
||||
|
@ -78,6 +78,8 @@ function worldClickHandler(event)
|
||||
|
||||
if (event.clicks == 2)
|
||||
triggerSelectionRun();
|
||||
else
|
||||
setSelectionRun();
|
||||
|
||||
issueCommand (selection, cmd, args[0], args[1]);
|
||||
}
|
||||
@ -174,6 +176,14 @@ function triggerSelectionRun()
|
||||
selection[i].triggerRun();
|
||||
}
|
||||
}
|
||||
function setSelectionRun()
|
||||
{
|
||||
for ( i=0; i< selection.length; i++ )
|
||||
{
|
||||
selection[i].setRun( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user