@quenty/rogue-properties 4.26.0 → 4.27.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,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
+ # [4.27.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@4.26.0...@quenty/rogue-properties@4.27.0) (2023-07-28)
7
+
8
+ **Note:** Version bump only for package @quenty/rogue-properties
9
+
10
+
11
+
12
+
13
+
6
14
  # [4.26.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@4.25.0...@quenty/rogue-properties@4.26.0) (2023-07-23)
7
15
 
8
16
  **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": "4.26.0",
3
+ "version": "4.27.0",
4
4
  "description": "Roguelike properties which can be modified by external provides",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,24 +25,24 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@quenty/baseobject": "^6.2.1",
28
- "@quenty/binder": "^8.22.0",
29
- "@quenty/brio": "^8.15.0",
30
- "@quenty/instanceutils": "^7.17.0",
31
- "@quenty/jsonutils": "^6.6.0",
32
- "@quenty/linkutils": "^7.17.0",
28
+ "@quenty/binder": "^8.23.0",
29
+ "@quenty/brio": "^8.16.0",
30
+ "@quenty/instanceutils": "^7.18.0",
31
+ "@quenty/jsonutils": "^6.7.0",
32
+ "@quenty/linkutils": "^7.18.0",
33
33
  "@quenty/loader": "^6.2.1",
34
34
  "@quenty/maid": "^2.5.0",
35
- "@quenty/rx": "^7.13.0",
36
- "@quenty/rxbinderutils": "^8.23.0",
35
+ "@quenty/rx": "^7.14.0",
36
+ "@quenty/rxbinderutils": "^8.24.0",
37
37
  "@quenty/servicebag": "^6.8.0",
38
38
  "@quenty/signal": "^2.4.0",
39
39
  "@quenty/table": "^3.2.0",
40
- "@quenty/valuebaseutils": "^7.17.0",
41
- "@quenty/valueobject": "^7.19.0",
40
+ "@quenty/valuebaseutils": "^7.18.0",
41
+ "@quenty/valueobject": "^7.20.0",
42
42
  "@quentystudios/t": "^3.0.0"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "c1fbe93a0a20b5c0c4b9ffbbac771926b07ac251"
47
+ "gitHead": "539b6bcf1266fb18e143059d08381654cca200bd"
48
48
  }
@@ -8,11 +8,12 @@ local RunService = game:GetService("RunService")
8
8
 
9
9
  local Rx = require("Rx")
10
10
  local RxBinderUtils = require("RxBinderUtils")
11
- local RxBrioUtils = require("RxBrioUtils")
12
11
  local RogueBindersShared = require("RogueBindersShared")
13
12
  local BinderUtils = require("BinderUtils")
14
13
  local RoguePropertyModifierUtils = require("RoguePropertyModifierUtils")
15
14
  local RoguePropertyService = require("RoguePropertyService")
15
+ local Observable = require("Observable")
16
+ local Maid = require("Maid")
16
17
 
17
18
  local RogueAdditiveProvider = {}
18
19
  RogueAdditiveProvider.ServiceName = "RogueAdditiveProvider"
@@ -83,17 +84,37 @@ end
83
84
 
84
85
  function RogueAdditiveProvider:ObserveModifiedVersion(propObj, rogueProperty, observeBaseValue)
85
86
  if rogueProperty:GetDefinition():GetValueType() == "number" then
86
- return RxBrioUtils.flatCombineLatest({
87
- value = observeBaseValue;
88
- adder = self:_observeAddersBrio(propObj):Pipe({
89
- RxBrioUtils.flatMapBrio(function(item)
90
- return item:ObserveAdditive();
91
- end); -- this gets us a list of adders which should mutate pretty frequently.
92
- Rx.defaultsToNil;
93
- });
94
- }):Pipe({
95
- Rx.map(function(state)
96
- return self:GetModifiedVersion(propObj, rogueProperty, state.value)
87
+ return Observable.new(function(sub)
88
+ local topMaid = Maid.new()
89
+
90
+ topMaid:GiveTask(self:_observeAddersBrio(propObj):Subscribe(function(brio)
91
+ if brio:IsDead() then
92
+ return
93
+ end
94
+
95
+ local maid = brio:ToMaid()
96
+ local value = brio:GetValue()
97
+
98
+ maid:GiveTask(value:ObserveAdditive():Subscribe(function()
99
+ sub:Fire()
100
+ end))
101
+
102
+ sub:Fire()
103
+
104
+ maid:GiveTask(function()
105
+ sub:Fire()
106
+ end)
107
+ end))
108
+
109
+ topMaid:GiveTask(observeBaseValue:Subscribe(function()
110
+ sub:Fire()
111
+ end))
112
+
113
+ return topMaid
114
+ end):Pipe({
115
+ Rx.throttleDefer();
116
+ Rx.map(function()
117
+ return self:GetModifiedVersion(propObj, rogueProperty, propObj.Value)
97
118
  end);
98
119
  })
99
120
  else
@@ -8,11 +8,12 @@ local RunService = game:GetService("RunService")
8
8
 
9
9
  local Rx = require("Rx")
10
10
  local RxBinderUtils = require("RxBinderUtils")
11
- local RxBrioUtils = require("RxBrioUtils")
12
11
  local RogueBindersShared = require("RogueBindersShared")
13
12
  local BinderUtils = require("BinderUtils")
14
13
  local RoguePropertyModifierUtils = require("RoguePropertyModifierUtils")
15
14
  local RoguePropertyService = require("RoguePropertyService")
15
+ local Observable = require("Observable")
16
+ local Maid = require("Maid")
16
17
 
17
18
  local RogueMultiplierProvider = {}
18
19
  RogueMultiplierProvider.ServiceName = "RogueMultiplierProvider"
@@ -83,17 +84,37 @@ end
83
84
 
84
85
  function RogueMultiplierProvider:ObserveModifiedVersion(propObj, rogueProperty, observeBaseValue)
85
86
  if rogueProperty:GetDefinition():GetValueType() == "number" then
86
- return RxBrioUtils.flatCombineLatest({
87
- value = observeBaseValue;
88
- multiplier = self:_observeMultipliersBrio(propObj):Pipe({
89
- RxBrioUtils.flatMapBrio(function(item)
90
- return item:ObserveMultiplier();
91
- end); -- this gets us a list of multipliers which should mutate pretty frequently.
92
- Rx.defaultsToNil;
93
- });
94
- }):Pipe({
95
- Rx.map(function(state)
96
- return self:GetModifiedVersion(propObj, rogueProperty, state.value)
87
+ return Observable.new(function(sub)
88
+ local topMaid = Maid.new()
89
+
90
+ topMaid:GiveTask(self:_observeMultipliersBrio(propObj):Subscribe(function(brio)
91
+ if brio:IsDead() then
92
+ return
93
+ end
94
+
95
+ local maid = brio:ToMaid()
96
+ local value = brio:GetValue()
97
+
98
+ maid:GiveTask(value:ObserveMultiplier():Subscribe(function()
99
+ sub:Fire()
100
+ end))
101
+
102
+ sub:Fire()
103
+
104
+ maid:GiveTask(function()
105
+ sub:Fire()
106
+ end)
107
+ end))
108
+
109
+ topMaid:GiveTask(observeBaseValue:Subscribe(function()
110
+ sub:Fire()
111
+ end))
112
+
113
+ return topMaid
114
+ end):Pipe({
115
+ Rx.throttleDefer();
116
+ Rx.map(function()
117
+ return self:GetModifiedVersion(propObj, rogueProperty, propObj.Value)
97
118
  end);
98
119
  })
99
120
  else