isaacscript-common 1.2.113 → 1.2.114

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.
@@ -38,6 +38,7 @@ export declare function logColor(this: void, color: Color): void;
38
38
  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
+ export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
41
42
  /** Helper function for printing out information about the current room. */
42
43
  export declare function logRoom(this: void): void;
43
44
  export declare function logTable(this: void, table: unknown, parentTables?: number): void;
@@ -14,6 +14,9 @@ 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 getPlayerName = ____player.getPlayerName
18
+ local ____playerHealth = require("functions.playerHealth")
19
+ local getPlayerHealth = ____playerHealth.getPlayerHealth
17
20
  local ____rooms = require("functions.rooms")
18
21
  local getRoomData = ____rooms.getRoomData
19
22
  local getRoomGridIndex = ____rooms.getRoomGridIndex
@@ -130,6 +133,22 @@ function ____exports.logMap(map)
130
133
  end
131
134
  ____exports.log("The size of the map was: " .. tostring(map.size))
132
135
  end
136
+ function ____exports.logPlayerHealth(player)
137
+ local playerName = getPlayerName(nil, player)
138
+ local playerHealth = getPlayerHealth(nil, player)
139
+ ____exports.log(("Player health for " .. playerName) .. ":")
140
+ ____exports.log("- Max hearts: " .. tostring(playerHealth.maxHearts))
141
+ ____exports.log("- Hearts: " .. tostring(playerHealth.hearts))
142
+ ____exports.log("- Eternal hearts: " .. tostring(playerHealth.eternalHearts))
143
+ ____exports.log("- Soul hearts: " .. tostring(playerHealth.soulHearts))
144
+ ____exports.log("- Bone hearts: " .. tostring(playerHealth.boneHearts))
145
+ ____exports.log("- Golden hearts: " .. tostring(playerHealth.goldenHearts))
146
+ ____exports.log("- Rotten hearts: " .. tostring(playerHealth.rottenHearts))
147
+ ____exports.log("- Broken hearts: " .. tostring(playerHealth.brokenHearts))
148
+ ____exports.log("- Soul charges: " .. tostring(playerHealth.soulCharges))
149
+ ____exports.log("- Blood charges: " .. tostring(playerHealth.bloodCharges))
150
+ ____exports.log(("- Soul heart types: [" .. table.concat(playerHealth.soulHeartTypes, "," or ",")) .. "]")
151
+ end
133
152
  function ____exports.logRoom()
134
153
  local roomGridIndex = getRoomGridIndex(nil)
135
154
  local roomListIndex = getRoomListIndex(nil)
@@ -75,7 +75,6 @@ function ____exports.getPlayerHealth(self, player)
75
75
  end
76
76
  end
77
77
  return {
78
- soulHeartTypes = soulHeartTypes,
79
78
  maxHearts = maxHearts,
80
79
  hearts = hearts,
81
80
  eternalHearts = eternalHearts,
@@ -85,7 +84,8 @@ function ____exports.getPlayerHealth(self, player)
85
84
  rottenHearts = rottenHearts,
86
85
  brokenHearts = brokenHearts,
87
86
  soulCharges = soulCharges,
88
- bloodCharges = bloodCharges
87
+ bloodCharges = bloodCharges,
88
+ soulHeartTypes = soulHeartTypes
89
89
  }
90
90
  end
91
91
  function ____exports.setPlayerHealth(self, player, playerHealth)
@@ -1,6 +1,5 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  export interface PlayerHealth {
3
- soulHeartTypes: HeartSubType[];
4
3
  maxHearts: int;
5
4
  hearts: int;
6
5
  eternalHearts: int;
@@ -11,4 +10,5 @@ export interface PlayerHealth {
11
10
  brokenHearts: int;
12
11
  soulCharges: int;
13
12
  bloodCharges: int;
13
+ soulHeartTypes: HeartSubType[];
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.113",
3
+ "version": "1.2.114",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "devDependencies": {
28
28
  "@zamiell/typescript-to-lua": "^1.4.2",
29
- "isaac-typescript-definitions": "^1.0.357",
29
+ "isaac-typescript-definitions": "^1.0.358",
30
30
  "isaacscript-lint": "^1.0.84",
31
31
  "isaacscript-tsconfig": "^1.1.8",
32
32
  "typedoc": "^0.22.13",