isaacscript-common 16.1.6 → 16.1.7
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 16.1.
|
|
3
|
+
isaacscript-common 16.1.7
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -24954,11 +24954,11 @@ function ____exports.findFreePosition(self, startingPosition, avoidActiveEntitie
|
|
|
24954
24954
|
local room = game:GetRoom()
|
|
24955
24955
|
local heavenDoors = getEffects(nil, EffectVariant.HEAVEN_LIGHT_DOOR, HeavenLightDoorSubType.HEAVEN_DOOR)
|
|
24956
24956
|
do
|
|
24957
|
-
local
|
|
24958
|
-
while
|
|
24957
|
+
local initialStep = 0
|
|
24958
|
+
while initialStep < MAX_FIND_FREE_POSITION_ATTEMPTS do
|
|
24959
24959
|
do
|
|
24960
|
-
local position = room:FindFreePickupSpawnPosition(startingPosition,
|
|
24961
|
-
local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE)
|
|
24960
|
+
local position = room:FindFreePickupSpawnPosition(startingPosition, initialStep, avoidActiveEntities)
|
|
24961
|
+
local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE * 1.5)
|
|
24962
24962
|
if closePlayer ~= nil then
|
|
24963
24963
|
goto __continue7
|
|
24964
24964
|
end
|
|
@@ -24975,7 +24975,7 @@ function ____exports.findFreePosition(self, startingPosition, avoidActiveEntitie
|
|
|
24975
24975
|
return position
|
|
24976
24976
|
end
|
|
24977
24977
|
::__continue7::
|
|
24978
|
-
|
|
24978
|
+
initialStep = initialStep + 1
|
|
24979
24979
|
end
|
|
24980
24980
|
end
|
|
24981
24981
|
return room:FindFreePickupSpawnPosition(startingPosition)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionVelocity.d.ts","sourceRoot":"","sources":["../../../src/functions/positionVelocity.ts"],"names":[],"mappings":";;;;AAaA,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,GAAG,GACZ,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,KAAK,GACd,OAAO,CAKT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,UAAQ,EAC3B,eAAe,CAAC,EAAE,KAAK,GACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"positionVelocity.d.ts","sourceRoot":"","sources":["../../../src/functions/positionVelocity.ts"],"names":[],"mappings":";;;;AAaA,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,GAAG,GACZ,OAAO,CAIT;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,KAAK,GACd,OAAO,CAKT;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,MAAM,EACxB,mBAAmB,UAAQ,EAC3B,eAAe,CAAC,EAAE,KAAK,GACtB,MAAM,CA8CR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAY5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAY7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,IAAI,CAYN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,gBAAgB,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,EACtC,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,IAAI,CAYN"}
|
|
@@ -58,7 +58,7 @@ function ____exports.findFreePosition(self, startingPosition, avoidActiveEntitie
|
|
|
58
58
|
while i < MAX_FIND_FREE_POSITION_ATTEMPTS do
|
|
59
59
|
do
|
|
60
60
|
local position = room:FindFreePickupSpawnPosition(startingPosition, i, avoidActiveEntities)
|
|
61
|
-
local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE)
|
|
61
|
+
local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE * 1.5)
|
|
62
62
|
if closePlayer ~= nil then
|
|
63
63
|
goto __continue7
|
|
64
64
|
end
|
package/package.json
CHANGED
|
@@ -61,14 +61,24 @@ export function findFreePosition(
|
|
|
61
61
|
HeavenLightDoorSubType.HEAVEN_DOOR,
|
|
62
62
|
);
|
|
63
63
|
|
|
64
|
-
for (
|
|
64
|
+
for (
|
|
65
|
+
let initialStep = 0;
|
|
66
|
+
initialStep < MAX_FIND_FREE_POSITION_ATTEMPTS;
|
|
67
|
+
initialStep++
|
|
68
|
+
) {
|
|
65
69
|
const position = room.FindFreePickupSpawnPosition(
|
|
66
70
|
startingPosition,
|
|
67
|
-
|
|
71
|
+
initialStep,
|
|
68
72
|
avoidActiveEntities,
|
|
69
73
|
);
|
|
70
74
|
|
|
71
|
-
const closePlayer = getPlayerCloserThan(
|
|
75
|
+
const closePlayer = getPlayerCloserThan(
|
|
76
|
+
position,
|
|
77
|
+
// If we use a multiplier of 1.0, certain enemies might spawn directly next to a player, which
|
|
78
|
+
// is not technically unavoidable damage, but still a little bit unfair. Thus, we use a
|
|
79
|
+
// multiplier of 1.5.
|
|
80
|
+
DISTANCE_OF_GRID_TILE * 1.5,
|
|
81
|
+
);
|
|
72
82
|
if (closePlayer !== undefined) {
|
|
73
83
|
continue;
|
|
74
84
|
}
|