Bleeding edgy refresh (#303)

* not code stuff

* other things

* global vars, defines, helpers

* onclick hud stuff, orphans, world.dm

* controllers and datums

* game folder

* everything not client/mobs in modules

* client folder

* stage 1 mob stuff

* simple animal things

* silicons

* carbon things

* ayylmaos and monkeys

* hyoomahn

* icons n shit

* sprite fixes

* compile fixes

* some fixes I cherrypicked.

* qdel fixes

* forgot brain refractors
This commit is contained in:
Poojawa
2017-03-21 11:44:10 -05:00
committed by GitHub
parent 099a6c8764
commit f67e9f6d87
1476 changed files with 344416 additions and 40694 deletions
+2 -2
View File
@@ -174,11 +174,11 @@
src.anchored = 0
disconnect_from_network()
else
user << "<span class='warning'>Once bolted and linked to a shielding unit it the [src.name] is unable to be moved!</span>"
to_chat(user, "<span class='warning'>Once bolted and linked to a shielding unit it the [src.name] is unable to be moved!</span>")
else if(istype(W, /obj/item/weapon/am_containment))
if(fueljar)
user << "<span class='warning'>There is already a [fueljar] inside!</span>"
to_chat(user, "<span class='warning'>There is already a [fueljar] inside!</span>")
return
if(!user.transferItemToLoc(W, src))
+64 -64
View File
@@ -200,18 +200,18 @@
return
if(opened)
if(has_electronics && terminal)
user << "The cover is [opened==2?"removed":"open"] and the power cell is [ cell ? "installed" : "missing"]."
to_chat(user, "The cover is [opened==2?"removed":"open"] and the power cell is [ cell ? "installed" : "missing"].")
else
user << "It's [ !terminal ? "not" : "" ] wired up."
user << "The electronics are[!has_electronics?"n't":""] installed."
to_chat(user, "It's [ !terminal ? "not" : "" ] wired up.")
to_chat(user, "The electronics are[!has_electronics?"n't":""] installed.")
else
if (stat & MAINT)
user << "The cover is closed. Something is wrong with it. It doesn't work."
to_chat(user, "The cover is closed. Something is wrong with it. It doesn't work.")
else if (malfhack)
user << "The cover is broken. It may be hard to force it open."
to_chat(user, "The cover is broken. It may be hard to force it open.")
else
user << "The cover is closed."
to_chat(user, "The cover is closed.")
// update the APC icon to show the three base states
@@ -375,10 +375,10 @@
if (opened) // a) on open apc
if (has_electronics==1)
if (terminal)
user << "<span class='warning'>Disconnect the wires first!</span>"
to_chat(user, "<span class='warning'>Disconnect the wires first!</span>")
return
playsound(src.loc, W.usesound, 50, 1)
user << "<span class='notice'>You are trying to remove the power control board...</span>" //lpeters - fixed grammar issues
to_chat(user, "<span class='notice'>You are trying to remove the power control board...</span>" )
if(do_after(user, 50*W.toolspeed, target = src))
if (has_electronics==1)
has_electronics = 0
@@ -415,10 +415,10 @@
return
else if (!(stat & BROKEN)) // b) on closed and not broken APC
if(coverlocked && !(stat & MAINT)) // locked...
user << "<span class='warning'>The cover is locked and cannot be opened!</span>"
to_chat(user, "<span class='warning'>The cover is locked and cannot be opened!</span>")
return
else if (panel_open) // wires are exposed
user << "<span class='warning'>Exposed wires prevents you from opening it!</span>"
to_chat(user, "<span class='warning'>Exposed wires prevents you from opening it!</span>")
return
else
opened = 1
@@ -427,11 +427,11 @@
else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
if(cell)
user << "<span class='warning'>There is a power cell already installed!</span>"
to_chat(user, "<span class='warning'>There is a power cell already installed!</span>")
return
else
if (stat & MAINT)
user << "<span class='warning'>There is no connector for your power cell!</span>"
to_chat(user, "<span class='warning'>There is no connector for your power cell!</span>")
return
if(!user.drop_item())
return
@@ -446,46 +446,46 @@
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
if(opened)
if (cell)
user << "<span class='warning'>Close the APC first!</span>" //Less hints more mystery!
to_chat(user, "<span class='warning'>Close the APC first!</span>") //Less hints more mystery!
return
else
if (has_electronics==1)
has_electronics = 2
stat &= ~MAINT
playsound(src.loc, W.usesound, 50, 1)
user << "<span class='notice'>You screw the circuit electronics into place.</span>"
to_chat(user, "<span class='notice'>You screw the circuit electronics into place.</span>")
else if (has_electronics==2)
has_electronics = 1
stat |= MAINT
playsound(src.loc, W.usesound, 50, 1)
user << "<span class='notice'>You unfasten the electronics.</span>"
to_chat(user, "<span class='notice'>You unfasten the electronics.</span>")
else /* has_electronics==0 */
user << "<span class='warning'>There is nothing to secure!</span>"
to_chat(user, "<span class='warning'>There is nothing to secure!</span>")
return
update_icon()
else if(emagged)
user << "<span class='warning'>The interface is broken!</span>"
to_chat(user, "<span class='warning'>The interface is broken!</span>")
else
panel_open = !panel_open
user << "The wires have been [panel_open ? "exposed" : "unexposed"]"
to_chat(user, "The wires have been [panel_open ? "exposed" : "unexposed"]")
update_icon()
else if (W.GetID()) // trying to unlock the interface with an ID card
if(emagged)
user << "<span class='warning'>The interface is broken!</span>"
to_chat(user, "<span class='warning'>The interface is broken!</span>")
else if(opened)
user << "<span class='warning'>You must close the cover to swipe an ID card!</span>"
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else if(panel_open)
user << "<span class='warning'>You must close the panel!</span>"
to_chat(user, "<span class='warning'>You must close the panel!</span>")
else if(stat & (BROKEN|MAINT))
user << "<span class='warning'>Nothing happens!</span>"
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
if(allowed(usr) && !wires.is_cut(WIRE_IDSCAN) && !malfhack)
locked = !locked
user << "<span class='notice'>You [ locked ? "lock" : "unlock"] the APC interface.</span>"
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the APC interface.</span>")
update_icon()
else
user << "<span class='warning'>Access denied.</span>"
to_chat(user, "<span class='warning'>Access denied.</span>")
else if (istype(W, /obj/item/stack/cable_coil) && opened)
var/turf/host_turf = get_turf(src)
@@ -493,18 +493,18 @@
throw EXCEPTION("attackby on APC when it's not on a turf")
return
if (host_turf.intact)
user << "<span class='warning'>You must remove the floor plating in front of the APC first!</span>"
to_chat(user, "<span class='warning'>You must remove the floor plating in front of the APC first!</span>")
return
else if (terminal) // it already have terminal
user << "<span class='warning'>This APC is already wired!</span>"
to_chat(user, "<span class='warning'>This APC is already wired!</span>")
return
else if (has_electronics == 0)
user << "<span class='warning'>There is nothing to wire!</span>"
to_chat(user, "<span class='warning'>There is nothing to wire!</span>")
return
var/obj/item/stack/cable_coil/C = W
if(C.get_amount() < 10)
user << "<span class='warning'>You need ten lengths of cable for APC!</span>"
to_chat(user, "<span class='warning'>You need ten lengths of cable for APC!</span>")
return
user.visible_message("[user.name] adds cables to the APC frame.", \
"<span class='notice'>You start adding cables to the APC frame...</span>")
@@ -521,7 +521,7 @@
s.start()
return
C.use(10)
user << "<span class='notice'>You add cables to the APC frame.</span>"
to_chat(user, "<span class='notice'>You add cables to the APC frame.</span>")
make_terminal()
terminal.connect_to_network()
@@ -530,10 +530,10 @@
else if (istype(W, /obj/item/weapon/electronics/apc) && opened)
if (has_electronics!=0) // there are already electronicks inside
user << "<span class='warning'>You cannot put the board inside, there already is one!</span>"
to_chat(user, "<span class='warning'>You cannot put the board inside, there already is one!</span>")
return
else if (stat & BROKEN)
user << "<span class='warning'>You cannot put the board inside, the frame is damaged!</span>"
to_chat(user, "<span class='warning'>You cannot put the board inside, the frame is damaged!</span>")
return
user.visible_message("[user.name] inserts the power control board into [src].", \
@@ -543,13 +543,13 @@
if(has_electronics==0)
has_electronics = 1
locked = 1 //We placed new, locked board in
user << "<span class='notice'>You place the power control board inside the frame.</span>"
to_chat(user, "<span class='notice'>You place the power control board inside the frame.</span>")
qdel(W)
else if (istype(W, /obj/item/weapon/weldingtool) && opened && has_electronics==0 && !terminal)
var/obj/item/weapon/weldingtool/WT = W
if (WT.get_fuel() < 3)
user << "<span class='warning'>You need more welding fuel to complete this task!</span>"
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task!</span>")
return
user.visible_message("[user.name] welds [src].", \
"<span class='notice'>You start welding the APC frame...</span>", \
@@ -572,24 +572,24 @@
else if (istype(W, /obj/item/wallframe/apc) && opened)
if (!(stat & BROKEN || opened==2 || obj_integrity < max_integrity)) // There is nothing to repair
user << "<span class='warning'>You found no reason for repairing this APC</span>"
to_chat(user, "<span class='warning'>You found no reason for repairing this APC</span>")
return
if (!(stat & BROKEN) && opened==2) // Cover is the only thing broken, we do not need to remove elctronicks to replace cover
user.visible_message("[user.name] replaces missing APC's cover.",\
"<span class='notice'>You begin to replace APC's cover...</span>")
if(do_after(user, 20, target = src)) // replacing cover is quicker than replacing whole frame
user << "<span class='notice'>You replace missing APC's cover.</span>"
to_chat(user, "<span class='notice'>You replace missing APC's cover.</span>")
qdel(W)
opened = 1
update_icon()
return
if (has_electronics)
user << "<span class='warning'>You cannot repair this APC until you remove the electronics still inside!</span>"
to_chat(user, "<span class='warning'>You cannot repair this APC until you remove the electronics still inside!</span>")
return
user.visible_message("[user.name] replaces the damaged APC frame with a new one.",\
"<span class='notice'>You begin to replace the damaged APC frame...</span>")
if(do_after(user, 50, target = src))
user << "<span class='notice'>You replace the damaged APC frame with a new one.</span>"
to_chat(user, "<span class='notice'>You replace the damaged APC frame with a new one.</span>")
qdel(W)
stat &= ~BROKEN
obj_integrity = max_integrity
@@ -623,16 +623,16 @@
/obj/machinery/power/apc/emag_act(mob/user)
if(!emagged && !malfhack)
if(opened)
user << "<span class='warning'>You must close the cover to swipe an ID card!</span>"
to_chat(user, "<span class='warning'>You must close the cover to swipe an ID card!</span>")
else if(panel_open)
user << "<span class='warning'>You must close the panel first!</span>"
to_chat(user, "<span class='warning'>You must close the panel first!</span>")
else if(stat & (BROKEN|MAINT))
user << "<span class='warning'>Nothing happens!</span>"
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
flick("apc-spark", src)
emagged = 1
locked = 0
user << "<span class='notice'>You emag the APC interface.</span>"
to_chat(user, "<span class='notice'>You emag the APC interface.</span>")
update_icon()
// attack with hand - remove cell (if cover open) or interact with the APC
@@ -649,7 +649,7 @@
src.cell = null
user.visible_message("[user.name] removes the power cell from [src.name]!",\
"<span class='notice'>You remove the power cell.</span>")
//user << "You remove the power cell."
//to_chat(user, "You remove the power cell.")
charging = 0
src.update_icon()
return
@@ -681,7 +681,7 @@
"chargingStatus" = charging,
"totalLoad" = lastused_total,
"coverLocked" = coverlocked,
"siliconUser" = user.has_unlimited_silicon_privilege,
"siliconUser" = user.has_unlimited_silicon_privilege || user.using_power_flow_console(),
"malfStatus" = get_malf_status(user),
"powerChannels" = list(
@@ -744,13 +744,13 @@
area.power_environ = (environ > 1)
// if (area.name == "AI Chamber")
// spawn(10)
// world << " [area.name] [area.power_equip]"
// to_chat(world, " [area.name] [area.power_equip]")
else
area.power_light = 0
area.power_equip = 0
area.power_environ = 0
// if (area.name == "AI Chamber")
// world << "[area.power_equip]"
// to_chat(world, "[area.power_equip]")
area.power_change()
/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
@@ -768,7 +768,7 @@
) \
)
if(!loud)
user << "<span class='danger'>\The [src] has eee disabled!</span>"
to_chat(user, "<span class='danger'>\The [src] has eee disabled!</span>")
return FALSE
return TRUE
@@ -779,7 +779,7 @@
if("lock")
if(usr.has_unlimited_silicon_privilege)
if(emagged || (stat & (BROKEN|MAINT)))
usr << "The APC does not respond to the command."
to_chat(usr, "The APC does not respond to the command.")
else
locked = !locked
update_icon()
@@ -840,9 +840,9 @@
if(get_malf_status(malf) != 1)
return
if(malf.malfhacking)
malf << "You are already hacking an APC."
to_chat(malf, "You are already hacking an APC.")
return
malf << "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process."
to_chat(malf, "Beginning override of APC systems. This takes some time, and you cannot perform other actions during the process.")
malf.malfhack = src
malf.malfhacking = addtimer(CALLBACK(malf, /mob/living/silicon/ai/.proc/malfhacked, src), 600, TIMER_STOPPABLE)
@@ -854,10 +854,10 @@
if(!istype(malf))
return
if(istype(malf.loc, /obj/machinery/power/apc)) // Already in an APC
malf << "<span class='warning'>You must evacuate your current APC first!</span>"
to_chat(malf, "<span class='warning'>You must evacuate your current APC first!</span>")
return
if(!malf.can_shunt)
malf << "<span class='warning'>You cannot shunt!</span>"
to_chat(malf, "<span class='warning'>You cannot shunt!</span>")
return
if(src.z != 1)
return
@@ -888,7 +888,7 @@
occupier.parent.verbs -= /mob/living/silicon/ai/proc/corereturn
qdel(occupier)
else
occupier << "<span class='danger'>Primary core damaged, unable to return core processes.</span>"
to_chat(occupier, "<span class='danger'>Primary core damaged, unable to return core processes.</span>")
if(forced)
occupier.loc = src.loc
occupier.death()
@@ -899,19 +899,19 @@
/obj/machinery/power/apc/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/device/aicard/card)
if(card.AI)
user << "<span class='warning'>[card] is already occupied!</span>"
to_chat(user, "<span class='warning'>[card] is already occupied!</span>")
return
if(!occupier)
user << "<span class='warning'>There's nothing in [src] to transfer!</span>"
to_chat(user, "<span class='warning'>There's nothing in [src] to transfer!</span>")
return
if(!occupier.mind || !occupier.client)
user << "<span class='warning'>[occupier] is either inactive, destroyed, or braindead!</span>"
to_chat(user, "<span class='warning'>[occupier] is either inactive or destroyed!</span>")
return
if(!occupier.parent.stat)
user << "<span class='warning'>[occupier] is refusing all attempts at transfer!</span>" //We can return to our core, no need to shunt right now
to_chat(user, "<span class='warning'>[occupier] is refusing all attempts at transfer!</span>" )
return
if(transfer_in_progress)
user << "<span class='warning'>There's already a transfer in progress!</span>"
to_chat(user, "<span class='warning'>There's already a transfer in progress!</span>")
return
if(interaction != AI_TRANS_TO_CARD || occupier.stat)
return
@@ -923,26 +923,26 @@
playsound(src, 'sound/machines/click.ogg', 50, 1)
occupier << sound('sound/misc/notice2.ogg') //To alert the AI that someone's trying to card them if they're tabbed out
if(alert(occupier, "[user] is attempting to transfer you to \a [card.name]. Do you consent to this?", "APC Transfer", "Yes - Transfer Me", "No - Keep Me Here") == "No - Keep Me Here")
user << "<span class='danger'>AI denied transfer request. Process terminated.</span>"
to_chat(user, "<span class='danger'>AI denied transfer request. Process terminated.</span>")
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, 1)
transfer_in_progress = FALSE
return
if(user.loc != T)
user << "<span class='danger'>Location changed. Process terminated.</span>"
occupier << "<span class='warning'>[user] moved away! Transfer canceled.</span>"
to_chat(user, "<span class='danger'>Location changed. Process terminated.</span>")
to_chat(occupier, "<span class='warning'>[user] moved away! Transfer canceled.</span>")
transfer_in_progress = FALSE
return
user << "<span class='notice'>AI accepted request. Transferring stored intelligence to [card]...</span>"
occupier << "<span class='notice'>Transfer starting. You will be moved to [card] shortly.</span>"
to_chat(user, "<span class='notice'>AI accepted request. Transferring stored intelligence to [card]...</span>")
to_chat(occupier, "<span class='notice'>Transfer starting. You will be moved to [card] shortly.</span>")
if(!do_after(user, 50, target = src))
occupier << "<span class='warning'>[user] was interrupted! Transfer canceled.</span>"
to_chat(occupier, "<span class='warning'>[user] was interrupted! Transfer canceled.</span>")
transfer_in_progress = FALSE
return
if(!occupier || !card)
transfer_in_progress = FALSE
return
user.visible_message("<span class='notice'>[user] transfers [occupier] to [card]!</span>", "<span class='notice'>Transfer complete! [occupier] is now stored in [card].</span>")
occupier << "<span class='notice'>Transfer complete! You've been stored in [user]'s [card.name].</span>"
to_chat(occupier, "<span class='notice'>Transfer complete! You've been stored in [user]'s [card.name].</span>")
occupier.forceMove(card)
card.AI = occupier
occupier.parent.shunted = FALSE
+12 -12
View File
@@ -138,15 +138,15 @@ By design, d1 is the smallest direction and d2 is the highest
else if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/coil = W
if (coil.get_amount() < 1)
user << "<span class='warning'>Not enough cable!</span>"
to_chat(user, "<span class='warning'>Not enough cable!</span>")
return
coil.cable_join(src, user)
else if(istype(W, /obj/item/device/multitool))
if(powernet && (powernet.avail > 0)) // is it powered?
user << "<span class='danger'>[powernet.avail]W in power network.</span>"
to_chat(user, "<span class='danger'>[powernet.avail]W in power network.</span>")
else
user << "<span class='danger'>The cable is not powered.</span>"
to_chat(user, "<span class='danger'>The cable is not powered.</span>")
shock(user, 5, 0.2)
src.add_fingerprint(user)
@@ -555,15 +555,15 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
return
if(!T.can_have_cabling())
user << "<span class='warning'>You can only lay cables on catwalks and plating!</span>"
to_chat(user, "<span class='warning'>You can only lay cables on catwalks and plating!</span>")
return
if(get_amount() < 1) // Out of cable
user << "<span class='warning'>There is no cable left!</span>"
to_chat(user, "<span class='warning'>There is no cable left!</span>")
return
if(get_dist(T,user) > 1) // Too far
user << "<span class='warning'>You can't lay cable at a place that far away!</span>"
to_chat(user, "<span class='warning'>You can't lay cable at a place that far away!</span>")
return
else
@@ -576,7 +576,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
for(var/obj/structure/cable/LC in T)
if(LC.d2 == dirn && LC.d1 == 0)
user << "<span class='warning'>There's already a cable at that position!</span>"
to_chat(user, "<span class='warning'>There's already a cable at that position!</span>")
return
var/obj/structure/cable/C = get_new_cable(T)
@@ -617,7 +617,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
return
if(get_dist(C, user) > 1) // make sure it's close enough
user << "<span class='warning'>You can't lay cable at a place that far away!</span>"
to_chat(user, "<span class='warning'>You can't lay cable at a place that far away!</span>")
return
@@ -630,10 +630,10 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
// one end of the clicked cable is pointing towards us
if(C.d1 == dirn || C.d2 == dirn)
if(!U.can_have_cabling()) //checking if it's a plating or catwalk
user << "<span class='warning'>You can only lay cables on catwalks and plating!</span>"
to_chat(user, "<span class='warning'>You can only lay cables on catwalks and plating!</span>")
return
if(U.intact) //can't place a cable if it's a plating with a tile on it
user << "<span class='warning'>You can't lay cable there unless the floor tiles are removed!</span>"
to_chat(user, "<span class='warning'>You can't lay cable there unless the floor tiles are removed!</span>")
return
else
// cable is pointing at us, we're standing on an open tile
@@ -643,7 +643,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
for(var/obj/structure/cable/LC in U) // check to make sure there's not a cable there already
if(LC.d1 == fdirn || LC.d2 == fdirn)
user << "<span class='warning'>There's already a cable at that position!</span>"
to_chat(user, "<span class='warning'>There's already a cable at that position!</span>")
return
var/obj/structure/cable/NC = get_new_cable (U)
@@ -687,7 +687,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \
if(LC == C) // skip the cable we're interacting with
continue
if((LC.d1 == nd1 && LC.d2 == nd2) || (LC.d1 == nd2 && LC.d2 == nd1) ) // make sure no cable matches either direction
user << "<span class='warning'>There's already a cable at that position!</span>"
to_chat(user, "<span class='warning'>There's already a cable at that position!</span>")
return
+3 -3
View File
@@ -86,9 +86,9 @@
/obj/item/weapon/stock_parts/cell/examine(mob/user)
..()
if(rigged)
user << "<span class='danger'>This power cell seems to be faulty!</span>"
to_chat(user, "<span class='danger'>This power cell seems to be faulty!</span>")
else
user << "The charge meter reads [round(src.percent() )]%."
to_chat(user, "The charge meter reads [round(src.percent() )]%.")
/obj/item/weapon/stock_parts/cell/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is licking the electrodes of [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
@@ -98,7 +98,7 @@
..()
if(istype(W, /obj/item/weapon/reagent_containers/syringe))
var/obj/item/weapon/reagent_containers/syringe/S = W
user << "<span class='notice'>You inject the solution into the power cell.</span>"
to_chat(user, "<span class='notice'>You inject the solution into the power cell.</span>")
if(S.reagents.has_reagent("plasma", 5))
rigged = 1
S.reagents.clear_reagents()
+7 -7
View File
@@ -79,24 +79,24 @@
lastgen = 0
if(powernet)
//world << "cold_circ and hot_circ pass"
//to_chat(world, "cold_circ and hot_circ pass")
var/datum/gas_mixture/cold_air = cold_circ.return_transfer_air()
var/datum/gas_mixture/hot_air = hot_circ.return_transfer_air()
//world << "hot_air = [hot_air]; cold_air = [cold_air];"
//to_chat(world, "hot_air = [hot_air]; cold_air = [cold_air];")
if(cold_air && hot_air)
//world << "hot_air = [hot_air] temperature = [hot_air.temperature]; cold_air = [cold_air] temperature = [hot_air.temperature];"
//to_chat(world, "hot_air = [hot_air] temperature = [hot_air.temperature]; cold_air = [cold_air] temperature = [hot_air.temperature];")
//world << "coldair and hotair pass"
//to_chat(world, "coldair and hotair pass")
var/cold_air_heat_capacity = cold_air.heat_capacity()
var/hot_air_heat_capacity = hot_air.heat_capacity()
var/delta_temperature = hot_air.temperature - cold_air.temperature
//world << "delta_temperature = [delta_temperature]; cold_air_heat_capacity = [cold_air_heat_capacity]; hot_air_heat_capacity = [hot_air_heat_capacity]"
//to_chat(world, "delta_temperature = [delta_temperature]; cold_air_heat_capacity = [cold_air_heat_capacity]; hot_air_heat_capacity = [hot_air_heat_capacity]")
if(delta_temperature > 0 && cold_air_heat_capacity > 0 && hot_air_heat_capacity > 0)
var/efficiency = 0.65
@@ -106,12 +106,12 @@
var/heat = energy_transfer*(1-efficiency)
lastgen = energy_transfer*efficiency
//world << "lastgen = [lastgen]; heat = [heat]; delta_temperature = [delta_temperature]; hot_air_heat_capacity = [hot_air_heat_capacity]; cold_air_heat_capacity = [cold_air_heat_capacity];"
//to_chat(world, "lastgen = [lastgen]; heat = [heat]; delta_temperature = [delta_temperature]; hot_air_heat_capacity = [hot_air_heat_capacity]; cold_air_heat_capacity = [cold_air_heat_capacity];")
hot_air.temperature = hot_air.temperature - energy_transfer/hot_air_heat_capacity
cold_air.temperature = cold_air.temperature + heat/cold_air_heat_capacity
//world << "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]"
//to_chat(world, "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]")
add_avail(lastgen)
// update icon overlays only if displayed level has changed
+6 -6
View File
@@ -191,7 +191,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
switch(broken_state)
if(GRAV_NEEDS_SCREWDRIVER)
if(istype(I, /obj/item/weapon/screwdriver))
user << "<span class='notice'>You secure the screws of the framework.</span>"
to_chat(user, "<span class='notice'>You secure the screws of the framework.</span>")
playsound(src.loc, I.usesound, 50, 1)
broken_state++
update_icon()
@@ -200,28 +200,28 @@ var/const/GRAV_NEEDS_WRENCH = 3
if(istype(I, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = I
if(WT.remove_fuel(1, user))
user << "<span class='notice'>You mend the damaged framework.</span>"
to_chat(user, "<span class='notice'>You mend the damaged framework.</span>")
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
broken_state++
update_icon()
else if(WT.isOn())
user << "<span class='warning'>You don't have enough fuel to mend the damaged framework!</span>"
to_chat(user, "<span class='warning'>You don't have enough fuel to mend the damaged framework!</span>")
return
if(GRAV_NEEDS_PLASTEEL)
if(istype(I, /obj/item/stack/sheet/plasteel))
var/obj/item/stack/sheet/plasteel/PS = I
if(PS.get_amount() >= 10)
PS.use(10)
user << "<span class='notice'>You add the plating to the framework.</span>"
to_chat(user, "<span class='notice'>You add the plating to the framework.</span>")
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
broken_state++
update_icon()
else
user << "<span class='warning'>You need 10 sheets of plasteel!</span>"
to_chat(user, "<span class='warning'>You need 10 sheets of plasteel!</span>")
return
if(GRAV_NEEDS_WRENCH)
if(istype(I, /obj/item/weapon/wrench))
user << "<span class='notice'>You secure the plating to the framework.</span>"
to_chat(user, "<span class='notice'>You secure the plating to the framework.</span>")
playsound(src.loc, I.usesound, 75, 1)
set_fix()
return
+36 -27
View File
@@ -25,6 +25,15 @@
result_path = /obj/structure/light_construct/small
materials = list(MAT_METAL=MINERAL_MATERIAL_AMOUNT)
/obj/item/wallframe/light_fixture/try_build(turf/on_wall, user)
if(!..())
return
var/area/A = get_area(user)
if(A.dynamic_lighting != DYNAMIC_LIGHTING_ENABLED)
to_chat(user, "<span class='warning'>You cannot place [src] in this area!</span>")
return
return TRUE
/obj/structure/light_construct
name = "light fixture frame"
@@ -51,11 +60,11 @@
..()
switch(src.stage)
if(1)
user << "It's an empty frame."
to_chat(user, "It's an empty frame.")
if(2)
user << "It's wired."
to_chat(user, "It's wired.")
if(3)
user << "The casing is closed."
to_chat(user, "The casing is closed.")
/obj/structure/light_construct/attackby(obj/item/weapon/W, mob/user, params)
add_fingerprint(user)
@@ -63,7 +72,7 @@
if(1)
if(istype(W, /obj/item/weapon/wrench))
playsound(src.loc, W.usesound, 75, 1)
usr << "<span class='notice'>You begin deconstructing [src]...</span>"
to_chat(usr, "<span class='notice'>You begin deconstructing [src]...</span>")
if (!do_after(usr, 30*W.toolspeed, target = src))
return
new /obj/item/stack/sheet/metal( get_turf(src.loc), sheets_refunded )
@@ -85,11 +94,11 @@
user.visible_message("[user.name] adds wires to [src].", \
"<span class='notice'>You add wires to [src].</span>")
else
user << "<span class='warning'>You need one length of cable to wire [src]!</span>"
to_chat(user, "<span class='warning'>You need one length of cable to wire [src]!</span>")
return
if(2)
if(istype(W, /obj/item/weapon/wrench))
usr << "<span class='warning'>You have to remove the wires first!</span>"
to_chat(usr, "<span class='warning'>You have to remove the wires first!</span>")
return
if(istype(W, /obj/item/weapon/wirecutters))
@@ -238,7 +247,7 @@
update_icon()
if(on)
if(!light || light.luminosity != brightness)
if(!light || light.light_range != brightness)
switchcount++
if(rigged)
if(status == LIGHT_OK && trigger)
@@ -248,10 +257,10 @@
burn_out()
else
use_power = 2
SetLuminosity(brightness)
set_light(brightness)
else
use_power = 1
SetLuminosity(0)
set_light(0)
active_power_usage = (brightness * 10)
if(on != on_gs)
@@ -268,7 +277,7 @@
status = LIGHT_BURNED
icon_state = "[base_state]-burned"
on = 0
SetLuminosity(0)
set_light(0)
// attempt to set the light's on/off status
// will not switch on if broken/burned/empty
@@ -281,13 +290,13 @@
..()
switch(status)
if(LIGHT_OK)
user << "It is turned [on? "on" : "off"]."
to_chat(user, "It is turned [on? "on" : "off"].")
if(LIGHT_EMPTY)
user << "The [fitting] has been removed."
to_chat(user, "The [fitting] has been removed.")
if(LIGHT_BURNED)
user << "The [fitting] is burnt out."
to_chat(user, "The [fitting] is burnt out.")
if(LIGHT_BROKEN)
user << "The [fitting] has been smashed."
to_chat(user, "The [fitting] has been smashed.")
@@ -303,7 +312,7 @@
// attempt to insert light
else if(istype(W, /obj/item/weapon/light))
if(status == LIGHT_OK)
user << "<span class='warning'>There is a [fitting] already inserted!</span>"
to_chat(user, "<span class='warning'>There is a [fitting] already inserted!</span>")
else
src.add_fingerprint(user)
var/obj/item/weapon/light/L = W
@@ -314,9 +323,9 @@
src.add_fingerprint(user)
if(status != LIGHT_EMPTY)
drop_light_tube(user)
user << "<span class='notice'>You replace [L].</span>"
to_chat(user, "<span class='notice'>You replace [L].</span>")
else
user << "<span class='notice'>You insert [L].</span>"
to_chat(user, "<span class='notice'>You insert [L].</span>")
status = L.status
switchcount = L.switchcount
rigged = L.rigged
@@ -329,7 +338,7 @@
if(on && rigged)
explode()
else
user << "<span class='warning'>This type of light requires a [fitting]!</span>"
to_chat(user, "<span class='warning'>This type of light requires a [fitting]!</span>")
// attempt to stick weapon into light socket
else if(status == LIGHT_EMPTY)
@@ -339,7 +348,7 @@
"<span class='notice'>You open [src]'s casing.</span>", "<span class='italics'>You hear a noise.</span>")
deconstruct()
else
user << "<span class='userdanger'>You stick \the [W] into the light socket!</span>"
to_chat(user, "<span class='userdanger'>You stick \the [W] into the light socket!</span>")
if(has_power() && (W.flags & CONDUCT))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(3, 1, src)
@@ -439,7 +448,7 @@
add_fingerprint(user)
if(status == LIGHT_EMPTY)
user << "There is no [fitting] in this light."
to_chat(user, "There is no [fitting] in this light.")
return
// make it burn hands if not wearing fire-insulated gloves
@@ -457,18 +466,18 @@
prot = 1
if(prot > 0)
user << "<span class='notice'>You remove the light [fitting].</span>"
to_chat(user, "<span class='notice'>You remove the light [fitting].</span>")
else if(istype(user) && user.dna.check_mutation(TK))
user << "<span class='notice'>You telekinetically remove the light [fitting].</span>"
to_chat(user, "<span class='notice'>You telekinetically remove the light [fitting].</span>")
else
user << "<span class='warning'>You try to remove the light [fitting], but you burn your hand on it!</span>"
to_chat(user, "<span class='warning'>You try to remove the light [fitting], but you burn your hand on it!</span>")
var/obj/item/bodypart/affecting = H.get_bodypart("[(user.active_hand_index % 2 == 0) ? "r" : "l" ]_arm")
if(affecting && affecting.receive_damage( 0, 5 )) // 5 burn damage
H.update_damage_overlays()
return // if burned, don't remove the light
else
user << "<span class='notice'>You remove the light [fitting].</span>"
to_chat(user, "<span class='notice'>You remove the light [fitting].</span>")
// create a light tube/bulb item and put it in the user's hand
drop_light_tube(user)
@@ -494,10 +503,10 @@
/obj/machinery/light/attack_tk(mob/user)
if(status == LIGHT_EMPTY)
user << "There is no [fitting] in this light."
to_chat(user, "There is no [fitting] in this light.")
return
user << "<span class='notice'>You telekinetically remove the light [fitting].</span>"
to_chat(user, "<span class='notice'>You telekinetically remove the light [fitting].</span>")
// create a light tube/bulb item and put it in the user's hand
drop_light_tube()
@@ -616,7 +625,7 @@
if(istype(I, /obj/item/weapon/reagent_containers/syringe))
var/obj/item/weapon/reagent_containers/syringe/S = I
user << "<span class='notice'>You inject the solution into \the [src].</span>"
to_chat(user, "<span class='notice'>You inject the solution into \the [src].</span>")
if(S.reagents.has_reagent("plasma", 5))
+1
View File
@@ -3,6 +3,7 @@
desc = "It monitors power levels across the station."
icon_screen = "power"
icon_keyboard = "power_key"
light_color = LIGHT_COLOR_YELLOW
use_power = 2
idle_power_usage = 20
active_power_usage = 100
+9 -9
View File
@@ -86,7 +86,7 @@ display round(lastgen) and plasmatank amount
/obj/machinery/power/port_gen/examine(mob/user)
..()
user << "It is[!active?"n't":""] running."
to_chat(user, "It is[!active?"n't":""] running.")
/obj/machinery/power/port_gen/pacman
name = "\improper P.A.C.M.A.N.-type portable generator"
@@ -151,8 +151,8 @@ display round(lastgen) and plasmatank amount
/obj/machinery/power/port_gen/pacman/examine(mob/user)
..()
user << "<span class='notice'>The generator has [sheets] units of [sheet_name] fuel left, producing [power_gen] per cycle.</span>"
if(crit_fail) user << "<span class='danger'>The generator seems to have broken down.</span>"
to_chat(user, "<span class='notice'>The generator has [sheets] units of [sheet_name] fuel left, producing [power_gen] per cycle.</span>")
if(crit_fail) to_chat(user, "<span class='danger'>The generator seems to have broken down.</span>")
/obj/machinery/power/port_gen/pacman/HasFuel()
if(sheets >= 1 / (time_per_sheet / power_output) - sheet_left)
@@ -214,9 +214,9 @@ display round(lastgen) and plasmatank amount
var/obj/item/stack/addstack = O
var/amount = min((max_sheets - sheets), addstack.amount)
if(amount < 1)
user << "<span class='notice'>The [src.name] is full!</span>"
to_chat(user, "<span class='notice'>The [src.name] is full!</span>")
return
user << "<span class='notice'>You add [amount] sheets to the [src.name].</span>"
to_chat(user, "<span class='notice'>You add [amount] sheets to the [src.name].</span>")
sheets += amount
addstack.use(amount)
updateUsrDialog()
@@ -230,11 +230,11 @@ display round(lastgen) and plasmatank amount
if(!anchored && !isinspace())
connect_to_network()
user << "<span class='notice'>You secure the generator to the floor.</span>"
to_chat(user, "<span class='notice'>You secure the generator to the floor.</span>")
anchored = 1
else if(anchored)
disconnect_from_network()
user << "<span class='notice'>You unsecure the generator from the floor.</span>"
to_chat(user, "<span class='notice'>You unsecure the generator from the floor.</span>")
anchored = 0
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
@@ -243,9 +243,9 @@ display round(lastgen) and plasmatank amount
panel_open = !panel_open
playsound(src.loc, O.usesound, 50, 1)
if(panel_open)
user << "<span class='notice'>You open the access panel.</span>"
to_chat(user, "<span class='notice'>You open the access panel.</span>")
else
user << "<span class='notice'>You close the access panel.</span>"
to_chat(user, "<span class='notice'>You close the access panel.</span>")
return
else if(default_deconstruction_crowbar(O))
return
+8 -8
View File
@@ -49,14 +49,14 @@ var/global/list/rad_collectors = list()
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [loaded_tank?"Fuel: [round(loaded_tank.air_contents.gases["plasma"][MOLES]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
return
else
user << "<span class='warning'>The controls are locked!</span>"
to_chat(user, "<span class='warning'>The controls are locked!</span>")
return
..()
/obj/machinery/power/rad_collector/can_be_unfasten_wrench(mob/user, silent)
if(loaded_tank)
if(!silent)
user << "<span class='warning'>Remove the plasma tank first!</span>"
to_chat(user, "<span class='warning'>Remove the plasma tank first!</span>")
return FAILED_UNFASTEN
return ..()
@@ -70,16 +70,16 @@ var/global/list/rad_collectors = list()
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/device/multitool))
user << "<span class='notice'>The [W.name] detects that [last_power]W were recently produced.</span>"
to_chat(user, "<span class='notice'>The [W.name] detects that [last_power]W were recently produced.</span>")
return 1
else if(istype(W, /obj/item/device/analyzer) && loaded_tank)
atmosanalyzer_scan(loaded_tank.air_contents, user)
else if(istype(W, /obj/item/weapon/tank/internals/plasma))
if(!anchored)
user << "<span class='warning'>The [src] needs to be secured to the floor first!</span>"
to_chat(user, "<span class='warning'>The [src] needs to be secured to the floor first!</span>")
return 1
if(loaded_tank)
user << "<span class='warning'>There's already a plasma tank loaded!</span>"
to_chat(user, "<span class='warning'>There's already a plasma tank loaded!</span>")
return 1
if(!user.drop_item())
return 1
@@ -97,11 +97,11 @@ var/global/list/rad_collectors = list()
if(allowed(user))
if(active)
locked = !locked
user << "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>"
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>")
else
user << "<span class='warning'>The controls can only be locked when \the [src] is active!</span>"
to_chat(user, "<span class='warning'>The controls can only be locked when \the [src] is active!</span>")
else
user << "<span class='danger'>Access denied.</span>"
to_chat(user, "<span class='danger'>Access denied.</span>")
return 1
else
return ..()
+18 -18
View File
@@ -67,7 +67,7 @@
if(usr.stat || !usr.canmove || usr.restrained())
return
if (src.anchored)
usr << "<span class='warning'>It is fastened to the floor!</span>"
to_chat(usr, "<span class='warning'>It is fastened to the floor!</span>")
return 0
src.setDir(turn(src.dir, 270))
return 1
@@ -75,7 +75,7 @@
/obj/machinery/power/emitter/AltClick(mob/user)
..()
if(user.incapacitated())
user << "<span class='warning'>You can't do that right now!</span>"
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
@@ -105,26 +105,26 @@
src.add_fingerprint(user)
if(state == 2)
if(!powernet)
user << "<span class='warning'>The emitter isn't connected to a wire!</span>"
to_chat(user, "<span class='warning'>The emitter isn't connected to a wire!</span>")
return 1
if(!src.locked)
if(src.active==1)
src.active = 0
user << "<span class='notice'>You turn off \the [src].</span>"
to_chat(user, "<span class='notice'>You turn off \the [src].</span>")
message_admins("Emitter turned off by [key_name_admin(user)](<A HREF='?_src_=holder;adminmoreinfo=\ref[user]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[user]'>FLW</A>) in ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1)
log_game("Emitter turned off by [key_name(user)] in ([x],[y],[z])")
investigate_log("turned <font color='red'>off</font> by [key_name(user)] at [get_area(src)]","singulo")
else
src.active = 1
user << "<span class='notice'>You turn on \the [src].</span>"
to_chat(user, "<span class='notice'>You turn on \the [src].</span>")
src.shot_number = 0
src.fire_delay = maximum_fire_delay
investigate_log("turned <font color='green'>on</font> by [key_name(user)] at [get_area(src)]","singulo")
update_icon()
else
user << "<span class='warning'>The controls are locked!</span>"
to_chat(user, "<span class='warning'>The controls are locked!</span>")
else
user << "<span class='warning'>The [src] needs to be firmly secured to the floor first!</span>"
to_chat(user, "<span class='warning'>The [src] needs to be firmly secured to the floor first!</span>")
return 1
/obj/machinery/power/emitter/attack_animal(mob/living/simple_animal/M)
@@ -196,7 +196,7 @@
src.shot_number = 0
var/obj/item/projectile/A = new projectile_type(src.loc)
A.setDir(src.dir)
playsound(src.loc, projectile_sound, 100, 1, 7)
playsound(src.loc, projectile_sound, 25, 1)
if(prob(35))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(5, 1, src)
@@ -220,7 +220,7 @@
/obj/machinery/power/emitter/can_be_unfasten_wrench(mob/user, silent)
if(state == EM_WELDED)
if(!silent)
user << "<span class='warning'>[src] is welded to the floor!</span>"
to_chat(user, "<span class='warning'>[src] is welded to the floor!</span>")
return FAILED_UNFASTEN
return ..()
@@ -235,7 +235,7 @@
/obj/machinery/power/emitter/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench))
if(active)
user << "<span class='warning'>Turn \the [src] off first!</span>"
to_chat(user, "<span class='warning'>Turn \the [src] off first!</span>")
return
default_unfasten_wrench(user, W, 0)
return
@@ -243,11 +243,11 @@
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(active)
user << "Turn \the [src] off first."
to_chat(user, "Turn \the [src] off first.")
return
switch(state)
if(EM_UNSECURED)
user << "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>"
to_chat(user, "<span class='warning'>The [src.name] needs to be wrenched to the floor!</span>")
if(EM_SECURED)
if(WT.remove_fuel(0,user))
playsound(loc, WT.usesound, 50, 1)
@@ -256,7 +256,7 @@
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && WT.isOn())
state = EM_WELDED
user << "<span class='notice'>You weld \the [src] to the floor.</span>"
to_chat(user, "<span class='notice'>You weld \the [src] to the floor.</span>")
connect_to_network()
if(EM_WELDED)
if(WT.remove_fuel(0,user))
@@ -266,22 +266,22 @@
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && WT.isOn())
state = EM_SECURED
user << "<span class='notice'>You cut \the [src] free from the floor.</span>"
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
disconnect_from_network()
return
if(W.GetID())
if(emagged)
user << "<span class='warning'>The lock seems to be broken!</span>"
to_chat(user, "<span class='warning'>The lock seems to be broken!</span>")
return
if(allowed(user))
if(active)
locked = !locked
user << "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>"
to_chat(user, "<span class='notice'>You [src.locked ? "lock" : "unlock"] the controls.</span>")
else
user << "<span class='warning'>The controls can only be locked when \the [src] is online!</span>"
to_chat(user, "<span class='warning'>The controls can only be locked when \the [src] is online!</span>")
else
user << "<span class='danger'>Access denied.</span>"
to_chat(user, "<span class='danger'>Access denied.</span>")
return
if(is_wire_tool(W) && panel_open)
@@ -64,7 +64,7 @@ field_generator power level display
if(state == FG_WELDED)
if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on
if(active >= FG_CHARGING)
user << "<span class='warning'>You are unable to turn off the [name] once it is online!</span>"
to_chat(user, "<span class='warning'>You are unable to turn off the [name] once it is online!</span>")
return 1
else
user.visible_message("[user.name] turns on the [name].", \
@@ -75,12 +75,12 @@ field_generator power level display
add_fingerprint(user)
else
user << "<span class='warning'>The [src] needs to be firmly secured to the floor first!</span>"
to_chat(user, "<span class='warning'>The [src] needs to be firmly secured to the floor first!</span>")
/obj/machinery/field/generator/can_be_unfasten_wrench(mob/user, silent)
if(state == FG_WELDED)
if(!silent)
user << "<span class='warning'>[src] is welded to the floor!</span>"
to_chat(user, "<span class='warning'>[src] is welded to the floor!</span>")
return FAILED_UNFASTEN
return ..()
@@ -94,7 +94,7 @@ field_generator power level display
/obj/machinery/field/generator/attackby(obj/item/W, mob/user, params)
if(active)
user << "<span class='warning'>[src] needs to be off!</span>"
to_chat(user, "<span class='warning'>[src] needs to be off!</span>")
return
else if(istype(W, /obj/item/weapon/wrench))
default_unfasten_wrench(user, W, 0)
@@ -103,7 +103,7 @@ field_generator power level display
var/obj/item/weapon/weldingtool/WT = W
switch(state)
if(FG_UNSECURED)
user << "<span class='warning'>The [name] needs to be wrenched to the floor!</span>"
to_chat(user, "<span class='warning'>The [name] needs to be wrenched to the floor!</span>")
if(FG_SECURED)
if (WT.remove_fuel(0,user))
@@ -113,7 +113,7 @@ field_generator power level display
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && state == FG_SECURED && WT.isOn())
state = FG_WELDED
user << "<span class='notice'>You weld the field generator to the floor.</span>"
to_chat(user, "<span class='notice'>You weld the field generator to the floor.</span>")
if(FG_WELDED)
if (WT.remove_fuel(0,user))
@@ -123,7 +123,7 @@ field_generator power level display
"<span class='italics'>You hear welding.</span>")
if(do_after(user,20*W.toolspeed, target = src) && state == FG_WELDED && WT.isOn())
state = FG_SECURED
user << "<span class='notice'>You cut \the [src] free from the floor.</span>"
to_chat(user, "<span class='notice'>You cut \the [src] free from the floor.</span>")
else
return ..()
+7 -4
View File
@@ -11,6 +11,9 @@
move_self = 1 //Do we move on our own?
grav_pull = 5 //How many tiles out do we pull?
consume_range = 6 //How many tiles out do we eat
light_power = 0.7
light_range = 15
light_color = rgb(255, 0, 0)
var/clashing = FALSE //If Nar-Sie is fighting Ratvar
/obj/singularity/narsie/large
@@ -73,7 +76,7 @@
for(var/mob/living/carbon/M in viewers(consume_range, src))
if(M.stat == CONSCIOUS)
if(!iscultist(M))
M << "<span class='cultsmall'>You feel conscious thought crumble away in an instant as you gaze upon [src.name]...</span>"
to_chat(M, "<span class='cultsmall'>You feel conscious thought crumble away in an instant as you gaze upon [src.name]...</span>")
M.apply_effect(3, STUN)
@@ -128,12 +131,12 @@
/obj/singularity/narsie/proc/acquire(atom/food)
if(food == target)
return
target << "<span class='cultsmall'>NAR-SIE HAS LOST INTEREST IN YOU.</span>"
to_chat(target, "<span class='cultsmall'>NAR-SIE HAS LOST INTEREST IN YOU.</span>")
target = food
if(isliving(target))
target << "<span class ='cult'>NAR-SIE HUNGERS FOR YOUR SOUL.</span>"
to_chat(target, "<span class ='cult'>NAR-SIE HUNGERS FOR YOUR SOUL.</span>")
else
target << "<span class ='cult'>NAR-SIE HAS CHOSEN YOU TO LEAD HER TO HER NEXT MEAL.</span>"
to_chat(target, "<span class ='cult'>NAR-SIE HAS CHOSEN YOU TO LEAD HER TO HER NEXT MEAL.</span>")
//Wizard narsie
/obj/singularity/narsie/wizard
@@ -41,13 +41,13 @@
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
user << "Looks like it's not attached to the flooring"
to_chat(user, "Looks like it's not attached to the flooring")
if(PA_CONSTRUCTION_UNWIRED)
user << "It is missing some cables"
to_chat(user, "It is missing some cables")
if(PA_CONSTRUCTION_PANEL_OPEN)
user << "The panel is open"
to_chat(user, "The panel is open")
user << "<span class='notice'>Alt-click to rotate it clockwise.</span>"
to_chat(user, "<span class='notice'>Alt-click to rotate it clockwise.</span>")
/obj/structure/particle_accelerator/Destroy()
construction_state = PA_CONSTRUCTION_UNSECURED
@@ -65,7 +65,7 @@
if(usr.stat || !usr.canmove || usr.restrained())
return
if (anchored)
usr << "It is fastened to the floor!"
to_chat(usr, "It is fastened to the floor!")
return 0
setDir(turn(dir, -90))
return 1
@@ -73,7 +73,7 @@
/obj/structure/particle_accelerator/AltClick(mob/user)
..()
if(user.incapacitated())
user << "<span class='warning'>You can't do that right now!</span>"
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!in_range(src, user))
return
@@ -88,7 +88,7 @@
if(usr.stat || !usr.canmove || usr.restrained())
return
if (anchored)
usr << "It is fastened to the floor!"
to_chat(usr, "It is fastened to the floor!")
return 0
setDir(turn(dir, 90))
return 1
@@ -81,7 +81,7 @@
return
if(!interface_control)
usr << "<span class='error'>ERROR: Request timed out. Check wire contacts.</span>"
to_chat(usr, "<span class='error'>ERROR: Request timed out. Check wire contacts.</span>")
return
if(href_list["close"])
@@ -258,11 +258,11 @@
..()
switch(construction_state)
if(PA_CONSTRUCTION_UNSECURED)
user << "Looks like it's not attached to the flooring"
to_chat(user, "Looks like it's not attached to the flooring")
if(PA_CONSTRUCTION_UNWIRED)
user << "It is missing some cables"
to_chat(user, "It is missing some cables")
if(PA_CONSTRUCTION_PANEL_OPEN)
user << "The panel is open"
to_chat(user, "The panel is open")
/obj/machinery/particle_accelerator/control_box/attackby(obj/item/W, mob/user, params)
@@ -322,9 +322,6 @@
if(prob(50))
qdel(src)
/obj/machinery/particle_accelerator/control_box/emp_act(severity)
return
#undef PA_CONSTRUCTION_UNSECURED
#undef PA_CONSTRUCTION_UNWIRED
#undef PA_CONSTRUCTION_PANEL_OPEN
@@ -415,7 +415,7 @@
if(istype(H.glasses, /obj/item/clothing/glasses/meson))
var/obj/item/clothing/glasses/meson/MS = H.glasses
if(MS.vision_flags == SEE_TURFS)
H << "<span class='notice'>You look directly into the [src.name], good thing you had your protective eyewear on!</span>"
to_chat(H, "<span class='notice'>You look directly into the [src.name], good thing you had your protective eyewear on!</span>")
return
M.apply_effect(3, STUN)
+9 -9
View File
@@ -44,7 +44,7 @@
/obj/machinery/power/smes/examine(user)
..()
if(!terminal)
user << "<span class='warning'>This SMES has no power terminal!</span>"
to_chat(user, "<span class='warning'>This SMES has no power terminal!</span>")
/obj/machinery/power/smes/New()
..()
@@ -106,10 +106,10 @@
if(term && term.dir == turn(dir, 180))
terminal = term
terminal.master = src
user << "<span class='notice'>Terminal found.</span>"
to_chat(user, "<span class='notice'>Terminal found.</span>")
break
if(!terminal)
user << "<span class='alert'>No power terminal found.</span>"
to_chat(user, "<span class='alert'>No power terminal found.</span>")
return
stat &= ~BROKEN
update_icon()
@@ -126,25 +126,25 @@
return
if(terminal) //is there already a terminal ?
user << "<span class='warning'>This SMES already has a power terminal!</span>"
to_chat(user, "<span class='warning'>This SMES already has a power terminal!</span>")
return
if(!panel_open) //is the panel open ?
user << "<span class='warning'>You must open the maintenance panel first!</span>"
to_chat(user, "<span class='warning'>You must open the maintenance panel first!</span>")
return
var/turf/T = get_turf(user)
if (T.intact) //is the floor plating removed ?
user << "<span class='warning'>You must first remove the floor plating!</span>"
to_chat(user, "<span class='warning'>You must first remove the floor plating!</span>")
return
var/obj/item/stack/cable_coil/C = I
if(C.get_amount() < 10)
user << "<span class='warning'>You need more wires!</span>"
to_chat(user, "<span class='warning'>You need more wires!</span>")
return
user << "<span class='notice'>You start building the power terminal...</span>"
to_chat(user, "<span class='notice'>You start building the power terminal...</span>")
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(do_after(user, 20, target = src) && C.get_amount() >= 10)
@@ -186,7 +186,7 @@
/obj/machinery/power/smes/default_deconstruction_crowbar(obj/item/weapon/crowbar/C)
if(istype(C) && terminal)
usr << "<span class='warning'>You must first remove the power terminal!</span>"
to_chat(usr, "<span class='warning'>You must first remove the power terminal!</span>")
return FALSE
return ..()
+5 -5
View File
@@ -207,7 +207,7 @@
/obj/item/solar_assembly/attackby(obj/item/weapon/W, mob/user, params)
if(istype(W, /obj/item/weapon/wrench) && isturf(loc))
if(isinspace())
user << "<span class='warning'>You can't secure [src] here.</span>"
to_chat(user, "<span class='warning'>You can't secure [src] here.</span>")
return
anchored = !anchored
if(anchored)
@@ -220,7 +220,7 @@
if(istype(W, /obj/item/stack/sheet/glass) || istype(W, /obj/item/stack/sheet/rglass))
if(!anchored)
user << "<span class='warning'>You need to secure the assembly before you can add glass.</span>"
to_chat(user, "<span class='warning'>You need to secure the assembly before you can add glass.</span>")
return
var/obj/item/stack/sheet/S = W
if(S.use(2))
@@ -232,7 +232,7 @@
else
new /obj/machinery/power/solar(get_turf(src), src)
else
user << "<span class='warning'>You need two sheets of glass to put them into a solar panel!</span>"
to_chat(user, "<span class='warning'>You need two sheets of glass to put them into a solar panel!</span>")
return
return 1
@@ -412,7 +412,7 @@
playsound(src.loc, I.usesound, 50, 1)
if(do_after(user, 20*I.toolspeed, target = src))
if (src.stat & BROKEN)
user << "<span class='notice'>The broken glass falls out.</span>"
to_chat(user, "<span class='notice'>The broken glass falls out.</span>")
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer( src.loc )
new /obj/item/weapon/shard( src.loc )
var/obj/item/weapon/circuitboard/computer/solar_control/M = new /obj/item/weapon/circuitboard/computer/solar_control( A )
@@ -424,7 +424,7 @@
A.anchored = 1
qdel(src)
else
user << "<span class='notice'>You disconnect the monitor.</span>"
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer( src.loc )
var/obj/item/weapon/circuitboard/computer/solar_control/M = new /obj/item/weapon/circuitboard/computer/solar_control( A )
for (var/obj/C in src)
+323 -79
View File
@@ -2,28 +2,55 @@
//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
#define PLASMA_HEAT_PENALTY 15 // Higher == Bigger heat and waste penalty from having the crystal surrounded by this gas. Negative numbers reduce penalty.
#define OXYGEN_HEAT_PENALTY 1
#define CO2_HEAT_PENALTY 0.1
#define NITROGEN_HEAT_MODIFIER -1.5
#define OXYGEN_TRANSMIT_MODIFIER 1.5 //Higher == Bigger bonus to power generation.
#define PLASMA_TRANSMIT_MODIFIER 4
#define FREON_TRANSMIT_PENALTY 0.75 // Scales how much freon reduces total power transmission. 1 equals 1% per 1% of freon in the mix.
#define N2O_HEAT_RESISTANCE 6 //Higher == Gas makes the crystal more resistant against heat damage.
#define POWERLOSS_INHIBITION_GAS_THRESHOLD 0.20 //Higher == Higher percentage of inhibitor gas needed before the charge inertia chain reaction effect starts.
#define POWERLOSS_INHIBITION_MOLE_THRESHOLD 100 //Higher == More moles of the gas are needed before the charge inertia chain reaction effect starts. //Scales powerloss inhibition down until this amount of moles is reached
#define POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD 500 //bonus powerloss inhibition boost if this amount of moles is reached
#define MOLE_PENALTY_THRESHOLD 1800 //Higher == Shard can absorb more moles before triggering the high mole penalties.
#define MOLE_HEAT_PENALTY 350 //Heat damage scales around this. Too hot setups with this amount of moles do regular damage, anything above and below is scaled
#define POWER_PENALTY_THRESHOLD 5000 //Higher == Engine can generate more power before triggering the high power penalties.
#define SEVERE_POWER_PENALTY_THRESHOLD 7000 //Same as above, but causes more dangerous effects
#define CRITICAL_POWER_PENALTY_THRESHOLD 9000 //Even more dangerous effects, threshold for tesla delamination
#define HEAT_PENALTY_THRESHOLD 40 //Higher == Crystal safe operational temperature is higher.
#define DAMAGE_HARDCAP 0.01
#define THERMAL_RELEASE_MODIFIER 5 //Higher == less heat released during reaction, not to be confused with the above values
#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 FREON_BREEDING_MODIFIER 100 //Higher == less freon created
#define REACTION_POWER_MODIFIER 0.55 //Higher == more overall power
#define MATTER_POWER_CONVERSION 10 //Crystal converts 1/this value of stored matter into energy.
//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.
#define WARNING_DELAY 30
#define HALLUCINATION_RANGE(P) (min(7, round(P ** 0.25)))
/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>"
desc = "A strangely translucent and iridescent crystal that looks like it used to be part of a larger structure."
icon = 'icons/obj/supermatter.dmi'
icon_state = "darkmatter_shard"
density = 1
anchored = 0
luminosity = 4
light_range = 4
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
critical_machine = TRUE
@@ -43,12 +70,31 @@
var/emergency_issued = 0
var/explosion_power = 320
var/explosion_power = 12
var/temp_factor = 30
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.
var/n2comp = 0 // raw composition of each gas in the chamber, ranges from 0 to 1
var/freoncomp = 0
var/plasmacomp = 0
var/o2comp = 0
var/co2comp = 0
var/n2ocomp = 0
var/combined_gas = 0
var/gasmix_power_ratio = 0
var/dynamic_heat_modifier = 1
var/dynamic_heat_resistance = 1
var/powerloss_inhibitor = 1
var/powerloss_dynamic_scaling= 0
var/power_transmission_bonus = 0
var/mole_heat_penalty = 0
var/freon_transmit_modifier = 1
var/matter_power = 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
@@ -69,6 +115,9 @@
var/produces_gas = 1
var/obj/effect/countdown/supermatter/countdown
/obj/machinery/power/supermatter_shard/make_frozen_visual()
return
/obj/machinery/power/supermatter_shard/New()
. = ..()
countdown = new(src)
@@ -90,13 +139,42 @@
countdown = null
. = ..()
/obj/machinery/power/supermatter_shard/examine(mob/user)
..()
if(!ishuman(user))
return
var/range = HALLUCINATION_RANGE(power)
for(var/mob/living/carbon/human/H in viewers(range, src))
if(H != user)
continue
if(!istype(H.glasses, /obj/item/clothing/glasses/meson))
to_chat(H, "<span class='danger'>You get headaches just from looking at it.</span>")
return
/obj/machinery/power/supermatter_shard/get_spans()
return list(SPAN_ROBOT)
/obj/machinery/power/supermatter_shard/proc/explode()
investigate_log("has collapsed into a singularity.", "supermatter")
var/turf/T = get_turf(src)
if(T)
var/obj/singularity/S = new(T)
S.energy = explosion_power
S.consume(src)
for(var/mob/M in mob_list)
if(M.z == z)
M << 'sound/magic/Charge.ogg'
to_chat(M, "<span class='boldannounce'>You feel reality distort for a moment...</span>")
if(combined_gas > MOLE_PENALTY_THRESHOLD)
investigate_log("has collapsed into a singularity.", "supermatter")
if(T)
var/obj/singularity/S = new(T)
S.energy = 800
S.consume(src)
else
investigate_log("has exploded.", "supermatter")
explosion(get_turf(T), explosion_power * max(gasmix_power_ratio, 0.205) * 0.5 , explosion_power * max(gasmix_power_ratio, 0.205) + 2, explosion_power * max(gasmix_power_ratio, 0.205) + 4 , explosion_power * max(gasmix_power_ratio, 0.205) + 6, 1, 1)
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
investigate_log("has spawned additional energy balls.", "supermatter")
var/obj/singularity/energy_ball/E = new(T)
E.energy = power
qdel(src)
/obj/machinery/power/supermatter_shard/process()
var/turf/T = loc
@@ -107,43 +185,6 @@
if(!istype(T)) //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(isspaceturf(T)) // 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.talk_into(src, "[emergency_alert] Instability: [stability]%")
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.talk_into(src, "[warning_alert] Instability: [stability]%")
lastwarning = world.timeofday - 150
else // Phew, we're safe
radio.talk_into(src, "[safe_alert]")
lastwarning = world.timeofday
if(damage > explosion_point)
for(var/mob in living_mob_list)
var/mob/living/L = mob
if(istype(L) && L.z == 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(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(L, src) + 1) )
L.rad_act(rads)
explode()
return
//Ok, get the air from the turf
var/datum/gas_mixture/env = T.return_air()
@@ -156,28 +197,65 @@
// Pass all the gas related code an empty gas container
removed = new()
if(!removed || !removed.total_moles())
if(!removed || !removed.total_moles() || isspaceturf(T)) //we're in space or there is no gas to process
if(takes_damage)
damage += max((power-1600)/10, 0)
power = min(power, 1600)
return 1
damage_archived = damage
if(takes_damage)
damage = max( damage + ( (removed.temperature - 800) / 150 ) , 0 )
//Ok, 100% oxygen atmosphere = best reaction
//Maxes out at 100% oxygen pressure
var/removed_nitrogen = 0
if(removed.gases["n2"])
removed_nitrogen = (removed.gases["n2"][MOLES] * NITROGEN_RETARDATION_FACTOR)
//causing damage
damage = max(damage + (max(removed.temperature - ((T0C + HEAT_PENALTY_THRESHOLD)*dynamic_heat_resistance), 0) * mole_heat_penalty / 150 ), 0)
damage = max(damage + (max(power - POWER_PENALTY_THRESHOLD, 0)/500), 0)
damage = max(damage + (max(combined_gas - MOLE_PENALTY_THRESHOLD, 0)/80), 0)
removed.assert_gases("o2", "plasma")
//healing damage
if(combined_gas < MOLE_PENALTY_THRESHOLD)
damage = max(damage + (min(removed.temperature - (T0C + HEAT_PENALTY_THRESHOLD), 0) / 150 ), 0)
oxygen = max(min((removed.gases["o2"][MOLES] - removed_nitrogen) / MOLES_CELLSTANDARD, 1), 0)
//capping damage
damage = min(damage_archived + (DAMAGE_HARDCAP * explosion_point),damage)
if(damage > damage_archived && prob(10))
playsound(get_turf(src), 'sound/effects/EMPulse.ogg', 50, 1)
removed.assert_gases("o2", "plasma", "co2", "n2o", "n2", "freon")
//calculating gas related values
combined_gas = max(removed.total_moles(), 0)
plasmacomp = max(removed.gases["plasma"][MOLES]/combined_gas, 0)
o2comp = max(removed.gases["o2"][MOLES]/combined_gas, 0)
co2comp = max(removed.gases["co2"][MOLES]/combined_gas, 0)
n2ocomp = max(removed.gases["n2o"][MOLES]/combined_gas, 0)
n2comp = max(removed.gases["n2"][MOLES]/combined_gas, 0)
freoncomp = max(removed.gases["freon"][MOLES]/combined_gas, 0)
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp - n2ocomp - n2comp - freoncomp, 0), 1)
dynamic_heat_modifier = max((plasmacomp * PLASMA_HEAT_PENALTY)+(o2comp * OXYGEN_HEAT_PENALTY)+(co2comp * CO2_HEAT_PENALTY)+(n2comp * NITROGEN_HEAT_MODIFIER), 0.5)
dynamic_heat_resistance = max(n2ocomp * N2O_HEAT_RESISTANCE, 1)
power_transmission_bonus = max((plasmacomp * PLASMA_TRANSMIT_MODIFIER) + (o2comp * OXYGEN_TRANSMIT_MODIFIER), 0)
freon_transmit_modifier = max(1-(freoncomp * FREON_TRANSMIT_PENALTY), 0)
//more moles of gases are harder to heat than fewer, so let's scale heat damage around them
mole_heat_penalty = max(combined_gas / MOLE_HEAT_PENALTY, 0.25)
if (combined_gas > POWERLOSS_INHIBITION_MOLE_THRESHOLD && co2comp > POWERLOSS_INHIBITION_GAS_THRESHOLD)
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling + Clamp(co2comp - powerloss_dynamic_scaling, -0.02, 0.02), 0, 1)
else
powerloss_dynamic_scaling = Clamp(powerloss_dynamic_scaling - 0.10,0, 1)
powerloss_inhibitor = Clamp(1-(powerloss_dynamic_scaling * Clamp(combined_gas/POWERLOSS_INHIBITION_MOLE_BOOST_THRESHOLD,1 ,1.5)),0 ,1)
if(matter_power)
var/removed_matter = max(matter_power/MATTER_POWER_CONVERSION, 40)
power = max(power + removed_matter, 0)
matter_power = max(matter_power - removed_matter, 0)
var/temp_factor = 50
if(oxygen > 0.8)
if(gasmix_power_ratio > 0.8)
// with a perfect gas mix, make the power less based on heat
icon_state = "[base_icon_state]_glow"
else
@@ -185,7 +263,7 @@
temp_factor = 30
icon_state = base_icon_state
power = max( (removed.temperature * temp_factor / T0C) * oxygen + power, 0) //Total laser power plus an overload
power = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + 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()
@@ -199,19 +277,22 @@
//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 += ((device_energy * dynamic_heat_modifier) / THERMAL_RELEASE_MODIFIER)
removed.temperature = max(0, min(removed.temperature, 2500))
removed.temperature = max(0, min(removed.temperature, 2500 * dynamic_heat_modifier))
//Calculate how much gas to release
removed.gases["plasma"][MOLES] += max(device_energy / PLASMA_RELEASE_MODIFIER, 0)
removed.gases["plasma"][MOLES] += max((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER, 0)
removed.gases["o2"][MOLES] += max((device_energy + removed.temperature - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
removed.gases["o2"][MOLES] += max(((device_energy + removed.temperature * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER, 0)
if(combined_gas < 50)
removed.gases["freon"][MOLES] = max((removed.gases["freon"][MOLES] + device_energy) * freoncomp / FREON_BREEDING_MODIFIER, 0)
if(produces_gas)
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.
for(var/mob/living/carbon/human/l in view(src, HALLUCINATION_RANGE(power))) // If they can see it without mesons on. Bad on them.
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
var/D = sqrt(1 / max(1, get_dist(l, src)))
l.hallucination += power * config_hallucination_power * D
@@ -221,7 +302,69 @@
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
l.rad_act(rads)
power -= (power/500)**3
if(power > POWER_PENALTY_THRESHOLD)
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
supermatter_zap(src, 5, min(power*2, 20000))
supermatter_zap(src, 5, min(power*2, 20000))
if(power > SEVERE_POWER_PENALTY_THRESHOLD)
supermatter_zap(src, 5, min(power*2, 20000))
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
supermatter_zap(src, 5, min(power*2, 20000))
if(prob(15))
supermatter_pull(src, power/750)
if(prob(5))
supermatter_anomaly_gen(src, 1, rand(5, 10))
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(5) || prob(2))
supermatter_anomaly_gen(src, 2, rand(5, 10))
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3))
supermatter_anomaly_gen(src, 3, rand(5, 10))
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
if((REALTIMEOFDAY - lastwarning) / 10 >= WARNING_DELAY)
var/stability = num2text(round((damage / explosion_point) * 100))
if(damage > emergency_point)
radio.talk_into(src, "[emergency_alert] Instability: [stability]%")
lastwarning = REALTIMEOFDAY
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.talk_into(src, "[warning_alert] Instability: [stability]%")
lastwarning = REALTIMEOFDAY - (WARNING_DELAY * 5)
else // Phew, we're safe
radio.talk_into(src, "[safe_alert] Instability: [stability]%")
lastwarning = REALTIMEOFDAY
if(power > POWER_PENALTY_THRESHOLD)
radio.talk_into(src, "Warning: Hyperstructure has reached dangerous power level.")
if(powerloss_inhibitor < 0.5)
radio.talk_into(src, "DANGER: CHARGE INERTIA CHAIN REACTION IN PROGRESS.")
if(combined_gas > MOLE_PENALTY_THRESHOLD)
radio.talk_into(src, "Warning: Critical coolant mass reached.")
if(damage > explosion_point)
for(var/mob in living_mob_list)
var/mob/living/L = mob
if(istype(L) && L.z == 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(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(L, src) + 1) )
L.rad_act(rads)
explode()
power -= ((power/500)**3) * powerloss_inhibitor
return 1
@@ -250,7 +393,7 @@
for(var/mob/M in mob_list)
if(M.z == z)
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>"
to_chat(M, "<span class='boldannounce'>A horrible screeching fills your ears, and a wave of dread washes over you...</span>")
qdel(src)
return(gain)
@@ -275,10 +418,10 @@
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>"
to_chat(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_ai(mob/user)
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>"
to_chat(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)
if(!istype(user))
@@ -294,7 +437,7 @@
/obj/machinery/power/supermatter_shard/proc/transfer_energy()
for(var/obj/machinery/power/rad_collector/R in rad_collectors)
if(R.z == z && get_dist(R, src) <= 15) //Better than using orange() every process
R.receive_pulse(power/10)
R.receive_pulse(power * (1 + power_transmission_bonus)/10 * freon_transmit_modifier)
/obj/machinery/power/supermatter_shard/attackby(obj/item/W, mob/living/user, params)
if(!istype(W) || (W.flags & ABSTRACT) || !istype(user))
@@ -325,19 +468,18 @@
Consume(AM)
/obj/machinery/power/supermatter_shard/proc/Consume(atom/movable/AM)
if(isliving(AM))
var/mob/living/user = AM
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")
user.dust()
power += 200
matter_power += 200
else if(isobj(AM) && !istype(AM, /obj/effect))
investigate_log("has consumed [AM].", "supermatter")
qdel(AM)
power += 200
matter_power += 200
//Some poor sod got eaten, go ahead and irradiate people nearby.
radiation_pulse(get_turf(src), 4, 10, 500, 1)
@@ -357,9 +499,111 @@
/obj/machinery/power/supermatter_shard/crystal
name = "supermatter crystal"
desc = "A strangely translucent and iridescent crystal. <span class='danger'>You get headaches just from looking at it.</span>"
desc = "A strangely translucent and iridescent crystal."
base_icon_state = "darkmatter"
icon_state = "darkmatter"
anchored = 1
gasefficency = 0.15
explosion_power = 800
explosion_power = 35
/obj/machinery/power/supermatter_shard/proc/supermatter_pull(turf/center, pull_range = 10)
playsound(src.loc, 'sound/weapons/marauder.ogg', 100, 1, extrarange = 7)
for(var/atom/P in orange(pull_range,center))
if(istype(P, /atom/movable))
var/atom/movable/pulled_object = P
if(ishuman(P))
var/mob/living/carbon/human/H = P
H.apply_effect(2, WEAKEN, 0)
if(pulled_object && !pulled_object.anchored && !ishuman(P))
step_towards(pulled_object,center)
step_towards(pulled_object,center)
step_towards(pulled_object,center)
step_towards(pulled_object,center)
return
/obj/machinery/power/supermatter_shard/proc/supermatter_anomaly_gen(turf/anomalycenter, type = 1, anomalyrange = 5)
var/turf/L = pick(orange(anomalyrange, anomalycenter))
if(L)
if(type == 1)
var/obj/effect/anomaly/flux/A = new(L)
A.explosive = 0
A.lifespan = 300
else if(type == 2)
var/obj/effect/anomaly/grav/A = new(L)
A.lifespan = 250
else if(type == 3)
var/obj/effect/anomaly/pyro/A = new(L)
A.lifespan = 200
return
/obj/machinery/power/supermatter_shard/proc/supermatter_zap(atom/zapstart, range = 3, power)
. = zapstart.dir
if(power < 1000)
return
var/target_atom
var/mob/living/target_mob
var/obj/machinery/target_machine
var/obj/structure/target_structure
var/list/arctargetsmob = list()
var/list/arctargetsmachine = list()
var/list/arctargetsstructure = list()
if(prob(20)) //let's not hit all the engineers with every beam and/or segment of the arc
for(var/mob/living/Z in oview(zapstart, range+2))
arctargetsmob += Z
if(arctargetsmob.len)
var/mob/living/H = pick(arctargetsmob)
var/atom/A = H
target_mob = H
target_atom = A
else
for(var/obj/machinery/X in oview(zapstart, range+2))
arctargetsmachine += X
if(arctargetsmachine.len)
var/obj/machinery/M = pick(arctargetsmachine)
var/atom/A = M
target_machine = M
target_atom = A
else
for(var/obj/structure/Y in oview(zapstart, range+2))
arctargetsstructure += Y
if(arctargetsstructure.len)
var/obj/structure/O = pick(arctargetsstructure)
var/atom/A = O
target_structure = O
target_atom = A
if(target_atom)
zapstart.Beam(target_atom, icon_state="nzcrentrs_power", time=5)
var/zapdir = get_dir(zapstart, target_atom)
if(zapdir)
. = zapdir
if(target_mob)
target_mob.electrocute_act(rand(5,10), "Supermatter Discharge Bolt", 1, stun = 0)
if(prob(15))
supermatter_zap(target_mob, 5, power / 2)
supermatter_zap(target_mob, 5, power / 2)
else
supermatter_zap(target_mob, 5, power / 1.5)
else if(target_machine)
if(prob(15))
supermatter_zap(target_machine, 5, power / 2)
supermatter_zap(target_machine, 5, power / 2)
else
supermatter_zap(target_machine, 5, power / 1.5)
else if(target_structure)
if(prob(15))
supermatter_zap(target_structure, 5, power / 2)
supermatter_zap(target_structure, 5, power / 2)
else
supermatter_zap(target_structure, 5, power / 1.5)
#undef HALLUCINATION_RANGE
+4 -4
View File
@@ -24,18 +24,18 @@
/obj/structure/powerswitch/examine(mob/user)
..()
if(on)
user << "The switch is in the on position"
to_chat(user, "The switch is in the on position")
else
user << "The switch is in the off position"
to_chat(user, "The switch is in the off position")
/obj/structure/powerswitch/attack_ai(mob/user)
user << "\red You're an AI. This is a manual switch. It's not going to work."
to_chat(user, "\red You're an AI. This is a manual switch. It's not going to work.")
return
/obj/structure/powerswitch/attack_hand(mob/user)
if(busy)
user << "\red This switch is already being toggled."
to_chat(user, "\red This switch is already being toggled.")
return
..()
+2 -2
View File
@@ -51,7 +51,7 @@
if(isturf(loc))
var/turf/T = loc
if(T.intact)
user << "<span class='warning'>You must first expose the power terminal!</span>"
to_chat(user, "<span class='warning'>You must first expose the power terminal!</span>")
return
if(!master || master.can_terminal_dismantle())
@@ -67,7 +67,7 @@
s.start()
return
new /obj/item/stack/cable_coil(loc, 10)
user << "<span class='notice'>You cut the cables and dismantle the power terminal.</span>"
to_chat(user, "<span class='notice'>You cut the cables and dismantle the power terminal.</span>")
qdel(src)
+1 -1
View File
@@ -78,7 +78,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics,
/obj/singularity/energy_ball/examine(mob/user)
..()
if(orbiting_balls.len)
user << "The amount of orbiting mini-balls is [orbiting_balls.len]."
to_chat(user, "The amount of orbiting mini-balls is [orbiting_balls.len].")
/obj/singularity/energy_ball/proc/move_the_basket_ball(var/move_amount)
+4 -4
View File
@@ -123,10 +123,10 @@
inturf = get_step(src, dir)
locate_machinery()
if(turbine)
user << "<span class='notice'>Turbine connected.</span>"
to_chat(user, "<span class='notice'>Turbine connected.</span>")
stat &= ~BROKEN
else
user << "<span class='alert'>Turbine not connected.</span>"
to_chat(user, "<span class='alert'>Turbine not connected.</span>")
stat |= BROKEN
return
@@ -275,10 +275,10 @@
outturf = get_step(src, dir)
locate_machinery()
if(compressor)
user << "<span class='notice'>Compressor connected.</span>"
to_chat(user, "<span class='notice'>Compressor connected.</span>")
stat &= ~BROKEN
else
user << "<span class='alert'>Compressor not connected.</span>"
to_chat(user, "<span class='alert'>Compressor not connected.</span>")
stat |= BROKEN
return