Files
GS13NG/code/modules/reagents/chemistry/recipes.dm
T
PoojawaandGitHub 7e9b96a00f April sync (#360)
* Maps and things no code/icons

* helpers defines globalvars

* Onclick world.dm orphaned_procs

* subsystems

Round vote and shuttle autocall done here too

* datums

* Game folder

* Admin - chatter modules

* clothing - mining

* modular computers - zambies

* client

* mob level 1

* mob stage 2 + simple_animal

* silicons n brains

* mob stage 3 + Alien/Monkey

* human mobs

* icons updated

* some sounds

* emitter y u no commit

* update tgstation.dme

* compile fixes

* travis fixes

Also removes Fast digest mode, because reasons.

* tweaks for travis Mentors are broke again

Also fixes Sizeray guns

* oxygen loss fix for vore code.

* removes unused code

* some code updates

* bulk fixes

* further fixes

* outside things

* whoops.

* Maint bar ported

* GLOBs.
2017-04-13 23:37:00 -05:00

92 lines
3.8 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/atom/required_container = null // the container required for the reaction to happen
var/required_other = 0 // an integer required for the reaction to happen
var/secondary = 0 // set to nonzero if secondary reaction
var/mob_react = 0 //Determines if a chemical reaction can occur inside a mob
var/required_temp = 0
var/is_cold_recipe = 0 // Set to 1 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_faction = "chemicalsummon")
var/static/list/chemical_mob_spawn_meancritters = list() // list of possible hostile mobs
var/static/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs
if(holder && holder.my_atom)
if (chemical_mob_spawn_meancritters.len <= 0 || chemical_mob_spawn_nicecritters.len <= 0)
for (var/T in typesof(/mob/living/simple_animal))
var/mob/living/simple_animal/SA = T
switch(initial(SA.gold_core_spawnable))
if(1)
chemical_mob_spawn_meancritters += T
if(2)
chemical_mob_spawn_nicecritters += T
var/atom/A = holder.my_atom
var/turf/T = get_turf(A)
var/area/my_area = get_area(T)
var/message = "A [reaction_name] reaction has occurred in [my_area.name]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[T.x];Y=[T.y];Z=[T.z]'>JMP</A>)"
message += " (<A HREF='?_src_=vars;Vars=\ref[A]'>VV</A>)"
var/mob/M = get(A, /mob)
if(M)
message += " - Carried By: [key_name_admin(M)](<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[M]'>FLW</A>)"
else
message += " - Last Fingerprint: [(A.fingerprintslast ? A.fingerprintslast : "N/A")]"
message_admins(message, 0, 1)
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 = 1, i <= amount_to_spawn, i++)
var/chosen
if (reaction_name == "Friendly Gold Slime")
chosen = pick(chemical_mob_spawn_nicecritters)
else
chosen = pick(chemical_mob_spawn_meancritters)
var/spawnloc = get_turf(holder.my_atom)
var/mob/living/simple_animal/C = new chosen(spawnloc)
C.faction |= mob_faction
if(prob(50))
for(var/j = 1, j <= rand(1, 3), j++)
step(C, 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(istype(X, /obj/effect))
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(2)
if(!step_away(X, T))
break
else
for(var/i = 0, i < moving_power, i++)
sleep(2)
if(!step_towards(X, T))
break