Skip to content

Commit

Permalink
v0.47.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Zamiell committed Dec 28, 2019
1 parent 5005544 commit cf80c13
Show file tree
Hide file tree
Showing 29 changed files with 281 additions and 53 deletions.
18 changes: 18 additions & 0 deletions HISTORY.md
@@ -1,5 +1,23 @@
# Racing+ Version History and News

### *v0.47.11* - December 28th, 2019

News:

* StoneAgeMarcus will be performing a R+7 Season 7 run live at Awesome Games Done Quick 2020 on Sunday, January 5th.

Mod changes:

* Isaac is now feeling festive. Happy New Years!
* The "controls" starting room graphic will no longer show in seeded or diversity races.
* Fixed the (vanilla) bug where the trapdoor/ beam of light was accessible in I AM ERROR rooms before the room was cleared.
* Fixed the bug where going to the next floor on Greed Mode would automatically start the next wave.
* Fixed the bug where the Butter Bean "surprise" mechanic was not working properly. (It is supposed to be a 10% chance per swap.) (Thanks Greg)
* Fixed the bug where Blank Card + ? Card would not work correctly if you had Cursed Eye. (Thanks Greg)
* Fixed the bug where the Glowing Hour Glass wuld not work correctly if you had Cursed Eye. (Thanks mgln)
* Fixed the bug where brown creep would not be cleared immediately when the room was cleared.
* Fixed the bug where pedestal items could go into an empty Schoolbag upon entering a room under certain conditions. (Thanks Gamonymous)

### *v0.47.10* - December 19th, 2019

* Isaac is now feeling festive. Merry Christmas!
Expand Down
1 change: 1 addition & 0 deletions mod/CHANGES.md
Expand Up @@ -160,6 +160,7 @@ While there are thousands of rooms in the game, many players have already seen t
* The babies on the Isaac fight can no longer spawn inside the hitbox of the player and will now randomly spawn throughout the room (as originally intended).
* The random beams of light from Isaac and Conquest are fixed such that they will now target the player.
* Multi-segment bosses will no longer drop more than one black heart when killed with Maw of the Void or Athame.
* The trapdoor / beam of light in I AM ERROR rooms will no longer be accessible if the room is not cleared.

### Graphics & Sound Fixes

Expand Down
7 changes: 6 additions & 1 deletion mod/content/entities2.xml
Expand Up @@ -3,6 +3,11 @@
<gibs amount="0" blood="0" bone="0" eye="0" gut="0" large="0" worm="0" />
</entity>

<!-- "12545" is the subtype arbitrarily chosen by StageAPI, so we will keep it for consistency -->
<entity id="1000" name="Floor Effect Creep" variant="46" subtype="12545" anm2path="none.anm2" collisionRadius="0" numGridCollisionPoints="0">
<gibs amount="0" blood="0" bone="0" eye="0" gut="0" large="0" />
</entity>

