# HG changeset patch # User sheepluva # Date 1473978125 -7200 # Node ID 6a0d6b00dac8e220514b2d828a544b6aaf76f8e1 # Parent 38e7206a5df420806671ac33903088005c7e9b33 Highlander: give visual and acustic feedback when weapons are collected from a kill, similar to collecting a crate diff -r 38e7206a5df4 -r 6a0d6b00dac8 ChangeLog.txt --- a/ChangeLog.txt Fri Sep 16 00:01:43 2016 +0200 +++ b/ChangeLog.txt Fri Sep 16 00:22:05 2016 +0200 @@ -8,6 +8,7 @@ Game engine: + Improved hedgehog spawns on maps that lack land mass or free space + Highlander mode displays game scheme specifics (mines timer, etc.) in ESC info + + Highlander mode gives visual and acustic feedback when weapons are collected from a kill, similar to collecting a crate + AI hedgehogs can now use Bee and Vampirism + Divided Teams mode will now work with more than 2 teams (Hint: you probably want to set world edges to "wrap" in such games) + Fort Mode will now work with more than 2 teams @@ -51,6 +52,7 @@ Lua-API: + New call: SetCinematicMode(enable) -- e.g. for cutscenes etc. + + New call: GetAmmoName(ammoType) -- returns the localized name for the specified ammoType 0.9.21 -> 0.9.22 + New Weapon / Map object: AirMine (floating mine that will follow nearby hedgehogs) diff -r 38e7206a5df4 -r 6a0d6b00dac8 hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Fri Sep 16 00:01:43 2016 +0200 +++ b/hedgewars/uGearsHedgehog.pas Fri Sep 16 00:22:05 2016 +0200 @@ -660,7 +660,7 @@ if cnt <> 0 then AddAmmo(HH, ammo, cnt) else AddAmmo(HH, ammo); - if IsHogLocal(@HH) or (GameType = gmtDemo) then + if IsHogLocal(@HH) then begin if cnt <> 0 then s:= trammo[Ammoz[ammo].NameId] + ansistring(' (+' + IntToStr(cnt) + ')') diff -r 38e7206a5df4 -r 6a0d6b00dac8 hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Fri Sep 16 00:01:43 2016 +0200 +++ b/hedgewars/uGearsUtils.pas Fri Sep 16 00:22:05 2016 +0200 @@ -1592,7 +1592,7 @@ function IsHogLocal(HH: PHedgehog): boolean; begin - IsHogLocal:= (not (HH^.Team^.ExtDriven or (HH^.BotLevel > 0))) or (HH^.Team^.Clan^.ClanIndex = LocalClan); + IsHogLocal:= (not (HH^.Team^.ExtDriven or (HH^.BotLevel > 0))) or (HH^.Team^.Clan^.ClanIndex = LocalClan) or (GameType = gmtDemo); end; end. diff -r 38e7206a5df4 -r 6a0d6b00dac8 share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua Fri Sep 16 00:01:43 2016 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua Fri Sep 16 00:22:05 2016 +0200 @@ -1,6 +1,6 @@ -------------------------------- -- HIGHLANDER / HOGS OF WAR --- version 0.4b +-- version 0.4b+ -- by mikade -------------------------------- @@ -216,7 +216,18 @@ -- this is called when a hog dies function TransferWeps(gear) - if CurrentHedgehog ~= nil then + if CurrentHedgehog ~= nil and CurrentHedgehog ~= gear then + + local x,y,color + local vgear + local vgtX, vgtY, vgtdX, vgtdY, vgtAngle, vgtFrame, vgtFrameTicks, vgtState, vgtTimer, vgtTint + local dspl = IsHogLocal(CurrentHedgehog) + local ammolist = '' + + if dspl then + x,y = GetGearPosition(CurrentHedgehog) + color = GetClanColor(GetHogClan(CurrentHedgehog)) + end for w,c in pairs(wepArray) do val = getGearValue(gear,w) @@ -230,10 +241,29 @@ else AddAmmo(CurrentHedgehog, w, val) end + if dspl then + if ammolist == '' then + ammolist = GetAmmoName(w) + else + ammolist = ammolist .. ' • ' .. GetAmmoName(w) + end + x = x + 2 + y = y + 32 + vgear = AddVisualGear(x, y, vgtAmmo, 0, true) + if vgear ~= nil then + vgtX,vgtY,vgtdX,vgtdY,vgtAngle,vgtFrame,vgtFrameTicks,vgtState,vgtTimer,vgtTint = GetVisualGearValues(vgear) + vgtFrame = w + SetVisualGearValues(vgear,vgtX,vgtY,vgtdX,vgtdY,vgtAngle,vgtFrame,vgtFrameTicks,vgtState,vgtTimer,vgtTint) + end + end end end + PlaySound(sndShotgunReload); + if dspl and ammolist ~= '' then + AddCaption(ammolist, color, capgrpAmmoinfo) + end end end