Merge branch 'bleeding-edge-freeze' of https://github.com/Baystation12/Baystation12 into bleeding-edge-freeze

Conflicts:
	code/controllers/master_controller.dm
	code/modules/mob/new_player/sprite_accessories.dm
	code/modules/reagents/Chemistry-Reagents.dm
	code/setup.dm
	icons/mob/human_face.dmi

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-02-01 23:41:16 +10:00
235 changed files with 37105 additions and 26723 deletions

View File

@@ -24,12 +24,29 @@ datum
var/datum/reagent/D = new path()
chemical_reagents_list[D.id] = D
if(!chemical_reactions_list)
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list (without an index)
//Chemical Reactions - Initialises all /datum/chemical_reaction into a list
// It is filtered into multiple lists within a list.
// For example:
// chemical_reaction_list["plasma"] is a list of all reactions relating to plasma
var/paths = typesof(/datum/chemical_reaction) - /datum/chemical_reaction
chemical_reactions_list = list()
for(var/path in paths)
var/datum/chemical_reaction/D = new path()
chemical_reactions_list += D
var/list/reaction_ids = list()
if(D.required_reagents && D.required_reagents.len)
for(var/reaction in D.required_reagents)
reaction_ids += reaction
// Create filters based on each reagent id in the required reagents list
for(var/id in reaction_ids)
if(!chemical_reactions_list[id])
chemical_reactions_list[id] = list()
chemical_reactions_list[id] += D
break // Don't bother adding ourselves to other reagent ids, it is redundant.
proc
@@ -85,17 +102,20 @@ datum
var/part = amount / src.total_volume
var/trans_data = null
for (var/datum/reagent/current_reagent in src.reagent_list)
if (!current_reagent)
continue
var/current_reagent_transfer = current_reagent.volume * part
if(preserve_data)
trans_data = current_reagent.data
if((current_reagent.id == "blood" && !ishuman(target)) || current_reagent.id != "blood")
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
else if(current_reagent.id == "blood" && ishuman(target)) // can never be sure
if(current_reagent.id == "blood" && ishuman(target)) // can never be sure
var/mob/living/carbon/human/H = target
H.vessel.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
H.vessel.update_total()
else
R.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data)
src.remove_reagent(current_reagent.id, current_reagent_transfer)
src.update_total()
R.update_total()
R.handle_reactions()
@@ -203,84 +223,90 @@ datum
var/reaction_occured = 0
do
reaction_occured = 0
for(var/datum/chemical_reaction/C in chemical_reactions_list)
var/total_required_reagents = C.required_reagents.len
var/total_matching_reagents = 0
var/total_required_catalysts = C.required_catalysts.len
var/total_matching_catalysts= 0
var/matching_container = 0
var/matching_other = 0
var/list/multipliers = new/list()
for(var/datum/reagent/R in reagent_list) // Usually a small list
for(var/reaction in chemical_reactions_list[R.id]) // Was a big list but now it should be smaller since we filtered it with our reagent id
for(var/B in C.required_reagents)
if(!has_reagent(B, C.required_reagents[B])) break
total_matching_reagents++
multipliers += round(get_reagent_amount(B) / C.required_reagents[B])
for(var/B in C.required_catalysts)
if(!has_reagent(B, C.required_catalysts[B])) break
total_matching_catalysts++
if(!reaction)
continue
if(!C.required_container)
matching_container = 1
var/datum/chemical_reaction/C = reaction
var/total_required_reagents = C.required_reagents.len
var/total_matching_reagents = 0
var/total_required_catalysts = C.required_catalysts.len
var/total_matching_catalysts= 0
var/matching_container = 0
var/matching_other = 0
var/list/multipliers = new/list()
else
if(my_atom.type == C.required_container)
for(var/B in C.required_reagents)
if(!has_reagent(B, C.required_reagents[B])) break
total_matching_reagents++
multipliers += round(get_reagent_amount(B) / C.required_reagents[B])
for(var/B in C.required_catalysts)
if(!has_reagent(B, C.required_catalysts[B])) break
total_matching_catalysts++
if(!C.required_container)
matching_container = 1
if(!C.required_other)
matching_other = 1
else
if(my_atom.type == C.required_container)
matching_container = 1
else
/*if(istype(my_atom, /obj/item/slime_core))
var/obj/item/slime_core/M = my_atom
if(!C.required_other)
matching_other = 1
if(M.POWERFLAG == C.required_other && M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1*/
if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/M = my_atom
else
/*if(istype(my_atom, /obj/item/slime_core))
var/obj/item/slime_core/M = my_atom
if(M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1
if(M.POWERFLAG == C.required_other && M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1*/
if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/M = my_atom
if(M.Uses > 0) // added a limit to slime cores -- Muskets requested this
matching_other = 1
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other)
var/multiplier = min(multipliers)
for(var/B in C.required_reagents)
remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1)
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other)
var/multiplier = min(multipliers)
for(var/B in C.required_reagents)
remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1)
var/created_volume = C.result_amount*multiplier
if(C.result)
feedback_add_details("chemical_reaction","[C.result]|[C.result_amount*multiplier]")
multiplier = max(multiplier, 1) //this shouldnt happen ...
add_reagent(C.result, C.result_amount*multiplier)
var/created_volume = C.result_amount*multiplier
if(C.result)
feedback_add_details("chemical_reaction","[C.result]|[C.result_amount*multiplier]")
multiplier = max(multiplier, 1) //this shouldnt happen ...
add_reagent(C.result, C.result_amount*multiplier)
if(!isliving(my_atom))
for(var/mob/M in viewers(4, get_turf(my_atom)) )
var/list/seen = viewers(4, get_turf(my_atom))
for(var/mob/M in seen)
M << "\blue \icon[my_atom] The solution begins to bubble."
/* if(istype(my_atom, /obj/item/slime_core))
var/obj/item/slime_core/ME = my_atom
ME.Uses--
if(ME.Uses <= 0) // give the notification that the slime core is dead
for(var/mob/M in viewers(4, get_turf(my_atom)) )
M << "\blue \icon[my_atom] The innards begin to boil!"
*/
if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/ME2 = my_atom
ME2.Uses--
if(ME2.Uses <= 0) // give the notification that the slime core is dead
for(var/mob/M in viewers(4, get_turf(my_atom)) )
M << "\blue \icon[my_atom] The [my_atom]'s power is consumed in the reaction."
ME2.name = "used slime extract"
ME2.desc = "This extract has been used up."
/* if(istype(my_atom, /obj/item/slime_core))
var/obj/item/slime_core/ME = my_atom
ME.Uses--
if(ME.Uses <= 0) // give the notification that the slime core is dead
for(var/mob/M in viewers(4, get_turf(my_atom)) )
M << "\blue \icon[my_atom] The innards begin to boil!"
*/
if(istype(my_atom, /obj/item/slime_extract))
var/obj/item/slime_extract/ME2 = my_atom
ME2.Uses--
if(ME2.Uses <= 0) // give the notification that the slime core is dead
for(var/mob/M in seen)
M << "\blue \icon[my_atom] The [my_atom]'s power is consumed in the reaction."
ME2.name = "used slime extract"
ME2.desc = "This extract has been used up."
playsound(get_turf(my_atom), 'sound/effects/bubbles.ogg', 80, 1)
playsound(get_turf(my_atom), 'sound/effects/bubbles.ogg', 80, 1)
C.on_reaction(src, created_volume)
reaction_occured = 1
break
C.on_reaction(src, created_volume)
reaction_occured = 1
break
while(reaction_occured)
update_total()
@@ -426,17 +452,13 @@ datum
for(var/A in reagent_list)
var/datum/reagent/R = A
var/datum/compare = chemical_reagents_list[reagent]
if(istype(R,compare))
var/amt = max(0,min(R.volume,amount))
R.volume -= amt
amount -= amt
if(amount<=0)
update_total()
if(!safety)//So it does not handle reactions when it need not to
handle_reactions()
my_atom.on_reagent_change()
return 0
if (R.id == reagent)
R.volume -= amount
update_total()
if(!safety)//So it does not handle reactions when it need not to
handle_reactions()
my_atom.on_reagent_change()
return 0
return 1
@@ -444,8 +466,7 @@ datum
for(var/A in reagent_list)
var/datum/reagent/R = A
var/datum/compare = chemical_reagents_list[reagent]
if(istype(R,compare))
if (R.id == reagent)
if(!amount) return R
else
if(R.volume >= amount) return R
@@ -454,14 +475,12 @@ datum
return 0
get_reagent_amount(var/reagent)
var/amnt = 0
for(var/A in reagent_list)
var/datum/reagent/R = A
var/datum/compare = chemical_reagents_list[reagent]
if(istype(R,compare))
amnt += R.volume
if (R.id == reagent)
return R.volume
return amnt
return 0
get_reagents()
var/res = ""

