User:Blcd/RandomTidbits

= What? = This page contains random information gathered by "data mining" that has yet to make it into a relevant page. Feel free to use this information and enhance relevant pages.

= Buttons =

AB+ Pseudo code for the reward pressure plate spawns. This doesn't currently include greed mode.

local plate --GridEntityPressurePlate

function PlateMonsterReward(stage, stageType) local entityType = 0 local entityVariant = 0 if stage == 1 or stage == 2 then local spawns = [ENTITY_ATTACKFLY, ENTITY_RING_OF_FLIES, ENTITY_DART_FLY, ENTITY_HORF, ENTITY_CHARGER, ENTITY_SPIDER] entityType = spawns[plate.RNG:RandomInt(6)] elseif stage == 3 or stage == 4 then local spawns = [ENTITY_CHARGER, ENTITY_BOOMFLY, ENTITY_HIVE, ENTITY_NEST, ENTITY_MAW, ENTITY_ONE_TOOTH] entityType = spawns[plate.RNG:RandomInt(6)] elseif stage == 5 or stage == 6 then local spawns = [ENTITY_BABY, ENTITY_GLOBIN, ENTITY_BONY, ENTITY_KNIGHT, ENTITY_FAT_SACK, ENTITY_GURGLING] entityType = spawns[plate.RNG:RandomInt(6)] elseif stage == 7 or stage == 8 then local spawns = [ENTITY_MEMBRAIN, ENTITY_DINGA, ENTITY_LUMP, ENTITY_MOMS_HAND] entityType = spawns[plate.RNG:RandomInt(6)] elseif stage == 9 then if plate.RNG:RandomInt(2) == 0 then entityType = ENTITY_CHARGER entityVariant = 1 else entityType = ENTITY_CONJOINED_FATTY entityVariant = 1 end elseif stage == 10 then local entChance = plate.RNG:RandomInt(3) local entTypes = [ [ENTITY_LITTLE_HORN, ENTITY_MONSTRO], [ENTITY_GREED, ENTITY_GEMINI], [ENTITY_RAG_MAN, ENTITY_DUKE]] entityType = entTypes[entChance][stageType] elseif stage == 11 then local entChance = plate.RNG:RandomInt(2) local entTypes = [ [ENTITY_LITTLE_HORN, ENTITY_MONSTRO], [ENTITY_NULLS, ENTITY_ENVY]] local entVars = [ [0, 0],			[0, 1]]		entityType = entTypes[entChance][stageType] entityVariant = entVars[entChance][stageType] end return entityType, entityVariant end

function PlateMonsterRewardVoid(backdrop) local entityType = 0 local entityVariant = 0 local backdropToStage = [ 1,1,1, 		3,3,3,		5,5,5,		7,7,7,		9,		10,10,		11,11]	local backdropToStageType = [ 0,0,0,		0,0,0,		0,0,0,		0,0,0,		0,		0,1,		0,1]	if (backdrop <= 17) then return PlateMonsterReward(backdropToStage[backdrop], backdropToStageType[backdrop]) else return PlateMonsterReward(17, 0) end return entityType, entityVariant end

if (plate.RNG:Next & 1) == 0 then

local chance = plate.RNG:RandomInt(100) --Tries to spawn in a free pickup area, otherwise uses -1. --Not included FindFreePickupSpawnPosition for simplicity. if chance < 5 then --trap door SpawnGridEntity(-1, 17, 0, plate.RNG:GetSeed, 0) elseif chance < 10 then --gold poop SpawnGridEntity(-1, 14, 3, plate.RNG:GetSeed, 0) elseif chance < 11 then --poop SpawnGridEntity(-1, 14, 0, plate.RNG:GetSeed, 0) elseif chance < 12 then --random item Spawn(5, 64, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) elseif chance < 30 then local coins = plate.RNG:RandomInt(3) + 1 for i=1, coins do			Spawn(5, 20, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) end elseif chance < 50 then local hearts = plate.RNG:RandomInt(2) + 1 for i=1, hearts do			Spawn(5, 10, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) end elseif chance < 70 then local bombs = plate.RNG:RandomInt(2) + 1 for i=1, bombs do			Spawn(5, 10, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) end elseif chance < 80 then local rewards = [50, 60, 51, 360] --Chest, Locked Chest, Bomb Chest, Red Chest local reward = rewards[plate.RNG:RandomInt(4) + 1] Spawn(5, reward, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) elseif chance < 85 then if plate.RNG:RandomInt(2) == 0 then --slot machine Spawn(6, 1, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) else --fortune machine Spawn(6, 3, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) end elseif chance < 90 then --donation machine Spawn(6, 8, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) else --troll bomb Spawn(4, 3, position, Vector(0, 0), 0, 0, plate.RNG:GetSeed) end else local stage = Game:GetLevel:GetStage local entityType = 0 local entityVariant = 0 if stage < 12 then entityType, entityVariant = PlateMonsterReward(stage) elseif stage == 12 then entityType, entityVariant = PlateMonsterRewardVoid(Game:GetCurrentRoom:GetBackdropType) end local entityCount = plate.RNG:RandomInt(4) + 1 for i=1,entityCount do		Spawn(entityType, entityVariant, RandomFreeSpot, Vector(0, 0), 0, 0, plate.RNG:GetSeed) end end

