# HG changeset patch # User nemo # Date 1441209337 14400 # Node ID c632b47b8ff0bd9c608ef9cdffaa1fa396176f53 # Parent f10a4bdfa0f4188a296bf4ede5693cae99f7c946 Trying to get these scripts to behave properly, still WIP though. diff -r f10a4bdfa0f4 -r c632b47b8ff0 share/hedgewars/Data/Maps/ClimbHome/map.lua --- a/share/hedgewars/Data/Maps/ClimbHome/map.lua Wed Sep 02 16:58:31 2015 +0200 +++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua Wed Sep 02 11:55:37 2015 -0400 @@ -88,9 +88,7 @@ dummyHog = AddHog(" ", 0, 1, "NoHat") HH[dummyHog] = nil totalHedgehogs = totalHedgehogs - 1 - if not showWaterStats then - SendStat(siClanHealth, tostring(32640), " ") - end + teams[GetHogTeamName(dummyHog)] = nil SendStat(siClanHealth, tostring(32640), " ") end end @@ -112,6 +110,8 @@ elseif gear == Cake then Cake = nil elseif GetGearType(gear) == gtHedgehog then + onGameTick20() + onGearDamage(gear, 0) HH[gear] = nil end end @@ -595,6 +595,7 @@ else SendStat(siCustomAchievement, string.format(text, RecordHeightHogName)) end + SendStat(siPointType, loc("points")) SendStat(siPlayerKills, actualHeight, loc(GetHogTeamName(CurrentHedgehog))) EndGame() end @@ -629,7 +630,7 @@ SendStat(siGraphTitle, string.format(loc("Team’s best heights per round"))) if winner.score < 1500 then - SendStat(siCustomAchievement, string.format(loc("This round’s award for ulitmate disappointment goes to: Everyone!"))) + SendStat(siCustomAchievement, string.format(loc("This round’s award for ultimate disappointment goes to: Everyone!"))) else if winner.score > 30000 then text = loc("%s (%s) reached for the sky and beyond with a height of %d!") elseif winner.score > 24750 then text = loc("%s (%s) was certainly not afraid of heights: Peak height of %d!") diff -r f10a4bdfa0f4 -r c632b47b8ff0 share/hedgewars/Data/Missions/Training/ClimbHome.lua --- a/share/hedgewars/Data/Missions/Training/ClimbHome.lua Wed Sep 02 16:58:31 2015 +0200 +++ b/share/hedgewars/Data/Missions/Training/ClimbHome.lua Wed Sep 02 11:55:37 2015 -0400 @@ -1,11 +1,18 @@ HedgewarsScriptLoad("/Scripts/Locale.lua") -isSinglePlayer = true +local isSinglePlayer = true -- trying to allow random theme, but fixed theme objects... -- Also skip some ugly themes, or ones where the sky is "meh" --local themes = { "Art","Cake","City","EarthRise","Halloween","Olympics","Underwater","Bamboo","Castle","Compost","Eyes","Hell","Planes","Bath","Cave","CrazyMission","Freeway","Island","Sheep","Blox","Cheese","Deepspace","Fruit","Jungle","Snow","Brick","Christmas","Desert","Golf","Nature","Stage" } local themes = {"Christmas","Hell","Bamboo","City","Island","Bath","Compost","Jungle","Desert","Nature","Olympics","Brick","EarthRise","Sheep","Cake","Freeway","Snow","Castle","Fruit","Stage","Cave","Golf","Cheese","Halloween"} +local showWaterStats = true -- uses the AI team to draw water height. +local scaleGraph = true +local totalHedgehogs = 0 +local HH = {} +local teams = {} +local dummyHog = nil + function onGameInit() -- Ensure people get same map for same theme @@ -16,10 +23,19 @@ DisableGameFlags(gfBottomBorder+gfBorder) CaseFreq = 0 Explosives = 0 + MineDudPercent = 0 Map = "ClimbHome" AddTeam(loc("Lonely Hog"), 0xDD0000, "Simple", "Island", "Default") player = AddHog(loc("Climber"), 0, 1, "NoHat") - AddTeam(loc("Water Gods"), 0x4980C1, "Simple", "Island", "Default") - dummyHog = AddHog("Poseidon", 5, 1, "NoHat") - --HideHog(dummyHog) + if showWaterStats then + AddTeam(" ", 0x545C9D, "Simple", "Island", "Default") + elseif scaleGraph then + AddTeam(" ", 0x050505, "Simple", "Island", "Default") + end + if showWaterStats or scaleGraph then + dummyHog = AddHog(" ", 0, 1, "NoHat") + HH[dummyHog] = nil + totalHedgehogs = totalHedgehogs - 1 + SendStat(siClanHealth, tostring(32640), " ") + end end