Initial Commit

This commit is contained in:
Tobba
2016-03-06 20:52:14 +01:00
commit b181d0b552
4325 changed files with 579453 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
/////////////////////////////////////////////
// Bad smoke
/////////////////////////////////////////////
/obj/effects/bad_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effects/bad_smoke/Move()
..()
for(var/mob/living/carbon/M in get_turf(src))
if (M.internal != null && M.wear_mask && (M.wear_mask.c_flags & MASKINTERNALS))
else
M.drop_item()
if (prob(25))
M.stunned += 1
M.take_oxygen_deprivation(1)
M.emote("cough")
return
/obj/effects/bad_smoke/HasEntered(mob/living/carbon/M as mob )
..()
if(iscarbon(M))
if (M.internal != null && M.wear_mask && (M.wear_mask.c_flags & MASKINTERNALS))
return
else
M.drop_item()
if (prob(25))
M.stunned += 1
M.take_oxygen_deprivation(1)
M.emote("cough")
return
+54
View File
@@ -0,0 +1,54 @@
// fart cloud for toxic farts
/obj/effects/fart_cloud
name = "fart cloud"
icon_state = "mustard"
opacity = 1
anchored = 0
mouse_opacity = 0
var/amount = 6
var/mob/living/fartowner = null
proc/Life()
amount--
for(var/mob/living/carbon/human/H in range(get_turf(src),1))
if (H == src.fartowner)
continue
if (prob(20))
boutput(H, "<span style=\"color:red\">Oh god! The <i>smell</i>!!!</span>")
H.reagents.add_reagent("jenkem",0.1)
sleep(15)
if(amount < 1)
dispose()
return
else
src.Life()
/obj/effects/fart_cloud/New(loc,var/mob/living/owner)
..()
if (owner)
fartowner = owner
amount = rand(3,8)
spawn(0)
src.Life()
return
/obj/effects/fart_cloud/Move()
..()
for(var/mob/living/carbon/human/R in get_turf(src))
if (R.internal != null && usr.wear_mask && (R.wear_mask.c_flags & MASKINTERNALS))
continue
if (R == src.fartowner)
continue
R.reagents.add_reagent("jenkem",1)
return
/obj/effects/fart_cloud/HasEntered(mob/living/carbon/human/R as mob )
..()
if (istype(R, /mob/living/carbon/human))
if (R.internal != null && usr.wear_mask && (R.wear_mask.c_flags & MASKINTERNALS))
return
if (R == src.fartowner)
return
R.reagents.add_reagent("jenkem",1)
return
+169
View File
@@ -0,0 +1,169 @@
// Foam
// Similar to smoke, but spreads out more
// metal foams leave behind a foamed metal wall
/obj/effects/foam
name = "foam"
icon_state = "foam"
opacity = 0
anchored = 1
density = 0
layer = OBJ_LAYER + 0.9
mouse_opacity = 0
var/foamcolor
var/amount = 3
var/expand = 1
animate_movement = 0
var/metal = 0
/*
/obj/effects/foam/New(loc, var/ismetal=0)
..(loc)
*/
/obj/effects/foam/pooled()
..()
name = "foam"
icon_state = "foam"
opacity = 0
foamcolor = null
expand = 0
amount = 0
metal = 0
animate_movement = 0
if(reagents)
reagents.clear_reagents()
/obj/effects/foam/unpooled()
..()
amount = 3
expand = 1
/obj/effects/foam/proc/set_up(loc, var/ismetal)
src.set_loc(loc)
expand = 1
if(ismetal == 1)
icon_state = "mfoam"
else
icon_state = "foam"
if(reagents)
src.overlays.len = 0
icon_state = "foam"
src.foamcolor = src.reagents.get_master_color()
var/icon/I = new /icon('icons/effects/effects.dmi',"foam_overlay")
I.Blend(src.foamcolor, ICON_ADD)
src.overlays += I
metal = ismetal
playsound(src, "sound/effects/bubbles2.ogg", 80, 1, -3)
spawn(3 + metal*3)
process()
spawn(120)
expand = 0 // stop expanding
sleep(30)
if(metal)
var/obj/foamedmetal/M = new(src.loc)
M.metal = metal
M.updateicon()
if(metal)
flick("mfoam-disolve", src)
else
flick("foam-disolve", src)
sleep(5)
die()
return
// on delete, transfer any reagents to the floor & surrounding tiles
/obj/effects/foam/proc/die()
expand = 0
if(!metal && reagents)
reagents.handle_reactions()
for(var/atom/A in oview(1,src))
if(A == src)
continue
if(istype(A,/mob/living))
var/mob/living/L = A
logTheThing("combat", L, null, "is hit by chemical foam [log_reagents(src)] at [log_loc(src)].")
reagents.reaction(A, TOUCH, 5)
pool(src)
/obj/effects/foam/proc/process()
if(--amount < 0)
return
while(expand) // keep trying to expand while true
for(var/direction in cardinal)
var/turf/T = get_step(src,direction)
if(!T)
continue
if(!T.Enter(src))
continue
//if(istype(T, /turf/space))
// continue
var/obj/effects/foam/F = locate() in T
if(F)
continue
F = unpool(/obj/effects/foam)
F.set_up(T, metal)
F.amount = amount
if(!metal)
F.overlays.len = 0
F.create_reagents(15)
//This very slight tweak is to make it so some reactions that require different ratios
//can still work in foam.
for(var/reagent_id in src.reagents.reagent_list)
var/datum/reagent/current_reagent = src.reagents.reagent_list[reagent_id]
if(current_reagent)
F.reagents.add_reagent(reagent_id,min(current_reagent.volume, 3), current_reagent.data, src.reagents.total_temperature)
F.icon_state = "foam"
F.foamcolor = src.reagents.get_master_color()
var/icon/I = new /icon('icons/effects/effects.dmi',"foam_overlay")
I.Blend(F.foamcolor, ICON_ADD)
F.overlays += I
sleep(15)
// foam disolves when heated
// except metal foams
/obj/effects/foam/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(!metal && prob(max(0, exposed_temperature - 475)))
flick("foam-disolve", src)
spawn(5)
die()
expand = 0
/obj/effects/foam/HasEntered(var/atom/movable/AM)
if (metal)
return
if (ishuman(AM))
var/mob/living/carbon/human/M = AM
if (!M.can_slip())
return
for(var/reagent_id in src.reagents.reagent_list)
var/amount = M.reagents.get_reagent_amount(reagent_id)
if(amount < 25)
M.reagents.add_reagent(reagent_id, min(round(amount / 2),15))
logTheThing("combat", M, null, "is hit by chemical foam [log_reagents(src)] at [log_loc(src)].")
reagents.reaction(M, TOUCH, 5)
if(!istype(src.loc, /turf/space))
M.pulling = null
M.show_text("You slip on the foam!", "red")
playsound(src.loc, "sound/misc/slip.ogg", 50, 1, -3)
M.stunned = 2
M.weakened = 2
+36
View File
@@ -0,0 +1,36 @@
/obj/effects/harmless_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
pooled()
..()
/*
/obj/effects/harmless_smoke/New()
..()
spawn (100)
pool(src)
return
*/
/obj/effects/harmless_smoke/proc/kill(var/time)
spawn(time)
pool(src)
/obj/effects/harmless_smoke/Move()
..()
return
proc/harmless_smoke_puff(var/turf/location, var/duration = 100)
if(!istype(location)) return
var/obj/effects/harmless_smoke/smoke = unpool(/obj/effects/harmless_smoke)
smoke.set_loc(location)
smoke.kill(100)
+17
View File
@@ -0,0 +1,17 @@
/////////////////////////////////////////////
//////// Attach an Ion trail to any object, that spawns when it moves (like for the jetpack)
/// just pass in the object to attach it to in set_up
/// Then do start() to start it and stop() to stop it, obviously
/// and don't call start() in a loop that will be repeated otherwise it'll get spammed!
/////////////////////////////////////////////
/obj/effects/ion_trails
name = "ion trails"
icon_state = "ion_trails"
anchored = 1.0
/obj/effects/ion_trails/pooled(var/poolname)
icon_state = "blank"
pixel_x = 0
pixel_y = 0
..()
+44
View File
@@ -0,0 +1,44 @@
/////////////////////////////////////////////
// Mustard Gas
/////////////////////////////////////////////
/obj/effects/mustard_gas
name = "mustard gas"
icon_state = "mustard"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
/obj/effects/mustard_gas/New()
..()
spawn (100)
dispose()
return
/obj/effects/mustard_gas/Move()
..()
for(var/mob/living/carbon/human/R in get_turf(src))
if (R.internal != null && R.wear_mask && (R.wear_mask.c_flags & MASKINTERNALS))
else
R.TakeDamage("chest", 0, 10)
R.losebreath = max(5, R.losebreath)
R.emote("scream")
if (prob(25))
R.stunned += 1
R.updatehealth()
return
/obj/effects/mustard_gas/HasEntered(mob/living/carbon/human/R as mob )
..()
if (istype(R, /mob/living/carbon/human))
if (R.internal != null && R.wear_mask && (R.wear_mask.c_flags & MASKINTERNALS))
return
R.losebreath = max(5, R.losebreath)
R.TakeDamage("chest", 0, 10)
R.emote("scream")
if (prob(25))
R.stunned += 1
R.updatehealth()
return
+8
View File
@@ -0,0 +1,8 @@
/obj/effects/smoke
name = "smoke"
icon = 'icons/effects/water.dmi'
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 8.0
+35
View File
@@ -0,0 +1,35 @@
/////////////////////////////////////////////
//SPARK SYSTEM (like steam system)
// The attach(atom/atom) proc is optional, and can be called to attach the effect
// to something, like the RCD, so then you can just call start() and the sparks
// will always spawn at the items location.
/////////////////////////////////////////////
/obj/effects/sparks
name = "sparks"
icon_state = "sparks"
var/amount = 6.0
anchored = 1.0
mouse_opacity = 0
/obj/effects/sparks/unpooled(var/poolname)
..(poolname)
spawn(5)
playsound(src.loc, "sparks", 100, 1)
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(1000,100)
return
/obj/effects/sparks/disposing()
var/turf/T = get_turf(src)
if (istype(T, /turf))
T.hotspot_expose(1000,100)
..()
/obj/effects/sparks/Move()
..()
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(1000,100)
return
+8
View File
@@ -0,0 +1,8 @@
/obj/effects/spray
name = "spray"
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
flags = TABLEPASS
mouse_opacity = 0
anchored = 1
var/original_dir = NORTH
+5
View File
@@ -0,0 +1,5 @@
/obj/effects/steam
name = "steam"
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
density = 0
+52
View File
@@ -0,0 +1,52 @@
/obj/effects/water
name = "water"
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
var/life = 15.0
flags = TABLEPASS
mouse_opacity = 0
/obj/effects/water/pooled(var/poolname)
life = initial(life)
..()
/obj/effects/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
if (!disposed)
pool(src)
return 0
if(newloc.density)
if (!disposed)
pool(src)
return 0
.=..()
/obj/effects/water/proc/spray_at(var/turf/target, var/datum/reagents/R)
if (!target || !R)
pool(src)
return
src.reagents = R
R.my_atom = src
src.reagents.trans_to(src,1)
var/turf/T
for(var/b=0, b<5, b++)
T = get_turf(src)
step_towards(src,target)
if(!src.reagents)
break
src.reagents.reaction(T)
for(var/atom/atm in T)
src.reagents.reaction(atm)
if(src.loc == target)
break
sleep(2)
if (disposed)
break
if (!disposed)
pool(src)