Commit Graph

68 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
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
phil235 639ff5d161 Doors can now be attacked when clicked on harm intent. (they're currently indestructible so it's only cosmetic for now). I tried to make door code more OOP. 2016-04-24 20:39:30 +02:00
Nerd Lord f7a2348ef7 Nar-Sie will now corrupt doors, tables, windows, and windoors 2016-03-17 16:28:26 -04:00
c0 f3ecb132ba Adds Alien Alloys 2016-03-12 15:06:03 +03:00
KorPhaeron 3f439b211c Abductor Airlocks 2016-02-21 00:01:54 -06:00
oranges 134a76cc8f Line ending apocalypse 2015-12-17 14:12:37 +13:00
xxalpha e9e4ff735d Added maintenance glass airlock and external glass airlock. 2015-12-14 00:48:01 +00:00
Razharas 78c95ab035 Merge pull request #13317 from neersighted/airlock_electronics
NanoUI Airlock Electronics
2015-11-30 20:43:33 +03:00
Bjorn Neergaard f214e547cb NanoUI Airlock Electronics
Also reworks a lot of the AE code.
2015-11-29 11:32:56 -06:00
Firecage c933363062 Adds the toolspeed var and adds it to most usages of tools which has a timer 2015-11-21 19:24:14 +02:00
xxalpha 94f045b73f Merge remote-tracking branch 'upstream/master' into airlocking
Conflicts:
	_maps/map_files/MetaStation/MetaStation.v41F.dmm
	code/game/objects/structures/door_assembly.dm
2015-08-30 19:53:54 +01:00
c0 97b792bbc3 Changed some circuits paths to reduce copypasta 2015-08-30 16:58:13 +03:00
xxalpha 4ed1937168 Completed construction icons 2015-08-27 18:40:08 +01:00
xxalpha 382cd870aa Airlock construction icons
Removed leftover comments
2015-08-27 10:05:46 +01:00
phil235 0e91f254b9 Fixes a warning during compilation.
Removes some unneeded code lines.
2015-08-01 19:46:36 +02:00
SvartaSvansen e12d47aab6 Centcom airlock assemblies! No more disintegrating airlocks! 2015-07-31 01:41:02 -04:00
Firecage 4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
Iamgoofball a8ec1c76df Merge branch 'master' of https://github.com/tgstation/-tg-station into graphics
Conflicts:
	code/ATMOSPHERICS/atmospherics.dm
	code/game/machinery/computer/computer.dm
	code/game/objects/items/weapons/explosives.dm
	code/game/objects/structures/crates_lockers/closets/fireaxe.dm
	code/game/objects/structures/musician.dm
	code/game/objects/structures/tables_racks.dm
	code/game/objects/structures/window.dm
