@quenty/ragdoll 6.2.1-canary.256.edbbcfc.0 → 7.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/CHANGELOG.md CHANGED
@@ -3,7 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [6.2.1-canary.256.edbbcfc.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ragdoll@6.2.0...@quenty/ragdoll@6.2.1-canary.256.edbbcfc.0) (2022-03-27)
6
+ # [7.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ragdoll@6.3.0...@quenty/ragdoll@7.0.0) (2022-05-21)
7
+
8
+
9
+ ### Features
10
+
11
+ * More control over automatic unragdoll behavior ([8c71438](https://github.com/Quenty/NevermoreEngine/commit/8c71438ee9854d800c7fec5c5e844f841aeae378))
12
+
13
+
14
+
15
+
16
+
17
+ # [6.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/ragdoll@6.2.0...@quenty/ragdoll@6.3.0) (2022-03-27)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/ragdoll
9
20
 
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2014-2021 Quenty
3
+ Copyright (c) 2014-2022 Quenty
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/ragdoll",
3
- "version": "6.2.1-canary.256.edbbcfc.0",
3
+ "version": "7.0.0",
4
4
  "description": "Quenty's Ragdoll system for Roblox - Floppy fun ragdolls",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,24 +25,24 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/attributeutils": "5.1.1-canary.256.edbbcfc.0",
29
- "@quenty/baseobject": "4.1.1-canary.256.edbbcfc.0",
30
- "@quenty/binder": "5.1.1-canary.256.edbbcfc.0",
31
- "@quenty/camera": "6.2.1-canary.256.edbbcfc.0",
32
- "@quenty/characterutils": "4.1.1-canary.256.edbbcfc.0",
33
- "@quenty/hapticfeedbackutils": "3.0.1-canary.256.edbbcfc.0",
34
- "@quenty/humanoidanimatorutils": "2.0.2-canary.256.edbbcfc.0",
35
- "@quenty/loader": "4.0.1-canary.256.edbbcfc.0",
36
- "@quenty/maid": "2.2.1-canary.256.edbbcfc.0",
37
- "@quenty/playerhumanoidbinder": "5.1.1-canary.256.edbbcfc.0",
38
- "@quenty/promise": "4.1.1-canary.256.edbbcfc.0",
39
- "@quenty/remoting": "4.1.1-canary.256.edbbcfc.0",
40
- "@quenty/rx": "4.1.1-canary.256.edbbcfc.0",
41
- "@quenty/table": "2.1.2-canary.256.edbbcfc.0",
42
- "@quenty/valuebaseutils": "4.1.1-canary.256.edbbcfc.0"
28
+ "@quenty/attributeutils": "^6.0.0",
29
+ "@quenty/baseobject": "^5.0.0",
30
+ "@quenty/binder": "^6.0.0",
31
+ "@quenty/camera": "^7.0.0",
32
+ "@quenty/characterutils": "^5.0.0",
33
+ "@quenty/hapticfeedbackutils": "^3.1.0",
34
+ "@quenty/humanoidanimatorutils": "^2.1.0",
35
+ "@quenty/loader": "^5.0.0",
36
+ "@quenty/maid": "^2.3.0",
37
+ "@quenty/playerhumanoidbinder": "^6.0.0",
38
+ "@quenty/promise": "^5.0.0",
39
+ "@quenty/remoting": "^5.0.0",
40
+ "@quenty/rx": "^5.0.0",
41
+ "@quenty/table": "^3.0.0",
42
+ "@quenty/valuebaseutils": "^5.0.0"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "edbbcfc38516772a791d50dc43cd6b304ffc4aff"
47
+ "gitHead": "9f7eaea7543c33c89d2e32c38491b13f9271f4f7"
48
48
  }
@@ -35,6 +35,7 @@ function RagdollHumanoidOnFall.new(humanoid, serviceBag)
35
35
 
36
36
  self._remoteEvent = Instance.new("RemoteEvent")
37
37
  self._remoteEvent.Name = RagdollHumanoidOnFallConstants.REMOTE_EVENT_NAME
38
+ self._remoteEvent.Archivable = false
38
39
  self._remoteEvent.Parent = self._obj
39
40
  self._maid:GiveTask(self._remoteEvent)
40
41
 
@@ -40,6 +40,7 @@ function Ragdollable.new(humanoid, serviceBag)
40
40
 
41
41
  self._remoteEvent = Instance.new("RemoteEvent")
42
42
  self._remoteEvent.Name = RagdollableConstants.REMOTE_EVENT_NAME
43
+ self._remoteEvent.Archivable = false
43
44
  self._remoteEvent.Parent = self._obj
44
45
  self._maid:GiveTask(self._remoteEvent)
45
46
 
@@ -11,6 +11,9 @@ local RunService = game:GetService("RunService")
11
11
  local BaseObject = require("BaseObject")
12
12
  local RagdollBindersServer = require("RagdollBindersServer")
13
13
  local CharacterUtils = require("CharacterUtils")
14
+ local AttributeValue = require("AttributeValue")
15
+ local Maid = require("Maid")
16
+ local UnragdollAutomaticallyConstants = require("UnragdollAutomaticallyConstants")
14
17
 
15
18
  local UnragdollAutomatically = setmetatable({}, BaseObject)
16
19
  UnragdollAutomatically.ClassName = "UnragdollAutomatically"
@@ -28,10 +31,22 @@ function UnragdollAutomatically.new(humanoid, serviceBag)
28
31
  self._ragdollBindersServer = serviceBag:GetService(RagdollBindersServer)
29
32
  self._player = CharacterUtils.getPlayerFromCharacter(self._obj)
30
33
 
31
- self._maid:GiveTask(self._ragdollBindersServer.Ragdoll:ObserveInstance(self._obj, function()
32
- self:_handleRagdollChanged()
34
+ self._disabledUnragdoll = AttributeValue.new(self._obj, UnragdollAutomaticallyConstants.DISABLE_UNRAGDOLL_AUTOMATICALLY_ATTRIBUTE, false)
35
+ self._maid:GiveTask(self._disabledUnragdoll:Observe():Subscribe(function(isDisabled)
36
+ if isDisabled then
37
+ self._maid._updater = nil
38
+ return
39
+ end
40
+
41
+ local maid = Maid.new()
42
+
43
+ maid:GiveTask(self._ragdollBindersServer.Ragdoll:ObserveInstance(self._obj, function()
44
+ self:_handleRagdollChanged(maid)
45
+ end))
46
+ self:_handleRagdollChanged(maid)
47
+
48
+ self._maid._updater = maid
33
49
  end))
34
- self:_handleRagdollChanged()
35
50
 
36
51
  return self
37
52
  end
@@ -44,11 +59,11 @@ function UnragdollAutomatically:_getTime()
44
59
  end
45
60
  end
46
61
 
47
- function UnragdollAutomatically:_handleRagdollChanged()
62
+ function UnragdollAutomatically:_handleRagdollChanged(maid)
48
63
  if self._ragdollBindersServer.Ragdoll:Get(self._obj) then
49
64
  self._ragdollTime = tick()
50
65
 
51
- self._maid._conn = RunService.Stepped:Connect(function()
66
+ maid._conn = RunService.Stepped:Connect(function()
52
67
  if tick() - self._ragdollTime >= self:_getTime() then
53
68
  if self._obj.Health > 0 then
54
69
  self._ragdollBindersServer.Ragdoll:Unbind(self._obj)
@@ -56,7 +71,7 @@ function UnragdollAutomatically:_handleRagdollChanged()
56
71
  end
57
72
  end)
58
73
  else
59
- self._maid._conn = nil
74
+ maid._conn = nil
60
75
  end
61
76
  end
62
77
 
@@ -0,0 +1,11 @@
1
+ --[=[
2
+ @class UnragdollAutomaticallyConstants
3
+ ]=]
4
+
5
+ local require = require(script.Parent.loader).load(script)
6
+
7
+ local Table = require("Table")
8
+
9
+ return Table.readonly({
10
+ DISABLE_UNRAGDOLL_AUTOMATICALLY_ATTRIBUTE = "DisableUnragdollAutomatically";
11
+ })