Commit Graph

43 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
phil235
194398cbbd Merge branch 'master' of https://github.com/tgstation/-tg-station into PreliminaryDamageRefactor
# Conflicts:
#	code/game/gamemodes/miniantags/bot_swarm/swarmer.dm
#	code/game/objects/effects/portals.dm
2016-09-29 01:44:27 +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
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
cbf733dbc4 Does something, likely to be important, to blob (#19831)
🆑 Joan
rscadd: Once the blob alert message is sent in the blob game mode, all mobs get to see how many tiles the blob has until it wins, via the Status tab.
rscdel: Removed/merged a bunch of blob chems, you probably don't care about the specifics.
tweak: The remaining blob chems should, overall, be more powerful.
tweak: Shield blobs soak brute damage less well.
tweak: Flashbangs do higher damage to blobs up close, but their damage falls off faster.
experiment: Shield blobs now cost 15 resources to make instead of 10. Node blobs now cost 50 resources to make instead of 60.
experiment: Expanding/attacking now costs 4 resources instead of 5, and blobs can now ATTACK DIAGONALLY. Diagonal attacks are weaker than normal attacks, especially against cyborgs(which may be entirely immune, depending), and they remain unable to expand diagonally.
rscadd: Shield blobs no longer block atmos while under half health. Shield blobs are still immune to fire, even if they can't block atmos.
tweak: Blobs should block explosions less well.
rscadd: Blob cores and nodes are no longer immune to fire and no longer block atmos.
rscadd: Blobs can only auto-expand one tile at a time per expanding thing, and should be easier to beat back in general.
tweak: Blobbernauts now attack faster.
tweak: Blob Overminds attack mobs slower but can attack non-mobs much faster.
rscadd: Blob Overminds start with some amount of resources; in the gamemode, it's 80 divided by the number of overminds, in the event, it's 20 plus the number of active players, and otherwise, it's 60.
bugfix: You can no longer move blob cores into space, onto the mining shuttle, white ship, gulag shuttle, or solars.
bugfix: Blob rounds might be less laggy, if they were laggy?
tweak: Blobs don't heal as fast, excluding the core.
experiment: Blobs are marginally less destructive to their environment.
/🆑

Objective:
maybe possibly make blob something you can fight instead of wishing the blob didn't exist?
but also make the blob lethal enough that it can still deal with the crew if it knows what it's doing(and still lose if the crew is good instead of snowballing forever)
2016-08-17 15:48:28 +12:00
Joan Lung
60b32ddd85 Simple animals can now have a set amount of damage to deal to objects in place of normal melee damage 2016-07-30 09:14:53 -04:00
bobdobbington
6cfa29dc2b Now with 100% of the daily recommended dose of Vitamin C 2016-06-27 19:32:21 -07:00
bobdobbington
4fc41bac33 Fixes #18923 2016-06-27 19:05:26 -07:00
Remie Richards
fda2c699fc Automatic conversion via Regex 2016-06-11 18:37:48 +01:00
MMMiracles
a72e48ffe3 the fact this never came up is surprising 2016-05-01 12:20:06 -04:00
Joan Lung
6fc1d4fde4 Blobs can no longer eat the supermatter (#17205)
* Blobs can no longer eat the supermatter

* phil'd

* phil'd
2016-04-29 20:29:20 +02:00
phil235
0480790b0a Same things but with structures now. 2016-04-24 20:38:33 +02:00
Razharas
78c95ab035 Merge pull request #13317 from neersighted/airlock_electronics
NanoUI Airlock Electronics
2015-11-30 20:43:33 +03:00
Bjorn Neergaard
f214e547cb NanoUI Airlock Electronics
Also reworks a lot of the AE code.
2015-11-29 11:32:56 -06: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
phil235
c19d1c1427 Removed unused code in hologram.dm
Fixes displaycase when you could put a new item in it w/o first removing the first one.
Fixes parrot going through windows when getting on its perch, and some other cases of in_range() instead of Ajacent().
Fixes not being able to change transfer amount of reagent containers while buckled.
Remove unused sprites in stationobjs.dmi
2015-10-11 20:18:13 +02:00
AnturK
b7a1ee7cfa Adds display case repair 2015-10-05 13:07:58 +02:00
AnturK
bc5d660fe0 Adds support for custom showcases on the map 2015-10-01 00:38:29 +02:00
AnturK
a524268b4d Fix 2015-09-17 17:53:27 +02:00
AnturK
a668109c3d Adds ID unlocking
Fixes directional issues
2015-09-17 17:53:26 +02:00
AnturK
8067597beb Display case chasssis 2015-09-17 17:53:26 +02:00
AnturK
b72de17b50 Adds icon for open but not broken case. 2015-09-17 17:53:25 +02:00
AnturK
ac813a0ced Display cases 2015-09-17 17:53:24 +02:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02: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
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
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
Cheridan
0198ec2bde Merge pull request #4576 from Firecage/SPANCLASSES
SPANCLASSES!!!!!
2014-08-26 15:05:12 -05:00
Firecage
6c7af5eb32 SPANCLASSES!!!!! 2014-08-26 09:52:13 +02:00
ikarrus
0be874efff -Added proc for setting the flashing red alarm lights
-moved all the Related Areas checking for fire alarms into the procs in areas.dm
-Added sound for burglar alarm due to popular request
2014-08-18 21:27:42 -06:00
ikarrus
49dc1608d0 -Burglar alarm is now an area/proc
-Burglar alarm automatically clears after a minute
-Fixed runtime with cyborgs receiving burglar alarms
2014-08-09 17:09:35 -06:00
ikarrus
31ad2bc636 Burglar Alarm for Captain's Display Case
-Breaking the Captain's Display Case will now trigger an alarm, bolting all airlocks in the room as well as notifying the AI (after a 3 second delay)

Nowadays, I'm seeing far too many Captains breaking their display case with little repercussion. Keeping the gun in the case used to have value when the AI was able to watch over it (hear people breaking it), but since the AI was moved there's no value in keeping it in there besides to avoid being accused of powergaming.

This change is meant to add incentive for Captains to keep it in the case (Extra Security), humiliates them from taking it (bells and whistles will draw everyone's attention), and makes the steal objective a little more unique from the other ones.

Traitors would need to create their own escape route first, or be extremely predictable jump down the disposal outlet. An alternative to bolting the airlocks (should it be seen as being too extreme) would be to simply drop firedoors instead.
2014-08-09 12:51:11 -06:00
Aranclanos
ccae5781c5 added two defines CLICK_CD_RANGE and CLICK_CD_MELEE (4 and 8), replaced all changeNext_move() procs to use these two defines.
Added melee click cooldown for paper spam on cameras.
2014-08-03 22:14:56 -03:00
ikarrus
82b861702f Resolved Conflicts:
code/modules/mob/living/simple_animal/constructs.dm
2014-05-25 10:59:08 -06:00
ikarrus
61b156a07f Added attack cooldowns to a few objects
Includes:
-Fire axe cabinets
-Captain's display case
-RD's lab cage
2014-05-10 12:10:41 -06:00
Cheridan
4d8160ab14 meteorhit() is kill 2014-04-22 12:16:02 -05:00
MrPerson
6b29fecda1 Merge branch 'master' of https://github.com/tgstation/-tg-station into qdel_r
Conflicts:
	code/game/machinery/bots/ed209bot.dm
	code/game/machinery/rechargestation.dm
	code/game/machinery/turrets.dm
	code/game/objects/structures/crates_lockers/closets.dm
	code/modules/research/circuitprinter.dm
2014-03-08 22:03:03 -08:00
Ergovisavi
ac269baacb Fixes bullet_act not checking for damagetype on many, many objects.
Replaces Holodamage with Stamina damage, if your stamina damage exceeds your current health, you get weaken(5)'d. Stamina heals itself slowly over time.
Makes the hallucination enemies deal more stamina damage than they did holodamage, but stamina damage heals now so it's mostly for just seeming threatening at the moment.
Adds the Disabler, a gun that does stamina damage. It has a range of your screen, but no more. Adds a disabler crate to cargo (security lock)
Fixes Lasertag ED209's because they were busted as shit
Reduces ED209's view range to 9 from 12, which was several times longer than your screen view, now is only a little bit more
Lastertag now does stamina damage instead of an instant stun for that GRITTY LASERTAG EXPERIENCE
2014-03-01 16:39:22 -08: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
Kyrah Abattoir
d9fc4bdd5c code/game/object/items/weapons/* lowercase pass
code/game/object/structure/* lowercase pass (start)
2013-11-24 08:49:34 +01:00
johnsonmt88@gmail.com
867b21c7ce File restructuring!
This brings down a bunch of defines from /code/defines/obj.dm unto their appropriate files.

I've moved morgue.dm from game/machinery into game/objects/structures since that file contains no machines.

I've reorganized the objects/items/stacks folder and made a 'sheets' and 'tiles' folder to keep things separate

I've separated stool_chair_bed.dm into its own folder which now contains the files: stools.dm, chairs.dm, bed.dm and alien_nests.dm to make it a little easier to go through.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4582 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-29 18:00:30 +00:00
johnsonmt88@gmail.com
9e30e7d2ec Moving stuff around part 2!
Committing this early to allow pete to commit something involving the .dme file which would probably conflict otherwise.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4514 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-22 16:32:45 +00:00