2015-06-23 12:54:26 -07:00
phil235 e6dcabf245 Merge pull request #9960 from xxalpha/bass
Put drop_item() calls inside ifs. Replaced some drop_item() with unEq…
2015-06-18 15:50:35 +02:00
xxalpha b2e84a0d3c Put drop_item() calls inside ifs. Replaced some drop_item() with unEquip( 2015-06-14 20:11:40 +01:00
kingofkosmos c8d79e7034 Removed unnecessary spaces in these situations:
"span class = '" changed to "span class='"
"'> " changed to "'>"
2015-06-14 12:13:19 +03:00
Iamgoofball c2256d41fc BAR NOW SHOWS UP ON THE OBJECT YOU'RE INTERACTING WITH 2015-06-13 13:58:08 -07:00
Firecage f79e0fc1aa Updates more paths, for example obj/stuff to /obj/stuff 2015-05-31 17:48:33 +02:00
spasticVerbalizer 1468ad5b6f Heat-proofness now determined by the type of glass in the airlock 2015-05-12 11:33:21 +02:00
spasticVerbalizer 1cc928fac3 Makes the plasteel sheet drop when the assembly is disassembled without removing the sheet, grammars a comment 2015-05-11 21:12:18 +02:00
spasticVerbalizer bccb7cb14f Standardized heat-proofing airlocks 2015-05-11 20:52:31 +02:00
kingofkosmos a7bd5f93e1 "You hear something" set to italics. 2015-04-24 21:06:16 +03:00
kingofkosmos 1d14471d00 Ellipses to waiting messages. Warning-spanclasses to failing messages with an exclamation mark. 2015-04-24 20:50:50 +03:00
Orange Borg 0570ec92c7 Fix electronics check in airlock code
Because needhand defaults to 1 (on) it was always returning false as the item was dropped before the do_after check
2015-04-10 21:42:57 +12:00
Remie Richards 5fc7af7fbf attackby() now has an argument containing the parameters of the click that called it. Items placed on tables now center their icon where the user clicked. this is NOT true for racks, since racks look organised in their sprite.
Items reset their pixel_x and pixel_y values on pickup.
2015-02-19 13:02:43 +00:00
Boggart ff17e083eb Fixes being unable to build doors over firelocks, blast doors and shutters.
As a result, any door with the sub_door variable set to 1 can have an airlock built over it.
Also fixes using a fireaxe to open unpowered poddoors and adds myself to the admins.txt.
2014-12-31 20:47:17 -07:00
hornygranny 3ad160f98e Merge pull request #6027 from fleure/airlockfix
Fixes multiple airlocks on same tile
2014-11-26 10:57:54 -08:00
phil235 1f4a071940 Fixing a similar bug with door assembly. 2014-11-24 13:21:25 +01:00
fleure e8ca9ec224 Fixes multiple airlocks on same tile 2014-11-23 16:32:24 +00:00
Menshin b77e2fc46a Conflicts solving 2014-11-04 20:24:52 +01:00
Menshin cce46b39eb Fixes runtimes related to clown_ore -> bananium changes (fixes #5554).
Fixes runtimes related to security records (fixes #5552).
Changing the name in the security database now also change it in the general database.
2014-10-31 02:30:34 +01:00
Menshin 26f70fd9aa * Completed the _strip_html_properly_ proc to also limit the length of the text
* Removed uses of _strip_html_simple_
* Replaced input or redondant trimming/text_copying with the new unified _stripped_input_
2014-10-15 16:00:22 +02:00
Cheridan 08be1b34eb Revert "Changes a few green crosses to blue on sprites that I missed last time" 2014-10-04 19:22:10 -05:00
Lo6a4evskiy 82f869c9a6 Updated to resolve conflicts 2014-09-06 13:34:43 +04:00
Jordie0608 4d14bd2dc6 Greens Viro, fixes building glass med airlocks 2014-08-28 23:00:21 +10:00
Firecage 146af7607c absolute paths for the structure folder files
Conflicts:
	code/game/objects/structures/crates_lockers/closets/secure/cargo.dm
2014-08-16 00:01:04 +02:00
Kelenius cd4be00d3b Fix 2014-06-19 02:48:37 +04:00
Kelenius a8b7588c12 Merge branch 'master' of https://github.com/tgstation/-tg-station into Temp
Conflicts:
	code/game/objects/items/weapons/grenades/ghettobomb.dm
	code/game/objects/structures/door_assembly.dm
2014-06-19 02:27:10 +04:00
phil235 6d1bfb9244 removing !src checks 2014-06-13 19:38:15 +02:00
phil235 2f03f0fabd Door Assembly exploit fix 2014-06-12 23:06:42 +02:00
Kelenius 698fde12f4 Two small bugs... 2014-06-13 01:01:10 +04:00
Kelenius 3908160998 One big update for stacks. 2014-06-10 20:36:08 +04:00
Kyrah Abattoir 997e1310c5 More name fixing, lowercasing objects, proper-ing unique objects, plural-ing some stuff that needs it. 2014-05-01 23:07:35 +02:00
Jordie0608 b18cc7d54e Merge branch 'master' of https://github.com/tgstation/-tg-station into manidontevenknowwhatwentwrongwiththat
Conflicts:
	code/game/machinery/doors/airlock.dm
	code/game/objects/structures/door_assembly.dm
	code/game/objects/structures/false_walls.dm
	code/game/objects/structures/mineral_doors.dm
	code/modules/research/protolathe.dm
	icons/obj/doors/door_assembly.dmi
2014-04-11 02:51:07 +10:00