Commit Graph

54 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 bdcb16113a Adds a few turf istype helpers (#20754)
* a very calming act
when the world is too much, too fast

* i'm tired
but i have to be efficient, infinite

* lick your lips at the sight of me
a fantasy made reality
2016-10-01 19:25:46 +02: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
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
Joan Lung 8516999a2a Wetting turfs should actually last for some time 2016-06-28 14:28:51 -04:00
LatD f36237a67d Merge remote-tracking branch 'refs/remotes/tgstation/master' into Research 2016-05-25 18:45:31 +03:00
Nyvrem 19caf6c130 Fixes mop wetness stacks (#17850)
* Fixes mop wetness stacks

Mops currently apply ten times as much liquid as they use and because wetness and lube and the such now stacks this means when you apply something with a mop it takes ten times as long to dry as it would otherwise.

* Fixes lacking wetting
2016-05-25 13:23:54 +02:00
LatD 7d6b3e6847 origin and req lvl changes 2016-05-21 17:17:20 +03: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
zenek123 f14a80b10c Update mop.dm 2016-04-12 21:51:00 +02:00
duncathan e86cf0f280 praise the good lord, for the game finally compiles 2016-03-29 19:04:37 -06:00
duncathan 5bf31463da removes simulated turfs; adds space gas mixture for space 2016-03-10 17:27:01 -06:00
KorPhaeron d8a37204e7 Makes burn_state use defines 2015-12-13 05:36:55 -06:00
Fox-McCloud 6ca0a1ad40 Re-Adds Advanced Mop 2015-09-26 06:42:57 -04:00
Swag McYolosteinen b5e4eefe8b Merge pull request #11685 from bgobandit/fuckingprogressbarsfuck
Mop progress bar now actually works.
2015-09-13 17:30:50 +02:00
bear1ake f697ae90f5 removes a bunch of .0 2015-09-10 20:57:30 +09:00
bgobandit 4efae3bc02 Mop progress bar now actually works. 2015-09-09 22:04:47 -04:00
c0 9cfb246e4f Removes dirt from walking on tiles 2015-08-24 11:33:52 +03:00
Ikarrus 8759f56f6f Squashed Commits 2015-06-27 00:09:16 -06:00
Iamgoofball c2256d41fc BAR NOW SHOWS UP ON THE OBJECT YOU'RE INTERACTING WITH 2015-06-13 13:58:08 -07:00
Jordie 4e82cd9689 Merge pull request #9355 from Firecage/OverlaycleanBGone
Removes the ability to clean Overlays
2015-05-09 21:30:21 +10:00
Firecage c0c2c8b097 cleanable #define 2015-05-05 18:51:44 +02:00
Firecage 522e77752f Removes the ability to clean Overlays 2015-05-05 17:36:51 +02:00
kingofkosmos 8c1f6b1644 Mop span fix. 2015-05-04 05:57:31 +03:00
kingofkosmos de280c72b5 Removed some more spans from visible messages. 2015-04-24 21:06:59 +03:00
Ikarrus 4ff044dc78 Gang v3 has been tested and is now good to go! 2015-04-19 22:26:15 -06: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
paprka 2afd0f7862 adds key spawning and stuff 2015-01-21 18:39:17 -08:00
paprka 8535145401 Merge branch 'master' of https://github.com/tgstation/-tg-station into janitorbuffholyfuckvalvepleasenerf
Conflicts:
	code/game/turfs/simulated/floor.dm
2014-12-27 21:54:53 -08:00
paprka ef189dc9d4 adds dirt overlays for walking on turfs 2014-12-16 22:12:14 -08:00
paprka 9be60df479 fixes no inhand for mop 2014-11-08 19:28:13 -08:00
paprka 5599d9b2b7 advanced mop cleans twice as fast as the normal mop 2014-10-27 19:04:01 -07:00
paprka b136cf653c wet floor signs and advanced janitor research 2014-10-23 13:43:42 -07:00
paprka 7f2feabbd8 soap, lube, and janitor stuff 2014-10-23 01:44:19 -07:00
MrPerson d56e0c6d04 var rename. Gia's right, this was kinda confusing 2014-04-23 15:11:59 -07:00
MrPerson 2841124d29 Runtime fix for the mop
The following runtime has occured 40 time(s).
runtime error: Cannot execute null.clean blood().
proc name: clean (/obj/item/weapon/mop/proc/clean)
  source file: mop.dm,22
  usr: Xavier Paynter (/mob/living/carbon/human)
  src: the mop (/obj/item/weapon/mop)

Cause: Someone would mop the same vomit/whatever more than once. The first clean would qdel() the vomit, which resulted in the vomit's loc being null. The subsequent moppings would continue and eventually try to call vomit.loc.clean_blood().
2014-04-22 12:52:33 -07:00
MrPerson 9eee3e5067 First pass at a qdel() garbage collection system for tgstation
Works pretty well. If it can't GC something, it'll just del() it and be done.
Speed is amazing, holy shit.

New procs you should be aware of:
qdel(atom/movable) - sets up an object for garbage collection. Call this rather than del(atom/movable).
atom/movable/Destroy() - called right before the object is GC'd, so it still has a loc. Also called if the object is del()'d.
new controller - garbage.dm has all the details on this. Basically it nulls all references on GC'd objects and force del() them if necessary.
Generally speaking, objects should use Destroy() for behavior prior to deletion rather than Del(). You should also always call the parent so the object gets the right gc_destroyed var set.

ISSUES:
Tries to GC mobs atm. This actually works for new players, not so much for humans/monkies/simple_animals/anything. I'm guessing it needs to clear out their mind and HUD and maybe other things.
Gibbing is really bugged. It works, but the overlays just sit there for awhile and ugh. I'm very tempted just to del() mob/living and mob/camera and call it a day.
qdel() equipment doesn't unequip the item.
Pipes don't generally GC correctly. Debugging suggests they get referenced in many pipenets and that isn't cleared properly. However some do work fine. Need assistance here.
Bots don't GC, probably in the radio controller.
Lots of other shit doesn't GC but it's hard to find them because of the pipe spam.
I think I'm calling Destroy() twice by accident.
2014-02-23 14:55:12 -08:00
Hornygranny 2134add41b Items with throw_range over 7 reduced to throw_range 7. This does not affect players as there's no way to extend your vision range. 2014-02-17 15:44:07 -08:00
Hornygranny 9e14c22747 Reduces throwspeeds on all items to realistic levels. 2014-02-15 19:58:03 -08:00
hornygranny e0d0cedf36 passed over everything with throwforce 2014-02-13 18:06:50 -08:00
adrix89 5e05401541 properly fix rune cleaning 2014-02-06 17:35:48 +02:00
adrix89 02cf28a4f1 missed a rune check 2014-02-06 17:13:01 +02:00
adrix89 dfa1c8c363 Fine! removed ability to clean up runes 2014-02-06 09:12:32 +02:00
adrix89 8a41cf9c69 Spray bottles doesn't make floor wet anymore.
Wet floor nerfed
Slight soap and banana buff.
Cult runes are now cleanable by soap and space cleaner.
You can clean with holy water.
2014-01-31 23:05:55 +02:00
Cheridan bb9c09df46 Obsoletes flags = FPRINT | TABLEPASS*
*TABLEPASS was already totally obsolete.
FPRINT was used, but it was on virtually everything anyway.

Removes those flags from every instance where they were used. Also assigned and removed other flags where it made sense.

If it is desired, I can revive the flag as NOFPRINT, which would retain the original functionality, though inverted. That way it would be be used only  where it was intentional (holodeck items could use this for example).
2013-12-30 15:03:17 -06:00
Perakp c40af6ae40 Update icons after item is placed in cart. 2013-12-21 09:50:15 +02:00
Perakp 68ff764463 Subtypes of janiborg tools
- The other way of fixing it. I’m not sure why this is better.
- Removed condescending messages to cyborgs.
2013-12-18 20:44:24 +02:00
supersayu a993ce62db Bugfixen and minor changes. Fixes #136.
Adjusts the click code to not use client/Click().  The code is largely unchanged, except that it allows the compiler default behaviour of calling atom/Click(), and then forwards the call to mob/ClickOn().  I had some reports that melee combat mixed with movement was behaving oddly, and I believe it may be due to the use of client/Click; the byond documentation says that redefining client/Click() causes additional overhead, and it isn't strictly necessary.

Alters the way double clicks are handled, in an attempt to better handle clickspam, as often occurs during pitched combat.  This may also be responsible for the above, but I don't know.

Inserts proximity (aka flag) checks in all afterattack() procs.  The old assumption was that unless an item used the USEDELAY flag, afterattack() was only called when adjacent, but this is no longer true.  This led to beakers, soap, crayons, etc, all being usable at all ranges.

Removes the NODELAY flag, which was unused.  Removes all existing uses of the USEDELAY flag so that it can be readded to things that need extra delay.

Removes the hand_* procs, previously used by restrained actions.  Instead, the mob helper mob/RestrainedClickOn() has abosrbed basically all the functionality they were used for, which is really only monkeys with jungle fever.

Adds a special case of the Adjacency() proc for doors.  This fixes #136, airlocks being unreachable due to border fire doors.  However, this only takes us back to the unpleasant position where you have to open-hand the door, switch to a crowbar, and pry open the firedoor; it still needs a better fix.
2013-09-17 18:19:14 -04:00
Aranclanos 6294888222 The mop will now check for water to clean the floor. This will stop people from cleaning the floor with fuel, avoiding the slippery floors. 2013-07-04 12:07:02 -03:00
Pete Goodfellow e4bce0bb14 Replaced most reagent initialisations with the helper proc create_reagents(). 2013-04-15 15:40:33 +01:00