@quenty/rogue-properties 10.0.0 → 11.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,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
|
+
# [11.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@10.0.0...@quenty/rogue-properties@11.0.0) (2024-02-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Fix rogue property speeds ([0275254](https://github.com/Quenty/NevermoreEngine/commit/027525423896ecc110c2e12e2af5a9b5b6da75ae))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [10.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@9.0.0...@quenty/rogue-properties@10.0.0) (2024-02-14)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/rogue-properties
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/rogue-properties",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Roguelike properties which can be modified by external provides",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "76dd93ee8ce79e7e156f1c39978bf72224f6dd05"
|
|
52
52
|
}
|
|
@@ -211,8 +211,8 @@ function RogueProperty:Observe()
|
|
|
211
211
|
current = Rx.of(self._definition:GetDefaultValue())
|
|
212
212
|
end
|
|
213
213
|
|
|
214
|
-
for _,
|
|
215
|
-
current =
|
|
214
|
+
for _, provider in pairs(self._roguePropertyService:GetProviders()) do
|
|
215
|
+
current = provider:ObserveModifiedVersion(baseValue, self, current)
|
|
216
216
|
end
|
|
217
217
|
|
|
218
218
|
return current
|
|
@@ -13,6 +13,7 @@ local RoguePropertyModifierUtils = require("RoguePropertyModifierUtils")
|
|
|
13
13
|
local RoguePropertyService = require("RoguePropertyService")
|
|
14
14
|
local Observable = require("Observable")
|
|
15
15
|
local Maid = require("Maid")
|
|
16
|
+
local ValueObject = require("ValueObject")
|
|
16
17
|
|
|
17
18
|
local RogueAdditiveProvider = {}
|
|
18
19
|
RogueAdditiveProvider.ServiceName = "RogueAdditiveProvider"
|
|
@@ -86,6 +87,12 @@ function RogueAdditiveProvider:ObserveModifiedVersion(propObj, rogueProperty, ob
|
|
|
86
87
|
return Observable.new(function(sub)
|
|
87
88
|
local topMaid = Maid.new()
|
|
88
89
|
|
|
90
|
+
local lastValue = topMaid:Add(ValueObject.fromObservable(observeBaseValue))
|
|
91
|
+
|
|
92
|
+
local function update()
|
|
93
|
+
sub:Fire(lastValue.Value)
|
|
94
|
+
end
|
|
95
|
+
|
|
89
96
|
topMaid:GiveTask(self:_observeAddersBrio(propObj):Subscribe(function(brio)
|
|
90
97
|
if brio:IsDead() then
|
|
91
98
|
return
|
|
@@ -95,25 +102,25 @@ function RogueAdditiveProvider:ObserveModifiedVersion(propObj, rogueProperty, ob
|
|
|
95
102
|
local value = brio:GetValue()
|
|
96
103
|
|
|
97
104
|
maid:GiveTask(value:ObserveAdditive():Subscribe(function()
|
|
98
|
-
|
|
105
|
+
update()
|
|
99
106
|
end))
|
|
100
107
|
|
|
101
|
-
|
|
108
|
+
update()
|
|
102
109
|
|
|
103
110
|
maid:GiveTask(function()
|
|
104
|
-
|
|
111
|
+
update()
|
|
105
112
|
end)
|
|
106
113
|
end))
|
|
107
114
|
|
|
108
115
|
topMaid:GiveTask(observeBaseValue:Subscribe(function()
|
|
109
|
-
|
|
116
|
+
update()
|
|
110
117
|
end))
|
|
111
118
|
|
|
112
119
|
return topMaid
|
|
113
120
|
end):Pipe({
|
|
114
121
|
Rx.throttleDefer();
|
|
115
|
-
Rx.map(function()
|
|
116
|
-
return self:GetModifiedVersion(propObj, rogueProperty,
|
|
122
|
+
Rx.map(function(baseValue)
|
|
123
|
+
return self:GetModifiedVersion(propObj, rogueProperty, baseValue)
|
|
117
124
|
end);
|
|
118
125
|
})
|
|
119
126
|
else
|
|
@@ -13,6 +13,7 @@ local RoguePropertyModifierUtils = require("RoguePropertyModifierUtils")
|
|
|
13
13
|
local RoguePropertyService = require("RoguePropertyService")
|
|
14
14
|
local Observable = require("Observable")
|
|
15
15
|
local Maid = require("Maid")
|
|
16
|
+
local ValueObject = require("ValueObject")
|
|
16
17
|
|
|
17
18
|
local RogueMultiplierProvider = {}
|
|
18
19
|
RogueMultiplierProvider.ServiceName = "RogueMultiplierProvider"
|
|
@@ -86,6 +87,12 @@ function RogueMultiplierProvider:ObserveModifiedVersion(propObj, rogueProperty,
|
|
|
86
87
|
return Observable.new(function(sub)
|
|
87
88
|
local topMaid = Maid.new()
|
|
88
89
|
|
|
90
|
+
local lastValue = topMaid:Add(ValueObject.fromObservable(observeBaseValue))
|
|
91
|
+
|
|
92
|
+
local function update()
|
|
93
|
+
sub:Fire(lastValue.Value)
|
|
94
|
+
end
|
|
95
|
+
|
|
89
96
|
topMaid:GiveTask(self:_observeMultipliersBrio(propObj):Subscribe(function(brio)
|
|
90
97
|
if brio:IsDead() then
|
|
91
98
|
return
|
|
@@ -95,25 +102,25 @@ function RogueMultiplierProvider:ObserveModifiedVersion(propObj, rogueProperty,
|
|
|
95
102
|
local value = brio:GetValue()
|
|
96
103
|
|
|
97
104
|
maid:GiveTask(value:ObserveMultiplier():Subscribe(function()
|
|
98
|
-
|
|
105
|
+
update()
|
|
99
106
|
end))
|
|
100
107
|
|
|
101
|
-
|
|
108
|
+
update()
|
|
102
109
|
|
|
103
110
|
maid:GiveTask(function()
|
|
104
|
-
|
|
111
|
+
update()
|
|
105
112
|
end)
|
|
106
113
|
end))
|
|
107
114
|
|
|
108
|
-
topMaid:GiveTask(
|
|
109
|
-
|
|
115
|
+
topMaid:GiveTask(lastValue:Observe():Subscribe(function()
|
|
116
|
+
update()
|
|
110
117
|
end))
|
|
111
118
|
|
|
112
119
|
return topMaid
|
|
113
120
|
end):Pipe({
|
|
114
121
|
Rx.throttleDefer();
|
|
115
|
-
Rx.map(function()
|
|
116
|
-
return self:GetModifiedVersion(propObj, rogueProperty,
|
|
122
|
+
Rx.map(function(baseValue)
|
|
123
|
+
return self:GetModifiedVersion(propObj, rogueProperty, baseValue)
|
|
117
124
|
end);
|
|
118
125
|
})
|
|
119
126
|
else
|