Skip to content

Instantly share code, notes, and snippets.

@Hobey
Last active October 29, 2022 21:06
Show Gist options
  • Save Hobey/41909c29a166550815fe71822a4dff5d to your computer and use it in GitHub Desktop.
Save Hobey/41909c29a166550815fe71822a4dff5d to your computer and use it in GitHub Desktop.
King Arthur's Gold - Territory Control - Chemical Laboratory
Recipes and Mechanics as of Territory Control v130  
TC's code for Chemlab recipes and pressure logic is in "kag_folder\mods\TFlippy_TerritoryControl_Structures_v130\Entities\Structures\DrugLab\DrugLab.as"

General Info

50 Methane  adds 3.75k base pressure
50 Acid     adds 3.75k base pressure
50 Fuel     adds    5k base pressure
50 Mustard  adds  2.5k base pressure

The temperature slowly falls (7 per tick)
Pressing the heat button increases the temperature by 100
Mithril that you put inside the Chemlab makes the the temperature go up each tick; at 125 mithril, it balances out with the natural cooling
Enriched mithril increases temperature 5x as much as mithril

the higher the temperature, the higher the "true" pressure in the Chemlab (temperature is a weak exponent on the pressure)
true_pressure = base_pressure ^ min(1, 1 + temperature / 5'000)  -- line 531 in DrugLab.as
so for example:
  at 5'000 temperature:   true_pressure = base_pressure ^ 2
  at 2'500 temperature:   true_pressure = base_pressure ^ 1.5
  at    25 temperature:   true_pressure ~ base_pressure

max pressure is 150k (shaking starts at half max pressure)
if max pressure is reached the Chemlab explodes and leaks a bit of yellow firey-acid
Crackhead's Chemistry Kit (the 'Unstable piece of shit' from hobos) only has 50k max pressure
the auto chem lab (the one you need a blueprint for) has 180k max pressure, and you can upgrade the max pressure by 2k for a copper ingot up to. you can upgrade forever (there is no max max)

"Rule of thumb" about preventing it from blowing up
at 1000 temperature, you can have 200 methane or acid in the Chemlab
at 1400 temperature, you can have 100 methane or acid in the Chemlab
at 2000 temperature, you can have  50 methane or acid in the Chemlab
above 2500 temperature, avoid having any gas in the Chemlab

here's desmos graphs with sliders to explore the heat and gas numbers:
"How much gas can I put in at this temperature": https://www.desmos.com/calculator/lxptwsqwxr?lang=en
"How much heat can I add with this amount of gas": https://www.desmos.com/calculator/i8rxffy1wk?lang=en

Link to the chemlab code in the TC repository:
https://github.com/TFlippy/kag_territorycontrol/blob/master/TFlippy_TerritoryControl_Structures_Dev/Entities/Structures/DrugLab/DrugLab.as https://github.com/TFlippy/kag_territorycontrol/blob/master/TFlippy_TerritoryControl_Structures_Dev/Entities/Structures/Factories/AutoChemLab/ChemLab.as

Gas Recipes --- [outputs]: [inputs] ([pressure], [temperature])

1.75n Oil:                         n Coal            (70k,     1300)  n=P/5k
1.5n Fuel:                         n Oil, n Methane  (40k,      750)  n=P/5k
1.5n Fuel, 0.5n Acid, n Dirt:      n Oil             (10k-50k, 1000)  n=P/5k   - stay below 2400 heat to avoid overpressure

3n Methane, 3n Acid:               n Meat              (  1k,  300)  n=P/4k
3n Sulphur:                        n Dirt, 0.25n Acid  (<50k,  100)  n=P/3k
2n Acid:                           n Mustard, n Fuel   ( 20k,  300)  n=P/7k

Drug Recipes --- [outputs]: [inputs] ([pressure], [temperature]) - [notes] {[auto chemlab output amount]}

Recipes with a * in front cannot be made in an Auto Chemlab; also some drug recipes give a bit less output in an Auto Chemlab

*  0-6 Domino, 4-7 Fiks:                          15 Acid,  5 Mithril            ( <25k,  500-2000)
*  3-8 Domino, 0-9 Enriched Mithril, 0-39 Fuel:   25 Acid, 50 Mithril            (  25k, 1500     )
   3-12 Coal, or sometimes (30%) Crak:               Fiks                        (  <5k,  500     )  the Fiks is only consumed if Crak is generated; (expected amount of coal per fiks is 15 coal)
   2-4 Babby:                                     20 Acid, 15 Coal               ( <20k,  100-750 )

   1-4 Propesko, sometimes (10%) 2 Love:                  25 Acid, 10 Coal, 100 Sulphur  (<100k,  500     )   - use >750 temperature to avoid babby; never creates love when made in an auto chem lab
*  3-7 Stim, 0-14 Dirt, 5-19 Mustard:                     50 Acid,           50 Sulphur  (  25k,  400     )
   2-3 Rippio, 15-49 Rippio gas, sometimes (30%) 2 Love:  25 Oil, Stim                   (    0, 2250     )   - use >50k pressure to avoid oil reacting; never creates love when made in an auto chem lab   {1-2 Rippio, 10-44 Rippio gas}
   3-7 Bobongo, 0-49 Methane, sometimes (5%) 2-3 Fusk:    25 Acid, 50 Dirt, 15 Meat      (    0,  500     )

*  2-6 Fumes:  50 Fuel, 50 Coal, 50 Acid  (100k,  500)
   2-4 Sosek:  50 Fuel, 50 Coal, 1 Vodka  ( 50k, 1500)

   2-4 Schisk, 1-3 Bobomax:          15 Oil, 5 Mithril          (40k, 2000)      - use >50k pressure to avoid oil reacting;  only 15 oil and 5 mithril gets consumed, but 25 oil and 25 mithril is required for the reaction to happen    {2-3 Schisk. 1-2 Bobomax}
   3-9 Foof:                         20 Oil, 25 Acid, Bobomax   (20k, 1000-2000) - use >50k pressure to avoid oil reacting     {1-2 Foof}

*  1-2 Poot, 0-1 Bobomax, 0-24 Oil:  25 Acid, 25 Methane, 5 Enriched Mithril, 10 Meat (40k,  700)

   2-5 Dew:  50 Protopopov Leaves, 50 Acid, 25 Mithril  (10k, <500)
   50-124 Acid, 25-124 Oil      or sometimes (30%) 1-2 Fusk:   Protopopov Bulb  (   0, 1400)    - use <1450 heat and no gas to avoid overpressure (or just use overflow + compactors); never creates fusk when made in an auto chem lab

*  2-3 Paxilon, 15-49 Paxilon gas, sometimes ( 3%) 2-3 Fusk:   25 Oil, Vodka    (   0,  500)
   Vodka:  Grain   (0, 1000)

   15-19 Boofgas:            Ganja Pod                                 (1k, 700)
   1-2 Boof:                 20 Ganja Leaves, 20 Dirt                  (1k, <500)

High Grade Mystery Meat: 
When a creature that has Propesko applied dies (and explodes), then it drops High Grade Mystery Meat, rather than Low Grade Mystery Meat.

*  1-2 Gooby:                45 High Meat, Fiks, Rippio  (25k, 1000)
   1-2 Explodium, 9-13 Meat: 15 High Meat                (0, <300)


Drug Effects

Domino:  movement boost, heal 1/8 heart each second (stops at double your starting health); after 200 seconds, the healing stops, and instead you get screenshake and stunlock; eating another domino resets the timer to 200 second; disables suicide; automatically kills you after 5.5 minutes
Babby:   movement boost, giggling, become unable to pickup dangerous items; attacks deal no damage; a slaving attempt will always succeed on a player that has been babbyed (no matter what their health is at); disables suicide; automatically kills you after 14 minutes

Fiks:    strong overheal (the fiks amount that you have eaten gets used up a bit for each bit of health it heals you, fiks doesn't have a timer-based system like domino); short stun when overeating Fiks
Crak:    movement boost, faster build, faster attacking; take 30% damage; become a hobo after ~80 seconds (jenny can become a boowb when she touches enriched mithril after eating crak), eat more Crak to delay hobo transformation; overeating Crak results in shake/stun/damage and the inability to jump (but you can roll around!); touching at least 10 enriched mithril after becoming a hobo transforms you into a Hoob; class switching after transforming into a hobo drops 0-1500 coins.

Propesko:  when you die you explode in a nukey way; die upon strong impact (or smaller impacts if you eat more propesko); the power of the death explosion scales up over time (while you're still alive); drop High grade mystery meat on death
Bobongo:   mining material gain bonus (up to 4x extra of base amount), forced right click, locked zoom level, movement debuff, brown sky, 1 Bobongo lasts 170 seconds

Stim:     movement boost, random left clicking, screen flashing, stacks (1 stim lasts 5.5 minutes)
Rippio:   shake/stun/damage, forced right click, screaming; disables suicide
Love:     fast and intense shake/stun/damage, screaming; disables suicide

Fumes: press space for jetboost; 1 fumes lasts ~16 seconds; fumes also reduces the 15 second cooldown of Dragonfriend fireball to 3 seconds (you can shoot a fireball by pressing 'v' if you have used the 1499 coin offering in dragonfriend altar)
Sosek: drink Beer or Vodka, then press 's' and left click to activate flamethrower (you can also use the flame as a jetboost; it has pretty big pushback if you drink enough beer/vodka)

Schisk:   halluzinate nukes, sirens, death screams, random noises every 10-25 seconds (or sometimes start fake-burning); other people's chat messages will be magically changed to be about you; your chat messages are cut off for other people. but not for you
Bobomax:  become a bouncy ball, rainbow sky, die after 108 seconds drop; Klaxon and Bobomax on death/classchange
Poot:     Klaxon that farts Poot gas: movement boost, twirl, loud noise, destroy blocks upon strong impact (corpses keep the block slam effect!)
Foof:     attacks do AOE+multihit (awesome for mining, also adds significant pushback and bonus damage to guns); 1 Foof lasts ~2 minutes, stacks

Dew:   movement boost, darude sandstorm, aimbot, makes MLG bullets explode if they hit blobs
Gooby: heals you very quickly and to a very high max HP for 30 seconds, then it damages you and gives you orange sky (and you scream and roll like with rippio) and disables suicide; eating a second Gooby does NOT reset the 30 second timer, it instead instantly skips to damaging you.

Boof: movement reduction, smile/laugh emotes, coughing

Paxilon:  sleep for 30 seconds
Fusk:     get infected with the fusk virus:
  Level 0, Immediately after fusk infection: Infect flesh blobs that are overlapped and picked up. (This effect continues even for dead blobs, the other effects don't.)  
  Level 1, 30 seconds after fusk infection: Move/jump reduction, blood particles, screenshake, mousecursor moves on its own.  
  Level 2, 60 seconds after fusk infection: Stun, left/right keypresses, take dmg (0.068-0.16 hearts), coughing, screen flashing dark, infect flesh blobs in an arc in front of you, up to 4 blocks away.
  Level 3, 90 seconds after fusk infection: Take dmg (0.3-1.8 times your remaining HP) if you have more than half a heart remaining HP. This hit starts killing 150 seconds after infection if go above half a heart of HP.  
  Note that dying and respawning cleanses the infection. (But if you leave a corpse behind, the corpse can keep touch infecting things.)  
  Note that ganja tea (5 ganja leaves in healshop) cleanses the infection.  
  Note that class change sometimes cleanses the virus but sometimes the old playerblob with the virus collides with the new playerblob in the class-change tick, causing an infection to the new playerblob.  
  Note that you can in theory survive fusk forever if you stay below half a heart of HP; the only thing that will kill you is the level 2 dmg, so you need to go heal a quarter heart in a Healshop from time to time; also, if I understand the FleshHit armor code correctly, armor reduces fusk dmg.  
  Note that the rate at which you reach level 1 fusk, level 2 etc. also depends on whether or not stuff around you keeps infecting you. Overlap infections skip 0.3 seconds; pickup skips 1.5 seconds; arc infection skips 9 seconds. (Also I think arc infections can hit your own playerblob as well, triggering the leveling progress.)  

Approximate fusk arc size: https://i.imgur.com/pB2wbFQ.png


Hobo Trades [subprobablility] [drug] [prize range]

Hobos have a 50% of spawning with trades to buy drugs from them.
25% Domino    350-850
40% Bobongo   125-625
40$ Crak      500-600
25% Propesko  600-700
10% Chemistry Blueprint 3000-8000

Hobos have a 40% of spawning with trades to sell drugs to them.
70% Boof   200- 400
50% Crak   300- 500
50% Rippio 600-1000
50% Stim   500- 600
50% Fumes  500- 700

Notes for an experiment I wanna do

30 Coal -> 1.75x 30 Oil
21 Mustard  21 Fuel -> 42 Acid
50 Fuel 50 Coal 50 Acid -> 2-6 Fumes
50 Acid 50 Sulphur -> 3-7 Stim 0-14 Dirt 0-24 Mustard
20 Oil 25 Acid 1 Bobomax -> 3-9 Foof
20 Oil 20 Methane -> 30 Fuel

25 Oil 1 Vodka -> 2-3 Paxillon 15-49 Paxillon Gas  3% 2-3 Fusk
25 Acid 25 Methane 10 Meat 5 Enriched Mithril -> 1-2 Poot 1 Bobomax 0-24 Oil
25 Acid 50 Dirt 15 Meat -> 3-7 Bobongo 0-49 Methane  5% 2-3 Fusk
15 Meat -> 45 Acid 45 Methane


could add grain->vodka
could add ganja pod -> 15-19 boofgas


-----------

Heat 1300-1325
12/15 Inventory Slots occupied
Inputs:

50 Acid
50 Coal

25 Methane
25 Oil

21 Mustard
50 Fuel

50 Sulphur
50 Dirt

1 Bobomax
1 Vodka

15 Meat
5 Enriched Mithril


-----------

Outputs:

2-6 Fumes
3-7 Stim 
3-9 Foof
2-3 Paxillon 15-49 Paxillon Gas 
1-2 Poot 
3-7 Bobongo 
1 Bobomax
3% 2-3 + 5% 2-3 Fusk
 

52-76 Oil
45-94 Methane  
87 Acid
5-19 Mustard
30 Fuel

0-14 Dirt 


without overflowing some of the gas we get 18k base pressure; 240k true pressure

-----------

TC Stuff unrelated to chemlab

Mystery box: https://docs.google.com/spreadsheets/d/1VTJFBECVZ6rT_FPPSl7mSofP9lypG7KjojbUO8gVOiE/edit?usp=sharing
Animal box: https://docs.google.com/spreadsheets/d/1POb9UeYHg6-Jf6D1XrlzS3xdlkQvKhcSFtiFyFjHGKo/edit?usp=sharing

Lootchest: https://docs.google.com/spreadsheets/d/1A528wiDdZkqBs9qnMNGrwjFCcY7m9YW6mMfkr4YejaI/edit?usp=sharing

Guns: https://docs.google.com/spreadsheets/d/16XKeRnONhHNv2oj0c9BFdBt7yY8DNsZcCBI8lt_X-RE/edit#gid=0

Mithril Reactor graph: https://www.desmos.com/calculator/fe94fm8nyh?lang=en

Gyro speed upgrade graph 1: https://www.desmos.com/calculator/zx2prreefv?lang=en
Gyro speed upgrade graph 2: https://www.desmos.com/calculator/zdmunrkbru?lang=en

Base tick frequencies of machines:

Mithril Reactor    10
Driller mole       15

Auto furnace       45
Induction Furnace  90

Extractor          60 (4 block radius box)
Filtered extractor 90 (4 block radius box)

Fetcher   90 (cannot gyro) (8 block radius circle)
Inserter  60 (cannot gyro)
Packer    60 (cannot gyro)

Grinder        2 (cannot gyro)
Tree capitator 5 (cannot gyro)

Assembler          60
Chicken assembler 150
Auto Chemlab       10 (but does reaction every 20 ticks? because 15 tick reaction cooldown)

Resources that Driller mole drops when it hits bedrock (never gives the maximum because of how XORRandom() works)
20%:  0- 5   iron         (2)         50   iron per minute? (without gyros)
20%:  0- 5   copper       (2)         50 copper per minute? (without gyros)
20%:  0-10   stone        (4)        150  stone per minute? (without gyros)
20%:  0- 5   gold         (2)         50   gold per minute? (without gyros)
20%:  0- 2.5 coal         (1)         10   coal per minute? (without gyros)

//           mithril      (1)


Driller mole hits a cone of blocks that 12 deep (and 7 wide at the top)

The average value of a lottery ticket is 218 coins, so you lose 31 coins per ticket (on average); https://www.desmos.com/calculator/uqovgarvrr?lang=en


One day-night cycle in TC lasts 20 minutes.
Solar Death Ray Tower power is this: https://www.desmos.com/calculator/mzs5oqp7z0?lang=en
To shoot you need at least 0.5 power.

With  1 mirror  you have shooting power from minute 7-13 of each day.  
With  2 mirrors you have shooting power from minute 6-14 of each day.  
With  4 mirrors you have shooting power from minute 5-15 of each day.  
With 12 mirrors you have shooting power from minute 4-16 of each day.  

The match starts at minute 6 of daytime.
Power is set to 0 during rain.


Ancientship/Poisonship (AKA when god damn are the aliens/mechs coming?!?!?!)

code (line 38)

if (getGameTime() % 30 == 0)
    [...]
    if(timeSinceWreckage>30000&&XORRandom(Maths::Max(250000-timeSinceWreckage,0))==0)//Wreckage
        [...] (50/50 ancientship/poisonship)

at least 1000 seconds (~15 minutes) between ships
at most 138.88 minutes between ships

rolls the "dice" every 30 ticks (= 1 second)
probability curve for the "dice" looks like this: https://www.desmos.com/calculator/gkr8gfakpd?lang=en

chart with probability y of the ship having spawned at x minutes: https://i.imgur.com/f6817Oa.png
corresponging spreadsheet: https://docs.google.com/spreadsheets/d/1NKpwJu8SD4MT7v4vXh6-1yTWxe8hRMpN7DQFRdt-PLc/edit?usp=sharing

 30   minutes into the match you have a 0.4%  probability of having seen a ship
 60   minutes into the match you have a 1.4%  probability of having seen a ship
 90   minutes into the match you have a 3.0%  probability of having seen a ship
120   minutes into the match you have a 6.0%  probability of having seen a ship

135   minutes into the match you have a 10.9% probability of having seen a ship
138.8 minutes into the match you have a 100%  probability of having seen a ship

@bend-n
Copy link

bend-n commented Sep 9, 2020

i cant make explodium meat

@bend-n
Copy link

bend-n commented Sep 27, 2020

what about crak gas?

@bend-n
Copy link

bend-n commented Jan 26, 2021

the chemical machien thingy

@Hobey
Copy link
Author

Hobey commented Mar 29, 2021

Added Boof recipe and info
Added Gooby recipe
Added Explodium recipe + High meat info

@bend-n
Copy link

bend-n commented Apr 19, 2021

GOOBY RECIPE?

@bend-n
Copy link

bend-n commented Apr 19, 2021

fujs rippio edxplodium

hmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment