Commit Graph

50 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
oranges
6b0a100d0b Merge pull request #20441 from MrStonedOne/ssSpaceDrift
Makes SpaceDrifting a subsystem
2016-09-13 09:23:16 +12:00
phil235
443a4501ec Carbon Dismemberment , second attempt. (#20461)
* - I rearranged X_defense.dm mob files, more damage_procs.dm.Here's what's inside:
* X_defense.dm: is for the procs of attacks onto the mob, all the XXX_act() proc (things happening to the mob), as well as protection check and get procs (armor, ear prot, projectile dismemberment)
* damage_procs.dm: actual damage procs like adjustBruteLoss() getfireloss, any proc that handles damaging.

- some bugfixes with gibspawner effects.
- monkey's bodyparts can be dismembered and are used to create its icon.
- brains are no longer carbons.
- all carbon have bodyparts that can be dropped when the mob is gibbed.
- adminspawned bodyparts now have a default icon.
- robotic parts are now a child of bodyparts.
- health analyzer on alien/monkey shows damage on each limb
- added admin option to add/remove bodyparts for all carbon (instead of just remove on humans)
- Fixes keycheck message spam for janicart and all when trying to move.
- Fixes bug with buckling to a scooter while limbless.
- removed arg "hit_zone" in proj's on_hit() because we can already use the def_zone var (where hit_zone got its value)
- Fixes mob not getting any damage when hit by a projectile on their missing limb, despite a hit message shown). carbon/apply_damage() now when we specify a def_zone and the corresponding BP is missing we default to the chest instead of stopping the proc. Consistently with how human/attacked_by() default to its attack to chest if missing limb.
- Fixes mini uzi icon when empty and no mag (typo).
- I renamed and changed a bit check_eye_prot and ear prot
- renamed flash_eyes to flash_act()
- I made a soundbang_act() similar to flash_act but for loud bangs.
- added a gib and dust animation to larva.
- husked monkeys
- no damage overlay for husk or skeleton.
- damage overlay for robotic limb now.
- no damage overlay when organic bodypart husked.
- one handed human with a bloody hand still get a bloody single hand overlay.
- fix admin heal being unable to heal robotic bodyparts.
- slightly touched robotic bodypart sprites (head one pixel too high)
- Fixes 18532 "beheaded husk has hair".
- Fixes 18584 "Ling stasis appearance bug"
- no more eyes or lipstick on husks.
- can remove flashes/wires/cells from robot chest and head with crowbar.
- Fixes not being able to surgically amputate robotic arm/leg.

* More merge conflict fixes and adding the new files I forgot to add.

* of course I forgot birdstation

* More typos and stuff I forgot to undo.

* Fixing a typo in examine.dm
Removing an unnecessary check.
Making admin heal regenerate limbs on all carbons.
Monkey-human transformation now transfer missing limbs info and presence of a cavity implant.
NODISMEMBER species can still lack a limb if the mob lacked a limb and changed into that new species.
Changeling Regenerate ability now also regenerate limbs when in monkey form. (and remove some cryptic useless code)

* Fixing more conflicts with remie's multihands PR.

* Fixes runtime with hud when calling build_hand_slots().
Fixes lightgeist healing not working.
Fixes null.handle_fall() runtimes with pirate mobs.
Fixes typo in has_left_hadn() and has_right_hand().

