Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into STILLALOTOFBLOOD

This commit is contained in:
Aurorablade
2015-07-02 15:57:16 -04:00
48 changed files with 436 additions and 885 deletions
+1
View File
@@ -43,6 +43,7 @@ proc/createRandomZlevel()
// Initialize air for the away mission's turfs
if(air_master)
air_master.setup_allturfs(block(locate(1, 1, world.maxz), locate(world.maxx, world.maxy, world.maxz)))
create_lighting_overlays(world.maxz)
world.log << "away mission loaded: [map]"
for(var/obj/effect/landmark/L in landmarks_list)
+4 -2
View File
@@ -18,7 +18,8 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set
"vampire" = IS_MODE_COMPILED("vampire"), // 2048 / 12
"mutineer" = IS_MODE_COMPILED("mutiny"), // 4096 / 13
"blob" = IS_MODE_COMPILED("blob"), // 8192 / 14
"shadowling" = IS_MODE_COMPILED("shadowling") //16384 / 15
"shadowling" = IS_MODE_COMPILED("shadowling"), //16384 / 15
"Revenant" = 1 //32768 / 16
)
var/global/list/special_role_times = list( //minimum age (in days) for accounts to play these roles
num2text(BE_PAI) = 0,
@@ -35,7 +36,8 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
num2text(BE_ALIEN) = 21,
num2text(BE_NINJA) = 21,
num2text(BE_MUTINEER) = 21,
num2text(BE_MALF) = 30
num2text(BE_MALF) = 30,
num2text(BE_REVENANT) = 7
)
/proc/player_old_enough_antag(client/C, role)
+1 -1
View File
@@ -3,7 +3,7 @@ var/list/dreams = list(
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
"voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness",
"light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun",
"a hat","the Luna","a ruined station","a planet","phoron","air","the medical bay","the bridge","blinking lights",
"a hat","the Luna","a ruined station","a planet","plasma","air","the medical bay","the bridge","blinking lights",
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying","the eggs","money",
"the head of personnel","the head of security","a chief engineer","a research director","a chief medical officer",
+18 -18
View File
@@ -29,7 +29,7 @@
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
qdel(src)
return
seed = plant_controller.seeds[plantname]
@@ -80,7 +80,7 @@
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
qdel(src)
return
if(plant_controller.product_descs["[seed.uid]"])
@@ -178,7 +178,7 @@
M.Weaken(5)
seed.thrown_at(src,M)
sleep(-1)
if(src) del(src)
if(src) qdel(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom)
@@ -198,7 +198,7 @@
user.put_in_hands(pocell)
pocell.maxcharge = src.potency * 10
pocell.charge = pocell.maxcharge
del(src)
qdel(src)
return
else if(W.sharp)
var/reagents_per_slice
@@ -206,21 +206,21 @@
if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful.
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
new /obj/item/clothing/head/hardhat/pumpkinhead (user.loc)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "potato")
user << "You slice \the [src] into sticks."
reagents_per_slice = reagents.total_volume
slice = new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "carrot")
user << "You slice \the [src] into sticks."
reagents_per_slice = reagents.total_volume
slice = new /obj/item/weapon/reagent_containers/food/snacks/carrotfries(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "watermelon")
user << "You slice \the [src] into large slices."
@@ -228,14 +228,14 @@
for(var/i=0,i<5,i++)
slice = new /obj/item/weapon/reagent_containers/food/snacks/watermelonslice(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "soybeans")
user << "You roughly chop up \the [src]."
reagents_per_slice = reagents.total_volume
slice = new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.chems)
if(istype(W,/obj/item/weapon/hatchet) && !isnull(seed.chems["woodpulp"]))
@@ -250,7 +250,7 @@
continue
G.attackby(NG, user)
user << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks."
del(src)
qdel(src)
return
else if(istype(W, /obj/item/weapon/rollingpaper))
if(seed.kitchen_tag == "ambrosia" || seed.kitchen_tag == "ambrosiadeus" || seed.kitchen_tag == "tobacco" || seed.kitchen_tag == "stobacco")
@@ -259,22 +259,22 @@
var/obj/item/clothing/mask/cigarette/joint/J = new /obj/item/clothing/mask/cigarette/joint(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
qdel(W)
user.put_in_active_hand(J)
else if(seed.kitchen_tag == "ambrosiadeus")
var/obj/item/clothing/mask/cigarette/joint/deus/J = new /obj/item/clothing/mask/cigarette/joint/deus(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
qdel(W)
user.put_in_active_hand(J)
else if(seed.kitchen_tag == "tobacco" || seed.kitchen_tag == "stobacco")
var/obj/item/clothing/mask/cigarette/handroll/J = new /obj/item/clothing/mask/cigarette/handroll(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
qdel(W)
user.put_in_active_hand(J)
user << "\blue You roll the [src] into a rolling paper."
del(src)
qdel(src)
else
user << "\red You can't roll a smokable from the [src]."
@@ -333,7 +333,7 @@
if(user)
user << "<span class='danger'>\The [src] has fallen to bits.</span>"
//user.drop_from_inventory(src)
del(src)
qdel(src)
add_fingerprint(user)
return 1
@@ -353,7 +353,7 @@
user.visible_message("<span class='danger'>\The [user] squashes \the [src]!</span>")
seed.thrown_at(src,user)
sleep(-1)
if(src) del(src)
if(src) qdel(src)
return
if(seed.kitchen_tag == "grass")
@@ -368,14 +368,14 @@
continue
NG.attackby(G, user)
user << "You add the newly-formed grass to the stack. It now contains [G.amount] tiles."
del(src)
qdel(src)
return
if(seed.get_trait(TRAIT_SPREAD) > 0)
user << "<span class='notice'>You plant the [src.name].</span>"
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed)
new /obj/effect/plant(get_turf(user), src.seed)
del(src)
qdel(src)
return
/*
+1 -1
View File
@@ -71,7 +71,7 @@
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/kitchenknife/ritual))
user << "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>"
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
del(src)
qdel(src)
return
/obj/item/weapon/bananapeel
+3 -3
View File
@@ -103,7 +103,7 @@
if(!istype(target))
if(istype(target, /mob/living/simple_animal/mouse) || istype(target, /mob/living/simple_animal/lizard))
new /obj/effect/decal/cleanable/blood/splatter(get_turf(target))
del(target)
qdel(target)
return
@@ -228,7 +228,7 @@
apply_special_effect(M)
splatter(T,thrown)
origin_turf.visible_message("<span class='danger'>The [thrown.name] explodes!</span>")
del(thrown)
qdel(thrown)
return
if(istype(target,/mob/living))
@@ -241,7 +241,7 @@
if(get_trait(TRAIT_JUICY) && splatted)
splatter(origin_turf,thrown)
origin_turf.visible_message("<span class='danger'>The [thrown.name] splatters against [target]!</span>")
del(thrown)
qdel(thrown)
/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/obj/item/weapon/tank/holding, var/check_only)
+2 -2
View File
@@ -37,7 +37,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
/datum/controller/plants/New()
if(plant_controller && plant_controller != src)
log_debug("Rebuilding plant controller.")
del(plant_controller)
qdel(plant_controller)
plant_controller = src
setup()
process()
@@ -136,7 +136,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
break
var/obj/effect/plant/plant = pick(plant_queue)
plant_queue -= plant
if(!istype(plant))
if(!istype(plant) || !isnull(plant.gcDestroyed))
continue
plant.process()
processed++
+1 -1
View File
@@ -224,7 +224,7 @@
genetics = seed.seed
degradation = 0
del(seed)
qdel(seed)
seed = null
if(href_list["get_gene"])
+4 -4
View File
@@ -188,16 +188,16 @@
N.seeds -= O
if (N.amount <= 0 || N.seeds.len <= 0)
piles -= N
del(N)
qdel(N)
O.loc = src.loc
else
piles -= N
del(N)
qdel(N)
else if (task == "purge")
for (var/obj/O in N.seeds)
del(O)
qdel(O)
piles -= N
del(N)
qdel(N)
break
updateUsrDialog()
@@ -32,13 +32,13 @@
color = DEAD_PLANT_COLOUR
/obj/effect/dead_plant/attack_hand()
del(src)
qdel(src)
/obj/effect/dead_plant/attackby()
..()
for(var/obj/effect/plant/neighbor in range(1))
neighbor.update_neighbors()
del(src)
qdel(src)
/obj/effect/plant
name = "plant"
@@ -70,12 +70,12 @@
var/mob/living/buckled_mob = null
var/movable = 0
/obj/effect/plant/Del()
/obj/effect/plant/Destroy()
if(plant_controller)
plant_controller.remove_plant(src)
for(var/obj/effect/plant/neighbor in range(1,src))
plant_controller.add_plant(neighbor)
..()
return ..()
/obj/effect/plant/single
spread_chance = 0
@@ -91,14 +91,14 @@
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
qdel(src)
return
if(!istype(newseed))
newseed = plant_controller.seeds[DEFAULT_SEED]
seed = newseed
if(!seed)
del(src)
qdel(src)
return
name = seed.display_name
@@ -104,6 +104,6 @@
for(var/obj/effect/plant/neighbor in check_turf.contents)
neighbor.neighbors |= check_turf
plant_controller.add_plant(neighbor)
spawn(1) if(src) del(src)
spawn(1) if(src) qdel(src)
#undef NEIGHBOR_REFRESH_TIME
+6 -6
View File
@@ -574,7 +574,7 @@
weedlevel -= P.weed_kill_str
user << "You spray [src] with [O]."
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
del(O)
qdel(O)
check_level_sanity()
update_icon()
@@ -587,7 +587,7 @@
weedlevel -= W.weed_kill_str
user << "You spray [src] with [O]."
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
del(O)
qdel(O)
check_level_sanity()
update_icon()
@@ -682,7 +682,7 @@
if(!S.seed)
user << "The packet seems to be empty. You throw it away."
del(O)
qdel(O)
return
user << "You plant the [S.seed.seed_name] [S.seed.seed_noun]."
@@ -693,7 +693,7 @@
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
lastcycle = world.time
del(O)
qdel(O)
check_health()
@@ -735,13 +735,13 @@
user << "<span class='danger'>[src] is already occupied!</span>"
else
user.drop_item()
del(O)
qdel(O)
var/obj/machinery/apiary/A = new(src.loc)
A.icon = src.icon
A.icon_state = src.icon_state
A.hydrotray_type = src.type
del(src)
qdel(src)
else if ((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
if (src.holding)
user << "\blue There is alreadu a tank loaded into the [src]."
@@ -51,7 +51,7 @@
health = 10
nutrilevel += 10
user.drop_item()
del(O)
qdel(O)
user << "\blue You carefully insert the queen into [src], she gets busy making a hive."
bees_in_hive = 0
else if(istype(O, /obj/item/beezeez))
@@ -62,7 +62,7 @@
user << "\blue You insert [O] into [src]. A relaxed humming appears to pick up."
else
user << "\blue You insert [O] into [src]. Now it just needs some bees."
del(O)
qdel(O)
else if(istype(O, /obj/item/weapon/minihoe))
if(health > 0)
user << "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>"
@@ -73,7 +73,7 @@
new hydrotray_type(src.loc)
new /obj/item/apiary(src.loc)
user << "\red You dislodge the apiary from the tray."
del(src)
qdel(src)
else if(istype(O, /obj/item/weapon/bee_net))
var/obj/item/weapon/bee_net/N = O
if(N.caught_bees > 0)
@@ -115,11 +115,11 @@
if(swarming <= 0)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
del(B)
qdel(B)
else if(bees_in_hive < 10)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
del(B)
qdel(B)
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
@@ -199,7 +199,7 @@
B.target_turf = get_turf(src)
B.strength -= 1
if(B.strength <= 0)
del(B)
qdel(B)
else if(B.strength <= 5)
B.icon_state = "bees[B.strength]"
bees_in_hive = 0
+6 -6
View File
@@ -44,27 +44,27 @@
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/remove_dead()
..()
del(src)
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
..()
if(!seed) // Repeat harvests are a thing.
del(src)
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die()
del(src)
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process()
if(!seed)
del(src)
qdel(src)
return
else if(name=="plant")
name = seed.display_name
..()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Del()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Destroy()
// Check if we're masking a decal that needs to be visible again.
for(var/obj/effect/plant/plant in get_turf(src))
if(plant.invisibility == INVISIBILITY_MAXIMUM)
plant.invisibility = initial(plant.invisibility)
..()
return ..()
+4 -4
View File
@@ -37,7 +37,7 @@ Rare minerals:
diamond
Deep minerals:
phoron
plasma
xerxium (adamantine)
fulgurium (mythril)
*/
@@ -178,7 +178,7 @@ Deep minerals:
target_turf.resources["silver"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
target_turf.resources["uranium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
target_turf.resources["diamond"] = 0
target_turf.resources["phoron"] = 0
target_turf.resources["plasma"] = 0
target_turf.resources["osmium"] = 0
target_turf.resources["hydrogen"] = 0
if(100 to 124)
@@ -187,7 +187,7 @@ Deep minerals:
target_turf.resources["silver"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
target_turf.resources["uranium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
target_turf.resources["diamond"] = 0
target_turf.resources["phoron"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
target_turf.resources["plasma"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
target_turf.resources["osmium"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
target_turf.resources["hydrogen"] = 0
if(125 to 255)
@@ -196,7 +196,7 @@ Deep minerals:
target_turf.resources["silver"] = 0
target_turf.resources["uranium"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
target_turf.resources["diamond"] = rand(RESOURCE_LOW_MIN,RESOURCE_LOW_MAX)
target_turf.resources["phoron"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
target_turf.resources["plasma"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
target_turf.resources["osmium"] = rand(RESOURCE_HIGH_MIN,RESOURCE_HIGH_MAX)
target_turf.resources["hydrogen"] = rand(RESOURCE_MID_MIN,RESOURCE_MID_MAX)
+1 -1
View File
@@ -22,7 +22,7 @@
"gold" = /obj/item/weapon/ore/gold,
"silver" = /obj/item/weapon/ore/silver,
"diamond" = /obj/item/weapon/ore/diamond,
"phoron" = /obj/item/weapon/ore/plasma,
"plasma" = /obj/item/weapon/ore/plasma,
"osmium" = /obj/item/weapon/ore/osmium,
"hydrogen" = /obj/item/weapon/ore/hydrogen,
"silicates" = /obj/item/weapon/ore/glass,
+1 -1
View File
@@ -36,7 +36,7 @@
if("silicates" || "carbonaceous rock" || "iron") ore_type = "surface minerals"
if("gold" || "silver" || "diamond") ore_type = "precious metals"
if("uranium") ore_type = "nuclear fuel"
if("phoron" || "osmium" || "hydrogen") ore_type = "exotic matter"
if("plasma" || "osmium" || "hydrogen") ore_type = "exotic matter"
if(ore_type) metals[ore_type] += T.resources[metal]
+1 -1
View File
@@ -99,7 +99,7 @@
/obj/machinery/mineral/processing_unit
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable phoron...
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable plasma...
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "furnace"
density = 1
+18 -1
View File
@@ -24,7 +24,7 @@
mob_container.forceMove(get_turf(src))
M.reset_view()
del(src)
qdel(src)
/obj/item/weapon/holder/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
for(var/mob/M in src.contents)
@@ -34,6 +34,23 @@
for(var/mob/living/M in contents)
M.show_message(message,m_type)
//Mob procs and vars for scooping up
/mob/living/var/holder_type
/mob/living/proc/get_scooped(var/mob/living/carbon/grabber)
if(!holder_type) return
var/obj/item/weapon/holder/H = new holder_type(loc)
src.forceMove(H)
H.name = name
if(desc) H.desc = desc
H.attack_hand(grabber)
grabber << "<span class='notice'>You scoop up \the [src]."
src << "<span class='notice'>\The [grabber] scoops you up.</span>"
grabber.status_flags |= PASSEMOTES
return
//Mob specific holders.
/obj/item/weapon/holder/diona
@@ -108,6 +108,6 @@
/datum/species/nucleation/handle_death(var/mob/living/carbon/human/H)
var/turf/T = get_turf(H)
H.visible_message("\red[H]'s body explodes, leaving behind a pile of microscopic crystals!")
supermatter_delamination(T, 2, 0, 0) // Create a small supermatter burst upon death
new /obj/item/weapon/shard/supermatter( T )
explosion(T, 0, 0, 2, 2) // Create a small explosion burst upon death
// new /obj/item/weapon/shard/supermatter( T )
del(H)
@@ -13,6 +13,7 @@
var/ready_evolve = 0
ventcrawler = 1
var/environment_smash = 0 // This is a sloppy way to solve attack_animal runtimes. Stupid nymphs...
holder_type = /obj/item/weapon/holder/diona
/mob/living/carbon/primitive/diona/New()
@@ -30,16 +31,9 @@
src << "You feel your being twine with that of [M] as you merge with its biomass."
src.verbs += /mob/living/carbon/primitive/diona/proc/split
src.verbs -= /mob/living/carbon/primitive/diona/proc/merge
src.loc = M
src.forceMove(M)
else
var/obj/item/weapon/holder/diona/D = new(loc)
src.loc = D
D.name = loc.name
D.attack_hand(M)
M << "You scoop up [src]."
src << "[M] scoops you up."
M.status_flags |= PASSEMOTES
return
get_scooped(M)
..()
@@ -25,6 +25,8 @@
//Used for self-mailing.
var/mail_destination = 0
holder_type = /obj/item/weapon/holder/drone
// var/sprite[0]
@@ -45,14 +45,7 @@
//Actual picking-up event.
/mob/living/silicon/robot/drone/attack_hand(mob/living/carbon/human/M as mob)
if(M.a_intent == "help")
var/obj/item/weapon/holder/drone/D = new(loc)
src.loc = D
D.attack_hand(M)
M << "You scoop up [src]."
src << "[M] scoops you up."
M.status_flags |= PASSEMOTES
return
get_scooped(M)
..()
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -256,7 +256,7 @@
use_power = 1
set_light(0)
active_power_usage = ((light_range + light_power) * 10)
active_power_usage = brightness_range * 10
if(on != on_gs)
on_gs = on
@@ -564,11 +564,11 @@
#define LIGHTING_POWER_FACTOR 20 //20W per unit luminosity
/*
/obj/machinery/light/process()//TODO: remove/add this from machines to save on processing as needed ~Carn PRIORITY
if(on)
use_power(light_range * LIGHTING_POWER_FACTOR, LIGHT)
*/
use_power(brightness_range * LIGHTING_POWER_FACTOR, LIGHT)
// called when area power state changes
/obj/machinery/light/power_change()
@@ -244,7 +244,7 @@
/obj/singularity/proc/consume(var/atom/A)
var/gain = A.singularity_act(current_size)
src.energy += gain
if(istype(A, /obj/machinery/power/supermatter) && !consumedSupermatter)
if(istype(A, /obj/machinery/power/supermatter_shard) && !consumedSupermatter)
desc = "[initial(desc)] It glows fiercely with inner fire."
name = "supermatter-charged [initial(name)]"
consumedSupermatter = 1
@@ -0,0 +1,179 @@
//separate dm since hydro is getting bloated already
/obj/effect/supermatter_crystal
name = "supermatter growth"
anchored = 1
opacity = 0
density = 0
icon = 'icons/obj/lighting.dmi'
icon_state = "supermatter_crystalf"
layer = 2.1
light_color = "#8A8A00"
var/endurance = 100
var/delay = 1200
var/floor = 0
var/spreadChance = 10
var/spreadIntoAdjacentChance = 10
var/lastTick = 0
var/spreaded = 1
var/deleted = 0
/obj/effect/supermatter_crystal/single
spreadChance = 0
/obj/effect/supermatter_crystal/New()
..()
light_color = "#8A8A00"
dir = CalcDir()
if(!floor)
switch(dir) //offset to make it be on the wall rather than on the floor
if(NORTH)
pixel_y = 32
if(SOUTH)
pixel_y = -32
if(EAST)
pixel_x = 32
if(WEST)
pixel_x = -32
icon_state = "supermatter_crystal"
else
if( prob( 10 )) // Only 10% of all floor crystals survive, so there's not a forest of 'em
icon_state = "supermatter_crystalf"
name = "supermatter crystal"
density = 1
else
deleted = 1
del( src )
processing_objects += src
set_light(3)
lastTick = world.timeofday
/obj/effect/supermatter_crystal/Del()
if( !deleted )
visible_message("\red <B>\The [src] shatters!</B>")
new /obj/item/weapon/shard/supermatter( src.loc )
processing_objects -= src
..()
/obj/effect/supermatter_crystal/process()
if(!spreaded)
return
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
lastTick = world.timeofday
spreaded = 0
for(var/mob/living/l in range( src, 2 ))
var/rads = 5
l.apply_effect(rads, IRRADIATE)
for(var/i=1,i<=3,i++)
if(prob(spreadChance))
var/list/possibleLocs = list()
var/spreadsIntoAdjacent = 0
if(prob(spreadIntoAdjacentChance))
spreadsIntoAdjacent = 1
for(var/turf/simulated/floor/floor in view(3,src))
if(spreadsIntoAdjacent || !locate(/obj/effect/supermatter_crystal) in view(1,floor))
possibleLocs += floor
if(!possibleLocs.len)
break
var/turf/newLoc = pick(possibleLocs)
var/crystalCount = 0 //hacky
var/placeCount = 1
for(var/obj/effect/supermatter_crystal/shroom in newLoc)
crystalCount++
for(var/wallDir in cardinal)
var/turf/isWall = get_step(newLoc,wallDir)
if(isWall.density)
placeCount++
if(crystalCount >= placeCount)
continue
var/obj/effect/supermatter_crystal/child = new /obj/effect/supermatter_crystal(newLoc)
if( child )
child.delay = delay
child.endurance = endurance
spreaded++
/obj/effect/supermatter_crystal/proc/CalcDir(turf/location = loc)
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
return wallDir
/*
var/direction = 16
for(var/wallDir in cardinal)
var/turf/newTurf = get_step(location,wallDir)
if(newTurf.density)
direction |= wallDir
for(var/obj/effect/supermatter_crystal/crystal in location)
if(crystal == src)
continue
if(crystal.floor) //special
direction &= ~16
else
direction &= ~crystal.dir
var/list/dirList = list()
for(var/i=1,i<=16,i <<= 1)
if(direction & i)
dirList += i
if(dirList.len)
var/newDir = pick(dirList)
if(newDir == 16)
floor = 1
newDir = 1
return newDir
*/
floor = 1
return 1
/obj/effect/supermatter_crystal/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
endurance -= W.force
CheckEndurance()
/obj/effect/supermatter_crystal/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
return
if(2.0)
if (prob(50))
qdel(src)
return
if(3.0)
if (prob(5))
qdel(src)
return
else
return
/obj/effect/supermatter_crystal/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
endurance -= 5
CheckEndurance()
/obj/effect/supermatter_crystal/proc/CheckEndurance()
if(endurance <= 0)
qdel(src)
+103
View File
@@ -0,0 +1,103 @@
/obj/item/weapon/shard/supermatter
name = "supermatter shard"
desc = "A shard of supermatter. Incredibly dangerous, though not large enough to go critical."
force = 10.0
throwforce = 20.0
icon_state = "supermatter"
sharp = 1
edge = 1
w_class = 2
flags = CONDUCT
light_color = "#8A8A00"
var/brightness = 2
/obj/item/weapon/shard/supermatter/New()
src.icon_state = "supermatter" + pick("large", "medium", "small")
switch(src.icon_state)
if("supermattersmall")
src.pixel_x = rand(-12, 12)
src.pixel_y = rand(-12, 12)
if("supermattermedium")
src.pixel_x = rand(-8, 8)
src.pixel_y = rand(-8, 8)
if("supermatterlarge")
src.pixel_x = rand(-5, 5)
src.pixel_y = rand(-5, 5)
else
set_light(brightness)
/obj/item/weapon/shard/supermatter/attackby(obj/item/weapon/W as obj, mob/user as mob)
if( istype( W, /obj/item/weapon/tongs ))
var/obj/item/weapon/tongs/T = W
T.pick_up( src )
T.icon_state = "tongs_supermatter"
return
..()
/obj/item/weapon/shard/supermatter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
return ..()
/obj/item/weapon/shard/supermatter/Crossed(AM as mob|obj)
if(ismob(AM))
var/mob/M = AM
M << "\red <B>You step on \the [src]!</B>"
playsound(src.loc, 'sound/effects/glass_step_sm.ogg', 70, 1) // not sure how to handle metal shards with sounds
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_SYNTHETIC) //Thick skin.
return
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(affecting.status & ORGAN_ROBOT)
return
if(affecting.take_damage(5, 20))
H.UpdateDamageIcon()
H.updatehealth()
if(!(H.species && (H.species.flags & NO_PAIN)))
H.Weaken(3)
..()
/obj/item/weapon/shard/supermatter/attack_hand(var/mob/user)
if(!istype(user,/mob/living/carbon/human/nucleation))
user << pick( "\red You think twice before touching that without protection.",
"\red You don't want to touch that without some protection.",
"\red You probably should get something else to pick that up.",
"\red You aren't sure that's a good idea.",
"\red You aren't in the mood to get vaporized today.",
"\red You really don't feel like frying your hand off.",
"\red You assume that's a bad idea." )
return
..()
/obj/item/weapon/tongs
name = "tongs"
desc = "Tungsten-alloy tongs used for handling dangerous materials."
force = 7.0
throwforce = 12.0
icon = 'icons/obj/weapons.dmi'
icon_state = "tongs"
edge = 1
w_class = 2
flags = CONDUCT
var/obj/item/held = null // The item currently being held
/obj/item/weapon/tongs/proc/pick_up( var/obj/item/I )
held = I
I.loc = src
playsound(loc, 'sound/effects/tong_pickup.ogg', 50, 1, -1)
/obj/item/weapon/tongs/attack_self(var/mob/user as mob)
if( held )
var/turf/T = get_turf(user.loc)
held.loc = T
held = null
icon_state = initial(icon_state)
..()
@@ -0,0 +1,299 @@
//Ported from /vg/station13, which was in turn forked from baystation12;
//Please do not bother them with bugs from this port, however, as it has been modified quite a bit.
//Modifications include removing the world-ending full supermatter variation, and leaving only the shard.
#define NITROGEN_RETARDATION_FACTOR 2 //Higher == N2 slows reaction more
#define THERMAL_RELEASE_MODIFIER 5 //Higher == less heat released during reaction
#define PLASMA_RELEASE_MODIFIER 750 //Higher == less plasma released by reaction
#define OXYGEN_RELEASE_MODIFIER 325 //Higher == less oxygen released at high temperature/power
#define REACTION_POWER_MODIFIER 0.55 //Higher == more overall power
//These would be what you would get at point blank, decreases with distance
#define DETONATION_RADS 200
#define DETONATION_HALLUCINATION 600
#define WARNING_DELAY 30 //seconds between warnings.
/obj/machinery/power/supermatter_shard
name = "supermatter shard"
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure. <span class='danger'>You get headaches just from looking at it.</span>"
icon = 'icons/obj/supermatter.dmi'
icon_state = "darkmatter_shard"
density = 1
anchored = 0
light_range = 4
var/gasefficency = 0.125
var/base_icon_state = "darkmatter_shard"
var/damage = 0
var/damage_archived = 0
var/safe_alert = "Crystalline hyperstructure returning to safe operating levels."
var/warning_point = 50
var/warning_alert = "Danger! Crystal hyperstructure instability!"
var/emergency_point = 500
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT."
var/explosion_point = 900
var/emergency_issued = 0
var/explosion_power = 8
var/lastwarning = 0 // Time in 1/10th of seconds since the last sent warning
var/power = 0
var/oxygen = 0 // Moving this up here for easier debugging.
//Temporary values so that we can optimize this
//How much the bullets damage should be multiplied by when it is added to the internal variables
var/config_bullet_energy = 2
//How much of the power is left after processing is finished?
// var/config_power_reduction_per_tick = 0.5
//How much hallucination should it produce per unit of power?
var/config_hallucination_power = 0.1
var/obj/item/device/radio/radio
//for logging
var/has_been_powered = 0
var/has_reached_emergency = 0
/obj/machinery/power/supermatter_shard/New()
. = ..()
radio = new(src)
radio.listening = 0
investigate_log("has been created.", "supermatter")
/obj/machinery/power/supermatter_shard/Destroy()
investigate_log("has been destroyed.", "supermatter")
qdel(radio)
. = ..()
/obj/machinery/power/supermatter_shard/proc/explode()
investigate_log("has exploded.", "supermatter")
explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1)
qdel(src)
return
/obj/machinery/power/supermatter_shard/process()
var/turf/L = loc
if(isnull(L)) // We have a null turf...something is wrong, stop processing this entity.
return PROCESS_KILL
if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
return //Yeah just stop.
if(istype(L, /turf/space)) // Stop processing this stuff if we've been ejected.
return
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
if((world.timeofday - lastwarning) / 10 >= WARNING_DELAY)
var/stability = num2text(round((damage / explosion_point) * 100))
if(damage > emergency_point)
radio.autosay("[emergency_alert] Instability: [stability]%", src)
lastwarning = world.timeofday
if(!has_reached_emergency)
investigate_log("has reached the emergency point for the first time.", "supermatter")
message_admins("[src] has reached the emergency point <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>(JMP)</a>.")
has_reached_emergency = 1
else if(damage >= damage_archived) // The damage is still going up
radio.autosay("[warning_alert] Instability: [stability]%", src)
lastwarning = world.timeofday - 150
else // Phew, we're safe
radio.autosay("[safe_alert]", src)
lastwarning = world.timeofday
if(damage > explosion_point)
for(var/mob/living/mob in living_mob_list)
if(istype(mob, /mob/living/carbon/human))
//Hilariously enough, running into a closet should make you get hit the hardest.
var/mob/living/carbon/human/H = mob
H.hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) )
mob.apply_effect(rads, IRRADIATE)
explode()
//Ok, get the air from the turf
var/datum/gas_mixture/env = L.return_air()
//Remove gas from surrounding area
var/datum/gas_mixture/removed = env.remove(gasefficency * env.total_moles())
if(!removed || !removed.total_moles())
damage += max((power-1600)/10, 0)
power = min(power, 1600)
return 1
damage_archived = damage
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
//Ok, 100% oxygen atmosphere = best reaction
//Maxes out at 100% oxygen pressure
oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / MOLES_CELLSTANDARD, 1), 0)
var/temp_factor = 50
if(oxygen > 0.8)
// with a perfect gas mix, make the power less based on heat
icon_state = "[base_icon_state]_glow"
else
// in normal mode, base the produced energy around the heat
temp_factor = 30
icon_state = base_icon_state
power = max( (removed.temperature * temp_factor / T0C) * oxygen + power, 0) //Total laser power plus an overload
//We've generated power, now let's transfer it to the collectors for storing/usage
transfer_energy()
var/device_energy = power * REACTION_POWER_MODIFIER
//To figure out how much temperature to add each tick, consider that at one atmosphere's worth
//of pure oxygen, with all four lasers firing at standard energy and no N2 present, at room temperature
//that the device energy is around 2140. At that stage, we don't want too much heat to be put out
//Since the core is effectively "cold"
//Also keep in mind we are only adding this temperature to (efficiency)% of the one tile the rock
//is on. An increase of 4*C @ 25% efficiency here results in an increase of 1*C / (#tilesincore) overall.
removed.temperature += (device_energy / THERMAL_RELEASE_MODIFIER)
removed.temperature = max(0, min(removed.temperature, 2500))
//Calculate how much gas to release
removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
env.merge(removed)
for(var/mob/living/carbon/human/l in view(src, min(7, round(power ** 0.25)))) // If they can see it without mesons on. Bad on them.
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1, get_dist(l, src)) ) ) )
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
l.apply_effect(rads, IRRADIATE)
power -= (power/500)**3
return 1
/obj/machinery/power/supermatter_shard
/obj/machinery/power/supermatter_shard/bullet_act(var/obj/item/projectile/Proj)
var/turf/L = loc
if(!istype(L)) // We don't run process() when we are in space
return 0 // This stops people from being able to really power up the supermatter
// Then bring it inside to explode instantly upon landing on a valid turf.
if(Proj.flag != "bullet")
power += Proj.damage * config_bullet_energy
if(!has_been_powered)
investigate_log("has been powered for the first time.", "supermatter")
message_admins("[src] has been powered for the first time <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>(JMP)</a>.")
has_been_powered = 1
else
damage += Proj.damage * config_bullet_energy
return 0
/obj/machinery/power/supermatter_shard/singularity_act()
var/gain = 100
investigate_log("Supermatter shard consumed by singularity.","singulo")
message_admins("Singularity has consumed a supermatter shard and can now become stage six.")
visible_message("<span class='userdanger'>[src] is consumed by the singularity!</span>")
for(var/mob/M in mob_list)
M << 'sound/effects/supermatter.ogg' //everyone goan know bout this
M << "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>"
qdel(src)
return(gain)
/obj/machinery/power/supermatter_shard/attack_robot(mob/user as mob)
if(Adjacent(user))
return attack_hand(user)
else
user << "<span class='warning'>You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
return
/obj/machinery/power/supermatter_shard/attack_ai(mob/user as mob)
user << "<span class='warning'>You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
/obj/machinery/power/supermatter_shard/attack_hand(mob/living/user as mob)
if(!istype(user))
return
user.visible_message("<span class='danger'>\The [user] reaches out and touches \the [src], inducing a resonance... \his body starts to glow and bursts into flames before flashing into ash.</span>",\
"<span class='userdanger'>You reach out and touch \the [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"</span>",\
"<span class='italics'>You hear an unearthly noise as a wave of heat washes over you.</span>")
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, 1)
Consume(user)
/obj/machinery/power/supermatter_shard/proc/transfer_energy()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(get_dist(R, src) <= 15) // Better than using orange() every process
R.receive_pulse(power/10)
return
/obj/machinery/power/supermatter_shard/attackby(obj/item/W as obj, mob/living/user as mob, params)
if(!istype(W) || (W.flags & ABSTRACT) || !istype(user))
return
if(user.drop_item(W))
Consume(W)
user.visible_message("<span class='danger'>As [user] touches \the [src] with \a [W], silence fills the room...</span>",\
"<span class='userdanger'>You touch \the [src] with \the [W], and everything suddenly goes silent.\"</span>\n<span class='notice'>\The [W] flashes into dust as you flinch away from \the [src].</span>",\
"<span class='italics'>Everything suddenly goes silent.</span>")
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, 1)
user.apply_effect(150, IRRADIATE)
/obj/machinery/power/supermatter_shard/Bumped(atom/AM as mob|obj)
if(istype(AM, /mob/living))
AM.visible_message("<span class='danger'>\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.</span>",\
"<span class='userdanger'>You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class='italics'>You hear an unearthly noise as a wave of heat washes over you.</span>")
else if(isobj(AM) && !istype(AM, /obj/effect))
AM.visible_message("<span class='danger'>\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
"<span class='italics'>You hear a loud crack as you are washed with a wave of heat.</span>")
else
return
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, 1)
Consume(AM)
/obj/machinery/power/supermatter_shard/proc/Consume(atom/movable/AM)
if(istype(AM, /mob/living))
var/mob/living/user = AM
user.dust()
power += 200
message_admins("[src] has consumed [key_name_admin(user)]<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>(JMP)</a>.")
investigate_log("has consumed [key_name(user)].", "supermatter")
else if(isobj(AM) && !istype(AM, /obj/effect))
investigate_log("has consumed [AM].", "supermatter")
qdel(AM)
power += 200
//Some poor sod got eaten, go ahead and irradiate people nearby.
for(var/mob/living/L in range(10))
var/rads = 500 * sqrt( 1 / (get_dist(L, src) + 1) )
L.apply_effect(rads, IRRADIATE)
investigate_log("has irradiated [L] after consuming [AM].", "supermatter")
if(L in view())
L.show_message("<span class='danger'>As \the [src] slowly stops resonating, you find your skin covered in new radiation burns.</span>", 1,\
"<span class='danger'>The unearthly ringing subsides and you notice you have new radiation burns.</span>", 2)
else
L.show_message("<span class='italics'>You hear an uneartly ringing and notice your skin is covered in fresh radiation burns.</span>", 2)
+10 -274
View File
@@ -705,273 +705,10 @@
return 0
/obj/machinery/chem_master/condimaster
name = "CondiMaster 3000"
condi = 1
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/*
/obj/machinery/computer/pandemic
name = "PanD.E.M.I.C 2200"
density = 1
anchored = 1
icon = 'icons/obj/chemical.dmi'
icon_state = "mixer0"
circuit = /obj/item/weapon/circuitboard/pandemic
//use_power = 1
//idle_power_usage = 20 //defaults make more sense.
var/temphtml = ""
var/wait = null
var/obj/item/weapon/reagent_containers/glass/beaker = null
/obj/machinery/computer/pandemic/set_broken()
icon_state = (src.beaker?"mixer1_b":"mixer0_b")
stat |= BROKEN
/obj/machinery/computer/pandemic/power_change()
if(stat & BROKEN)
icon_state = (src.beaker?"mixer1_b":"mixer0_b")
else if(powered())
icon_state = (src.beaker?"mixer1":"mixer0")
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = (src.beaker?"mixer1_nopower":"mixer0_nopower")
stat |= NOPOWER
/obj/machinery/computer/pandemic/Topic(href, href_list)
if(stat & (NOPOWER|BROKEN)) return
if(usr.stat || usr.restrained()) return
if(!in_range(src, usr)) return
usr.set_machine(src)
if(!beaker) return
if (href_list["create_vaccine"])
if(!src.wait)
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
if(B)
var/path = href_list["create_vaccine"]
var/vaccine_type = text2path(path)
var/datum/disease/D = null
if(!vaccine_type)
D = archive_diseases[path]
vaccine_type = path
else
if(vaccine_type in diseases)
D = new vaccine_type(0, null)
if(D)
B.name = "[D.name] vaccine bottle"
B.reagents.add_reagent("vaccine",15,vaccine_type)
wait = 1
var/datum/reagents/R = beaker.reagents
var/datum/reagent/blood/Blood = null
for(var/datum/reagent/blood/L in R.reagent_list)
if(L)
Blood = L
break
var/list/res = Blood.data["resistances"]
spawn(res.len*200)
src.wait = null
else
src.temphtml = "The replicator is not ready yet."
src.updateUsrDialog()
return
else if (href_list["create_virus_culture"])
if(!wait)
var/obj/item/weapon/reagent_containers/glass/bottle/B = new/obj/item/weapon/reagent_containers/glass/bottle(src.loc)
B.icon_state = "bottle3"
var/type = text2path(href_list["create_virus_culture"])//the path is received as string - converting
var/datum/disease/D = null
if(!type)
var/datum/disease/advance/A = archive_diseases[href_list["create_virus_culture"]]
if(A)
D = new A.type(0, A)
else
if(type in diseases) // Make sure this is a disease
D = new type(0, null)
var/list/data = list("viruses"=list(D))
var/name = sanitize(input(usr,"Name:","Name the culture",D.name))
if(!name || name == " ") name = D.name
B.name = "[name] culture bottle"
B.desc = "A small bottle. Contains [D.agent] culture in synthblood medium."
B.reagents.add_reagent("blood",20,data)
src.updateUsrDialog()
wait = 1
spawn(1000)
src.wait = null
else
src.temphtml = "The replicator is not ready yet."
src.updateUsrDialog()
return
else if (href_list["empty_beaker"])
beaker.reagents.clear_reagents()
src.updateUsrDialog()
return
else if (href_list["eject"])
beaker:loc = src.loc
beaker = null
icon_state = "mixer0"
src.updateUsrDialog()
return
else if(href_list["clear"])
src.temphtml = ""
src.updateUsrDialog()
return
else if(href_list["name_disease"])
var/new_name = stripped_input(usr, "Name the Disease", "New Name", "", MAX_NAME_LEN)
if(stat & (NOPOWER|BROKEN)) return
if(usr.stat || usr.restrained()) return
if(!in_range(src, usr)) return
var/id = href_list["name_disease"]
if(archive_diseases[id])
var/datum/disease/advance/A = archive_diseases[id]
A.AssignName(new_name)
for(var/datum/disease/advance/AD in active_diseases)
AD.Refresh()
src.updateUsrDialog()
else
usr << browse(null, "window=pandemic")
src.updateUsrDialog()
return
src.add_fingerprint(usr)
return
/obj/machinery/computer/pandemic/attack_ai(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/pandemic/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/machinery/computer/pandemic/attack_hand(mob/user as mob)
if(stat & (NOPOWER|BROKEN))
return
user.set_machine(src)
var/dat = ""
if(src.temphtml)
dat = "[src.temphtml]<BR><BR><A href='?src=\ref[src];clear=1'>Main Menu</A>"
else if(!beaker)
dat += "Please insert beaker.<BR>"
dat += "<A href='?src=\ref[user];mach_close=pandemic'>Close</A>"
else
var/datum/reagents/R = beaker.reagents
var/datum/reagent/blood/Blood = null
for(var/datum/reagent/blood/B in R.reagent_list)
if(B)
Blood = B
break
if(!R.total_volume||!R.reagent_list.len)
dat += "The beaker is empty<BR>"
else if(!Blood)
dat += "No blood sample found in beaker"
else if(!Blood.data)
dat += "No blood data found in beaker."
else
dat += "<h3>Blood sample data:</h3>"
dat += "<b>Blood DNA:</b> [(Blood.data["blood_DNA"]||"none")]<BR>"
dat += "<b>Blood Type:</b> [(Blood.data["blood_type"]||"none")]<BR>"
if(Blood.data["viruses"])
var/list/vir = Blood.data["viruses"]
if(vir.len)
for(var/datum/disease/D in Blood.data["viruses"])
if(!D.hidden[PANDEMIC])
var/disease_creation = D.type
if(istype(D, /datum/disease/advance))
var/datum/disease/advance/A = D
D = archive_diseases[A.GetDiseaseID()]
disease_creation = A.GetDiseaseID()
if(D.name == "Unknown")
dat += "<b><a href='?src=\ref[src];name_disease=[A.GetDiseaseID()]'>Name Disease</a></b><BR>"
if(!D)
CRASH("We weren't able to get the advance disease from the archive.")
dat += "<b>Disease Agent:</b> [D?"[D.agent] - <A href='?src=\ref[src];create_virus_culture=[disease_creation]'>Create virus culture bottle</A>":"none"]<BR>"
dat += "<b>Common name:</b> [(D.name||"none")]<BR>"
dat += "<b>Description: </b> [(D.desc||"none")]<BR>"
dat += "<b>Spread:</b> [(D.spread||"none")]<BR>"
dat += "<b>Possible cure:</b> [(D.cure||"none")]<BR><BR>"
if(istype(D, /datum/disease/advance))
var/datum/disease/advance/A = D
dat += "<b>Symptoms:</b> "
var/english_symptoms = list()
for(var/datum/symptom/S in A.symptoms)
english_symptoms += S.name
dat += english_list(english_symptoms)
dat += "<BR><b>Contains antibodies to:</b> "
if(Blood.data["resistances"])
var/list/res = Blood.data["resistances"]
if(res.len)
dat += "<ul>"
for(var/type in Blood.data["resistances"])
var/disease_name = "Unknown"
if(!ispath(type))
var/datum/disease/advance/A = archive_diseases[type]
if(A)
disease_name = A.name
else
var/datum/disease/D = new type(0, null)
disease_name = D.name
dat += "<li>[disease_name] - <A href='?src=\ref[src];create_vaccine=[type]'>Create vaccine bottle</A></li>"
dat += "</ul><BR>"
else
dat += "nothing<BR>"
else
dat += "nothing<BR>"
dat += "<BR><A href='?src=\ref[src];eject=1'>Eject beaker</A>[((R.total_volume&&R.reagent_list.len) ? "-- <A href='?src=\ref[src];empty_beaker=1'>Empty beaker</A>":"")]<BR>"
dat += "<A href='?src=\ref[user];mach_close=pandemic'>Close</A>"
user << browse("<TITLE>[src.name]</TITLE><BR>[dat]", "window=pandemic;size=575x400")
onclose(user, "pandemic")
return
/obj/machinery/computer/pandemic/attackby(var/obj/I as obj, var/mob/user as mob, params)
if(istype(I, /obj/item/weapon/reagent_containers/glass))
if(stat & (NOPOWER|BROKEN)) return
if(src.beaker)
user << "A beaker is already loaded into the machine."
return
src.beaker = I
user.drop_item()
I.loc = src
user << "You add the beaker to the machine!"
src.updateUsrDialog()
icon_state = "mixer1"
else
..()
return
*/
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/obj/machinery/reagentgrinder
name = "All-In-One Grinder"
@@ -986,6 +723,8 @@
var/inuse = 0
var/obj/item/weapon/reagent_containers/beaker = null
var/limit = 10
//IMPORTANT NOTE! A negative number is a multiplier, a positive number is a flat amount to add. 0 means equal to the amount of the original reagent
var/list/blend_items = list (
//Sheets
@@ -996,12 +735,10 @@
/obj/item/stack/sheet/mineral/gold = list("gold" = 20),
/obj/item/weapon/grown/novaflower = list("capsaicin" = 0),
//archaeology!
/obj/item/weapon/rocksliver = list("ground_rock" = 50),
//All types that you can put into the grinder to transfer the reagents to the beaker. !Put all recipes above this.!
/obj/item/weapon/reagent_containers/pill = list(),
/obj/item/weapon/reagent_containers/food = list()
@@ -1013,9 +750,8 @@
"soybeans" = list("soymilk" = 0),
"tomato" = list("ketchup" = 0),
///obj/item/weapon/reagent_containers/food/snacks/grown/wheat = list("flour" = -5),
"ricestalk" = list("rice" = 5),
"rice" = list("rice" = -5),
"cherries" = list("cherryjelly" = 0),
"plastellium" = list("plasticide" = 5),
)
var/list/juice_items = list (
@@ -1036,9 +772,6 @@
"corn" = list("cornoil" = 0),
)
var/list/holdingitems = list()
/obj/machinery/reagentgrinder/New()
@@ -1050,10 +783,8 @@
icon_state = "juicer"+num2text(!isnull(beaker))
return
/obj/machinery/reagentgrinder/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if (istype(O,/obj/item/weapon/reagent_containers/glass) || \
istype(O,/obj/item/weapon/reagent_containers/food/drinks/drinkingglass) || \
istype(O,/obj/item/weapon/reagent_containers/food/drinks/shaker))
@@ -1152,7 +883,6 @@
onclose(user, "reagentgrinder")
return
/obj/machinery/reagentgrinder/Topic(href, href_list)
if(..())
return
@@ -1313,15 +1043,21 @@
var/space = beaker.reagents.maximum_volume - beaker.reagents.total_volume
var/amount = allowed[r_id]
if(amount <= 0)
if(amount <= 0) //Negative amounts are multipliers for the reagent amount (Example: "amount = -5" means "reagent_amount * 5")
if(amount == 0)
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("nutriment"), space))
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
if (O.reagents != null && O.reagents.has_reagent("plantmatter"))
beaker.reagents.add_reagent(r_id, min(O.reagents.get_reagent_amount("plantmatter"), space))
O.reagents.remove_reagent("plantmatter", min(O.reagents.get_reagent_amount("plantmatter"), space))
else
if (O.reagents != null && O.reagents.has_reagent("nutriment"))
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("nutriment")*abs(amount)), space))
O.reagents.remove_reagent("nutriment", min(O.reagents.get_reagent_amount("nutriment"), space))
if (O.reagents != null && O.reagents.has_reagent("plantmatter"))
beaker.reagents.add_reagent(r_id, min(round(O.reagents.get_reagent_amount("plantmatter")*abs(amount)), space))
O.reagents.remove_reagent("plantmatter", min(O.reagents.get_reagent_amount("plantmatter"), space))
else
O.reagents.trans_id_to(beaker, r_id, min(amount, space))
@@ -182,16 +182,6 @@
build_path = /obj/item/weapon/circuitboard/operating
category = list("Computer Boards")
/datum/design/pandemic
name = "Console Board (PanD.E.M.I.C. 2200)"
desc = "Allows for the construction of circuit boards used to build a PanD.E.M.I.C. 2200 console."
id = "pandemic"
req_tech = list("programming" = 2, "biotech" = 2)
build_type = IMPRINTER
materials = list("$glass" = 1000, "sacid" = 20)
build_path = /obj/item/weapon/circuitboard/pandemic
category = list("Computer Boards")
/datum/design/powermonitor
name = "Console Board (Power Monitor)"
desc = "Allows for the construction of circuit boards used to build a new power monitor"
@@ -13,10 +13,9 @@
artifact_id = "[pick("kappa","sigma","antaeres","beta","omicron","iota","epsilon","omega","gamma","delta","tau","alpha")]-[rand(100,999)]"
artifact_find_type = pick(\
5;/obj/machinery/power/supermatter,\
5;/obj/structure/constructshell,\
5;/obj/machinery/wish_granter,\
25;/obj/machinery/power/supermatter/shard,\
25;/obj/machinery/power/supermatter_shard,\
50;/obj/structure/cult/pylon,\
100;/obj/machinery/auto_cloner,\
100;/obj/machinery/giga_drill,\
@@ -135,10 +135,7 @@
ecosystem involving self cannibalism and a symbiotic relationship with the contained liquid.<br><br>\
Structure is composed of a carbo-titanium alloy with interlaced reinforcing energy fields, and the contained liquid \
resembles proto-plasmic residue supportive of single cellular developmental conditions."
if(/obj/machinery/power/supermatter)
return "Super dense plasma clump - Appears to have been shaped or hewn, structure is composed of matter 2000% denser than ordinary carbon matter residue.\
Potential application as unrefined plasma source."
if(/obj/machinery/power/supermatter)
if(/obj/machinery/power/supermatter_shard)
return "Super dense plasma clump - Appears to have been shaped or hewn, structure is composed of matter 2000% denser than ordinary carbon matter residue.\
Potential application as unrefined plasma source."
if(/obj/structure/constructshell)
-473
View File
@@ -1,473 +0,0 @@
#define NITROGEN_RETARDATION_FACTOR 0.15 //Higher == N2 slows reaction more
#define THERMAL_RELEASE_MODIFIER 750 //Higher == more heat released during reaction
#define PLASMA_RELEASE_MODIFIER 1500 //Higher == less plasma released by reaction
#define OXYGEN_RELEASE_MODIFIER 1500 //Higher == less oxygen released at high temperature/power
#define REACTION_POWER_MODIFIER 1.1 //Higher == more overall power
/*
How to tweak the SM
POWER_FACTOR directly controls how much power the SM puts out at a given level of excitation (power var). Making this lower means you have to work the SM harder to get the same amount of power.
CRITICAL_TEMPERATURE The temperature at which the SM starts taking damage.
CHARGING_FACTOR Controls how much emitter shots excite the SM.
DAMAGE_RATE_LIMIT Controls the maximum rate at which the SM will take damage due to high temperatures.
*/
//Controls how much power is produced by each collector in range - this is the main parameter for tweaking SM balance, as it basically controls how the power variable relates to the rest of the game.
#define POWER_FACTOR 1.0
#define DECAY_FACTOR 700 //Affects how fast the supermatter power decays
#define CRITICAL_TEMPERATURE 5000 //K
#define CHARGING_FACTOR 0.05
#define DAMAGE_RATE_LIMIT 3 //damage rate cap at power = 300, scales linearly with power
//These would be what you would get at point blank, decreases with distance
#define DETONATION_RADS 200
#define DETONATION_HALLUCINATION 600
#define TRANSFORM_DISTANCE_MOD 2 // Size/this is maximum distance from SM during burst for transformation to Nucleation
#define WARNING_DELAY 30 //seconds between warnings.
/obj/machinery/power/supermatter
name = "Supermatter"
desc = "A strangely translucent and iridescent crystal. \red You get headaches just from looking at it."
icon = 'icons/obj/engine.dmi'
icon_state = "darkmatter"
density = 1
anchored = 0
light_range = 4
var/gasefficency = 0.25
var/base_icon_state = "darkmatter"
var/damage = 0
var/damage_archived = 0
var/safe_alert = "Crystaline hyperstructure returning to safe operating levels."
var/safe_warned = 0
var/warning_point = 100
var/warning_alert = "Danger! Crystal hyperstructure instability!"
var/emergency_point = 700
var/emergency_alert = "CRYSTAL DELAMINATION IMMINENT."
var/explosion_point = 1000
light_color = "#8A8A00"
var/warning_color = "#B8B800"
var/emergency_color = "#D9D900"
var/grav_pulling = 0
var/pull_radius = 14
// Time in ticks between delamination ('exploding') and exploding (as in the actual boom)
var/pull_time = 100
var/explosion_power = 8
var/emergency_issued = 0
// Time in 1/10th of seconds since the last sent warning
var/lastwarning = 0
// This stops spawning redundand explosions. Also incidentally makes supermatter unexplodable if set to 1.
var/exploded = 0
var/power = 0
var/oxygen = 0
//Temporary values so that we can optimize this
//How much the bullets damage should be multiplied by when it is added to the internal variables
var/config_bullet_energy = 2
//How much of the power is left after processing is finished?
// var/config_power_reduction_per_tick = 0.5
//How much hallucination should it produce per unit of power?
var/config_hallucination_power = 0.1
var/obj/item/device/radio/radio
var/debug = 0
var/uneatable = list(/turf/space, /obj/effect/overlay, /atom/movable/lighting_overlay, /mob/dead, /mob/camera, /mob/new_player)
/obj/machinery/power/supermatter/New()
. = ..()
radio = new (src)
/obj/machinery/power/supermatter/Del()
del radio
. = ..()
/obj/machinery/power/supermatter/proc/explode()
message_admins("Supermatter exploded at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("Supermatter exploded at ([x],[y],[z])")
anchored = 1
grav_pulling = 1
exploded = 1
spawn(pull_time)
var/turf/epicenter = get_turf(src)
explosion(epicenter, explosion_power, explosion_power*2, explosion_power*3, explosion_power*4, 1)
supermatter_delamination( epicenter, explosion_power*4, 1 )
del src
return
//Changes color and light_range of the light to these values if they were not already set
/obj/machinery/power/supermatter/proc/shift_light(var/lum, var/clr)
if(light_color != clr)
light_color = clr
if(light_range != lum)
set_light(lum)
/obj/machinery/power/supermatter/proc/announce_warning()
var/integrity = damage / explosion_point
integrity = round(100 - integrity * 100)
integrity = integrity < 0 ? 0 : integrity
var/alert_msg = " Integrity at [integrity]%"
if(damage > emergency_point)
alert_msg = emergency_alert + alert_msg
lastwarning = world.timeofday - WARNING_DELAY * 4
else if(damage >= damage_archived) // The damage is still going up
safe_warned = 0
alert_msg = warning_alert + alert_msg
lastwarning = world.timeofday
else if(!safe_warned)
safe_warned = 1 // We are safe, warn only once
alert_msg = safe_alert
lastwarning = world.timeofday
else
alert_msg = null
if(alert_msg)
radio.autosay(alert_msg, "Supermatter Monitor")
/obj/machinery/power/supermatter/process()
var/turf/L = loc
if(isnull(L)) // We have a null turf...something is wrong, stop processing this entity.
return PROCESS_KILL
if(!istype(L)) //We are in a crate or somewhere that isn't turf, if we return to turf resume processing but for now.
return //Yeah just stop.
if(damage > explosion_point)
if(!exploded)
if(!istype(L, /turf/space))
announce_warning()
explode()
else if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
shift_light(5, warning_color)
if(damage > emergency_point)
shift_light(7, emergency_color)
if(!istype(L, /turf/space) && (world.timeofday - lastwarning) >= WARNING_DELAY * 10)
announce_warning()
else
shift_light(4,initial(light_color))
if(grav_pulling)
supermatter_pull()
//Ok, get the air from the turf
var/datum/gas_mixture/removed = null
var/datum/gas_mixture/env = null
//ensure that damage doesn't increase too quickly due to super high temperatures resulting from no coolant, for example. We dont want the SM exploding before anyone can react.
//We want the cap to scale linearly with power (and explosion_point). Let's aim for a cap of 5 at power = 300 (based on testing, equals roughly 5% per SM alert announcement).
var/damage_inc_limit = (power/300)*(explosion_point/1000)*DAMAGE_RATE_LIMIT
if(!istype(L, /turf/space))
env = L.return_air()
removed = env.remove(gasefficency * env.total_moles()) //Remove gas from surrounding area
if(!env || !removed || !removed.total_moles())
damage += max((power - 15*POWER_FACTOR)/10, 0)
else if (grav_pulling) //If supermatter is detonating, remove all air from the zone
env.remove(env.total_moles())
else
damage_archived = damage
damage = max( damage + min( ( (removed.temperature - CRITICAL_TEMPERATURE) / 150 ), damage_inc_limit ) , 0 )
//Ok, 100% oxygen atmosphere = best reaction
//Maxes out at 100% oxygen pressure
oxygen = max(min((removed.oxygen - (removed.nitrogen * NITROGEN_RETARDATION_FACTOR)) / removed.total_moles(), 1), 0)
//calculate power gain for oxygen reaction
var/temp_factor
var/equilibrium_power
if (oxygen > 0.8)
//If chain reacting at oxygen == 1, we want the power at 800 K to stabilize at a power level of 400
equilibrium_power = 400
icon_state = "[base_icon_state]_glow"
else
//If chain reacting at oxygen == 1, we want the power at 800 K to stabilize at a power level of 250
equilibrium_power = 250
icon_state = base_icon_state
temp_factor = ( (equilibrium_power/DECAY_FACTOR)**3 )/800
power = max( (removed.temperature * temp_factor) * oxygen + power, 0)
//We've generated power, now let's transfer it to the collectors for storing/usage
transfer_energy()
var/device_energy = power * REACTION_POWER_MODIFIER
//Calculate how much gas to release
removed.toxins += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
removed.oxygen += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
env.merge(removed)
for(var/mob/living/carbon/human/l in view(src, min(7, round(sqrt(power/6))))) // If they can see it without mesons on. Bad on them.
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) )
//adjusted range so that a power of 300 (pretty high) results in 8 tiles, roughly the distance from the core to the engine monitoring room.
for(var/mob/living/l in range(src, round(sqrt(power / 5))))
var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) )
l.apply_effect(rads, IRRADIATE)
power -= (power/DECAY_FACTOR)**3 //energy losses due to radiation
return 1
/obj/machinery/power/supermatter/bullet_act(var/obj/item/projectile/Proj)
var/turf/L = loc
if(!istype(L)) // We don't run process() when we are in space
return 0 // This stops people from being able to really power up the supermatter
// Then bring it inside to explode instantly upon landing on a valid turf.
if(istype(Proj, /obj/item/projectile/beam))
power += Proj.damage * config_bullet_energy * CHARGING_FACTOR / POWER_FACTOR
else
damage += Proj.damage * config_bullet_energy
return 0
/obj/machinery/power/supermatter/singularity_act()
var/gain = 100
investigate_log("Supermatter shard consumed by singularity.","singulo")
message_admins("Singularity has consumed a supermatter shard and can now become stage six.")
visible_message("<span class='userdanger'>[src] is consumed by the singularity!</span>")
for(var/mob/M in mob_list)
M << 'sound/effects/supermatter.ogg' //everyone goan know bout this
M << "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>"
qdel(src)
return(gain)
/obj/machinery/power/supermatter/attack_robot(mob/user as mob)
if(Adjacent(user))
return attack_hand(user)
else
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
return
/obj/machinery/power/supermatter/attack_ai(mob/user as mob)
user << "<span class = \"warning\">You attempt to interface with the control circuits but find they are not connected to your network. Maybe in a future firmware update.</span>"
/obj/machinery/power/supermatter/attack_hand(mob/user as mob)
if(istype(user,/mob/living/carbon/human/nucleation)) // Nucleation's biology doesn't react to this
return
user.visible_message("<span class=\"warning\">\The [user] reaches out and touches \the [src], inducing a resonance... \his body starts to glow and bursts into flames before flashing into ash.</span>",\
"<span class=\"danger\">You reach out and touch \the [src]. Everything starts burning and all you can hear is ringing. Your last thought is \"That was not a wise decision.\"</span>",\
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
Consume(user)
/obj/machinery/power/supermatter/proc/transfer_energy()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
var/distance = get_dist(R, src)
if(distance <= 15)
//for collectors using standard plasma tanks at 1013 kPa, the actual power generated will be this power*POWER_FACTOR*20*29 = power*POWER_FACTOR*580
R.receive_pulse(power * POWER_FACTOR * (min(3/distance, 1))**2)
return
/obj/machinery/power/supermatter/attackby(obj/item/weapon/W as obj, mob/living/carbon/user as mob)
user.visible_message("<span class=\"warning\">\The [user] touches \a [W] to \the [src] as a silence fills the room...</span>",\
"<span class=\"danger\">You touch \the [W] to \the [src] when everything suddenly goes silent.\"</span>\n<span class=\"notice\">\The [W] flashes into dust as you flinch away from \the [src].</span>",\
"<span class=\"warning\">Everything suddenly goes silent.</span>")
user.unEquip(W)
Consume(W)
user.apply_effect(150, IRRADIATE)
/obj/machinery/power/supermatter/Bumped(atom/AM as mob|obj)
if(istype(AM, /mob/living))
if(istype(AM,/mob/living/carbon/human/nucleation)) // Nucleation's biology doesn't react to this
return
AM.visible_message("<span class=\"warning\">\The [AM] slams into \the [src] inducing a resonance... \his body starts to glow and catch flame before flashing into ash.</span>",\
"<span class=\"danger\">You slam into \the [src] as your ears are filled with unearthly ringing. Your last thought is \"Oh, fuck.\"</span>",\
"<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
else if(!grav_pulling) //To prevent spam, detonating supermatter does not indicate non-mobs being destroyed
AM.visible_message("<span class=\"warning\">\The [AM] smacks into \the [src] and rapidly flashes to ash.</span>",\
"<span class=\"warning\">You hear a loud crack as you are washed with a wave of heat.</span>")
Consume(AM)
/obj/machinery/power/supermatter/proc/Consume(var/mob/living/user)
if(istype(user,/mob/living/carbon/human/nucleation)) // Nucleation's biology doesn't react to this
return
if(istype(user))
user.dust()
power += 200
else
del user
power += 200
//Some poor sod got eaten, go ahead and irradiate people nearby.
for(var/mob/living/l in range(10))
if(l in view())
l.show_message("<span class=\"warning\">As \the [src] slowly stops resonating, you find your skin covered in new radiation burns.</span>", 1,\
"<span class=\"warning\">The unearthly ringing subsides and you notice you have new radiation burns.</span>", 2)
else
l.show_message("<span class=\"warning\">You hear an uneartly ringing and notice your skin is covered in fresh radiation burns.</span>", 2)
var/rads = 500 * sqrt( 1 / (get_dist(l, src) + 1) )
l.apply_effect(rads, IRRADIATE)
/obj/machinery/power/supermatter/proc/supermatter_pull()
//following is adapted from singulo code
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
// Let's just make this one loop.
for(var/atom/X in orange(pull_radius,src))
// Movable atoms only
if(istype(X, /atom/movable))
if(is_type_in_list(X, uneatable)) continue
if(((X) && (!istype(X,/mob/living/carbon/human))))
step_towards(X,src)
if(istype(X, /obj)) //unanchored objects pulled twice as fast
var/obj/O = X
if(!O.anchored)
step_towards(X,src)
else
step_towards(X,src)
if(istype(X, /obj/structure/window)) //shatter windows
var/obj/structure/window/W = X
W.ex_act(2.0)
else if(istype(X,/mob/living/carbon/human))
var/mob/living/carbon/human/H = X
if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
var/obj/item/clothing/shoes/magboots/M = H.shoes
if(M.magpulse)
step_towards(H,src) //step just once with magboots
continue
step_towards(H,src) //step twice
step_towards(H,src)
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
return
proc/supermatter_delamination(var/turf/epicenter, var/size, var/transform_mobs = 0, var/adminlog = 1)
spawn(0)
var/start = world.timeofday
epicenter = get_turf(epicenter)
if(!epicenter) return
if(adminlog)
message_admins("Supermatter delamination with size ([size]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[epicenter.x];Y=[epicenter.y];Z=[epicenter.z]'>JMP</a>)")
log_game("Supermatter delamination with size ([size]) in area [epicenter.loc.name] ")
playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(size*2,1) )
playsound(epicenter, "explosion", 100, 1, round(size,1) )
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 1
var/x = epicenter.x
var/y = epicenter.y
var/z = epicenter.z
epicenter.ChangeTurf( /turf/simulated/floor/plating/smatter )
for(var/mob/living/mob in orange( epicenter, size*2 )) // Irradiate area twice the size of the main blast
if(epicenter.z == mob.loc.z)
if( ishuman(mob) )
//Hilariously enough, running into a closet should make you get hit the hardest.
var/mob/living/carbon/human/H = mob
H.hallucination += max(50, min(size*10, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, epicenter) + 1)) ) )
var/rads = size*10 * sqrt( 1 / (get_dist(mob, epicenter) + 1) )
mob.apply_effect(rads, IRRADIATE)
for(var/i=0, i<size, i++) // An awful way to do this, but i'm tired
for(var/j=0, j<i, j++)
var/turf/cur_turf = locate((x-i)+j, y+j, z )
var/dist = get_dist( cur_turf, epicenter )
var/percent = min( 100, ((( size-dist )/size )*100 ))
blow_lights( cur_turf )
if( prob( percent ))
supermatter_convert( cur_turf, transform_mobs )
cur_turf = locate(x+j, (y+i)-j, z )
dist = get_dist( cur_turf, epicenter )
percent = min( 100, ((( size-dist )/size )*100 ))
blow_lights( cur_turf )
if( prob( percent ))
supermatter_convert( cur_turf, transform_mobs )
cur_turf = locate((x+i)-j, y-j, z )
dist = get_dist( cur_turf, epicenter )
percent = min( 100, ((( size-dist )/size )*100 ))
blow_lights( cur_turf )
if( prob( percent ))
supermatter_convert( cur_turf, transform_mobs )
cur_turf = locate(x-j, (y-i)+j, z )
dist = get_dist( cur_turf, epicenter )
percent = min( 100, ((( size-dist )/size )*100 ))
blow_lights( cur_turf )
if( prob( percent ))
supermatter_convert( cur_turf, transform_mobs )
if(defer_powernet_rebuild != 2)
defer_powernet_rebuild = 0
diary << "## Supermatter delamination with size [size]. Took [(world.timeofday-start)/10] seconds."
return 1
proc/supermatter_convert( var/turf/T, var/transform_mobs = 0 )
if( transform_mobs )
for( var/mob/item in T.contents )
if( ishuman( item ))
var/mob/living/carbon/human/M = item
if( istype(M.species, /datum/species/human ))
if( prob( 33 ))
M.set_species( "Nucleation", 1 )
item.ex_act( 3 )
if( istype( T, /turf/simulated/floor ))
new /obj/effect/supermatter_crystal(T)
proc/blow_lights( var/turf/T )
for( var/obj/machinery/power/apc/apc in T )
apc.overload_lighting()
/obj/machinery/power/supermatter/shard //Small subtype, less efficient and more sensitive, but less boom.
name = "Supermatter Shard"
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure. \red You get headaches just from looking at it."
icon_state = "darkmatter_shard"
base_icon_state = "darkmatter_shard"
warning_point = 50
emergency_point = 400
explosion_point = 600
gasefficency = 0.125
pull_radius = 5
pull_time = 45
explosion_power = 3
/obj/machinery/power/supermatter/shard/announce_warning() //Shards don't get announcements
return