Commit Graph

264 Commits

Author SHA1 Message Date
Jared-Fogle 0a77d27a1b Replace direct poi_list manipulation with element (#55416)
Replaces GLOB.poi_list |= src and GLOB.poi_list -= src with an element that handles it directly.

More consistent code, especially when a lot of code couldn't decide how to add/remove (some |=, some -=, some .Remove, etc).
2020-12-10 23:30:25 +00:00
silicons 160175ee8b 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.)
2020-12-10 09:29:27 +13:00
Qustinnus 8737e8cb80 Small do-after refactor (#55172)
This is an alternative to the PR Ryll made, it does some things similar e.g. the default limit of 1 interaction per target for a person, however, it refactors do_afters to support overrides for max interaction counts and unique sources.

For example, stripping uses the item being stripped as the source, allowing you to strip multiple items, but not the same item multiple times.

I've also fixed most other edge-cases this could cause where balance would be affected, but feel free to point out any I might've missed, this'll probably require some longer-term testmerging.
2020-12-07 13:04:51 -08:00
TiviPlus 0eaab0bc54 Grep for space indentation (#54850)
#54604 atomizing
Since a lot of the space indents are in lists ill atomize those later
2020-11-30 12:48:40 -05:00
ArcaneMusic 87cb185d58 Mech Ammo now properly respects ammo for custom materials. (#55095)
Mech code now does a basic check for the amount of remaining ammo to adjust the amount of custom materials of an ammo container based on the remaining ammo against the original amount of ammo.
When the ammo runs out, it's hard-set to 2000 iron as that's the value of the sheet of iron that it gets set to by the end.
2020-11-28 07:50:57 -03:00
Ryll Ryll 1b9777df1f Changes grenade proc names to be more clear (#55181)
Grenades have, for the longest time, used the proc name preprime() to refer to arming a timed grenade so that it will boom in a few seconds, and prime() to refer to the grenade actually going boom (or releasing foam or anything else grenades do when they go off). This was very confusing, so now these two procs are called arm_grenade() and detonate().
2020-11-28 07:44:28 -03:00
Timberpoes e7ff79bcbe Feex (#55144)
For whatever reason we hardcoded the health value for drills at 200 brute damage before they can gib. 200 brute damage was picked as it was double the max health of /mob/living/carbon/whatever and double the max health was like, the cap on brute damage when someone is really, really, really, really dead.

Enter simplemobs. Their max health is regularly under 100, which means a hardcoded value of 200 brute damage to trigger gibbing effects is bad. Not that it matters anyway, because simplemobs also brute damage cap at maxHealth instead of maxHealth * 2 so the only simplemobs that could be gibbed by mech drills are those with 200 or more health.

This has been changed. Simplemobs now cap out at maxHealth * 2 damage, in line with all other /mob/living while drill code has been changed to check for maxHealth * 2 when gibbing instead of a hardcoded 200.
2020-11-25 13:44:01 -08:00
Ghom 4c31b0e116 CanUseTopic() refactor. (#54747)
* CanUseTopic() refactor.

* Forgot about default_can_use_topic. Tested and working.

* Update bin.dm

* no-nonsense.
2020-11-25 13:12:12 +01:00
NightRed fb51b24d21 Humans have more complicated body temperatures (#54550)
This changes how carbon/humans stabilize body temperature, and changes how damage and wounds are applied based on temperature.

Humans now have a core body temperature along with body temperature. The core temperature is used for natural stabilization and what viruses like fever and shivers target by raising or lowing the core temperature of the mob.
The standard body temperature still exists and acts exactly the same for most items at this time but is now treated as surface temperature in humans.

Damage from body temperature for humans is now based on the core temperature instead of body temperature now.
Humans will now receive burn wounds when the body (surface) temperature is to high for to long.

This causes you to see alerts for the area temperature before you take damage in most cases improving visibility of dangerous situations.
2020-11-24 22:37:36 -08:00
Timberpoes 191b3cde38 Prevents mecha drills from stacking do_afters on the same target. (#55145)
* Feex

* Feex 2.0 Feexlectric Feexaloo

* Whitespace purge
2020-11-24 21:27:42 +08:00
Qustinnus 41157f5d6b Moves grown food to newfood (#55040)
Moves grown food to newfood
Gives trash element support for callbacks for item creation override
2020-11-23 14:00:23 -08:00
Ghom 27d0e32b47 minor material_container args/vars refactor and Mk-honk shoes peeve. (#54863)
My original intention was just fixing an issue with the Mk-honk banana shoes but, considering I didn't want to add two new variables to a component with already lot of args and lengthy AddComponent() calls in term of text, I had to merge some TRUE/FALSE variable/args into the breakdown_flags bitfield (now named mat_container_flags) in the process.
2020-11-21 04:37:07 -03:00
TemporalOroboros edd6500d78 /obj/screen --> /atom/movable/screen (#54403)
Repaths screen objects to /atom/movable
2020-11-08 23:07:15 -03:00
Jared-Fogle 477d97647e Move death(), gib(), and dust() from /mob to /mob/living (#54810)
These have no reason to exist on /mob, where they noop for any nonliving.
2020-11-08 10:32:04 -05:00
Ghom 97e21c8b7e Fixing multi-z defying mechas (AGAIN) (#54753)
I already fixed this issue almost a year ago, but the mecha refactor guy managed to revert the fix at the distance of 8 months.
2020-11-06 22:52:24 -05:00
TiviPlus b067cbe7bd Fixes mecha rotate & spacemove sounds and makes stomping silence flag instead of null based (#54529)
* comit

* bump

* Update code/modules/vehicles/mecha/_mecha.dm

Co-authored-by: Couls <coul422@gmail.com>

* Update code/modules/vehicles/mecha/_mecha.dm

Co-authored-by: Rohesie <rohesie@gmail.com>

Co-authored-by: Couls <coul422@gmail.com>
Co-authored-by: Rohesie <rohesie@gmail.com>
2020-11-02 21:02:53 -08:00
ShizCalev d7c3cdf46f Merge pull request #54396 from necromanceranne/revert_reversion_mechs
Fixes an accidental (???) reversion in mech code
2020-11-02 11:19:46 -05:00
InvalidArgument3 5cfc65fe3e [Ready]New walking and turning sounds for the Ripley Mk. I and II, interaction sounds for the hydraulic clamp (#54523) 2020-11-01 16:33:23 -08:00
necromanceranne 2e9aed0e62 Accidentally removed some logging 2020-10-31 01:08:58 +11:00
necromanceranne d99dd457aa Ridden vehicles pass bullets, checks for new incapacitation traits for whether or not you fall off (#54376)
Ridden vehicles now pass any objects that normally pass tables. This includes bullets, thrown objects, and probably dwarves?

Ridden vehicles check for the various incapacitation traits instead of just usable hands for whether you fall off. Doesn't fix corpses buckled to these objects but that'll require more work to fix because it's all tied into relay_move.

This doesn't affect any ridden object that doesn't checks for hand availability. Like skateboards and wheelchairs (although how exactly your wheelchair is moving without hands or mechanical parts is beyond me).
2020-10-30 10:16:32 -03:00
Rohesie c55bb1b6c8 Basepixels (#54652) 2020-10-28 20:31:13 -07:00
zxaber bc620ff88a Various fixes to mechs (#54595)
Vehicle objects now call bumpopen() rather than Bumped() when moving into an airlock, and thus will once again open any door the pilot has access to. Closes #54480

    Fixes Ripley MK-I to MK-II conversions destroying equipment.

    MK-I to MK-II conversions now sets the MK-II's integrity to be same percentage as the MK-I's integrity. Thus, upgrading a full-health MK-I will no longer result in a damaged MK-II.

    Both Ripley types no longer start with an orebox, that function has been moved to the Clarke.
2020-10-26 12:28:11 -03:00
necromanceranne 1b05cba5fb Merge remote-tracking branch 'upstream/master' into revert_reversion_mechs 2020-10-26 10:38:46 +11:00
Timberpoes 37a5965d02 Fixes motorised wheelchairs not moving (#54507) 2020-10-21 20:21:39 -03:00
TiviPlus 5e93efebf7 Mecha follow up 2 edition 2 (#54454)
fixes mech power not using deltatime
fixes a few mech bugs
moved mecha gun logging to attacklog instead of mechalog
2020-10-20 19:58:39 -03:00
Rohesie 29ec525147 Implements timed_action_flags for do_after-like procs (#54409)
Originally I wanted to fix an issue where the `get_up()` `do_after()` would ignore the callback checks, because it was `uninterruptible`, so that made me refactor these procs to allow for higher granularity on checks and standardize behavior a bit more.
There's more work to be done for them, but one thing at a time.

* Removes the `uninterruptible` check in favor of the more granular `timed_action_flags`
* Cleans code on the `do_atom`, `do_after_mob`, `do_mob` and `do_after` procs to standardize them a little better.
2020-10-19 17:06:49 -04:00
TiviPlus 0a62588558 Vehicle housekeeping (#54455)
Removed redundacies, autodoc, early returns, moved attackby into welder act, made some CamelCase into a snake_case
2020-10-19 11:32:36 -03:00
Rohesie 14e7c7c971 [READY] Fixes being able to use items while inside a mech (#54302) 2020-10-18 22:50:39 -07:00
necromanceranne 03c47dc66a Reverts a reversion, mechs no longer blow up upon deletion. 2020-10-15 01:52:33 +11:00
ZeWaka 9629feed35 Converts A && A.B into A?.B (#54342)
Implements the ?. operator, replacing code like A && A.B with A?.B

BYOND Ref:
When reading A?.B, it's equivalent to A && A.B except that A is only evaluated once, even if it's a complex expression like a proc call.
2020-10-13 16:43:53 -03:00
Rohesie af65c90125 Mobility refactor: no more update_mobility() (#54183)
This is a pretty big change all around. The gist of it is that it moves the mobility_flags into traits or variables that can track the sources, and to which we can append code to react to the events, be it via signals or via on_event-like procs.

For example, MOBILITY_STAND could mean, depending on context, that the mob is either already standing or that it may be able to stand, and thus is lying down.

There was a lot of snowflakery and redefinitions on top of redefinitions, so this is bound to create bugs I'm willing to fix as I learn them.

The end-goal is for every living mob to use the same mobility system, for the traits to mean the same among them, and for no place to just mass-change settings without a way to trace it, such as with mobility_flags = NONE and mobility_flags = ALL

Fixes AIs being able to strip nearby people. They've lost their hands usage.
2020-10-09 16:04:30 -07:00
TemporalOroboros cab4313b29 Adds Alloy Materials (#53623)
Adds and implements alloy materials

Takes several materials that were mostly fluff and converts them into actual usable materials.
Messes with material code a bit to make alloys recycle back into their component materials.
Adds the alloy materials to their in-game stacks.

Materials added:
    Plasteel
    Plastitanium
    Plasmaglass
    Titaniumglass
    Plastitanium Glass
    Alien Alloy

Makes plasteel/plastitanium/plasmaglass and the rest able to have separate properties from their component materials. It doesn't make much sense that the materials used to seal off the supermatter chamber from the rest of the station would be prone to exploding when heated.

Allows for further expansion of materials, possibly including actual functional metallurgy and smelting at some point in the very distant future.

(Lemons note: Adds a regeneration component, used for alien alloy)
2020-10-09 12:23:40 -07:00
ShizCalev 48bff26867 Merge pull request #54098 from Timberpoes/dirty-do-after-fix
Minor tweaks and cleanup to mecha drill equipment's action code
2020-10-09 05:51:58 -04:00
spookydonut 2a0eac8772 Fix some potential sleeps as detected by SpacemanDMM improvements (#54230)
overrides weren't detected by should not sleep, i think i've mostly 
fixed that with SpaceManiac/SpacemanDMM#214

Some of these are wacky but overall this pr is harmless

signals shouldnt sleep even in weird 1 in a million situations or due 
to other people adding bad code

overrides of changeling can_sting() use alert() and input() and that's 
just too fucked for me to fix in this pr
2020-10-08 17:06:19 -07:00
Timberpoes d5402dc459 Yellow slime core nerfs and adjustments. (#54198)
Yellow slime extract can no longer turn into a self-charging yellow slime core. This functionality has been completely removed.

Hypercharged yellow slime cores no longer self-charge.
They now have a capacity of 50,000 (up from their previous 20,000). This is 10,000 more than a bluespace power cell.
Their recharge rate is 2500. This is relatively slow for the power capacity, as hyper and bluespace cells charge at 10% of their capacity respectively and this is 5%.

Motorised wheelchairs have had their power usage reduced to 5% of their previous value since they were basically only usable with rechargable cells before
2020-10-07 15:42:02 -03:00
TiviPlus a30377f4bb More deletion cleanup (#53681)
- Observer mobs not delling correctly
- AI delling basically nothing
- pods not delling glow effect
- minor slime cleanup
2020-10-01 20:30:51 -07:00
Timberpoes 557fb0a3be Update code/modules/vehicles/mecha/equipment/tools/mining_tools.dm
Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com>
2020-10-02 03:38:54 +01:00
Timberpoes 914f9dd4e4 Feex 2020-10-01 01:33:34 +01:00
Timberpoes bd3af07f6f Feex 2020-09-30 09:37:31 +01:00
Rohesie 3cc7733f34 Moblity refactor: hands blocked and restrained edition. (#53981)
Splits the restrained() proc into component traits: TRAIT_HANDS_BLOCKED for the general inability to use hands and TRAIT_RESTRAINED for the more specific condition that permits arrests.
    Code moved away from the update_mobility() proc so it doesn't have to wait for an update, instead changing based on events. The idea is to eventually kill that proc.
    Wrapper proc added for setting the handcuffed value so we can react to the event of it changing.
    Kills the RestrainedClickOn() proc. That is now just an UnarmedAttack(), in where the ability to use hands can be checked. Monkeys keep their bite attack and humans their self-examine.
2020-09-29 11:23:43 +01:00
TiviPlus 31271f8984 Mining mechas refactors (#53676) 2020-09-28 15:15:07 -03:00
Timberpoes 1f23cc281d Enforce preserving parent proc return values across ui_act call stacks (#53964)
All ui_act procs should call parent by default. All procs should preserve the value of the parent proc when it's TRUTHY and pass it down the call stack. No UI should be interactible when its flags or state indicate it should not be, except when explicity overriden by child procs intentionally disregarding parent return values to achieve a specific goal.
2020-09-26 11:52:39 -03:00
Coffee 8f6e48e30f Makes wheelchairs foldable. (#53796)
First, this removes 'The Whip' wheelchair as it doesn't show up anywhere or really do anything so it's kind of bloat. The other thing this does is make the metal and gold wheelchairs foldable into an item, like the rollerbeds. Motorized wheelchairs are not foldable. The metal wheelchair item does as much damage as a chair, and the gold one packs an extra oomph. Hiynastrike helped me with the sprites.
2020-09-24 14:55:09 -03:00
Timberpoes 357d272935 Fix skill related runtimes in mindless mobs. (#53691)
Fixes related to mindless mobs using skills
2020-09-24 13:32:22 +02:00
Tad Hardesty f80836d00d Fix broken dmdoc crosslinks (#53896)
- Backtick-escape code samples which contain `[]` syntax.
- Fix all crosslinks to nonexistent symbols.
- Somewhat improve docs for qdel defines, research defines, dynamic mode, and others.
- Remove unused bloodcrawling defines.

Some crosslinks to defined but undocumented symbols remain. For BYOND builtins, a future dmdoc version may link those symbols to their entries in the DM reference. Other symbols could be documented by a future PR.

New "file" crosslinks as used in `research.dm` are slated for release in a future dmdoc version.
2020-09-23 03:47:44 -03:00
TiviPlus 72fc7213ed Mecha medical and other_equipment refactor (#53637) 2020-09-23 02:40:16 -03:00
Mickyan 3e23be84bc fixed scooter construction (#53866) 2020-09-22 12:23:32 +08:00
ArcaneMusic d836946e8e Arcane finishes the fight and adds all the missing belt sprites and a worn sprite Admin Tool. (#53305) 2020-09-16 16:11:23 -03:00
Timberpoes 2ef520fbf5 Fix comments that trigger new lint warning (#53737)
New lint catches potential fuckery with meme comments.

Now you know why every meme ////comment\\ had a newline under it in 
order to compile.
2020-09-15 18:50:10 -07:00
msgerbs fb010a1dea Fix mechs not using power to move, gygax leg actuator button not matching actual state, and mechpads not working (#53624)
Fixes these issues with mechs:

    Mechs aren't using power to move (broken in #52902)
    Gygax leg actuator button is opposite of what it should be (off when it should be on) (broken in #52902)
    Mechpads don't actually send mechs
    None of the error messages for failing to move work
2020-09-12 18:16:14 +01:00