* Derp, forgot to remove debug message.
2016-09-12 19:33:50 +02:00
MrStonedOne
d0b83d71b4 Moves SpaceDrifting to a subsystem to remove a spawn from Move() 2016-09-10 15:17:29 -07:00
Remie Richards
c50fa5729c Merge branch 'master' of https://github.com/tgstation/-tg-station into many_hands_make_light_work 2016-09-10 20:28:23 +01:00
Joan Lung
266bacf4c8 Bubblegum now charges past its target's location 2016-09-03 12:09:08 -04:00
Remie Richards
00738bd2a3 More than 2 hands!? WHAAAAAAT 2016-09-02 16:10:16 +01:00
unknown
5ea9203c7f Added some has_buckled_mobs() checks. 2016-08-02 23:39:29 -07:00
Firecage
58ee32f8e3 Fixes borgs not being able to finish scooters + misc changes. 2016-07-18 16:25:09 +02:00
PKPenguin321
01d4d02b70 conflicts + undo loc changes
attackself/dragging the board now deletes it and spawns a new board of the proper type again instead of setting locs
2016-06-20 22:22:50 -07:00
PKPenguin321
3254e28a89 tweaks 2016-06-16 19:44:34 -07:00
PKPenguin321
c12f351e30 makes them go inside each other
;)
2016-06-16 18:59:12 -07: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
PKPenguin321
ee2a964c07 new skateboard sprites 2016-06-14 16:52:24 -07:00
PKPenguin321
a6655db4fa Merge branch 'master' of https://github.com/tgstation/-tg-station into boardsmacked
# Conflicts:
#	icons/obj/weapons.dmi
2016-06-14 14:28:03 -07:00
Remie Richards
fda2c699fc Automatic conversion via Regex 2016-06-11 18:37:48 +01:00
oranges
4c09ee4fbc Merge pull request #18364 from PKPenguin321/rip-scooterborgs
makes legless scootering a feature
2016-06-09 16:10:09 +12:00
PKPenguin321
beccfc08a6 makes it work 2016-06-08 19:21:47 -07:00
PKPenguin321
1260170c07 Merge branch 'rip-scooterborgs' of https://github.com/PKPenguin321/-tg-station into rip-scooterborgs
# Conflicts:
#	code/modules/vehicles/scooter.dm
2016-06-08 15:38:00 -07:00
PKPenguin321
ceb1780c2f fixes duplicate message, more tweaks 2016-06-08 15:25:43 -07:00
PKPenguin321
3c08c52cff fixes broken var
Buckled mobs -> buckled mob
2016-06-07 22:59:20 -07:00
PKPenguin321
7de7f6bbdb tweaks 2016-06-07 21:30:28 -07:00
PKPenguin321
d031d38f03 makes scooterborgs a feature 2016-06-07 20:06:03 -07:00
PKPenguin321
cbdf98b796 code for picking up boards, placeholder codersprites 2016-06-07 15:29:00 -07:00
AnturK
19eb97ae18 Moves some list initializations to New
Fixes missing ..() calls in New()
2016-06-07 18:39:13 +02:00
LatD
65a0027979 Merge remote-tracking branch 'refs/remotes/tgstation/master' into Research 2016-05-28 01:37:55 +03: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
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
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
Cheridan
eab43191a7 Merge pull request #16375 from ChangelingRain/fastbike
Speedbike trails now have a proper, under-speedbike layer
2016-03-26 20:46:35 -05:00
Nerd Lord
ee65384437 Speedbike trails now have a proper, under-speedbike layer 2016-03-25 22:10:14 -04:00
Leo
bac9031a32 Adds a check for clients.
Otherwise bad things will probably happen
2016-03-23 17:48:32 -03:00
Leo
e10b0753d0 Guess you can't use world.view here 2016-03-23 00:16:20 -03:00
Lzimann
0a8103ea70 Adds a way to change vehicles view range 2016-03-23 00:00:54 -03:00
PKPenguin321
443a73fe75 tweaks code slightly as per remie's request 2016-03-14 19:16:32 -07:00
PKPenguin321
747538921d fixes skateboarders being unable to have head on head collisions
since they were non-dense they couldn't crash into each other even when there was another person on the other skateboard. this fixes that
2016-03-14 15:55:54 -07:00
PKPenguin321
69372b03ab adds tablecrafting recipes
also makes skateboards nondense because their sprite was so small and it's awkward bumping into something that small
2016-03-13 21:58:04 -07:00
PKPenguin321
6552c6c0b1 code cleanup
fixes a case where skateboards can end up in nullspace
adds another do_after
moves a sfx
2016-03-13 14:49:31 -07:00
PKPenguin321
0bc274573a fixes skateboard crashing 2016-03-12 20:49:21 -08:00
PKPenguin321
8961dbc46f updates code to come into line with remie's buckling update
there is still a huge bug that i will point out on github
2016-03-12 20:11:28 -08:00
PKPenguin321
bceca977ec adds scooters and skateboards
adds scooter.dm for pretty much all scooter-and-skateboard related code
added ability to make a scooter frame to rods.dm
added sprites for the scooter, the skateboard, and the scooter frame to vehicles.dmi
2016-03-12 19:27:48 -08:00
Remie Richards
aeaa73601c Fixes 2016-03-07 19:39:37 +00: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
AnturK
68c0fc3173 Switches to overlay/temp 2016-02-25 13:11:08 +01:00
AnturK
444b5ae9d5 Adds simple space vehicle 2016-02-24 14:14:20 +01:00
Remie Richards
db6f01bf5e Formalises Path Compatibility 2015-12-28 22:20:33 +00:00
Remie Richards
3c9c6e5c19 Fixes ATV speed and name, improves janicart cleaning code by using Moved() vs a Move() override. 2015-12-26 23:16:39 +00:00
Remie Richards
bd22fc8c6d Converted janicarts into a simple to use vehicle framework with customisable speed, converted all existing vehicles to the new framework, added a atv type with a turret on it. 2015-12-26 22:54:15 +00:00