Takes a lot of movement points, can be used to ‘kick’ away a single zombie, (perhaps stun, and this would provide a more ‘legit’ alternative to bush-kiting), but it takes the mass of the player and the mass of the zombie into consideration.
So, With a minimum strength level the player could kick a single zombie away a single tile.
A Child zombie would be kicked twice as far, but a fat zombie would have a large chance for failure.
Or, the player themselves could be pushed backwards instead.
With higher mass disparities & strength, (saaay, a 30-strength bionic commando kicking a 3-ton truck), the player could send themselves flying multiple tiles at a time. A nifty feature for high-strength bionic commandos or beefy-but-light mutants.
Another thing to consider: health of the kicked object. Gibbing child-zeds, kicking holes in walls, bending car doors.
So, the math…
It’d need to have a minimum strength to do anything
The player would have to be subject to it as well.
There’d have to be a random chance in there as well to account for failures against enemies that are just barely within the character’s strength/mass bracket.
Distance pushed dependent on both strength & mass.
Health of pushed object.
[spoiler=If my life literally depended on me somehow writing the code for this…]
If monstermass-playermass >1 ;If the monster weighs more
set player.movement to (opposite direction) speed=(player.basemass*(1+(strength-minstrengthtoseefasterpushes)))/player.mass;So, the distance being pushed will default to 1 tile all else being normal. However, it gets bonus distance proportional to the strength above the minimum strength required for faster pushes. This could probably be tweaked better, but in the meantime it means a stronger player can launch themselves farther. However however, this gets a boost/damper based on player mass- if the player is average-sized, it will be negated, (if basemass=mass, then basemass/mass=1). But if the player is larger or smaller than normal they are shoved accordingly farther or lesser, (if basemass>mass, distance is multiplied by basemass(larger)/mass(smaller)…meanwhile if basemass<mass, distance is multiplied by basemass(smaller)/mass(larger)). End result, hulking bear-men can’t launch themselves nearly as easily, but sprightly bird-men can swish-off at twice the speed.
Start objdmgcalc
end
If monstermass-playermass >=-1 and <=1 ;If they’re about the same weight
Get randnumber
If randnumber >=75
set player.movement to (opposite direction) speed=1
Start objdmgcalc
end
If randnumber <75 and >25
Start objdmgcalc
end
If randnumber <=25
set monster.movement to (direction) speed=1
Start objdmgcalc
end
If Monstermass-playermass <-1 ;If the player weighs more
Start objdmgcalc
If objbroken !=1
set monster.movement to (direction) speed=(1+(strength-minstrengthtoseefasterpushes))
end
If objbroken =1
set monster.movement to (direction) speed=(1+(.5*(strength-minstrengthtoseefasterpushes)));If the player breaks what they’re kicking, energy is dispersed into the breakage and it doesn’t go as far. (so an intact zombie-child will fly 10 tiles, but a gibbed-one will only go 5)
set objbroken to 0
end
[objdmgcalc]
If player.strength < objhlth ;If the player’s strength isn’t high enough to damage the object, don’t calculate how much damage is done
end
else
deal ((player.strength/objhlth)-1)*totalobjhp to obj; (Damage is done proportional to how vastly exceeded the ‘minimum strength requirement to deal damage’ is exceeded. 150% required = 50% total health dealt in damage)
If player.strength/objhlth >=2 ;If the damage = 100% of the object’s health, it gets ‘broken’ and doesn’t fly as far
set objbroken to 1
end
end
end [/spoiler]