@quenty/rogue-properties 11.28.0 → 11.29.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,22 @@
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.29.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@11.28.0...@quenty/rogue-properties@11.29.0) (2025-10-08)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Fix formatting ([97cfa97](https://github.com/Quenty/NevermoreEngine/commit/97cfa9787cc2d93e90e6d9a9f1a3c3c57b87a8a5))
12
+
13
+
14
+ ### Features
15
+
16
+ * Can disable rogue modifier ([0570ee2](https://github.com/Quenty/NevermoreEngine/commit/0570ee24eda1bacfe8489165400007f4ffef1374))
17
+
18
+
19
+
20
+
21
+
6
22
  # [11.28.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rogue-properties@11.27.0...@quenty/rogue-properties@11.28.0) (2025-10-03)
7
23
 
8
24
  **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": "11.28.0",
3
+ "version": "11.29.0",
4
4
  "description": "Roguelike properties which can be modified by external provides",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -24,10 +24,10 @@
24
24
  "Quenty"
25
25
  ],
26
26
  "dependencies": {
27
- "@quenty/adorneedata": "^7.21.0",
27
+ "@quenty/adorneedata": "^7.22.0",
28
28
  "@quenty/attributeutils": "^14.20.0",
29
29
  "@quenty/baseobject": "^10.9.0",
30
- "@quenty/binder": "^14.24.0",
30
+ "@quenty/binder": "^14.25.0",
31
31
  "@quenty/brio": "^14.20.0",
32
32
  "@quenty/defaultvalueutils": "^1.2.2",
33
33
  "@quenty/ducktype": "^5.9.0",
@@ -36,23 +36,23 @@
36
36
  "@quenty/linkutils": "^13.20.0",
37
37
  "@quenty/loader": "^10.9.0",
38
38
  "@quenty/maid": "^3.5.0",
39
- "@quenty/observablecollection": "^12.23.0",
39
+ "@quenty/observablecollection": "^12.24.0",
40
40
  "@quenty/remoting": "^12.21.0",
41
41
  "@quenty/rx": "^13.20.0",
42
- "@quenty/rxbinderutils": "^14.24.0",
42
+ "@quenty/rxbinderutils": "^14.25.0",
43
43
  "@quenty/rxsignal": "^7.20.0",
44
44
  "@quenty/servicebag": "^11.13.1",
45
45
  "@quenty/signal": "^7.11.1",
46
46
  "@quenty/spring": "^10.9.0",
47
47
  "@quenty/string": "^3.3.3",
48
48
  "@quenty/table": "^3.8.0",
49
- "@quenty/tie": "^10.24.0",
49
+ "@quenty/tie": "^10.25.0",
50
50
  "@quenty/valuebaseutils": "^13.20.0",
51
- "@quenty/valueobject": "^13.20.0",
51
+ "@quenty/valueobject": "^13.21.0",
52
52
  "@quentystudios/t": "^3.0.0"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "b7e211b41722e047a10a99f22da48887fc937b8a"
57
+ "gitHead": "d396d6f77d25ba25f1f45bbc252216131f88eeed"
58
58
  }
@@ -24,6 +24,10 @@ function RogueAdditive.new(valueObject, serviceBag)
24
24
  end
25
25
 
26
26
  function RogueAdditive:GetModifiedVersion(value)
27
+ if not self._data.Enabled.Value then
28
+ return value
29
+ end
30
+
27
31
  local input = LinearValue.toLinearIfNeeded(value)
28
32
  local additive = LinearValue.toLinearIfNeeded(self._obj.Value)
29
33
 
@@ -31,6 +35,10 @@ function RogueAdditive:GetModifiedVersion(value)
31
35
  end
32
36
 
33
37
  function RogueAdditive:GetInvertedVersion(value)
38
+ if not self._data.Enabled.Value then
39
+ return value
40
+ end
41
+
34
42
  local input = LinearValue.toLinearIfNeeded(value)
35
43
  local additive = LinearValue.toLinearIfNeeded(self._obj.Value)
36
44
 
@@ -40,9 +48,14 @@ end
40
48
  function RogueAdditive:ObserveModifiedVersion(inputValue)
41
49
  return Rx.combineLatest({
42
50
  inputValue = inputValue,
51
+ enabled = self._data.Enabled:Observe(),
43
52
  additive = RxInstanceUtils.observeProperty(self._obj, "Value"),
44
53
  }):Pipe({
45
54
  Rx.map(function(state)
55
+ if not state.enabled then
56
+ return state.inputValue
57
+ end
58
+
46
59
  if state.inputValue and type(state.inputValue) == type(state.additive) then
47
60
  local input = LinearValue.toLinearIfNeeded(state.inputValue)
48
61
  local additive = LinearValue.toLinearIfNeeded(state.additive)
@@ -24,6 +24,10 @@ function RogueMultiplier.new(valueObject, serviceBag)
24
24
  end
25
25
 
26
26
  function RogueMultiplier:GetModifiedVersion(value)
27
+ if not self._data.Enabled.Value then
28
+ return value
29
+ end
30
+
27
31
  local input = LinearValue.toLinearIfNeeded(value)
28
32
  local multiplier = LinearValue.toLinearIfNeeded(self._obj.Value)
29
33
 
@@ -31,6 +35,10 @@ function RogueMultiplier:GetModifiedVersion(value)
31
35
  end
32
36
 
33
37
  function RogueMultiplier:GetInvertedVersion(value)
38
+ if not self._data.Enabled.Value then
39
+ return value
40
+ end
41
+
34
42
  local input = LinearValue.toLinearIfNeeded(value)
35
43
  local multiplier = LinearValue.toLinearIfNeeded(self._obj.Value)
36
44
 
@@ -40,9 +48,14 @@ end
40
48
  function RogueMultiplier:ObserveModifiedVersion(inputValue)
41
49
  return Rx.combineLatest({
42
50
  inputValue = inputValue,
51
+ enabled = self._data.Enabled:Observe(),
43
52
  multiplier = RxInstanceUtils.observeProperty(self._obj, "Value"),
44
53
  }):Pipe({
45
54
  Rx.map(function(state)
55
+ if not state.enabled then
56
+ return state.inputValue
57
+ end
58
+
46
59
  if state.inputValue and type(state.inputValue) == type(state.multiplier) then
47
60
  local input = LinearValue.toLinearIfNeeded(state.inputValue)
48
61
  local multiplier = LinearValue.toLinearIfNeeded(state.multiplier)
@@ -7,6 +7,7 @@ local require = require(script.Parent.loader).load(script)
7
7
  local Binder = require("Binder")
8
8
  local RogueModifierBase = require("RogueModifierBase")
9
9
  local RogueModifierInterface = require("RogueModifierInterface")
10
+ local Rx = require("Rx")
10
11
  local RxValueBaseUtils = require("RxValueBaseUtils")
11
12
 
12
13
  local RogueSetter = setmetatable({}, RogueModifierBase)
@@ -21,15 +22,32 @@ function RogueSetter.new(valueObject, serviceBag)
21
22
  return self
22
23
  end
23
24
 
24
- function RogueSetter:GetModifiedVersion()
25
- return self._obj.Value
25
+ function RogueSetter:GetModifiedVersion(value)
26
+ if self._data.Enabled.Value then
27
+ return self._obj.Value
28
+ else
29
+ return value
30
+ end
26
31
  end
27
32
 
28
- function RogueSetter:ObserveModifiedVersion()
29
- return RxValueBaseUtils.observeValue(self._obj)
33
+ function RogueSetter:ObserveModifiedVersion(inputValue)
34
+ return self._data.Enabled:Observe():Pipe({
35
+ Rx.switchMap(function(enabled)
36
+ if enabled then
37
+ return RxValueBaseUtils.observeValue(self._obj)
38
+ else
39
+ return inputValue
40
+ end
41
+ end),
42
+ Rx.distinct(),
43
+ })
30
44
  end
31
45
 
32
- function RogueSetter:GetInvertedVersion(_, initialValue)
46
+ function RogueSetter:GetInvertedVersion(value, initialValue)
47
+ if not self._data.Enabled.Value then
48
+ return value
49
+ end
50
+
33
51
  return initialValue
34
52
  end
35
53
 
@@ -10,6 +10,7 @@ local ValueBaseValue = require("ValueBaseValue")
10
10
  local t = require("t")
11
11
 
12
12
  return AdorneeData.new({
13
+ Enabled = true,
13
14
  Order = 0,
14
15
  RoguePropertySourceLink = AdorneeDataEntry.new(t.optional(t.Instance), function(adornee)
15
16
  return ValueBaseValue.new(adornee, "ObjectValue", "RoguePropertySourceLink", nil)