share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
changeset 12969 2fee2ee717eb
parent 12968 b27960c83818
child 12972 d82e4e583805
equal deleted inserted replaced
12968:b27960c83818 12969:2fee2ee717eb
   126 local colorHealingStation = 0xFF808040 -- Just a slight glow
   126 local colorHealingStation = 0xFF808040 -- Just a slight glow
   127 local colorBioFilter = 0xFF0000FF
   127 local colorBioFilter = 0xFF0000FF
   128 local colorReflectorShield = 0xFFAE00FF
   128 local colorReflectorShield = 0xFFAE00FF
   129 local colorWeaponFilter =  0xA800FFFF
   129 local colorWeaponFilter =  0xA800FFFF
   130 
   130 
   131 local colorHealingStationParticle = 0x00FF00FF
   131 local colorHealingStationParticle = 0x00FF0080
       
   132 local colorGeneratorParticle = 0xFFFF00FF
   132 
   133 
   133 local colorMessageError = 0xFFFFFFFF
   134 local colorMessageError = 0xFFFFFFFF
   134 
   135 
   135 -- Fake ammo types, for the overwritten weapons in Construction Mode
   136 -- Fake ammo types, for the overwritten weapons in Construction Mode
   136 local amCMStructurePlacer = amAirAttack
   137 local amCMStructurePlacer = amAirAttack
   704 						else
   705 						else
   705 							SetHealth(gear, hogLife+1)
   706 							SetHealth(gear, hogLife+1)
   706 						end
   707 						end
   707 					end
   708 					end
   708 
   709 
   709 					-- change this to the med kit sprite health ++++s later
   710 					-- Maybe find better animation?
   710 					local tempE = AddVisualGear(GetX(strucGear[sID]), GetY(strucGear[sID]), vgtSmoke, 0, true)
   711 					local tempE = AddVisualGear(GetX(strucGear[sID]), GetY(strucGear[sID]), vgtSmoke, 0, false)
   711 					SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, colorHealingStationParticle)
   712 					SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, colorHealingStationParticle)
   712 
   713 
   713 				end
   714 				end
   714 			end
   715 			end
   715 
   716 
   842 		-- for girders, mines, sticky mines and barrels
   843 		-- for girders, mines, sticky mines and barrels
   843 		elseif strucType[sID] == "Construction Station" then
   844 		elseif strucType[sID] == "Construction Station" then
   844 
   845 
   845 			if GetGearType(gear) == gtHedgehog then
   846 			if GetGearType(gear) == gtHedgehog then
   846 				if GetHogClan(gear) == strucClan[sID] then
   847 				if GetHogClan(gear) == strucClan[sID] then
   847 					AddVisualGear(GetX(strucGear[sID]), GetY(strucGear[sID]), vgtSmoke, 0, true)
   848 					AddVisualGear(GetX(strucGear[sID]), GetY(strucGear[sID]), vgtSmoke, 0, false)
   848 
   849 
   849 					sProx["Girder Placement Mode"] = true
   850 					sProx["Girder Placement Mode"] = true
   850 					sProx["Rubber Placement Mode"] = true
   851 					sProx["Rubber Placement Mode"] = true
   851 					sProx["Mine Placement Mode"] = true
   852 					sProx["Mine Placement Mode"] = true
   852 					sProx["Sticky Mine Placement Mode"] = true
   853 					sProx["Sticky Mine Placement Mode"] = true
   860 		-- for weapon, utility, and med crates
   861 		-- for weapon, utility, and med crates
   861 		elseif strucType[sID] == "Support Station" then
   862 		elseif strucType[sID] == "Support Station" then
   862 
   863 
   863 			if GetGearType(gear) == gtHedgehog then
   864 			if GetGearType(gear) == gtHedgehog then
   864 				if GetHogClan(gear) == strucClan[sID] then
   865 				if GetHogClan(gear) == strucClan[sID] then
   865 					AddVisualGear(GetX(strucGear[sID]), GetY(strucGear[sID]), vgtSmoke, 0, true)
   866 					AddVisualGear(GetX(strucGear[sID]), GetY(strucGear[sID]), vgtSmoke, 0, false)
   866 
   867 
   867 					sProx["Health Crate Placement Mode"] = true
   868 					sProx["Health Crate Placement Mode"] = true
   868 					sProx["Weapon Crate Placement Mode"] = true
   869 					sProx["Weapon Crate Placement Mode"] = true
   869 					sProx["Utility Crate Placement Mode"] = true
   870 					sProx["Utility Crate Placement Mode"] = true
   870 
   871 
   924 				for z = 0, ClansCount-1 do
   925 				for z = 0, ClansCount-1 do
   925 					if z == strucClan[i] then
   926 					if z == strucClan[i] then
   926 						increaseGearValue(strucGear[i],"power")
   927 						increaseGearValue(strucGear[i],"power")
   927 						if getGearValue(strucGear[i],"power") == 10 then
   928 						if getGearValue(strucGear[i],"power") == 10 then
   928 							setGearValue(strucGear[i],"power",0)
   929 							setGearValue(strucGear[i],"power",0)
   929 							clanPower[z] = clanPower[z] + 1
   930 
   930 							if conf_maxEnergy ~= "inf" and clanPower[z] > conf_maxEnergy then
   931 							-- Add 1 energy (if not at max. already)
   931 								clanPower[z] = conf_maxEnergy
   932 							if not (conf_maxEnergy ~= "inf" and clanPower[z] + 1 > conf_maxEnergy) then
       
   933 								clanPower[z] = clanPower[z] + 1
       
   934 
       
   935 								-- Spawn one particle per energy added
       
   936 								local particle = AddVisualGear(GetX(strucGear[i]), GetY(strucGear[i])-16, vgtStraightShot, sprStar, false)
       
   937 								SetVisualGearValues(particle, nil, nil, math.random(-100, 100)*0.00005, 0.02, math.random(360), 0, 900, nil, 0, colorGeneratorParticle)
       
   938 
       
   939 							else
       
   940 
       
   941 								SetVisualGearValues(strucAltDisplay[i], GetX(strucGear[i]), GetY(strucGear[i]), 0, 0, nil, nil, 800000, sprTarget)
   932 							end
   942 							end
       
   943 
       
   944 
   933 						end
   945 						end
   934 
   946 
   935 					end
   947 					end
   936 				end
   948 				end
   937 			end
   949 			end