@quenty/rogue-humanoid 10.48.0 → 10.49.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/CHANGELOG.md +8 -0
- package/package.json +13 -13
- package/src/Shared/RogueHumanoidBase.lua +55 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.49.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-humanoid@10.49.0...@quenty/rogue-humanoid@10.49.1) (2026-05-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/rogue-humanoid
|
|
9
|
+
|
|
10
|
+
# [10.49.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-humanoid@10.48.0...@quenty/rogue-humanoid@10.49.0) (2026-05-29)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @quenty/rogue-humanoid
|
|
13
|
+
|
|
6
14
|
# [10.48.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-humanoid@10.47.0...@quenty/rogue-humanoid@10.48.0) (2026-05-20)
|
|
7
15
|
|
|
8
16
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/rogue-humanoid",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.49.1",
|
|
4
4
|
"description": "Roguelike humanoid properties which can be modified",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,25 +28,25 @@
|
|
|
28
28
|
"Quenty"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@quenty/adorneedata": "7.
|
|
32
|
-
"@quenty/attributeutils": "14.
|
|
31
|
+
"@quenty/adorneedata": "7.34.1",
|
|
32
|
+
"@quenty/attributeutils": "14.30.1",
|
|
33
33
|
"@quenty/baseobject": "10.13.0",
|
|
34
|
-
"@quenty/binder": "14.
|
|
35
|
-
"@quenty/brio": "14.
|
|
36
|
-
"@quenty/characterutils": "12.
|
|
34
|
+
"@quenty/binder": "14.36.1",
|
|
35
|
+
"@quenty/brio": "14.30.1",
|
|
36
|
+
"@quenty/characterutils": "12.32.1",
|
|
37
37
|
"@quenty/loader": "10.11.0",
|
|
38
38
|
"@quenty/maid": "3.9.0",
|
|
39
39
|
"@quenty/nevermore-test-runner": "1.4.0",
|
|
40
|
-
"@quenty/playerhumanoidbinder": "14.
|
|
41
|
-
"@quenty/rogue-properties": "11.
|
|
42
|
-
"@quenty/rx": "13.28.
|
|
43
|
-
"@quenty/servicebag": "11.18.
|
|
40
|
+
"@quenty/playerhumanoidbinder": "14.37.1",
|
|
41
|
+
"@quenty/rogue-properties": "11.46.1",
|
|
42
|
+
"@quenty/rx": "13.28.3",
|
|
43
|
+
"@quenty/servicebag": "11.18.1",
|
|
44
44
|
"@quenty/table": "3.9.2",
|
|
45
|
-
"@quenty/tie": "10.
|
|
46
|
-
"@quenty/valueobject": "13.
|
|
45
|
+
"@quenty/tie": "10.40.1",
|
|
46
|
+
"@quenty/valueobject": "13.31.1"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "598b2b62b36bdcbdbbd56f7db10c399831cc6eba"
|
|
52
52
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
@class RogueHumanoidBase
|
|
4
4
|
]=]
|
|
5
5
|
|
|
6
6
|
local require = require(script.Parent.loader).load(script)
|
|
7
7
|
|
|
8
|
-
local Players = game:GetService("Players")
|
|
9
8
|
local RunService = game:GetService("RunService")
|
|
10
9
|
|
|
11
10
|
local AttributeUtils = require("AttributeUtils")
|
|
12
11
|
local BaseObject = require("BaseObject")
|
|
13
|
-
local
|
|
12
|
+
local Maid = require("Maid")
|
|
14
13
|
local RogueHumanoidProperties = require("RogueHumanoidProperties")
|
|
15
14
|
local Rx = require("Rx")
|
|
15
|
+
local RxCharacterUtils = require("RxCharacterUtils")
|
|
16
16
|
local RxRootPartUtils = require("RxRootPartUtils")
|
|
17
17
|
local ServiceBag = require("ServiceBag")
|
|
18
18
|
local ValueObject = require("ValueObject")
|
|
19
19
|
|
|
20
|
-
local GROWTH_VALUE_NAMES = {
|
|
21
|
-
"HeadScale",
|
|
22
|
-
"BodyDepthScale",
|
|
23
|
-
"BodyHeightScale",
|
|
24
|
-
"BodyWidthScale",
|
|
20
|
+
local GROWTH_VALUE_NAMES: { [string]: true } = {
|
|
21
|
+
["HeadScale"] = true,
|
|
22
|
+
["BodyDepthScale"] = true,
|
|
23
|
+
["BodyHeightScale"] = true,
|
|
24
|
+
["BodyWidthScale"] = true,
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
type ScaleState = {
|
|
@@ -34,8 +34,20 @@ local RogueHumanoidBase = setmetatable({}, BaseObject)
|
|
|
34
34
|
RogueHumanoidBase.ClassName = "RogueHumanoidBase"
|
|
35
35
|
RogueHumanoidBase.__index = RogueHumanoidBase
|
|
36
36
|
|
|
37
|
+
export type RogueHumanoidBase =
|
|
38
|
+
typeof(setmetatable(
|
|
39
|
+
{} :: {
|
|
40
|
+
_obj: Humanoid,
|
|
41
|
+
_serviceBag: ServiceBag.ServiceBag,
|
|
42
|
+
_properties: any,
|
|
43
|
+
_scaleState: ValueObject.ValueObject<ScaleState?>,
|
|
44
|
+
},
|
|
45
|
+
{} :: typeof({ __index = RogueHumanoidBase })
|
|
46
|
+
))
|
|
47
|
+
& BaseObject.BaseObject
|
|
48
|
+
|
|
37
49
|
function RogueHumanoidBase.new(humanoid: Humanoid, serviceBag: ServiceBag.ServiceBag)
|
|
38
|
-
local self = setmetatable(BaseObject.new(humanoid), RogueHumanoidBase)
|
|
50
|
+
local self: RogueHumanoidBase = setmetatable(BaseObject.new(humanoid) :: any, RogueHumanoidBase)
|
|
39
51
|
|
|
40
52
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
41
53
|
|
|
@@ -44,26 +56,32 @@ function RogueHumanoidBase.new(humanoid: Humanoid, serviceBag: ServiceBag.Servic
|
|
|
44
56
|
scale = self._properties.Scale:Observe(),
|
|
45
57
|
maxSize = self._properties.ScaleMax:Observe(),
|
|
46
58
|
minSize = self._properties.ScaleMin:Observe(),
|
|
47
|
-
})))
|
|
59
|
+
})) :: any)
|
|
60
|
+
|
|
61
|
+
self._maid:GiveTask(RxCharacterUtils.observeIsOfLocalCharacterBrio(self._obj):Subscribe(function(brio)
|
|
62
|
+
if brio:IsDead() then
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
local maid = brio:ToMaid()
|
|
48
67
|
|
|
49
|
-
|
|
50
|
-
self._maid:GiveTask(self._properties.WalkSpeed:Observe():Subscribe(function(walkSpeed)
|
|
68
|
+
maid:GiveTask(self._properties.WalkSpeed:Observe():Subscribe(function(walkSpeed)
|
|
51
69
|
self._obj.WalkSpeed = walkSpeed
|
|
52
70
|
end))
|
|
53
|
-
|
|
71
|
+
maid:GiveTask(self._properties.CharacterUseJumpPower:Observe():Subscribe(function(useJumpPower)
|
|
54
72
|
self._obj.UseJumpPower = useJumpPower
|
|
55
73
|
end))
|
|
56
|
-
|
|
74
|
+
maid:GiveTask(self._properties.JumpPower:Observe():Subscribe(function(jumpPower)
|
|
57
75
|
self._obj.JumpPower = jumpPower
|
|
58
76
|
end))
|
|
59
|
-
|
|
77
|
+
maid:GiveTask(self._properties.JumpHeight:Observe():Subscribe(function(jumpHeight)
|
|
60
78
|
self._obj.JumpHeight = jumpHeight
|
|
61
79
|
end))
|
|
62
80
|
|
|
63
81
|
if RunService:IsClient() then
|
|
64
|
-
self:_setupIgnoreCFrameChangesOnScaleChange()
|
|
82
|
+
self:_setupIgnoreCFrameChangesOnScaleChange(maid)
|
|
65
83
|
end
|
|
66
|
-
end
|
|
84
|
+
end))
|
|
67
85
|
|
|
68
86
|
self._maid:GiveTask(self._properties.MaxHealth:Observe():Subscribe(function(maxHealth)
|
|
69
87
|
local newMaxHealth = math.max(maxHealth, 1)
|
|
@@ -86,34 +104,44 @@ function RogueHumanoidBase.new(humanoid: Humanoid, serviceBag: ServiceBag.Servic
|
|
|
86
104
|
return self
|
|
87
105
|
end
|
|
88
106
|
|
|
89
|
-
function RogueHumanoidBase
|
|
107
|
+
function RogueHumanoidBase.CreateMultiplier(
|
|
108
|
+
self: RogueHumanoidBase,
|
|
109
|
+
property: string,
|
|
110
|
+
amount: number,
|
|
111
|
+
source: Instance?
|
|
112
|
+
): ValueBase
|
|
90
113
|
local rogueProperty = assert(self._properties:GetRogueProperty(property), "Bad property")
|
|
91
114
|
assert(type(rogueProperty.Value) == "number", "Incompatible property")
|
|
92
115
|
|
|
93
116
|
return rogueProperty:CreateMultiplier(amount, source)
|
|
94
117
|
end
|
|
95
118
|
|
|
96
|
-
function RogueHumanoidBase
|
|
119
|
+
function RogueHumanoidBase.CreateAdditive(
|
|
120
|
+
self: RogueHumanoidBase,
|
|
121
|
+
property: string,
|
|
122
|
+
amount: number,
|
|
123
|
+
source: Instance?
|
|
124
|
+
): ValueBase
|
|
97
125
|
local rogueProperty = assert(self._properties:GetRogueProperty(property), "Bad property")
|
|
98
126
|
assert(type(rogueProperty.Value) == "number", "Incompatible property")
|
|
99
127
|
|
|
100
128
|
return rogueProperty:CreateAdditive(amount, source)
|
|
101
129
|
end
|
|
102
130
|
|
|
103
|
-
function RogueHumanoidBase
|
|
131
|
+
function RogueHumanoidBase._setupScaling(self: RogueHumanoidBase)
|
|
104
132
|
self._maid:GiveTask(self._scaleState
|
|
105
133
|
:Observe()
|
|
106
134
|
:Pipe({
|
|
107
135
|
Rx.where(function(state)
|
|
108
136
|
return state ~= nil
|
|
109
|
-
end),
|
|
137
|
+
end) :: any,
|
|
110
138
|
})
|
|
111
139
|
:Subscribe(function(state)
|
|
112
140
|
self:_updateScale(state)
|
|
113
141
|
end))
|
|
114
142
|
|
|
115
143
|
self._maid:GiveTask(self._obj.ChildAdded:Connect(function(child)
|
|
116
|
-
if
|
|
144
|
+
if child:IsA("NumberValue") and GROWTH_VALUE_NAMES[child.Name] then
|
|
117
145
|
local state = self._scaleState.Value
|
|
118
146
|
if state then
|
|
119
147
|
self:_updateScaleValue(child, state)
|
|
@@ -122,8 +150,8 @@ function RogueHumanoidBase:_setupScaling()
|
|
|
122
150
|
end))
|
|
123
151
|
end
|
|
124
152
|
|
|
125
|
-
function RogueHumanoidBase
|
|
126
|
-
|
|
153
|
+
function RogueHumanoidBase._setupIgnoreCFrameChangesOnScaleChange(self: RogueHumanoidBase, topMaid: Maid.Maid)
|
|
154
|
+
topMaid:GiveTask(RxRootPartUtils.observeHumanoidRootPartBrioFromHumanoid(self._obj):Subscribe(function(brio)
|
|
127
155
|
if brio:IsDead() then
|
|
128
156
|
return
|
|
129
157
|
end
|
|
@@ -155,8 +183,8 @@ function RogueHumanoidBase:_setupIgnoreCFrameChangesOnScaleChange()
|
|
|
155
183
|
end))
|
|
156
184
|
end
|
|
157
185
|
|
|
158
|
-
function RogueHumanoidBase
|
|
159
|
-
for
|
|
186
|
+
function RogueHumanoidBase._updateScale(self: RogueHumanoidBase, state: ScaleState)
|
|
187
|
+
for name, _ in GROWTH_VALUE_NAMES do
|
|
160
188
|
local numberValue = self._obj:FindFirstChild(name)
|
|
161
189
|
if not (numberValue and numberValue:IsA("NumberValue")) then
|
|
162
190
|
continue
|
|
@@ -166,7 +194,7 @@ function RogueHumanoidBase:_updateScale(state: ScaleState)
|
|
|
166
194
|
end
|
|
167
195
|
end
|
|
168
196
|
|
|
169
|
-
function RogueHumanoidBase
|
|
197
|
+
function RogueHumanoidBase._updateScaleValue(_self: RogueHumanoidBase, numberValue: NumberValue, state: ScaleState)
|
|
170
198
|
assert(typeof(numberValue) == "Instance", "Bad numberValue")
|
|
171
199
|
assert(numberValue:IsA("NumberValue"), "Bad numberValue")
|
|
172
200
|
|