Realistic meth labs, yo

Yo, Gryphsenberg, this stuff doesn’t make meth. Aspirin? Caffeine pills? Energy drinks? I thought you were a chemistry teacher.

I coded an version of one that’d be more realistic.

Mr. Gryte, you handle the merging, I’ll handle the supplies for the cook.
Here’s the recipe, bitch. No chili-P, yo, the ZEA’s cracked down on it. I thought meth-heads were bad, but these zombies are worse.

        "type" : "recipe",
  "result": "meth1",
  "category": "CC_CHEM",
  "skill_used": "cooking",
  "difficulty": 3,
  "time": 80000,
  "reversible": false,
  "autolearn": true,
  "tools": [
    [
      [ "hotplate", 15 ],
      [ "chemistry_set", 15 ],
      [ "toolset", 1 ],
      [ "fire", -1 ]
    ],
    [
      [ "chemistry_set", -1 ],
      [ "bottle_glass", 2 ],
      [ "jug_plastic", 2 ],
      [ "bottle_plastic", 2 ],
      [ "hose", -1 ]
    ]
  ],
  "components": [
    [
      [ "dayquil", 2 ],
      [ "ephedrine", 1 ],
      [ "royal_jelly", 1 ]
    ],
    [
      [ "battery", 100 ],
      [ "acid", 1 ]
    ],
    [
      [ "matches", 10 ],
      [ "flare", 5 ]
    ]
  ]
},{
        "type" : "recipe",
  "result": "meth2",
  "category": "CC_CHEM",
  "skill_used": "cooking",
  "difficulty": 5,
  "time": 40000,
  "reversible": false,
  "autolearn": true,
  "tools": [
    [
      [ "hotplate", 15 ],
      [ "chemistry_set", 15 ],
      [ "toolset", 1 ],
      [ "fire", -1 ]
    ],
    [
      [ "chemistry_set", -1 ],
      [ "bottle_glass", 2 ],
      [ "hose", -1 ]
    ]
  ],
  "components": [
    [
      [ "dayquil", 5 ],
      [ "ephedrine", 3 ],
      [ "royal_jelly", 2 ]
    ],
    [
      [ "battery", 100 ],
      [ "acid", 1 ]
    ],
    [
      [ "matches", 5 ],
      [ "flare", 5 ],
      [ "fertilizer_liquid", 1 ]
    ]
  ]
},{
        "type" : "recipe",
  "result": "meth3",
  "category": "CC_CHEM",
  "skill_used": "cooking",
  "difficulty": 9,
  "time": 90000,
  "reversible": false,
  "autolearn": true,
  "tools": [
    [
      [ "chemistry_set", 15 ]
    ],
    [
      [ "flask_glass", 2 ]
    ],
    [
      [ "hose", -1 ]
    ]
  ],
  "components": [
    [
      [ "methylamine", 2 ]
    ],
    [
      [ "acid", 1 ]
    ],
    [
      [ "aluminumfilings", 20 ]
    ]
  ]
},{
        "type" : "recipe",
  "result": "redphosphorus",
  "category": "CC_CHEM",
  "difficulty": 2,
  "time": 10000,
  "reversible": false,
  "autolearn": true,
  "tools": [
    [
      [ "scissors", -1 ],
      [ "toolset", 2 ]
    ]
  ],
  "components": [
    [
      [ "flare", 1 ],
      [ "matches", 3 ]
    ]
  ]
},{
        "type" : "recipe",
  "result": "methylamine",
  "category": "CC_CHEM",
  "difficulty": 6,
  "time": 10000,
  "reversible": false,
  "autolearn": true,
  "tools": [
    [
      [ "chemistry_set", 1 ],
      [ "toolset", 2 ]
    ]
  ],
  "components": [
    [
      [ "fertilizer_liquid", 1 ]
    ]
  ]
},{
        "type" : "recipe",
  "result": "aluminumfilings",
  "category": "CC_CHEM",
  "difficulty": 2,
  "time": 10000,
  "reversible": false,
  "autolearn": true,
  "tools": [
    [
      [ "scissors", -1 ],
      [ "toolset", 2 ]
    ]
  ],
  "components": [
    [
      [ "can_drink", 1 ]
    ]
  ]
},{

{ "type" : "COMESTIBLE", "id" : "meth1", "name" : "Shake and Bake Meth", "weight" : 1, "color" : "yellow", "addiction_type" : "amphetamine", "spoils_in" : 0, "use_action" : "METH", "stim" : 20, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : 0, "heal" : -8, "addiction_potential" : 50, "nutrition" : 0, "description" : "A profoundly addictive homemade stimulant. Extremely effective at reducing teeth count, these yellow crystals smell of left over chemical impurities.", "price" : 800, "material" : "powder", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "solid", "charges" : 6, "stack_size" : 100, "bashing" : 0, "fun" : 30 }, { "type" : "COMESTIBLE", "id" : "meth2", "name" : "Crank", "weight" : 1, "color" : "white", "addiction_type" : "amphetamine", "spoils_in" : 0, "use_action" : "METH", "stim" : 50, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : 0, "heal" : -5, "addiction_potential" : 60, "nutrition" : 0, "description" : "Cloudy crystals. Smells vaguely of acetone. Now you can smoke that chunky white crunch anywhere. At the office, at the grocery store, a bathtub in the middle of the street, or face down in a big ol' tire.", "price" : 1000, "material" : "powder", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "solid", "charges" : 6, "stack_size" : 100, "bashing" : 0, "fun" : 40 }, { "type" : "COMESTIBLE", "id" : "meth3", "name" : "Chemically Pure Meth", "weight" : 1, "color" : "blue", "addiction_type" : "amphetamine", "spoils_in" : 0, "use_action" : "METH", "stim" : 99, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : 0, "heal" : 0, "addiction_potential" : 60, "nutrition" : 0, "description" : "This stuff is as clear as glass, and as blue as an azure sunset. It is the most chemically pure product on the market. Who ever cooked this, they're an artist.", "price" : 1600, "material" : "powder", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "solid", "charges" : 6, "stack_size" : 100, "bashing" : 0, "fun" : 60 }, { "type" : "COMESTIBLE", "id" : "ephedrine", "name" : "ephedrine", "weight" : 1, "color" : "cyan", "addiction_type" : "caffine", "spoils_in" : 0, "use_action" : "CAFF", "stim" : 14, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : 0, "heal" : 0, "addiction_potential" : 3, "nutrition" : 0, "description" : "A minor stimulant, extracted and powdered.", "price" : 60, "material" : "plastic", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "solid", "charges" : 10, "stack_size" : 200, "bashing" : 0, "fun" : 0 }, { "type" : "COMESTIBLE", "id" : "methylamine", "name" : "methylamine", "weight" : 1, "color" : "cyan", "addiction_type" : "none", "spoils_in" : 0, "use_action" : "POISON", "stim" : 0, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : -50, "heal" : -50, "addiction_potential" : 0, "nutrition" : 0, "description" : "A chemical used in the production of fertilizer and methamphetamine. Used to be on a watchlist, before the DEA became the DEAD. Do not drink.", "price" : 60, "material" : "plastic", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "liquid", "charges" : 10, "stack_size" : 200, "bashing" : 0, "fun" : -40 }, { "type" : "COMESTIBLE", "id" : "aluminumfilings", "name" : "aluminum filings", "weight" : 1, "color" : "cyan", "addiction_type" : "none", "spoils_in" : 0, "use_action" : "NONE", "stim" : 0, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : -10, "heal" : 0, "addiction_potential" : 0, "nutrition" : 0, "description" : "Metallic shavings. Tastes like Alzheimers.", "price" : 60, "material" : "plastic", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "liquid", "charges" : 10, "stack_size" : 200, "bashing" : 0, "fun" : -5 }, { "type" : "COMESTIBLE", "id" : "redphosphorus", "name" : "red phosphorus", "weight" : 1, "color" : "red", "addiction_type" : "none", "spoils_in" : 0, "use_action" : "NONE", "stim" : 0, "container" : "null", "to_hit" : 0, "comestible_type" : "MED", "symbol" : "!", "quench" : -10, "heal" : 0, "addiction_potential" : 0, "nutrition" : 0, "description" : "It's red, it's phosphorus, what more can be said?", "price" : 60, "material" : "plastic", "tool" : "null", "volume" : 1, "cutting" : 0, "phase" : "powder", "charges" : 10, "stack_size" : 200, "bashing" : 0, "fun" : -5 },

This is some primitive code, but you get the point. Copy paste that crystal into yo recipes and comestibles.

Seriously though, if anyone knows how to alter duration of effect, that’d be awesome. God, so many things are just going to waste being in iuse.cpp.

I have a dream, that one day, the stuff in iuse.cpp will be alterable without having to recompile the whole program. That’d make things like this so much easier.

Yo, I just think there should be a quality system for drugs in game.

If anyone else thinks this is a good idea, tell me. I could code it up, but I don’t want to if it’s not gonna come to any use.

I’m all for a drug quality system.

I’ve been the victim of that really shitty yayo that takes a gram just to get your nose numb hahaha.

I think this is a nice idea. It’d be great if we could get more specific chemical recipes than “chemistry set + hotplate = drugs,” but I don’t have the knowledge to implement such a system. And a quality system would also be great, especially if there are higher risks of unexpected consequences with poorer quality drugs.

Concievably we could apply a quality system to everything. With drugs, while there could be different recipes for different actions, your skill at such action could affect the quality of such things. Samething applies to food, swords, armor, everything. A shitty smith makes a shitty katana for example, and an inept cook manages to burn clean water. Somehow.

Or forgets about it and all the water boils off.

We already kinda have that in the form of wasting materials.

Drug quality +1.

I’m working on it, Clay. But the USE_ACTION for coke is set in stone and limited to about 140.

This would be a lot smoother if iuse.cpp was editable in the precompiled game. It doesn’t have to be JSON, but can it remain .ccp and just be in one of the folders like data, or raw? It’d make things like this so much easier if the .ccp files were in a folder like the JSON files instead of having to compile every time.

So, I did some CCP coding for the shake and bake.

int iuse::meth1(player *p, item *it, bool t) {
    int duration = 5 * (10 );
    if (p->has_amount("apparatus", 1) && p->use_charges_if_avail("fire", 1)) {
        g->add_msg_if_player(p,_("You smoke your impure meth. The world speeds up, slightly, and you taste burning plastic."));
        duration *= (p->has_trait("LIGHTWEIGHT") ? 1.8 : 1.5);
    } else {
    if (p->has_amount("syringe", 1) && p->use_charges_if_avail("fire", 1)) {
        g->add_msg_if_player(p,_("You inject meth you cooked in a jug. Your heart races."));
        duration *= (p->has_amount("syringe", 1) ? 3.8 : 3.5);
        p->add_disease("infection", rng(10, 20));
    } else {
        g->add_msg_if_player(p,_("You snort some of the worst shabu-shabu you've ever had."));
    }
    if (!p->has_disease("meth")) {
        duration += 450;
    }
    if (duration > 0) {
        int hungerpen = (p->str_cur < 10 ? 20 : 30 - p->str_cur);
        p->hunger -= hungerpen;
        p->add_disease("meth", duration);
    }
    return it->type->charges_to_use();
}

If anyone is in the know about coding, is this functional?

I thought this thread was going to be a suggestion for some houses being “realistic meth labs”, ie a chance of blowing up if anything happens, inhaling fumes causing problems, all that stuff. But this is good too.

I can’t do that in JSON code, but it might be possible with CPP. If I could get a real coder in here, I’d love to have any thing merged, and I’d code a bunch of different substances of purity. I can code CPP, I think, but I can’t compile. Just needs to be copy pasted in.

I offer my services to make a meth-lab house variant or building, but will only write the code. I’m not a fan of having to mess around with GitHub or CodeBlocks more than I have to :stuck_out_tongue:

I’ve got a new basement lab variant ready to go. Lots of meth, and sometimes other goodies.

If this turns out with enough content to justify it, if I work on the codes, could it maybe get merged into the main branch?

I’ve been studying the CPP code, and I think I know enough to code up something that could be useable.

[quote=“TheGrifter, post:15, topic:4436”]If this turns out with enough content to justify it, if I work on the codes, could it maybe get merged into the main branch?

I’ve been studying the CPP code, and I think I know enough to code up something that could be useable.[/quote]

Smaller things have been added to the game ;p another basement variant will probably be a welcome addition to the game.

Well, I may or may not work on that. I understand disease.ccp, iuse.cpp, but not the terrain.ccp.

I’d like to get some of this code integrated into the main game. It’d necessitate aluminum foil being added, because aluminum cans aren’t really that great a substance to create aluminum filings to cook Heisenberg level P2P meth with.

Also, I’d really like to add a chance of “Requiem for a Dream” style gangrene and infection for characters who inject, along with various purity levels.

We have three varieties of potato chips, so why not?

I’ve finished finals, so if I don’t experience general malaise, I’ll work on it, but I really think the recipe ought to be changed. I’ve watched too much breaking bad for the current one to not break my suspension of disbelief.

“Yo, Mr. White, why’d you get aspirin, dayquil, and caffeine? Don’t you know you need red phosphorus, iodine, and ephedrine?”

“No, Jesse. We’re cooking in a different meth-od. We’re making imaginary meth. Goddamn you, we’ve got to sell this to Tuco, or Gus, or those Meth-Nazis. It’s supposed to have aspirin and caffeine.”

“Uh… Where did you get your chemistry degree again?”

No wonder Jesse Pinkman failed his class in the Cata-universe. Chemistry is all messed up.

+1 to this general silliness.

+1 to call the strongest freakin’ drug you’d be able to cook up “The Grifter”

[quote=“Slax, post:19, topic:4436”]+1 to call the strongest freakin’ drug you’d be able to cook up “The Grifter”[/quote]Agreed. This needs to happen.