@quenty/rogue-humanoid 10.23.0 → 10.23.1-canary.545.2374fb2.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,6 +3,17 @@
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
+ ## [10.23.1-canary.545.2374fb2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-humanoid@10.23.0...@quenty/rogue-humanoid@10.23.1-canary.545.2374fb2.0) (2025-04-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
12
+
13
+
14
+
15
+
16
+
6
17
  # [10.23.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-humanoid@10.22.5...@quenty/rogue-humanoid@10.23.0) (2025-04-02)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/rogue-humanoid
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/rogue-humanoid",
3
- "version": "10.23.0",
3
+ "version": "10.23.1-canary.545.2374fb2.0",
4
4
  "description": "Roguelike humanoid properties which can be modified",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,23 +25,23 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/adorneedata": "^7.18.0",
29
- "@quenty/attributeutils": "^14.17.0",
30
- "@quenty/baseobject": "^10.8.0",
31
- "@quenty/binder": "^14.19.0",
32
- "@quenty/brio": "^14.17.0",
33
- "@quenty/characterutils": "^12.18.0",
34
- "@quenty/loader": "^10.8.0",
35
- "@quenty/maid": "^3.4.0",
36
- "@quenty/playerhumanoidbinder": "^14.19.0",
37
- "@quenty/rogue-properties": "^11.22.0",
38
- "@quenty/rx": "^13.17.0",
39
- "@quenty/servicebag": "^11.11.1",
40
- "@quenty/table": "^3.7.1",
41
- "@quenty/valueobject": "^13.17.0"
28
+ "@quenty/adorneedata": "7.18.1-canary.545.2374fb2.0",
29
+ "@quenty/attributeutils": "14.17.1-canary.545.2374fb2.0",
30
+ "@quenty/baseobject": "10.8.1-canary.545.2374fb2.0",
31
+ "@quenty/binder": "14.19.1-canary.545.2374fb2.0",
32
+ "@quenty/brio": "14.17.1-canary.545.2374fb2.0",
33
+ "@quenty/characterutils": "12.18.1-canary.545.2374fb2.0",
34
+ "@quenty/loader": "10.8.1-canary.545.2374fb2.0",
35
+ "@quenty/maid": "3.4.1-canary.545.2374fb2.0",
36
+ "@quenty/playerhumanoidbinder": "14.19.1-canary.545.2374fb2.0",
37
+ "@quenty/rogue-properties": "11.22.1-canary.545.2374fb2.0",
38
+ "@quenty/rx": "13.17.1-canary.545.2374fb2.0",
39
+ "@quenty/servicebag": "11.11.2-canary.545.2374fb2.0",
40
+ "@quenty/table": "3.7.2-canary.545.2374fb2.0",
41
+ "@quenty/valueobject": "13.17.1-canary.545.2374fb2.0"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "e8ea56930e65322fcffc05a1556d5df988068f0b"
46
+ "gitHead": "2374fb2b043cfbe0e9b507b3316eec46a4e353a0"
47
47
  }
@@ -4,10 +4,12 @@
4
4
 
5
5
  local require = require(script.Parent.loader).load(script)
6
6
 
7
+ local _ServiceBag = require("ServiceBag")
8
+
7
9
  local RogueHumanoidServiceClient = {}
8
10
  RogueHumanoidServiceClient.ServiceName = "RogueHumanoidServiceClient"
9
11
 
10
- function RogueHumanoidServiceClient:Init(serviceBag)
12
+ function RogueHumanoidServiceClient:Init(serviceBag: _ServiceBag.ServiceBag)
11
13
  assert(not self._serviceBag, "Already initialized")
12
14
  self._serviceBag = assert(serviceBag, "No serviceBag")
13
15
 
@@ -4,10 +4,12 @@
4
4
 
5
5
  local require = require(script.Parent.loader).load(script)
6
6
 
7
+ local _ServiceBag = require("ServiceBag")
8
+
7
9
  local RogueHumanoidService = {}
8
10
  RogueHumanoidService.ServiceName = "RogueHumanoidService"
9
11
 
