Better Energy Weapons!

[size=14pt]Git: https://github.com/swwu/Cataclysm-DDA/tree/energy_overhaul[/size]
PR: https://github.com/CleverRaven/Cataclysm-DDA/pull/2803 (Merged! Yay)

I’ve gotten into DDA somewhat recently after a long hiatus from roguelikes, and I’ve been playing a lot with energy and high-tech/non-ballistic weapons. I feel that a lot of them are lacking something so I made a little mod to fix that.

THIS MOD IS NOT MAY NOT BE BALANCED YET. I’ve kept all the numbers the same whenever possible, and a good chunk of the changes are cosmetic, but certain mechanical changes (namely: laser weapons now consume no ammo and are powered by UPS only) have not been thoroughly playtested and may be very, very overpowered.

I’m going to show some pics first, and then drop a big ol’ wall of text. There’s a tl;dr featurelist at the end, though.

[size=14pt]Pics[/size]
Plasma:

in the dark:

Lasers:

in the dark:

[size=14pt]Wall of Text[/size]
These are more or less the issues with energy weapons I’ve tried to address with this mod. In general I’m going to use the term “energy weapon” to describe all high-tech and/or non-ballistic weapons - the V29, fusion rifle, plasma rifle, laser rifle, railgun, and their home-made/bionic variants.

Problem 1: Energy weapons do not have a close relationship between ammunition and projectile effect like ballistic weapons do
An FMJ bullet is better for armor and an incendiary bullet sets things on fire regardless of what gun it comes out of. However, a laser pistol and a “fusion gun” (whatever that is[1]) presumably have very different effects even if they both use fusion packs as ammo, as energy weapons don’t always use their ammunition as projectiles.
Solution:
Weapons now have an “ammo_effects” field in the JSON. When a weapon is fired, its “ammo_effects” are added to the ammo’s “effects”. So if you e.g. add “ammo_effects”: [“EXPLOSIVE”,“LIGHTNING”] to the Glock 19, every round fired out of a Glock will now have a nifty lightning trail and explode, regardless of if you’re using 9mm +P or 9mm FMJ or 9mm extra-soft nerf darts. This way, all laser-based weapons can have “laser” effects (goes through glass, etc), all plasma-based weapons can have “plasma” effects, etc, even if they share the same ammo type.

Problem 2: Energy weapons lack cosmetic polish
The cosmetics around energy weapons are somewhat lacking, since most of the weapon effects are designed with gunpowder weapons in mind. Laser and plasma weapons don’t generate any light, despite the fact that the former is supposed to literally shoot beams of light, and the latter more or less shoots bolts of burning gas. The plasma rifle and railgun both actually go “Blam!” when they fire, even though presumably neither of them use the types of chemical propellants which produce that sound. Fusion-pack-based weapons all go “Fzzt” and generate 12 noise, even though the fusion gun does more than five times (52!) as much damage as the V29 (10).
Solution:
The “LASER” ammo effect now makes cute little glowy beams, and the newly-added “PLASMA” ammo effect makes bursty crackly plasma, both of which act as very short-lived light sources. I’ve also changed the sound effects a little bit - weapons with those flags now have their own noise sets ranging from the good ol’ “Fzzt” all the up through ear-rending "KRA-KOW"s. Unfortunately, my ability to make up good lasergun onomatopoeia is pretty poor, so help with these would be great.

Problem 3: Fusion packs are lore-inconsistent
UPS-based weapons is a mechanic that makes a lot of sense for energy guns, but the “older” weapons use fusion packs (v29, fusion gun, fusion blaster arm). Considering the in-game description of the fusion pack (designed to shoot super-heated gas), it’s an odd choice of ammunition for the laser-based weapons, unless we ignore said in-game description and pretend they’re just general-purpose power cells, and in that case they’re more or less equivalent to using UPS.
Solution:
The laser weapons and fusion gun now all use UPS. The v29 and laser rifle no longer use fusion packs, although the fusion gun still uses them as ammunition, hence making their description consistent with their use. A new flag, “NO_AMMO”, has been introduced for weapons (like the new laser weapons) that do not consume ammunition. Unfortunately, since weapons cannot have an innate pierce statistic, all the laser weapons no longer have any AP properties :/. Weapons now also have an innate pierce statistic, so lasers once again have their old armor-piercing properties. I also haven’t edited the descriptions to mention UPS or changed the item spawns yet, so the v29/fusion gun lab finale (do we still call them “lab finales”? it’s been a while) still only contains fusion packs. The energy weapons lab finale now also gives a UPS, but fewer fusion packs.

[size=14pt]tl;dr[/size]

[ul][li]Weapons can now augment fired ammo with additional effects[/li]
[li]Energy weapons have some new visual effects and “sounds”[/li]
[li]All “laser” guns now no longer use fusion packs and use UPS exclusively instead. Fusion gun uses UPS but also fusion packs.[/li][/ul]

[size=14pt]Future… things[/size]
I’m playing with a lot of ideas right now w.r.t energy weapons that I might look into implementing depending on feedback here. Some of them:

[ul][li]A “capacitor charge” system for UPS-based weapons, wherein those weapons have a charge reservoir that depletes when fired, but is recharged at a fixed rate from UPS (at a rate slower than firing depletes it). Weapon mods could also be added that e.g. use batteries/plutonium cells/fusion packs to recharge a weapon in the absence of or in addition to a UPS[/li]
[li]Reworked weaponfire noise. Currently firing noise is the base damage of the ammunition used, which makes a lot of sense when your gun uses propellant-containing cartridges as ammunition, but makes somewhat less sense with energy guns.[/li]
[li]Energy-weapon versions of “big guns” and explosives - antimatter cannons? plasma grenades? who knows?[/li][/ul]

[size=8pt][1] Based on the description for the fusion pack - “… the standard fusion pack, capable of delivering bolts of superheated gas at near light speed with no recoil.” The implication seems to be that the fusion gun is supposed to fire superheated gas.[/size]

Holy cheese, this is interesting.

good god man, get this balanced and rolled into the main game!

Spiffy, I assume the lighting is provided by some new fields?
we’re pretty light on procedure about submissions, just dropping a PR in github is fine, but bonus points for discussing it here, on IRC, or in the issue tracker first if it’s extensive.

Whoa!! That is some great work man!

swwu… I fucking love ya man. Absolutely superb. Great work.

Plasma grenades I can certainly see working. They’d do much more damage than conventional grenades for sure, at least x3~x5, however they would not produce shrapnel.

Note: I’m all in favour of antimatter weapons. However there are several issues that should be addressed.
Firstly, 1g antimatter + 1g matter = an explosive force larger than the bombs dropped on Hiroshima and Nagasaki combined.
In game terms I’d love such a weapon, but maybe it should be restricted to a building-sized explosion.

Secondly, ammo. I’m thinking advanced UPS + a few nanograms of antimatter found in Super Particle accelerators in the new Ice labs coming up-- and again, it would be rare. The firing mechanism would need to project a charged field similar to how antimatter is contained in a particle accelerator to prevent it coming into contact, although I don’t think you’d really need to implement that little tidbit ingame aside from having a drain on the AUPS when fired.

In reality, however, all known technologies for producing antimatter involve particle accelerators, and they are currently still highly inefficient and expensive. [b]The production rate per year is only 1 to 10 nanograms[/b].[1] In 2008, the annual production of antiprotons at the Antiproton Decelerator facility of CERN was several picograms at a cost of $20 million. Thus, at the current level of production, an equivalent of a 10MT hydrogen bomb, about 250 grams of antimatter will take 2.5 billion years of the energy production of the entire Earth to produce. A milligram of antimatter will take 100,000 times the annual production rate to produce (or 100,000 years).[2] It will take billions of years for the current production rate to make an equivalent of current typical hydrogen bombs.[3] For example, an equivalent of the Hiroshima atomic bomb will take half a gram of antimatter, but will take CERN 2 million years to produce at the current production rate.[3]

Given the advanced UPS running on plutonium cells, I’d like to point you to Syndicate Wars for the bleeding-edge weaponry pre-Cata.

Stuff like the Launcher is probably out: synthesizing an entire homing anti-personnel rocket is beyond the UPS’ scope. The Electron Mace, Laser, and maybe the Minigun could be possibilities? Plasma Lance, despite its universal fix-it nature, is probably a bit too high-tech and the Graviton Gun is not-gonna-happen.

Yep, both effects are just fields with no additional behaviors.

we're pretty light on procedure about submissions, just dropping a PR in github is fine, but bonus points for discussing it here, on IRC, or in the issue tracker first if it's extensive.
Great! I'll put in a PR in a little bit.

