Skip to content

Commit

Permalink
Kill nearby zombies when player respawns
Browse files Browse the repository at this point in the history
Fixed bugs with itemeffectcomponent item pickup mappings
Classic tent 2 model fixed
Increased spike aura move speed decrease from 0.1/0.2/0.3/0.4/0.5 to 0.2/0.3/0.4/0.5/0.6
Reduced max number of crows alive to 2
Reduced max number of necros alive to 6/8/12
Fixed moving buildings in the map
  • Loading branch information
jlfarris91 committed Feb 16, 2021
1 parent 9570d5f commit 3399716
Show file tree
Hide file tree
Showing 18 changed files with 114 additions and 80 deletions.
Binary file not shown.
Binary file added imports/buildings/other/tent2/tent2.mdx
Binary file not shown.
Binary file modified maps/TheLastStand.w3x/war3map.doo
Binary file not shown.
18 changes: 9 additions & 9 deletions maps/TheLastStand.w3x/war3map.j
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ endfunction
//***************************************************************************

//===========================================================================
function CreateBuildingsForPlayer20 takes nothing returns nothing
function CreateUnitsForPlayer20 takes nothing returns nothing
local player p= Player(20)
local unit u
local integer unitID
Expand Down Expand Up @@ -145,7 +145,7 @@ function CreateBuildingsForPlayer20 takes nothing returns nothing
set u=BlzCreateUnitWithSkin(p, 'h003', 9300.1, 4735.7, 269.873, 'h003')
set u=BlzCreateUnitWithSkin(p, 'h006', 9595.6, 4509.6, 188.143, 'h006')
set u=BlzCreateUnitWithSkin(p, 'h004', 9489.6, 4671.7, 232.538, 'h004')
set u=BlzCreateUnitWithSkin(p, 'h008', 11202.7, 8659.5, 295.600, 'h008')
set u=BlzCreateUnitWithSkin(p, 'h008', 11180.8, 8650.5, 295.600, 'h008')
set u=BlzCreateUnitWithSkin(p, 'h01A', 5922.8, 2722.5, 192.717, 'h01A')
set u=BlzCreateUnitWithSkin(p, 'h013', 7952.5, 2878.0, 359.556, 'h013')
set u=BlzCreateUnitWithSkin(p, 'h009', 8990.2, 4420.6, 318.637, 'h009')
Expand Down Expand Up @@ -185,8 +185,8 @@ function CreateBuildingsForPlayer20 takes nothing returns nothing
set u=BlzCreateUnitWithSkin(p, 'h01J', - 1226.5, - 5776.7, 315.000, 'h01J')
set u=BlzCreateUnitWithSkin(p, 'h01N', - 10658.1, - 2400.3, 270.000, 'h01N')
set u=BlzCreateUnitWithSkin(p, 'h01H', - 11002.3, 1210.4, 38.031, 'h01H')
set u=BlzCreateUnitWithSkin(p, 'h005', 4203.9, - 7292.1, 274.990, 'h005')
set u=BlzCreateUnitWithSkin(p, 'h007', 4418.9, - 7299.5, 242.780, 'h007')
set u=BlzCreateUnitWithSkin(p, 'h005', 4198.7, - 7309.4, - 71.242, 'h005')
set u=BlzCreateUnitWithSkin(p, 'h007', 4482.9, - 7427.5, 242.780, 'h007')
set u=BlzCreateUnitWithSkin(p, 'h001', 1339.1, - 10026.5, 270.000, 'h001')
set u=BlzCreateUnitWithSkin(p, 'h01V', - 8549.1, - 8683.0, 270.000, 'h01V')
set u=BlzCreateUnitWithSkin(p, 'h017', - 236.5, - 2720.7, 268.946, 'h017')
Expand Down Expand Up @@ -217,12 +217,12 @@ function CreateBuildingsForPlayer20 takes nothing returns nothing
set u=BlzCreateUnitWithSkin(p, 'h00C', 5988.9, - 3649.4, 297.105, 'h00C')
set u=BlzCreateUnitWithSkin(p, 'h01U', 9944.6, 1489.9, 185.620, 'h01U')
set u=BlzCreateUnitWithSkin(p, 'h01T', 10014.0, 1533.2, 29.953, 'h01T')
set u=BlzCreateUnitWithSkin(p, 'h01A', 4056.9, - 7404.5, 37.585, 'h01A')
set u=BlzCreateUnitWithSkin(p, 'h01A', 3992.9, - 7532.5, 37.585, 'h01A')
set u=BlzCreateUnitWithSkin(p, 'h01K', 9959.1, 3661.2, 245.792, 'h01K')
set u=BlzCreateUnitWithSkin(p, 'h007', 9831.9, 3660.0, 358.373, 'h007')
set u=BlzCreateUnitWithSkin(p, 'h01A', 9967.6, 3580.9, 28.895, 'h01A')
set u=BlzCreateUnitWithSkin(p, 'h01N', 10799.1, 10774.0, 180.014, 'h01N')
set u=BlzCreateUnitWithSkin(p, 'h01A', 4062.2, - 7339.6, 289.784, 'h01A')
set u=BlzCreateUnitWithSkin(p, 'h01A', 3998.2, - 7467.6, 289.784, 'h01A')
set u=BlzCreateUnitWithSkin(p, 'h00D', 6758.0, 6432.5, 255.710, 'h00D')
set u=BlzCreateUnitWithSkin(p, 'h00C', 7175.8, 7947.0, 348.066, 'h00C')
set u=BlzCreateUnitWithSkin(p, 'h01U', 10886.1, 5675.4, 217.966, 'h01U')
Expand Down Expand Up @@ -277,17 +277,17 @@ endfunction

