unlock some furniture (not all items implemented yet)

special thanks to undownding for the logic
This commit is contained in:
Naruse
2026-05-12 16:03:38 +08:00
parent 233419eba3
commit 6740b8ecf7
11 changed files with 107 additions and 5 deletions

View File

@@ -288,9 +288,10 @@ public class PlayerInstance(PlayerGameData data)
return (gid << 16) | sid;
}
public void BuildPlayerAttr()
public void BuildPlayerAttr(bool additional = false)
{
var bootstrapAttrs = BuildLobbyBootstrapAttrs();
var bootstrapAttrs = BuildLobbyBootstrapAttrs().ToList();
if (additional) bootstrapAttrs.AddRange(BuildGirlFurnitureAttrs());
var existingAttrs = Data.Attrs
.ToDictionary(x => (x.Gid, x.Sid));
var seenAttrs = new HashSet<(uint Gid, uint Sid)>();
@@ -320,6 +321,24 @@ public class PlayerInstance(PlayerGameData data)
}
}
private static IEnumerable<(uint Gid, uint Sid, uint Value)> BuildGirlFurnitureAttrs()
{
// Unlock some furniture slots for every girl
// Each furniture attr int stores 10 slots using 3 bits per slot
// Value below means slot 0..9 = 1
const uint furnitureUnlockedValue = 153391689;
for (uint girlId = 0; girlId <= 50; girlId++)
{
// FurnitureStart..FurnitureEnd = 10..19
for (uint offset = 10; offset <= 19; offset++)
{
uint sid = (girlId * 50) + offset;
yield return (101, sid, furnitureUnlockedValue);
}
}
}
private static IEnumerable<(uint Gid, uint Sid, uint Value)> BuildLobbyBootstrapAttrs()
{
// GuideLogic uses group 4. Value 999 is safely above every configured step count,
@@ -375,7 +394,7 @@ public class PlayerInstance(PlayerGameData data)
yield return (4, guide.ID, 999);
}
for (uint favor = 1; favor <= 50; favor++)
for (uint favor = 0; favor <= 50; favor++)
yield return (101, favor * 50, 500);
// Main Scene 0 mean default scene