isaacscript-common 1.2.91 → 1.2.94

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.
@@ -39,7 +39,6 @@ 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;
43
42
  export declare function logTable(this: void, table: unknown, parentTables?: number): void;
44
43
  export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
45
44
  export declare function logSet(this: void, set: Set<AnyNotNil>): void;
@@ -14,11 +14,6 @@ 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
22
17
  local ____trinkets = require("functions.trinkets")
23
18
  local getTrinketName = ____trinkets.getTrinketName
24
19
  function ____exports.getDebugPrependString(self, msg, numParentFunctions)
@@ -129,18 +124,6 @@ function ____exports.logMap(map)
129
124
  end
130
125
  ____exports.log("The size of the map was: " .. tostring(map.size))
131
126
  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
144
127
  function ____exports.logTable(____table, parentTables)
145
128
  if parentTables == nil then
146
129
  parentTables = 0
@@ -216,7 +199,6 @@ function ____exports.setLogFunctionsGlobal(self)
216
199
  globals.logEntity = ____exports.logEntity
217
200
  globals.logKColor = ____exports.logKColor
218
201
  globals.logMap = ____exports.logMap
219
- globals.logRoom = ____exports.logRoom
220
202
  globals.logTable = ____exports.logTable
221
203
  globals.logTemporaryEffects = ____exports.logTemporaryEffects
222
204
  globals.logSet = ____exports.logSet
@@ -1,4 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ export declare function countSetBits(n: int): int;
2
3
  export declare function getAngleDifference(angle1: float, angle2: float): float;
3
4
  /**
4
5
  * Helper function to get an array of equidistant points on the circumference around a circle.
@@ -7,33 +7,33 @@ local ____utils = require("functions.utils")
7
7
  local ensureAllCases = ____utils.ensureAllCases
8
8
  function getCircleInitialPosition(self, direction, radius)
9
9
  repeat
10
- local ____switch6 = direction
11
- local ____cond6 = ____switch6 == Direction.NO_DIRECTION
12
- if ____cond6 then
10
+ local ____switch8 = direction
11
+ local ____cond8 = ____switch8 == Direction.NO_DIRECTION
12
+ if ____cond8 then
13
13
  do
14
14
  return Vector.Zero
15
15
  end
16
16
  end
17
- ____cond6 = ____cond6 or ____switch6 == Direction.LEFT
18
- if ____cond6 then
17
+ ____cond8 = ____cond8 or ____switch8 == Direction.LEFT
18
+ if ____cond8 then
19
19
  do
20
20
  return Vector(-radius, 0)
21
21
  end
22
22
  end
23
- ____cond6 = ____cond6 or ____switch6 == Direction.UP
24
- if ____cond6 then
23
+ ____cond8 = ____cond8 or ____switch8 == Direction.UP
24
+ if ____cond8 then
25
25
  do
26
26
  return Vector(0, -radius)
27
27
  end
28
28
  end
29
- ____cond6 = ____cond6 or ____switch6 == Direction.RIGHT
30
- if ____cond6 then
29
+ ____cond8 = ____cond8 or ____switch8 == Direction.RIGHT
30
+ if ____cond8 then
31
31
  do
32
32
  return Vector(radius, 0)
33
33
  end
34
34
  end
35
- ____cond6 = ____cond6 or ____switch6 == Direction.DOWN
36
- if ____cond6 then
35
+ ____cond8 = ____cond8 or ____switch8 == Direction.DOWN
36
+ if ____cond8 then
37
37
  do
38
38
  return Vector(0, radius)
39
39
  end
@@ -45,6 +45,14 @@ function getCircleInitialPosition(self, direction, radius)
45
45
  end
46
46
  until true
47
47
  end
48
+ function ____exports.countSetBits(self, n)
49
+ local count = 0
50
+ while n > 0 do
51
+ n = n & n - 1
52
+ count = count + 1
53
+ end
54
+ return count
55
+ end
48
56
  function ____exports.getAngleDifference(self, angle1, angle2)
49
57
  local subtractedAngle = angle1 - angle2
50
58
  return (subtractedAngle + 180) % 360 - 180
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.91",
3
+ "version": "1.2.94",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -27,9 +27,9 @@
27
27
  "devDependencies": {
28
28
  "@zamiell/typescript-to-lua": "^1.4.0",
29
29
  "isaac-typescript-definitions": "^1.0.355",
30
- "isaacscript-lint": "^1.0.81",
30
+ "isaacscript-lint": "^1.0.83",
31
31
  "isaacscript-tsconfig": "^1.1.8",
32
32
  "typedoc": "^0.22.12",
33
- "typescript": "^4.5.5"
33
+ "typescript": "4.5.5"
34
34
  }
35
35
  }