share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 12940 39b7b3ed619e
parent 12836 8610462e3d33
child 12941 ffbd31afed96
equal deleted inserted replaced
12939:0112ef349ddc 12940:39b7b3ed619e
   622 		if strucType[tempID] == loc("Healing Station") then
   622 		if strucType[tempID] == loc("Healing Station") then
   623 
   623 
   624 			if GetGearType(gear) == gtHedgehog then
   624 			if GetGearType(gear) == gtHedgehog then
   625 				if GetHogClan(gear) == strucClan[tempID] then
   625 				if GetHogClan(gear) == strucClan[tempID] then
   626 
   626 
   627 					hogLife = GetHealth(gear) + 1
   627 					local hogLife = GetHealth(gear)
   628 					if hogLife > 150 then
   628 					-- Heal hog by 1 HP, up to 150 HP total
   629 						hogLife = 150
   629 					if hogLife < 150 then
       
   630 						if ((hogLife + 1) % 5) == 0 then
       
   631 							-- Health anim every 5 HP
       
   632 							HealHog(gear, 1, false)
       
   633 						else
       
   634 							SetHealth(gear, hogLife+1)
       
   635 						end
   630 					end
   636 					end
   631 					SetHealth(gear, hogLife)
       
   632 
   637 
   633 					-- change this to the med kit sprite health ++++s later
   638 					-- change this to the med kit sprite health ++++s later
   634 					tempE = AddVisualGear(GetX(strucGear[tempID]), GetY(strucGear[tempID]), vgtSmoke, 0, true)
   639 					tempE = AddVisualGear(GetX(strucGear[tempID]), GetY(strucGear[tempID]), vgtSmoke, 0, true)
   635 					g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
   640 					g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
   636 					SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, colorGreen )
   641 					SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, colorGreen )