Skip to content

Commit

Permalink
RE CV: switch back to old item technique
Browse files Browse the repository at this point in the history
  • Loading branch information
IntelOrca committed Mar 19, 2024
1 parent cb2db38 commit 4a5ceb1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 0 additions & 2 deletions IntelOrca.Biohazard.BioRand/RECV/ReCvItemHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,8 @@ public ItemAttribute GetItemAttributes(byte item)
case ReCvItemIds.EnhancedHandgun:
return ItemAttribute.Ammo;
case ReCvItemIds.Memo:
return ItemAttribute.Document;
case ReCvItemIds.BoardClip:
case ReCvItemIds.Card:
return ItemAttribute.Key;
case ReCvItemIds.NewspaperClip:
return ItemAttribute.Document;
case ReCvItemIds.LugerReplica:
Expand Down
21 changes: 11 additions & 10 deletions IntelOrca.Biohazard.BioRand/RECV/ReCvRandomiser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public override void Generate(RandoConfig config, IRandoProgress progress, FileR
throw new BioRandUserException("RE3 installation must be enabled to randomize RE3.");
}

config.IncludeDocuments = false;
config.SwapCharacters = false;
config.RandomNPCs = false;
config.RandomEnemies = false;
Expand Down Expand Up @@ -376,16 +377,16 @@ private unsafe void TestEdits(GameData gameData)
#if DEBUG
// QuickDoor(RdtId.Parse("10B"), 0);

var rrdt = gameData.GetRdt(RdtId.Parse("1021"))!;
rrdt.PostModifications.Add(() =>
{
var rdtBuilder = ((RdtCv)rrdt.RdtFile).ToBuilder();
rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
rrdt.RdtFile = rdtBuilder.ToRdt();
});
// var rrdt = gameData.GetRdt(RdtId.Parse("1021"))!;
// rrdt.PostModifications.Add(() =>
// {
// var rdtBuilder = ((RdtCv)rrdt.RdtFile).ToBuilder();
// rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
// rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
// rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
// rdtBuilder.Enemies.RemoveAt(rdtBuilder.Enemies.Count - 1);
// rrdt.RdtFile = rdtBuilder.ToRdt();
// });
#endif
}

Expand Down
17 changes: 17 additions & 0 deletions IntelOrca.Biohazard.BioRand/Rdt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,22 @@ private void SetItem(byte id, byte? itemId, short? globalId, ushort type, ushort
if (Version == BioVersion.BiohazardCv)
{
var rdtBuilder = ((RdtCv)RdtFile).ToBuilder();

#if !OLD_ITEM_TECHNIQUE
itemId = itemId ?? id;
if (globalId != null)
{
var aot = rdtBuilder.Aots[id];
itemId = aot.Stage;
}
if (rdtBuilder.Items.Count > itemId)
{
var item = rdtBuilder.Items[itemId.Value];
item.Type = (item.Type & 0xFFFF) | (type << 16);
rdtBuilder.Items[itemId.Value] = item;
RdtFile = rdtBuilder.ToRdt();
}
#else
if (globalId == null)
{
itemId = itemId ?? id;
Expand All @@ -272,6 +288,7 @@ private void SetItem(byte id, byte? itemId, short? globalId, ushort type, ushort
// rdtBuilder.Aots[id] = aot;
CvAddItemPickupCodes(id, itemId.Value, (byte)type, globalId.Value);
}
#endif
}
else
{
Expand Down

0 comments on commit 4a5ceb1

Please sign in to comment.