Page 1 of 1

Damage Calculation

PostPosted: Tue Apr 15, 2014 22:25
by SegFault22
How is damage dealt with a weapon calculated?

PostPosted: Tue Apr 15, 2014 22:31
by Jordach
SegFault22 wrote:How is damage dealt with a weapon calculated?
I'll explain in the code tags;

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_tool("tools:sword_stone", {
    description = "Stone Sword",
    inventory_image = "tool_stonesword.png",
    tool_capabilities = {
        full_punch_interval = 4.1,
        max_drop_level = 0,
        groupcaps = {
            snappy={times={[1]=1.2, [2]=0.6, [3]=0.3}, uses=17, maxlevel=1},
        },
        damage_groups = {fleshy=5}, --this is how many hearts (to other players) the sword will do, and only until
                -- the sword has moved itself back into it's resting position, it will do full damage again, while waiting 2.05
                -- seconds means it will only do half the damage, while having to wait again to use it.
                -- i belive fleshy = 3 is the full damage, fleshy = 2 does 75%, and so on. immortal = 0 disables damage.
    }
})

PostPosted: Tue Apr 15, 2014 23:30
by SegFault22
Jordach wrote:
SegFault22 wrote:How is damage dealt with a weapon calculated?
I'll explain in the code tags;

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_tool("tools:sword_stone", {
    description = "Stone Sword",
    inventory_image = "tool_stonesword.png",
    tool_capabilities = {
        full_punch_interval = 4.1,
        max_drop_level = 0,
        groupcaps = {
            snappy={times={[1]=1.2, [2]=0.6, [3]=0.3}, uses=17, maxlevel=1},
        },
        damage_groups = {fleshy=5}, --this is how many hearts (to other players) the sword will do, and only until
                -- the sword has moved itself back into it's resting position, it will do full damage again, while waiting 2.05
                -- seconds means it will only do half the damage, while having to wait again to use it.
                -- i belive fleshy = 3 is the full damage, fleshy = 2 does 75%, and so on. immortal = 0 disables damage.
    }
})

Thank you. I didn't know that the proposal for damage was already implemented.