isaacscript-common 44.1.0 → 45.0.0
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.
- package/dist/index.rollup.d.ts +19 -7
- package/dist/isaacscript-common.lua +51 -27
- package/dist/src/classes/features/other/{EdenStartingStats.d.ts → EdenStartingStatsHealth.d.ts} +17 -5
- package/dist/src/classes/features/other/EdenStartingStatsHealth.d.ts.map +1 -0
- package/dist/src/classes/features/other/EdenStartingStatsHealth.lua +75 -0
- package/dist/src/enums/ISCFeature.d.ts +1 -1
- package/dist/src/enums/ISCFeature.d.ts.map +1 -1
- package/dist/src/enums/ISCFeature.lua +2 -2
- package/dist/src/features.d.ts +3 -3
- package/dist/src/features.d.ts.map +1 -1
- package/dist/src/features.lua +3 -3
- package/dist/src/functions/math.d.ts +1 -0
- package/dist/src/functions/math.d.ts.map +1 -1
- package/dist/src/functions/math.lua +1 -0
- package/dist/src/functions/playerHealth.d.ts +1 -1
- package/dist/src/functions/playerHealth.d.ts.map +1 -1
- package/dist/src/functions/playerHealth.lua +7 -4
- package/package.json +1 -1
- package/src/classes/features/other/{EdenStartingStats.ts → EdenStartingStatsHealth.ts} +38 -5
- package/src/enums/ISCFeature.ts +1 -1
- package/src/features.ts +3 -3
- package/src/functions/math.ts +1 -0
- package/src/functions/playerHealth.ts +21 -9
- package/dist/src/classes/features/other/EdenStartingStats.d.ts.map +0 -1
- package/dist/src/classes/features/other/EdenStartingStats.lua +0 -54
package/dist/index.rollup.d.ts
CHANGED
|
@@ -4068,15 +4068,26 @@ export declare function easeOutQuint(time: number): number;
|
|
|
4068
4068
|
*/
|
|
4069
4069
|
export declare function easeOutSine(time: number): number;
|
|
4070
4070
|
|
|
4071
|
-
declare class
|
|
4071
|
+
declare class EdenStartingStatsHealth extends Feature {
|
|
4072
4072
|
/**
|
|
4073
4073
|
* We must use the `POST_PLAYER_INIT` callback since the two random collectibles have not been
|
|
4074
4074
|
* granted yet.
|
|
4075
4075
|
*/
|
|
4076
4076
|
private readonly postPlayerInit;
|
|
4077
|
+
private getEdenStats;
|
|
4078
|
+
private getEdenHealth;
|
|
4077
4079
|
/**
|
|
4078
|
-
* Helper function to get the
|
|
4079
|
-
*
|
|
4080
|
+
* Helper function to get the health that Eden started with at the beginning of the run before any
|
|
4081
|
+
* of the random collectibles were added.
|
|
4082
|
+
*
|
|
4083
|
+
* Returns undefined if passed a player that is not Eden.
|
|
4084
|
+
*
|
|
4085
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
|
|
4086
|
+
*/
|
|
4087
|
+
getEdenStartingHealth(player: EntityPlayer): Readonly<PlayerHealth> | undefined;
|
|
4088
|
+
/**
|
|
4089
|
+
* Helper function to get the value of the randomized starting stat for Eden that was assigned at
|
|
4090
|
+
* the beginning of the run before any of the random collectibles were added.
|
|
4080
4091
|
*
|
|
4081
4092
|
* Returns undefined if passed a player that is not Eden.
|
|
4082
4093
|
*
|
|
@@ -4085,7 +4096,7 @@ declare class EdenStartingStats extends Feature {
|
|
|
4085
4096
|
getEdenStartingStat<T extends PlayerStat>(player: EntityPlayer, playerStat: T): PlayerStats[T] | undefined;
|
|
4086
4097
|
/**
|
|
4087
4098
|
* Helper function to get all of the stat values that Eden started with at the beginning of the
|
|
4088
|
-
* run.
|
|
4099
|
+
* run before any of the random collectibles were added.
|
|
4089
4100
|
*
|
|
4090
4101
|
* Returns undefined if passed a player that is not Eden.
|
|
4091
4102
|
*
|
|
@@ -6240,7 +6251,7 @@ export declare function getPlayerFromPtr(entityPtr: EntityPtr): EntityPlayer | u
|
|
|
6240
6251
|
*
|
|
6241
6252
|
* This is based on the `REVEL.StoreHealth` function in the Revelations mod.
|
|
6242
6253
|
*/
|
|
6243
|
-
export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth
|
|
6254
|
+
export declare function getPlayerHealth(player: EntityPlayer): Readonly<PlayerHealth>;
|
|
6244
6255
|
|
|
6245
6256
|
export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
|
|
6246
6257
|
|
|
@@ -8330,7 +8341,7 @@ export declare enum ISCFeature {
|
|
|
8330
8341
|
DEPLOY_JSON_ROOM = 24,
|
|
8331
8342
|
DISABLE_ALL_SOUND = 25,
|
|
8332
8343
|
DISABLE_INPUTS = 26,
|
|
8333
|
-
|
|
8344
|
+
EDEN_STARTING_STATS_HEALTH = 27,
|
|
8334
8345
|
FADE_IN_REMOVER = 28,
|
|
8335
8346
|
FAST_RESET = 29,
|
|
8336
8347
|
FLYING_DETECTION = 30,
|
|
@@ -8395,7 +8406,7 @@ declare interface ISCFeatureToClass {
|
|
|
8395
8406
|
[ISCFeature.DEPLOY_JSON_ROOM]: DeployJSONRoom;
|
|
8396
8407
|
[ISCFeature.DISABLE_ALL_SOUND]: DisableAllSound;
|
|
8397
8408
|
[ISCFeature.DISABLE_INPUTS]: DisableInputs;
|
|
8398
|
-
[ISCFeature.
|
|
8409
|
+
[ISCFeature.EDEN_STARTING_STATS_HEALTH]: EdenStartingStatsHealth;
|
|
8399
8410
|
[ISCFeature.FADE_IN_REMOVER]: FadeInRemover;
|
|
8400
8411
|
[ISCFeature.FAST_RESET]: FastReset;
|
|
8401
8412
|
[ISCFeature.FLYING_DETECTION]: FlyingDetection;
|
|
@@ -15608,6 +15619,7 @@ export declare function roomUpdateSafe(): void;
|
|
|
15608
15619
|
|
|
15609
15620
|
/**
|
|
15610
15621
|
* If rounding fails, this function returns 0.
|
|
15622
|
+
*
|
|
15611
15623
|
* From: http://lua-users.org/wiki/SimpleRound
|
|
15612
15624
|
*
|
|
15613
15625
|
* @param num The number to round.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 45.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -17451,8 +17451,8 @@ ____exports.ISCFeature.DISABLE_ALL_SOUND = 25
|
|
|
17451
17451
|
____exports.ISCFeature[____exports.ISCFeature.DISABLE_ALL_SOUND] = "DISABLE_ALL_SOUND"
|
|
17452
17452
|
____exports.ISCFeature.DISABLE_INPUTS = 26
|
|
17453
17453
|
____exports.ISCFeature[____exports.ISCFeature.DISABLE_INPUTS] = "DISABLE_INPUTS"
|
|
17454
|
-
____exports.ISCFeature.
|
|
17455
|
-
____exports.ISCFeature[____exports.ISCFeature.
|
|
17454
|
+
____exports.ISCFeature.EDEN_STARTING_STATS_HEALTH = 27
|
|
17455
|
+
____exports.ISCFeature[____exports.ISCFeature.EDEN_STARTING_STATS_HEALTH] = "EDEN_STARTING_STATS_HEALTH"
|
|
17456
17456
|
____exports.ISCFeature.FADE_IN_REMOVER = 28
|
|
17457
17457
|
____exports.ISCFeature[____exports.ISCFeature.FADE_IN_REMOVER] = "FADE_IN_REMOVER"
|
|
17458
17458
|
____exports.ISCFeature.FAST_RESET = 29
|
|
@@ -28620,6 +28620,7 @@ return ____exports
|
|
|
28620
28620
|
["src.functions.playerHealth"] = function(...)
|
|
28621
28621
|
local ____lualib = require("lualib_bundle")
|
|
28622
28622
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
28623
|
+
local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
28623
28624
|
local __TS__ArrayEntries = ____lualib.__TS__ArrayEntries
|
|
28624
28625
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
28625
28626
|
local ____exports = {}
|
|
@@ -29073,20 +29074,22 @@ end
|
|
|
29073
29074
|
function ____exports.playerConvertBlackHeartsToSoulHearts(self, player)
|
|
29074
29075
|
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
29075
29076
|
____exports.removeAllPlayerHealth(nil, player)
|
|
29076
|
-
|
|
29077
|
+
local newSoulHeartTypes = __TS__ArrayMap(
|
|
29077
29078
|
playerHealth.soulHeartTypes,
|
|
29078
29079
|
function(____, soulHeartType) return soulHeartType == HeartSubType.BLACK and HeartSubType.SOUL or soulHeartType end
|
|
29079
29080
|
)
|
|
29080
|
-
|
|
29081
|
+
local playerHealthWithSoulHearts = __TS__ObjectAssign({}, playerHealth, {soulHeartTypes = newSoulHeartTypes})
|
|
29082
|
+
____exports.setPlayerHealth(nil, player, playerHealthWithSoulHearts)
|
|
29081
29083
|
end
|
|
29082
29084
|
function ____exports.playerConvertSoulHeartsToBlackHearts(self, player)
|
|
29083
29085
|
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
29084
29086
|
____exports.removeAllPlayerHealth(nil, player)
|
|
29085
|
-
|
|
29087
|
+
local newSoulHeartTypes = __TS__ArrayMap(
|
|
29086
29088
|
playerHealth.soulHeartTypes,
|
|
29087
29089
|
function(____, soulHeartType) return soulHeartType == HeartSubType.SOUL and HeartSubType.BLACK or soulHeartType end
|
|
29088
29090
|
)
|
|
29089
|
-
|
|
29091
|
+
local playerHealthWithBlackHearts = __TS__ObjectAssign({}, playerHealth, {soulHeartTypes = newSoulHeartTypes})
|
|
29092
|
+
____exports.setPlayerHealth(nil, player, playerHealthWithBlackHearts)
|
|
29090
29093
|
end
|
|
29091
29094
|
function ____exports.playerHasHealthLeft(self, player)
|
|
29092
29095
|
local hearts = player:GetHearts()
|
|
@@ -47746,7 +47749,7 @@ end
|
|
|
47746
47749
|
__TS__DecorateLegacy({Exported}, DeployJSONRoom.prototype, "deployJSONRoom", true)
|
|
47747
47750
|
return ____exports
|
|
47748
47751
|
end,
|
|
47749
|
-
["src.classes.features.other.
|
|
47752
|
+
["src.classes.features.other.EdenStartingStatsHealth"] = function(...)
|
|
47750
47753
|
local ____lualib = require("lualib_bundle")
|
|
47751
47754
|
local Map = ____lualib.Map
|
|
47752
47755
|
local __TS__New = ____lualib.__TS__New
|
|
@@ -47761,45 +47764,66 @@ local Exported = ____decorators.Exported
|
|
|
47761
47764
|
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
47762
47765
|
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
47763
47766
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
47767
|
+
local ____playerHealth = require("src.functions.playerHealth")
|
|
47768
|
+
local getPlayerHealth = ____playerHealth.getPlayerHealth
|
|
47764
47769
|
local ____players = require("src.functions.players")
|
|
47765
47770
|
local isEden = ____players.isEden
|
|
47766
47771
|
local ____stats = require("src.functions.stats")
|
|
47767
47772
|
local getPlayerStats = ____stats.getPlayerStats
|
|
47768
47773
|
local ____Feature = require("src.classes.private.Feature")
|
|
47769
47774
|
local Feature = ____Feature.Feature
|
|
47770
|
-
local v = {run = {
|
|
47771
|
-
|
|
47772
|
-
|
|
47773
|
-
|
|
47774
|
-
|
|
47775
|
-
|
|
47775
|
+
local v = {run = {
|
|
47776
|
+
edenPlayerStats = __TS__New(Map),
|
|
47777
|
+
edenPlayerHealth = __TS__New(Map)
|
|
47778
|
+
}}
|
|
47779
|
+
____exports.EdenStartingStatsHealth = __TS__Class()
|
|
47780
|
+
local EdenStartingStatsHealth = ____exports.EdenStartingStatsHealth
|
|
47781
|
+
EdenStartingStatsHealth.name = "EdenStartingStatsHealth"
|
|
47782
|
+
__TS__ClassExtends(EdenStartingStatsHealth, Feature)
|
|
47783
|
+
function EdenStartingStatsHealth.prototype.____constructor(self)
|
|
47776
47784
|
Feature.prototype.____constructor(self)
|
|
47777
47785
|
self.v = v
|
|
47778
47786
|
self.postPlayerInit = function(____, player)
|
|
47779
47787
|
if not isEden(nil, player) then
|
|
47780
47788
|
return
|
|
47781
47789
|
end
|
|
47782
|
-
|
|
47783
|
-
|
|
47784
|
-
return
|
|
47785
|
-
end
|
|
47786
|
-
local playerStats = getPlayerStats(nil, player)
|
|
47787
|
-
mapSetPlayer(nil, v.run.edenPlayerStats, player, playerStats)
|
|
47790
|
+
self:getEdenStats(player)
|
|
47791
|
+
self:getEdenHealth(player)
|
|
47788
47792
|
end
|
|
47789
47793
|
self.callbacksUsed = {{ModCallback.POST_PLAYER_INIT, self.postPlayerInit}}
|
|
47790
47794
|
end
|
|
47791
|
-
function
|
|
47795
|
+
function EdenStartingStatsHealth.prototype.getEdenStats(self, player)
|
|
47796
|
+
local existingStatMap = mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
47797
|
+
if existingStatMap ~= nil then
|
|
47798
|
+
return
|
|
47799
|
+
end
|
|
47800
|
+
local playerStats = getPlayerStats(nil, player)
|
|
47801
|
+
mapSetPlayer(nil, v.run.edenPlayerStats, player, playerStats)
|
|
47802
|
+
end
|
|
47803
|
+
function EdenStartingStatsHealth.prototype.getEdenHealth(self, player)
|
|
47804
|
+
local existingHealthMap = mapGetPlayer(nil, v.run.edenPlayerHealth, player)
|
|
47805
|
+
if existingHealthMap ~= nil then
|
|
47806
|
+
return
|
|
47807
|
+
end
|
|
47808
|
+
local playerHealth = getPlayerHealth(nil, player)
|
|
47809
|
+
mapSetPlayer(nil, v.run.edenPlayerHealth, player, playerHealth)
|
|
47810
|
+
end
|
|
47811
|
+
function EdenStartingStatsHealth.prototype.getEdenStartingHealth(self, player)
|
|
47812
|
+
return mapGetPlayer(nil, v.run.edenPlayerHealth, player)
|
|
47813
|
+
end
|
|
47814
|
+
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingHealth", true)
|
|
47815
|
+
function EdenStartingStatsHealth.prototype.getEdenStartingStat(self, player, playerStat)
|
|
47792
47816
|
local playerStats = mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
47793
47817
|
if playerStats == nil then
|
|
47794
47818
|
return nil
|
|
47795
47819
|
end
|
|
47796
47820
|
return playerStats[playerStat]
|
|
47797
47821
|
end
|
|
47798
|
-
__TS__DecorateLegacy({Exported},
|
|
47799
|
-
function
|
|
47822
|
+
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingStat", true)
|
|
47823
|
+
function EdenStartingStatsHealth.prototype.getEdenStartingStats(self, player)
|
|
47800
47824
|
return mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
47801
47825
|
end
|
|
47802
|
-
__TS__DecorateLegacy({Exported},
|
|
47826
|
+
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingStats", true)
|
|
47803
47827
|
return ____exports
|
|
47804
47828
|
end,
|
|
47805
47829
|
["src.functions.deepCopyTests"] = function(...)
|
|
@@ -52399,8 +52423,8 @@ local ____DisableAllSound = require("src.classes.features.other.DisableAllSound"
|
|
|
52399
52423
|
local DisableAllSound = ____DisableAllSound.DisableAllSound
|
|
52400
52424
|
local ____DisableInputs = require("src.classes.features.other.DisableInputs")
|
|
52401
52425
|
local DisableInputs = ____DisableInputs.DisableInputs
|
|
52402
|
-
local
|
|
52403
|
-
local
|
|
52426
|
+
local ____EdenStartingStatsHealth = require("src.classes.features.other.EdenStartingStatsHealth")
|
|
52427
|
+
local EdenStartingStatsHealth = ____EdenStartingStatsHealth.EdenStartingStatsHealth
|
|
52404
52428
|
local ____ExtraConsoleCommands = require("src.classes.features.other.ExtraConsoleCommands")
|
|
52405
52429
|
local ExtraConsoleCommands = ____ExtraConsoleCommands.ExtraConsoleCommands
|
|
52406
52430
|
local ____FadeInRemover = require("src.classes.features.other.FadeInRemover")
|
|
@@ -52556,7 +52580,7 @@ function ____exports.getFeatures(self, mod, callbacks)
|
|
|
52556
52580
|
[ISCFeature.DEPLOY_JSON_ROOM] = __TS__New(DeployJSONRoom, preventGridEntityRespawn, spawnCollectible),
|
|
52557
52581
|
[ISCFeature.DISABLE_ALL_SOUND] = disableAllSound,
|
|
52558
52582
|
[ISCFeature.DISABLE_INPUTS] = disableInputs,
|
|
52559
|
-
[ISCFeature.
|
|
52583
|
+
[ISCFeature.EDEN_STARTING_STATS_HEALTH] = __TS__New(EdenStartingStatsHealth),
|
|
52560
52584
|
[ISCFeature.FADE_IN_REMOVER] = __TS__New(FadeInRemover),
|
|
52561
52585
|
[ISCFeature.FAST_RESET] = __TS__New(FastReset),
|
|
52562
52586
|
[ISCFeature.FLYING_DETECTION] = __TS__New(FlyingDetection, moddedElementSets),
|
package/dist/src/classes/features/other/{EdenStartingStats.d.ts → EdenStartingStatsHealth.d.ts}
RENAMED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
import type { PlayerStat } from "../../../enums/PlayerStat";
|
|
3
|
+
import type { PlayerHealth } from "../../../interfaces/PlayerHealth";
|
|
3
4
|
import type { PlayerStats } from "../../../interfaces/PlayerStats";
|
|
4
5
|
import { Feature } from "../../private/Feature";
|
|
5
|
-
export declare class
|
|
6
|
+
export declare class EdenStartingStatsHealth extends Feature {
|
|
6
7
|
/**
|
|
7
8
|
* We must use the `POST_PLAYER_INIT` callback since the two random collectibles have not been
|
|
8
9
|
* granted yet.
|
|
9
10
|
*/
|
|
10
11
|
private readonly postPlayerInit;
|
|
12
|
+
private getEdenStats;
|
|
13
|
+
private getEdenHealth;
|
|
11
14
|
/**
|
|
12
|
-
* Helper function to get the
|
|
13
|
-
*
|
|
15
|
+
* Helper function to get the health that Eden started with at the beginning of the run before any
|
|
16
|
+
* of the random collectibles were added.
|
|
17
|
+
*
|
|
18
|
+
* Returns undefined if passed a player that is not Eden.
|
|
19
|
+
*
|
|
20
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
|
|
21
|
+
*/
|
|
22
|
+
getEdenStartingHealth(player: EntityPlayer): Readonly<PlayerHealth> | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Helper function to get the value of the randomized starting stat for Eden that was assigned at
|
|
25
|
+
* the beginning of the run before any of the random collectibles were added.
|
|
14
26
|
*
|
|
15
27
|
* Returns undefined if passed a player that is not Eden.
|
|
16
28
|
*
|
|
@@ -19,7 +31,7 @@ export declare class EdenStartingStats extends Feature {
|
|
|
19
31
|
getEdenStartingStat<T extends PlayerStat>(player: EntityPlayer, playerStat: T): PlayerStats[T] | undefined;
|
|
20
32
|
/**
|
|
21
33
|
* Helper function to get all of the stat values that Eden started with at the beginning of the
|
|
22
|
-
* run.
|
|
34
|
+
* run before any of the random collectibles were added.
|
|
23
35
|
*
|
|
24
36
|
* Returns undefined if passed a player that is not Eden.
|
|
25
37
|
*
|
|
@@ -27,4 +39,4 @@ export declare class EdenStartingStats extends Feature {
|
|
|
27
39
|
*/
|
|
28
40
|
getEdenStartingStats(player: EntityPlayer): Readonly<PlayerStats> | undefined;
|
|
29
41
|
}
|
|
30
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=EdenStartingStatsHealth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EdenStartingStatsHealth.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/EdenStartingStatsHealth.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAQ5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAShD,qBAAa,uBAAwB,SAAQ,OAAO;IAclD;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAO7B;IAEF,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,aAAa;IAUrB;;;;;;;OAOG;IAEI,qBAAqB,CAC1B,MAAM,EAAE,YAAY,GACnB,QAAQ,CAAC,YAAY,CAAC,GAAG,SAAS;IAIrC;;;;;;;OAOG;IAEI,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC7C,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,CAAC,GACZ,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS;IAS7B;;;;;;;OAOG;IAEI,oBAAoB,CACzB,MAAM,EAAE,YAAY,GACnB,QAAQ,CAAC,WAAW,CAAC,GAAG,SAAS;CAGrC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local __TS__Class = ____lualib.__TS__Class
|
|
5
|
+
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
6
|
+
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
|
|
7
|
+
local ____exports = {}
|
|
8
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
|
+
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
10
|
+
local ____decorators = require("src.decorators")
|
|
11
|
+
local Exported = ____decorators.Exported
|
|
12
|
+
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
13
|
+
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
14
|
+
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
15
|
+
local ____playerHealth = require("src.functions.playerHealth")
|
|
16
|
+
local getPlayerHealth = ____playerHealth.getPlayerHealth
|
|
17
|
+
local ____players = require("src.functions.players")
|
|
18
|
+
local isEden = ____players.isEden
|
|
19
|
+
local ____stats = require("src.functions.stats")
|
|
20
|
+
local getPlayerStats = ____stats.getPlayerStats
|
|
21
|
+
local ____Feature = require("src.classes.private.Feature")
|
|
22
|
+
local Feature = ____Feature.Feature
|
|
23
|
+
local v = {run = {
|
|
24
|
+
edenPlayerStats = __TS__New(Map),
|
|
25
|
+
edenPlayerHealth = __TS__New(Map)
|
|
26
|
+
}}
|
|
27
|
+
____exports.EdenStartingStatsHealth = __TS__Class()
|
|
28
|
+
local EdenStartingStatsHealth = ____exports.EdenStartingStatsHealth
|
|
29
|
+
EdenStartingStatsHealth.name = "EdenStartingStatsHealth"
|
|
30
|
+
__TS__ClassExtends(EdenStartingStatsHealth, Feature)
|
|
31
|
+
function EdenStartingStatsHealth.prototype.____constructor(self)
|
|
32
|
+
Feature.prototype.____constructor(self)
|
|
33
|
+
self.v = v
|
|
34
|
+
self.postPlayerInit = function(____, player)
|
|
35
|
+
if not isEden(nil, player) then
|
|
36
|
+
return
|
|
37
|
+
end
|
|
38
|
+
self:getEdenStats(player)
|
|
39
|
+
self:getEdenHealth(player)
|
|
40
|
+
end
|
|
41
|
+
self.callbacksUsed = {{ModCallback.POST_PLAYER_INIT, self.postPlayerInit}}
|
|
42
|
+
end
|
|
43
|
+
function EdenStartingStatsHealth.prototype.getEdenStats(self, player)
|
|
44
|
+
local existingStatMap = mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
45
|
+
if existingStatMap ~= nil then
|
|
46
|
+
return
|
|
47
|
+
end
|
|
48
|
+
local playerStats = getPlayerStats(nil, player)
|
|
49
|
+
mapSetPlayer(nil, v.run.edenPlayerStats, player, playerStats)
|
|
50
|
+
end
|
|
51
|
+
function EdenStartingStatsHealth.prototype.getEdenHealth(self, player)
|
|
52
|
+
local existingHealthMap = mapGetPlayer(nil, v.run.edenPlayerHealth, player)
|
|
53
|
+
if existingHealthMap ~= nil then
|
|
54
|
+
return
|
|
55
|
+
end
|
|
56
|
+
local playerHealth = getPlayerHealth(nil, player)
|
|
57
|
+
mapSetPlayer(nil, v.run.edenPlayerHealth, player, playerHealth)
|
|
58
|
+
end
|
|
59
|
+
function EdenStartingStatsHealth.prototype.getEdenStartingHealth(self, player)
|
|
60
|
+
return mapGetPlayer(nil, v.run.edenPlayerHealth, player)
|
|
61
|
+
end
|
|
62
|
+
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingHealth", true)
|
|
63
|
+
function EdenStartingStatsHealth.prototype.getEdenStartingStat(self, player, playerStat)
|
|
64
|
+
local playerStats = mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
65
|
+
if playerStats == nil then
|
|
66
|
+
return nil
|
|
67
|
+
end
|
|
68
|
+
return playerStats[playerStat]
|
|
69
|
+
end
|
|
70
|
+
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingStat", true)
|
|
71
|
+
function EdenStartingStatsHealth.prototype.getEdenStartingStats(self, player)
|
|
72
|
+
return mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
73
|
+
end
|
|
74
|
+
__TS__DecorateLegacy({Exported}, EdenStartingStatsHealth.prototype, "getEdenStartingStats", true)
|
|
75
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISCFeature.d.ts","sourceRoot":"","sources":["../../../src/enums/ISCFeature.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAEpB,aAAa,IAAA;IACb,iBAAiB,IAAA;IACjB,cAAc,IAAA;IACd,+BAA+B,IAAA;IAC/B,4BAA4B,IAAA;IAC5B,4BAA4B,IAAA;IAC5B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,uBAAuB,IAAA;IACvB,4BAA4B,IAAA;IAC5B,0BAA0B,KAAA;IAC1B,wBAAwB,KAAA;IACxB,qBAAqB,KAAA;IACrB,qBAAqB,KAAA;IAGrB,2BAA2B,KAAA;IAC3B,eAAe,KAAA;IACf,0BAA0B,KAAA;IAC1B,oBAAoB,KAAA;IACpB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,cAAc,KAAA;IACd,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,
|
|
1
|
+
{"version":3,"file":"ISCFeature.d.ts","sourceRoot":"","sources":["../../../src/enums/ISCFeature.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAEpB,aAAa,IAAA;IACb,iBAAiB,IAAA;IACjB,cAAc,IAAA;IACd,+BAA+B,IAAA;IAC/B,4BAA4B,IAAA;IAC5B,4BAA4B,IAAA;IAC5B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,uBAAuB,IAAA;IACvB,4BAA4B,IAAA;IAC5B,0BAA0B,KAAA;IAC1B,wBAAwB,KAAA;IACxB,qBAAqB,KAAA;IACrB,qBAAqB,KAAA;IAGrB,2BAA2B,KAAA;IAC3B,eAAe,KAAA;IACf,0BAA0B,KAAA;IAC1B,oBAAoB,KAAA;IACpB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,cAAc,KAAA;IACd,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,0BAA0B,KAAA;IAC1B,eAAe,KAAA;IACf,UAAU,KAAA;IACV,gBAAgB,KAAA;IAChB,gBAAgB,KAAA;IAChB,sBAAsB,KAAA;IACtB,mBAAmB,KAAA;IACnB,wBAAwB,KAAA;IACxB,mBAAmB,KAAA;IACnB,cAAc,KAAA;IACd,KAAK,KAAA;IACL,mBAAmB,KAAA;IACnB,qBAAqB,KAAA;IACrB,2BAA2B,KAAA;IAC3B,cAAc,KAAA;IACd,WAAW,KAAA;IACX,sBAAsB,KAAA;IACtB,4BAA4B,KAAA;IAC5B,2BAA2B,KAAA;IAC3B,gBAAgB,KAAA;IAChB,YAAY,KAAA;IACZ,eAAe,KAAA;IACf,aAAa,KAAA;IACb,iBAAiB,KAAA;IACjB,sBAAsB,KAAA;IACtB,iBAAiB,KAAA;IACjB,aAAa,KAAA;IACb,YAAY,KAAA;IACZ,uBAAuB,KAAA;CACxB"}
|
|
@@ -54,8 +54,8 @@ ____exports.ISCFeature.DISABLE_ALL_SOUND = 25
|
|
|
54
54
|
____exports.ISCFeature[____exports.ISCFeature.DISABLE_ALL_SOUND] = "DISABLE_ALL_SOUND"
|
|
55
55
|
____exports.ISCFeature.DISABLE_INPUTS = 26
|
|
56
56
|
____exports.ISCFeature[____exports.ISCFeature.DISABLE_INPUTS] = "DISABLE_INPUTS"
|
|
57
|
-
____exports.ISCFeature.
|
|
58
|
-
____exports.ISCFeature[____exports.ISCFeature.
|
|
57
|
+
____exports.ISCFeature.EDEN_STARTING_STATS_HEALTH = 27
|
|
58
|
+
____exports.ISCFeature[____exports.ISCFeature.EDEN_STARTING_STATS_HEALTH] = "EDEN_STARTING_STATS_HEALTH"
|
|
59
59
|
____exports.ISCFeature.FADE_IN_REMOVER = 28
|
|
60
60
|
____exports.ISCFeature[____exports.ISCFeature.FADE_IN_REMOVER] = "FADE_IN_REMOVER"
|
|
61
61
|
____exports.ISCFeature.FAST_RESET = 29
|
package/dist/src/features.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { DebugDisplay } from "./classes/features/other/DebugDisplay";
|
|
|
26
26
|
import { DeployJSONRoom } from "./classes/features/other/DeployJSONRoom";
|
|
27
27
|
import { DisableAllSound } from "./classes/features/other/DisableAllSound";
|
|
28
28
|
import { DisableInputs } from "./classes/features/other/DisableInputs";
|
|
29
|
-
import {
|
|
29
|
+
import { EdenStartingStatsHealth } from "./classes/features/other/EdenStartingStatsHealth";
|
|
30
30
|
import { ExtraConsoleCommands } from "./classes/features/other/ExtraConsoleCommands";
|
|
31
31
|
import { FadeInRemover } from "./classes/features/other/FadeInRemover";
|
|
32
32
|
import { FastReset } from "./classes/features/other/FastReset";
|
|
@@ -85,7 +85,7 @@ export interface ISCFeatureToClass {
|
|
|
85
85
|
[ISCFeature.DEPLOY_JSON_ROOM]: DeployJSONRoom;
|
|
86
86
|
[ISCFeature.DISABLE_ALL_SOUND]: DisableAllSound;
|
|
87
87
|
[ISCFeature.DISABLE_INPUTS]: DisableInputs;
|
|
88
|
-
[ISCFeature.
|
|
88
|
+
[ISCFeature.EDEN_STARTING_STATS_HEALTH]: EdenStartingStatsHealth;
|
|
89
89
|
[ISCFeature.FADE_IN_REMOVER]: FadeInRemover;
|
|
90
90
|
[ISCFeature.FAST_RESET]: FastReset;
|
|
91
91
|
[ISCFeature.FLYING_DETECTION]: FlyingDetection;
|
|
@@ -143,7 +143,7 @@ export declare function getFeatures(mod: ModUpgradedInterface, callbacks: ModCal
|
|
|
143
143
|
readonly 24: DeployJSONRoom;
|
|
144
144
|
readonly 25: DisableAllSound;
|
|
145
145
|
readonly 26: DisableInputs;
|
|
146
|
-
readonly 27:
|
|
146
|
+
readonly 27: EdenStartingStatsHealth;
|
|
147
147
|
readonly 28: FadeInRemover;
|
|
148
148
|
readonly 29: FastReset;
|
|
149
149
|
readonly 30: FlyingDetection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+DAA+D,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AACzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,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CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACrC,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,oBAAoB,CAAC;IAC1D,CAAC,UAAU,CAAC,4BAA4B,CAAC,EAAE,0BAA0B,CAAC;IACtE,CAAC,UAAU,CAAC,2BAA2B,CAAC,EAAE,wBAAwB,CAAC;IACnE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,cAAc,CAAC;IAC9C,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC;IACvC,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,YAAY,CAAC;IAC3C,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,WAAW,CAAC;IACxC,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,eAAe,CAAC;IAChD,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,mBAAmB,CAAC;IACzD,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACjD,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACzC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC;IACvC,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,qBAAqB,CAAC;CAC7D;AAKD,wBAAgB,WAAW,CACzB,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoLpC"}
|
package/dist/src/features.lua
CHANGED
|
@@ -55,8 +55,8 @@ local ____DisableAllSound = require("src.classes.features.other.DisableAllSound"
|
|
|
55
55
|
local DisableAllSound = ____DisableAllSound.DisableAllSound
|
|
56
56
|
local ____DisableInputs = require("src.classes.features.other.DisableInputs")
|
|
57
57
|
local DisableInputs = ____DisableInputs.DisableInputs
|
|
58
|
-
local
|
|
59
|
-
local
|
|
58
|
+
local ____EdenStartingStatsHealth = require("src.classes.features.other.EdenStartingStatsHealth")
|
|
59
|
+
local EdenStartingStatsHealth = ____EdenStartingStatsHealth.EdenStartingStatsHealth
|
|
60
60
|
local ____ExtraConsoleCommands = require("src.classes.features.other.ExtraConsoleCommands")
|
|
61
61
|
local ExtraConsoleCommands = ____ExtraConsoleCommands.ExtraConsoleCommands
|
|
62
62
|
local ____FadeInRemover = require("src.classes.features.other.FadeInRemover")
|
|
@@ -212,7 +212,7 @@ function ____exports.getFeatures(self, mod, callbacks)
|
|
|
212
212
|
[ISCFeature.DEPLOY_JSON_ROOM] = __TS__New(DeployJSONRoom, preventGridEntityRespawn, spawnCollectible),
|
|
213
213
|
[ISCFeature.DISABLE_ALL_SOUND] = disableAllSound,
|
|
214
214
|
[ISCFeature.DISABLE_INPUTS] = disableInputs,
|
|
215
|
-
[ISCFeature.
|
|
215
|
+
[ISCFeature.EDEN_STARTING_STATS_HEALTH] = __TS__New(EdenStartingStatsHealth),
|
|
216
216
|
[ISCFeature.FADE_IN_REMOVER] = __TS__New(FadeInRemover),
|
|
217
217
|
[ISCFeature.FAST_RESET] = __TS__New(FastReset),
|
|
218
218
|
[ISCFeature.FLYING_DETECTION] = __TS__New(FlyingDetection, moddedElementSets),
|
|
@@ -37,6 +37,7 @@ export declare function lerp(a: number, b: number, pos: float): number;
|
|
|
37
37
|
export declare function lerpAngleDegrees(aStart: number, aEnd: number, percent: float): number;
|
|
38
38
|
/**
|
|
39
39
|
* If rounding fails, this function returns 0.
|
|
40
|
+
*
|
|
40
41
|
* From: http://lua-users.org/wiki/SimpleRound
|
|
41
42
|
*
|
|
42
43
|
* @param num The number to round.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../src/functions/math.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,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aStart, aEnd) * percent
|
|
88
88
|
end
|
|
89
89
|
--- If rounding fails, this function returns 0.
|
|
90
|
+
--
|
|
90
91
|
-- From: http://lua-users.org/wiki/SimpleRound
|
|
91
92
|
--
|
|
92
93
|
-- @param num The number to round.
|
|
@@ -59,7 +59,7 @@ export declare function getPlayerBlackHearts(player: EntityPlayer): int;
|
|
|
59
59
|
*
|
|
60
60
|
* This is based on the `REVEL.StoreHealth` function in the Revelations mod.
|
|
61
61
|
*/
|
|
62
|
-
export declare function getPlayerHealth(player: EntityPlayer): PlayerHealth
|
|
62
|
+
export declare function getPlayerHealth(player: EntityPlayer): Readonly<PlayerHealth>;
|
|
63
63
|
export declare function getPlayerHealthType(player: EntityPlayer, healthType: HealthType): int;
|
|
64
64
|
/**
|
|
65
65
|
* Returns the number of red hearts that the player has, excluding any rotten hearts. For example,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAQ9E,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,GAAG,GACb,IAAI,CA+CN;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAYtE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAA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BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAqCrE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,YAAY,GACnB,GAAG,CAML;AAED,sDAAsD;AACtD,wBAAgB,eAAe,IAAI,YAAY,CAc9C;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAcN;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAcN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAwBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,YAAY,GACzB,IAAI,CAyHN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
|
+
local __TS__ObjectAssign = ____lualib.__TS__ObjectAssign
|
|
3
4
|
local __TS__ArrayEntries = ____lualib.__TS__ArrayEntries
|
|
4
5
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
6
|
local ____exports = {}
|
|
@@ -526,22 +527,24 @@ end
|
|
|
526
527
|
function ____exports.playerConvertBlackHeartsToSoulHearts(self, player)
|
|
527
528
|
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
528
529
|
____exports.removeAllPlayerHealth(nil, player)
|
|
529
|
-
|
|
530
|
+
local newSoulHeartTypes = __TS__ArrayMap(
|
|
530
531
|
playerHealth.soulHeartTypes,
|
|
531
532
|
function(____, soulHeartType) return soulHeartType == HeartSubType.BLACK and HeartSubType.SOUL or soulHeartType end
|
|
532
533
|
)
|
|
533
|
-
|
|
534
|
+
local playerHealthWithSoulHearts = __TS__ObjectAssign({}, playerHealth, {soulHeartTypes = newSoulHeartTypes})
|
|
535
|
+
____exports.setPlayerHealth(nil, player, playerHealthWithSoulHearts)
|
|
534
536
|
end
|
|
535
537
|
--- Helper function to remove all of a player's soul hearts and add the corresponding amount of black
|
|
536
538
|
-- hearts.
|
|
537
539
|
function ____exports.playerConvertSoulHeartsToBlackHearts(self, player)
|
|
538
540
|
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
539
541
|
____exports.removeAllPlayerHealth(nil, player)
|
|
540
|
-
|
|
542
|
+
local newSoulHeartTypes = __TS__ArrayMap(
|
|
541
543
|
playerHealth.soulHeartTypes,
|
|
542
544
|
function(____, soulHeartType) return soulHeartType == HeartSubType.SOUL and HeartSubType.BLACK or soulHeartType end
|
|
543
545
|
)
|
|
544
|
-
|
|
546
|
+
local playerHealthWithBlackHearts = __TS__ObjectAssign({}, playerHealth, {soulHeartTypes = newSoulHeartTypes})
|
|
547
|
+
____exports.setPlayerHealth(nil, player, playerHealthWithBlackHearts)
|
|
545
548
|
end
|
|
546
549
|
--- Helper function to see if the player is out of health.
|
|
547
550
|
--
|
package/package.json
CHANGED
|
@@ -5,8 +5,10 @@ import {
|
|
|
5
5
|
mapGetPlayer,
|
|
6
6
|
mapSetPlayer,
|
|
7
7
|
} from "../../../functions/playerDataStructures";
|
|
8
|
+
import { getPlayerHealth } from "../../../functions/playerHealth";
|
|
8
9
|
import { isEden } from "../../../functions/players";
|
|
9
10
|
import { getPlayerStats } from "../../../functions/stats";
|
|
11
|
+
import type { PlayerHealth } from "../../../interfaces/PlayerHealth";
|
|
10
12
|
import type { PlayerStats } from "../../../interfaces/PlayerStats";
|
|
11
13
|
import type { PlayerIndex } from "../../../types/PlayerIndex";
|
|
12
14
|
import { Feature } from "../../private/Feature";
|
|
@@ -14,10 +16,11 @@ import { Feature } from "../../private/Feature";
|
|
|
14
16
|
const v = {
|
|
15
17
|
run: {
|
|
16
18
|
edenPlayerStats: new Map<PlayerIndex, PlayerStats>(),
|
|
19
|
+
edenPlayerHealth: new Map<PlayerIndex, PlayerHealth>(),
|
|
17
20
|
},
|
|
18
21
|
};
|
|
19
22
|
|
|
20
|
-
export class
|
|
23
|
+
export class EdenStartingStatsHealth extends Feature {
|
|
21
24
|
/** @internal */
|
|
22
25
|
public override v = v;
|
|
23
26
|
|
|
@@ -40,6 +43,11 @@ export class EdenStartingStats extends Feature {
|
|
|
40
43
|
return;
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
this.getEdenStats(player);
|
|
47
|
+
this.getEdenHealth(player);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
private getEdenStats(player: EntityPlayer): void {
|
|
43
51
|
const existingStatMap = mapGetPlayer(v.run.edenPlayerStats, player);
|
|
44
52
|
if (existingStatMap !== undefined) {
|
|
45
53
|
return;
|
|
@@ -47,11 +55,36 @@ export class EdenStartingStats extends Feature {
|
|
|
47
55
|
|
|
48
56
|
const playerStats = getPlayerStats(player);
|
|
49
57
|
mapSetPlayer(v.run.edenPlayerStats, player, playerStats);
|
|
50
|
-
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private getEdenHealth(player: EntityPlayer): void {
|
|
61
|
+
const existingHealthMap = mapGetPlayer(v.run.edenPlayerHealth, player);
|
|
62
|
+
if (existingHealthMap !== undefined) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const playerHealth = getPlayerHealth(player);
|
|
67
|
+
mapSetPlayer(v.run.edenPlayerHealth, player, playerHealth);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Helper function to get the health that Eden started with at the beginning of the run before any
|
|
72
|
+
* of the random collectibles were added.
|
|
73
|
+
*
|
|
74
|
+
* Returns undefined if passed a player that is not Eden.
|
|
75
|
+
*
|
|
76
|
+
* In order to use this function, you must upgrade your mod with `ISCFeature.EDEN_STARTING_STATS`.
|
|
77
|
+
*/
|
|
78
|
+
@Exported
|
|
79
|
+
public getEdenStartingHealth(
|
|
80
|
+
player: EntityPlayer,
|
|
81
|
+
): Readonly<PlayerHealth> | undefined {
|
|
82
|
+
return mapGetPlayer(v.run.edenPlayerHealth, player);
|
|
83
|
+
}
|
|
51
84
|
|
|
52
85
|
/**
|
|
53
|
-
* Helper function to get the value of the randomized starting stat for Eden
|
|
54
|
-
*
|
|
86
|
+
* Helper function to get the value of the randomized starting stat for Eden that was assigned at
|
|
87
|
+
* the beginning of the run before any of the random collectibles were added.
|
|
55
88
|
*
|
|
56
89
|
* Returns undefined if passed a player that is not Eden.
|
|
57
90
|
*
|
|
@@ -72,7 +105,7 @@ export class EdenStartingStats extends Feature {
|
|
|
72
105
|
|
|
73
106
|
/**
|
|
74
107
|
* Helper function to get all of the stat values that Eden started with at the beginning of the
|
|
75
|
-
* run.
|
|
108
|
+
* run before any of the random collectibles were added.
|
|
76
109
|
*
|
|
77
110
|
* Returns undefined if passed a player that is not Eden.
|
|
78
111
|
*
|
package/src/enums/ISCFeature.ts
CHANGED
package/src/features.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { DebugDisplay } from "./classes/features/other/DebugDisplay";
|
|
|
26
26
|
import { DeployJSONRoom } from "./classes/features/other/DeployJSONRoom";
|
|
27
27
|
import { DisableAllSound } from "./classes/features/other/DisableAllSound";
|
|
28
28
|
import { DisableInputs } from "./classes/features/other/DisableInputs";
|
|
29
|
-
import {
|
|
29
|
+
import { EdenStartingStatsHealth } from "./classes/features/other/EdenStartingStatsHealth";
|
|
30
30
|
import { ExtraConsoleCommands } from "./classes/features/other/ExtraConsoleCommands";
|
|
31
31
|
import { FadeInRemover } from "./classes/features/other/FadeInRemover";
|
|
32
32
|
import { FastReset } from "./classes/features/other/FastReset";
|
|
@@ -92,7 +92,7 @@ export interface ISCFeatureToClass {
|
|
|
92
92
|
[ISCFeature.DEPLOY_JSON_ROOM]: DeployJSONRoom;
|
|
93
93
|
[ISCFeature.DISABLE_ALL_SOUND]: DisableAllSound;
|
|
94
94
|
[ISCFeature.DISABLE_INPUTS]: DisableInputs;
|
|
95
|
-
[ISCFeature.
|
|
95
|
+
[ISCFeature.EDEN_STARTING_STATS_HEALTH]: EdenStartingStatsHealth;
|
|
96
96
|
[ISCFeature.FADE_IN_REMOVER]: FadeInRemover;
|
|
97
97
|
[ISCFeature.FAST_RESET]: FastReset;
|
|
98
98
|
[ISCFeature.FLYING_DETECTION]: FlyingDetection;
|
|
@@ -274,7 +274,7 @@ export function getFeatures(
|
|
|
274
274
|
),
|
|
275
275
|
[ISCFeature.DISABLE_ALL_SOUND]: disableAllSound,
|
|
276
276
|
[ISCFeature.DISABLE_INPUTS]: disableInputs,
|
|
277
|
-
[ISCFeature.
|
|
277
|
+
[ISCFeature.EDEN_STARTING_STATS_HEALTH]: new EdenStartingStatsHealth(),
|
|
278
278
|
[ISCFeature.FADE_IN_REMOVER]: new FadeInRemover(),
|
|
279
279
|
[ISCFeature.FAST_RESET]: new FastReset(),
|
|
280
280
|
[ISCFeature.FLYING_DETECTION]: new FlyingDetection(moddedElementSets),
|
package/src/functions/math.ts
CHANGED
|
@@ -162,7 +162,7 @@ export function getPlayerBlackHearts(player: EntityPlayer): int {
|
|
|
162
162
|
*
|
|
163
163
|
* This is based on the `REVEL.StoreHealth` function in the Revelations mod.
|
|
164
164
|
*/
|
|
165
|
-
export function getPlayerHealth(player: EntityPlayer): PlayerHealth {
|
|
165
|
+
export function getPlayerHealth(player: EntityPlayer): Readonly<PlayerHealth> {
|
|
166
166
|
const character = player.GetPlayerType();
|
|
167
167
|
let maxHearts = player.GetMaxHearts();
|
|
168
168
|
let hearts = getPlayerHearts(player); // We use the helper function to remove rotten hearts
|
|
@@ -474,11 +474,17 @@ export function playerConvertBlackHeartsToSoulHearts(
|
|
|
474
474
|
): void {
|
|
475
475
|
const playerHealth = getPlayerHealth(player);
|
|
476
476
|
removeAllPlayerHealth(player);
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
477
|
+
|
|
478
|
+
const newSoulHeartTypes = playerHealth.soulHeartTypes.map((soulHeartType) =>
|
|
479
|
+
soulHeartType === HeartSubType.BLACK ? HeartSubType.SOUL : soulHeartType,
|
|
480
480
|
);
|
|
481
|
-
|
|
481
|
+
|
|
482
|
+
const playerHealthWithSoulHearts = {
|
|
483
|
+
...playerHealth,
|
|
484
|
+
soulHeartTypes: newSoulHeartTypes,
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
setPlayerHealth(player, playerHealthWithSoulHearts);
|
|
482
488
|
}
|
|
483
489
|
|
|
484
490
|
/**
|
|
@@ -490,11 +496,17 @@ export function playerConvertSoulHeartsToBlackHearts(
|
|
|
490
496
|
): void {
|
|
491
497
|
const playerHealth = getPlayerHealth(player);
|
|
492
498
|
removeAllPlayerHealth(player);
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
499
|
+
|
|
500
|
+
const newSoulHeartTypes = playerHealth.soulHeartTypes.map((soulHeartType) =>
|
|
501
|
+
soulHeartType === HeartSubType.SOUL ? HeartSubType.BLACK : soulHeartType,
|
|
496
502
|
);
|
|
497
|
-
|
|
503
|
+
|
|
504
|
+
const playerHealthWithBlackHearts = {
|
|
505
|
+
...playerHealth,
|
|
506
|
+
soulHeartTypes: newSoulHeartTypes,
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
setPlayerHealth(player, playerHealthWithBlackHearts);
|
|
498
510
|
}
|
|
499
511
|
|
|
500
512
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EdenStartingStats.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/EdenStartingStats.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAO5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,iBAAkB,SAAQ,OAAO;IAc5C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAY7B;IAEF;;;;;;;OAOG;IAEI,mBAAmB,CAAC,CAAC,SAAS,UAAU,EAC7C,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,CAAC,GACZ,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS;IAS7B;;;;;;;OAOG;IAEI,oBAAoB,CACzB,MAAM,EAAE,YAAY,GACnB,QAAQ,CAAC,WAAW,CAAC,GAAG,SAAS;CAGrC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Map = ____lualib.Map
|
|
3
|
-
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local __TS__Class = ____lualib.__TS__Class
|
|
5
|
-
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
6
|
-
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
|
|
7
|
-
local ____exports = {}
|
|
8
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
|
-
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
10
|
-
local ____decorators = require("src.decorators")
|
|
11
|
-
local Exported = ____decorators.Exported
|
|
12
|
-
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
13
|
-
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
14
|
-
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
15
|
-
local ____players = require("src.functions.players")
|
|
16
|
-
local isEden = ____players.isEden
|
|
17
|
-
local ____stats = require("src.functions.stats")
|
|
18
|
-
local getPlayerStats = ____stats.getPlayerStats
|
|
19
|
-
local ____Feature = require("src.classes.private.Feature")
|
|
20
|
-
local Feature = ____Feature.Feature
|
|
21
|
-
local v = {run = {edenPlayerStats = __TS__New(Map)}}
|
|
22
|
-
____exports.EdenStartingStats = __TS__Class()
|
|
23
|
-
local EdenStartingStats = ____exports.EdenStartingStats
|
|
24
|
-
EdenStartingStats.name = "EdenStartingStats"
|
|
25
|
-
__TS__ClassExtends(EdenStartingStats, Feature)
|
|
26
|
-
function EdenStartingStats.prototype.____constructor(self)
|
|
27
|
-
Feature.prototype.____constructor(self)
|
|
28
|
-
self.v = v
|
|
29
|
-
self.postPlayerInit = function(____, player)
|
|
30
|
-
if not isEden(nil, player) then
|
|
31
|
-
return
|
|
32
|
-
end
|
|
33
|
-
local existingStatMap = mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
34
|
-
if existingStatMap ~= nil then
|
|
35
|
-
return
|
|
36
|
-
end
|
|
37
|
-
local playerStats = getPlayerStats(nil, player)
|
|
38
|
-
mapSetPlayer(nil, v.run.edenPlayerStats, player, playerStats)
|
|
39
|
-
end
|
|
40
|
-
self.callbacksUsed = {{ModCallback.POST_PLAYER_INIT, self.postPlayerInit}}
|
|
41
|
-
end
|
|
42
|
-
function EdenStartingStats.prototype.getEdenStartingStat(self, player, playerStat)
|
|
43
|
-
local playerStats = mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
44
|
-
if playerStats == nil then
|
|
45
|
-
return nil
|
|
46
|
-
end
|
|
47
|
-
return playerStats[playerStat]
|
|
48
|
-
end
|
|
49
|
-
__TS__DecorateLegacy({Exported}, EdenStartingStats.prototype, "getEdenStartingStat", true)
|
|
50
|
-
function EdenStartingStats.prototype.getEdenStartingStats(self, player)
|
|
51
|
-
return mapGetPlayer(nil, v.run.edenPlayerStats, player)
|
|
52
|
-
end
|
|
53
|
-
__TS__DecorateLegacy({Exported}, EdenStartingStats.prototype, "getEdenStartingStats", true)
|
|
54
|
-
return ____exports
|