isaacscript-common 1.2.97 → 1.2.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,7 +57,8 @@ function getCurrentHealthValue(self, player, healthType)
57
57
  do
58
58
  local soulHearts = player:GetSoulHearts()
59
59
  local blackHeartsBitmask = player:GetBlackHearts()
60
- local blackHearts = countSetBits(nil, blackHeartsBitmask)
60
+ local blackHeartsBits = countSetBits(nil, blackHeartsBitmask)
61
+ local blackHearts = blackHeartsBits * 2
61
62
  return soulHearts - blackHearts
62
63
  end
63
64
  end
@@ -70,8 +71,10 @@ function getCurrentHealthValue(self, player, healthType)
70
71
  ____cond11 = ____cond11 or ____switch11 == HealthType.BLACK
71
72
  if ____cond11 then
72
73
  do
73
- local blackHearts = player:GetBlackHearts()
74
- return countSetBits(nil, blackHearts)
74
+ local blackHeartsBitmask = player:GetBlackHearts()
75
+ local blackHeartsBits = countSetBits(nil, blackHeartsBitmask)
76
+ local blackHearts = blackHeartsBits * 2
77
+ return blackHearts
75
78
  end
76
79
  end
77
80
  ____cond11 = ____cond11 or ____switch11 == HealthType.GOLDEN
@@ -1,7 +1,5 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
- local ____lualib = require("lualib_bundle")
3
- local Set = ____lualib.Set
4
- local __TS__New = ____lualib.__TS__New
2
+ require("lualib_bundle");
5
3
  local ____exports = {}
6
4
  local postPEffectUpdate, FLAGS_WHEN_PONY_IS_ACTIVE, v
7
5
  local ____errors = require("errors")
@@ -39,6 +39,7 @@ export declare function logEntity(this: void, entity: Entity): void;
39
39
  export declare function logKColor(this: void, kColor: KColor): void;
40
40
  export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
41
41
  /** Helper function for printing out information about the current room. */
42
+ export declare function logRoom(this: void): void;
42
43
  export declare function logTable(this: void, table: unknown, parentTables?: number): void;
43
44
  export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
44
45
  export declare function logSet(this: void, set: Set<AnyNotNil>): void;
@@ -14,6 +14,11 @@ local ____flag = require("functions.flag")
14
14
  local hasFlag = ____flag.hasFlag
15
15
  local ____player = require("functions.player")
16
16
  local getEffectsList = ____player.getEffectsList
17
+ local ____rooms = require("functions.rooms")
18
+ local getRoomListIndex = ____rooms.getRoomListIndex
19
+ local getRoomSafeGridIndex = ____rooms.getRoomSafeGridIndex
20
+ local getRoomSubType = ____rooms.getRoomSubType
21
+ local getRoomVariant = ____rooms.getRoomVariant
17
22
  local ____trinkets = require("functions.trinkets")
18
23
  local getTrinketName = ____trinkets.getTrinketName
19
24
  function ____exports.getDebugPrependString(self, msg, numParentFunctions)
@@ -124,6 +129,18 @@ function ____exports.logMap(map)
124
129
  end
125
130
  ____exports.log("The size of the map was: " .. tostring(map.size))
126
131
  end
132
+ function ____exports.logRoom()
133
+ local game = Game()
134
+ local room = game:GetRoom()
135
+ local roomType = room:GetType()
136
+ local roomVariant = getRoomVariant(nil)
137
+ local roomSubType = getRoomSubType(nil)
138
+ local roomSafeGridIndex = getRoomSafeGridIndex(nil)
139
+ local roomListIndex = getRoomListIndex(nil)
140
+ ____exports.log((((("Current room type/variant/sub-type: " .. tostring(roomType)) .. ".") .. tostring(roomVariant)) .. ".") .. tostring(roomSubType))
141
+ ____exports.log("Current room safe grid index: " .. tostring(roomSafeGridIndex))
142
+ ____exports.log("Current room list index: " .. tostring(roomListIndex))
143
+ end
127
144
  function ____exports.logTable(____table, parentTables)
128
145
  if parentTables == nil then
129
146
  parentTables = 0
@@ -296,8 +296,9 @@ function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
296
296
  return 32 - 2.5 * tearHeight
297
297
  end
298
298
  function ____exports.getBlackHearts(self, player)
299
- local blackHearts = player:GetBlackHearts()
300
- return countSetBits(nil, blackHearts)
299
+ local blackHeartsBitmask = player:GetBlackHearts()
300
+ local blackHeartBits = countSetBits(nil, blackHeartsBitmask)
301
+ return blackHeartBits * 2
301
302
  end
302
303
  function ____exports.getClosestPlayer(self, position)
303
304
  local closestPlayer = nil
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.97",
3
+ "version": "1.2.100",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,10 +25,10 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "devDependencies": {
28
- "@zamiell/typescript-to-lua": "1.4.0",
29
- "isaac-typescript-definitions": "1.0.355",
30
- "isaacscript-lint": "1.0.83",
31
- "isaacscript-tsconfig": "1.1.8",
28
+ "@zamiell/typescript-to-lua": "^1.4.2",
29
+ "isaac-typescript-definitions": "^1.0.355",
30
+ "isaacscript-lint": "^1.0.84",
31
+ "isaacscript-tsconfig": "^1.1.8",
32
32
  "typedoc": "^0.22.12",
33
33
  "typescript": "4.5.5"
34
34
  }