mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 15:01:04 +01:00
Chemistry commit
I messed something in the git
This commit is contained in:
@@ -13,36 +13,12 @@ would spawn and follow the beaker, even if it is carried or thrown.
|
||||
unacidable = 1//So effect are not targeted by alien acid.
|
||||
pass_flags = PASSTABLE | PASSGRILLE
|
||||
|
||||
/obj/effect/effect/water
|
||||
name = "water"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "extinguish"
|
||||
var/life = 15.0
|
||||
mouse_opacity = 0
|
||||
|
||||
/obj/effect/proc/delete()
|
||||
loc = null
|
||||
if(reagents)
|
||||
reagents.delete()
|
||||
return
|
||||
|
||||
/obj/effect/effect/water/Move(turf/newloc)
|
||||
//var/turf/T = src.loc
|
||||
//if (istype(T, /turf))
|
||||
// T.firelevel = 0 //TODO: FIX
|
||||
if (--src.life < 1)
|
||||
//SN src = null
|
||||
delete()
|
||||
if(newloc.density)
|
||||
return 0
|
||||
.=..()
|
||||
|
||||
/obj/effect/effect/water/Bump(atom/A)
|
||||
if(reagents)
|
||||
reagents.reaction(A)
|
||||
return ..()
|
||||
|
||||
|
||||
/datum/effect/effect/system
|
||||
var/number = 3
|
||||
var/cardinals = 0
|
||||
@@ -482,227 +458,6 @@ steam.start() -- spawns the effect
|
||||
src.processing = 0
|
||||
src.on = 0
|
||||
|
||||
|
||||
|
||||
// Foam
|
||||
// Similar to smoke, but spreads out more
|
||||
// metal foams leave behind a foamed metal wall
|
||||
|
||||
/obj/effect/effect/foam
|
||||
name = "foam"
|
||||
icon_state = "foam"
|
||||
opacity = 0
|
||||
anchored = 1
|
||||
density = 0
|
||||
layer = OBJ_LAYER + 0.9
|
||||
mouse_opacity = 0
|
||||
var/amount = 3
|
||||
var/expand = 1
|
||||
animate_movement = 0
|
||||
var/metal = 0
|
||||
|
||||
|
||||
/obj/effect/effect/foam/New(loc, var/ismetal=0)
|
||||
..(loc)
|
||||
icon_state = "[ismetal ? "m":""]foam"
|
||||
metal = ismetal
|
||||
playsound(src, 'sound/effects/bubbles2.ogg', 80, 1, -3)
|
||||
spawn(3 + metal*3)
|
||||
process()
|
||||
checkReagents()
|
||||
spawn(120)
|
||||
processing_objects.Remove(src)
|
||||
sleep(30)
|
||||
|
||||
if(metal)
|
||||
var/obj/structure/foamedmetal/M = new(src.loc)
|
||||
M.metal = metal
|
||||
M.updateicon()
|
||||
|
||||
flick("[icon_state]-disolve", src)
|
||||
sleep(5)
|
||||
delete()
|
||||
return
|
||||
|
||||
// transfer any reagents to the floor
|
||||
/obj/effect/effect/foam/proc/checkReagents()
|
||||
if(!metal && reagents)
|
||||
for(var/atom/A in src.loc.contents)
|
||||
if(A == src)
|
||||
continue
|
||||
reagents.reaction(A, 1, 1)
|
||||
|
||||
/obj/effect/effect/foam/process()
|
||||
if(--amount < 0)
|
||||
return
|
||||
|
||||
|
||||
for(var/direction in cardinal)
|
||||
|
||||
|
||||
var/turf/T = get_step(src,direction)
|
||||
if(!T)
|
||||
continue
|
||||
|
||||
if(!T.Enter(src))
|
||||
continue
|
||||
|
||||
var/obj/effect/effect/foam/F = locate() in T
|
||||
if(F)
|
||||
continue
|
||||
|
||||
F = new(T, metal)
|
||||
F.amount = amount
|
||||
if(!metal)
|
||||
F.create_reagents(10)
|
||||
if (reagents)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
F.reagents.add_reagent(R.id, 1, safety = 1) //added safety check since reagents in the foam have already had a chance to react
|
||||
|
||||
// foam disolves when heated
|
||||
// except metal foams
|
||||
/obj/effect/effect/foam/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(!metal && prob(max(0, exposed_temperature - 475)))
|
||||
flick("[icon_state]-disolve", src)
|
||||
|
||||
spawn(5)
|
||||
delete()
|
||||
|
||||
|
||||
/obj/effect/effect/foam/Crossed(var/atom/movable/AM)
|
||||
if(metal)
|
||||
return
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/M = AM
|
||||
M.slip("the foam",6)
|
||||
|
||||
/datum/effect/effect/system/foam_spread
|
||||
var/amount = 5 // the size of the foam spread.
|
||||
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
|
||||
var/metal = 0 // 0=foam, 1=metalfoam, 2=ironfoam
|
||||
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
if(carry && !metal)
|
||||
for(var/datum/reagent/R in carry.reagent_list)
|
||||
carried_reagents += R.id
|
||||
|
||||
start()
|
||||
spawn(0)
|
||||
var/obj/effect/effect/foam/F = locate() in location
|
||||
if(F)
|
||||
F.amount += amount
|
||||
return
|
||||
|
||||
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, null, 1) //makes a safety call because all reagents should have already reacted anyway
|
||||
else
|
||||
F.reagents.add_reagent("water", 1, safety = 1)
|
||||
|
||||
// wall formed by metal foams
|
||||
// dense and opaque, but easy to break
|
||||
|
||||
/obj/structure/foamedmetal
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "metalfoam"
|
||||
density = 1
|
||||
opacity = 1 // changed in New()
|
||||
anchored = 1
|
||||
name = "foamed metal"
|
||||
desc = "A lightweight foamed metal wall."
|
||||
var/metal = 1 // 1=aluminum, 2=iron
|
||||
|
||||
New()
|
||||
..()
|
||||
update_nearby_tiles(1)
|
||||
|
||||
|
||||
|
||||
Del()
|
||||
|
||||
density = 0
|
||||
update_nearby_tiles(1)
|
||||
..()
|
||||
|
||||
proc/updateicon()
|
||||
if(metal == 1)
|
||||
icon_state = "metalfoam"
|
||||
else
|
||||
icon_state = "ironfoam"
|
||||
|
||||
|
||||
ex_act(severity)
|
||||
del(src)
|
||||
|
||||
blob_act()
|
||||
del(src)
|
||||
|
||||
bullet_act()
|
||||
if(metal==1 || prob(50))
|
||||
del(src)
|
||||
|
||||
attack_hand(var/mob/user)
|
||||
if ((HULK in user.mutations) || (prob(75 - metal*25)))
|
||||
user << "\blue You smash through the metal foam wall."
|
||||
for(var/mob/O in oviewers(user))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [user] smashes through the foamed metal."
|
||||
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You hit the metal foam but bounce off it."
|
||||
return
|
||||
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
|
||||
if (istype(I, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = I
|
||||
G.affecting.loc = src.loc
|
||||
for(var/mob/O in viewers(src))
|
||||
if (O.client)
|
||||
O << "\red [G.assailant] smashes [G.affecting] through the foamed metal wall."
|
||||
del(I)
|
||||
del(src)
|
||||
return
|
||||
|
||||
if(prob(I.force*20 - metal*25))
|
||||
user << "\blue You smash through the foamed metal with \the [I]."
|
||||
for(var/mob/O in oviewers(user))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << "\red [user] smashes through the foamed metal."
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You hit the metal foam to no effect."
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)
|
||||
if(air_group) return 0
|
||||
return !density
|
||||
|
||||
/datum/effect/effect/system/reagents_explosion
|
||||
var/amount // TNT equivalent
|
||||
var/flashing = 0 // does explosion creates flash effect?
|
||||
|
||||
Reference in New Issue
Block a user