#define BOT_CMD_BARRIER 20
#define BOT_CMD_CONSOLE 21
#define BOT_CMD_SOUND 22
-#define BOT_CMD_WHILE 23 // TODO: Not implemented yet
-#define BOT_CMD_WEND 24 // TODO: Not implemented yet
-#define BOT_CMD_CHASE 25 // TODO: Not implemented yet
+#define BOT_CMD_DEBUG_ASSERT_CANFIRE 23
+#define BOT_CMD_WHILE 24 // TODO: Not implemented yet
+#define BOT_CMD_WEND 25 // TODO: Not implemented yet
+#define BOT_CMD_CHASE 26 // TODO: Not implemented yet
-#define BOT_CMD_COUNTER 23 // Update this value if you add/remove a command
+#define BOT_CMD_COUNTER 24 // Update this value if you add/remove a command
// NOTE: Following commands should be implemented on the bot ai
// If a new command should be handled by the target ai(s) please declare it here
bot_cmd_string[BOT_CMD_SOUND] = "sound";
bot_cmd_parm_type[BOT_CMD_SOUND] = BOT_CMD_PARAMETER_STRING;
+ bot_cmd_string[BOT_CMD_DEBUG_ASSERT_CANFIRE] = "debug_assert_canfire";
+ bot_cmd_parm_type[BOT_CMD_DEBUG_ASSERT_CANFIRE] = BOT_CMD_PARAMETER_FLOAT;
+
bot_cmds_initialized = TRUE;
}
case BOT_CMD_SOUND:
print("play sound file at bot location");
break;
+ case BOT_CMD_DEBUG_ASSERT_CANFIRE:
+ print("verify the state of the weapon entity");
+ break;
default:
print("This command has no description yet.");
break;
bot_commands_init();
print("List of all available commands:\n");
- print(" Command\t\t\t\tParameter Type\n");
+ print(" Command - Parameter Type\n");
for(i=1;i<BOT_CMD_COUNTER;++i)
{
ptype = "none";
break;
}
- print(strcat(" ",bot_cmd_string[i],"\t\t\t\t<",ptype,"> \n"));
+ print(strcat(" ",bot_cmd_string[i]," - <",ptype,"> \n"));
}
}
return CMD_STATUS_FINISHED;
}
+.entity tuba_note;
+float bot_cmd_debug_assert_canfire()
+{
+ float f;
+ f = bot_cmd.bot_cmd_parm_float;
+
+ if(self.weaponentity.state != WS_READY)
+ {
+ if(f)
+ {
+ self.colormod = '0 8 8';
+ print("Bot wants to fire, inhibited by weaponentity state\n");
+ }
+ }
+ else if(ATTACK_FINISHED(self) > time)
+ {
+ if(f)
+ {
+ self.colormod = '8 0 8';
+ print("Bot wants to fire, inhibited by ATTACK_FINISHED\n");
+ }
+ }
+ else if(self.tuba_note)
+ {
+ if(f)
+ {
+ self.colormod = '8 0 0';
+ print("Bot wants to fire, bot still has an active tuba note\n");
+ }
+ }
+ else
+ {
+ if(!f)
+ {
+ self.colormod = '8 8 0';
+ print("Bot thinks it has fired, but apparently did not\n");
+ }
+ }
+
+ return CMD_STATUS_FINISHED;
+}
+
//
void bot_command_executed(float rm)
case BOT_CMD_SOUND:
status = bot_cmd_sound();
break;
+ case BOT_CMD_DEBUG_ASSERT_CANFIRE:
+ status = bot_cmd_debug_assert_canfire();
+ break;
default:
print(strcat("ERROR: Invalid command on queue with id '",ftos(bot_cmd.bot_cmd_type),"'\n"));
return 0;