# HG changeset patch # User Wuzzy # Date 1554743762 -7200 # Node ID a9f32ff533893d8da6ccc976505c5d3d1037ec2d # Parent f5dcf47dff2cf918cb37120dba95cb129e270fe3 WxW: Play taunt if crate spawns between turns diff -r f5dcf47dff2c -r a9f32ff53389 share/hedgewars/Data/Scripts/Multiplayer/WxW.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua Mon Apr 08 19:02:01 2019 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua Mon Apr 08 19:16:02 2019 +0200 @@ -853,15 +853,20 @@ end function onCaseDrop() + local crates if roundN == 100 then allowCrate = crateGearsInGame < maxCrates - CheckCrateConditions() + crates = CheckCrateConditions() + end + if type(crates) == "table" and #crates > 0 and CurrentHedgehog then + PlaySound(sndReinforce, CurrentHedgehog) end end function CheckCrateConditions() local crateSpawn = AreCratesUnlocked() + local crates = {} if crateSpawn == true and crateSpawned == false then UnfreezeCrates() @@ -872,7 +877,7 @@ toSpawn = maxCrates - cratesInGame end for i=1,toSpawn do - SpawnSupplyCrate(0, 0, weapons[1+GetRandom(#weapons)] ) + table.insert(crates, SpawnSupplyCrate(0, 0, weapons[1+GetRandom(#weapons)])) end rPingTimer = 0 rAlpha = 0 @@ -882,6 +887,7 @@ end end + return crates end function onGearWaterSkip(gear)