10
- function RogueHumanoidService:Init(serviceBag)
12
+ function RogueHumanoidService:Init(serviceBag: _ServiceBag.ServiceBag)
11
13
  assert(not self._serviceBag, "Already initialized")
12
14
  self._serviceBag = assert(serviceBag, "No serviceBag")
13
15
 
@@ -22,6 +22,12 @@ local GROWTH_VALUE_NAMES = {
22
22
  "BodyWidthScale";
23
23
  }
24
24
 
25
+ type ScaleState = {
26
+ scale: number,
27
+ maxSize: number,
28
+ minSize: number,
29
+ }
30
+
25
31
  local RogueHumanoidBase = setmetatable({}, BaseObject)
26
32
  RogueHumanoidBase.ClassName = "RogueHumanoidBase"
27
33
  RogueHumanoidBase.__index = RogueHumanoidBase
@@ -33,9 +39,9 @@ function RogueHumanoidBase.new(humanoid, serviceBag)
33
39
 
34
40
  self._properties = RogueHumanoidProperties:GetPropertyTable(self._serviceBag, self._obj)
35
41
  self._scaleState = self._maid:Add(ValueObject.fromObservable(Rx.combineLatest({
36
- scale = self._properties.Scale:Observe();
37
- maxSize = self._properties.ScaleMax:Observe();
38
- minSize = self._properties.ScaleMin:Observe();
42
+ scale = self._properties.Scale:Observe(),
43
+ maxSize = self._properties.ScaleMax:Observe(),
44
+ minSize = self._properties.ScaleMin:Observe(),
39
45
  })))
40
46
 
41
47
  if CharacterUtils.getPlayerFromCharacter(self._obj) == Players.LocalPlayer then
@@ -79,13 +85,16 @@ function RogueHumanoidBase.new(humanoid, serviceBag)
79
85
  end
80
86
 
81
87
  function RogueHumanoidBase:_setupScaling()
82
- self._maid:GiveTask(self._scaleState:Observe():Pipe({
83
- Rx.where(function(state)
84
- return state ~= nil
85
- end);
86
- }):Subscribe(function(state)
87
- self:_updateScale(state)
88
- end))
88
+ self._maid:GiveTask(self._scaleState
89
+ :Observe()
90
+ :Pipe({
91
+ Rx.where(function(state)
92
+ return state ~= nil
93
+ end),
94
+ })
95
+ :Subscribe(function(state)
96
+ self:_updateScale(state)
97
+ end))
89
98
 
90
99
  self._maid:GiveTask(self._obj.ChildAdded:Connect(function(child)
91
100
  if GROWTH_VALUE_NAMES[child.Name] and child:IsA("NumberValue") then
@@ -130,8 +139,8 @@ function RogueHumanoidBase:_setupIgnoreCFrameChangesOnScaleChange()
130
139
  end))
131
140
  end
132
141
 
133
- function RogueHumanoidBase:_updateScale(state)
134
- for _, name in pairs(GROWTH_VALUE_NAMES) do
142
+ function RogueHumanoidBase:_updateScale(state: ScaleState)
143
+ for _, name in GROWTH_VALUE_NAMES do
135
144
  local numberValue = self._obj:FindFirstChild(name)
136
145
  if not (numberValue and numberValue:IsA("NumberValue")) then
137
146
  continue
@@ -141,7 +150,7 @@ function RogueHumanoidBase:_updateScale(state)
141
150
  end
142
151
  end
143
152
 
144
- function RogueHumanoidBase:_updateScaleValue(numberValue, state)
153
+ function RogueHumanoidBase:_updateScaleValue(numberValue: NumberValue, state: ScaleState)
145
154
  assert(typeof(numberValue) == "Instance", "Bad numberValue")
146
155
  assert(numberValue:IsA("NumberValue"), "Bad numberValue")
147
156
 
@@ -7,4 +7,4 @@ local require = require(loader).bootstrapGame(loader.Parent)
7
7
  local serviceBag = require("ServiceBag").new()
8
8
  serviceBag:GetService(require("RogueHumanoidServiceClient"))
9
9
  serviceBag:Init()
10
- serviceBag:Start()
10
+ serviceBag:Start()