Commit Graph

6 Commits

Author SHA1 Message Date
Funce
ccdc7bcd97 Oh yeah baseline wounding bonus begone for testing.... (#7088) 2021-07-23 12:05:16 +12:00
SkyratBot
413b6bf1b4 [MIRROR] Fix 2.4 damage test bug, with proof (#4017)
* Fix 2.4 damage test bug, with proof (#57560)

I tracked down every source of damage, and just ran the test 100 times until it failed.

It was shrapnel.

I made the victim pierce immune, meaning they'll never take embeds.

* Fix 2.4 damage test bug, with proof

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-03-09 17:31:24 +00:00
SkyratBot
71efaf0d7a [MIRROR] Put unit tests in a box, fixes sporradic gun test failure (#3896)
* Put unit tests in a box, fixes sporradic gun test failure (#57408)

* Initial commit

* Fix removing old objects

* Remove define

* TGM

* Put unit tests in a box, fixes sporradic gun test failure

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-03-05 14:06:09 +00:00
Azarak
ac89749ff4 Fixes gun go bang integration test (#3851)
* Update projectiles.dm

* Update projectiles.dm
2021-03-04 12:40:13 +00:00
SkyratBot
1a7cb09623 [MIRROR] Fixes runtimes from firing projectiles, adds unit test for firing guns (#3828)
* Fixes runtimes from firing projectiles, adds unit test for firing guns (#57345)

* Fixes runtimes from firing projectiles, adds unit test for firing guns

Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
2021-03-04 01:02:50 +00:00
SkyratBot
afce3e2a94 [MIRROR] pass_flags handling refactor + rewrites a part of projectiles for the n-th time (#2097)
* pass_flags handling refactor + rewrites a part of projectiles for the n-th time (#54924)

Yeah uhh this'll probably need testmerging even after it's done because yeah it's a bit big.
If y'all want me to atomize this into two PRs (pass flags vs projectiles) tell me please. Pass flags would have to go in first though, in that case, as new projectile hit handling will rely on pass_flags_self.
Pass flags:

Pass flags handling now uses an atom variable named pass_flags_self.
If any of these match a pass_flag on a thing trying to pass through, it's allowed through by default.
This makes overriding CanAllowThrough unnecessary for the majority of things. I've however not removed overrides for very.. weird cases, like plastic flaps which uses a prob(60) for letting PASSGLASS things through for god knows why.
LETPASSTHROW is now on pass_flags_self
Projectiles:

Not finalized yet, need to do something to make the system I have in mind have less unneeded overhead + snowflake

Basically, for piercing/phasing/otherwise projectiles that go through things instead of hitting the first dense object, I have them use pass_flags flags for two new variables, projectile_phasing and projectile_piercing. Anything with pass_flags_self in the former gets phased through entirely. Anything in the latter gets hit, and the projectile then goes through. on_hit will also register a piercing hit vs a normal hit (so things like missiles can only explode on a normal hit or otherwise, instead of exploding multiple times. Not needed as missiles qdel(src) right now but it's nice to have for the future).

I still need to decide what to do for hit handling proper, as Bump() is still preferred due to it not being as high-overhead as something like scanning on Moved(). I'm thinking I'll make Moved() only scan for cases where it needs to hit a non-dense object - a prone human the user clicked on, anything special like that. Don't know the exact specifics yet, which is why this is still WIP.

Projectiles now use check_pierce() to determine if it goes through something and hits it, doesn't hit it, or doesn't go through something at all (should delete self after hitting). Will likely make an on_pierce proc to be called post-piercing something so you can have !fun! things like projectiles that go down in damage after piercing something. This will likely deprecate the process_hit proc, or at least make it less awful.

scan_for_hit() is now used to attempt to hit something and will return whether the projectile got deleted or not. It will delete the projectile if the projectile does hit something and fails to pierce through it.

scan_moved_turf() (WIP) will be used for handling moving onto a turf.

permutated has been renamed to impacted. Ricocheting projectiles get it reset, allowing projectiles to pierce and potentially hit something again if it goes back around.

A new unit test has been added checking for projectiles with movement type of PHASING. This is because PHASING completely causes projectiles to break down as projectiles mainly sense collisions through Bump. The small boost in performance from using PHASING instead of having all pass flags active/overriding check_pierce is in my opinion not worth the extra snowflake in scan_moved_turf() I'd have to do to deal with having to check for hits manually rather than Bump()ing things.
Movement types

UNSTOPPABLE renamed to PHASING to better describe what it is, going through and crossing everything but not actually bumping.
Why It's Good For The Game

Better pass flags handling allows for less proc overrides, bitflag checks are far less expensive in general.

Fixes penetrating projectiles like sniper penetrators

This system also allows for better handling of piercing projectiles (see above) without too much snowflake code, as you'd only need to modify on_pierce() if you needed to do special handling like dampening damage per target pierced, and otherwise you could just use the standardized system and just set pass flags to what's needed. If you really need a projectile that pierces almost everything, override check_pierce(), which is still going to be easier than what was done before (even with snowflake handling of UNSTOPPABLE flag process_hit() was extremely ugly, now we don't rely on movement types at all.)

* pass_flags handling refactor + rewrites a part of projectiles for the n-th time

Co-authored-by: silicons <2003111+silicons@users.noreply.github.com>
2020-12-09 23:44:54 +01:00