Commit Graph

46 Commits

Author SHA1 Message Date
phil235
cd825493cf Unfuck the statue code. 2016-10-14 21:04:52 +02: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
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
Cheridan
2bb568bf2b Adds an aesthetic new space ruin with original content (hi bawhoppen) (#19275)
* Adds an aesthetic new space ruin with original content (hi bawhoppen)

* do you understand its all in your hands its your move

* i made up my mind
time is running out
2016-07-14 14:21:49 -04:00
phil235
43e98079f1 Removing some comments I had left in. 2016-04-24 21:12:04 +02:00
phil235
0480790b0a Same things but with structures now. 2016-04-24 20:38:33 +02:00
duncathan
497a4efc70 makes atmos_spawn_air() use the new gas string parser 2016-04-04 01:49:09 -06:00
duncathan
b9950c4358 turf/open and turf/closed 2016-03-29 13:38:56 -06:00
duncathan
5bf31463da removes simulated turfs; adds space gas mixture for space 2016-03-10 17:27:01 -06:00
MMMiracles
d07f300063 i did things 2015-12-15 16:46:24 -05:00
MMMiracles
6ac96194ba snow stuff. 2015-12-04 18:52:17 -05: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
Xhuis
5f99b313cc Radiation changes 2015-09-26 13:33:27 -04:00
xxalpha
655b1a77c7 Replaced refactored is_hot() to be an atom proc. 2015-09-24 01:12:38 +01:00
duncathan
51c09f16bf makes all Destroy()'s return properly 2015-08-31 00:21:01 -06:00
phil235
866cdbcd34 Fixes plasma cutter firing sound, as well as lack of sound when slicing girder/statues.
Rearrange girders.dm
Singularity_pull() no longer unanchors anchored objects (because it breaks the deconstruction of table/girder/states/etc, and make mech pullable by mobs), but it still pulls them.
2015-08-07 23:14:45 +02:00
KorPhaeron
d1dec3ffec Changed on phil's comments 2015-07-21 12:20:15 -05:00
KorPhaeron
99c5d75cef Adds check for firer being null 2015-07-20 06:07:17 -05:00
KorPhaeron
65f56e146d Liberty Station fix, alien whispering fix, plasma statue logging.
Fixes the liberty station spawning an SMG without a firing pin by
creating an unrestricted variant of it. Added unrestricted L6 and
unrestricted bulldog object types for admin spawn since I was already
there.

Fixes aliens being able to whisper to ghosts.

Adds logging to shooting plasma statues.
2015-07-19 10:31:52 -05: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
Jordie0608
a67de221cc JMP replaced with FLW, fixes and adds a bunch of key_name checks in adminlogging 2015-06-14 23:37:35 +10:00
Iamgoofball
c2256d41fc BAR NOW SHOWS UP ON THE OBJECT YOU'RE INTERACTING WITH 2015-06-13 13:58:08 -07:00
GunHog
26df5b6c8e Removes mining drill power mechanic.
- Removes the power mechanic from mining drills and the sonic
jackhammer.
- Fixes broken borg diamond drill upgrade.
2015-05-08 10:12:22 -05:00
kingofkosmos
de280c72b5 Removed some more spans from visible messages. 2015-04-24 21:06:59 +03:00
phil235
081bae6740 Fixes broken ui action button for toggling chef apron's sleeves and owl's wings.
Fixes surviving suicide
Fixes suicide damage overlays.
Fixes ninja regen "clothes warm" spam message. (moving rad armor check outside of apply_effect)
Fixes ninja smoke bomb count.
Fixes dead shaved corgi
Fixes lipozine still being in code.
Fixes flattening boxes requiring them to have their window opened.
Fixes armor softening message from disarm attack.
Fixes player being forced to play spiders without choosing.
2015-04-14 13:54:36 +02:00
pudl
69924a15be plasma/ripley update 2015-03-25 18:06:26 -05:00
Jordie0608
a7e23d672a Improves drill's handling of power 2015-03-05 17:12:12 +11:00
Remie Richards
b1ff6b7220 Merge branch 'master' of https://github.com/tgstation/-tg-station into AttackbyParams
Conflicts:
	code/game/turfs/simulated/floor/light_floor.dm
2015-02-24 22:16:53 +00: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
88760896ad initial commit 2015-02-13 20:59:39 -08:00
phil235
be6532b825 Fixing a few things in statue's attackby 2015-01-06 16:26:16 +01:00
Firecage
b6e1547f0e Final Statues 2015-01-01 01:43:28 +02:00
Firecage
920624a8f1 Statue code cleanup 2015-01-01 00:41:54 +02:00
Firecage
71cc4ff94e Statue_code_cleanliness(kinda) 2014-12-29 23:41:13 +02:00
Firecage
26e4329a64 Statue_Fixes_3
Signed-off-by: Firecage <Firecage@hotmail.com>
2014-12-27 22:30:26 +02:00
Firecage
ea16486efd Statue fixes 2. 2014-12-27 22:24:06 +02:00
Firecage
7f1595dd7d Negligence from me. Fixed 2014-12-27 15:02:31 +02:00
Firecage
1d63ba5dec Adds some fixes to mineral statues 2014-12-27 14:55:02 +02:00
Menshin
8202bde945 Even the damned statue !!! 2014-11-01 22:06:59 +01:00
phil235
9b9481d65c Changes many span classes.
Replaces for(mob in oviewers) show_message()  with visible_message() when possible.

Fixes the absolute pathing in Ninja code.

Fixes facehugger attack messages being bold red for third party (only the first leap message will stay bold red for third party, for better visibility)

Standardizes vomiting message

Fixes mech occupant not receiving any attack messages when the mech is attacked.
2014-10-18 16:00:38 +02:00
Firecage
caa4d60503 Phase Honk 2014-09-15 12:44:52 +02:00
Firecage
ad5d15a225 New part 2014-09-15 11:16:39 +02:00
Firecage
b3c842b614 phase 1 part 3: Anonussing 2014-09-07 00:40:48 +02:00
Firecage
ea900fc0e7 Phase 1 part 2: Improvement to code 2014-09-06 22:46:44 +02:00
Firecage
2bf0773261 First phase of statues part 1 2014-09-06 21:14:27 +02:00