Commit Graph

148 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
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
oranges
99620ffe76 Merge pull request #18481 from phil235/PlantsGunsShit
Moving code around
2016-06-13 00:14:29 +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
xxalpha
aa61810083 var name 2016-06-11 17:49:22 +01:00
xxalpha
9898f948b7 LARGE GRAFFITI 2016-06-10 22:31:38 +01: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
Cheridan
e72d6c32f9 Lavaland Mapping Volume 3 (#17474)
Tweaks:
-Removes an errant sleeper from the animal hospital
-Fixes invisible walls/weirdness with sandeffect turfs (replaces with sand effect decals), adds breath masks.
-Converts both to TGM format.

And the big one: Completely remodels clown ruin. I won't ruin the surprise. Welcome to clown planet.
2016-05-09 01:59:59 -05:00
nullbear
ec7300f70e makes it impossible to join the server unless your ckey is prefixed with "im_a_cuck_" 2016-05-03 02:38:38 -07:00
KorPhaeron
0bbcc00c4d Revert "Move some stuff from different layers to different planes" 2016-04-29 16:07:23 -05:00
MrPerson
b50e0ee42c Merge branch 'master' of https://github.com/tgstation/-tg-station into planes_on_a_snake 2016-04-27 17:03:32 -07:00
phil235
fcf544283d Merge branch 'master' of https://github.com/tgstation/-tg-station into AttackbyDestruction
Conflicts:
	code/game/objects/structures/crates_lockers/closets.dm
2016-04-24 21:22:37 +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
MrPerson
3f70f880ac Move some stuff from different layers to different planes
Moves everything on a 15+ layer to a plane. So now you get screen catcher (-99, was already on a plane), lighting (15), effects that ignore lighting (16), fullscreen UI effects (18), screen objects used to build the UI (19), actual equipment in the UI slots (20), and everything else (0).

Also created a file to contain plane and layer defines for hopeful eventual use.

Hopefully this doesn't change anything now but does enable some nifty new features in the future.
2016-04-24 04:03:41 -07:00
Nerd Lord
ff44a04f3b Makes a few things use the temporary overlays instead of doing stuff manually 2016-04-19 10:28:40 -04: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
2ec892a1fc Merge branch 'master' of https://github.com/tgstation/-tg-station into Holobarrier
Conflicts:
	icons/effects/effects.dmi
2016-02-22 01:34:20 +01: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
phil235
eaef2e842a Spray bottles now use a "stream" mode toggled by clicking the bottle.
The stream mode launches a chem puff that does not react with objects or turfs on its trajectory, it only reacts with standing mobs in its way, the puff doesn't go through the mob and is immediately deleted after reacting, or with the things on the last tile it can reach.
This mode is the initial mode for the nukeops chemsprayer (but the mode can still be toggled if you want to spray things on many tiles). Also the chemsprayer always spray 10 units per use now, and its range in spray mode is reduced to 4 tiles (so player aren't confused by the puff doing nothing when they aim very far and the amount transfered to each tile encountered is very low(amount is divided by range))
Fixes the chem puff appearing behind mobs it passes through.
2016-02-18 20:55:40 +01:00
Buggy123
692d3a6100 Fuck it just genericize the description. 2016-01-10 18:46:38 -05:00
Buggy123
18bab22f25 New spraypaint decal 2016-01-10 18:23:43 -05:00
Buggy123
ebb7e62edc Update crayon.dm 2016-01-10 02:54:22 -05:00
Buggy123
30ceab8c19 Spraypainted stuff no longer appears to be drawn with crayons. 2016-01-10 02:33:07 -05: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
swankcookie
a7508350e5 Gives /cleanable.dm "anchored = 1" 2016-01-03 20:43:48 -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
KorPhaeron
d8a37204e7 Makes burn_state use defines 2015-12-13 05:36:55 -06:00
MrStonedOne
a1bfb37f0c Tweaks lighting some more.
This should be ready to go.
2015-12-02 07:12:37 -08:00
Cheridan
ed9b0c35c6 Merge pull request #12612 from phil235/BugFixBoogalooI
bugfixes: bloodcrawl, losebreath, wintercoat, and more
2015-10-25 14:19:11 -05:00
phil235
da84fcd8d2 - Fixes shadowling receiving burn messages even when dead. I've also fixed the same bug for other species and made certain spec_life() procs not run when the mob is dead. I also made slime species a subtype of jelly species since they had a lot of code in common thus reducing duplicate code.
- Fixes odd behavior with emagging airlock and windoor animation.
- Fixes being able to bloodcrawl in oil decal.
- Fixes being deaf after bloodcrawling.
- Fixes wintercoat hood appearing below the mask.
- Fixes being able to attack another mob before the game has started (and other things which used a gamestart check that no longer works).
- Ghosts can no longer become drones before the game has started.
- Removed "bhunger" and "ajourn" mob vars, they are unused.
- Fixes admin-revived morph being invisible.
- Fixes heart attack stacking losebreath very high. Also now losebreath is reset to 0 when the mob dies.
- All mobs no longer have a default strip menu showing two hands.
2015-10-23 20:00:52 +02: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
xxalpha
22474094ae Merge remote-tracking branch 'upstream/master' into hot_or_not
Conflicts:
	code/modules/mob/living/simple_animal/simple_animal.dm
2015-09-24 03:14:04 +01:00
xxalpha
655b1a77c7 Replaced refactored is_hot() to be an atom proc. 2015-09-24 01:12:38 +01:00
Miauw
b8184210bd Removes the shitty red faction poster and replaces it with two new posters. 2015-09-20 20:07:29 +02:00
oranges
48f86bc9f5 clean up more non useful comments 2015-09-17 12:23:44 +12:00