#do
#	function ExtractCloakMeshBlueprint(bp)
#		local meshid = bp.Display.MeshBlueprint
#		if not meshid then return end
#
#		local meshbp = original_blueprints.Mesh[meshid]
#		if not meshbp then return end
#
#		local shadername = 'UnitFormationPreview'
#
#		local cloakmeshbp = table.deepcopy(meshbp)
#		if cloakmeshbp.LODs then
#			for i,lod in cloakmeshbp.LODs do
#				lod.ShaderName = shadername
#			end
#		end
#		cloakmeshbp.BlueprintId = meshid .. '_cloak'
#		bp.Display.CloakMeshBlueprint = cloakmeshbp.BlueprintId
#		MeshBlueprint(cloakmeshbp)
#	end
#
#	local OldModBlueprints = ModBlueprints
#	function ModBlueprints(all_blueprints)
#		OldModBlueprints(all_blueprints)
#		for id,bp in all_blueprints.Unit do
#			ExtractCloakMeshBlueprint(bp)
#		end
#	end
#end

do

    local oldModBlueprints = ModBlueprints

    function ModBlueprints(all_bps)
        oldModBlueprints(all_bps)

        local initialMultFactor = 1.3
        local turnMultFactor = 1.2
        local directfireMultiplier = 1.8
        local antiairMultiplier = 1.8
        local antinavyMultiplier = 1.8
        local directfirenavalMultiplier = 1.3

        for id, bp in all_bps.Projectile do

            if bp.Physics.TurnRate then
                bp.Physics.TurnRate = bp.Physics.TurnRate * turnMultFactor

            end

            if bp.Physics.MaxSpeed then
                bp.Physics.MaxSpeed = bp.Physics.MaxSpeed * initialMultFactor

            end

            if bp.Physics.Acceleration then
                bp.Physics.Acceleration = bp.Physics.Acceleration * initialMultFactor

            end

        end


        for id, bp in all_bps.Unit do

            if bp.Weapon then

                for ik, wep in bp.Weapon do

                    if wep.MuzzleVelocity and not wep.ProjectileLifeTime then

                        if wep.WeaponCategory == 'Direct Fire' then
                          # decrease the lifetime so that projectiles don't fly all the way to China.
#                            wep.ProjectileLifetime = wep.ProjectileLifetime * turnMultFactor

                            wep.MuzzleVelocity = wep.MuzzleVelocity * directfireMultiplier
                            #LOG(bp.BlueprintId, " ", ik)
                            #LOG('*DIRECT FIRE WEAPONS MUZZLE VELOCITY INCREASED')

                        end
                        
                        if wep.WeaponCategory == 'Anti Air' then
                          # decrease the lifetime so that projectiles don't fly all the way to China.
#                            wep.ProjectileLifetime = wep.ProjectileLifetime * turnMultFactor

                            wep.MuzzleVelocity = wep.MuzzleVelocity * antiairMultiplier
                            #LOG(bp.BlueprintId, " ", ik)
                            #LOG('*ANTI AIR WEAPONS MUZZLE VELOCITY INCREASED')

                        end
                        
                        if wep.WeaponCategory == 'Anti Navy' then
                          # decrease the lifetime so that projectiles don't fly all the way to China.
#                            wep.ProjectileLifetime = wep.ProjectileLifetime * turnMultFactor

                            wep.MuzzleVelocity = wep.MuzzleVelocity * antinavyMultiplier
                            #LOG(bp.BlueprintId, " ", ik)
                            #LOG('*ANTI NAVY WEAPONS MUZZLE VELOCITY INCREASED')

                        end
                        
                        if wep.WeaponCategory == 'Direct Fire Naval' then
                          # decrease the lifetime so that projectiles don't fly all the way to China.
#                            wep.ProjectileLifetime = wep.ProjectileLifetime * turnMultFactor

                            wep.MuzzleVelocity = wep.MuzzleVelocity * directfirenavalMultiplier
                            #LOG(bp.BlueprintId, " ", ik)
                            #LOG('*ANTI NAVY WEAPONS MUZZLE VELOCITY INCREASED')

                        end
                    end

                end # bp.Weapon loop

            end

        end # all_bps.Unit loop

    end

end

do
    local oldModBlueprints = ModBlueprints

    function ModBlueprints(all_bps)
	    oldModBlueprints(all_bps)

        local econScale = 0.3
        
        --loop through the blueprints and adjust as desired.
        for id,bp in all_bps.Unit do
            for i, cat in bp.Categories do
            if cat == 'NAVAL' then
                if bp.Economy.BuildTime then
                   bp.Economy.BuildTime = bp.Economy.BuildTime - (bp.Economy.BuildTime * econScale)
                end
            end
            end
        end
    end

end