tackler
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 separate """skill rolls""" involved here, which are handled and explained in 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 | A wearkef to 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! |
do_grab | Helper to do a grab and then adjust the grab state if necessary |
negative_outcome | Our negative tackling outcomes. |
neutral_outcome | Our neutral tackling outcome. |
positive_outcome | Our positive tackling outcomes. |
registerTackle | Store the thrownthing datum for later use |
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!) |
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: |
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. |
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
A wearkef to 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!
do_grab
Helper to do a grab and then adjust the grab state if necessary
negative_outcome
Our negative tackling outcomes.
We pass our tackle result here to determine the potential outcome of the tackle. Typically, this results in a very poor state for the tackler, and a mostly okay outcome for the tackled.
First, we determine severity by taking our roll result, multiplying it by -10, and then rolling within that value.
If our tackler is human, their armor will reduce the severity of the roll. We pass along any MELEE armor as a percentage reduction. If they're not human (such as a carbon), we give them a small grace of a 10% reduction.
Finally, we figure out what effect our target receives and what our tackler receives:
- 1 to 20: Our tackler is knocked down and become staggered, and our target suffers stamina damage and is knocked staggered. So not all bad, but the target most likely can punish you for this.
- 21 to 49: Our tackler is knocked down, suffers stamina damage, and is staggered. Ouch.
- 50 to inf: Our tackler suffers a catastrophic failure, receiving significant stamina damage, a concussion, and is paralyzed for 3 seconds. Oh, and they're staggered for a LONG time.
neutral_outcome
Our neutral tackling outcome.
Our tackler and our target are staggered. The target longer than the tackler. However, the tackler stands up after this outcome. This is maybe less neutral than it appears, but the tackler initiated, so... This outcome also occurs when our target has blocked the tackle in some way, preventing situations where someone tackling into a blocker is too severely punished as a result. Hence, this has its own proc.
positive_outcome
Our positive tackling outcomes.
We pass our tackle result here to determine the potential outcome of the tackle. Typically, this results in a very poor state for the tackled, and a positive outcome for the tackler.
First, we determine severity by taking our roll result, multiplying it by 10, and then rolling within that value.
If our target is human, their armor will reduce the severity of the roll. We pass along any MELEE armor as a percentage reduction. If they're not human (such as a carbon), we give them a small grace of a 10% reduction.
Finally, we figure out what effect our target receives. Note that all positive outcomes inflict staggered, resulting in a much harder time escaping the potential grab:
- 1 to 20: Our target is briefly stunned and knocked down. suffers 30 stamina damage, and our tackler is also knocked down.
- 21 to 49: Our target is knocked down, dealt 40 stamina damage, and put into a passive grab. Given they are staggered, this means the target must resist to escape!
- 50 to inf: Our target is hit with a significant chunk of stamina damage, put into an aggressive grab, and knocked down. They're probably not escaping after this. If our tackler is stamcrit when they land this, so is our target.
registerTackle
Store the thrownthing datum for later use
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() 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 /datum/component/tackler/proc/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 -1: We have a negative roll result, which means something unfortunate or less than ideal happens to our sacker! Could mean just getting knocked down, but it could also mean they get a concussion. Ouch.
- 0: We get a relatively neutral result, mildly favouring the tackler.
- 1 to inf: We get a positive roll result, which means we get a reasonable to significant advantage against the target!
Finally, we return a bitflag to COMSIG_MOVABLE_IMPACT that forces the hitpush to false so that we don't knock them away.
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-67: Knocked down for a few seconds and a bit of brute and stamina damage
- 68-85: Knocked silly, gain some confusion as well as the above
- 86-92: Cranial trauma, get a concussion and more confusion, plus more damage
- 93-96: Knocked unconscious, get a random mild brain trauma, as well as a fair amount of damage
- 97-98: Massive head damage, probably crack your skull open, random mild brain trauma
- 99-Infinity: Break your spinal cord, get paralyzed, take a bunch of damage too. Very unlucky!
splatWindow
A special case for splatting for handling windows