<!-- Custom effects take variants past 200 -->
<!-- All of these are used for fast-travel -->
<!-- (we want them as effects because we don't want the smoke to appear when they are spawned) -->
Expand Down Expand Up @@ -33,7 +38,7 @@
</entity>

<!-- This is for subverting the post-Lamb popup -->
<entity name="Room Clear Delay" id="1000" variant="207" baseHP="0" boss="0" champion="0" collisionDamage="0" collisionMass="0" collisionRadius="0" friction="0" numGridCollisionPoints="0" shadowSize="0" shutdoors="true" stageHP="0">
<entity name="Room Clear Delay" id="1000" variant="209" baseHP="0" boss="0" champion="0" collisionDamage="0" collisionMass="0" collisionRadius="0" friction="0" numGridCollisionPoints="0" shadowSize="0" shutdoors="true" stageHP="0">
<gibs amount="0" blood="0" bone="0" eye="0" gut="0" large="0" worm="0" />
</entity>

Expand Down
2 changes: 2 additions & 0 deletions mod/main.lua
Expand Up @@ -233,6 +233,8 @@ RacingPlus:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, Speedrun.PreventD6, -- 23
CollectibleType.COLLECTIBLE_D6) -- 105
RacingPlus:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, PreUseItem.Item124, -- 23
CollectibleType.COLLECTIBLE_DEAD_SEA_SCROLLS) -- 124
RacingPlus:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, PreUseItem.Item286, -- 23
CollectibleType.COLLECTIBLE_BLANK_CARD) -- 286
RacingPlus:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, PreUseItem.Item422, -- 23
CollectibleType.COLLECTIBLE_GLOWING_HOUR_GLASS) -- 422
RacingPlus:AddCallback(ModCallbacks.MC_PRE_USE_ITEM, PreUseItem.Item479, -- 23
Expand Down
31 changes: 27 additions & 4 deletions mod/racing_plus/ExecuteCmd.lua
Expand Up @@ -35,6 +35,17 @@ ExecuteCmd.functions["angel"] = function(params)
g.p:UseCard(Card.CARD_JOKER) -- 31
end

ExecuteCmd.functions["blackmarket"] = function(params)
ExecuteCmd:BlackMarket()
end

function ExecuteCmd:BlackMarket()
g.run.naturalTeleport = true -- Mark that this is not a Cursed Eye teleport
g.l.LeaveDoor = -1 -- You have to set this before every teleport or else it will send you to the wrong room
g.g:StartRoomTransition(GridRooms.ROOM_BLACK_MARKET_IDX, -- 6
Direction.NO_DIRECTION, g.RoomTransition.TRANSITION_TELEPORT) -- -1, 3
end

ExecuteCmd.functions["boss"] = function(params)
g.run.bossCommand = true
g.p:UseCard(Card.CARD_EMPEROR) -- 5
Expand All @@ -46,10 +57,7 @@ ExecuteCmd.functions["bossrush"] = function(params)
end

ExecuteCmd.functions["bm"] = function(params)
g.run.naturalTeleport = true -- Mark that this is not a Cursed Eye teleport
g.l.LeaveDoor = -1 -- You have to set this before every teleport or else it will send you to the wrong room
g.g:StartRoomTransition(GridRooms.ROOM_BLACK_MARKET_IDX, -- 6
Direction.NO_DIRECTION, g.RoomTransition.TRANSITION_TELEPORT) -- -1, 3
ExecuteCmd:BlackMarket()
end

ExecuteCmd.functions["cc"] = function(params)
Expand Down Expand Up @@ -126,6 +134,17 @@ ExecuteCmd.functions["devil"] = function(params)
g.p:UseCard(Card.CARD_JOKER) -- 31
end

ExecuteCmd.functions["error"] = function(params)
ExecuteCmd:IAMERROR()
end

function ExecuteCmd:IAMERROR()
g.run.naturalTeleport = true -- Mark that this is not a Cursed Eye teleport
g.l.LeaveDoor = -1 -- You have to set this before every teleport or else it will send you to the wrong room
g.g:StartRoomTransition(GridRooms.ROOM_ERROR_IDX, -- 2
Direction.NO_DIRECTION, g.RoomTransition.TRANSITION_TELEPORT) -- -1, 3
end

ExecuteCmd.functions["getframe"] = function(params)
-- Used for debugging
Isaac.ConsoleOutput("Isaac frame count is at: " .. tostring(Isaac.GetFrameCount()))
Expand All @@ -137,6 +156,10 @@ ExecuteCmd.functions["getroom"] = function(params)
Isaac.ConsoleOutput("Room index is: " .. g.l:GetCurrentRoomIndex())
end

ExecuteCmd.functions["iamerror"] = function(params)
ExecuteCmd:IAMERROR()
end

ExecuteCmd.functions["level"] = function(params)
-- Used to go to the proper floor and stage
-- (always assume a seeded race)
Expand Down
25 changes: 15 additions & 10 deletions mod/racing_plus/FastClear.lua
Expand Up @@ -408,6 +408,7 @@ function FastClear:ClearRoom()
-- Manually kill Death's Heads, Flesh Death's Heads, and any type of creep
-- (by default, they will only die after the death animations are completed)
-- Additionally, open any closed heaven doors
for _, entity in ipairs(Isaac.GetRoomEntities()) do
if entity.Type == EntityType.ENTITY_DEATHS_HEAD and entity.Variant == 0 then -- 212.0
-- Activate its death state
Expand All @@ -420,18 +421,22 @@ function FastClear:ClearRoom()
entity.Parent, entity.SubType, entity.InitSeed)
newHead:ToNPC().State = 18
elseif entity.Type == EntityType.ENTITY_EFFECT then -- 1000
if entity.Variant >= 22 and entity.Variant <= 26 then
-- EffectVariant.CREEP_RED (22)
-- EffectVariant.CREEP_GREEN (23)
-- EffectVariant.CREEP_YELLOW (24)
-- EffectVariant.CREEP_WHITE (25)
-- EffectVariant.CREEP_BLACK (26)
entity:Kill()
elseif entity.Type == EffectVariant.CREEP_BROWN or -- 56
entity.Type == EffectVariant.CREEP_SLIPPERY_BROWN then -- 94
if entity.Variant == EffectVariant.CREEP_RED or -- 22
entity.Variant == EffectVariant.CREEP_GREEN or -- 23
entity.Variant == EffectVariant.CREEP_YELLOW or -- 24
entity.Variant == EffectVariant.CREEP_WHITE or -- 25
entity.Variant == EffectVariant.CREEP_BLACK or -- 26
entity.Variant == EffectVariant.CREEP_BROWN or -- 56
entity.Variant == EffectVariant.CREEP_SLIPPERY_BROWN then -- 94
entity:Kill()
elseif entity.Variant == EffectVariant.HEAVEN_DOOR_FAST_TRAVEL then
local effect = entity:ToEffect()
if effect.State == 1 then
effect.State = 0
effect:GetSprite():Play("Appear", true)
end
end
end
end
Expand Down
59 changes: 50 additions & 9 deletions mod/racing_plus/FastTravel.lua
Expand Up @@ -40,6 +40,7 @@ function FastTravel:ReplaceTrapdoor(entity, i)
if roomIndex < 0 then -- SafeGridIndex is always -1 for rooms outside the grid
roomIndex = g.l:GetCurrentRoomIndex()
end
local roomType = g.r:GetType()
local challenge = Isaac.GetChallenge()

