Commit Graph

65 Commits

Author SHA1 Message Date
Joan Lung
ce13143d9d Replaces yet more istypes with helpers (#20806)
* uses more istype helpers

* oranges is inefficient
2016-10-10 17:48:35 +13: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
Shadowlight213
de19e36a51 Removes morphine from nurse spiders (#20773)
Fixes spider web, cocoon, spiderling sprites
Halves cocoon breakout time, fixes camera going to nullspace
2016-10-03 13:35:56 +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
Jack Edge
87016bc6cd Code cleaning; countdown for transformer
🆑 coiax
rscadd: Observers now have a visible countdown for borg factories,
silicons can examine the factory to determine how long it has remaining
until it is ready.
/🆑

- Removes a bunch of spawns and trailing returns
2016-06-25 11:40:03 +01:00
Kyle Spier-Swenson
0d6bbbb412 stop the pills (#18703)
* RedPills Processing

Now you have to use START_PROCESSING(SSname, thing) (and STOP_PROCESSING)

* Fixes a minor bug.
2016-06-20 12:07:44 +02:00
Jack Edge
a677973a56 Ghost sword orbits on button click, added URL, POI
🆑 coiax
rscadd: Spectral sword is now a point of interest for ghosts.
fix: Clicking the spectral sword action now orbits the sword, instead of
just teleporting to its location.
/🆑

Changed the notify_jump alert to notify_action, added three different
notification actions (jump, attack, orbit), modified notify_ghosts and
its callers appropriately.

Spectral sword now just counts the number of orbiting ghosts in the
turf, irregardless of what they're orbiting. Generally this'll be the
summation of orbiters of the mob, and orbiters of the sword.
2016-05-28 12:23:24 +01: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
phil235
0480790b0a Same things but with structures now. 2016-04-24 20:38:33 +02: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
oranges
b496ca6043 Don't allow every single spider to be player controllable 2016-02-16 10:00:23 +13:00
oranges
d103d6c648 Change spider ghost alert to an in chat one
This could actually benefit from a nice subystem to handle it (calling humanize_from_ghost) on the appropriate atom when the user clicks the link
2016-01-29 15:42:05 +13:00
KorPhaeron
2f22514fd6 Spider fixes 2015-12-24 04:57:50 -06:00
KorPhaeron
44873907f4 More spider fixes 2015-12-11 04:42:04 -06:00
Tkdrg
e2187614fd Merge remote-tracking branch 'upstream/master' into hog-mergeconflicts
Conflicts:
	code/__DEFINES/hud.dm
	code/__HELPERS/game.dm
	code/_onclick/hud/_defines.dm
	code/_onclick/hud/hud.dm
	code/game/gamemodes/antag_spawner.dm
	code/game/gamemodes/game_mode.dm
	code/game/machinery/turrets.dm
	code/modules/client/preferences_toggles.dm
	code/modules/events/alien_infestation.dm
	code/modules/mob/dead/observer/observer.dm
	code/modules/mob/living/carbon/alien/special/alien_embryo.dm
	code/modules/mob/living/simple_animal/revenant/revenant.dm
	icons/mob/back.dmi
	icons/mob/head.dmi
	icons/mob/hud.dmi
	icons/mob/inhands/items_lefthand.dmi
	icons/mob/inhands/items_righthand.dmi
	icons/mob/mob.dmi
	icons/mob/suit.dmi
	icons/obj/clothing/hats.dmi
	icons/obj/items.dmi
	icons/obj/projectiles.dmi
	icons/obj/storage.dmi
2015-11-02 01:06:30 -03:00
phil235
79a814b434 Fixes some runtimes when picking candidates for certain simple_animals, especially sentience potion. If the player chose 'Yes' and then immediately disconnected, it would make the chosen client null. Same thing for xeno larva bursting (player disconnection mid bursting animation)
Fixes runtimes with chem grenade calling prime() after being GC'd.
Fixes some hardsuits having "unacidable = 1" twice.
Fixes runtime with alien whisper.
Fixes runtime with check_shields()
Fixes runtime with Venom, Formaldehyde, corn syrup and holy water.
Fixes cult sacrifice soulstoning not working (giving a dead shade).
2015-10-18 01:28:48 +02:00
Remie Richards
b9394257da About a million changes, but largely: Functional (Sort of) Antag Huds, Mind fixes, and Final glue to get the mode working. 2015-10-07 22:11:19 +01:00
Cheridan
d1e1beb713 Merge pull request #11748 from Aranclanos/pipep1
Fixes the last remaining associative lists from pipes
2015-09-14 18:26:46 -05:00
Aranclanos
815ef798e9 Fixes the last remaining associative lists from pipes 2015-09-12 20:57:16 -03:00
bear1ake
f697ae90f5 removes a bunch of .0 2015-09-10 20:57:30 +09:00
duncathan
51c09f16bf makes all Destroy()'s return properly 2015-08-31 00:21:01 -06:00
Swag McYolosteinen
624572a664 Makes spider vars transfer to next generations
For admin fuckery
2015-07-26 22:20:23 +02:00
duncathan
ae417d2a03 Merge branch 'master' of https://github.com/tgstation/-tg-station into atmosrefactor2
Conflicts:
	code/ATMOSPHERICS/atmospherics.dm
	code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
	code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
	code/ATMOSPHERICS/components/binary_devices/pump.dm
	code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
	code/ATMOSPHERICS/components/trinary_devices/filter.dm
	code/ATMOSPHERICS/components/trinary_devices/mixer.dm
	code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
	code/ATMOSPHERICS/components/unary_devices/Freezer.dm
	code/ATMOSPHERICS/components/unary_devices/cryo.dm
	code/ATMOSPHERICS/components/unary_devices/unary_base.dm
	code/ATMOSPHERICS/components/unary_devices/vent_scrubber.dm
	code/modules/events/vent_clog.dm
	code/modules/mob/living/carbon/human/species.dm
	config/admins.txt
2015-07-16 04:27:25 -06:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
duncathan
e074fb7856 makes air flow; fixes EVERYTHING 2015-07-11 18:45:19 -06:00
Iamgoofball
c2256d41fc BAR NOW SHOWS UP ON THE OBJECT YOU'RE INTERACTING WITH 2015-06-13 13:58:08 -07:00
kingofkosmos
de280c72b5 Removed some more spans from visible messages. 2015-04-24 21:06:59 +03:00
kingofkosmos
a7bd5f93e1 "You hear something" set to italics. 2015-04-24 21:06:16 +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
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
phil235
135293bedf Fixes object processing list by replacing "SSobj.processing.Add" by "SSobj.processing |= " to avoid having duplicated objects in the list, meaning the objects would be processed more than once per iteration.
Fixes Alien embryo processing that was processed twice.
2015-02-14 14:18:49 +01:00
carnie
a029a49392 SubSystem rewrite
Misc:

+Fixes unreported issue with initializing lighting on a specific zlevel

+Fixes two similar issues with moveElement and moveRange. Where fromIndex or toIndex could be adjusted incorrectly in certain conditions. Potentially causing bad-sorts, or out of bound errors.

+Rewrites listclearnulls(list/L) to no longer iterate through L.len elements for every null in the list (plus 1). i.e. went from L.len*(number_of_nulls+1) list-element reads (best-case), to L.len list-element reads (worst-case)

+New proc/getElementByVar(list/L, varname, value) which finds the first datum in a list, with a variable named varname, which equals value. You can also feed it atoms instead of lists due to the way the in operator functions.

+Fixes an unreported issue with Yota's list2text rewrite. Under certain conditions, the first element would not be converted into a string. Causing type-mismatch runtimes.

+New global map_ready variable. This is not fully implemented yet, but will be used to avoid duplicate calls to initialize() for map objects.

+All turfs now maintain references to all lights currently illuminating them. This will mean higher memory use unfortunately, due to the huge number of turfs. However, it will speed up updateAffectingLights significantly. I've used list husbandry to reduce baseline memory usage, so it shouldn't be any worse than some past atmos modifications memory-wise.

-Removed 'quadratic lighting', can add this back at some point. Sorry.

+modified the way lum() works slightly, to allow turfs to have overridden delta-lumen. i.e. space cannot be illuminated more than its default ambiance. This allowed removal of some iffy special-snowflake lighting areas implemented by somebody else.

+Lighting images in the dmi can now use arbitrary naming schemes. It is reliant on order now. This allows the dmi to be replaced by simply dropping in a new dmi.

-Removed all subtypes of /area/shuttle. Shuttles now create duplicate 'rooms' of /area/shuttle. (More on this later). This will conflict with most maps. Guide on how to fix to follow.

+All verbs/tools relating to world.tick_lag were refactored to use world.fps. However old config text for setting tick_lag will still work (it converts the value to fps for you)

+MC stats improved using smoothing. They now have their own tab so they dont get in the way when you're playing as an admin.

-removed the push_mob_back stuff due to conflicting changes. Sorry Giacom.

_OK, NOW THE ACTUAL INTERESTING STUFF_

Following systems moved over to subsystem datums:
air_master
garbage_manager
lighting_controller
process_mobs (aka Life())
nanomanager
power
sun
pipenets
AFK kick loops
shuttle_controller (aka emergency shuttle/pods), supply_shuttle and other shuttles
voting
bots
radio
diseases
events
jobs
objects
ticker

Subsystems hooks and variables should be commented fairly in-depth. If anything isn't particularly clear, please make an issue.

Many system-specific global variables have been refactored into

All tickers which previously used world.timeofday now use world.time

some subsystems can iterate before round start. this resolves the issue with votes not working pregame
2014-12-31 13:25:41 +00:00
phil235
d5a7d82959 Fixes a lot of "the the" in messages. 2014-12-16 22:59:55 +01: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
Cheridan
f909d59d1a Merge pull request #6130 from phil235/AttackMsgStandardizedFormat
Standardizing attack messages to always show the attacker first
2014-12-04 12:45:31 -06:00
phil235
86405fa8c0 Standardizes attack messages to always show the attacker first (when there is an attacker).
Replacing some fo mob in viewers() show_message() with visible message().
Simplifying some message code in a couple places, fixing typos and span classes.
2014-11-24 01:49:34 +01:00
Razharas
ff456ebaf4 Unwinded most of shit
Meh
2014-11-19 21:36:45 +03:00
Cheridan
24456bcc22 Merge branch 'PipenetRevamp' of https://github.com/Aranclanos/-tg-station into Aranclanos-PipenetRevamp
Conflicts:
	_maps/map_files/tgstation.2.1.3.dmm
	code/ATMOSPHERICS/atmospherics.dm
	code/ATMOSPHERICS/components/portables_connector.dm
2014-11-13 18:55:53 -06:00
Jordie0608
590684e129 Merge branch 'master' of https://github.com/tgstation/-tg-station into beekeepermodewhen
Conflicts:
	icons/mob/animal.dmi
	tgstation.dme
2014-11-09 00:15:12 +11:00
Aranclanos
8aa5a137c5 Pipenet revamp
-Removed the pipenet network datum, now it will all be done with the pipeline datum
-All atmos pipes and machines will always have a pipeline datum
-Moved the valves to the binary subtype and the portable connectors to the unary subtype
-The pipe vents (who were barely used in three spots of the map) are removed, the map slots will replaced with outlets
-Fixes some bugs of pipenet disconnection, mostly on explosions
-Cleaned a bit the copypaste of construction.dm of pipes
-Removed the ID restrictions of digital valves and the frequency (both unused)
2014-11-03 08:21:31 -03:00
hornygranny
16d299e5c5 Merge pull request #5379 from optimumtact/revertclick
Revert my click cooldown changes
2014-10-21 18:39:21 -07:00
Francis
adf252df9b Keep the define around as that is a good idea 2014-10-20 22:49:06 +13:00
Francis
b3de61552f Revert "Defines for the define god"
This reverts commit f737f7889c.
2014-10-20 22:22:38 +13:00
Francis
c50c26a48f Revert "Add the click cooldown define to the last special defines"
This reverts commit 5595d57f57.
2014-10-20 22:22:23 +13:00
phil235
45cfe07f98 Merge branch 'master' of https://github.com/tgstation/-tg-station into DisplacedGirderFix
Conflicts:
	code/modules/recycling/disposal.dm
2014-10-15 18:23:40 +02:00
phil235
dbea503e88 Removing the fourth argument (air_group) of CanPass() everywhere, because it isn't used anywhere.
Fixing one instance of "for(mob in viewers) show_message()" to "visible_message()"
2014-10-15 18:03:06 +02:00
Francis Devine
5595d57f57 Add the click cooldown define to the last special defines
This will stop these getting out of sync and let you change
all times with a single define
2014-10-09 14:52:47 +13:00
Francis Devine
f737f7889c Defines for the define god 2014-10-09 14:49:28 +13:00
Incoming
8e99152226 Updates spiders to have full player functionality
*All spiders can now web turf (but AI controlled non-nurses won't choose to), only nurse spiders can wrap items and lay eggs.
*Eggs laid by a player controlled nurse spider will eventually grow into player controlled spiders, while AI lain eggs will only result in AI spiders
*Adds non nurse spiders to the staff of change as they pass my rules for inclusion (Leaves a corpse, can do everything as a player the NPC can do, can't dominate a round by reproduction)

I take no responsibility for spidercode, it's a bit iffy but as far as I can tell it all works for players now.
2014-10-01 18:58:07 -04:00