|
|
@ -1268,12 +1268,12 @@ typedef struct
|
|
|
|
Room *room_list;
|
|
|
|
Room *room_list;
|
|
|
|
} ThreeDeeLevel;
|
|
|
|
} ThreeDeeLevel;
|
|
|
|
|
|
|
|
|
|
|
|
Room *get_cur_room(GameState *gs, ThreeDeeLevel *level)
|
|
|
|
Room *get_cur_room(ThreeDeeLevel *level)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Room *in_room = 0;
|
|
|
|
Room *in_room = 0;
|
|
|
|
for(Room *cur = level->room_list; cur; cur = cur->next)
|
|
|
|
for(Room *cur = level->room_list; cur; cur = cur->next)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(MD_S8Match(cur->name, gs->current_room_name, 0))
|
|
|
|
if(MD_S8Match(cur->name, MD_S8Lit("Forest"), 0))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
in_room = cur;
|
|
|
|
in_room = cur;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2143,21 +2143,8 @@ void initialize_gamestate_from_threedee_level(GameState *gs, ThreeDeeLevel *leve
|
|
|
|
memset(gs, 0, sizeof(GameState));
|
|
|
|
memset(gs, 0, sizeof(GameState));
|
|
|
|
rnd_gamerand_seed(&gs->random, RANDOM_SEED);
|
|
|
|
rnd_gamerand_seed(&gs->random, RANDOM_SEED);
|
|
|
|
|
|
|
|
|
|
|
|
// the target room will be whichever room has the player
|
|
|
|
Room *in_room = get_cur_room(level);
|
|
|
|
for(Room *cur_room = level->room_list; cur_room; cur_room = cur_room->next)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for(PlacedEntity *cur = cur_room->placed_entity_list; cur; cur = cur->next)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(cur->npc_kind == NPC_Player)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
gs->current_room_name = cur_room->name;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(gs->current_room_name.size > 0) break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Room *in_room = get_cur_room(gs, level);
|
|
|
|
|
|
|
|
bool found_player = false;
|
|
|
|
bool found_player = false;
|
|
|
|
for(PlacedEntity *cur = in_room->placed_entity_list; cur; cur = cur->next)
|
|
|
|
for(PlacedEntity *cur = in_room->placed_entity_list; cur; cur = cur->next)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -4602,7 +4589,7 @@ Vec2 move_and_slide(MoveSlideParams p)
|
|
|
|
BUFF(CollisionObj, 256) to_check = { 0 };
|
|
|
|
BUFF(CollisionObj, 256) to_check = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
// add world boxes
|
|
|
|
// add world boxes
|
|
|
|
for(CollisionCylinder *cur = get_cur_room(&gs, &level_threedee)->collision_list; cur; cur = cur->next)
|
|
|
|
for(CollisionCylinder *cur = get_cur_room(&level_threedee)->collision_list; cur; cur = cur->next)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BUFF_APPEND(&to_check, ((CollisionObj){cur->bounds, gs.world_entity}));
|
|
|
|
BUFF_APPEND(&to_check, ((CollisionObj){cur->bounds, gs.world_entity}));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -5717,7 +5704,7 @@ void frame(void)
|
|
|
|
|
|
|
|
|
|
|
|
// @Place(draw 3d things)
|
|
|
|
// @Place(draw 3d things)
|
|
|
|
|
|
|
|
|
|
|
|
for(PlacedMesh *cur = get_cur_room(&gs, &level_threedee)->placed_mesh_list; cur; cur = cur->next)
|
|
|
|
for(PlacedMesh *cur = get_cur_room(&level_threedee)->placed_mesh_list; cur; cur = cur->next)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
float seed = (float)((int64_t)cur % 1024);
|
|
|
|
float seed = (float)((int64_t)cur % 1024);
|
|
|
|
|
|
|
|
|
|
|
@ -5772,18 +5759,11 @@ void frame(void)
|
|
|
|
assert(false);
|
|
|
|
assert(false);
|
|
|
|
|
|
|
|
|
|
|
|
if (it->killed)
|
|
|
|
if (it->killed)
|
|
|
|
{
|
|
|
|
|
|
|
|
to_use->go_to_animation = MD_S8Lit("Die Backwards");
|
|
|
|
to_use->go_to_animation = MD_S8Lit("Die Backwards");
|
|
|
|
to_use->next_animation_isnt_looping = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (LenV2(it->vel) > 0.5f)
|
|
|
|
else if (LenV2(it->vel) > 0.5f)
|
|
|
|
{
|
|
|
|
|
|
|
|
to_use->go_to_animation = MD_S8Lit("Running");
|
|
|
|
to_use->go_to_animation = MD_S8Lit("Running");
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
|
|
|
to_use->go_to_animation = MD_S8Lit("Idle");
|
|
|
|
to_use->go_to_animation = MD_S8Lit("Idle");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_thing((DrawnThing){.armature = to_use, .t = draw_with, .outline = gete(gs.player->interacting_with) == it});
|
|
|
|
draw_thing((DrawnThing){.armature = to_use, .t = draw_with, .outline = gete(gs.player->interacting_with) == it});
|
|
|
|
|
|
|
|
|
|
|
@ -6659,7 +6639,6 @@ ISANERROR("Don't know how to do this stuff on this platform.")
|
|
|
|
//if (it->memories_last->context.author_npc_kind != it->npc_kind)
|
|
|
|
//if (it->memories_last->context.author_npc_kind != it->npc_kind)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const char *action = 0;
|
|
|
|
const char *action = 0;
|
|
|
|
const char *action_argument = "Raphael";
|
|
|
|
|
|
|
|
if(gete(it->aiming_shotgun_at))
|
|
|
|
if(gete(it->aiming_shotgun_at))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
action = "fire_shotgun";
|
|
|
|
action = "fire_shotgun";
|
|
|
@ -6672,7 +6651,7 @@ ISANERROR("Don't know how to do this stuff on this platform.")
|
|
|
|
char *next_dialog = rigged_dialog[it->times_talked_to % ARRLEN(rigged_dialog)];
|
|
|
|
char *next_dialog = rigged_dialog[it->times_talked_to % ARRLEN(rigged_dialog)];
|
|
|
|
char *target = characters[it->memories_last->context.author_npc_kind].name;
|
|
|
|
char *target = characters[it->memories_last->context.author_npc_kind].name;
|
|
|
|
target = characters[NPC_Player].name;
|
|
|
|
target = characters[NPC_Player].name;
|
|
|
|
ai_response = FmtWithLint(frame_arena, "{\"target\": \"%s\", \"action\": \"%s\", \"action_argument\": \"%s\", \"speech\": \"%s\"}", target, action, action_argument, next_dialog);
|
|
|
|
ai_response = FmtWithLint(frame_arena, "{\"target\": \"%s\", \"action\": \"%s\", \"action_argument\": \"The Player\", \"speech\": \"%s\"}", target, action, next_dialog);
|
|
|
|
it->times_talked_to += 1;
|
|
|
|
it->times_talked_to += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -7012,12 +6991,7 @@ ISANERROR("Don't know how to do this stuff on this platform.")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static float visible = 0.0f;
|
|
|
|
static float visible = 0.0f;
|
|
|
|
float target = 0.0f;
|
|
|
|
float target = 0.0f;
|
|
|
|
bool anybody_unread = false;
|
|
|
|
if(gs.player->killed && (!cur_unread_entity || gs.finished_reading_dying_dialog))
|
|
|
|
ENTITIES_ITER(gs.entities)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(it->undismissed_action) anybody_unread = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(gs.player->killed && (!anybody_unread || gs.finished_reading_dying_dialog))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
gs.finished_reading_dying_dialog = true;
|
|
|
|
gs.finished_reading_dying_dialog = true;
|
|
|
|
target = 1.0f;
|
|
|
|
target = 1.0f;
|
|
|
@ -7405,7 +7379,7 @@ void event(const sapp_event *e)
|
|
|
|
|
|
|
|
|
|
|
|
if(flycam)
|
|
|
|
if(flycam)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (e->type == SAPP_EVENTTYPE_MOUSE_MOVE && !mouse_frozen)
|
|
|
|
if (e->type == SAPP_EVENTTYPE_MOUSE_MOVE)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const float rotation_speed = 0.001f;
|
|
|
|
const float rotation_speed = 0.001f;
|
|
|
|
flycam_horizontal_rotation -= e->mouse_dx * rotation_speed;
|
|
|
|
flycam_horizontal_rotation -= e->mouse_dx * rotation_speed;
|
|
|
|