-- There is no way to manually travel to the "Infiniate Basements" Easter Egg floors,
Expand Down Expand Up @@ -104,9 +105,16 @@ function FastTravel:ReplaceTrapdoor(entity, i)
pos = entity.Position,
}

-- Always spawn the trapdoor closed, unless it is after Satan in Sheol
-- (or after a boss in the "Everything" race goal)
if stage ~= 10 and stage ~= 11 then
-- Spawn the trapdoor closed by default
local closed = true
if (stage == 10 or -- After Satan, there is no reason to remain in Sheol
stage == 11) and -- After Blue Baby in an "Everything" race, there is no reason to remain on The Chest
roomType == RoomType.ROOM_BOSS then -- 5
-- (it looks buggy if the trapdoor snaps open in I AM ERROR rooms)

closed = false
end
if closed then
trapdoor:ToEffect().State = 1
trapdoor:GetSprite():Play("Closed", true)
end
Expand Down Expand Up @@ -136,6 +144,8 @@ function FastTravel:ReplaceHeavenDoor(entity)
if roomIndex < 0 then -- SafeGridIndex is always -1 for rooms outside the grid
roomIndex = g.l:GetCurrentRoomIndex()
end
local roomType = g.r:GetType()
local roomClear = g.r:IsClear()
local roomSeed = g.r:GetSpawnSeed() -- Gets a reproducible seed based on the room, e.g. "2496979501"
-- Delete the "natural" beam of light
Expand Down Expand Up @@ -165,6 +175,18 @@ function FastTravel:ReplaceHeavenDoor(entity)
pos = entity.Position,
}
-- Spawn the heaven door open by default
local closed = false
if roomType == RoomType.ROOM_ERROR and -- 3
not roomClear then
closed = true
end
if closed then
heaven:ToEffect().State = 1
heaven:GetSprite():Play("Disappear", true)
end
--[[
-- Log it
local debugString = "Replaced a beam of light in room " .. tostring(roomIndex) .. " "
Expand Down Expand Up @@ -305,18 +327,18 @@ function FastTravel:CheckTrapdoorEnter(effect, upwards, theVoid)
local stage = g.l:GetStage()
local gameFrameCount = g.g:GetFrameCount()
-- Check to see if a player is touching the trapdoor
-- Check to see if a player is touching the trapdoor / heaven door
for i = 1, g.g:GetNumPlayers() do
local player = Isaac.GetPlayer(i - 1)
if g.run.trapdoor.state == FastTravel.state.DISABLED and
((not upwards and effect.State == 0) or -- The trapdoor is open
(upwards and stage == 8 and effect.FrameCount >= 40 and effect.InitSeed ~= 0) or
(upwards and effect.State == 0 and stage == 8 and effect.FrameCount >= 40 and effect.InitSeed ~= 0) or
-- We want the player to be forced to dodge the final wave of tears from It Lives!, so we have to delay
-- (we initially spawn it with an InitSeed equal to the room seed)
(upwards and stage == 8 and effect.FrameCount >= 8 and effect.InitSeed == 0) or
(upwards and effect.State == 0 and stage == 8 and effect.FrameCount >= 8 and effect.InitSeed == 0) or
-- The extra delay should not apply if they are re-entering the room
-- (we respawn beams of light with an InitSeed of 0)
(upwards and stage ~= 8 and effect.FrameCount >= 8)) and
(upwards and effect.State == 0 and stage ~= 8 and effect.FrameCount >= 8)) and
-- The beam of light opening animation is 16 frames long,
-- but we want the player to be taken upwards automatically if they hold "up" or "down" with max (2.0) speed
-- (and the minimum for this is 8 frames, determined from trial and error)
Expand Down Expand Up @@ -464,6 +486,7 @@ function FastTravel:CheckTrapdoor()
end
-- Called from the PostNewRoom callback
-- (for the Mega Satan trapdoor)
function FastTravel:CheckTrapdoor2()
-- Local variables
local stage = g.l:GetStage()
Expand All @@ -490,16 +513,26 @@ function FastTravel:CheckTrapdoor2()
Sprites:Init("black", 0)
local pos = g.r:GetCenterPos()
if g.run.trapdoor.megaSatan then
if g.g.Difficulty >= Difficulty.DIFFICULTY_GREED and -- 2
stage ~= 7 then
-- The center of the room in Greed Mode will be on top of the trigger switch
-- On vanilla, the player appears near the top of the room (at 320, 280)
-- However, if we adjust the position to this, it will cause the camera to bug out
-- Thus, make the player appear near the bottom
pos = Vector(320, 560)
elseif g.run.trapdoor.megaSatan then
-- The center of the Mega Satan room is near the top
-- Causing Isaac to warp to the top causes the game to bug out,
-- Causing Isaac to warp to the top causes the camera to bug out,
-- so adjust the position to be near the bottom entrance
pos = Vector(320, 650)
-- Additionally, stop the boss room sound effect
g.sfx:Stop(SoundEffect.SOUND_CASTLEPORTCULLIS) -- 190
elseif stage == 9 then -- Blue Womb
-- Emulate the vanilla starting position
pos = Vector(320, 560)
end
Expand Down Expand Up @@ -1024,12 +1057,20 @@ end
function FastTravel:CheckTrapdoorCrawlspaceOpen(effect)
-- Local variables
local roomType = g.r:GetType()
local roomClear = g.r:IsClear()
-- Don't do anything if the trapdoor / crawlspace is already open
if effect.State == 0 then
return
end
-- Don't do anything if we are in an uncleared I AM ERROR room
if roomType == RoomType.ROOM_ERROR and -- 3
not roomClear then
return
end
-- Don't do anything if it is freshly spawned in a boss room and one or more players are relatively close
local playerRelativelyClose = false
for j = 1, g.g:GetNumPlayers() do
Expand Down
6 changes: 4 additions & 2 deletions mod/racing_plus/Globals.lua
Expand Up @@ -5,7 +5,7 @@ local g = {}
-- Global variables
--

g.version = "v0.47.10"
g.version = "v0.47.11"
g.debug = false
g.corrupted = false -- Checked in the MC_POST_GAME_STARTED callback
g.saveFile = { -- Checked in the MC_POST_GAME_STARTED callback
Expand Down Expand Up @@ -83,6 +83,7 @@ g.RNGCounter = {
BookOfSin = 0, -- 97
DeadSeaScrolls = 0, -- 124
GuppysCollar = 0, -- 212
ButterBean = 0, -- 294
-- Devil Rooms and Angel Rooms go in order on seeded races
DevilRoomKrampus = 0,
DevilRoomChoice = 0,
Expand Down Expand Up @@ -169,7 +170,7 @@ SoundEffect.SOUND_WALNUT = Isaac.GetSoundIdByName("Walnut")

-- Transformations
PlayerForm.PLAYERFORM_STOMPY = PlayerForm.PLAYERFORM_SPIDERBABY + 1
PlayerForm.NUM_PLAYER_FORMS = PlayerForm.PLAYERFORM_STOMPY + 1
PlayerForm.NUM_PLAYER_FORMS = PlayerForm.PLAYERFORM_STOMPY + 1

g.LaserVariant = {
LASER_THICK = 1, -- Brimstone
Expand Down Expand Up @@ -312,6 +313,7 @@ function g:InitRun()
g.run.krampusKillFrame = 0 -- Used to delete vanilla Krampus items
g.run.angelKillFrame = 0 -- Used to delete vanilla key pieces
g.run.spamButtons = false -- Used to spam Blood Rights
g.run.startingRoomGraphics = false -- Used to toggle off the controls graphic in some race types

-- Trophy
g.run.trophy = { -- Used to know when to respawn the trophy
Expand Down
11 changes: 11 additions & 0 deletions mod/racing_plus/Pedestals.lua
Expand Up @@ -142,6 +142,17 @@ function Pedestals:Replace(pickup)
pickup.SubType = 0
end

-- Account for the Butter Bean "surprise" mechanic
-- (this is 10% according to Kilburn)
if pickup.SubType == CollectibleType.COLLECTIBLE_BUTTER_BEAN then -- 294
g.RNGCounter.ButterBean = g:IncrementRNG(g.RNGCounter.ButterBean)
math.randomseed(g.RNGCounter.ButterBean)
local surpriseChance = math.random(1, 10)
if surpriseChance == 1 then
pickup.SubType = CollectibleType.COLLECTIBLE_WAIT_WHAT -- 484
end
end

-- Check to see if this item should go into a Schoolbag
if Schoolbag:CheckSecondItem(pickup) then
return
Expand Down
1 change: 1 addition & 0 deletions mod/racing_plus/PostGameStarted.lua
Expand Up @@ -94,6 +94,7 @@ function PostGameStarted:Main(saveState)
g.RNGCounter.BookOfSin = startSeed
g.RNGCounter.DeadSeaScrolls = startSeed
g.RNGCounter.GuppysCollar = startSeed
g.RNGCounter.ButterBean = startSeed
g.RNGCounter.DevilRoomKrampus = startSeed
g.RNGCounter.DevilRoomChoice = startSeed
g.RNGCounter.DevilRoomItem = startSeed
Expand Down

0 comments on commit cf80c13

Please sign in to comment.