Fixes stuff and stuff

This commit is contained in:
Crazylemon64
2016-03-28 23:03:17 -07:00
parent fa14522a1f
commit 00a39f5c83
7 changed files with 2529 additions and 287 deletions
+6 -1
View File
@@ -180,4 +180,9 @@
#define TURF_DRY 0
#define TURF_WET_WATER 1
#define TURF_WET_LUBE 2
#define TURF_WET_ICE 3
#define TURF_WET_ICE 3
// Metal foam states
// teehee no one will find these here
#define MFOAM_ALUMINUM 1
#define MFOAM_IRON 2
+94 -102
View File
@@ -929,9 +929,8 @@ steam.start() -- spawns the effect
if(istype(T, /turf/space))
T.ChangeTurf(/turf/simulated/floor/plating/metalfoam)
var/turf/simulated/floor/plating/metalfoam/MF = get_turf(src)
if(istype(MF))
MF.metal = metal
MF.update_icon()
MF.metal = metal
MF.update_icon()
var/obj/structure/foamedmetal/M = new(src.loc)
M.metal = metal
@@ -1002,53 +1001,48 @@ steam.start() -- spawns the effect
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
var/metal = 0 // 0=foam, 1=metalfoam, 2=ironfoam
/datum/effect/system/foam_spread/set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
amount = round(sqrt(amt / 3), 1)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
carried_reagents = list()
metal = metalfoam
set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
amount = round(sqrt(amt / 3), 1)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
carried_reagents = list()
metal = metalfoam
// bit of a hack here. Foam carries along any reagent also present in the glass it is mixed
// with (defaults to water if none is present). Rather than actually transfer the reagents,
// this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
// bit of a hack here. Foam carries along any reagent also present in the glass it is mixed
// with (defaults to water if none is present). Rather than actually transfer the reagents,
// this makes a list of the reagent ids and spawns 1 unit of that reagent when the foam disolves.
if(carry && !metal)
for(var/datum/reagent/R in carry.reagent_list)
carried_reagents += R.id
/datum/effect/system/foam_spread/start()
spawn(0)
var/obj/effect/effect/foam/F = locate() in location
if(F)
F.amount += amount
return
if(carry && !metal)
for(var/datum/reagent/R in carry.reagent_list)
carried_reagents += R.id
F = new(src.location, metal)
F.amount = amount
start()
spawn(0)
var/obj/effect/effect/foam/F = locate() in location
if(F)
F.amount += amount
return
if(!metal) // don't carry other chemicals if a metal foam
F.create_reagents(10)
F = new(src.location, metal)
F.amount = amount
if(!metal) // don't carry other chemicals if a metal foam
F.create_reagents(10)
if(carried_reagents)
for(var/id in carried_reagents)
F.reagents.add_reagent(id,1)
else
F.reagents.add_reagent("water", 1)
if(carried_reagents)
for(var/id in carried_reagents)
F.reagents.add_reagent(id,1)
else
F.reagents.add_reagent("water", 1)
// wall formed by metal foams
// dense and opaque, but easy to break
var/const/MFOAM_ALUMINUM = 1
var/const/MFOAM_IRON = 2
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
@@ -1060,85 +1054,83 @@ var/const/MFOAM_IRON = 2
desc = "A lightweight foamed metal wall."
var/metal = MFOAM_ALUMINUM
New()
..()
air_update_turf(1)
/obj/structure/foamedmetal/New()
..()
air_update_turf(1)
Destroy()
density = 0
air_update_turf(1)
return ..()
/obj/structure/foamedmetal/Destroy()
density = 0
air_update_turf(1)
return ..()
Move()
var/turf/T = loc
..()
move_update_air(T)
/obj/structure/foamedmetal/Move()
var/turf/T = loc
..()
move_update_air(T)
proc/updateicon()
if(metal == MFOAM_ALUMINUM)
icon_state = "metalfoam"
else
icon_state = "ironfoam"
/obj/structure/foamedmetal/proc/updateicon()
if(metal == MFOAM_ALUMINUM)
icon_state = "metalfoam"
else
icon_state = "ironfoam"
ex_act(severity)
/obj/structure/foamedmetal/ex_act(severity)
qdel(src)
/obj/structure/foamedmetal/blob_act()
qdel(src)
/obj/structure/foamedmetal/bullet_act()
if(metal==MFOAM_ALUMINUM || prob(50))
qdel(src)
blob_act()
/obj/structure/foamedmetal/attack_hand(var/mob/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if ((HULK in user.mutations) || (prob(75 - metal*25)))
user.visible_message("<span class='warning'>[user] smashes through \the [src].</span>", "<span class='notice'>You smash through \the [src].</span>")
qdel(src)
else
user << "<span class='notice'>You hit the metal foam but bounce off it.</span>"
bullet_act()
if(metal==1 || prob(50))
qdel(src)
attack_hand(var/mob/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if ((HULK in user.mutations) || (prob(75 - metal*25)))
user.visible_message("<span class='warning'>[user] smashes through \the [src].</span>", "<span class='notice'>You smash through \the [src].</span>")
qdel(src)
else
user << "\blue You hit the metal foam but bounce off it."
/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if (istype(I, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = I
G.affecting.loc = src.loc
user.visible_message("<span class='warning'>[G.assailant] smashes [G.affecting] through the foamed metal wall.</span>")
qdel(I)
qdel(src)
return
if(prob(I.force*20 - metal*25))
user.visible_message("<span class='warning'>[user] smashes through the foamed metal with \the [I].</span>", "<span class='notice'>You smash through the foamed metal with \the [I].</span>")
qdel(src)
else
user << "<span class='warning'>You hit the metal foam to no effect.</span>"
attackby(var/obj/item/I, var/mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if (istype(I, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = I
G.affecting.loc = src.loc
user.visible_message("<span class='warning'>[G.assailant] smashes [G.affecting] through the foamed metal wall.</span>")
qdel(I)
qdel(src)
return
if(prob(I.force*20 - metal*25))
user.visible_message("<span class='warning'>[user] smashes through the foamed metal with \the [I].</span>", "<span class='notice'>You smash through the foamed metal with \the [I].</span>")
qdel(src)
else
user << "\blue You hit the metal foam to no effect."
attack_animal(mob/living/simple_animal/M)
M.do_attack_animation(src)
if(M.melee_damage_upper == 0)
M.visible_message("<span class='notice'>[M] nudges \the [src].</span>")
else
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
M.visible_message("<span class='danger'>\The [M] [M.attacktext] [src]!</span>")
qdel(src)
attack_alien(mob/living/carbon/alien/humanoid/M)
M.visible_message("<span class='danger'>[M] tears apart \the [src]!</span>");
/obj/structure/foamedmetal/attack_animal(mob/living/simple_animal/M)
M.do_attack_animation(src)
if(M.melee_damage_upper == 0)
M.visible_message("<span class='notice'>[M] nudges \the [src].</span>")
else
if(M.attack_sound)
playsound(loc, M.attack_sound, 50, 1, 1)
M.visible_message("<span class='danger'>\The [M] [M.attacktext] [src]!</span>")
qdel(src)
CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(air_group) return 0
return !density
/obj/structure/foamedmetal/attack_alien(mob/living/carbon/alien/humanoid/M)
M.visible_message("<span class='danger'>[M] tears apart \the [src]!</span>");
qdel(src)
CanAtmosPass()
return !density
/obj/structure/foamedmetal/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(air_group) return 0
return !density
/obj/structure/foamedmetal/CanAtmosPass()
return !density
/datum/effect/system/reagents_explosion
var/amount // TNT equivalent
+1 -1
View File
@@ -253,7 +253,7 @@
/turf/simulated/floor/plating/metalfoam/attackby(var/obj/item/C, mob/user, params)
if(..())
return 1
else if(istype(C) && C.force)
if(istype(C) && C.force)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
var/smash_prob = max(0, C.force*17 - metal*25) // A crowbar will have a 60% chance of a breakthrough on alum, 35% on iron
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,207 +1,147 @@
/datum/chemical_reaction/
// foam and foam precursor
surfactant
name = "Foam surfactant"
id = "foam surfactant"
result = "fluorosurfactant"
required_reagents = list("fluorine" = 2, "carbon" = 2, "sacid" = 1)
result_amount = 5
mix_message = "A head of foam results from the mixture's constant fizzing."
/datum/chemical_reaction/surfactant
name = "Foam surfactant"
id = "foam surfactant"
result = "fluorosurfactant"
required_reagents = list("fluorine" = 2, "carbon" = 2, "sacid" = 1)
result_amount = 5
mix_message = "A head of foam results from the mixture's constant fizzing."
/datum/chemical_reaction/foam
name = "Foam"
id = "foam"
result = null
required_reagents = list("fluorosurfactant" = 1, "water" = 1)
result_amount = 2
/datum/chemical_reaction/foam/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
holder.my_atom.visible_message("<span class='warning'>The solution spews out foam!</span>")
var/datum/effect/system/foam_spread/s = new()
s.set_up(created_volume, location, holder, 0)
s.start()
holder.clear_reagents()
foam
name = "Foam"
id = "foam"
result = null
required_reagents = list("fluorosurfactant" = 1, "water" = 1)
result_amount = 2
/datum/chemical_reaction/metalfoam
name = "Metal Foam"
id = "metalfoam"
result = null
required_reagents = list("aluminum" = 3, "fluorosurfactant" = 1, "sacid" = 1)
result_amount = 5
on_reaction(var/datum/reagents/holder, var/created_volume)
/datum/chemical_reaction/metalfoam/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
holder.my_atom.visible_message("<span class='warning'>The solution spews out a metalic foam!</span>")
var/datum/effect/system/foam_spread/s = new()
s.set_up(created_volume, location, holder, MFOAM_ALUMINUM)
s.start()
var/location = get_turf(holder.my_atom)
for(var/mob/M in viewers(5, location))
M << "\red The solution violently bubbles!"
/datum/chemical_reaction/ironfoam
name = "Iron Foam"
id = "ironlfoam"
result = null
required_reagents = list("iron" = 3, "fluorosurfactant" = 1, "sacid" = 1)
result_amount = 5
location = get_turf(holder.my_atom)
/datum/chemical_reaction/ironfoam/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
for(var/mob/M in viewers(5, location))
M << "\red The solution spews out foam!"
holder.my_atom.visible_message("<span class='warning>The solution spews out a metalic foam!</span>")
//world << "Holder volume is [holder.total_volume]"
//for(var/datum/reagent/R in holder.reagent_list)
// world << "[R.name] = [R.volume]"
var/datum/effect/system/foam_spread/s = new()
s.set_up(created_volume, location, holder, MFOAM_IRON)
s.start()
var/datum/effect/system/foam_spread/s = new()
s.set_up(created_volume, location, holder, 0)
s.start()
holder.clear_reagents()
return
metalfoam
name = "Metal Foam"
id = "metalfoam"
result = null
required_reagents = list("aluminum" = 3, "fluorosurfactant" = 1, "sacid" = 1)
result_amount = 5
on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
for(var/mob/M in viewers(5, location))
M << "\red The solution spews out a metalic foam!"
var/datum/effect/system/foam_spread/s = new()
s.set_up(created_volume, location, holder, 1)
s.start()
return
ironfoam
name = "Iron Foam"
id = "ironlfoam"
result = null
required_reagents = list("iron" = 3, "fluorosurfactant" = 1, "sacid" = 1)
result_amount = 5
on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
for(var/mob/M in viewers(5, location))
M << "\red The solution spews out a metalic foam!"
var/datum/effect/system/foam_spread/s = new()
s.set_up(created_volume, location, holder, 2)
s.start()
return
// Synthesizing these three chemicals is pretty complex in real life, but fuck it, it's just a game!
ammonia
name = "Ammonia"
id = "ammonia"
result = "ammonia"
required_reagents = list("hydrogen" = 3, "nitrogen" = 1)
result_amount = 3
mix_message = "The mixture bubbles, emitting an acrid reek."
/datum/chemical_reaction/ammonia
name = "Ammonia"
id = "ammonia"
result = "ammonia"
required_reagents = list("hydrogen" = 3, "nitrogen" = 1)
result_amount = 3
mix_message = "The mixture bubbles, emitting an acrid reek."
diethylamine
name = "Diethylamine"
id = "diethylamine"
result = "diethylamine"
required_reagents = list ("ammonia" = 1, "ethanol" = 1)
result_amount = 2
min_temp = 374
mix_message = "A horrible smell pours forth from the mixture."
/datum/chemical_reaction/diethylamine
name = "Diethylamine"
id = "diethylamine"
result = "diethylamine"
required_reagents = list ("ammonia" = 1, "ethanol" = 1)
result_amount = 2
min_temp = 374
mix_message = "A horrible smell pours forth from the mixture."
space_cleaner
name = "Space cleaner"
id = "cleaner"
result = "cleaner"
required_reagents = list("ammonia" = 1, "water" = 1, "ethanol" = 1)
result_amount = 3
mix_message = "Ick, this stuff really stinks. Sure does make the container sparkle though!"
/datum/chemical_reaction/space_cleaner
name = "Space cleaner"
id = "cleaner"
result = "cleaner"
required_reagents = list("ammonia" = 1, "water" = 1, "ethanol" = 1)
result_amount = 3
mix_message = "Ick, this stuff really stinks. Sure does make the container sparkle though!"
sulfuric_acid
name = "Sulfuric Acid"
id = "sacid"
result = "sacid"
required_reagents = list("sulfur" = 1, "oxygen" = 1, "hydrogen" = 1)
result_amount = 2
mix_message = "The mixture gives off a sharp acidic tang."
/datum/chemical_reaction/sulfuric_acid
name = "Sulfuric Acid"
id = "sacid"
result = "sacid"
required_reagents = list("sulfur" = 1, "oxygen" = 1, "hydrogen" = 1)
result_amount = 2
mix_message = "The mixture gives off a sharp acidic tang."
///////Changeling Blood Test/////////////
/*
changeling_test
name = "Changeling blood test"
id = "changelingblood"
result = "blood"
required_reagents = list("blood" = 5)
required_catalysts = list("fuel")
result_amount = 1 //Needs this in order to check the donor, as the data var in the reacted blood gets transferred.
on_reaction(var/datum/reagents/holder, var/created_volume)
if(!holder.reagent_list) //reagent_list is not null
return
var/datum/reagent/blood/B = locate() in holder.reagent_list
if(!B) //B is not null
return
var/mob/living/carbon/human/H = B.data["donor"]
if(!H) //H is not null.
return
if(H.mind && H.mind.changeling) //Checks if H, the blood donor is a ling.
for(var/mob/M in viewers(get_turf(holder.my_atom), null))
M.show_message( "<span class='danger'>The blood writhes and wriggles and sizzles away from the container!</span>", 1, "<span class='warning'>You hear bubbling and sizzling.</span>", 2)
else
for(var/mob/M in viewers(get_turf(holder.my_atom), null))
M.show_message( "<span class ='notice'>The blood seems to break apart in the fuel.</span>", 1)
holder.del_reagent("blood")
return
*/
/datum/chemical_reaction/plastication
name = "Plastic"
id = "solidplastic"
result = null
required_reagents = list("facid" = 10, "plasticide" = 20)
result_amount = 1
plastication
name = "Plastic"
id = "solidplastic"
result = null
required_reagents = list("facid" = 10, "plasticide" = 20)
result_amount = 1
on_reaction(var/datum/reagents/holder)
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/mineral/plastic
M.amount = 10
M.loc = get_turf(holder.my_atom)
return
/datum/chemical_reaction/plastication/on_reaction(var/datum/reagents/holder)
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/mineral/plastic
M.amount = 10
M.forceMove(get_turf(holder.my_atom))
/datum/chemical_reaction/space_drugs
name = "Space Drugs"
id = "space_drugs"
result = "space_drugs"
required_reagents = list("mercury" = 1, "sugar" = 1, "lithium" = 1)
result_amount = 3
mix_message = "Slightly dizzying fumes drift from the solution."
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
//Not really misc chems, but not enough to deserve their own file
/*
silicate
name = "Silicate"
id = "silicate"
result = "silicate"
required_reagents = list("aluminum" = 1, "silicon" = 1, "oxygen" = 1)
result_amount = 3
*/
/datum/chemical_reaction/lube
name = "Space Lube"
id = "lube"
result = "lube"
required_reagents = list("water" = 1, "silicon" = 1, "oxygen" = 1)
result_amount = 3
mix_message = "The substance turns a striking cyan and becomes oily."
space_drugs
name = "Space Drugs"
id = "space_drugs"
result = "space_drugs"
required_reagents = list("mercury" = 1, "sugar" = 1, "lithium" = 1)
result_amount = 3
mix_message = "Slightly dizzying fumes drift from the solution."
mix_sound = 'sound/goonstation/misc/drinkfizz.ogg'
/datum/chemical_reaction/holy_water
name = "Holy Water"
id = "holywater"
result = "holywater"
required_reagents = list("water" = 1, "mercury" = 1, "wine" = 1)
result_amount = 3
mix_message = "The water somehow seems purified. Or maybe defiled."
lube
name = "Space Lube"
id = "lube"
result = "lube"
required_reagents = list("water" = 1, "silicon" = 1, "oxygen" = 1)
result_amount = 3
mix_message = "The substance turns a striking cyan and becomes oily."
/datum/chemical_reaction/lsd
name = "Lysergic acid diethylamide"
id = "lsd"
result = "lsd"
required_reagents = list("diethylamine" = 1, "fungus" = 1)
result_amount = 3
mix_message = "The mixture turns a rather unassuming color and settles."
holy_water
name = "Holy Water"
id = "holywater"
result = "holywater"
required_reagents = list("water" = 1, "mercury" = 1, "wine" = 1)
result_amount = 3
mix_message = "The water somehow seems purified. Or maybe defiled."
lsd
name = "Lysergic acid diethylamide"
id = "lsd"
result = "lsd"
required_reagents = list("diethylamine" = 1, "fungus" = 1)
result_amount = 3
mix_message = "The mixture turns a rather unassuming color and settles."
drying_agent
name = "Drying agent"
id = "drying_agent"
result = "drying_agent"
required_reagents = list("plasma" = 2, "ethanol" = 1, "sodium" = 1)
result_amount = 3
/datum/chemical_reaction/drying_agent
name = "Drying agent"
id = "drying_agent"
result = "drying_agent"
required_reagents = list("plasma" = 2, "ethanol" = 1, "sodium" = 1)
result_amount = 3