Jump to content

Damage modifier based on temp

Recommended Posts

so im doing a subzero and scorpion mod and i need to know if theres a wy to change their damage output while cold or while hot respectively but i havent been able to find anything in files that relate to a temperature modification of anything outside of overheat temp and freezing temp. has anyone here come across something like it or know where i could loo to find a solution? id like to be able to have subzero do more damage at a certain temperature as opposed to all winter and the same for scorpion for heat as opposed to all summer. any guidance on this would be a great help. thank you in advance

Link to comment
Share on other sites


    function(inst, data)
        local temperature_current = data.new
        local scaling_factor = 1.0
        if temperature_current < 10
            scaling_factor = 2.0
        inst.components.combat.damagemultiplier = scaling_factor

You can do more advanced scaling using a custom math function for the scaling_factor such as linearly increasing damage from a temperature range, etc.

This should be in the master_postinit callback for the character.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...