Skip to content

Instantly share code, notes, and snippets.

@mikeminutillo
Created December 17, 2010 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeminutillo/744510 to your computer and use it in GitHub Desktop.
Save mikeminutillo/744510 to your computer and use it in GitHub Desktop.
Simple Gr1d.org warrior to enter the Arena. The actual actions and strategies are secret sauce :p
public void Tick(IAgentUpdateInfo agentUpdate)
{
if (agentUpdate.Node.OpposingAgents.Any()) FightOrFlight(agentUpdate);
else SeekEnemiesAndBuffUp(agentUpdate);
}
private void FightOrFlight(IAgentInfo agentInfo)
{
if (IsOutnumbered(agentInfo) || IsOutgunned(agentInfo)) Move(agentInfo, FleeStrategy);
else Fight(agentInfo);
}
private void SeekEnemiesAndBuffUp(IAgentInfo agentInfo)
{
if (IsPinned(agentInfo) || !IsBuffed(agentInfo)) Buff();
else Move(agentInfo, HuntStrategy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment