Commit Graph

49 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
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
Firecage
c61b16b37b Fixes 2 bugs with mirrors. (#19015)
You can no longer use TK on a mirror to change your 
appearance while far away from the mirror. You have 
to be adjacent to it. Fixes #18823

You can no longer normally use shattered mirrors, they
now properly become shattered. Yes, you could shatter
a mirror and still use it, stealthily. Honk.
2016-07-01 13:34:19 +12:00
phil235
9e5e525335 Fixes admantine golem female body icon. Now all golems have a female version.
The wizard can no longer choose to become a military synth.
2016-06-11 17:13:12 +02:00
Shadowlight213
9573fdec0e Speed in nograv works correctly now
Dismemberment support added as well as a way to use the limbs of another species for dismemberment for visually identical species
Flying var changed to species flag
2016-05-08 16:39:54 -07: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
phil235
0480790b0a Same things but with structures now. 2016-04-24 20:38:33 +02:00
KorPhaeron
57493aa426 Merge pull request #15855 from kilkun/master
New Human Species Datum
2016-03-08 21:39:46 -06:00
kilkun
1bfa6cf742 Removes species from magic mirrors 2016-03-08 22:24:24 -05:00
KorPhaeron
62ce96e20e Adjacency checks 2016-02-24 13:20:12 -06:00
KorPhaeron
d17d34edc9 Three lavaland ruins 2016-02-23 01:07:06 -06:00
Buggy123
03da055f5c Maybe now it'll compile? 2016-01-10 01:58:44 -05:00
Buggy123
2d6ba27ce8 Update mirror.dm 2016-01-10 01:38:44 -05:00
Incoming
1e7fcd3e9f unbricks the rpgloot event.
fixes a rare issue with the imposter event.
2015-12-20 01:15:03 -05:00
Jordie
da0c466f82 Merge pull request #13149 from Firecage/toolspeed
Adds toolspeed
2015-11-29 21:06:15 +11: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
Incoming
1f9f0dfc40 Adds subtypesof(). It's shorthand for typesof(path) - path.
Replaces typesof(path) - path with subtypesof(path) in obvious places. I was a bit conservative, there's probably a few more places that could use this.
2015-11-16 18:55:57 -05:00
Firecage
40b149ade7 Removes one indent from the return. 2015-10-22 19:11:23 +02:00
Firecage
19d1f09511 Changes the user messages. 2015-10-18 18:14:47 +02:00
Firecage
86aa219825 initial() for the desc and icon_state 2015-10-18 16:40:00 +02:00
Firecage
124fba1d3b Enables fixing mirrors. 2015-10-18 12:47:14 +02:00
Shadowlight213
b3693e15ca Changed to use roundstart_species list 2015-10-13 19:24:32 -07:00
Shadowlight213
6146aa156d Adds a lesser magic mirror that only allows for human and lizard race changes 2015-10-12 01:04:30 -07:00
phil235
f90ee4aa8c - Fixed monkey starting with no dna.
- Fixed bugs with monkeyize/humanize: 7803 (humanized monkey nobloodtype)
- Fixes 9298 monkeyed ling have troubles humanizing themself (already fixed?)
- Fixes despawning clothes when monkeyizing. 11855
- Replaced check_dna_integrity proc by simpler has_dna proc when required.
- created set_species() proc
- fixed space retrovirus not transfering SE (despite having a domutcheck()). Still need to check if it needs a name = real_name.
- I renamed mecha/var/dna to dna_lock to avoid confusion
- I renamed an armor var in a species proc to armor_block to avoid confusion with species/var/armor.
- I removed many if(dna) checks in lots of files.
- I removed duplicate defense procs between human/proc/X and dna.species/proc/X since dna is now always set.
- Anatomic panacea from changeling removes alien embryo correctly. 6247
- Fixes runtime when trying to put dna-less brain mmi into a dnalocked mech.
- Removed carbon/var/list/features, we now only have dna.features and prefs.features
- Remove hulk mutation from lizards and other species (Fixed 6413); only real humans can acquire hulk. (less work on sprites for each ones, fixes lizard tail not in hulk color)
- Fixes cloning not setting up correctly dna UE and dna.real_name
- I fixed the issue with sucked+cloned ling being unable to absorb
- I fixed issue with changeling proc checking if they have the dna already not working.
- Fixed 4095, low health hulk with DAA getting stuck in loop of acquiring/losing hulk.
- I added a second layer for mutations to differientate mutations that go below and above the body layer (Fixes 7858)
- Fixes 10048, the transform to initial appearence button was fucking up the dna.

- Fixes cloning not setting up correctly dna UE and dna.real_name
- Fixed the issue with sucked+cloned ling being unable to absorb
- Fixed issue with changeling proc checking if they have the dna already not working.
- Fixed 4095, low health hulk with DAA getting stuck in loop of acquiring/losing hulk.
- Added a second layer for mutations to differientate mutations that go below and above the body layer (Fixes 7858)
- Fixes 10048, the transform to initial appearence button was fucking up the dna.
2015-09-19 22:18:28 +02:00
phil235
428a28a440 Fixes monkeyize/humanize removing the mob's viruses when they should be kept.
Fixes NOCLONE and CLUMSY being in both disabilities and mutations. they're now only disabilities.
Fixes minttoxin not gibbing people with the fat disabilities.
Fixes some runtimes, replacing usr by user in some places.
Fixes mutation overlays being removed when updating overlays.
Remove the now unused mob/var/list/mutations and human/var/blood_type
Fixed some formatting in preferences.dm
2015-09-13 22:52:38 +02:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00
Cheridan
ee87a1dc23 Merge pull request #9974 from phil235/MirrorRaceChangeFix
Mirror race change fix
2015-06-17 12:54:19 -05:00
phil235
d275152a96 Fixes the wizard magic mirror race change.
Fixes the "race swap" wizard event.
2015-06-15 17:01:07 +02:00
Cheridan
ec8cd61d4c Merge pull request #9808 from Incoming5643/march_of_the_snowflakes
WJohn's Hyper Customizable Lizard Sprites
2015-06-14 17:40:20 -05:00
Incoming
595bb0c8e4 Generalizes lizard parts to "features" for future non-lizard fields, at the same time merging mutant color into this list
Random lizard bodies will finally have color!

Pushes features almost all the way to the DNA side of thing, the mob side is only needed during character creation.

Note that changes to the save file will invoke a one time per character runtime for legacy characters as the save file purges mutant_color, this is as far as I can tell harmless, has no effect on the player, and is self correcting.
2015-06-12 00:43:35 -04:00
Incoming
1f0097a74a Adds the bind soul spell for wizards. It turns them into a lich (skeleton) and gives them access to a long cooldown ressurection spell (starts at 3 minutes).
The ressurection spell can only be used while dead/dying and charges at all times. When used the lich gains a new body at the site of their phylactery and is stunned for a short while. Meanwhile the old wizard body crumbles to dust leaving all the wizards worldly possessions on the ground. Anyone who sees the corpse crumble will also get a cardinal direction pointing towards the wizard.

Every time the wizard dies this way, the time between ressurections is increased by a minute. To take a lich out of the game for good, either destroy the body before the lich can cast the spell again, or destory the phylactery and kill the wizard one last time.

Liches spawn with robes and spells intact, but nothing else, everything collected on their original body stays there.

As a balance issue, this spell can't be used in the den, the item must be bound after arriving at the station.

Adds a nice black wizard robe ensemble for liches.

Magic mirrors (save for a special badmin only one) can no longer skeletonize people.

Adds a hopeful mulligan fix to wizard rounds problems. Also corrects an adminlog message.
2015-06-10 03:40:14 -04:00
Incoming
7459238065 Merge branch 'master' of https://github.com/tgstation/-tg-station into begone_ye_jellies
Conflicts:
	code/game/machinery/teleporter.dm
2015-04-29 13:37:01 -04:00
kingofkosmos
de280c72b5 Removed some more spans from visible messages. 2015-04-24 21:06:59 +03:00
Incoming
f59c01e721 sets hardset_dna to clear exotic blood on race changes
sets every instance of race changes to use hardset_dna instead of directly replacing the datum (needs more testing to be sure I didn't break shit)
removes the invisible man race (aka the generic) and shadowlings from the new green slime mutation toxin while I'm in the area
2015-04-23 12:35:37 -04:00
Incoming
1cb7674ebd Adds a cheap looking pulse animation for magic mirrors so wizards notice they are actually more than normal mirrors
Adds a changelog
2015-03-09 12:42:41 -04:00
Incoming
9384d44ee5 Adds a magic mirror to the wizards shuttle. The magic mirror has greatly expanded functionality compared to the normal one, and can additionally change a wizards name, gender, race, hair color and eye color.
Additionally this fixes up some rogue simulated airless tiles on the wizards shuttle (these tiles were why the creature would always end up dead)
2015-03-08 04:24:04 -04: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
4374e46cdd Fixes being able to smash grille/newscaster/mirror/lights with holo esword. 2014-12-24 23:50:20 +01:00
phil235
bc5754b378 adding diagonal attack animation. 2014-11-07 15:42:07 +01:00
phil235
1506383b2c Adding some missing do_attack_animation()
Moving do_attack_animation() proc to mob/living
Fixing the pixel offset issue from beds especially rollerbed.
Fixing the nograv bouncing stopping because of another animation being used.(lying down, jittering, attack animation)
2014-11-03 15:11:39 +01:00
phil235
8b49caa5ee Fixes typos and show messages. Fixes attack animation code. 2014-11-03 01:06:02 +01:00
phil235
3f30912c51 WIP - Adding attack animation to most attacks.
Fixing a couple "for(......) show_message()".
2014-11-02 22:50:58 +01: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
Incoming
03464e1f4d Slime Mob Refactor
Death of the istype invasion from slimes, previously every single color of slime was its own kind of mob, and every single one of those slimes also had an adult form which was a different mob.

There is now only one kind of slime, reliant on new var is_adult and old var colour to determine how it looks. All baby slimes functioned identically outside of icon and core, and all adult slimes functioned identically to each other and to the babys save for a bit higher Health and more capacity to break shit.

A nice side effect is that this solves any inheritence issues of baby slimes growing up since it's still the same mob, though it doesn't solve the same issues for adult slimes splitting.

Also fixed a few annoying but rare bugs (like getting ghosted because you got DC'd and your slime self split and you weren't around to get mind transfered)
2014-01-13 19:38:37 -05:00
carnie
02be173c60 Renamed variables:
b_type to blood_type
h_color to hair_color
f_color to facial_hair_color
f_style to facial_hair_style
h_style to hair_style
2013-08-01 13:48:41 +01:00
petethegoat@gmail.com
f77a71fc04 This should fix the following runtimes:
The following runtime has occured 18248 time(s).
runtime error: Cannot execute null.IsIndexCut().
proc name: isWireCut (/obj/item/device/radio/proc/isWireCut)
  source file: radio.dm,185
  usr: Azerthene Severn (/mob/living/carbon/human)
  src: the security radio headset (/obj/item/device/radio/headset/headset_sec/department/med)

The following runtime has occured 165 time(s).
runtime error: bad index
proc name: recalculateChannels (/obj/item/device/radio/headset/proc/recalculateChannels)
  source file: headset.dm,261
  usr: Burningface (/mob/new_player)
  src: the security radio headset (/obj/item/device/radio/headset/headset_sec/department/engi)

It also makes the mirror automatically shave women when used.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5760 316c924e-a436-60f5-8080-3fe189b3f50e
2013-02-22 02:06:02 +00:00
Kortgstation@gmail.com
0c4f441cb5 Added Cheridan's slime sprites to replace roros. Replaced all mentions of roro/metroid with slime. Once Cheri has the rest of the sprites/Phol gets mutant race sprites I'll start work on redoing metroid/slime code with Giacom and adding breeding.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5223 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-29 04:12:22 +00:00
petethegoat@gmail.com
dbd759477e Improved window code, mostly formatting and styles, but also general improvements.
I've tested it a fair bit, but there may be bugs, so please report those if you run into them.

Added an ismetroidadult() helper

Improved L6 code.
Made the syndie shuttle console impervious to bullets.
Made mirrors breakable.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5187 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-25 17:09:38 +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