File diff suppressed because it is too large Load Diff

View File

@@ -1013,7 +1013,8 @@ datum
/mob/living/simple_animal/hostile/syndicate/ranged,
/mob/living/simple_animal/hostile/syndicate/ranged/space,
/mob/living/simple_animal/hostile/alien/queen/large,
/mob/living/simple_animal/clown
/mob/living/simple_animal/hostile/retaliate,
/mob/living/simple_animal/hostile/retaliate/clown
)//exclusion list for things you don't want the reaction to create.
var/list/critters = typesof(/mob/living/simple_animal/hostile) - blocked // list of possible hostile mobs
@@ -1286,20 +1287,9 @@ datum
required_container = /obj/item/slime_extract/adamantine
required_other = 1
on_reaction(var/datum/reagents/holder)
var/mob/living/carbon/human/G = new /mob/living/carbon/human
G.dna.mutantrace = "adamantine"
G.real_name = text("Adamantine Golem ([rand(1, 1000)])")
G.equip_to_slot_or_del(new /obj/item/clothing/under/golem(G), slot_w_uniform)
G.equip_to_slot_or_del(new /obj/item/clothing/suit/golem(G), slot_wear_suit)
G.equip_to_slot_or_del(new /obj/item/clothing/shoes/golem(G), slot_shoes)
G.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/golem(G), slot_wear_mask)
G.equip_to_slot_or_del(new /obj/item/clothing/gloves/golem(G), slot_gloves)
G.loc = get_turf_loc(holder.my_atom)
var/list/candidates = get_alien_candidates()
var/candidate = pick(candidates)
G.key = candidate
G << "You are an adamantine golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. Serve the one created you, and assist them in completing their goals at any cost."
var/obj/effect/golemrune/Z = new /obj/effect/golemrune
Z.loc = get_turf_loc(holder.my_atom)
Z.announce_to_ghosts()
//////////////////////////////////////////FOOD MIXTURES////////////////////////////////////
tofu
@@ -1806,8 +1796,8 @@ datum
name = "Changeling Sting"
id = "changelingsting"
result = "changelingsting"
required_reagents = list("orangejuice" = 1, "limejuice" = 1, "lemonjuice" = 1, "vodka" = 1)
result_amount = 4
required_reagents = list("screwdrivercocktail" = 1, "limejuice" = 1, "lemonjuice" = 1)
result_amount = 5
aloe
name = "Aloe"

View File

@@ -1174,9 +1174,9 @@
bitesize = 5
/obj/item/weapon/reagent_containers/food/snacks/bloodsoup
name = "Meatball soup"
name = "Tomato soup"
desc = "Smells like copper"
icon_state = "meatballsoup"
icon_state = "tomatosoup"
New()
..()
reagents.add_reagent("nutriment", 2)

View File

@@ -26,10 +26,11 @@
/obj/machinery/bot/medbot,
/obj/machinery/computer/pandemic,
/obj/item/weapon/storage/secure/safe,
/obj/machinery/disposal,
/obj/machinery/iv_drip,
/obj/machinery/disease2/incubator
)
/obj/machinery/disease2/incubator,
/obj/machinery/disposal,
/mob/living/simple_animal/cow,
/mob/living/simple_animal/hostile/retaliate/goat )
examine()
set src in view()