Skip to content

Commit 23308d2

Browse files
committed
Fixed issue where slow was speeding up instead
1 parent de181b3 commit 23308d2

3 files changed

Lines changed: 43 additions & 10 deletions

File tree

core/assets/abilityBehaviors/humanUnitActives.json

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@
1212
}
1313
},
1414
"stackingKey": {
15-
"type": "getAllowStackingKey"
15+
"type": "rawString",
16+
"value": "slow"
1617
},
1718
"value": {
18-
"type": "getAbilityDataAsFloat",
19-
"dataField": "B"
19+
"type": "negativeFloat",
20+
"value": {
21+
"type": "getAbilityDataAsFloat",
22+
"dataField": "B"
23+
}
2024
}
2125
},{
2226
"type": "storeValueLocally",
@@ -37,11 +41,15 @@
3741
}
3842
},
3943
"stackingKey": {
40-
"type": "getAllowStackingKey"
44+
"type": "rawString",
45+
"value": "slow"
4146
},
4247
"value": {
43-
"type": "getAbilityDataAsFloat",
44-
"dataField": "A"
48+
"type": "negativeFloat",
49+
"value": {
50+
"type": "getAbilityDataAsFloat",
51+
"dataField": "A"
52+
}
4553
}
4654
},{
4755
"type": "storeValueLocally",
@@ -185,8 +193,11 @@
185193
}
186194
},
187195
"value": {
188-
"type": "getAbilityDataAsFloat",
189-
"dataField": "A"
196+
"type": "negativeFloat",
197+
"value": {
198+
"type": "getAbilityDataAsFloat",
199+
"dataField": "A"
200+
}
190201
}
191202
},{
192203
"type": "updateNonStackingStatBuff",
@@ -198,8 +209,11 @@
198209
}
199210
},
200211
"value": {
201-
"type": "getAbilityDataAsFloat",
202-
"dataField": "B"
212+
"type": "negativeFloat",
213+
"value": {
214+
"type": "getAbilityDataAsFloat",
215+
"dataField": "B"
216+
}
203217
}
204218
}]
205219
}]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks;
2+
3+
import java.util.Map;
4+
5+
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.CSimulation;
6+
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.CUnit;
7+
8+
public class ABCallbackNegativeFloat extends ABFloatCallback {
9+
10+
private ABFloatCallback value;
11+
12+
@Override
13+
public Float callback(CSimulation game, CUnit caster, Map<String, Object> localStore) {
14+
return -1 * value.callback(game, caster, localStore);
15+
}
16+
17+
}

core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilitybuilder/core/AbilityBuilderGsonBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackGetUnitFacing;
9797
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackGetUnitLocationX;
9898
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackGetUnitLocationY;
99+
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackNegativeFloat;
99100
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackRandomBoundedFloat;
100101
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackRandomFloat;
101102
import com.etheller.warsmash.viewer5.handlers.w3x.simulation.abilitybuilder.behavior.callback.floatcallbacks.ABCallbackRawFloat;
@@ -248,6 +249,7 @@ private static void registerFloatCallbacks(RuntimeTypeAdapterFactory callbackTyp
248249
callbackTypeFactory.registerSubtype(ABCallbackGetAbilityArea.class, "getAbilityArea")
249250
.registerSubtype(ABCallbackGetAbilityDuration.class, "getAbilityDuration")
250251
.registerSubtype(ABCallbackRawFloat.class, "rawFloat")
252+
.registerSubtype(ABCallbackNegativeFloat.class, "negativeFloat")
251253
.registerSubtype(ABCallbackGetStoredFloatByKey.class, "getStoredFloatByKey")
252254
.registerSubtype(ABCallbackGetAbilityDataAsFloat.class, "getAbilityDataAsFloat")
253255
.registerSubtype(ABCallbackGetParentAbilityDataAsFloat.class, "getParentAbilityDataAsFloat")

0 commit comments

Comments
 (0)