Skip to content

Commit 2700ade

Browse files
committed
Quick Fix
* AB: Fix to carrion swarm to not deal 0 damage * Core: Fix to pseudo projectiles to properly reduce wave distance in edge cases
1 parent 55ec327 commit 2700ade

File tree

4 files changed

+44
-39
lines changed

4 files changed

+44
-39
lines changed

core/assets/abilityBehaviors/undeadHeroUnitActives.json

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@
210210
}
211211
}]
212212
},{
213-
"ids": [{"id":"AUcs", "castId": "carrionswarm"}],
213+
"ids": [{"id":"AUcs", "castId": "carrionswarm"},{"id":"AOsh", "castId": "shockwave"}],
214214
"type": "NORMAL_POINTTARGET_SIMPLE",
215215
"onBeginCasting": [{
216216
"type": "createLocationTargetedCollisionProjectile",
@@ -386,39 +386,39 @@
386386
}
387387
},
388388
"thenActions": [{
389-
"type": "createTemporarySpellEffectOnUnit",
390-
"target": {
391-
"type": "getProjectileHitUnit"
392-
},
393-
"id": {
394-
"type": "getAlias"
395-
},
396-
"effectType": "SPECIAL"
389+
"type": "createTemporarySpellEffectOnUnit",
390+
"target": {
391+
"type": "getProjectileHitUnit"
392+
},
393+
"id": {
394+
"type": "getAlias"
395+
},
396+
"effectType": "SPECIAL"
397+
},{
398+
"type": "damageTarget",
399+
"source": {
400+
"type": "getCastingUnit"
401+
},
402+
"target": {
403+
"type": "getProjectileHitUnit"
404+
},
405+
"damageType": {
406+
"type": "getDamageTypeFromString",
407+
"id": {
408+
"type": "rawString",
409+
"value": "DISEASE"
410+
}
411+
},
412+
"damage": {
413+
"type": "getStoredFloatByKey",
414+
"key": {
415+
"type": "rawString",
416+
"value": "dpt"
417+
}
418+
}
397419
}],
398420
"elseActions": []
399-
},{
400-
"type": "damageTarget",
401-
"source": {
402-
"type": "getCastingUnit"
403-
},
404-
"target": {
405-
"type": "getProjectileHitUnit"
406-
},
407-
"damageType": {
408-
"type": "getDamageTypeFromString",
409-
"id": {
410-
"type": "rawString",
411-
"value": "DISEASE"
412-
}
413-
},
414-
"damage": {
415-
"type": "getStoredFloatByKey",
416-
"key": {
417-
"type": "rawString",
418-
"value": "dpt"
419-
}
420-
}
421-
}]
421+
}]
422422
}]
423423

424424
},{

core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilities/skills/CAbilitySpellBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public CAbilitySpellBase(final int handleId, final War3ID alias) {
4141
public final void populate(final MutableGameObject worldEditorAbility, final int level) {
4242
this.manaCost = worldEditorAbility.getFieldAsInteger(AbilityFields.MANA_COST, level);
4343
this.castRange = worldEditorAbility.getFieldAsFloat(AbilityFields.CAST_RANGE, level);
44-
this.cooldown = worldEditorAbility.readSLKTagFloat("Cool" + level);
44+
this.cooldown = worldEditorAbility.getFieldAsFloat(AbilityFields.COOLDOWN, level);
4545
this.castingTime = worldEditorAbility.getFieldAsFloat(AbilityFields.CASTING_TIME, level);
4646
int requiredLevel = worldEditorAbility.getFieldAsInteger(AbilityFields.REQUIRED_LEVEL, 0);
4747

core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilitybuilder/behavior/action/unit/ABActionDamageTarget.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@ public class ABActionDamageTarget implements ABAction {
2323
private ABAttackTypeCallback attackType;
2424
private ABDamageTypeCallback damageType;
2525
private ABFloatCallback damage;
26+
27+
private ABBooleanCallback ignoreLTEZero;
2628

2729
@Override
2830
public void runAction(CSimulation game, CUnit caster, Map<String, Object> localStore, final int castId) {
2931
boolean isItAttack = false;
3032
boolean isItRanged = true;
3133
CAttackType theAttackType = CAttackType.SPELLS;
3234
CDamageType theDamageType = CDamageType.MAGIC;
35+
36+
float theDamage = damage.callback(game, caster, localStore, castId);
3337

3438
if (isAttack != null) {
3539
isItAttack = isAttack.callback(game, caster, localStore, castId);
@@ -43,10 +47,11 @@ public void runAction(CSimulation game, CUnit caster, Map<String, Object> localS
4347
if (damageType != null) {
4448
theDamageType = damageType.callback(game, caster, localStore, castId);
4549
}
46-
47-
target.callback(game, caster, localStore, castId).damage(game, source.callback(game, caster, localStore, castId), isItAttack,
48-
isItRanged, theAttackType, theDamageType, CWeaponSoundTypeJass.WHOKNOWS.name(),
49-
damage.callback(game, caster, localStore, castId));
50+
if (ignoreLTEZero == null || !ignoreLTEZero.callback(game, caster, localStore, castId) || theDamage > 0) {
51+
target.callback(game, caster, localStore, castId).damage(game, source.callback(game, caster, localStore, castId), isItAttack,
52+
isItRanged, theAttackType, theDamageType, CWeaponSoundTypeJass.WHOKNOWS.name(),
53+
damage.callback(game, caster, localStore, castId));
54+
}
5055
}
5156

5257
}

core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/combat/projectile/CPsuedoProjectile.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ public CPsuedoProjectile(final float x, final float y, final float speed, final
8181

8282
final float d1x = dtsx / this.distanceToTarget;
8383
final float d1y = dtsy / this.distanceToTarget;
84+
this.steps = ((int)Math.round(this.distanceToTarget) / (int)speed) + 1;
8485

85-
float travelDistance = Math.min(speed, distanceToTarget);
86+
float travelDistance = Math.min(speed, distanceToTarget/this.steps);
8687

8788
this.dx = d1x * travelDistance;
8889
this.dy = d1y * travelDistance;
89-
this.steps = ((int)Math.round(this.distanceToTarget) / (int)speed) + 1;
9090

9191
this.stepInterval = (int) (projectileStepInterval / WarsmashConstants.SIMULATION_STEP_TIME);
9292
this.artSkip = projectileArtSkip;

0 commit comments

Comments
 (0)