Commit Graph

106 Commits

Author SHA1 Message Date
phil235 5f835bfc26 Obj damaging system, acid damage, and fire damage refactor (WIP) (#20793)
Please refer to #20867 and #20870 for a easier view of the changes. Those two PRs show all meaningful changes (hopefully) and doesn't show the files changed with just 3 lines changed.

This PR does three things:

    It makes all children of /obj/ use the same damage system.
    Previously to make your new machine/structure be destroyable you needed to give it a var/health, and its own version of many damage related proc such as bullet_act(), take_damage(), attacked_by(), attack_animal(), attack_hulk(), ex_act(), etc... But now, all /obj/ use the same version of those procs at the /obj/ level in code/game/obj_defense.dm. All these obj share the same necessary vars: obj_integrity (health), max_integrity, integrity_failure (optional, below that health level failure happens), and the armor list var which was previously only for items, as well as the resistance_flags bitfield. When you want your new object to be destroyable, you only have to give it a value for those vars and maybe override one proc if you want a special behavior but that's it. This reorganization removes a lot of copypasta (most bullet_act() version for each obj were nearly identical). Two new elements are added to the armor list var: fire and acid armor values.
    How much damage an obj take depends on the armor value for each damage category. But some objects are INDESTRUCTIBLE and simply never take any damage no matter the type.
    The armor categories are:
    -melee(punches, item attacks, xeno/animal/hulk attacks, blob attacks, thrown weapons)
    -bullet
    -laser
    -energy (used by projectiles like ionrifle, taser, and also by EMPs)
    -bio (unused for this, only here because clothes use them when worn)
    -rad (same)
    -bomb (self-explanatory)
    -fire (for fire damage, not for heat damage though)
    -acid
    For machines and structures, when their health reaches zero the object is not just deleted but gets somewhat forcedeconstructed (the proc used is shared with the actual deconstruction system) which can drops things. To not frustrates players most of these objects drop most of the elements necessary to rebuild them (think window dropping shards). Machines drop a machine frame and all components for example (but the frame can then be itself smashed to pieces).
    For clothes, when they are damaged, they get a "damaged" overlay, which can also be seen when worn, similar to the "bloody" overlay.

    It refactors acid. See #20537.
    Some objects are ACID_PROOF and take no damage from acid, while others take varying amounts
    of damage depending on their acid armor value. Some objects are even UNACIDABLE, no acid effect can even land on them. Acid on objects can be washed off using water.

    It changes some aspect of damage from fires.
    All /obj/ can now take fire damage and be flammable, instead of just items. And instead of having just FLAMMABLE objs that become ON_FIRE as soon as some fire touch them (paper), we now have objects that are non flammable but do take damage from fire and become ashes if their health reaches zero (only for items). The damage taken varies depending on the obj's fire armor value and total health. There's also still obj and items that are FIRE_PROOF (although some might still be melted by lava if they're not LAVA_PROOF).
    When a mob is on fire, its clothes now take fire damage and can turn to ashes. Similarly, when a mob takes melee damages, its clothes gets damaged a bit and can turn to shreds. You can repair clothes with cloth that is produceable by botany's biogenerator.

    It also does many minor things:
        Clicking a structure/machine with an item on help intent never results in an attack (so you don't destroy a structure while trying to figure out which tool to use).
        I moved a lot of objects away from /obj/effect, it should only be used for visual effects, decals and stuff, not for things you can hit and destroy.
        I tweaked a bit how clothes shredding from bombs work.
        I made a machine or structure un/anchorable with the wrench, I don't remember which object...
        Since I changed the meaning of the FIRE_PROOF bitflag to actually mean fire immune, I'm buffing the slime extract that you apply on items to make them fire proof. well now they're really 100% fire proof!
        animals with environment_smash = 1 no longer one-hit destroy tables and stuff, we give them a decent obj_damage value so they can destroy most obj relatively fast depending on the animal.
        Probably a million things I forgot.

If you want to know how the damage system works all you need is the three obj vars "obj_integrity", "max_integrity", "integrity_failure", as well as the armor list var and the resistance_flags bitfield, and read the file obj_defense.dm
2016-10-10 11:14:59 +13:00
Joan Lung bdcb16113a Adds a few turf istype helpers (#20754)
* a very calming act
when the world is too much, too fast

* i'm tired
but i have to be efficient, infinite

* lick your lips at the sight of me
a fantasy made reality
2016-10-01 19:25:46 +02:00
phil235 2d2975f783 Some preliminary changes before the damage refactor PR. The changes here do absolutely nothing gamewise.
This just adds some vars that the refactor will use. Putting this in a separate PR prevent the damage refactor PR from becoming too big (number of files changed) and hard to read and review.

Introduces the resistance_flags bitflag that replaces unacidable and burn_state.
Moves the armor var from item to /obj level and gives specific armor values to many objects, the armor list also gets two new armor types: fire and acid, which will be used in the refactor. the new fire and acid armor values are given to plenty of items.
2016-09-27 22:33:08 +02:00
Joan Lung fbe2430ff8 Moves all beam icon states to beams.dmi 2016-09-10 13:09:44 -04:00
Kromgar 2b235b8bba Revert "Fixes issues with packagewrap, trashbag, handlabeler, " 2016-09-01 12:18:24 -04:00
oranges 00495cedc5 Merge pull request #20186 from phil235/InsertFix2
Fixes issues with packagewrap, trashbag, handlabeler,
2016-09-01 10:13:30 +12:00
bgobandit f7c08b3100 Fixed syndie dufflebag back sprite. (#20183) 2016-08-28 16:26:21 -05:00
phil235 42301f32e2 Fixes issues with packagewrap, trashbag, handlabeler, and other potential items that must have an effect when clicking a storage item. Clicking a storage item with those items does not try to insert them in the container but instead calls their afterattack effect directly. The var used for those items is var/no_direct_insertion.
Fixes trashbag not being able to pick up pillbottles, evidence bags.
Fixes packagewrap not being able to wrap backpacks, pillbottles, all sorts of bags.
Fixes packagewrapping a locked lockbox showing "it's locked!"
Backpack only make rustling noise if insertion is successful.
2016-08-28 19:38:15 +02:00
Incoming5643 ca934347b3 Fixes my hot fix! 2016-08-21 17:45:49 -04:00
Incoming 06812de30a WHOOPS 2016-08-21 17:40:41 -04:00
Incoming5643 f70ba63d3e You can smuggle smuggler's satchels to a future shift (#19838)
* Hidden Smuggler Satchels hidden beneath the station now persist between rounds, though there's no assurances of WHEN they'll appear next and only one will ever appear in the round.

NOTE THAT THIS PULL INTRODUCES A CRITICAL BUG, DO NOT MERGE *JUST* THIS PR, AWAIT THE FOLLOWUP

* Finishes up satchel persistence.

Satchels require at least 20 saved bags before any will start spawning.

the var persistence_replacement can be set to a path to replace a very high risk item with a lower risk look alike. This is currently done with the nuke disk, the wizards spellbook, and the uplink implant

* DESIGNATED.
REMIE.
PULL.
2016-08-20 16:27:02 +12:00
Incoming 72e50aeb13 Finding the pulse rifle in space is now treated the same as if you won it out of the arcade (but it won't get you the achievement) 2016-08-06 23:16:09 -04:00
Incoming e00d419590 Transitions the feature from meme PR to normal PR 2016-08-06 22:03:27 -04:00
Incoming d81b88a346 Occasionally there'll be one tile of space that's inexplicably fake 2016-08-03 18:02:26 -04:00
Shadowlight213 5f10739385 Repaths satchels and lets angels equip them (#19371)
Repaths satchels so all the different ones are children of the normal satchel.
Allows angels to equip satchels since the satchels are on the side of the body instead of the back. Should help miners who find the potion out a bit.
2016-07-22 10:10:30 +12:00
coiax afb7ebd790 Tiles are now (mostly) pooled objects (#19112)
* Tiles are now (mostly) pooled objects

Floors no longer have a builtin_tile, but instead use PoolOrNew().

Also added a do-nothing SSpool so you can inspect the global pool.

* Entries for time keeping

* MORE STATISTICS

* Stat tracking, auto filling

* Code review I

* Code review II

* Code review III
2016-07-08 13:32:40 -04:00
LatD 25827d6ccb [Ready] Tweaks some R&D levels (#18246)
Removes tech levels from some traitor objectives. They had tech levels even before the remake but apparently now that the levels got raised that became a problem. Also some small tweaks to other items to make some early levels easier to get.
2016-06-07 20:18:19 +12:00
LatD 712c4e81a8 Code review improvements 2016-05-28 13:11:57 +03:00
LatD 65a0027979 Merge remote-tracking branch 'refs/remotes/tgstation/master' into Research 2016-05-28 01:37:55 +03:00
phil235 129295be69 Merge branch 'master' of https://github.com/tgstation/-tg-station into PullvsGrab
Conflicts:
	code/__DEFINES/misc.dm
	code/game/objects/structures/tables_racks.dm
	code/modules/mob/living/carbon/carbon.dm
	code/modules/mob/living/living.dm
	code/modules/mob/living/living_defines.dm
2016-05-25 23:48:00 +02:00
LatD 907fc36e5c Merge remote-tracking branch 'refs/remotes/tgstation/master' into Research 2016-05-24 22:17:44 +03:00
phil235 11ca987acb Merges Pull and Grab into a single functionality. Pulling someone is now the same as a passive grab. You can start pulling someone with ctrlclick or by using the grab intent with empty hand. Using the grab intent again on the pulled person tries to grab them aggressively, then neck grab, then kill grab.
Two mobs can no longer pull the same mob at the same time. Pulling someone break any other pull/grab from other mob on that person.

The grab item is gone entirely.

You can now only grab one mob at a time, instead of two (one for each hand).

Being aggressively grabbed or more now counts as being restrained (like handcuffed). A neck grab or more makes you lie down and prevents you from getting up until the grab is broken.

Fixes movement when moving with a grabbed person.
Fixes movement when moving a pulled person around you diagonally.
Fixes neckgrab moving the victim on your turf even if the turf is dense.
2016-05-24 01:28:04 +02:00
LatD 7d6b3e6847 origin and req lvl changes 2016-05-21 17:17:20 +03:00
KorPhaeron 0cf94ad6b0 Explorer Gear 2016-05-18 00:31:48 -05:00
LatD e685d82805 Removing reliability 2016-05-12 02:43:18 +03:00
Jack Edge 4e0ffcca23 Contraband clown pie crate 2016-05-09 00:32:14 +01:00
Jordie f3f0c63e4f Merge pull request #17245 from nullbear/c4-path
Changes C4 Path and adds X4 breaching charge
2016-05-01 16:41:07 +10:00
nullbear 5cd0cca621 Adds more reuseable c4 type path. Adds x4. Fixes chembomb recipe. 2016-04-29 03:31:17 -07:00
phil235 750eaa4a57 invisibility = 100 and 101 now use defines. 2016-04-29 01:00:05 +02:00
phil235 d5af5ca696 Objects with invisibility = 101 are ignored by procs like view() that are used for say() and visible_message().
Objects that are simply hidden (instead of being abstract things) now always use invisibility = 100.
This fixes not being able to hear what you say while inside a hidden gas/disposal pipe.
Fixes the t-ray scanner revealing abstract object that should never be seen, like spacevine controller.
Fixes not hearing anything during a mob transformation.
2016-04-29 00:04:40 +02:00
Razharas efa60f8587 Fixes BoHs
Fixes BoHs
fix https://github.com/tgstation/-tg-station/issues/17173
2016-04-27 21:33:36 +03:00
Razharas 534d970567 Fixes drone or any other boh in boh abuse
Fixes drone or any other boh in boh abuse
2016-04-26 15:34:49 +03:00
bawhoppen dfc91ae3c9 phix 2016-04-22 06:15:12 -05:00
Lularian c01d739390 R&D is shit 2016-04-21 17:27:47 -05:00
Jack Edge a5600abd26 Use drone dufflebag sprites 2016-04-19 00:03:24 +01:00
coiax 884d85e519 Adjusted dufflebag contents 2016-04-17 20:21:23 +01:00
Jack Edge db5f08adf0 Fixed indentation issues 2016-04-16 18:29:44 +01:00
Jack Edge 683aa9b26f Drones start with preloaded engineering dufflebags
🆑 coiax
rscadd: Drones now start with a spacious dufflebag full of tools, so they will stop stealing the captain's
/🆑
2016-04-16 18:09:28 +01:00
duncathan salt 7759b823da I like trustygun's idea 2016-03-26 14:13:27 -06:00
duncathan salt 0fd7310f41 Update backpack.dm 2016-03-26 10:08:52 -06:00
Akke 18897ac972 resderved 2016-03-14 23:24:28 +00:00
Akke d9bca07308 @steelpoint you didn't remove the bundles. 2016-03-09 23:18:53 +00:00
phil235 15d8e0a96f I refactored how a mob resisting out of a closet that is itself inside something is done.
Fixes not being able to resist out of an unlocked unwelded locker. Now both moving and the resist button  work (except for the cardboard box).
You can no longer spam breakingout message ouf of a closet by moving while inside.
Wrapping and unwrapping a locker no longer unwelds it magically.
I refactored closet/crate/item package wrapping.
You can packagewrap belts and other storage items in which the package wrap item doesn't fit.(it does currently have the unintended side effect of giving you the "doesn't fit in X" message when wrapping there storage items though).
2016-03-03 20:20:34 +01:00
duncathan salt ca8e3c6a0a Merge pull request #15157 from LanCartwright/nomorehardsuit
Removes hardsuit from bulldog bundle
2016-02-10 21:21:42 -06:00
AnturK f6f7943189 Adds C4 bag to uplink 2016-02-08 16:10:34 +01:00
KorPhaeron 2f6c9ec50e Bulldog Fix 2016-02-05 12:06:53 -06:00
Akke 4458aa9d73 no more hardsuit no more plasma flooding 2016-02-02 23:48:21 +00:00
Bjorn Neergaard 1c34479376 Fix uplink code once and for all
Fixes #14733
2016-01-19 16:42:57 -06:00
SouDescolado 92b3c84a22 Make the code beautiful
Less lines, same code.

Trying to fix merge conflict.

Gah
2016-01-05 14:36:39 -02:00
arty23 0e23fdee89 M90gl dufflebag grammar fixed
Issue reported by LanCartwright.
2016-01-01 12:46:23 -06:00