//===========================================================================
function CreatePlayerBuildings takes nothing returns nothing
call CreateBuildingsForPlayer20()
endfunction

//===========================================================================
function CreatePlayerUnits takes nothing returns nothing
call CreateUnitsForPlayer20()
endfunction

//===========================================================================
function CreateAllUnits takes nothing returns nothing
call CreateBuildingsForPlayer20() // INLINED!!
call CreatePlayerUnits()
call CreatePlayerBuildings()
call CreateUnitsForPlayer20() // INLINED!!
endfunction

//***************************************************************************
Expand Down
Binary file modified maps/TheLastStand.w3x/war3map.w3i
Binary file not shown.
Binary file modified maps/TheLastStand.w3x/war3map.w3u
Binary file not shown.
Binary file modified maps/TheLastStand.w3x/war3map.wpm
Binary file not shown.
Binary file modified maps/TheLastStand.w3x/war3mapMap.blp
Binary file not shown.
Binary file modified maps/TheLastStand.w3x/war3mapUnits.doo
Binary file not shown.
2 changes: 1 addition & 1 deletion wurst/Compile/Abilities/Ability_SpikeAura.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TlsBuffIds
import ObjectIds

public constant real array SPIKEAURA_ATTACK_SPEED_DECREASE = [0.1, 0.2, 0.3, 0.4, 0.5]
public constant real array SPIKEAURA_MOVE_SPEED_DECREASE = [0.1, 0.2, 0.3, 0.4, 0.5]
public constant real array SPIKEAURA_MOVE_SPEED_DECREASE = [0.2, 0.3, 0.4, 0.5, 0.6]

// ============================================================================
@compiletime function createAbility()
Expand Down
112 changes: 56 additions & 56 deletions wurst/Game/Waves/Generation/NormalNightWaveGenerator.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
..addSpawnWave(createSpawnWave_Ghosts(p, gameProgress))

// Tentacles (Invade, Melee)
waves.getOrCreateWave(gameProgress.nextWave())
..addSpawnWave(createSpawnWave_ForgottenOne(p, gameProgress))
// waves.getOrCreateWave(gameProgress.nextWave())
// ..addSpawnWave(createSpawnWave_ForgottenOne(p, gameProgress))

// Skeleton Marksman (Ranged)
waves.getOrCreateWave(gameProgress.nextWave())
Expand Down Expand Up @@ -161,8 +161,8 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
..addSpawnWave(createSpawnWave_Shades(p, gameProgress))

// Monolith (Invade, Summoner)
waves.getOrCreateWave(gameProgress.nextWave())
..addSpawnWave(createSpawnWave_Monolith(p, gameProgress))
// waves.getOrCreateWave(gameProgress.nextWave())
// ..addSpawnWave(createSpawnWave_Monolith(p, gameProgress))

