Added Christabel-specific functions.
This commit is contained in:
parent
7ebfa8020f
commit
62d35ae7e8
|
@ -634,6 +634,20 @@ static int drawComparator(const void *a, const void *b)
|
|||
return e2->type - e1->type;
|
||||
}
|
||||
|
||||
void killEntity(char *name)
|
||||
{
|
||||
Entity *e;
|
||||
|
||||
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
||||
{
|
||||
if (strcmp(e->name, name) == 0)
|
||||
{
|
||||
e->health = 0;
|
||||
e->deathType = DT_INSTANT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void destroyEntities(void)
|
||||
{
|
||||
Entity *e;
|
||||
|
|
|
@ -75,6 +75,37 @@ void activateLocations(char *locations)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Literally only used when Christabel's shuttle is disabled
|
||||
*/
|
||||
void createChristabelLocation(void)
|
||||
{
|
||||
Location *l;
|
||||
Entity *e;
|
||||
|
||||
for (e = battle.entityHead.next ; e != NULL ; e = e->next)
|
||||
{
|
||||
if (strcmp(e->name, "Christabel") == 0)
|
||||
{
|
||||
l = malloc(sizeof(Location));
|
||||
memset(l, 0, sizeof(Location));
|
||||
battle.locationTail->next = l;
|
||||
battle.locationTail = l;
|
||||
|
||||
STRNCPY(l->name, "CristabelLocation", MAX_NAME_LENGTH);
|
||||
l->x = e->x;
|
||||
l->y = e->y;
|
||||
l->size = 250;
|
||||
l->active = 0;
|
||||
|
||||
l->x -= l->size / 2;
|
||||
l->y -= l->size / 2;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loadLocations(cJSON *node)
|
||||
{
|
||||
int active;
|
||||
|
|
|
@ -183,7 +183,7 @@ void runScriptTimeFunctions(void)
|
|||
static void executeNextLine(ScriptRunner *runner)
|
||||
{
|
||||
char *line;
|
||||
char command[24];
|
||||
char command[32];
|
||||
char strParam[3][256];
|
||||
int intParam[2];
|
||||
|
||||
|
@ -269,6 +269,15 @@ static void executeNextLine(ScriptRunner *runner)
|
|||
battle.isEpic = 0;
|
||||
retreatEnemies();
|
||||
}
|
||||
else if (strcmp(command, "CREATE_CRISTABEL_LOCATION") == 0)
|
||||
{
|
||||
createChristabelLocation();
|
||||
}
|
||||
else if (strcmp(command, "KILL_ENTITY") == 0)
|
||||
{
|
||||
sscanf(line, "%*s %[^\n]", strParam[0]);
|
||||
killEntity(strParam[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("ERROR: Unrecognised script command '%s'\n", command);
|
||||
|
|
|
@ -38,6 +38,8 @@ extern void activateNextWaypoint(void);
|
|||
extern void activateJumpgate(int activate);
|
||||
extern void activateSpawner(char *name, int active);
|
||||
extern void completeAllObjectives(void);
|
||||
extern void createChristabelLocation(void);
|
||||
extern void killEntity(char *name);
|
||||
|
||||
extern Battle battle;
|
||||
extern Colors colors;
|
||||
|
|
Loading…
Reference in New Issue