npc and bandit dressup, bits of UI added, WIP NPC interaction

This commit is contained in:
2025-10-06 23:08:15 +01:00
parent f18d9d2b0e
commit 7f77d7ad52
13 changed files with 166 additions and 58 deletions

31
code/game/impl/outfit.c Normal file
View File

@@ -0,0 +1,31 @@
U32* GenOutfit(G_Outfit *o, World *world, G_State *game)
{
U32 *outfitChoices = M_ArenaPush(world->arena, U32, .count = 8);
G_Outfit *outfit = o;
D_AnimationInit(&outfit->state, 0, 1, 4, 1.0f / 6.0f);
M_TempScope(0, 0)
{
for (U32 it = 0; it < G_OUTFIT_COMPONENT_COUNT; ++it)
{
U32 idx = Random_Next(&world->random) % __outfit_counts[it];
// We just allow face, hair and hat to default to 0 meaning the player doesn't have one
if (idx != 0 || it < 2 || it > 4)
{
outfit->front.e[it] = OUTFIT_IMG(front, idx);
outfit->side.e[it] = OUTFIT_IMG(side, idx);
if ((idx + 1) <= __outfit_counts[it])
{
outfit->back.e[it] = OUTFIT_IMG(back, idx);
}
}
outfitChoices[it] = idx;
}
}
return outfitChoices;
}