require "MF_ISMoodle"
MF.createMoodle("worgrimed")

-- GRIMED MOODLE
function WORgrimedMoodleUpdate(player)
    --print("Player dirtiness: " .. player:getModData().WORbodyDirtiness)
    --print("Player bloodiness: " .. player:getModData().WORbodyBloodiness)
    local moodle = MF.getMoodle("worgrimed", player:getPlayerNum())
    if moodle ~= nil then
        if (player:getModData().WORbodyDirtiness > 50 and player:getModData().WORbodyDirtiness <= 60) or
            (player:getModData().WORbodyBloodiness > 50 and player:getModData().WORbodyBloodiness <= 60) then
            moodle:setValue(0.4);
            --print("Moodle 1")
        elseif (player:getModData().WORbodyDirtiness > 60 and player:getModData().WORbodyDirtiness <= 75) or 
            (player:getModData().WORbodyBloodiness > 60 and player:getModData().WORbodyBloodiness <= 75) then
            moodle:setValue(0.3);
            --print("Moodle 2")
        elseif (player:getModData().WORbodyDirtiness > 75 and player:getModData().WORbodyDirtiness <= 90) or
            (player:getModData().WORbodyBloodiness > 75 and player:getModData().WORbodyBloodiness <= 90) then
            moodle:setValue(0.2);
            --print("Moodle 3")
        elseif (player:getModData().WORbodyDirtiness > 90 and player:getModData().WORbodyDirtiness <= 100) or 
            (player:getModData().WORbodyBloodiness > 90 and player:getModData().WORbodyBloodiness <= 100) then
            moodle:setValue(0.1);
            --print("Moodle 4")
        else
            moodle:setValue(0.5);
            --print("No Moodle")
        end
    end
end