// --------------------------------------------------------------------------
function getRandomSpawnPointProvider(SpawnRange range) returns ISpawnPointProvider
Expand Down Expand Up @@ -199,8 +199,8 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
let def = new SpawnWaveDefinition("Infectious Zombies")
..setTags(SpawnDefinitionTags.ground, SpawnDefinitionTags.melee, SpawnDefinitionTags.normal, SpawnDefinitionTags.poison)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromValue(6))
..setSpawnsPerActivation(FunctionalT.fromValue(6))
..setMaxAliveCount(FunctionalT.fromValue(4))
..setSpawnsPerActivation(FunctionalT.fromValue(4))
..setSpawnGroupingFactor(FunctionalT.fromValue(0.5))
..setActivator(new PeriodicWaveActivator(3.0))
..setSpawnPointProvider(getRandomSpawnPointProvider(SpawnRange.NEAR))
Expand All @@ -224,8 +224,8 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
let def = new SpawnWaveDefinition("Crows")
..setTags(SpawnDefinitionTags.flying, SpawnDefinitionTags.ranged, SpawnDefinitionTags.magic)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromFunc((real _waveProgress) -> lerpInt(1, 4, gameProgress.getCurrentGameProgress())))
..setSpawnsPerActivation(FunctionalT.fromFunc((real waveProgress) -> lerpInt(2, 4, waveProgress)))
..setMaxAliveCount(FunctionalT.fromValue(2))
..setSpawnsPerActivation(FunctionalT.fromValue(2))
..setSpawnGroupingFactor(FunctionalT.fromValue(0.0))
..setActivator(new PeriodicWaveActivator(10.0))
..setSpawnPointProvider(getRandomSpawnPointProvider(SpawnRange.MID))
Expand All @@ -244,7 +244,7 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
let def = new SpawnWaveDefinition("Necromancers")
..setTags(SpawnDefinitionTags.summoner, SpawnDefinitionTags.ranged, SpawnDefinitionTags.magic)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromFunc((real _waveProgress) -> lerpInt(4, 12, gameProgress.getCurrentGameProgress())))
..setMaxAliveCount(FunctionalT.fromValue(6))
..setSpawnsPerActivation(FunctionalT.fromValue(1))
..setSpawnGroupingFactor(FunctionalT.fromValue(0.0))
..setActivator(new PeriodicWaveActivator(10.0)..setActivateOnStart(false))
Expand All @@ -264,7 +264,7 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
let def = new SpawnWaveDefinition("Greater Necromancers")
..setTags(SpawnDefinitionTags.summoner, SpawnDefinitionTags.ranged, SpawnDefinitionTags.magic)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromFunc((real waveProgress) -> lerpInt(2, 8, waveProgress)))
..setMaxAliveCount(FunctionalT.fromValue(8))
..setSpawnsPerActivation(FunctionalT.fromValue(2))
..setSpawnGroupingFactor(FunctionalT.fromValue(1.0))
..setActivator(new PeriodicWaveActivator(5.0))
Expand All @@ -284,7 +284,7 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
let def = new SpawnWaveDefinition("Ethereal Necromancers")
..setTags(SpawnDefinitionTags.summoner, SpawnDefinitionTags.ranged, SpawnDefinitionTags.magic)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromFunc((real waveProgress) -> lerpInt(2, 8, waveProgress)))
..setMaxAliveCount(FunctionalT.fromValue(12))
..setSpawnsPerActivation(FunctionalT.fromValue(2))
..setSpawnGroupingFactor(FunctionalT.fromValue(1.0))
..setActivator(new PeriodicWaveActivator(5.0))
Expand Down Expand Up @@ -499,29 +499,29 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
return new SpawnWave(def, p)

// --------------------------------------------------------------------------
private function createSpawnWave_ForgottenOne(player p, IGameWaveProgress gameProgress) returns SpawnWave
let def = new SpawnWaveDefinition("Forgotten One")
..setTags(SpawnDefinitionTags.invade, SpawnDefinitionTags.melee, SpawnDefinitionTags.normal)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromValue(1))
..setMaxSpawnCount(FunctionalT.fromValue(1))
..setSpawnsPerActivation(FunctionalT.fromValue(1))
..setSpawnGroupingFactor(FunctionalT.fromValue(0.0))
..setActivator(new PeriodicWaveActivator(5.0))
..setSpawnPointProvider(getRandomSpawnPointProvider(SpawnRange.MID))
..setUnitTypeProvider(new SingleUnitTypeProvider(TlsUnitIds.Undead.forgottenOne))

def.getUnitModifier(TlsUnitIds.Undead.forgottenOne)
..setTargetPlayer(p)
..standardEliteMaxHp(gameProgress)
..standardEliteArmor(gameProgress)
..standardEliteAttack1DamageRange(gameProgress)
..standardEliteAttack1Cooldown(gameProgress)
..guaranteeGrantCoinsOnDeath(gameProgress)
..standardEliteGrantLumberOnDeath(rangeInt(10,10))
..setDefenseType(ArmorType.Hero)

