diff --git a/db/names.tsv b/db/names.tsv index e814a4b..06e1553 100644 --- a/db/names.tsv +++ b/db/names.tsv @@ -1154,7 +1154,7 @@ 009446e0 Camera::update_follow Camera::DoUpdate non-override branch: computes target, ring_buffer_push ('Cannot erase from empty buffer'), Camera::ClampedToRoom 00732fa0 ItemPool::pick_weighted_item ? (pool, rng float) weighted pick with repicks, Item::IsAvailable, RemoveCollectible; '[warn] item pool ran out of repicks'; GetCollectible calls it 00581430 NpcAI::rotgut_fire_projectiles ENTITY_ROTGUT calls on Shoot event; ProjectileParams + Entity_NPC::FireBossProjectiles toward GetPlayerTarget -0074d4a0 Level::prepare_blue_room ? StartRoomTransition: when target room flag 0x40000, builds RoomDescriptor DAT_00c81090 via RoomConfig::GetRandomRoom type 0x1c (ROOM_BLUE), caller sets room idx -0x10 +0074d4a0 Level::prepare_blue_room StartRoomTransition 006fdb78 pushes (currentRoomIdx, roomIndex, direction): when the target room has flag 0x40000 (Blue Key, set by GridEntity_Door::TryUnlock), builds the blue room descriptor (Level +0x17744, dummy past dimension 2) seeded from the target's DecorationSeed (shifts 5,27,28; Seeds::Init3 draws 3), shape 6/7 across (1/4 long closet) or 4/5 up-down (RandomInt(4)==0: IIV), GetRandomRoom type 0x1c no weight reduction diff 1-10 doors 5/10, else shape 13 (any); doors[direction]=target, doors[opposite]=source; caller sets room idx -0x10 (notes/items/parity_blue_rooms.md) 005911b0 NpcAI::siren_release_stolen_items ENTITY_SIREN_main state 0x12: 'Death', AnimateCollectible 'Pickup'/'PlayerPickupSparkle' on owner +0xf40, RemoveCollectible 0x51/0xb, Spawn 0x388 00a13750 kage_graphics_flush ? compares global render state DAT_00c79900.., 00a670c0/00a66e30 submit; called from Entity::PostRender after shader set and 00a11080 00824800 Room::update_ambient_spawns ? Room::Update tail: Room::GetTimeScale, random SpawnEx(1000,0x87) at clamped positions @@ -3490,3 +3490,4 @@ 006073f0 Entity_Effect::moonlight_timer_callback Luna moonlight 1000.39.1 touch: 30-tick CreateTimer callback (case 39 @0x5f2433): sound 0x84, colour flash, null item 74 (luna secondary), AnimateCollectible(0x24d), AddSoulHearts(1) 007cbcb0 Entity_Player::resolve_tainted_soul returns +0x1e68 (the Forgotten body) when the player type is 0x28 (Tainted Soul) and it is set, else the player itself 007d4340 Entity_Player::get_salvation_scale clamp(GetCollectibleEffect(0x2b8).count * 0.1 + 1, 1, 2) (asm; returns in XMM0); x1.2 is the halo's _scale (Entity_Player::Update, update_effects 0x799548) +0073d9b0 Level::get_door_slot GetTargetSlot 0073da40's helper: the door slot on a side of roomIdx for the cell roomIdx names (slot +4 for a second row/column), -1 when the room data lacks it (parity_blue_rooms) diff --git a/notes/items/parity_blue_rooms.md b/notes/items/parity_blue_rooms.md new file mode 100644 index 0000000..87fc759 --- /dev/null +++ b/notes/items/parity_blue_rooms.md @@ -0,0 +1,77 @@ +# Blue rooms (GridRooms -16, room type 28) and Blue Key (trinket 150 / 0x96) + +Ported to isaac-classic (branch of the items parity sweep): room index BLUE_ROOM_INDEX 167, the blue_rooms trait. + +## Opening a door: GridEntity_Door::TryUnlock 0x710480 + +- Room::update_door_transitions 0x7f01c0 calls TryUnlock(door, player, 0) for a locked door (variant 1-5) of a cleared + room when the player is under 60 units from it and moving its way; keys are not needed to get there. +- Variant 1 into type 0x1b with get_secret_exit_kind 3 (the Mausoleum's flesh door) returns before Blue Key. +- Variant 1 (DOOR_LOCKED: key doors, coin doors with _doorFlags & 1 = arcades) or 2 (DOOR_LOCKED_DOUBLE, chest and + dice rooms) and HasTrinket(0x96): isForce = 1 and the blue mark. Forced: no key used (TryUseKey skipped, golden key + irrelevant), no coin (AddCoins(-1) skipped), _isUnlockedByPlayer = 1, a double lock opens at once (the state-3 first + key step needs isForce == 0). Sound as unforced: 0x9c for a key door, 0x2d for a coin door. +- Look: when UpdateAnimation chose "GoldenKeyOpen" it plays "KeyOpen" instead; while "KeyOpen" plays its layer "Key" + (string at 0xb1ce2c) is colorized (0.4, 0.6, 1.0, 1.0). +- Then GetRoomByIdx(_targetRoomIdx)->Flags |= 0x40000 (the blue room mark), if the room has data. + +## The mark (RoomDescriptor Flags 0x40000) + +- GridEntity_Door::Update 0x70c5c0: a door whose target room is marked colorizes its "Background" layer + (0.8, 1.1, 1.8, 0.8). +- Room::render_grid_entity_light 0x80c810 (door case, not a secret exit door, not in a stage-35 Home room): a marked + target's door gets the light sprite coloured (0.3, 0.6, 1.0, 1.0) at 0.7 scale instead of its plain light. +- Level::ChangeRoom 0x73fc80: after a room is entered, for each of its 8 door entities (Room +0x724..0x744) the room + the door leads into (door +0x394) loses the mark. So the mark lasts only while Isaac stays in the room he opened the + door from: the blue room (whose doors lead to both rooms) clears it, and so does any room beside the target. + +## Entering: Game::StartRoomTransition 0x6fd7c0 + +At 0x6fdb57: animation 0 (a door walk), target dimension < 0 or the current one, then +`prepare_blue_room(currentRoomIdx, roomIndex, direction)` (pushes at 0x6fdb6c); true replaces roomIndex with -16. + +## Level::prepare_blue_room 0x74d4a0 + +- Fails (plain transition) for direction -1, a source room index < 0 (a room off the map), or an unmarked target. +- The descriptor (Level +0x17744; a static dummy when _currentDimensionIdx >= 3) is reset to a fresh one, its + ListIndex kept, GridIndex -16. +- RNG: seed = the target's DecorationSeed, shifts 5, 27, 28 (0x1b, 0x1c). Seeds::Init3 0x428940 draws three times + (the blue room's own seeds). +- Direction 0 or 2 (left, right): one Next; (seed & 3) != 0 -> shape 6 (2x1), else 7 (IIH long closet). AllowedDoors 5 + (LEFT0 | RIGHT0). +- Direction 1 or 3: RandomInt(4) != 0 -> shape 4 (1x2), else 5 (IIV). AllowedDoors 10 (UP0 | DOWN0). +- RoomConfig::GetRandomRoom(Next(), reduceWeight 0, stage 0 (special rooms), type 0x1c, shape, variants all, + difficulty 1..10, &AllowedDoors, subtype -1, mode -1); none -> again with Next() and shape 0xd (CollectRooms 0x82ce40: + 13 matches any shape); none -> fail. +- doors[direction] = target, doors[opposite] = source (case 0: [0] target, [2] source, ...). +- 00.special rooms.stb has 25 type-28 rooms, all difficulty 1: variants 0-9 shape 4 (UP0/DOWN0), 10-11 shape 5, 12-22 + shape 6 (LEFT0/RIGHT0), 23-24 shape 7; weights 1 (0.5 for 8, 10, 11, 18, 23, 24). + +## In the blue room + +- Level::load_room 0x73e0a0: a descriptor door to a negative index (or a cell off the room map) gets no target, so a + blue room before a room off the map (the Downpour/Dross secret exit, -10) is a dead end. +- GridEntity_Door::SetRoomTypes 0x710fa0: in room -16 every door is variant 8 (never locked, never hidden). +- Room::LoadBackdropGraphics 0x7f1380: room -16 always backdrop 13 (Blue Womb: rocks_bluewomb, grid_pit_bluewomb, + door_01_bluewombdoor); -8 backdrop 27 (Blue Secret). +- Room::PlayMusic 0x7eb1b0: type 28 has no case of its own: the stage's music. +- Leaving: ChangeRoom's previous index is -16 (< 0), so the entered room's door is GetTargetSlot 0x73da40 / + Level::get_door_slot 0x73d9b0 on the side across from the exit, for the cell the blue room's door named. +- The descriptor is rebuilt on every prepare, so a blue room is never revisited (and the mark is gone once inside). + +## Clear award: Room::SpawnClearAward 0x7fb250 + +In the normal-room branch, after Contract from Below's count and Glyph of Balance, when the room descriptor's +GridIndex is -16 and FirstTrinketOwner(0x96) exists, the award count is multiplied by GetTrinketMultiplier(0x96) +(before Deep Pockets adds RandomInt(3)). + +## Other Blue Key reads + +- Entity_Player::GetTearHitParams 0x7bf6c0 tests collectible 0x96 (Blue Key's id is also COLLECTIBLE 150 = Tough Love + in that enum): not the trinket. + +## Not ported (look only) + +- The Rebirth renderer has no colorize (coloroffset.fs: mix(rgb, dot(rgb, lum) * Colorize.rgb, Colorize.a)), so the + door "Background" tint and the blue "Key" layer of KeyOpen are not drawn (the blue door light is); and the port has + no Blue Womb door (door_01_bluewombdoor) for backdrop 13 yet (the Blue Womb floor lacks it too).