mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa * Update others.dm * Update others.dm * Update others.dm * Update code/modules/reagents/chemistry/machinery/chem_dispenser.dm Co-authored-by: Theos <theubernyan@gmail.com> * Update code/modules/reagents/chemistry/machinery/chem_dispenser.dm Co-authored-by: Theos <theubernyan@gmail.com> * Update code/modules/reagents/chemistry/machinery/chem_dispenser.dm Co-authored-by: Theos <theubernyan@gmail.com> * Update code/modules/reagents/chemistry/machinery/chem_dispenser.dm Co-authored-by: Theos <theubernyan@gmail.com> * Update others.dm * Update others.dm * Update others.dm Co-authored-by: Theos <theubernyan@gmail.com>
80 lines
3.2 KiB
Plaintext
80 lines
3.2 KiB
Plaintext
/datum/chemical_reaction
|
|
var/name = null
|
|
var/id = null
|
|
var/list/results = new/list()
|
|
var/list/required_reagents = new/list()
|
|
var/list/required_catalysts = new/list()
|
|
|
|
// Both of these variables are mostly going to be used with slime cores - but if you want to, you can use them for other things
|
|
var/required_container = null // the exact container path required for the reaction to happen
|
|
var/required_other = 0 // an integer required for the reaction to happen
|
|
|
|
var/mob_react = TRUE //Determines if a chemical reaction can occur inside a mob
|
|
|
|
var/required_temp = 0
|
|
var/is_cold_recipe = FALSE // Set to TRUE if you want the recipe to only react when it's BELOW the required temp.
|
|
var/mix_message = "The solution begins to bubble." //The message shown to nearby people upon mixing, if applicable
|
|
var/mix_sound = 'sound/effects/bubbles.ogg' //The sound played upon mixing, if applicable
|
|
|
|
/datum/chemical_reaction/proc/on_reaction(datum/reagents/holder, created_volume)
|
|
return
|
|
//I recommend you set the result amount to the total volume of all components.
|
|
|
|
/datum/chemical_reaction/proc/chemical_mob_spawn(datum/reagents/holder, amount_to_spawn, reaction_name, mob_class = HOSTILE_SPAWN, mob_faction = "chemicalsummon", random = TRUE)
|
|
if(holder && holder.my_atom)
|
|
var/atom/A = holder.my_atom
|
|
var/turf/T = get_turf(A)
|
|
var/message = "A [reaction_name] reaction has occurred in [ADMIN_VERBOSEJMP(T)]"
|
|
message += " (<A HREF='?_src_=vars;[HrefToken()];Vars=[REF(A)]'>VV</A>)"
|
|
|
|
var/mob/M = get(A, /mob)
|
|
if(M)
|
|
message += " - Carried By: [ADMIN_LOOKUPFLW(M)]"
|
|
else
|
|
message += " - Last Fingerprint: [(A.fingerprintslast ? A.fingerprintslast : "N/A")]"
|
|
|
|
message_admins(message, 0, 1)
|
|
log_game("[reaction_name] chemical mob spawn reaction occuring at [AREACOORD(T)] carried by [key_name(M)] with last fingerprint [A.fingerprintslast? A.fingerprintslast : "N/A"]")
|
|
|
|
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
|
|
|
|
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
|
|
C.flash_act()
|
|
|
|
for(var/i in 1 to amount_to_spawn)
|
|
var/mob/living/simple_animal/S
|
|
if(random)
|
|
S = create_random_mob(get_turf(holder.my_atom), mob_class)
|
|
else
|
|
S = new mob_class(get_turf(holder.my_atom))//Spawn our specific mob_class
|
|
S.faction |= mob_faction
|
|
if(prob(50))
|
|
for(var/j = 1, j <= rand(1, 3), j++)
|
|
step(S, pick(NORTH,SOUTH,EAST,WEST))
|
|
|
|
/datum/chemical_reaction/proc/goonchem_vortex(turf/T, setting_type, range)
|
|
for(var/atom/movable/X in orange(range, T))
|
|
if(iseffect(X))
|
|
continue
|
|
if(!X.anchored)
|
|
var/distance = get_dist(X, T)
|
|
var/moving_power = max(range - distance, 1)
|
|
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
|
|
if(setting_type)
|
|
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, T)))
|
|
X.throw_at(throw_target, moving_power, 1)
|
|
else
|
|
X.throw_at(T, moving_power, 1)
|
|
else
|
|
spawn(0) //so everything moves at the same time.
|
|
if(setting_type)
|
|
for(var/i = 0, i < moving_power, i++)
|
|
sleep(0.2 SECONDS)
|
|
if(!step_away(X, T))
|
|
break
|
|
else
|
|
for(var/i = 0, i < moving_power, i++)
|
|
sleep(0.2 SECONDS)
|
|
if(!step_towards(X, T))
|
|
break
|