= AI = Lua code for some EntityNPC AI

Lvl2 Fly
The 2 pieces missing are wandering when there is no target and bouncing off the walls when colliding with them.

function mod:Maw_PreNpcUpdate(npc)

--only calculate every other frame when we have a target if (npc.TargetPosition.X ~= 0 or npc.TargetPosition.Y ~= 0) and (Game:GetFrameCount & 1) == 0 then local deactivateDist = 25 --This depends on the sprite scale. E.g. 1.1 sprite scale uses 30 instead. local targetVector = npc:CalcTargetPosition(0) local distanceVec = targetVector - npc.Position local vel = Vector(distanceVec.X - distanceVec.Y, (distanceVec.X + distanceVec.Y) * .5) local velLen = vel:Length if velLen > 0 then vel = vel / velLen end --Don't update velocity when near the target. if velLen > deactivateDist then local speed = math.min((velLen - deactivateDist) * 0.8, 1.2) npc.Velocity = npc.Velocity + (vel * (speed * 2) / npc.Friction) end end if Random % 3 == 0 then if (npc:GetEntityFlags & (EntityFlag.FLAG_FEAR | EntityFlag.FLAG_SHRINK)) == 0 then --Bounce off the colliding wall. --Lua doesn't have access to the direction fields. --You have to calculate this yourself. end end

if Game:GetFrameCount % 4 == 1 then --Give the fly some random movement npc.V1 = ((RandomVector * 0.6) + npc.V1) * 0.4 end --No target if npc.TargetPosition.X == 0 && npc.TargetPosition.X == 0 then --Wander since we have no target end

if Game:GetFrameCount % 3 == 2 then if npc.SpawnerType ~= 67 then --Move the fly towards the center local diffX, diffY = 0 if npc.Position.Y < 230 then diffY = 0.06 elseif npc.Position.Y > 420 then diffY = -0.06 end if npc.Position.X > 540 then diffX = -0.06 elseif npc.Position.X < 80 then diffX = 0.06 end npc.V1 = npc.V1 + Vector(diffX, diffY) end --Apply double V1 to the velocity npc.Velocity = ((npc.V1 * 2) / npc.Friction) + npc.Velocity npc.Friction = npc.Friction * 0.6 end return true end

mod:AddCallback(ModCallbacks.MC_PRE_NPC_UPDATE, mod.Maw_PreNpcUpdate, 214)

Red Maw
--replace maw's speed with red maw's speed function mod:Maw_PreNpcUpdate(npc) if npc.Variant == 0 then local targetVector = npc:CalcTargetPosition(0) local distance = targetVector - npc.Position local distanceLen = distance:Length local speed = (0.13 / distanceLen) * 3 --Red Maw is 3 times faster npc.Velocity = npc.Velocity + ((distance * speed) / npc.Friction) npc.Friction = npc.Friction * 0.93 return true end end

mod:AddCallback(ModCallbacks.MC_PRE_NPC_UPDATE, mod.Maw_PreNpcUpdate, 26)

= Luck =

WIP documenting everything affected by luck. First pass I'm just noting down items and such. Second pass I'll get into specifics on luck usage that hasn't been documented. Looks like everything but mysterybox was documented. Also noticed that Shell Game and Slot Machine aren't affected by the Luck stat.


 * COLLECTIBLE_MOMS_EYE
 * COLLECTIBLE_LOKIS_HORNS
 * COLLECTIBLE_BROKEN_MODEM
 * COLLECTIBLE_CELTIC_CROSS
 * COLLECTIBLE_OLD_BANDAGE
 * COLLECTIBLE_GIMPY
 * COLLECTIBLE_VIRGO
 * COLLECTIBLE_MOMS_WIG
 * COLLECTIBLE_MIDAS_TOUCH
 * COLLECTIBLE_MOMS_CONTACTS
 * COLLECTIBLE_HOLY_LIGHT
 * COLLECTIBLE_SPIDER_BITE
 * COLLECTIBLE_BALL_OF_TAR
 * COLLECTIBLE_COMMON_COLD
 * COLLECTIBLE_MOMS_EYESHADOW
 * COLLECTIBLE_IRON_BAR
 * COLLECTIBLE_MOMS_PERFUME
 * COLLECTIBLE_ABADDON
 * COLLECTIBLE_EUTHANASIA
 * COLLECTIBLE_DARK_MATTER
 * COLLECTIBLE_TOUGH_LOVE
 * COLLECTIBLE_APPLE
 * COLLECTIBLE_PARASITOID
 * COLLECTIBLE_LITTLE_HORN
 * COLLECTIBLE_EVIL_EYE
 * COLLECTIBLE_MYSTERY_GIFT


 * TRINKET_RED_PATCH
 * TRINKET_MISSING_PAGE
 * TRINKET_CARTRIDGE
 * TRINKET_SAMSONS_LOCK
 * TRINKET_EVES_BIRD_FOOT
 * TRINKET_CAINS_EYE
 * TRINKET_ISAACS_FORK
 * TRINKET_PINKY_EYE
 * TRINKET_PUSH_PIN
 * TRINKET_BLACK_TOOTH
 * TRINKET_OUROBOROS_WORM


 * SpawnClearAward

