Commit Graph

65 Commits

Author SHA1 Message Date
PJB3005
7356e80484 hey that should be everything except making it compile. 2017-01-17 22:08:27 +01:00
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
dff4db726a Replaces a bunch of istypes with their proper macros (#20739)
* Replaces a bunch of istypes with their proper macros

* i'm not sure doing a 100+ file changed pr on a whim is something you do when bored
especially if you do it by hand because you never actually learned the regex that would let you automate it

* i'm just... gonna do this, because that check was true a lot and it shouldn't matter
2016-09-30 20:21:08 +02:00
phil235
6809603669 Changes obj/effect/blob,spider,swarmer,energy_net,spacevines to be ob/structures instead, since you can hit and destroy them.
Adds a large ash and large molten item decal (for future use)
simplifies decal/cleanable/replace_decal() code a bit.
Changes construction() proc to on_construction() for consistency, same for deconstruction().
Made a deconstruct() proc for machinery and computer (also for future use).
2016-09-27 19:58:27 +02:00
Joan Lung
60e6ebaef1 Bubblegum's blood from being hit now has a different visual (#20626)
* Bubblegum's blood from being hit now has a different visual

* joan lung confirmed wild shitcoder
2016-09-24 19:51:42 +12:00
Joan Lung
ba6acc2ea0 Reduces the copypaste in cleanable decal code (#20491)
* Only holy water will clean blood runes

* macro!

* holy no longer required

* i am far too unethical and spite driven half the time

* it appears code done in the middle of the night in the hope that oranges hasn't merged my pr isn't always that good
2016-09-19 09:45:12 +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
Xhuis
527dddd95d Complete Revenant Rewrite (#18522)
I'm unhappy with the way revenants are right now, and my code for them is pretty unsatisfactory in comparison to what I know now. Although revenants will still fill the same role of just being spookier ghosts, they'll be a bit more passive - incapable, for instance, of giving diseases to people. The new revenants will be called umbras and will use vitae instead of essence.

Total change list:

    Revenants have been renamed to umbras. Essence has been renamed to vitae. This may be temporary.
    Umbra spawn events are now weighted higher and spawn an unoccupied umbra. Ghosts are alerted to the umbra's position and may interact with it to take control of it.
    Umbras' health is not based on vitae but has a hard cap at 100.
    Umbras have a passive vitae drain each tick, defaulting at 0.01. If the umbra runs out of vitae, they will die irrevocably. They also slowly regenerate health by doing this.
    When an umbra dies, they leave behind umbral ashes that reform after one minute. They're difficult to see and can be scattered by activating them, although they also have high research levels if you're fast enough.
    Harvesting vitae from critical targets no longer kills them. Harvesting a target in general prohibits them from being harvested until five minutes later, but they can be drained again after that.
    EMPs revitalize umbras and give them hefty amounts of vitae due to their physical nature.
    Umbras have four abilities: Toggle Nightvision, Discordant Whisper, Possess, and Thoughtsteal.
        Toggle Nightvision is self-explanatory.
        Discordant Whisper is identical to the original revenant's transmit.
        Possess allows the umbra to slip into a human's body unnoticed. While in their body, umbras will slowly drain vitae from the human at a tiny rate - not enough to cause harm, but enough to induce adverse effects in the clueless human. These effects intensify over time and eventually lead to the umbra being forced out of their host.
        Thoughtsteal paralyzes a living human for several seconds while the umbra steals their memories. After several seconds, the umbra copies the notes of the target's memories and turns invisible - the hapless victim is stunned for several seconds afterwards and can't be Thoughtstolen by the same umbra again. Umbras have an objective to steal the memories of 25% of the station's population.
    Salt piles have been added, created by salt shaker or just by splashing salt. These piles will prevent an umbra from passing and reveal them briefly if they try.
2016-06-17 10:58:07 +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
phil235
3b8af6f5ff Fixes grille/New() not calling ..()
Blood drips icons are now in blood.dmi instead of drip.dmi (which only had the 5 drip sprites).
Moved projectiles, guns, casings and ammo boxes to be in the right files. Please don't put your gun with its projectile, ammo casing and ammo box all the same file.
I split growing.dmi into 5 smaller files so we don't get close to the 512 icon limit again. Each seed has a var to indicate which icon file to use when planted.
Fixes code for heavy pulse laser projectile to be less awful.
2016-06-11 23:18:26 +02:00
phil235
b482764a19 - I made human/handle_blood() less shitty.
- We no longer leave a blood trail if blood_volume is below a certain level which depends on the brute damage received. This way dragging a wounded player does have a bad effect.
- We no longer give humans a second reagents var containing blood, and we don't put exotic blood in the mob's reagents. Now we don't store any blood substance inside the mob, we only have a blood_volume var. When we draw blood with syringe we create the reagent that match the type (blood reagent, or an exotic blood reagent)
- can't draw blood from mob if it's low on blood, so we can't empty a mob of its blood entirely.
- Removed the blood type preference appearing in character setting.
- blood pack automatically show blood type, unless manually labeled.
- removed bloody_hands_mob human var and same name glove var.
- Some animals now have blood (pets, goat, cows)
- hitting and dragging mobs with actual blood in their veins leaves blood on you and a trail on the floor.
- probably other stuff that I'll mention in the PR.
2016-06-04 17:33:16 +02: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
c0
240fd5bc05 Plant Refactor: Genesis 2016-03-09 09:29:37 +03:00
Akke
fc88b4d589 changes destroy() to qdel(src) 2016-03-02 00:00:54 +00:00
Akke
72854bd973 Flies can no longer eat.
Flies must eat vomit.
Eating causes vomiting.
Janitors and Janitorborgs rollout.
2016-02-23 00:03:15 +00:00
phil235
8b2708ff9a Replaces holo tape and holo tape projector with holo barrier and holo barrier projector (children of the janitor's holosign creator). 2016-02-19 02:34:57 +01:00
duncathan salt
18b9d67ab5 Merge pull request #14364 from swankcookie/cockroach_guts_fix
Cockroach guts fix
2016-01-06 22:50:15 -06:00
swankcookie
d4c3048a31 Removes redundant anchor tags
Signed-off-by: swankcookie <__X__>
2016-01-06 22:08:17 -06:00
MrStonedOne
b50e8d2a63 removes a bunch of unneeded spawns
spawns have a high overhead.

I only went for easy targets, almost every spawn could be removed with a few subsystems in place to handle delays or cooldowns
2016-01-02 18:23:02 -08:00
KorPhaeron
a47b490d2b That was dumb 2015-12-26 07:00:20 -06:00
KorPhaeron
1a958e83b6 Stacking decals 2015-12-26 06:47:07 -06:00
KorPhaeron
6ad132df53 Stacking decals 2015-12-19 07:41:22 -06:00
MrStonedOne
a1bfb37f0c Tweaks lighting some more.
This should be ready to go.
2015-12-02 07:12:37 -08:00
phil235
d3ee910211 Makes effect system code more OOP.
obj/effect/effect is now renamed obj/effect/particle_effect for better usability.
datum/effect/system and /datum/effect/effect/system are now both /datum/effect_system.
Fixes a bug where wall mounted igniters (and other spark producing objects) didn't produce sparks sometimes.
Moved explosion_particles.dm into the effect_system folder, because it has effect_systems code.
2015-10-21 23:28:29 +02:00
bgobandit
e7555de606 Adds the ability for chemists to turn gibs into soap. Gibs can now be scooped. 2015-10-13 20:01:49 -04:00
phil235
0efb30434a Fixes not being able to move during jaunting if you are cuffed and pulled.
Greenglow decal no longer disappears after 2 minutes.
Fixes runtime with explosive implant activation.
Fixes stunbaton infinite cell charge, the baton now turns off if you try using it after its cell has been deleted somehow.
Fixes bloody pulled mob leaving a blood trail in zero G.
Shortens the guardian battlecry message when attacking to lower chat spam.
Items in Morph now disperses a bit on death instead of being all on the same tile.
After reaching a limit of 50 items, morph swallowing items deletes them instead of putting them inside the morph.
Monkeys can no longer modify the hand labeller's text to communicate.
Fixes carbon,radium,uranium 's reaction_turf creating multiple decal on a tile, it now checks if there's already a decal of the relevant type and (for radium and uranium) only transfers reagent to it if it finds one.
2015-10-08 00:48:00 +02:00
oranges
48f86bc9f5 clean up more non useful comments 2015-09-17 12:23:44 +12:00
Remie Richards
7b6bbbfed1 Further tweaks. 2015-09-13 16:17:50 +01:00
Remie Richards
4bb97067b2 Tweaks amount of footprints, and fixes some bugs related to footprints, adds shoetype tracking to footprints 2015-09-13 15:36:56 +01:00
Remie Richards
ff07337841 Bloody footprints! Human blood, Xeno blood, and Oil can now produce bloody footprints that fade off as the blood on the shoe fades. Affects gibs too. 2015-09-02 01:32:02 +01:00
duncathan
51c09f16bf makes all Destroy()'s return properly 2015-08-31 00:21:01 -06:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
Cheridan
87cd31c11f Merge pull request #10211 from Ikarrus/burntweaks
Destructible Clothing Tweaks and Fixes
2015-06-29 21:38:20 -05:00
phil235
5f3bcf9eaf Fixes a runtime with cleanable/shreds when it is burnt. 2015-06-28 21:09:54 +02:00
Ikarrus
7894263033 Destructible Clothing Tweaks
- Fixes runtime with burning decals without reagents
- Adjusts some burnable flags
- Removes minimum shred prob()
2015-06-27 13:33:33 -06:00
Ikarrus
8759f56f6f Squashed Commits 2015-06-27 00:09:16 -06:00
Ikarrus
3d5f126779 Destructible Clothing [WIP]
- Clothes can be set on fire and extinguished
  - Any item can technically be set on fire and extinguished now, but only clothes (and paper) actually burn right now
  - All of a mob's clothing are burned if the mob is husked by fire
- Clothes will also have a chance of being shredded if you are caught in a bomb blast
  - The bigger the explosion, the higher the chance they have of being destroyed
  - Outer layer clothing (headgear and exosuits) take the shock first, which absorbs some of the shock for the clothes it covers, according to it's bomb armor
2015-06-25 00:06:47 -06:00
MrStonedOne
bd6d51a0b5 Massive MC and subsystem rewrite
MC:
	No longer tracks a subsystem's cpu usage. This was basically worthless and took up space on the stat panel
	Can calculate wait down to a tenth of a decisecond to make it fps/world.ticklag agnostic
	Now allows subsystems to have a dynamic wait, that is based on a ratio of how long that subsystem has been taking to process(cost). (This system allows for upper and lower bounds, and an changeable cost delta for each subsystem)
	MC can now be told to init a zlevel

All Subsystems:
	Stats panel now allows child subsystems to pass it a message to add to its stats entry. All subsystems have been moved over to this system - This should cut down on subsystems having to copy and paste the stats proc in order to add to it
	All subsystems now properlly handle being given a zlevel in their init proc

Subsystem changes:
	Air:
		Added air to the dynamic wait subsystem. upper bound: 50, lower bound: 5, cost delta: 3 times process cost
		Air now fires 4 times faster when it can do so without lagging things up
		Pipenet has been merged into air
		Atmos machinery now processes with process_atmos(), ticked by air, not machinery.
		Hotspots (the fire object) are now object pooled
	Pipenet:
		Deleted, added to air
	Machinery:
		Moved all atmos calcualtions in all objects's process() to process_atmos().
	Lighting:
		Added Lighting to the dynamic wait subsystem. upper bound: 20, lower bound: 5, cost delta: 3 times process cost
	Ticker:
		Fixed ticker not updating the lobby panel when game start delayed
		Fixed the game start timer updating rapidly from queued fires when game start delay is removed
	Garbage/qdel:
		qdel will now limit its process time to 2ds a fire.
		qdel can now be given hints as a return to Destroy() as to what should be done with the object.
		the options are:
			queue: (default) this is the normal behavior.
			letmelive: old default to non-null/zero. does nothing with the object
			iwillgc: functionally the same as above, mainly to let people working with objects know that the object will not be queued for GC checking
			harddel: this will queue the object to be deleted without storing a soft reference, mainly to save locate() processing time.
			harddel_now: this will del() the object. To allow for a clean removal of every del() not in qdel
		All objects have been updated to the new system, harddel and iwillgc was not added to any new objects.
		Fixed some objects not GCing because they didn't properlly clear references in Destory()
		Fixed some objects getting qdel'ed preventing other objects from getting GCed because they did not null their reference to that object.
2015-04-29 02:00:25 -07:00
Iamgoofball
c06ad7e6b8 moved process() to datum. made /datum/reagents/ process instead of the containers. 2015-04-07 17:13:59 -07:00
Iamgoofball
54154bec12 Merge branch 'master' of https://github.com/tgstation/-tg-station into explosive 2015-04-07 16:21:07 -07:00
phil235
0b403b3b03 Fixes lack of dna in old blood.
Fixes some comments about blood procs in atoms.dm
Small tweak in xeno blood blood_DNA.
2015-03-31 19:48:44 +02:00
Iamgoofball
434265afa0 Reagent Decals 2: Black Powder Boogaloo 2015-03-22 02:04:31 -07:00
Mandurrrh
48daa155d7 Fixes #8116 trails bug 2015-03-04 19:53:11 -05:00
paprka
d6dce069f4 finally actually fixes the blood decals 2015-02-01 00:29:37 -08:00
paprka
0b64a23310 fixes blood drips 2015-01-31 23:40:27 -08:00
paprka
a661e58281 Merge branch 'master' of https://github.com/tgstation/-tg-station into ointmentandshit
Conflicts:
	_maps/map_files/TgStation/tgstation.2.1.3.dmm
2015-01-31 22:03:00 -08:00
paprka
f071655ea4 updates and optimizations 2015-01-24 01:12:57 -08:00
paprka
1cdd5f011f blood for the blood god 2015-01-20 19:17:59 -08:00
Razharas
7758a0afed Ok now explosions shall work properly
Changed severity to target, make items not destroy themselves on
severity lower than 1, all that stuff
2014-12-05 23:21:48 +03:00
Razharas
ff456ebaf4 Unwinded most of shit
Meh
2014-11-19 21:36:45 +03:00