return new SpawnWave(def, p)
// private function createSpawnWave_ForgottenOne(player p, IGameWaveProgress gameProgress) returns SpawnWave
// let def = new SpawnWaveDefinition("Forgotten One")
// ..setTags(SpawnDefinitionTags.invade, SpawnDefinitionTags.melee, SpawnDefinitionTags.normal)
// ..setProgress(g_nightProgress)
// ..setMaxAliveCount(FunctionalT.fromValue(1))
// ..setMaxSpawnCount(FunctionalT.fromValue(1))
// ..setSpawnsPerActivation(FunctionalT.fromValue(1))
// ..setSpawnGroupingFactor(FunctionalT.fromValue(0.0))
// ..setActivator(new PeriodicWaveActivator(5.0))
// ..setSpawnPointProvider(getRandomSpawnPointProvider(SpawnRange.MID))
// ..setUnitTypeProvider(new SingleUnitTypeProvider(TlsUnitIds.Undead.forgottenOne))

// def.getUnitModifier(TlsUnitIds.Undead.forgottenOne)
// ..setTargetPlayer(p)
// ..standardEliteMaxHp(gameProgress)
// ..standardEliteArmor(gameProgress)
// ..standardEliteAttack1DamageRange(gameProgress)
// ..standardEliteAttack1Cooldown(gameProgress)
// ..guaranteeGrantCoinsOnDeath(gameProgress)
// ..standardEliteGrantLumberOnDeath(rangeInt(10,10))
// ..setDefenseType(ArmorType.Hero)

// return new SpawnWave(def, p)

// --------------------------------------------------------------------------
private function createSpawnWave_SkeletonChampions(player p, IGameWaveProgress gameProgress) returns SpawnWave
Expand Down Expand Up @@ -578,28 +578,28 @@ public class NormalNightWaveGenerator implements IWaveGenerator<NightWave>
return new SpawnWave(def, p)

// --------------------------------------------------------------------------
private function createSpawnWave_Monolith(player p, IGameWaveProgress gameProgress) returns SpawnWave
let def = new SpawnWaveDefinition("Monolith")
..setTags(SpawnDefinitionTags.invade, SpawnDefinitionTags.ranged, SpawnDefinitionTags.fortified, SpawnDefinitionTags.magic)
..setProgress(g_nightProgress)
..setMaxAliveCount(FunctionalT.fromFunc((real waveProgress) -> lerpInt(2, 8, waveProgress)))
..setSpawnsPerActivation(FunctionalT.fromValue(2))
..setSpawnGroupingFactor(FunctionalT.fromValue(1.0))
..setActivator(new PeriodicWaveActivator(5.0))
..setSpawnPointProvider(getRandomSpawnPointProvider(SpawnRange.CLOSE))
..setUnitTypeProvider(new SingleUnitTypeProvider(TlsUnitIds.Undead.monolith))

def.getUnitModifier(TlsUnitIds.Undead.monolith)
..setTargetPlayer(p)
..standardEliteMaxHp(gameProgress)
..standardEliteArmor(gameProgress)
..standardEliteAttack1DamageRange(gameProgress)
..standardEliteAttack1Cooldown(gameProgress)
..guaranteeGrantCoinsOnDeath(gameProgress)
..standardEliteGrantLumberOnDeath(rangeInt(500,500))
..setDefenseType(ArmorType.Fortified)

return new SpawnWave(def, p)
// private function createSpawnWave_Monolith(player p, IGameWaveProgress gameProgress) returns SpawnWave
// let def = new SpawnWaveDefinition("Monolith")
// ..setTags(SpawnDefinitionTags.invade, SpawnDefinitionTags.ranged, SpawnDefinitionTags.fortified, SpawnDefinitionTags.magic)
// ..setProgress(g_nightProgress)
// ..setMaxAliveCount(FunctionalT.fromFunc((real waveProgress) -> lerpInt(2, 8, waveProgress)))
// ..setSpawnsPerActivation(FunctionalT.fromValue(2))
// ..setSpawnGroupingFactor(FunctionalT.fromValue(1.0))
// ..setActivator(new PeriodicWaveActivator(5.0))
// ..setSpawnPointProvider(getRandomSpawnPointProvider(SpawnRange.CLOSE))
// ..setUnitTypeProvider(new SingleUnitTypeProvider(TlsUnitIds.Undead.monolith))

// def.getUnitModifier(TlsUnitIds.Undead.monolith)
// ..setTargetPlayer(p)
// ..standardEliteMaxHp(gameProgress)
// ..standardEliteArmor(gameProgress)
// ..standardEliteAttack1DamageRange(gameProgress)
// ..standardEliteAttack1Cooldown(gameProgress)
// ..guaranteeGrantCoinsOnDeath(gameProgress)
// ..standardEliteGrantLumberOnDeath(rangeInt(500,500))
// ..setDefenseType(ArmorType.Fortified)