[quote=“Iosyn, post:6, topic:2903”]Firstly, 1g antimatter + 1g matter = an explosive force larger than the bombs dropped on Hiroshima and Nagasaki combined.
In game terms I’d love such a weapon, but maybe it should be restricted to a building-sized explosion.[/quote]
I was thinking that maybe a directed-energy big gun should focus on being “cleaner” than, say, a grenade launcher or RPG-7, rather than bigger. I’ve been playing with the idea of disintegration, i.e. it causes a regular explosion just like every other explosive, which reduces tiles to rubble and kills things, but unlike a regular explosion it then goes through all the resulting debris and disintegrates it and/or turns it to dust with a material-dependent % chance (so organic things more or less just vaporize, but metal things will probably be more or less fine).
The lore explanation could be that the antimatter containment field disperses slower than the antimatter itself does, so it “concentrates” the explosion, hence providing better damage / aforementioned disintegration but not being significantly larger.

I’m not sure how I feel about mind-control weapons in non-magical settings, but most of the other stuff looks cool. Definitely good inspiration.

Also, I’ve put in a PR to merge this: https://github.com/CleverRaven/Cataclysm-DDA/pull/2803, so we’ll see what happens.

Uh, yeah, the Persuadertron, etc probably wouldn’t be that relevant. (Though we might be able to use a Disrupter in That RP Thread…) No need to attempt the really exotic stuff.

Wow, okay, that merged already! I honestly thought that would take a few days longer than it did…

Yeah, agreed. I’m poking around with a stasis/time dilation weapon and some other things - I’ll probably end up putting in another PR when they’re done if they look interesting…

[quote=“swwu, post:10, topic:2903”]Wow, okay, that merged already! I honestly thought that would take a few days longer than it did…

Yeah, agreed. I’m poking around with a stasis/time dilation weapon and some other things - I’ll probably end up putting in another PR when they’re done if they look interesting…[/quote]

Uh. The Stasis Field & Displacertron really really shouldn’t make it in. There’s a bullahittime™ aug already established as experimental military tech–it’s pretty inconvenient and has side effects. Being able to slow time* remotely or create a timewarp-portal, at least with human tech, is well outside Cata canon as I understand it. Sorry for the confusion.

*As in, an antipersonnel rocket fired through the Stasis Field moves slowly enough that you can see it coming at you, turn perpendicular to it, and briskly walk out of the way. Running guarantees your safety.

/embarrassed

Wait people know of syndicate wars?

<3. Just <3.

Monofilament razor wire nao plz :V

[quote=“Iosyn, post:12, topic:2903”]Wait people know of syndicate wars?

<3. Just <3.

Monofilament razor wire nao plz :V[/quote]

Yeah, where the mininukes are a little more potent. :wink:

Detcord is OK. Trigger Wire is unlikely. Razor Wire…could happen, but since Brain v3 could barely see it, it’d be pretty harsh on the eyes one can get in Cata.

[quote=“Iosyn, post:12, topic:2903”]Wait people know of syndicate wars?

<3. Just <3.

Monofilament razor wire nao plz :V[/quote]

http://satellitereign.com/ <- you may like this

May I also offer you some energy-weapon idea?

Self-heating thermonuclear engine. It overheats so much that it casts an endless explosion around it(and it’s very realistic, go check out xkcd’s “what if”, this shit have been mentioned once)

So presumably this would be some kind of area-control grenade-type weapon? Might be interesting actually, although I imagine the AI would be pretty bad about it.

No worse than it already is, other than when it blocks scent/LOS, monsters/NPCs aren’t aware of fields at all, so they walk straight into e.g. fires, which in practice are about as bad as a continuous explosion.

If you solved the issue for dangerous fields in general it would sort it out for this too.

Or do you mean NPCs trying to use the thing?

I’m fairly new to cataclysm but have seen videos of people playing / tutorials understand, with the new system of augmentations requiring the autodoc/needing to be sterilized with the special machines.

Am I stupid for thinking the finger mounted laser could be turned into a makeshift laser pistol similar to the arm Cannon being made into a rifle (not sure if it’s a mod or not)?

The FML only does damage similar to the 22LR and would be good for a mid-to late game turret mount option for bases because it has no splash damage/ common enough to get 1-2 in a lab run provided your lucky enough butchering scientists.

And with that new sterilization system somebody with high enough intelligence could just connect a large enough battery and a switch to it while overriding the safeties and done