Commit Graph

347 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
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
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
oranges
438b46cc17 Prevent infinite loops with DROPDEL items
We unset the flag just before calling qdel, preventing infinite loops
where the objects Destroy calls dropped, which is the case for a
number of items
2016-09-14 23:48:25 +00:00
Joan Lung
313ecf3843 Merge pull request #20498 from phil235/RewriteMegaphone
Megaphones no longer have special say code to handle their effect.
2016-09-14 16:35:01 -04:00
phil235
441a88c488 Megaphone no longer have special say code to handle their effect.
The megaphone is no longer used by clicking it and entering a message, you simply keep it in your active hand and talk normally.
Remove the insults feature of the emagged megaphone. The span of the emagged megaphone is now big and red.
2016-09-13 18:27:55 +02:00
AnturK
4709b5229b Merge pull request #20475 from optimumtact/throwat
Fix a bunch of incorrect throw_at proc definitions that caused a runtime
2016-09-13 15:41:00 +02:00
oranges
6fbcc6e26b Fix a bunch of incorrect throw_at proc definitions that caused a runtime 2016-09-12 22:09:52 +00: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
Remie Richards
897e8c5b88 Merge branch 'master' of https://github.com/tgstation/-tg-station into many_hands_make_light_work
Conflicts:
	code/game/objects/items/weapons/storage/storage.dm