// return new SpawnWave(def, p)

// --------------------------------------------------------------------------
private function createSpawnWave_MeatWagons(player p, IGameWaveProgress gameProgress) returns SpawnWave
Expand Down
10 changes: 10 additions & 0 deletions wurst/Heroes/Heroes.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import Orders
import MainItemLibrary
import TlsItemIds
import SurvivorSpawnManager
import GroupUtils
import GameConstants

// ============================================================================
public function spawnHeroForPlayer(player p, vec2 pos, bool firstTime) returns unit
Expand Down Expand Up @@ -58,6 +60,14 @@ public function spawnInitialPlayerUnitsAtRandomPoint(player p, bool firstTime)
return

let hero = spawnHeroForPlayer(p, sp.spawnPoint, firstTime)

// kill nearby zombies
let temp = getGroup()
temp.enumUnitsInRange(sp.spawnPoint, 512)
for _unit in temp
if (_unit.isAlive() and _unit.getOwner() == PLAYER_UNDEAD)
_unit.kill()
temp.release()

// Create survivors for the player to start with
spawnInitialSurvivorsForPlayer(p, hero)
Expand Down
9 changes: 8 additions & 1 deletion wurst/Items/BloodRedCape.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,11 @@ function IUnitMetadata.getOrAddBloodRedCapeComponent() returns BloodRedCapeCompo

// ============================================================================
init
g_itemIdToComponentFactoryMap.put(TlsItemIds.bloodRedCape, _unit -> _unit.getMetadata().getOrAddBloodRedCapeComponent())
g_itemIdToComponentFactoryMap.put(TlsItemIds.bloodRedCape) _unit ->
//{
let metadata = _unit.getMetadata()
ItemEffectComponent comp = null
if (metadata != null)
comp = metadata.getOrAddBloodRedCapeComponent()
return comp
//}
10 changes: 9 additions & 1 deletion wurst/Items/BrassContraption.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,13 @@ function onUnitDamageDealt()

// ============================================================================
init
g_itemIdToComponentFactoryMap.put(TlsItemIds.brassContraption, _unit -> _unit.getMetadata().getOrAddBrassContraptionComponent())
g_itemIdToComponentFactoryMap.put(TlsItemIds.brassContraption) (_unit) ->
//{
let metadata = _unit.getMetadata()
ItemEffectComponent comp = null
if (metadata != null)
comp = metadata.getOrAddBrassContraptionComponent()
return comp
//}

DamageEvent.addListener(DAMAGE_EVENT_PRIO_FINAL, () -> onUnitDamageDealt())
2 changes: 2 additions & 0 deletions wurst/Items/LightningRod.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ function onUnitDamageDealt()
// ============================================================================
init
g_itemIdToComponentFactoryMap.put(TlsItemIds.lightningRod) (_unit) ->
//{
let metadata = _unit.getMetadata()
ItemEffectComponent comp = null
if (metadata != null)
comp = metadata.getOrAddLightningRodComponent()
return comp
//}

DamageEvent.addListener(DAMAGE_EVENT_PRIO_FINAL, () -> onUnitDamageDealt())
12 changes: 10 additions & 2 deletions wurst/Items/WisdomKnuckle.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,13 @@ function onUnitDamageDealt()

// ============================================================================
init
g_itemIdToComponentFactoryMap.put(TlsItemIds.wisdomKnuckle, _unit -> _unit.getMetadata().getOrAddWisdomKnuckleComponent())
DamageEvent.addListener(DAMAGE_EVENT_PRIO_FINAL, () -> onUnitDamageDealt())
DamageEvent.addListener(DAMAGE_EVENT_PRIO_FINAL, () -> onUnitDamageDealt())

g_itemIdToComponentFactoryMap.put(TlsItemIds.wisdomKnuckle) _unit ->
//{
let metadata = _unit.getMetadata()
ItemEffectComponent comp = null
if (metadata != null)
comp = metadata.getOrAddWisdomKnuckleComponent()
return comp
//}
1 change: 0 additions & 1 deletion wurst/Lootables/LootableFactory.wurst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import SpawnWaveDefinitionExtensions
import Math
import ObjEditingCommons
import ZombieUnitModifier
import Functional

constant ItemChances g_smallLootableItemChances = ItemChances(64.0, 24.0, 8.0, 1.0)
constant ItemChances g_mediumLootableItemChances = ItemChances(32.0, 32.0, 16.0, 1.0)
Expand Down
Loading

0 comments on commit 3399716

Please sign in to comment.