Compare commits

..

No commits in common. '9c6cccfcd9fc49eaf4887d1b6cf295b66afc9160' and '65b399b8690925c9e5919b1385d70ad7cb77cc2e' have entirely different histories.

Binary file not shown.

@ -1268,12 +1268,12 @@ typedef struct
Room *room_list;
} ThreeDeeLevel;
Room *get_cur_room(GameState *gs, ThreeDeeLevel *level)
Room *get_cur_room(ThreeDeeLevel *level)
{
Room *in_room = 0;
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;
break;
@ -2143,21 +2143,8 @@ void initialize_gamestate_from_threedee_level(GameState *gs, ThreeDeeLevel *leve
memset(gs, 0, sizeof(GameState));
rnd_gamerand_seed(&gs->random, RANDOM_SEED);
// the target room will be whichever room has the player
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(level);
Room *in_room = get_cur_room(gs, level);
bool found_player = false;
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 };
// 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}));
}
@ -5717,7 +5704,7 @@ void frame(void)
// @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);
@ -5772,18 +5759,11 @@ void frame(void)
assert(false);
if (it->killed)
{
to_use->go_to_animation = MD_S8Lit("Die Backwards");
to_use->next_animation_isnt_looping = true;
}
else if (LenV2(it->vel) > 0.5f)
{
to_use->go_to_animation = MD_S8Lit("Running");
}
else
{
to_use->go_to_animation = MD_S8Lit("Idle");
}
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)
{
const char *action = 0;
const char *action_argument = "Raphael";
if(gete(it->aiming_shotgun_at))
{
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 *target = characters[it->memories_last->context.author_npc_kind].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;
}
else
@ -7012,12 +6991,7 @@ ISANERROR("Don't know how to do this stuff on this platform.")
{
static float visible = 0.0f;
float target = 0.0f;
bool anybody_unread = false;
ENTITIES_ITER(gs.entities)
{
if(it->undismissed_action) anybody_unread = true;
}
if(gs.player->killed && (!anybody_unread || gs.finished_reading_dying_dialog))
if(gs.player->killed && (!cur_unread_entity || gs.finished_reading_dying_dialog))
{
gs.finished_reading_dying_dialog = true;
target = 1.0f;
@ -7405,7 +7379,7 @@ void event(const sapp_event *e)
if(flycam)
{
if (e->type == SAPP_EVENTTYPE_MOUSE_MOVE && !mouse_frozen)
if (e->type == SAPP_EVENTTYPE_MOUSE_MOVE)
{
const float rotation_speed = 0.001f;
flycam_horizontal_rotation -= e->mouse_dx * rotation_speed;

@ -274,7 +274,6 @@ typedef struct GameState {
uint64_t tick;
bool won;
MD_String8 current_room_name; // the string is allocated on the level that is currently loaded
bool finished_reading_dying_dialog;
bool no_angel_screen;

@ -32,7 +32,7 @@
#ifdef DEVTOOLS
#define PROFILING_SAVE_FILENAME "rpgpt.spall"
// server url cannot have trailing slash
#define MOCK_AI_RESPONSE
//#define MOCK_AI_RESPONSE
#define SERVER_DOMAIN "localhost"
#define SERVER_PORT 8090
#define IS_SERVER_SECURE 0

Loading…
Cancel
Save