Commit Graph

45 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
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
Kromgar 2b235b8bba Revert "Fixes issues with packagewrap, trashbag, handlabeler, " 2016-09-01 12:18:24 -04: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
unknown 5ea9203c7f Added some has_buckled_mobs() checks. 2016-08-02 23:39:29 -07:00
Joan Lung fe28096320 Adds dextrous guardian (#19254)
Added dextrous guardians to the code, able to hold and use items and store a single item within themselves.

Dextrous guardians do low damage on punches, have medium damage resist, and recalling or leashing will force them to drop any items in their hands.
2016-07-13 11:25:00 +12:00
bgobandit 10d32cd9d4 Fixes/tweaks a lot of typos/descriptions. (#18956) 2016-06-28 22:02:28 +12:00
Cruix ac0bad5d61 Added priority overlay system. (#18225)
Added priority overlays to atoms, which will not be removed when overlays are cut and will always remain on top when new overlays are added. This requires everyone to use add_overlay() and cut_overlays() instead of overlays += and overlays.Cut(). These procs are found in __HELPERS/icons.dm, and the priority overlay list is found in game/atoms.dm. Everything else is replacing deprecated overlay manipulation.
2016-06-17 10:11:53 +12:00
Joan Lung 8582d0fbbd Chairs now handle layer updates/rotation with setDir 2016-06-12 22:56:41 -04:00
Remie Richards fda2c699fc Automatic conversion via Regex 2016-06-11 18:37:48 +01:00
Lzimann 9a9fd0a06a I fucked up 2016-06-08 22:36:04 -03:00
oranges c5a84c769d Merge pull request #18036 from AnturK/init_meme
Defers some list initializations
2016-06-08 19:20:04 +12:00
Leo cf27511dc9 Bar stool FIGHTS (#18325) 2016-06-08 13:29:47 +12:00
AnturK 19eb97ae18 Moves some list initializations to New
Fixes missing ..() calls in New()
2016-06-07 18:39:13 +02:00
pudl a76f6748bd adds stupid shitty bar stools 2016-06-04 19:06:52 -05:00
oranges b654016574 Merge pull request #17936 from MMMiracles/ruin_stuff
Adds some spawnable shuttle templates for admin memery
2016-05-31 15:58:12 +12:00
Joan Lung 2cfb2d8eed Layers are now defines (#17949)
* Layers are now defines

* this looks better

* GAS_phil_LAYER

* no message

* remove the three unneeded defines

* no message
2016-05-27 22:16:21 +02:00
MMMiracles a5cae8e49c memery supreme 2016-05-23 06:12:54 -04:00
Jack Edge d9bfa9e820 Removes materials from holodeck chairs and windows
- Breaking a chair with NODECONSTRUCT no longer produces materials.
- Breaking a window with NODECONSTRUCT now reliably does not produce
materials.
- Also moved the creation of debris into the window's shatter() proc,
because doing it on creation is dumb, and unreliable.
2016-05-12 16:30:38 +01:00
phil235 68da092009 Dismemberment port from Hippie code, based on RemieRichard's work. Big thanks to RemieRichards and crystalwarrior. 2016-05-05 18:17:51 +02:00
phil235 d3fa99e58b Fixes runtime when thermiting a wall
Fixes not being able to put down a chair on a tile with a border window.
Fixes Borg module cycling not working when the first module is empty.
2016-04-28 20:44:02 +02:00
phil235 6eb4ffa825 Merge branch 'master' of https://github.com/tgstation/-tg-station into AttackbyDestruction
Conflicts:
	code/game/objects/items/devices/lightreplacer.dm
	code/game/objects/structures/crates_lockers/closets.dm
2016-04-26 21:49:51 +02:00
erwgd 02b29f888a Prevents collapsing roller beds or grabbing chairs whilst incapacitated (#17074)
* added if(usr.incapacitated) for grabbing a chair

* added if(usr.incapacitated()) for collapsing a roller bed
2016-04-26 19:41:21 +02:00
phil235 0480790b0a Same things but with structures now. 2016-04-24 20:38:33 +02:00
phil235 0caa59b21a First commit of this big PR
These are the files with just tiny tweaks. Mostly modify an object's attackby so it does "return ..()" instead of "..()".
If there are other things in this commit, the PR's description will explain them.
2016-04-24 20:26:24 +02:00
Jack Edge 336612f663 You can't pick up NODECONSTRUCTed chairs 2016-04-17 14:39:42 +01:00
Nerd Lord f7a2348ef7 Nar-Sie will now corrupt doors, tables, windows, and windoors 2016-03-17 16:28:26 -04:00
Remie Richards 4e821d8657 Atoms may now have many mobs buckled to them, as opposed to one, this is controlled by the new max_buckled_mobs var on atoms, defaults to 1 as to not change any current functionality 2016-03-07 18:03:25 +00:00
phil235 3ea7cf9831 The AI's core no longer fits inside regular closets (but still fits inside bluespace bodybag).
Ghosts and camera mobs no longer get inserted inside closets.
Fixes an error in alien nest code.
2016-02-24 22:56:54 +01:00
KazeEspada ac7aed2cb7 Removes parentheses
Really? Really?
2016-02-21 10:56:57 -07:00
KazeEspada 9a33d27e05 Wooden chairs added. Inhands in WJohnston's pull. Fixed an issue with spawning to many sheets upon smashing. 2016-02-20 14:25:29 -07:00
KazeEspada 40ca05b70d Enhances barfights by making chairs smash against people. If they are weak enough, the act of smashing will knock them on their ass.
Also some backend stuff to make chairs more readable.
2016-02-19 22:15:37 -07:00
KazeEspada 2de3fac2f4 Chairs can no longer be stacked with dense items(rare) or dense structures. As well as chairs. 2016-02-19 20:47:43 -07:00
KazeEspada 4305097ace Properly typecasts user var on place. 2016-02-18 21:56:24 -07:00
KazeEspada fd3557761c Fixes the wrong proc being used. 2016-02-18 20:32:00 -07:00
KazeEspada fff4639bca Fixes an issue where you would plant a chair while moving hands.
Sets the block chance on declaration rather then on instantiation.
2016-02-18 20:29:37 -07:00
AnturK 884b6c3415 Chair hitsound 2016-02-18 17:55:39 +01:00
AnturK 56d2a34201 Splits beds and chairs
Adds deconstruct structure helper
Moves chair sprites from objects.dmi to chairs.dmi
Fixes check shields passing proper flags on unarmed attacks
Makes stools and chairs able to be picked up
2016-02-18 17:55:38 +01:00
KorPhaeron d8a37204e7 Makes burn_state use defines 2015-12-13 05:36:55 -06:00
Vincent 16303c1c1f Changes flag name from ABSTRACT to NODECONSTRUCT
Removes holo-tables and holo-windows since those typepaths are no longer needed.
Updates Z2 to reflect this.  Removes spurious tag tags in Z2.
2015-11-30 20:26:03 -05:00
Vincent 026e6ee772 Sets up the the ABSTRACT flag to be used by machines and structures that should not be disassembled or break into parts.
This is specifically used by the holodeck for things that should be immune to disassembly.

Fixes invisible windoors in the holodeck.
Standardizes the fire axe's interaction with windows.
Fixes a runtime with holodeck tiles getting broken or burned.
2015-11-26 21:11:54 -05:00
Nerd Lord f458c2cead The blob eats nondense things in all cases.
Probably fixes one or two bugs in the process.
2015-11-20 21:03:43 -05:00
kingofkosmos e75d24a6c9 Changes checks in altclicks from canusetopic to incapacitated. 2015-11-01 11:24:17 +02:00
phil235 a7bc8475d8 Fixes winter coat hood sprite appearing as a bucket.
Removing Smile, Swedish, Chav and Elvis from genetics. These mutation can still be acquired via adminspawned dna injector. Added a dna injector for laser eyes mutation.
Fixes using razor on non human shaving non existent hair.
Fixes chair deconstruction dropping too much metal.
Adding some necessary check for mob buckling in gibber, processor and monkey recycler code, and in ventcrawling proc to fix being able to enter pipe while feeding as a slime.
Fixes snapcorn not giving seeds.
Fixes portable chem dispenser.
2015-10-17 16:29:11 +02:00
phil235 9c79257aab Changes the paths of stools, beds and chairs. It is now obj/structure/bed/chair and obj/structure/bed/stool. It makes much more sense since stools barely have any code of their own.
Beds (and chairs) now have buildstacktype and buildstackamount vars to handle how many sheets of what they should drop on deconstruction.
They also have a foldabletype var to handle folding into item (currently only used by roller beds) so that people can add foldable chairs in the future.
Fixes swivel chairs not dropping the correct amount of metal sheets.
2015-10-10 13:35:00 +02:00