Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Improve the bodyheat indicator
#4
I agree that bodytemp is silly. For reference:

Code:
    proc/update_temp_indicator()
        if (!bodytemp)
            return
        if(master.burning && !master.is_heat_resistant())
            bodytemp.icon_state = "tempF" // on fire
            bodytemp.tooltipTheme = "tempInd tempIndF"
            bodytemp.desc = "OH FUCK FIRE FIRE FIRE OH GOD FIRE AAAAAAA"
            return

        var/dev = master.get_temp_deviation()
        var/state
        switch(dev)
            if(4)
                state = 4 // burning up
                bodytemp.desc = "It's scorching hot!"
            if(3)
                state = 3 // far too hot
                bodytemp.desc = "It's too hot."
            if(2)
                state = 2 // too hot
                bodytemp.desc = "It's a bit warm, but nothing to worry about."
            if(1)
                state = 1 // warm but safe
                bodytemp.desc = "It feels a little warm."
            if(-1)
                state = -1 // cool but safe
                bodytemp.desc = "It feels a little cool."
            if(-2)
                state = -2 // too cold
                bodytemp.desc = "It's a little cold, but nothing to worry about."
            if(-3)
                state = -3 // far too cold
                bodytemp.desc = "It's too cold."
            if(-4)
                state = -4 // freezing
                bodytemp.desc = "It's absolutley freezing!"
            else
                state = 0 // 310 is optimal body temp
                bodytemp.desc = "The temperature feels fine."

        bodytemp.icon_state = "temp[state]"
bodytemp.tooltipTheme = "tempInd tempInd[state]"

Code:
/mob/proc/get_temp_deviation()
    var/tempdiff = src.bodytemperature - src.base_body_temp
    var/tol = src.temp_tolerance
    var/ntl = 0 - src.temp_tolerance // these are just to make the switch a bit easier to look at

    if (tempdiff > tol*4)
        return 4 // some like to be on fire
    else if (tempdiff < ntl*4)
        return -4 // i think my ears just froze off oh god
    else if (tempdiff > tol*3)
        return 3 // some like it too hot
    else if (tempdiff < ntl*3)
        return -3 // too chill
    else if (tempdiff > tol*2)
        return 2 // some like it hot
    else if (tempdiff < ntl*2)
        return -2 // pretty chill
    else if (tempdiff > tol*1)
        return 1 // some like it warm
    else if (tempdiff < ntl*1)
        return -1 // a little bit chill
    else
        return 0 // I'M APOLLO JUSTICE AND I'M FINE

Code:
    var/base_body_temp = 310.055
    var/temp_tolerance = 15 // iterations between each temperature state

So basically, +/- 60(K/C) from your base body temp (310.55) maxes out your meters. In a game where body temp can be absolute zero or hotter than the center of a star, and survive, that just doesn't translate to much.

Cue me fucking up simple math but I just glanced over it, so sue meh.
Reply


Messages In This Thread
Improve the bodyheat indicator - by kyle2143 - 09-15-2018, 03:56 PM
RE: Improve the bodyheat indicator - by kyle2143 - 09-15-2018, 09:25 PM
RE: Improve the bodyheat indicator - by Vitatroll - 09-15-2018, 09:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)