isaacscript-common 19.1.0 → 19.1.1
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.d.ts
CHANGED
|
@@ -11451,8 +11451,10 @@ export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
|
|
|
11451
11451
|
* If there is more than one player, they will be distributed around the center in a circle.
|
|
11452
11452
|
*
|
|
11453
11453
|
* This function emulates what happens in the vanilla game when you travel to a new floor.
|
|
11454
|
+
*
|
|
11455
|
+
* @param radius Optional. The radius of the circle. Default is 10.
|
|
11454
11456
|
*/
|
|
11455
|
-
export declare function movePlayersToCenter(): void;
|
|
11457
|
+
export declare function movePlayersToCenter(radius?: float): void;
|
|
11456
11458
|
|
|
11457
11459
|
/**
|
|
11458
11460
|
* A cached version of the class returned from the `MusicManager()` constructor.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 19.1.
|
|
3
|
+
isaacscript-common 19.1.1
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -38046,8 +38046,10 @@ function movePlayerAndTheirFamiliars(self, player, position)
|
|
|
38046
38046
|
familiar.Position = position
|
|
38047
38047
|
end
|
|
38048
38048
|
end
|
|
38049
|
-
|
|
38050
|
-
|
|
38049
|
+
function ____exports.movePlayersToCenter(self, radius)
|
|
38050
|
+
if radius == nil then
|
|
38051
|
+
radius = 10
|
|
38052
|
+
end
|
|
38051
38053
|
local isGreedMode = game:IsGreedMode()
|
|
38052
38054
|
local startingPosition = isGreedMode and NEW_FLOOR_STARTING_POSITION_GREED_MODE or NEW_FLOOR_STARTING_POSITION_NORMAL_MODE
|
|
38053
38055
|
local players = getAllPlayers(nil)
|
|
@@ -38062,7 +38064,7 @@ function ____exports.movePlayersToCenter(self)
|
|
|
38062
38064
|
local circlePoints = getCircleDiscretizedPoints(
|
|
38063
38065
|
nil,
|
|
38064
38066
|
startingPosition,
|
|
38065
|
-
|
|
38067
|
+
radius,
|
|
38066
38068
|
#players,
|
|
38067
38069
|
1,
|
|
38068
38070
|
1,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
1
2
|
/**
|
|
2
3
|
* Helper function to move all of the players to where they would normally go when arriving at a new
|
|
3
4
|
* floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
|
|
@@ -6,6 +7,8 @@
|
|
|
6
7
|
* If there is more than one player, they will be distributed around the center in a circle.
|
|
7
8
|
*
|
|
8
9
|
* This function emulates what happens in the vanilla game when you travel to a new floor.
|
|
10
|
+
*
|
|
11
|
+
* @param radius Optional. The radius of the circle. Default is 10.
|
|
9
12
|
*/
|
|
10
|
-
export declare function movePlayersToCenter(): void;
|
|
13
|
+
export declare function movePlayersToCenter(radius?: float): void;
|
|
11
14
|
//# sourceMappingURL=playerCenter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerCenter.d.ts","sourceRoot":"","sources":["../../../src/functions/playerCenter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playerCenter.d.ts","sourceRoot":"","sources":["../../../src/functions/playerCenter.ts"],"names":[],"mappings":";AAUA;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,GAAE,KAAU,GAAG,IAAI,CAqC5D"}
|
|
@@ -20,7 +20,6 @@ function movePlayerAndTheirFamiliars(self, player, position)
|
|
|
20
20
|
familiar.Position = position
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
local CIRCLE_RADIUS_BETWEEN_PLAYERS = 50
|
|
24
23
|
--- Helper function to move all of the players to where they would normally go when arriving at a new
|
|
25
24
|
-- floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
|
|
26
25
|
-- door.)
|
|
@@ -28,7 +27,12 @@ local CIRCLE_RADIUS_BETWEEN_PLAYERS = 50
|
|
|
28
27
|
-- If there is more than one player, they will be distributed around the center in a circle.
|
|
29
28
|
--
|
|
30
29
|
-- This function emulates what happens in the vanilla game when you travel to a new floor.
|
|
31
|
-
|
|
30
|
+
--
|
|
31
|
+
-- @param radius Optional. The radius of the circle. Default is 10.
|
|
32
|
+
function ____exports.movePlayersToCenter(self, radius)
|
|
33
|
+
if radius == nil then
|
|
34
|
+
radius = 10
|
|
35
|
+
end
|
|
32
36
|
local isGreedMode = game:IsGreedMode()
|
|
33
37
|
local startingPosition = isGreedMode and NEW_FLOOR_STARTING_POSITION_GREED_MODE or NEW_FLOOR_STARTING_POSITION_NORMAL_MODE
|
|
34
38
|
local players = getAllPlayers(nil)
|
|
@@ -43,7 +47,7 @@ function ____exports.movePlayersToCenter(self)
|
|
|
43
47
|
local circlePoints = getCircleDiscretizedPoints(
|
|
44
48
|
nil,
|
|
45
49
|
startingPosition,
|
|
46
|
-
|
|
50
|
+
radius,
|
|
47
51
|
#players,
|
|
48
52
|
1,
|
|
49
53
|
1,
|
package/package.json
CHANGED
|
@@ -8,8 +8,6 @@ import { getPlayerFamiliars } from "./familiars";
|
|
|
8
8
|
import { getCircleDiscretizedPoints } from "./math";
|
|
9
9
|
import { getAllPlayers } from "./playerIndex";
|
|
10
10
|
|
|
11
|
-
const CIRCLE_RADIUS_BETWEEN_PLAYERS = 50;
|
|
12
|
-
|
|
13
11
|
/**
|
|
14
12
|
* Helper function to move all of the players to where they would normally go when arriving at a new
|
|
15
13
|
* floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
|
|
@@ -18,8 +16,10 @@ const CIRCLE_RADIUS_BETWEEN_PLAYERS = 50;
|
|
|
18
16
|
* If there is more than one player, they will be distributed around the center in a circle.
|
|
19
17
|
*
|
|
20
18
|
* This function emulates what happens in the vanilla game when you travel to a new floor.
|
|
19
|
+
*
|
|
20
|
+
* @param radius Optional. The radius of the circle. Default is 10.
|
|
21
21
|
*/
|
|
22
|
-
export function movePlayersToCenter(): void {
|
|
22
|
+
export function movePlayersToCenter(radius: float = 10): void {
|
|
23
23
|
const isGreedMode = game.IsGreedMode();
|
|
24
24
|
const startingPosition = isGreedMode
|
|
25
25
|
? NEW_FLOOR_STARTING_POSITION_GREED_MODE
|
|
@@ -41,7 +41,7 @@ export function movePlayersToCenter(): void {
|
|
|
41
41
|
// (This is what happens in vanilla.)
|
|
42
42
|
const circlePoints = getCircleDiscretizedPoints(
|
|
43
43
|
startingPosition,
|
|
44
|
-
|
|
44
|
+
radius,
|
|
45
45
|
players.length,
|
|
46
46
|
1,
|
|
47
47
|
1,
|