diff --git a/descriptions/ab+/zh_cn.lua b/descriptions/ab+/zh_cn.lua index 70605ee7..7c8de5c3 100644 --- a/descriptions/ab+/zh_cn.lua +++ b/descriptions/ab+/zh_cn.lua @@ -2,7 +2,7 @@ ----- Basic Chinese descriptions --- -------------------------------------- --- Last Sync Revise: 2022.01.16 +-- Last Sync Revise: 2022.01.20 -- Last Full Check: N/A -- I will have a full check someday else. -- FORMAT: Item ID | Name | Description @@ -441,7 +441,7 @@ EID.descriptions[languageCode].collectibles={ {"416", "深口袋", "能携带2个卡牌/胶囊/符文"}, {"417", "魅魔", "在房间内漂浮的跟班,产生伤害光环,每秒造成角色伤害的129%的伤害#↑ 站在光环中+50%伤害"}, {"418", "水果蛋糕", "每颗眼泪都有不同效果"}, - {"419", "传送2.0", "传送至另1个未探索的随机房间#等级:{{Room}}>{{BossRoom}}>{{SuperSecretRoom}}>{{Shop}}>{{TreasureRoom}}>{{SacrificeRoom}}> {{DiceRoom}}>{{Library}}>{{CursedRoom}}>{{MiniBoss}}>{{ChallengeRoom}}>{{IsaacsRoom}}>{{ArcadeRoom}}>{{ChestRoom}}>{{SecretRoom}}>{{DevilRoom}}{{AngelRoom}}>错误房"}, + {"419", "传送2.0", "传送至另1个未探索的随机房间#等级:{{Room}}>{{BossRoom}}>{{SuperSecretRoom}}>{{Shop}}>{{TreasureRoom}}>{{SacrificeRoom}}> {{DiceRoom}}>{{Library}}>{{CursedRoom}}>{{MiniBoss}}>{{ChallengeRoom}}>{{IsaacsRoom}}>{{ArcadeRoom}}>{{ChestRoom}}>{{SecretRoom}}>{{DevilRoom}}/{{AngelRoom}}>错误房"}, {"420", "黑色粉末", "在地上走1个圈会产生五角星符号#每秒造成30接触伤害"}, {"421", "腰豆", "使用时将任何范围内的敌人魅惑并造成5伤害"}, {"422", "发光沙漏", "倒退时间并将角色放回上1个房间,且与当时的状态一致"}, @@ -454,7 +454,7 @@ EID.descriptions[languageCode].collectibles={ {"429", "店主的头", "敌人被眼泪击中时有5%几率掉落硬币"}, {"430", "狙击蝇老爹", "跟随角色移动的跟班,有1秒延迟#向附近敌人发射眼泪,造成与角色伤害相等的伤害"}, {"431", "多维宝宝", "跟随角色移动的跟班,有2秒延迟#经过它的眼泪会分成2个并有速度加成"}, - {"432", "闪光炸弹", "+5炸弹#炸弹爆炸时有几率掉落随机掉落物"}, + {"432", "闪光炸弹", "+5炸弹#炸弹爆炸时几率掉落随机掉落物#炸弹爆炸时几率魅惑敌人"}, {"433", "我的影子", "每次受伤时使所有敌人恐惧并生成1个友好的黑蛆#黑蛆会造成5接触伤害"}, {"434", "苍蝇罐", "每次杀死敌人会在罐子里加入1只蓝苍蝇#最多20只苍蝇#使用时释放所有苍蝇"}, {"435", "小洛基", "十字发射眼泪的跟班#每次射击造成3.5伤害"}, @@ -505,7 +505,7 @@ EID.descriptions[languageCode].collectibles={ {"480", "堆肥", "将掉落物变成蓝苍蝇或蓝蜘蛛#使当前的蓝苍蝇/蓝蜘蛛翻倍#如果什么都没有就生成1只蓝苍蝇或蓝蜘蛛"}, {"481", "数据破解", "使用时,对随机属性小幅↑/↓#所在房间内随机眼泪效果#搞乱所有贴图"}, {"482", "遥控器", "将你换成另1个角色#移除上1个收集到的道具"}, - {"483", "妈咪炸弹!", "{{Warning}} 一次性 {{Warning}}#影响整层#炸碎所有障碍物#对所有敌人造成200伤害#打开Boss Rush/窒息胎/隐藏房的门#若持有金炸弹,则可不消耗道具使用一次,每层仅限一次"}, + {"483", "妈咪炸弹!", "{{Warning}} 一次性 {{Warning}}#影响整层#炸碎所有障碍物#对所有敌人造成200伤害#打开Boss Rush/窒息胎/隐藏房的门#若持有金炸弹,则可不消耗道具使用一次"}, {"484", "等等,啥?", "使用时使敌人推走并生成岩石波#可以开门或摧毁岩石"}, {"485", "被掰弯的硬币", "有50%几率使房间内所有道具,掉落物和箱子翻倍#另外50%几率将上述内容移除并掉落1硬币"}, {"486", "钝剃刀片", "使角色受伤但不掉血#可以用来触发道具效果"}, @@ -543,7 +543,7 @@ EID.descriptions[languageCode].collectibles={ {"518", "伙伴盲盒", "与合作宝宝外观一样的跟班#随机眼泪效果#每层都会重置"}, {"519", "精神错乱宝宝", "每10秒变成其他随机跟班的跟班"}, {"520", "跨接电缆", "每杀死15个敌人主动道具+1充能"}, - {"521", "代金券", "使用时{{Shop}}商店或{{DevilRoom}}恶魔房的随机1个道具免费#持有时,1件商店道具必定打折"}, + {"521", "代金券", "使用时{{Shop}}商店或{{DevilRoom}}恶魔房的随机1个道具免费#持有时,1件商店物品必定打折"}, {"522", "念力", "使用时使靠近角色的敌人弹幕滞留3秒#结束后弹幕会被扔走#3秒充能"}, {"523", "搬家盒", "使用时储存所在房间的所有掉落物#再次使用将储存物放回地上#可以在房间之间搬东西"}, {"524", "科技零", "眼泪以电束连接#电击伤害与角色伤害一致"}, @@ -852,10 +852,10 @@ EID.descriptions[languageCode].dice={ ---------- Transformations ---------- --- Using customary name for better understanding. +-- Using customary name for better understanding EID.descriptions[languageCode].transformations={ - "", -- 0 = none - "嗝屁猫套装", -- 1 + "", -- 0 = none + "嗝屁猫套装", -- 1 "蘑菇套装", -- 2 "苍蝇套装", -- 3 "连体套装", -- 4 diff --git a/descriptions/rep/zh_cn.lua b/descriptions/rep/zh_cn.lua index 85fde9a9..92028c20 100644 --- a/descriptions/rep/zh_cn.lua +++ b/descriptions/rep/zh_cn.lua @@ -165,8 +165,9 @@ local repCollectibles={ [407] = {"407", "纯洁", "↑ 根据角色光环颜色对角色属性进行增强#受伤或进入新房间时,获得新的光环:#{{ColorRed}}红色{{CR}} = +4伤害#{{ColorBlue}}蓝色{{CR}} = +2发射速度#{{ColorYellow}}黄色{{CR}} = +0.5移速#{{ColorOrange}}橙色{{CR}} = +3.0射程"}, [408] = {"408", "祭祀之刃", "受伤时在角色周围产生黑色硫磺火圈"}, -- Athame [415] = {"415", "光明之冠", "+2魂心#如果没有不满的心之容器:#↑ +100%伤害#↑ +1.5射程#↓ -0.3弹速#受伤后,当前房间无论心之容器是否是满的,效果消失"}, -- Crown Of Light - [416] = {"416", "深口袋", "能携带2个卡牌/胶囊/符文#如果房间没有奖励,生成1-3硬币#提高硬币上限为999"}, -- Deep Pockets + [416] = {"416", "深口袋", "如果房间没有奖励,生成1-3硬币#提高硬币上限为999"}, -- Deep Pockets [417] = {"417", "魅魔", "在房间内漂浮的跟班,产生伤害光环,每秒造成7-10的伤害#↑ 站在光环中+50%伤害"}, -- Succubus + [419] = {"419", "传送2.0", "传送至另1个未探索的随机房间#等级:{{Room}}>{{BossRoom}}>{{SuperSecretRoom}}>{{Shop}}>{{TreasureRoom}}>{{SacrificeRoom}}>{{DiceRoom}}> {{Library}}>{{CursedRoom}}>{{MiniBoss}}>{{ChallengeRoom}}>{{IsaacsRoom}}>{{ArcadeRoom}}>{{ChestRoom}}>{{Planetarium}}>{{SecretRoom}}>{{DevilRoom}}/{{AngelRoom}}>错误房"}, [421] = {"421", "腰豆", "使用时将任何范围内的敌人魅惑"}, -- Kidney Bean [426] = {"426", "狂热粉丝", "跟随角色移动的跟班,有0.66秒延迟#每秒造成30接触伤害"}, -- Obsessed Fan [430] = {"430", "狙击蝇老爹", "跟随角色移动的跟班,有0.66秒延迟#向附近敌人发射眼泪,造成与角色伤害相等的伤害"}, -- Papa Fly @@ -175,7 +176,7 @@ local repCollectibles={ [440] = {"440", "肾结石", "发射眼泪时几率进行蓄力攻击#松开发射键后发射肾结石和一串眼泪"}, -- Kidney Stone [442] = {"442", "黑王子之冠", "!!! 仅有1红心时:#↑ +2发射速度#↑ +1.5射程#↑ +0.2弹速#没有红心的角色无效)"}, -- Dark Princes Crown [444] = {"444", "铅笔", "每发射15颗眼泪,发射一串眼泪"}, -- Lead Pencil - [448] = {"448", "玻璃碎片", "受减红心的伤时,喷出红色眼泪#攻击时控制喷出眼泪的方向#生效后,每20秒受到半心伤害#直到捡到红心或无红心为止#不致死"}, -- Shard of Glass + [448] = {"448", "玻璃碎片", "受减红心的伤时:#在角色周围喷洒眼泪#攻击时控制喷出眼泪的方向#每20秒受到半红心伤害#直到捡到红心或无红心效果终止#不致死#受伤时有25%几率掉落1红心"}, -- Shard of Glass [451] = {"451", "塔罗牌桌布", "掉落1个随机卡牌或符文#某些卡牌有额外或双倍效果"}, -- Tarot Cloth [453] = {"453", "复杂性骨折", "↑ +0.38射程#骨头眼泪#眼泪击中时碎成1-3个小骨头碎片"}, -- Compound Fracture [455] = {"455", "老爸丢失的硬币", "↑ +0.38射程#生成1运气硬币"}, @@ -243,7 +244,7 @@ local repCollectibles={ [591] = {"591", "金星", "↑ +1心之容器#治疗1红心#近距离内的敌人受到魅惑"}, -- Venus [592] = {"592", "地球", "↑ +1.0伤害#眼泪变为石头#每颗伤害不定#可摧毁障碍物#击退增强"}, -- Terra [593] = {"593", "火星", "双击移动方向键进行冲锋#冲锋时无敌,造成角色伤害x4的伤害#3秒冷却时间"}, -- Mars - [594] = {"594", "木星", "↑ +2心之容器#治疗半红心#↓ -0.3移速#不移动时累积至多0.5移速#移动时向后释放毒气"}, -- Jupiter + [594] = {"594", "木星", "↑ +2心之容器#治疗半红心#↓ -0.3移速#不移动时累积至多0.5移速#移动时向后释放毒气#角色免疫中毒伤害"}, -- Jupiter [595] = {"595", "土星", "生成1个轨道#进入房间时生成7颗眼泪在轨道上环绕#轨道有几率捕获敌人的弹幕"}, -- Saturnus [596] = {"596", "天王星", "发射冰冻眼泪,对敌人造成减速效果,击杀时使敌人冻结#冻结的敌人可以推开,撞碎时向四周发射6个冰锥"}, -- Uranus [597] = {"597", "海王星", "不发射眼泪时积攒眼泪,最多持续3秒##发射时射出大量眼泪#发射时积攒的眼泪逐渐减少"}, -- Neptunus @@ -316,7 +317,7 @@ local repCollectibles={ [664] = {"664", "大胃王", "↑ +1心之容器#满血#所有道具会周期性地切换为食物道具#捡起食物道具时获得临时+3.6伤害,永久提升2项属性并永久-0.03移速#食物道具治疗3红心"}, -- Binge Eater [665] = {"665", "嗝屁猫的眼睛", "显示所有箱子,福袋,火堆的内容"}, -- Guppy's Eye [666] = {"666", "", "<道具不存在>"}, - [667] = {"667", "稻草人", "生成店主作为第二个角色#店主死亡时生成蓝蜘蛛#店主死亡时该道具消失#店主活着时恶魔交易花费硬币#!!! 店主能够捡起道具,包括剧情道具,死亡时也会永久移除"}, -- Strawman + [667] = {"667", "稻草人", "+1炸弹#生成店主作为第二个角色#店主死亡时生成蓝蜘蛛#店主死亡时该道具消失#店主活着时恶魔交易花费硬币#!!! 店主能够捡起道具,包括剧情道具,死亡时也会永久移除"}, -- Strawman [668] = {"668", "老爸的便条", "踏上回家的路#留在之前{{TreasureRoom}}道具房或{{BossRoom}}Boss房的饰品会变成 {{Card78}} 破裂的钥匙"}, -- Dad's Note [669] = {"669", "腊肠", "↑ +1心之容器#满血#↑ +0.5伤害#↑ +0.2移速#↑ +1.2弹速#↑ +0.16射程#↑ +1运气#↑ +6.9%{{DevilRoom}}恶魔房或{{AngelRoom}}天使房几率#↑ +6.9%{{Planetarium}}星象房几率"}, -- Sausage [670] = {"670", "选择?", "如果清理的房间有奖励,产生2种不同的奖励#捡起其一后另1个奖励消失"}, -- Options? @@ -549,7 +550,7 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { [291] = "每有1便便类敌人额外生成1魂火", -- Flush! [292] = "每有1此类魂火+10%{{DevilRoom}}恶魔房或{{AngelRoom}}天使房几率", -- Satanic Bible [293] = "摧毁时发射4向激光", -- Head of Krampus - [294] = "单房间魂火#不能发射眼泪#摧毁时产生棉豆效果", -- Butter Bean + [294] = "单房间魂火#不能发射眼泪#摧毁时产生棉豆的效果", -- Butter Bean [295] = "摧毁时几率掉落1硬币", -- Magic Fingers [296] = "无特殊效果", -- Converter [297] = "无特殊效果", -- Pandora's Box @@ -605,7 +606,6 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { [523] = "魂火只在掉落物品时生成#摧毁时生成随机掉落物", -- Moving Box [527] = "不能发射眼泪#清理房间后,魂火会打来箱子/门", -- Mr. ME! [536] = "将所有魂火变成半红心#献祭时生成1强力魂火", -- Sacrificial Altar - [545] = "摧毁时生成1友好的骷髅仔", -- Book of the Dead [550] = "眼泪有10%几率对敌人触发践踏", -- Broken Shovel [552] = "眼泪有10%几率对敌人触发践踏#另会生成1个高血量魂火,不能发射眼泪", -- Mom's Shovel @@ -851,7 +851,7 @@ EID:updateDescriptionsViaTable(repCards, EID.descriptions[languageCode].cards) -- Note: "#" will be replaced with "#{{Collectible451}}" automatically, in order to add Tarot Cloth icon infront of each buff-bulletpoint EID.descriptions[languageCode].tarotClothBuffs = { - [2] = "同时获得 {{Collectible34}} 彼列之书效果", -- I - The Magician + [2] = "同时获得{{Collectible34}}彼列之书效果", -- I - The Magician [3] = "第一只脚落下后马上落下第二只", -- II - The High Priestess [4] = "属性提升量为4倍", -- III - The Empress [5] = "如果Boss尚未击败,传送时获得1魂心", -- IV - The Emperor @@ -968,22 +968,22 @@ EID.descriptions[languageCode].GlitchedItemText = { [0] = "伤害", "射速", "弹速", "射程", "移速", "眼泪效果", "眼泪颜色", "飞行", "攻击类型", "跟班", "幸运", "大小", "颜色", "箱子内容物", [16] = "所有属性", -- Attribute triggers - chain = "{{ColorCyan}}然后:{{CR}} ", - active = "{{ColorCyan}}使用时:#", - pickup_collected = "{{ColorCyan}}捡到掉落物时:#", --chance to? - enemy_kill = "{{ColorCyan}}击杀时,几率:#", - damage_taken = "{{ColorCyan}}受伤时:#", --chance to? - entity_spawned = "当生成{{ColorCyan}}{T1}{{CR}}时:#", - tear_fire = "{{ColorCyan}}角色发射眼泪时,几率:#", - enemy_hit = "{{ColorCyan}}击中敌人时,几率:#", - room_clear = "{{ColorCyan}}清理房间后:#", --chance to? + chain = "然后:{{CR}}", + active = "使用时:#", + pickup_collected = "捡到掉落物时:#", --chance to? + enemy_kill = "击杀时,几率:#", + damage_taken = "受伤时:#", --chance to? + entity_spawned = "当生成{T1}时:#", + tear_fire = "角色发射眼泪时,几率:#", + enemy_hit = "击中敌人时,几率:#", + room_clear = "清理房间后:#", --chance to? -- Attribute effects area_damage = "在角色周围造成{1}伤害", add_temporary_effect = "所在房间获得{1}效果", - convert_entities = "将房间中所有{{ColorGray}}{1}{{CR}}变成{{ColorGray}}{2}{{CR}}", + convert_entities = "将房间中所有{1}变成{2}", use_active_item = "使用{1}", - spawn_entity = "生成1个{{ColorGray}}{1}{{CR}}", + spawn_entity = "生成1个{1}", fart = "放屁,大小为{1}", -- Generic entity names not obtained from entities2.xml diff --git a/eid_api.lua b/eid_api.lua index 114553f5..5a6e5621 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -321,10 +321,9 @@ function EID:getDescriptionObj(Type, Variant, SubType, entity) description.Transformation = EID:getTransformation(Type, Variant, SubType) - description.ModName = tableEntry and tableEntry[4] description.ModName = tableEntry and tableEntry[4] - for _, modifier in pairs(EID.DescModifiers) do + for _,modifier in pairs(EID.DescModifiers) do local result = modifier.condition(description) if type(result) == "table" then for _,callback in ipairs(result) do @@ -738,7 +737,6 @@ function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars) -- utf8 word (sequence): 0x11xxxxxx 0x10xxxxxx 0x10xxxxxx ... 0x10xxxxxx -- see https://en.wikipedia.org/wiki/UTF-8 -- we can only break after space, or before 0x11xxxxxx - local can_break_after_cursor = false local cur, next = byte(str,cursor), byte(str,cursor+1) if -- cond#1: we can break at the end of string @@ -829,7 +827,7 @@ function EID:renderString(str, position, scale, kcolor) str = EID:replaceShortMarkupStrings(str) local textPartsTable = EID:filterColorMarkup(str, kcolor) local offsetX = 0 - for i, textPart in ipairs(textPartsTable) do + for _, textPart in ipairs(textPartsTable) do local strFiltered, spriteTable = EID:filterIconMarkup(textPart[1], position.X, position.Y) EID:renderInlineIcons(spriteTable, position.X + offsetX, position.Y) EID.font:DrawStringScaledUTF8(strFiltered, position.X + offsetX, position.Y, scale.X, scale.Y, textPart[2], 0, false) @@ -886,11 +884,10 @@ end local itemConfigItemAttributes = { "AddMaxHearts", "AddHearts", "AddSoulHearts", "AddBlackHearts", "AddBombs", "AddCoins", "AddKeys", "CacheFlags" } function EID:CheckGlitchedItemConfig(id) local localizedNames = EID:getDescriptionEntry("GlitchedItemText") - local config = Isaac.GetItemConfig() - local item = config:GetCollectible(id) + local item = EID.itemConfig:GetCollectible(id) if not item then return "" end local attributes = "" - for k,v in ipairs(itemConfigItemAttributes) do + for _,v in ipairs(itemConfigItemAttributes) do local val = item[v] if val ~= 0 then if (v == "CacheFlags") then @@ -964,7 +961,7 @@ function EID:DetectModdedItems() end function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem) - local itemPool = Game():GetItemPool() + local itemPool = game:GetItemPool() if maxCollectibleID == nil then maxCollectibleID = EID:GetMaxCollectibleID() end for i= 1, maxCollectibleID do if ItemConfig.Config.IsValidCollectible(i) and i ~= collectibleID then @@ -972,7 +969,7 @@ function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem) end end local isUnlocked = false - for i = 0,1 do -- some samples to make sure + for i = 0, 1 do -- some samples to make sure local collID = itemPool:GetCollectible(itemPoolOfItem, false, 1) if collID == collectibleID then isUnlocked = true @@ -1001,7 +998,7 @@ function EID:isCollectibleUnlockedAnyPool(collectibleID) return false end --iterate through the pools this item can be in - for k,itemPoolID in ipairs(EID.XMLItemIsInPools[collectibleID]) do + for _,itemPoolID in ipairs(EID.XMLItemIsInPools[collectibleID]) do if (itemPoolID < ItemPoolType.NUM_ITEMPOOLS and EID:isCollectibleUnlocked(collectibleID, itemPoolID)) then EID.itemUnlockStates[collectibleID] = true return true @@ -1019,14 +1016,14 @@ end -- Example input: {1,2,3,4,5,6,7,8} -- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}" local emptyPickupTable = {} -for i=1,29 do emptyPickupTable[i] = 0 end +for i=1, 29 do emptyPickupTable[i] = 0 end function EID:tableToCraftingIconsFull(craftTable, indicateCompleteContent) local sortedList = {table.unpack(craftTable)} table.sort(sortedList, function(a, b) return a < b end) local visitedItemCount = {table.unpack(emptyPickupTable)} local iconString = "" - for _,nr in ipairs(sortedList) do + for _, nr in ipairs(sortedList) do visitedItemCount[nr] = visitedItemCount[nr] + 1 local completedColoring = indicateCompleteContent and EID:bagContainsItem(nr, visitedItemCount[nr], false) and "{{IconGreenTint}}" or "" iconString = iconString..completedColoring.."{{Crafting"..nr.."}}" @@ -1040,11 +1037,11 @@ end function EID:tableToCraftingIconsMerged(craftTable, indicateCompleteContent) local sortedList = {table.unpack(craftTable)} local filteredList = {table.unpack(emptyPickupTable)} - for _,nr in ipairs(sortedList) do + for _, nr in ipairs(sortedList) do filteredList[nr] = filteredList[nr] + 1 end local iconString = "" - for nr,count in ipairs(filteredList) do + for nr, count in ipairs(filteredList) do if (count > 0) then local completedColoring = indicateCompleteContent and EID:bagContainsItem(nr, count, true) and "{{ColorBagComplete}}" or "" iconString = iconString..completedColoring..count.."{{Crafting"..nr.."}}{{CR}}" @@ -1091,7 +1088,7 @@ end function EID:getScreenSize() local room = game:GetRoom() - local pos = room:WorldToScreenPosition(Vector(0,0)) - room:GetRenderScrollOffset() - Game().ScreenShakeOffset + local pos = room:WorldToScreenPosition(Vector(0,0)) - room:GetRenderScrollOffset() - game.ScreenShakeOffset local rx = pos.X + 60 * 26 / 40 local ry = pos.Y + 140 * (26 / 40) diff --git a/eid_bagofcrafting.lua b/eid_bagofcrafting.lua index 36429989..ff3cfd2c 100644 --- a/eid_bagofcrafting.lua +++ b/eid_bagofcrafting.lua @@ -85,7 +85,7 @@ local pickupIDLookup = { local function IsTaintedCain() --no clue how the display works for co-op, as far as I can tell we're only caring about player 1 --this check is necessary for some ingredient tracking now that Bag of Crafting is usable by everyone - return game:GetPlayer(0):GetPlayerType() == 23 + return EID.player:GetPlayerType() == 23 end local componentShifts = { @@ -256,27 +256,24 @@ function EID:simulateBagOfCrafting(componentsTable) end local poolWeights = { - {idx = 0, weight = 1}, - {idx = 1, weight = 2}, - {idx = 2, weight = 2}, - {idx = 3, weight = compCounts[4] * 10}, - {idx = 4, weight = compCounts[5] * 10}, - {idx = 5, weight = compCounts[7] * 5}, - {idx = 7, weight = compCounts[30] * 10}, - {idx = 8, weight = compCounts[6] * 10}, - {idx = 9, weight = compCounts[26] * 10}, - {idx = 12, weight = compCounts[8] * 10}, + {idx = 0, weight = 1, totalWeight = 0}, + {idx = 1, weight = 2, totalWeight = 0}, + {idx = 2, weight = 2, totalWeight = 0}, + {idx = 3, weight = compCounts[4] * 10, totalWeight = 0}, + {idx = 4, weight = compCounts[5] * 10, totalWeight = 0}, + {idx = 5, weight = compCounts[7] * 5, totalWeight = 0}, + {idx = 7, weight = compCounts[30] * 10, totalWeight = 0}, + {idx = 8, weight = compCounts[6] * 10, totalWeight = 0}, + {idx = 9, weight = compCounts[26] * 10, totalWeight = 0}, + {idx = 12, weight = compCounts[8] * 10}, totalWeight = 0, } if compCounts[9] + compCounts[2] + compCounts[13] + compCounts[16] == 0 then table.insert(poolWeights, {idx = 26, weight = compCounts[24] * 10}) end - for k,v in ipairs(poolWeights) do - v.totalWeight = 0 - end local totalWeight = 0 - local qualityWeights = {[0]=0, 0, 0, 0, 0} + local qualityWeights = {[0] = 0, 0, 0, 0, 0} for _, poolWeight in ipairs(poolWeights) do if poolWeight.weight > 0 then @@ -326,7 +323,7 @@ function EID:simulateBagOfCrafting(componentsTable) --line break after boss pool if (firstAfterBoss) then poolString = poolString .. " " end poolString = poolString .. poolToIcon[v.idx] .. ":" .. math.floor(v.totalWeight/totalWeight*100+0.5) .. "%," - if (k == 3) then firstAfterBoss = true else firstAfterBoss = false end + firstAfterBoss = (k == 3) end end poolString = string.sub(poolString,1,-2) .. "#" @@ -656,7 +653,6 @@ EID.bagOfCraftingRoomQueries = {} EID.bagOfCraftingFloorQuery = {} EID.BagItems = {} -local icount = 0 local bagOfCraftingOffset = 0 local lockedResults = nil local refreshNextTick = false @@ -863,7 +859,7 @@ function EID:handleBagOfCraftingRendering() local pickups = Isaac.FindByType(5, -1, -1, true, false) if EID.bagOfCraftingCurPickupCount ~= #pickups then - for i, entity in ipairs(pickups) do + for _, entity in ipairs(pickups) do local craftingIDs = EID:getBagOfCraftingID(entity.Variant, entity.SubType) if craftingIDs ~= nil and not entity:ToPickup():IsShopItem() then for _,v in ipairs(craftingIDs) do @@ -882,7 +878,7 @@ function EID:handleBagOfCraftingRendering() local itemCount = {} --max 8 copies of a single item in our list, to avoid repeat recipes - for i, v in ipairs(EID.bagOfCraftingFloorQuery) do + for _, v in ipairs(EID.bagOfCraftingFloorQuery) do if (not itemCount[v] or itemCount[v] < 8) then table.insert(itemQuery, v) if (not itemCount[v]) then itemCount[v] = 1 @@ -890,7 +886,7 @@ function EID:handleBagOfCraftingRendering() end end - for i, v in ipairs(EID.BagItems) do + for _, v in ipairs(EID.BagItems) do if (not itemCount[v] or itemCount[v] < 8) then table.insert(itemQuery, v) if (not itemCount[v]) then itemCount[v] = 1 @@ -998,12 +994,12 @@ function EID:handleBagOfCraftingRendering() if (calcResultCache[queryString]) then sortedResults = calcResultCache[queryString] else - for k, v in ipairs(sortedIDs) do + for _, v in ipairs(sortedIDs) do sortedResults[v] = {} end end - for k, v in pairs(newResults) do + for _, v in pairs(newResults) do local resultID, lockedAchievementID = EID:calculateBagOfCrafting(v) if resultID ~= lockedAchievementID then table.insert(sortedResults[resultID], {v, resultID, lockedAchievementID}) @@ -1016,7 +1012,7 @@ function EID:handleBagOfCraftingRendering() results = sortedResults numResults = 0 - for k,v in ipairs(sortedIDs) do + for _,v in ipairs(sortedIDs) do if (refreshNextTick and bagOfCraftingOffset > 0 and v == refreshPosition) then --jump to the item we were looking at before, so you can more easily refresh for variants of recipes bagOfCraftingOffset = numResults @@ -1097,11 +1093,11 @@ function EID:handleBagOfCraftingRendering() end local curOffset = 0 refreshPosition = -1 - for k,id in ipairs(sortedIDs) do + for _,id in ipairs(sortedIDs) do if (curOffset + #results[id] <= bagOfCraftingOffset) then curOffset = curOffset + #results[id] else if (refreshPosition == -1) then refreshPosition = id end - for k2, v in ipairs(results[id]) do + for _, v in ipairs(results[id]) do curOffset = curOffset + 1 if (curOffset > bagOfCraftingOffset+EID.Config["BagOfCraftingResults"]) then break end if not v then break end diff --git a/eid_tmtrainer.lua b/eid_tmtrainer.lua index 218a6d0f..c02d3aeb 100644 --- a/eid_tmtrainer.lua +++ b/eid_tmtrainer.lua @@ -102,10 +102,9 @@ local function CheckLogForItems(_) -- Check log.txt every 5 frames if there's a collectible we haven't read the data for yet -- (Should work well for Corrupted Data) if game:GetFrameCount() % 5 ~= 0 or not EID.Config["DisplayGlitchedItemInfo"] or not logFound or - Isaac.GetItemConfig():GetCollectible(maxNumber - spawnedItems - 1) == nil then return end + EID.itemConfig:GetCollectible(maxNumber - spawnedItems - 1) == nil then return end local numEffects = 0 - local itemScore = 0 local eidDesc = "" local theLog = io.open(logLocation, "r") @@ -114,7 +113,6 @@ local function CheckLogForItems(_) local line = theLog:read() while line ~= nil do if string.find(line, "initialized with") then - local count = 0 spawnedItems = spawnedItems + 1 lastEffectTrigger = "chain" eidDesc = "" diff --git a/main.lua b/main.lua index ac54ee6b..e059b22a 100644 --- a/main.lua +++ b/main.lua @@ -888,7 +888,7 @@ local function renderAchievementInfo() hasShownAchievementWarning = true else -- Achievements Locked Check (do we have Cube of Meat or Book of Revelations unlocked?) - local characterID = Game():GetPlayer(0):GetPlayerType() + local characterID = EID.player:GetPlayerType() --ID 21 = Tainted Isaac. Tainted characters have definitely beaten Mom! (Fixes Tainted Lost's item pools ruining this check) if characterID < 21 and game.Challenge == 0 and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) then local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)