= Items =

Head of the Keeper
5% chance for a coin to spawn when hitting a vulnerable enemy.

Void
Active items are activated in the order they were consumed. When consuming multiple items at once, they are added based on where they appear in the room's entity list. For example

for entity in roomEntities do   if (isPedistal(entity) and isActiveItem(entity)) then consume(entity) #Add to consumedItems list end end for item in consumedItems do   UseActiveItem(item) if isSingleUse(item) then remove(item) end end

Athame/Maw

 * Athame is a 15% chance on kill to spawn a blackheart. Maw is a 5% chance on kill to spawn a blackheart. If both proc, the black heart drop percentage is whatever one triggered last.
 * The effect can stack (E.g. Athame + Razor Blade). This can cause multiple hearts to spawn if the killing damage from multiple effects all trigger on the same frame. Here is an example showing this behavior with a 100% drop rate. https://www.youtube.com/watch?v=ppXu5A2FvS8.

Dead Eye
Upon missing there is an increasing chance to lose the buff.
 * first miss = 20%
 * second miss = 33%
 * third miss and beyond = 50%

Delirious
Delirious can spawn the following bosses(v193) http://pastebin.com/simKrthQ

Monster Manual
The list of familiars Monster Manual picks from.

D4
D4 rerolling excludes the following items.

= Familiars =

Lil' Chest
Upon clearing a room, Lil' Chest has a random chance to spawn a consumable or trinket. The drop chance is seeded, however the drop itself is not seeded.


 * Chances without BFFs!
 * 10% for a trinket
 * 25% for a consumable
 * Chances with BFFs!
 * 12.5% for a trinket
 * 31.25% for a consumable

Bomb Bag
The bomb bag drops a bomb after a certain number of room clears. Note the room clears is tracked per familiar.
 * Without BFFs!
 * floor(roomsCleared / 1.1) > 0 && (floor(roomsCleared / 1.1) & 1) == 0
 * With BFFs!
 * floor(roomsCleared / 1.2) > 0 && (floor(roomsCleared / 1.2) & 1) == 0

= Pickup Familiars =

= Monsters =

Host
Every 2 damage(rounded up) will add 7 frames of hiding up to a max of 70. Hosts take 14 frames to acquire a target. Dealing 20+ damage will cause the host to grimace.

= Machine destruction drops = These are the drops when you destroy a machine(excluding restock, blood donation and the chest/darkroom).
 * 20% (pill or trinket)
 * 1% chest
 * 1% locked chest
 * 78%
 * 33% for one of these conditions to happen based on trinkets you are holding. They are checked in this order in the case of having multiple matching trinkets. Ace of Spades = 50% spawn a card || Safety Cap = 50% spawn a pill || Match Stick = 50% spawn a bomb || Child's Heart = 50% spawn a heart || Rusted Key = 50% spawn a key
 * 100% Drop 2-3 pickups (33% +1 pickup if you have lucky toe)
 * 35% spawn 1-3 coins
 * 20% spawn a heart (50% this counts as 2 pickups, 80% chance daemon's tail prevents this to spawn, if prevented this doesn't count towards the pickup drops)
 * 15% spawn a key
 * 30% spawn a bomb

= Room Anti-softlock = This is the feature where doors will open after a set time. The anti-softlock check fires every 2 seconds after being in a room for 30 seconds. These are the door open conditions
 * Only works in RoomType.ROOM_DEFAULT
 * Doesn't trigger if there is a boss/miniboss in the room or the player has flying
 * The remaining enemies must be unable to path to the player (Ignoring poop)
 * The remaining enemies must have GridCollisionClass COLLISION_WALL or COLLISION_WALL_EXCEPT_PLAYER

= Player Health Types =