2016-09-02 18:04:18 +01:00
Remie Richards
00738bd2a3 More than 2 hands!? WHAAAAAAT 2016-09-02 16:10:16 +01:00
Kromgar
2b235b8bba Revert "Fixes issues with packagewrap, trashbag, handlabeler, " 2016-09-01 12:18:24 -04:00
phil235
42301f32e2 Fixes issues with packagewrap, trashbag, handlabeler, and other potential items that must have an effect when clicking a storage item. Clicking a storage item with those items does not try to insert them in the container but instead calls their afterattack effect directly. The var used for those items is var/no_direct_insertion.
Fixes trashbag not being able to pick up pillbottles, evidence bags.
Fixes packagewrap not being able to wrap backpacks, pillbottles, all sorts of bags.
Fixes packagewrapping a locked lockbox showing "it's locked!"
Backpack only make rustling noise if insertion is successful.
2016-08-28 19:38:15 +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
4a20757cc3 Clockwork armor cannot be equipped to people if you do not serve Ratvar 2016-08-06 21:41:15 -04:00
Kyle Spier-Swenson
c9831c4afd [Ready]Makes space wind great again! (#19494)
* Makes space wind great again!
Space wind is now a scaling percent to move on pressure differences.
Space wind percent to move scales with pressure amount, and other modifers:
Actively moving (as in holding down a move key) reduces chance of getting moved by space wind by 30%
Having a wall or densed anchored object to your left or right (in terms of direction to be moved) will lower your chance to be moved in space wind by 20% in each direction. (so a wall on both sides is 40%) (Only applies to mob's with limbs)

* does the mrp
2016-07-28 09:43:51 +02:00
coiax
6449b65d30 Adds fireplaces, eswords are hot, cardboard is flammable (#19118)
Makes needed improvements to proposed fireplaces

- Fireplaces now use world.timer
- Fireplaces no longer prompt input() for inserting logs, it just
takes as many logs as possible
- Paper and paper bins can be thrown on the fire, thirty paper is worth
one log of burn time.
- One log gives 15 seconds of burn time, the fireplace can hold up to 5
minutes of fuel.
- Ignitable items now use a /obj level proc to generate their messages,
currently using this are cigarettes, candles, fireplaces
- The fireplace can be put out with an extinguisher
- Cardboard cutouts are now flammable
- The fireplace is only "warm and cozy" when lit
- Paperbins qdel their stored papers when destroyed (probably did that
already, but no harm in making sure)
- Also removed some returns hanging around

* Added new proc for lighting stuff

- Adds ignition_effect(atom/A, mob/user) to obj/item, which is called
when you're attempting to light things with that object. By default it
does nothing and prevents ignition, but if the object is hot, it returns
a message. May do other things for different stuff.

- Eswords now ignite flammable gasses in their area.

* Fireplace is no longer on fire when not on fire
2016-07-06 10:16:47 +12:00
oranges
bce99c4f58 Merge pull request #18668 from coiax/dropdel
Adds DROPDEL flag; items will qdel() on dropped()
2016-06-20 11:08:31 +12:00
c0
0abc91c59d slot_equipment_priority no longer contributes to list init overhead 2016-06-18 05:09:15 +03:00
c0
1311fb9b43 Reduces list overhead a tiny bit 2016-06-18 04:38:49 +03:00
Jack Edge
8ca69eabbb Adds DROPDEL flag; items will qdel() on dropped()
Pretty self explanatory, replaces writing a dropped() proc that just
calls qdel() with a flag that does it for you.
2016-06-17 12:14:28 +01:00
phil235
bd20c313b9 Merge branch 'master' of https://github.com/tgstation/-tg-station into BloodRefactor
Conflicts:
	code/__DEFINES/genetics.dm
	code/modules/mob/living/carbon/human/species_types.dm
2016-06-04 17:41:43 +02: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
LatD
65a0027979 Merge remote-tracking branch 'refs/remotes/tgstation/master' into Research 2016-05-28 01:37:55 +03:00
LatD
907fc36e5c Merge remote-tracking branch 'refs/remotes/tgstation/master' into Research 2016-05-24 22:17:44 +03:00
phil235
11ca987acb Merges Pull and Grab into a single functionality. Pulling someone is now the same as a passive grab. You can start pulling someone with ctrlclick or by using the grab intent with empty hand. Using the grab intent again on the pulled person tries to grab them aggressively, then neck grab, then kill grab.
Two mobs can no longer pull the same mob at the same time. Pulling someone break any other pull/grab from other mob on that person.

The grab item is gone entirely.

You can now only grab one mob at a time, instead of two (one for each hand).

Being aggressively grabbed or more now counts as being restrained (like handcuffed). A neck grab or more makes you lie down and prevents you from getting up until the grab is broken.

Fixes movement when moving with a grabbed person.
Fixes movement when moving a pulled person around you diagonally.
Fixes neckgrab moving the victim on your turf even if the turf is dense.
2016-05-24 01:28:04 +02:00
Razharas
b46de70537 Makes dismemberment more adjustable (#17587)
* Makes dismemberment more adjustable

Makes dismemberment more adjustable
Items now return chance for dismemberment
Bodyparts now decide if they are dismemberable or not by the specific
item
Items now decide what sound to play on dismemberment
No balance changes here

* Owner into H

Owner into H
2016-05-13 20:27:06 +02:00
LatD
e685d82805 Removing reliability 2016-05-12 02:43:18 +03:00
Jack Edge
c32f5bb676 Fixes spawning lit candles printing messages
Also makes candles light stuff when they're in your hand.
2016-05-10 19:13:11 +01:00
KorPhaeron
024df00cd9 Dismemberment tweaks (#17453)
* Dismemberment tweaks

* Lowers some AP to address remies concerns

* Lowers the dualsaber AP again to prevent nonsense from occuring

* Adds HF blade

* Honk Dagger typo fix

* Lowers chaplain AP again
2016-05-08 20:55:44 +01:00
phil235
68da092009 Dismemberment port from Hippie code, based on RemieRichard's work. Big thanks to RemieRichards and crystalwarrior. 2016-05-05 18:17:51 +02:00
KorPhaeron
0bbcc00c4d Revert "Move some stuff from different layers to different planes" 2016-04-29 16:07:23 -05: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
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
6eb4ffa825 Merge branch 'master' of https://github.com/tgstation/-tg-station into AttackbyDestruction
Conflicts:
	code/game/objects/items/devices/lightreplacer.dm
	code/game/objects/structures/crates_lockers/closets.dm
2016-04-26 21:49:51 +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
Jack Edge
2f26b8eabc Compilation! 2016-04-24 13:54:37 +01:00
Jack Edge
6bc4fbf700 More changes 2016-04-24 13:23:33 +01:00
Jack Edge
0fd1f3c7e4 Made /datum/dog_fashion 2016-04-24 13:18:43 +01: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
Jack Edge
e4203c7ce9 Dogs can wear certain items that are not clothing
RIP. It's going to be a long PR.
2016-04-24 09:47:10 +01:00
Remie Richards
a3dd455a37 Adds a framework for alternate appearances (override images), the Cardborg costume now makes you look like a real Standard Cyborg 2016-04-02 20:52:00 +01:00
Menshin
9afe050025 Replaced last occurences of gc_destroyed by qdeleted(). 2016-03-05 01:58:56 +01:00
phil235
0ec876d9fe Refactored the item's action system. Items can now hold multiple actions.
The "set internals" button of tank items now turn green when it's used as internals.
Removed research scanner from drones (since cyborgs don't have it, it's more consistent)
Removed the ignore_madkadjust mask var.
The sechailer mask now has an adjust mask action button, so I removed the adjust verb that it was using.
The item's action are now created on item/New() instead of trying to create it every time someone picks the item up.
I split hud/action.dm, the datum/action stuff is now in the datum folder (/datum/action.dm), whereas the code for action buttons is kept in the hud folder under action_button.dm. Also I moved some /datum/action code that was in some files back into datum/action.dm where it belongs.
2016-02-23 19:37:42 +01:00
phil235
91839f5f70 Action buttons will now only update when needed instead of every Life().
The action buttons now update their icon instantly.
Fixes versions of pickup(),equipped() and dropped not calling the parent.
Fixes drone not being able to remove a defib from their storage.
You can now cycle the mime mask by clicking it in your hand.
The action buttons for hardsuit and hooded suits now only appears when you're wearing the suit.
Created two mob helper procs getBeltSlot() and getBackSlot().
Created /datum/species/proc/on_species_loss() to handle stuff when our race change, currently only used by jelly and slime race to remove their exotic blood from our reagents and to remove slime people's action buttons.
2016-02-22 00:34:59 +01:00
Bjorn Neergaard
0f89670107 Prevent picking up anchored items 2016-02-12 01:00:55 -06:00
phil235
83633edfed - I renamed some of the new adjust procs and create new ones for eye_blind,eye_blurry and eye_stat so they get three procs just like weakened/sleeping/etc.. (Sleeping, AdjustSleeping, SetSleeping)
- renamed the eye_stat var to eye_damage.
- mob/on_varedit() added. Manually var editing a mob's eye_blind var properly updates his vision.
- I removed update_vision_overlays(), we now just update the relevant fullscreens instead of all fullscreens whenever one needs to be updated.
- fixed climbing into mecha not giving you mecha sight.
- simplified and removed copypasta from update_tinttotal() (now update_tint() )
2016-02-07 18:50:18 +01:00