Fixes Phoron Salts Again (#5585)

Because I'm an idiot I realised that phoron salt bombs are actually impossible because water turns to ice when frozen, and you need frozen water in order to make a working bomb.

I also fixed a few bugs regarding cryo/pyro mixes in reagents. It only took me 5 hours to figure out.

I also made Phoron Salts containers spawn with a stable temperature so admins don't blow up when they mess around with it.

I adjusted the explosion size of phoron salts so that absolute best case scenario, you can make a bomb that has the destructive radius of a screen.
This commit is contained in:
BurgerLUA
2018-11-10 13:29:40 -08:00
committed by Werner
parent 7a23254be9
commit 575372ea6b
7 changed files with 97 additions and 24 deletions
@@ -17,9 +17,7 @@
/obj/item/weapon/grenade/chem_grenade/Initialize()
. = ..()
var/datum/reagents/R = new/datum/reagents(1000)
reagents = R
R.my_atom = src
create_reagents(1000)
/obj/item/weapon/grenade/chem_grenade/attack_self(mob/user as mob)
if(!stage || stage==1)
@@ -143,7 +141,8 @@
var/has_reagents = 0
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
if(G.reagents.total_volume) has_reagents = 1
if(G.reagents.total_volume)
has_reagents = 1
active = 0
if(!has_reagents)
@@ -159,7 +158,6 @@
return
playsound(src.loc, 'sound/effects/bamf.ogg', 50, 1)
for(var/obj/item/weapon/reagent_containers/glass/G in beakers)
G.reagents.trans_to_obj(src, G.reagents.total_volume)
@@ -324,6 +322,7 @@
beakers += B2
icon_state = initial(icon_state) +"_locked"
/obj/item/weapon/grenade/chem_grenade/teargas
name = "tear gas grenade"
desc = "Concentrated Capsaicin. Contents under pressure. Use with caution."
@@ -460,6 +460,7 @@
reagent_state = SOLID
color = "#FFFF00"
taste_description = "chalk"
default_temperature = 600 //Kelvin
/datum/reagent/cryosurfactant
name = "Cryosurfactant"
@@ -468,6 +469,7 @@
reagent_state = LIQUID
color = "#00FFFF"
taste_description = "needles"
default_temperature = 100 //Kelvin
/datum/reagent/luminol/touch_obj(var/obj/O)
O.reveal_blood()
@@ -128,10 +128,11 @@
/datum/reagent/toxin/phoron_salt //Remember to exclude in RNG chems.
name = "Phoron Salts"
id = "phoron_salt"
description = "A mysterious molten mixture with strange chemical properties."
description = "A mysterious molten mixture with strange chemical properties. Incredibly deadly to all lifeforms, especially Vaurca."
reagent_state = SOLID
color = "#7C4876"
strength = 30
default_temperature = 130 //Kelvin
/datum/reagent/toxin/cardox
name = "Cardox"
+34 -15
View File
@@ -102,7 +102,8 @@
for(var/reactant in required_reagents)
var/amt_used = required_reagents[reactant] * reaction_progress
var/datum/reagent/removing_reagent = holder.get_reagent(reactant)
total_thermal_energy += removing_reagent.get_thermal_energy() * (amt_used / removing_reagent.volume)
var/energy_transfered = removing_reagent.get_thermal_energy() * (amt_used / removing_reagent.volume)
total_thermal_energy += energy_transfered
holder.remove_reagent(reactant, amt_used, safety = 1)
//add the product
@@ -705,7 +706,8 @@
/datum/chemical_reaction/explosion_potassium/on_reaction(var/datum/reagents/holder, var/created_volume)
var/datum/effect/effect/system/reagents_explosion/e = new()
e.set_up(round (created_volume/10, 1), holder.my_atom, 0, 0)
var/turf/location = get_turf(holder.my_atom)
e.set_up(round (created_volume/10, 1), location, 0, 0)
if(isliving(holder.my_atom))
e.amount *= 0.5
var/mob/living/L = holder.my_atom
@@ -2907,7 +2909,7 @@
required_reagents = list("sodiumchloride" = 1, "phoron" = 2)
required_temperatures_min = list("sodiumchloride" = 678, "phoron" = 73)
required_temperatures_max = list("phoron" = 261)
result_amount = 1
/datum/chemical_reaction/pyrosilicate
@@ -2924,16 +2926,34 @@
result_amount = 3
required_reagents = list("surfactant" = 1, "ice" = 1, "sodium" = 1)
/datum/chemical_reaction/cryosurfactant_cooling
name = "Cryosurfactant Cooling"
id = "cryosurfactant_cooling"
//WATER
/datum/chemical_reaction/cryosurfactant_cooling_water
name = "Cryosurfactant Cooling Water"
id = "cryosurfactant_cooling_water"
result = null
result_amount = 1
required_reagents = list("cryosurfactant" = 1)
inhibitors = list("pyrosilicate" = 1)
catalysts = list("water" = 1)
mix_message = "The solution begins to freeze."
/datum/chemical_reaction/cryosurfactant_cooling/on_reaction(var/datum/reagents/holder, var/created_volume)
/datum/chemical_reaction/cryosurfactant_cooling_water/on_reaction(var/datum/reagents/holder, var/created_volume)
holder.del_reagent("cryosurfactant")
holder.add_thermal_energy(-created_volume*500)
//ICE
/datum/chemical_reaction/cryosurfactant_cooling_ice
name = "Cryosurfactant Cooling Ice"
id = "cryosurfactant_cooling_ice"
result = null
result_amount = 1
required_reagents = list("cryosurfactant" = 1)
inhibitors = list("pyrosilicate" = 1)
catalysts = list("ice" = 1)
mix_message = "The solution begins to freeze."
/datum/chemical_reaction/cryosurfactant_cooling_ice/on_reaction(var/datum/reagents/holder, var/created_volume, var/created_thermal_energy)
holder.del_reagent("cryosurfactant")
holder.add_thermal_energy(-created_volume*500)
/datum/chemical_reaction/pyrosilicate_heating
@@ -2946,6 +2966,7 @@
catalysts = list("sodiumchloride" = 1)
/datum/chemical_reaction/pyrosilicate_heating/on_reaction(var/datum/reagents/holder, var/created_volume)
holder.del_reagent("pyrosilicate")
holder.add_thermal_energy(created_volume*1000)
/datum/chemical_reaction/pyrosilicate_cryosurfactant
@@ -2969,9 +2990,10 @@
result_amount = 1
required_reagents = list("phoron_salt" = 1)
required_temperatures_min = list("phoron_salt" = 134) //If it's above this temperature, then cause hellfire.
mix_message = "The solution begins to vibrate!"
/datum/chemical_reaction/phoron_salt_fire/on_reaction(var/datum/reagents/holder, var/created_volume, var/created_thermal_energy)
var/turf/location = get_turf(holder.my_atom.loc)
var/turf/location = get_turf(holder.my_atom)
for(var/turf/simulated/floor/target_tile in range(0,location))
target_tile.assume_gas("phoron", created_volume*2, created_thermal_energy / 25) //2 because there is 2 phoron in 1u of phoron salts
addtimer(CALLBACK(target_tile, /turf/simulated/floor/.proc/hotspot_expose, 700, 400), 1)
@@ -2985,16 +3007,13 @@
result_amount = 1
required_reagents = list("phoron_salt" = 1)
required_temperatures_max = list("phoron_salt" = 113) //if it's below this temperature, then make a boom
mix_message = "The solution begins to shrink!"
/datum/chemical_reaction/phoron_salt_coldfire/on_reaction(var/datum/reagents/holder, var/created_volume, var/created_thermal_energy)
var/turf/location = get_turf(holder.my_atom)
var/explosion_mod = 1 + max(0,32*(1 - (created_thermal_energy/28000))*min(1,created_volume/120)) * 10
var/datum/effect/effect/system/reagents_explosion/e = new()
var/explosion_mod = 1 + max(0,32*(1 - (created_thermal_energy/28000))*min(1,created_volume/120)) * 7 //The colder you can get it to absolute 0 in a short amount of time, the bigger the explosion.
e.set_up(round(explosion_mod, 1), holder.my_atom, 0, 0)
if(isliving(holder.my_atom))
e.amount *= 0.5
var/mob/living/L = holder.my_atom
if(L.stat != DEAD)
e.amount *= 0.5
e.set_up(explosion_mod, location, 0, 0)
e.start()
holder.clear_reagents()
return
@@ -48,7 +48,7 @@
return get_thermal_energy() / volume
/datum/reagent/proc/add_thermal_energy(var/added_energy)
thermal_energy += added_energy
thermal_energy = max(0,thermal_energy + added_energy)
return added_energy
/datum/reagent/proc/set_thermal_energy(var/set_energy)
@@ -110,14 +110,15 @@
/datum/reagents/proc/has_all_temperatures(var/list/required_temperatures_min, var/list/required_temperatures_max)
for(var/datum/reagent/current in reagent_list)
var/current_temperature = current.get_temperature()
if(current.id in required_temperatures_min) //The current temperature must be greater than this temperature
var/current_temperature = current.get_temperature()
var/required_temperature = required_temperatures_min[current.id]
if(current_temperature < required_temperature) //Current temperature is less than the required temperature,
return FALSE
if(current.id in required_temperatures_max) //The current temperature must be less than this temperature.
var/current_temperature = current.get_temperature()
var/required_temperature = required_temperatures_max[current.id]
if(current_temperature > required_temperature) //Current temperature is greater than the required temperature.
return FALSE
@@ -393,4 +393,15 @@
Initialize()
. = ..()
reagents.add_reagent("cryosurfactant", 60)
update_icon()
/obj/item/weapon/reagent_containers/glass/bottle/phoron_salt
name = "phoron salt bottle"
desc = "A small bottle. Contains phoron salt - a mysterious and unstable chemical."
icon = 'icons/obj/chemical.dmi'
icon_state = "bottle-4"
Initialize()
. = ..()
reagents.add_reagent("phoron_salt", 60)
update_icon()
+40
View File
@@ -0,0 +1,40 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
#################################
# Your name.
author: BurgerBB
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Added an alternative cryosurfactant reaction that can be triggered with ice instead of water. "
- rscadd: "Updated phoron salts description to let people know it's harmful to Vaurca. Phoron salt default temperature is its stable temperature for easy admin spawning. Added different phoron salt mixture reaction messages."
- balance: "Slightly buffs phoron salt explosion size."
- bugfix: "Fixes a bug that made cryo/pyro reagents only half as effective."