--[[
作者：小开心
请不要擅自修改或删除
请尊重版权
@

说明：
想患 懒癌强迫症
]]

return function( LocoMotor )

    LocoMotor.bonussource = {}

    function LocoMotor:SetExternalSpeedMultiplier(source, key, m)
        m = m - 1
        if self.bonussource == nil then
            self.bonussource = {}
        end
        if self.bonussource[key] == nil then
            self.bonussource[key] = m
            self.bonusspeed = self.bonusspeed + self.walkspeed * m 
        end
    end

    function LocoMotor:RemoveExternalSpeedMultiplier(source, key) 
        if self.bonussource == nil then
            self.bonussource = {}
        end
        local mult = self.bonussource[key] or 0
        self.bonussource[key] = nil
        self.bonusspeed = self.bonusspeed - self.walkspeed * mult
    end
end
