diff --git a/core/assets/warsmash.ini b/core/assets/warsmash.ini index 1f0e7fc..cb2f17d 100644 --- a/core/assets/warsmash.ini +++ b/core/assets/warsmash.ini @@ -1,12 +1,20 @@ [DataSources] -Count=5 -Type00=Folder -Path00="D:\Backups\Warcraft\Data\UIMod" -Type01=Folder -Path01="..\..\resources" -Type02=Folder -Path02="D:\Backups\Warsmash\Data" -Type03=Folder -Path03="D:\Games\Warcraft III Patch 1.22\Maps" -Type04=Folder -Path04="." +Count=9 +Type00=MPQ +Path00="D:\Games\Warcraft III Patch 1.22\war3.mpq" +Type01=MPQ +Path01="D:\Games\Warcraft III Patch 1.22\War3x.mpq" +Type02=MPQ +Path02="D:\Games\Warcraft III Patch 1.22\War3xlocal.mpq" +Type03=MPQ +Path03="D:\Games\Warcraft III Patch 1.22\War3Patch.mpq" +Type04=MPQ +Path04="D:\Games\Warcraft III Patch 1.22\Warsmash\War3Mod.mpq" +Type05=Folder +Path05="..\..\resources" +Type06=Folder +Path06="D:\Backups\Warsmash\Data" +Type07=Folder +Path07="D:\Games\Warcraft III Patch 1.22\Maps" +Type08=Folder +Path08="." diff --git a/core/assets/warsmash122.ini b/core/assets/warsmash122.ini deleted file mode 100644 index cb2f17d..0000000 --- a/core/assets/warsmash122.ini +++ /dev/null @@ -1,20 +0,0 @@ -[DataSources] -Count=9 -Type00=MPQ -Path00="D:\Games\Warcraft III Patch 1.22\war3.mpq" -Type01=MPQ -Path01="D:\Games\Warcraft III Patch 1.22\War3x.mpq" -Type02=MPQ -Path02="D:\Games\Warcraft III Patch 1.22\War3xlocal.mpq" -Type03=MPQ -Path03="D:\Games\Warcraft III Patch 1.22\War3Patch.mpq" -Type04=MPQ -Path04="D:\Games\Warcraft III Patch 1.22\Warsmash\War3Mod.mpq" -Type05=Folder -Path05="..\..\resources" -Type06=Folder -Path06="D:\Backups\Warsmash\Data" -Type07=Folder -Path07="D:\Games\Warcraft III Patch 1.22\Maps" -Type08=Folder -Path08="." diff --git a/core/assets/warsmash_myHD.ini b/core/assets/warsmash_myHD.ini new file mode 100644 index 0000000..1f0e7fc --- /dev/null +++ b/core/assets/warsmash_myHD.ini @@ -0,0 +1,12 @@ +[DataSources] +Count=5 +Type00=Folder +Path00="D:\Backups\Warcraft\Data\UIMod" +Type01=Folder +Path01="..\..\resources" +Type02=Folder +Path02="D:\Backups\Warsmash\Data" +Type03=Folder +Path03="D:\Games\Warcraft III Patch 1.22\Maps" +Type04=Folder +Path04="." diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/SequenceUtils.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/SequenceUtils.java index c9e0583..46160b7 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/SequenceUtils.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/SequenceUtils.java @@ -20,6 +20,7 @@ public class SequenceUtils { public static final EnumSet HIT = EnumSet.of(SecondaryTag.HIT); public static final EnumSet SPELL = EnumSet.of(SecondaryTag.SPELL); public static final EnumSet WORK = EnumSet.of(SecondaryTag.WORK); + public static final EnumSet FAST = EnumSet.of(SecondaryTag.FAST); private static final StandSequenceComparator STAND_SEQUENCE_COMPARATOR = new StandSequenceComparator(); private static final SecondaryTagSequenceComparator SECONDARY_TAG_SEQUENCE_COMPARATOR = new SecondaryTagSequenceComparator( diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnit.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnit.java index 4fdd620..452b33a 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnit.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnit.java @@ -1742,4 +1742,8 @@ public class CUnit extends CWidget { return this.updateType; } } + + public float getAnimationRunSpeedRatio() { + return this.unitType.getAnimationRunSpeed() / this.speed; + } } diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnitType.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnitType.java index 242f7c4..2c620f8 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnitType.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/CUnitType.java @@ -75,7 +75,8 @@ public class CUnitType { private final int properNamesCount; private final boolean canFlee; private final int priority; - private boolean revivesHeroes; + private final boolean revivesHeroes; + private final float animationRunSpeed; public CUnitType(final String name, final String legacyName, final War3ID typeId, final int maxLife, final int manaInitial, final int manaMaximum, final int speed, final int defense, final String abilityList, @@ -93,7 +94,7 @@ public class CUnitType { final float strengthPerLevel, final int agility, final float agilityPerLevel, final int intelligence, final float intelligencePerLevel, final CPrimaryAttribute primaryAttribute, final List heroAbilityList, final List heroProperNames, final int properNamesCount, - final boolean canFlee, final int priority, boolean revivesHeroes) { + final boolean canFlee, final int priority, final boolean revivesHeroes, final float animationRunSpeed) { this.name = name; this.legacyName = legacyName; this.typeId = typeId; @@ -148,6 +149,7 @@ public class CUnitType { this.canFlee = canFlee; this.priority = priority; this.revivesHeroes = revivesHeroes; + this.animationRunSpeed = animationRunSpeed; } public String getName() { @@ -363,6 +365,10 @@ public class CUnitType { } public boolean isRevivesHeroes() { - return revivesHeroes; + return this.revivesHeroes; + } + + public float getAnimationRunSpeed() { + return this.animationRunSpeed; } } diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilities/inventory/CAbilityInventory.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilities/inventory/CAbilityInventory.java index 4a31829..593bea7 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilities/inventory/CAbilityInventory.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/abilities/inventory/CAbilityInventory.java @@ -274,6 +274,7 @@ public class CAbilityInventory extends AbstractGenericNoIconAbility { for (final CAbility ability : this.itemsHeldAbilities[slotIndex]) { hero.remove(simulation, ability); } + this.itemsHeldAbilities[slotIndex].clear(); droppedItem.setHidden(false); droppedItem.setPointAndCheckUnstuck(x, y, simulation); } @@ -295,6 +296,7 @@ public class CAbilityInventory extends AbstractGenericNoIconAbility { for (final CAbility ability : this.itemsHeldAbilities[index]) { hero.remove(simulation, ability); } + this.itemsHeldAbilities[index].clear(); itemToDrop.setPointAndCheckUnstuck(x, y, simulation); } } diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/behaviors/CBehaviorMove.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/behaviors/CBehaviorMove.java index 15099b1..6bf668a 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/behaviors/CBehaviorMove.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/behaviors/CBehaviorMove.java @@ -325,8 +325,8 @@ public class CBehaviorMove implements CBehavior { return this; } } - this.unit.getUnitAnimationListener().playAnimation(false, PrimaryTag.WALK, SequenceUtils.EMPTY, 1.0f, - true); + this.unit.getUnitAnimationListener().playAnimation(false, PrimaryTag.WALK, SequenceUtils.FAST, + this.unit.getAnimationRunSpeedRatio(), true); this.wasWithinPropWindow = true; } while (continueDistance > 0); diff --git a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/data/CUnitData.java b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/data/CUnitData.java index c9f03d3..cbb9add 100644 --- a/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/data/CUnitData.java +++ b/core/src/com/etheller/warsmash/viewer5/handlers/w3x/simulation/data/CUnitData.java @@ -172,6 +172,8 @@ public class CUnitData { private static final War3ID CAN_FLEE = War3ID.fromString("ufle"); private static final War3ID PRIORITY = War3ID.fromString("upri"); + private static final War3ID ANIMATION_RUN_SPEED = War3ID.fromString("urun"); + private final CGameplayConstants gameplayConstants; private final MutableObjectData unitData; private final Map unitIdToUnitType = new HashMap<>(); @@ -245,7 +247,7 @@ public class CUnitData { if (!unitsTrained.isEmpty() || !researchesAvailable.isEmpty()) { unit.add(simulation, new CAbilityQueue(handleIdAllocator.createId(), unitsTrained, researchesAvailable)); } - if(unitTypeInstance.isRevivesHeroes()) { + if (unitTypeInstance.isRevivesHeroes()) { unit.add(simulation, new CAbilityReviveHero(handleIdAllocator.createId())); } if (!unitsTrained.isEmpty() || unitTypeInstance.isRevivesHeroes()) { @@ -283,6 +285,8 @@ public class CUnitData { final int unitLevel = unitType.getFieldAsInteger(UNIT_LEVEL, 0); final int priority = unitType.getFieldAsInteger(PRIORITY, 0); + final float animationRunSpeed = unitType.getFieldAsFloat(ANIMATION_RUN_SPEED, 0); + final float moveHeight = unitType.getFieldAsFloat(MOVE_HEIGHT, 0); final String movetp = unitType.getFieldAsString(MOVE_TYPE, 0); final float collisionSize = unitType.getFieldAsFloat(COLLISION_SIZE, 0); @@ -455,7 +459,7 @@ public class CUnitData { final int foodUsed = unitType.getFieldAsInteger(FOOD_USED, 0); final int foodMade = unitType.getFieldAsInteger(FOOD_MADE, 0); - boolean revivesHeroes = unitType.getFieldAsBoolean(REVIVES_HEROES, 0); + final boolean revivesHeroes = unitType.getFieldAsBoolean(REVIVES_HEROES, 0); final String unitsTrainedString = unitType.getFieldAsString(UNITS_TRAINED, 0); final String[] unitsTrainedStringItems = unitsTrainedString.trim().split(","); @@ -545,7 +549,7 @@ public class CUnitData { goldCost, lumberCost, foodUsed, foodMade, buildTime, preventedPathingTypes, requiredPathingTypes, propWindow, turnRate, requirements, unitLevel, hero, strength, strPlus, agility, agiPlus, intelligence, intPlus, primaryAttribute, heroAbilityList, heroProperNames, properNamesCount, - canFlee, priority, revivesHeroes); + canFlee, priority, revivesHeroes, animationRunSpeed); this.unitIdToUnitType.put(typeId, unitTypeInstance); this.jassLegacyNameToUnitId.put(legacyName, typeId); }