isaacscript-common 1.2.42 → 1.2.43
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/callbacks/postBoneSwing.d.ts +1 -0
- package/dist/callbacks/postBoneSwing.lua +40 -0
- package/dist/callbacks/subscriptions/postBoneSwing.d.ts +2 -0
- package/dist/callbacks/subscriptions/postBoneSwing.lua +18 -0
- package/dist/types/CallbackParametersCustom.d.ts +4 -0
- package/dist/types/ModCallbacksCustom.d.ts +2 -1
- package/dist/types/ModCallbacksCustom.lua +2 -0
- package/dist/types/ModUpgraded.lua +8 -0
- package/dist/upgradeMod.lua +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local Set = ____lualib.Set
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local Map = ____lualib.Map
|
|
6
|
+
local ____exports = {}
|
|
7
|
+
local hasSubscriptions, postKnifeRenderBoneClub, boneClubAnimationChanged, BONE_SWING_ANIMATIONS, v
|
|
8
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
9
|
+
local saveDataManager = ____exports.saveDataManager
|
|
10
|
+
local ____postBoneSwing = require("callbacks.subscriptions.postBoneSwing")
|
|
11
|
+
local postBoneSwingFire = ____postBoneSwing.postBoneSwingFire
|
|
12
|
+
local postBoneSwingHasSubscriptions = ____postBoneSwing.postBoneSwingHasSubscriptions
|
|
13
|
+
function hasSubscriptions(self)
|
|
14
|
+
return postBoneSwingHasSubscriptions(nil)
|
|
15
|
+
end
|
|
16
|
+
function postKnifeRenderBoneClub(self, boneClub)
|
|
17
|
+
if not hasSubscriptions(nil) then
|
|
18
|
+
return
|
|
19
|
+
end
|
|
20
|
+
local sprite = boneClub:GetSprite()
|
|
21
|
+
local animation = sprite:GetAnimation()
|
|
22
|
+
local ptrHash = GetPtrHash(boneClub)
|
|
23
|
+
local animationOnLastFrame = v.room.boneClubAnimations:get(ptrHash)
|
|
24
|
+
v.room.boneClubAnimations:set(ptrHash, animation)
|
|
25
|
+
if animationOnLastFrame ~= nil and animation ~= animationOnLastFrame then
|
|
26
|
+
boneClubAnimationChanged(nil, boneClub, animation)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
function boneClubAnimationChanged(self, boneClub, animation)
|
|
30
|
+
if BONE_SWING_ANIMATIONS:has(animation) then
|
|
31
|
+
postBoneSwingFire(nil, boneClub)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
BONE_SWING_ANIMATIONS = __TS__New(Set, {"Swing", "Swing2", "Spin"})
|
|
35
|
+
v = {room = {boneClubAnimations = __TS__New(Map)}}
|
|
36
|
+
function ____exports.postBoneSwingCallbackInit(self, mod)
|
|
37
|
+
saveDataManager(nil, "postBoneSwing", v, hasSubscriptions)
|
|
38
|
+
mod:AddCallback(ModCallbacks.MC_POST_KNIFE_RENDER, postKnifeRenderBoneClub, 1)
|
|
39
|
+
end
|
|
40
|
+
return ____exports
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local subscriptions = {}
|
|
6
|
+
function ____exports.postBoneSwingHasSubscriptions(self)
|
|
7
|
+
return #subscriptions > 0
|
|
8
|
+
end
|
|
9
|
+
function ____exports.postBoneSwingRegister(self, callback)
|
|
10
|
+
__TS__ArrayPush(subscriptions, {callback})
|
|
11
|
+
end
|
|
12
|
+
function ____exports.postBoneSwingFire(self, boneClub)
|
|
13
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
14
|
+
local callback = ____value[1]
|
|
15
|
+
callback(nil, boneClub)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
return ____exports
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
import { PostBombInitLateCallbackType } from "../callbacks/subscriptions/postBombInitLate";
|
|
3
|
+
import { PostBoneSwingCallbackType } from "../callbacks/subscriptions/postBoneSwing";
|
|
3
4
|
import { PostCursedTeleportCallbackType } from "../callbacks/subscriptions/postCursedTeleport";
|
|
4
5
|
import { PostCustomReviveCallbackType } from "../callbacks/subscriptions/postCustomRevive";
|
|
5
6
|
import { PostEffectInitLateCallbackType } from "../callbacks/subscriptions/postEffectInitLate";
|
|
@@ -212,4 +213,7 @@ export interface CallbackParametersCustom {
|
|
|
212
213
|
callback: PostGridEntityCollisionCallbackType,
|
|
213
214
|
gridEntityType?: GridEntityType
|
|
214
215
|
];
|
|
216
|
+
[ModCallbacksCustom.MC_POST_BONE_SWING]: [
|
|
217
|
+
callback: PostBoneSwingCallbackType
|
|
218
|
+
];
|
|
215
219
|
}
|
|
@@ -93,4 +93,6 @@ ____exports.ModCallbacksCustom.MC_POST_GRID_ENTITY_REMOVE = 44
|
|
|
93
93
|
____exports.ModCallbacksCustom[____exports.ModCallbacksCustom.MC_POST_GRID_ENTITY_REMOVE] = "MC_POST_GRID_ENTITY_REMOVE"
|
|
94
94
|
____exports.ModCallbacksCustom.MC_POST_GRID_ENTITY_COLLISION = 45
|
|
95
95
|
____exports.ModCallbacksCustom[____exports.ModCallbacksCustom.MC_POST_GRID_ENTITY_COLLISION] = "MC_POST_GRID_ENTITY_COLLISION"
|
|
96
|
+
____exports.ModCallbacksCustom.MC_POST_BONE_SWING = 46
|
|
97
|
+
____exports.ModCallbacksCustom[____exports.ModCallbacksCustom.MC_POST_BONE_SWING] = "MC_POST_BONE_SWING"
|
|
96
98
|
return ____exports
|
|
@@ -7,6 +7,8 @@ local ____exports = {}
|
|
|
7
7
|
local getCallbackName, getCallbackRegisterFunction
|
|
8
8
|
local ____postBombInitLate = require("callbacks.subscriptions.postBombInitLate")
|
|
9
9
|
local postBombInitLateRegister = ____postBombInitLate.postBombInitLateRegister
|
|
10
|
+
local ____postBoneSwing = require("callbacks.subscriptions.postBoneSwing")
|
|
11
|
+
local postBoneSwingRegister = ____postBoneSwing.postBoneSwingRegister
|
|
10
12
|
local ____postCursedTeleport = require("callbacks.subscriptions.postCursedTeleport")
|
|
11
13
|
local postCursedTeleportRegister = ____postCursedTeleport.postCursedTeleportRegister
|
|
12
14
|
local ____postCustomRevive = require("callbacks.subscriptions.postCustomRevive")
|
|
@@ -392,6 +394,12 @@ function getCallbackRegisterFunction(self, callbackID)
|
|
|
392
394
|
return postGridEntityCollisionRegister
|
|
393
395
|
end
|
|
394
396
|
end
|
|
397
|
+
____cond19 = ____cond19 or ____switch19 == ModCallbacksCustom.MC_POST_BONE_SWING
|
|
398
|
+
if ____cond19 then
|
|
399
|
+
do
|
|
400
|
+
return postBoneSwingRegister
|
|
401
|
+
end
|
|
402
|
+
end
|
|
395
403
|
do
|
|
396
404
|
do
|
|
397
405
|
return ensureAllCases(nil, callbackID)
|
package/dist/upgradeMod.lua
CHANGED
|
@@ -9,6 +9,8 @@ local ____itemPickup = require("callbacks.itemPickup")
|
|
|
9
9
|
local itemPickupCallbacksInit = ____itemPickup.itemPickupCallbacksInit
|
|
10
10
|
local ____postBombInitLate = require("callbacks.postBombInitLate")
|
|
11
11
|
local postBombInitLateCallbackInit = ____postBombInitLate.postBombInitLateCallbackInit
|
|
12
|
+
local ____postBoneSwing = require("callbacks.postBoneSwing")
|
|
13
|
+
local postBoneSwingCallbackInit = ____postBoneSwing.postBoneSwingCallbackInit
|
|
12
14
|
local ____postCursedTeleport = require("callbacks.postCursedTeleport")
|
|
13
15
|
local postCursedTeleportCallbackInit = ____postCursedTeleport.postCursedTeleportCallbackInit
|
|
14
16
|
local ____postEffectInitLate = require("callbacks.postEffectInitLate")
|
|
@@ -125,6 +127,7 @@ function initCustomCallbacks(self, mod)
|
|
|
125
127
|
postSlotRenderBrokenCallbacksInit(nil, mod)
|
|
126
128
|
postGridEntityCallbacksInit(nil, mod)
|
|
127
129
|
postGridEntityCollisionInit(nil, mod)
|
|
130
|
+
postBoneSwingCallbackInit(nil, mod)
|
|
128
131
|
end
|
|
129
132
|
function initFeatures(self, mod)
|
|
130
133
|
deployJSONRoomInit(nil, mod)
|