ai: put a message when an intruder is spotted

alut-include-path
Maikel de Vries 2017-01-29 21:29:21 +01:00
parent ac38e1d23a
commit 7b26e1fa13
4 changed files with 20 additions and 3 deletions

View File

@ -40,8 +40,15 @@ public func ExecuteAttackMessage(effect fx)
if (group_cnt >= RandomX(3, 6))
{
fx.Target->Sound("Clonk::Action::GroupAttack");
fx.Target->Message(Translate(Format("MsgAttack%d", Random(4))));
fx.Target->Message(Translate(Format("MsgAttack%d", Random(5))));
fx.last_message = FrameCounter();
}
return true;
}
// Shows a message when an intruder is spotted.
public func ExecuteIntruderMessage(effect fx)
{
fx.Target->Message(Translate(Format("MsgIntruder%d", Random(3))));
return true;
}

View File

@ -2,4 +2,8 @@ MsgAttack0=Angriff!
MsgAttack1=Zum Angriff!
MsgAttack2=Attacke!
MsgAttack3=Vorwärts!
MsgAttack4=Hau drauf!
MsgAttack4=Hau drauf!
MsgIntruder0=Ein Eindringer!
MsgIntruder1=Wer bist du?
MsgIntruder2=Verschwinde!

View File

@ -2,4 +2,8 @@ MsgAttack0=Attack!
MsgAttack1=Charge!
MsgAttack2=Get them!
MsgAttack3=For glory!
MsgAttack4=Beat 'em up!
MsgAttack4=Beat 'em up!
MsgIntruder0=An intruder!
MsgIntruder1=Who are you?
MsgIntruder2=Get out!

View File

@ -380,6 +380,8 @@ public func Execute(effect fx, int time)
if (GameCall(ally_fx.encounter_cb, ally, fx.target))
ally_fx.encounter_cb = nil;
}
// Do some messages.
this->ExecuteIntruderMessage(fx);
// Waking up works only once. after that, AI might have moved and wake up clonks it shouldn't.
fx.ally_alert_range = nil;
}