#pragma once

#include "HandmadeMath.h"

// @TODO allow AI to prefix out of character statemetns with [ooc], this is a well khnown thing on role playing forums so gpt would pick up on it.
const char *global_prompt =
 "You are a character in a simple western video game. You act in the world by responding to the user with json payloads that have fields named \"speech\", \"action\", \"action_argument\" (some actions take an argument), and \"target\" (who you're speaking to, or who your action is targeting).\n"
 "You speak only when you have something to say, or are responding to somebody, and use short, concise, punchy language. If you're just overhearing what other people are saying, you only say something when absolutely compelled to do so"
;

const char *top_of_header = ""
"#pragma once\n"
"\n";

typedef struct 
{
	char *name; // the same as enum name
	char *description;
	char *argument_description;
	bool takes_argument;
} ActionInfo;
ActionInfo actions[] = {
	#define NO_ARGUMENT .argument_description = "Takes no argument", .takes_argument = false
	#define ARGUMENT(desc) .argument_description = desc, .takes_argument = true
	{
		.name = "none", 
		.description = "Do nothing",
		NO_ARGUMENT,
	},
	{
		.name = "join",
		.description = "Joins somebody else's party, so you follow them everywhere",
		ARGUMENT("Expects the argument to be who you're joining"),
	},
	{
		.name = "leave",
		.description = "Leave the party you're in right now",
		NO_ARGUMENT,
	},
	{
		.name = "aim_shotgun",
		.description = "Aims your shotgun at the specified target, preparing you to fire at them and threatening their life.",
		ARGUMENT("Expects the argument to be the name of the person you're aiming at, they must be nearby"),
	},
	{
		.name = "fire_shotgun",
		.description = "Fires your shotgun at the current target, killing the target.",
		NO_ARGUMENT,
	},
};

typedef enum
{
	MSG_SYSTEM,
	MSG_USER,
	MSG_ASSISTANT,
} MessageType;

typedef struct 
{
	char *name;
	char *enum_name;
	char *prompt;
} CharacterGen;
CharacterGen characters[] = {
	#define CHARACTER_PROMPT_PREFIX(name) "You, " name ", specifically are acting as a "
	{
		.name = "nobody",
		.enum_name = "nobody",
		.prompt = "There has been an internal error.",
	},
	{
		.name = "The Player",
		.enum_name = "Player",
		.prompt = "There has been an internal error.",
	},
	{
		.name = "Daniel",
		.enum_name = "Daniel",
		.prompt = CHARACTER_PROMPT_PREFIX("Daniel") "weathered farmer, who lives a tough, solitary life. You don't see much of a reason to keep living but soldier on anyways. You have a tragic backstory, and mostly just work on the farm.",
	},
	{
		.name = "Raphael",
		.enum_name = "Raphael",
		.prompt = CHARACTER_PROMPT_PREFIX("Raphael") "physicist from the 1980s who got their doctorate in subatomic particle physics. They don't know why they're in a western town, but they're terrified.",
	},
	{
		.name = "The Devil",
		.enum_name = "Devil",
		.prompt = CHARACTER_PROMPT_PREFIX("The Devil") "strange red beast, the devil himself, evil incarnate. You mercilessly mock everybody who talks to you, and are intending to instill absolute chaos.",
	},
	{
		.name = "Passerby",
		.enum_name = "Passerby",
		.prompt = CHARACTER_PROMPT_PREFIX("Random Passerby") "random person, just passing by",
	},
};
