tackler
#tackle.dm
For when you want to throw a person at something and have fun stuff happen
This component is made for carbon mobs (really, humans), and allows its parent to throw themselves and perform tackles. This is done by enabling throw mode, then clicking on your intended target with an empty hand. You will then launch toward your target. If you hit a carbon, you'll roll to see how hard you hit them. If you hit a solid non-mob, you'll roll to see how badly you just messed yourself up. If, along your journey, you hit a table, you'll slam onto it and send up to MAX_TABLE_MESSES (8) /obj/items on the table flying, and take a bit of extra damage and stun for each thing launched.
There are 2 """skill rolls""" involved here, which are handled and explained in sack() and rollTackle() (for roll 1, carbons), and splat() (for roll 2, walls and solid objects)
Vars | |
base_knockdown | Launching a tackle calls Knockdown on you for this long, so this is your cooldown. Once you stand back up, you can tackle again. |
---|---|
min_distance | Some gloves, generally ones that increase mobility, may have a minimum distance to fly. Rocket gloves are especially dangerous with this, be sure you'll hit your target or have a clear background if you miss, or else! |
range | Your max range for how far you can tackle. |
skill_mod | A flat modifier to your roll against your target, as described in rollTackle(). Slightly misleading, skills aren't relevant here, this is a matter of what type of gloves (or whatever) is granting you the ability to tackle. |
speed | How fast you sail through the air. Standard tackles are 1 speed, but gloves that throw you faster come at a cost: higher speeds make it more likely you'll be badly injured if you fly into a non-mob obstacle. |
stamina_cost | How much stamina it takes to launch a tackle |
tackle_ref | The throwdatum we're currently dealing with, if we need it |
tackling | If we're currently tackling or are on cooldown. Actually, shit, if I use this to handle cooldowns, then getting thrown by something while on cooldown will count as a tackle..... whatever, i'll fix that next commit |
Procs | |
checkObstacle | Check to see if we hit a table, and if so, make a big mess! |
checkTackle | See if we can tackle or not. If we can, leap! |
registerTackle | Store the thrownthing datum for later use |
rollTackle | rollTackle() |
sack | sack() |
splat | splat() |
splatWindow | A special case for splatting for handling windows |
Var Details
base_knockdown
Launching a tackle calls Knockdown on you for this long, so this is your cooldown. Once you stand back up, you can tackle again.
min_distance
Some gloves, generally ones that increase mobility, may have a minimum distance to fly. Rocket gloves are especially dangerous with this, be sure you'll hit your target or have a clear background if you miss, or else!
range
Your max range for how far you can tackle.
skill_mod
A flat modifier to your roll against your target, as described in rollTackle(). Slightly misleading, skills aren't relevant here, this is a matter of what type of gloves (or whatever) is granting you the ability to tackle.
speed
How fast you sail through the air. Standard tackles are 1 speed, but gloves that throw you faster come at a cost: higher speeds make it more likely you'll be badly injured if you fly into a non-mob obstacle.
stamina_cost
How much stamina it takes to launch a tackle
tackle_ref
The throwdatum we're currently dealing with, if we need it
tackling
If we're currently tackling or are on cooldown. Actually, shit, if I use this to handle cooldowns, then getting thrown by something while on cooldown will count as a tackle..... whatever, i'll fix that next commit
Proc Details
checkObstacle
Check to see if we hit a table, and if so, make a big mess!
checkTackle
See if we can tackle or not. If we can, leap!
registerTackle
Store the thrownthing datum for later use
rollTackle
rollTackle()
This handles all of the modifiers for the actual carbon-on-carbon tackling, and gets its own proc because of how many there are (with plenty more in mind!)
The base roll is between (-3, 3), with negative numbers favoring the target, and positive numbers favoring the tackler. The target and the tackler are both assessed for how easy they are to knock over, with clumsiness and dwarfiness being strong maluses for each, and gigantism giving a bonus for each. These numbers and ideas are absolutely subject to change.
In addition, after subtracting the defender's mod and adding the attacker's mod to the roll, the component's base (skill) mod is added as well. Some sources of tackles are better at taking people down, like the bruiser and rocket gloves, while the dolphin gloves have a malus in exchange for better mobility.
sack
sack()
sack() is called when you actually smack into something, assuming we're mid-tackle. First it deals with smacking into non-carbons, in two cases:
- If it's a non-carbon mob, we don't care, get out of here and do normal thrown-into-mob stuff
- Else, if it's something dense (walls, machinery, structures, most things other than the floor), go to splat() and get ready for some high grade shit
If it's a carbon we hit, we'll call rollTackle() which rolls a die and calculates modifiers for both the tackler and target, then gives us a number. Negatives favor the target, while positives favor the tackler. Check rollTackle() for a more thorough explanation on the modifiers at play.
Then, we figure out what effect we want, and we get to work! Note that with standard gripper gloves and no modifiers, the range of rolls is (-3, 3). The results are as follows, based on what we rolled:
- -inf to -5: Seriously botched tackle, tackler suffers a concussion, brute damage, and a 3 second paralyze, target suffers nothing
- -4 to -2: weak tackle, tackler gets 3 second knockdown, target gets shove slowdown but is otherwise fine
- -1 to 0: decent tackle, tackler gets up a bit quicker than the target
- 1: solid tackle, tackler has more of an advantage getting up quicker
- 2 to 4: expert tackle, tackler has sizeable advantage and lands on their feet with a free passive grab
- 5 to inf: MONSTER tackle, tackler gets up immediately and gets a free aggressive grab, target takes sizeable stamina damage from the hit and is paralyzed for one and a half seconds and knocked down for three seconds
Finally, we return a bitflag to COMSIG_MOVABLE_IMPACT that forces the hitpush to false so that we don't knock them away.
splat
splat()
This is where we handle diving into dense atoms, generally with effects ranging from bad to REALLY bad. This works as a percentile roll that is modified in two steps as detailed below. The higher the roll, the more severe the result.
Mod 1: Speed * Base tackle speed is 1, which is what normal gripper gloves use. For other sources with higher speed tackles, like dolphin and ESPECIALLY rocket gloves, we obey Newton's laws and hit things harder. * For every unit of speed above 1, move the lower bound of the roll up by 15. Unlike Mod 2, this only serves to raise the lower bound, so it can't be directly counteracted by anything you can control.
Mod 2: Misc -Flat modifiers, these take whatever you rolled and add/subtract to it, with the end result capped between the minimum from Mod 1 and 100. Note that since we can't roll higher than 100 to start with, wearing a helmet should be enough to remove any chance of permanently paralyzing yourself and dramatically lessen knocking yourself unconscious, even with rocket gloves. Will expand on maybe * Wearing a helmet: -6 * Wearing riot armor: -6 * Clumsy: +6
Effects: Below are the outcomes based off your roll, in order of increasing severity * 1-63: Knocked down for a few seconds and a bit of brute and stamina damage * 64-83: Knocked silly, gain some confusion as well as the above * 84-93: Cranial trauma, get a concussion and more confusion, plus more damage * 94-98: Knocked unconscious, significant chance to get a random mild brain trauma, as well as a fair amount of damage * 99-100: Break your spinal cord, get paralyzed, take a bunch of damage too. Very unlucky!
splatWindow
A special case for splatting for handling windows