Merge pull request #6969 from VOREStation/revert-6968-upstream-merge-6882

Redo "[MIRROR] Machinery: Always use update_use_power()"
This commit is contained in:
Aronai Sieyes
2020-03-24 15:09:21 -04:00
committed by GitHub
17 changed files with 1309 additions and 1356 deletions

View File

@@ -9,7 +9,7 @@
anchored = 1 anchored = 1
density = 1 density = 1
power_channel = EQUIP power_channel = EQUIP
use_power = 1 use_power = USE_POWER_IDLE
idle_power_usage = 100 // Minimal lights to keep algae alive idle_power_usage = 100 // Minimal lights to keep algae alive
active_power_usage = 5000 // Powerful grow lights to stimulate oxygen production active_power_usage = 5000 // Powerful grow lights to stimulate oxygen production
//power_rating = 7500 //7500 W ~ 10 HP //power_rating = 7500 //7500 W ~ 10 HP
@@ -57,10 +57,10 @@
..() ..()
recent_moles_transferred = 0 recent_moles_transferred = 0
if(inoperable() || use_power < 2) if(inoperable() || use_power < USE_POWER_ACTIVE)
ui_error = null ui_error = null
update_icon() update_icon()
if(use_power == 1) if(use_power == USE_POWER_IDLE)
last_power_draw = idle_power_usage last_power_draw = idle_power_usage
else else
last_power_draw = 0 last_power_draw = 0
@@ -113,7 +113,7 @@
update_icon() update_icon()
/obj/machinery/atmospherics/binary/algae_farm/update_icon() /obj/machinery/atmospherics/binary/algae_farm/update_icon()
if(inoperable() || !anchored || use_power < 2) if(inoperable() || !anchored || use_power < USE_POWER_ACTIVE)
icon_state = "algae-off" icon_state = "algae-off"
else if(recent_moles_transferred >= moles_per_tick) else if(recent_moles_transferred >= moles_per_tick)
icon_state = "algae-full" icon_state = "algae-full"
@@ -214,13 +214,13 @@
// Queue management can be done even while busy // Queue management can be done even while busy
if(href_list["activate"]) if(href_list["activate"])
update_use_power(2) update_use_power(USE_POWER_ACTIVE)
update_icon() update_icon()
updateUsrDialog() updateUsrDialog()
return return
if(href_list["deactivate"]) if(href_list["deactivate"])
update_use_power(1) update_use_power(USE_POWER_IDLE)
update_icon() update_icon()
updateUsrDialog() updateUsrDialog()
return return

View File

@@ -10,7 +10,7 @@
density = 1 density = 1
anchored = 0 anchored = 0
use_power = 0 //is powered directly from cables use_power = USE_POWER_OFF //is powered directly from cables
active_power_usage = 150 KILOWATTS //BIG POWER active_power_usage = 150 KILOWATTS //BIG POWER
idle_power_usage = 500 idle_power_usage = 500

View File

@@ -5,7 +5,7 @@
anchored = 1 anchored = 1
volume = 500000 volume = 500000
use_power = 1 use_power = USE_POWER_IDLE
idle_power_usage = 50 //internal circuitry, friction losses and stuff idle_power_usage = 50 //internal circuitry, friction losses and stuff
active_power_usage = 1000 // Blowers running active_power_usage = 1000 // Blowers running
power_rating = 100000 //100 kW ~ 135 HP power_rating = 100000 //100 kW ~ 135 HP

View File

@@ -210,7 +210,7 @@
/obj/machinery/bomb_tester/proc/start_simulating() /obj/machinery/bomb_tester/proc/start_simulating()
simulating = 1 simulating = 1
update_use_power(2) update_use_power(USE_POWER_ACTIVE)
simulation_started = world.time simulation_started = world.time
update_icon() update_icon()
switch(sim_mode) switch(sim_mode)
@@ -352,7 +352,7 @@
/obj/machinery/bomb_tester/proc/simulation_finish(cancelled = 0) /obj/machinery/bomb_tester/proc/simulation_finish(cancelled = 0)
simulating = 0 simulating = 0
update_use_power(1) update_use_power(USE_POWER_IDLE)
update_icon() update_icon()
if(test_canister && test_canister.anchored && !test_canister.connected_port) if(test_canister && test_canister.anchored && !test_canister.connected_port)
test_canister.anchored = 0 test_canister.anchored = 0

View File

@@ -4,7 +4,7 @@
desc = "Small wall-mounted chime triggered by a doorbell" desc = "Small wall-mounted chime triggered by a doorbell"
icon = 'icons/obj/machines/doorbell_vr.dmi' icon = 'icons/obj/machines/doorbell_vr.dmi'
icon_state = "dbchime-standby" icon_state = "dbchime-standby"
use_power = 1 use_power = USE_POWER_IDLE
idle_power_usage = 10 idle_power_usage = 10
active_power_usage = 200 active_power_usage = 200
anchored = 1 anchored = 1
@@ -89,7 +89,7 @@
desc = "A doorbell, press to chime." desc = "A doorbell, press to chime."
icon = 'icons/obj/machines/doorbell_vr.dmi' icon = 'icons/obj/machines/doorbell_vr.dmi'
icon_state = "doorbell-standby" icon_state = "doorbell-standby"
use_power = 0 use_power = USE_POWER_OFF
/obj/machinery/button/doorbell/New(var/loc, var/dir, var/building = 0) /obj/machinery/button/doorbell/New(var/loc, var/dir, var/building = 0)
..() ..()

View File

@@ -0,0 +1,324 @@
/*
FIRE ALARM
*/
/obj/machinery/firealarm
name = "fire alarm"
desc = "<i>\"Pull this in case of emergency\"</i>. Thus, keep pulling it forever."
icon = 'icons/obj/monitors.dmi'
icon_state = "fire0"
plane = TURF_PLANE
layer = ABOVE_TURF_LAYER
var/detecting = 1.0
var/working = 1.0
var/time = 10.0
var/timing = 0.0
var/lockdownbyai = 0
anchored = 1.0
use_power = USE_POWER_IDLE
idle_power_usage = 2
active_power_usage = 6
power_channel = ENVIRON
var/last_process = 0
panel_open = 0
var/seclevel
circuit = /obj/item/weapon/circuitboard/firealarm
var/alarms_hidden = FALSE //If the alarms from this machine are visible on consoles
/obj/machinery/firealarm/alarms_hidden
alarms_hidden = TRUE
/obj/machinery/firealarm/Initialize()
. = ..()
if(z in using_map.contact_levels)
set_security_level(security_level ? get_security_level() : "green")
/obj/machinery/firealarm/update_icon()
cut_overlays()
if(panel_open)
set_light(0)
return
if(stat & BROKEN)
icon_state = "firex"
set_light(0)
else if(stat & NOPOWER)
icon_state = "firep"
set_light(0)
else
if(!detecting)
icon_state = "fire1"
set_light(l_range = 4, l_power = 0.9, l_color = "#ff0000")
else
icon_state = "fire0"
switch(seclevel)
if("green") set_light(l_range = 2, l_power = 0.25, l_color = "#00ff00")
if("yellow") set_light(l_range = 2, l_power = 0.25, l_color = "#ffff00")
if("violet") set_light(l_range = 2, l_power = 0.25, l_color = "#9933ff")
if("orange") set_light(l_range = 2, l_power = 0.25, l_color = "#ff9900")
if("blue") set_light(l_range = 2, l_power = 0.25, l_color = "#1024A9")
if("red") set_light(l_range = 4, l_power = 0.9, l_color = "#ff0000")
if("delta") set_light(l_range = 4, l_power = 0.9, l_color = "#FF6633")
add_overlay("overlay_[seclevel]")
/obj/machinery/firealarm/fire_act(datum/gas_mixture/air, temperature, volume)
if(detecting)
if(temperature > T0C + 200)
alarm() // added check of detector status here
return
/obj/machinery/firealarm/attack_ai(mob/user as mob)
return attack_hand(user)
/obj/machinery/firealarm/bullet_act()
return alarm()
/obj/machinery/firealarm/emp_act(severity)
if(prob(50 / severity))
alarm(rand(30 / severity, 60 / severity))
..()
/obj/machinery/firealarm/attackby(obj/item/W as obj, mob/user as mob)
add_fingerprint(user)
if(alarm_deconstruction_screwdriver(user, W))
return
if(alarm_deconstruction_wirecutters(user, W))
return
if(panel_open)
if(istype(W, /obj/item/device/multitool))
detecting = !(detecting)
if(detecting)
user.visible_message("<span class='notice'>\The [user] has reconnected [src]'s detecting unit!</span>", "<span class='notice'>You have reconnected [src]'s detecting unit.</span>")
else
user.visible_message("<span class='notice'>\The [user] has disconnected [src]'s detecting unit!</span>", "<span class='notice'>You have disconnected [src]'s detecting unit.</span>")
return
alarm()
return
/obj/machinery/firealarm/process()//Note: this processing was mostly phased out due to other code, and only runs when needed
if(stat & (NOPOWER|BROKEN))
return
if(timing)
if(time > 0)
time = time - ((world.timeofday - last_process) / 10)
else
alarm()
time = 0
timing = 0
STOP_PROCESSING(SSobj, src)
updateDialog()
last_process = world.timeofday
if(locate(/obj/fire) in src.loc)
alarm()
return
/obj/machinery/firealarm/power_change()
..()
spawn(rand(0,15))
update_icon()
/obj/machinery/firealarm/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER | BROKEN))
return
user.set_machine(src)
var/area/A = src.loc
var/d1
var/d2
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))
A = A.loc
if(A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>Reset - Lockdown</A>", src)
else
d1 = text("<A href='?src=\ref[];alarm=1'>Alarm - Lockdown</A>", src)
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>Stop Time Lock</A>", src)
else
d2 = text("<A href='?src=\ref[];time=1'>Initiate Time Lock</A>", src)
var/second = round(time) % 60
var/minute = (round(time) - second) / 60
var/dat = "<HTML><HEAD></HEAD><BODY><TT><B>Fire alarm</B> [d1]\n<HR>The current alert level is: <b>[get_security_level()]</b><br><br>\nTimer System: [d2]<BR>\nTime Left: [(minute ? "[minute]:" : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>\n</TT></BODY></HTML>"
user << browse(dat, "window=firealarm")
onclose(user, "firealarm")
else
A = A.loc
if(A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>[]</A>", src, stars("Reset - Lockdown"))
else
d1 = text("<A href='?src=\ref[];alarm=1'>[]</A>", src, stars("Alarm - Lockdown"))
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>[]</A>", src, stars("Stop Time Lock"))
else
d2 = text("<A href='?src=\ref[];time=1'>[]</A>", src, stars("Initiate Time Lock"))
var/second = round(time) % 60
var/minute = (round(time) - second) / 60
var/dat = "<HTML><HEAD></HEAD><BODY><TT><B>[stars("Fire alarm")]</B> [d1]\n<HR><b>The current alert level is: [stars(get_security_level())]</b><br><br>\nTimer System: [d2]<BR>\nTime Left: [(minute ? text("[]:", minute) : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>\n</TT></BODY></HTML>"
user << browse(dat, "window=firealarm")
onclose(user, "firealarm")
return
/obj/machinery/firealarm/Topic(href, href_list)
..()
if(usr.stat || stat & (BROKEN | NOPOWER))
return
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["reset"])
reset()
else if(href_list["alarm"])
alarm()
else if(href_list["time"])
timing = text2num(href_list["time"])
last_process = world.timeofday
START_PROCESSING(SSobj, src)
else if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
updateUsrDialog()
add_fingerprint(usr)
else
usr << browse(null, "window=firealarm")
return
return
/obj/machinery/firealarm/proc/reset()
if(!(working))
return
var/area/area = get_area(src)
for(var/obj/machinery/firealarm/FA in area)
fire_alarm.clearAlarm(src.loc, FA)
update_icon()
return
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
if(!(working))
return
var/area/area = get_area(src)
for(var/obj/machinery/firealarm/FA in area)
fire_alarm.triggerAlarm(loc, FA, duration, hidden = alarms_hidden)
update_icon()
playsound(src.loc, 'sound/machines/airalarm.ogg', 25, 0, 4)
return
/obj/machinery/firealarm/proc/set_security_level(var/newlevel)
if(seclevel != newlevel)
seclevel = newlevel
update_icon()
/*
FIRE ALARM CIRCUIT
Just a object used in constructing fire alarms
/obj/item/weapon/firealarm_electronics
name = "fire alarm electronics"
icon = 'icons/obj/doors/door_assembly.dmi'
icon_state = "door_electronics"
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
w_class = ITEMSIZE_SMALL
matter = list(DEFAULT_WALL_MATERIAL = 50, "glass" = 50)
*/
/obj/machinery/partyalarm
name = "\improper PARTY BUTTON"
desc = "Cuban Pete is in the house!"
icon = 'icons/obj/monitors.dmi'
icon_state = "fire0"
var/detecting = 1.0
var/working = 1.0
var/time = 10.0
var/timing = 0.0
var/lockdownbyai = 0
anchored = 1.0
use_power = USE_POWER_IDLE
idle_power_usage = 2
active_power_usage = 6
/obj/machinery/partyalarm/attack_hand(mob/user as mob)
if(user.stat || stat & (NOPOWER|BROKEN))
return
user.machine = src
var/area/A = get_area(src)
ASSERT(isarea(A))
var/d1
var/d2
if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
if(A.party)
d1 = text("<A href='?src=\ref[];reset=1'>No Party :(</A>", src)
else
d1 = text("<A href='?src=\ref[];alarm=1'>PARTY!!!</A>", src)
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>Stop Time Lock</A>", src)
else
d2 = text("<A href='?src=\ref[];time=1'>Initiate Time Lock</A>", src)
var/second = time % 60
var/minute = (time - second) / 60
var/dat = text("<HTML><HEAD></HEAD><BODY><TT><B>Party Button</B> []\n<HR>\nTimer System: []<BR>\nTime Left: [][] <A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>\n</TT></BODY></HTML>", d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src)
user << browse(dat, "window=partyalarm")
onclose(user, "partyalarm")
else
if(A.fire)
d1 = text("<A href='?src=\ref[];reset=1'>[]</A>", src, stars("No Party :("))
else
d1 = text("<A href='?src=\ref[];alarm=1'>[]</A>", src, stars("PARTY!!!"))
if(timing)
d2 = text("<A href='?src=\ref[];time=0'>[]</A>", src, stars("Stop Time Lock"))
else
d2 = text("<A href='?src=\ref[];time=1'>[]</A>", src, stars("Initiate Time Lock"))
var/second = time % 60
var/minute = (time - second) / 60
var/dat = text("<HTML><HEAD></HEAD><BODY><TT><B>[]</B> []\n<HR>\nTimer System: []<BR>\nTime Left: [][] <A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>\n</TT></BODY></HTML>", stars("Party Button"), d1, d2, (minute ? text("[]:", minute) : null), second, src, src, src, src)
user << browse(dat, "window=partyalarm")
onclose(user, "partyalarm")
return
/obj/machinery/partyalarm/proc/reset()
if(!(working))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
A.partyreset()
return
/obj/machinery/partyalarm/proc/alarm()
if(!(working))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
A.partyalert()
return
/obj/machinery/partyalarm/Topic(href, href_list)
..()
if(usr.stat || stat & (BROKEN|NOPOWER))
return
if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
if(href_list["reset"])
reset()
else if(href_list["alarm"])
alarm()
else if(href_list["time"])
timing = text2num(href_list["time"])
else if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
updateUsrDialog()
add_fingerprint(usr)
else
usr << browse(null, "window=partyalarm")
return
return

View File

@@ -23,7 +23,7 @@
circuit = /obj/item/weapon/circuitboard/partslathe circuit = /obj/item/weapon/circuitboard/partslathe
anchored = 1 anchored = 1
density = 1 density = 1
use_power = 1 use_power = USE_POWER_IDLE
idle_power_usage = 30 idle_power_usage = 30
active_power_usage = 5000 active_power_usage = 5000
@@ -155,7 +155,7 @@
var/datum/category_item/partslathe/D = queue[1] var/datum/category_item/partslathe/D = queue[1]
if(canBuild(D)) if(canBuild(D))
busy = 1 busy = 1
update_use_power(2) update_use_power(USE_POWER_ACTIVE)
progress += speed progress += speed
if(progress >= D.time) if(progress >= D.time)
build(D) build(D)
@@ -165,7 +165,7 @@
else if(busy) else if(busy)
visible_message("<span class='notice'>\icon [src] flashes: insufficient materials: [getLackingMaterials(D)].</span>") visible_message("<span class='notice'>\icon [src] flashes: insufficient materials: [getLackingMaterials(D)].</span>")
busy = 0 busy = 0
update_use_power(1) update_use_power(USE_POWER_IDLE)
update_icon() update_icon()
playsound(src.loc, 'sound/machines/chime.ogg', 50, 0) playsound(src.loc, 'sound/machines/chime.ogg', 50, 0)

View File

@@ -140,11 +140,11 @@
var/obj/item/ammo_casing/microbattery/batt = charging var/obj/item/ammo_casing/microbattery/batt = charging
if(batt.shots_left >= initial(batt.shots_left)) if(batt.shots_left >= initial(batt.shots_left))
icon_state = icon_state_charged icon_state = icon_state_charged
update_use_power(1) update_use_power(USE_POWER_IDLE)
else else
icon_state = icon_state_charging icon_state = icon_state_charging
batt.shots_left++ batt.shots_left++
update_use_power(2) update_use_power(USE_POWER_ACTIVE)
return return
//VOREStation Add End //VOREStation Add End

View File

@@ -9,7 +9,7 @@
icon_keyboard = "tech_key" icon_keyboard = "tech_key"
icon_screen = "request" icon_screen = "request"
light_color = "#315ab4" light_color = "#315ab4"
use_power = 1 use_power = USE_POWER_IDLE
idle_power_usage = 250 idle_power_usage = 250
active_power_usage = 500 active_power_usage = 500
circuit = /obj/item/weapon/circuitboard/roguezones circuit = /obj/item/weapon/circuitboard/roguezones

View File

@@ -4,7 +4,7 @@
icon = 'icons/obj/telescience.dmi' icon = 'icons/obj/telescience.dmi'
icon_state = "qpad-idle" icon_state = "qpad-idle"
anchored = TRUE anchored = TRUE
use_power = 1 use_power = USE_POWER_IDLE
idle_power_usage = 200 idle_power_usage = 200
active_power_usage = 5000 active_power_usage = 5000
circuit = /obj/item/weapon/circuitboard/quantumpad circuit = /obj/item/weapon/circuitboard/quantumpad

View File

@@ -5,7 +5,7 @@
icon = 'icons/obj/telescience.dmi' icon = 'icons/obj/telescience.dmi'
icon_state = "pad-idle" icon_state = "pad-idle"
anchored = 1 anchored = 1
use_power = 1 use_power = USE_POWER_IDLE
circuit = /obj/item/weapon/circuitboard/telesci_pad circuit = /obj/item/weapon/circuitboard/telesci_pad
idle_power_usage = 200 idle_power_usage = 200
active_power_usage = 5000 active_power_usage = 5000

View File

@@ -3,7 +3,7 @@
desc = "A utility often used to lose weight." desc = "A utility often used to lose weight."
icon = 'icons/obj/machines/fitness_machines_vr.dmi' icon = 'icons/obj/machines/fitness_machines_vr.dmi'
anchored = 1 anchored = 1
use_power = 0 use_power = USE_POWER_OFF
idle_power_usage = 0 idle_power_usage = 0
active_power_usage = 0 active_power_usage = 0
var/messages var/messages
@@ -88,7 +88,7 @@
icon_state = "scale" icon_state = "scale"
desc = "A scale used to measure ones weight relative to their size and species." desc = "A scale used to measure ones weight relative to their size and species."
anchored = 1 // Set to 0 when we can construct or dismantle these. anchored = 1 // Set to 0 when we can construct or dismantle these.
use_power = 0 use_power = USE_POWER_OFF
idle_power_usage = 0 idle_power_usage = 0
active_power_usage = 0 active_power_usage = 0

View File

@@ -1,32 +0,0 @@
//Challenge Areas
/area/awaymission/challenge/start
name = "Where Am I?"
icon_state = "away"
/area/awaymission/challenge/main
name = "\improper Danger Room"
icon_state = "away1"
requires_power = 0
/area/awaymission/challenge/end
name = "Administration"
icon_state = "away2"
requires_power = 0
/obj/machinery/power/emitter/energycannon
name = "Energy Cannon"
desc = "A heavy duty industrial laser"
icon = 'icons/obj/singularity.dmi'
icon_state = "emitter"
anchored = 1
density = 1
use_power = USE_POWER_OFF
idle_power_usage = 0
active_power_usage = 0
active = 1
locked = 1
state = 2

View File

@@ -1,173 +1,173 @@
/* Code for the Wild West map by Brotemis /* Code for the Wild West map by Brotemis
* Contains: * Contains:
* Wish Granter * Wish Granter
* Meat Grinder * Meat Grinder
*/ */
/* /*
* Wish Granter * Wish Granter
*/ */
/obj/machinery/wish_granter_dark /obj/machinery/wish_granter_dark
name = "Wish Granter" name = "Wish Granter"
desc = "You're not so sure about this, anymore..." desc = "You're not so sure about this, anymore..."
icon = 'icons/obj/device.dmi' icon = 'icons/obj/device.dmi'
icon_state = "syndbeacon" icon_state = "syndbeacon"
anchored = 1 anchored = 1
density = 1 density = 1
use_power = USE_POWER_OFF use_power = USE_POWER_OFF
var/chargesa = 1 var/chargesa = 1
var/insistinga = 0 var/insistinga = 0
/obj/machinery/wish_granter_dark/attack_hand(var/mob/living/carbon/human/user as mob) /obj/machinery/wish_granter_dark/attack_hand(var/mob/living/carbon/human/user as mob)
usr.set_machine(src) usr.set_machine(src)
if(chargesa <= 0) if(chargesa <= 0)
to_chat(user, "The Wish Granter lies silent.") to_chat(user, "The Wish Granter lies silent.")
return return
else if(!istype(user, /mob/living/carbon/human)) else if(!istype(user, /mob/living/carbon/human))
to_chat(user, "You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's.") to_chat(user, "You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's.")
return return
else if(is_special_character(user)) else if(is_special_character(user))
to_chat(user, "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away.") to_chat(user, "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away.")
else if (!insistinga) else if (!insistinga)
to_chat(user, "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?") to_chat(user, "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?")
insistinga++ insistinga++
else else
chargesa-- chargesa--
insistinga = 0 insistinga = 0
var/wish = input("You want...","Wish") as null|anything in list("Power","Wealth","Immortality","To Kill","Peace") var/wish = input("You want...","Wish") as null|anything in list("Power","Wealth","Immortality","To Kill","Peace")
switch(wish) switch(wish)
if("Power") if("Power")
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>") to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.") to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.")
if (!(LASER in user.mutations)) if (!(LASER in user.mutations))
user.mutations.Add(LASER) user.mutations.Add(LASER)
to_chat(user, "<span class='notice'>You feel pressure building behind your eyes.</span>") to_chat(user, "<span class='notice'>You feel pressure building behind your eyes.</span>")
if (!(COLD_RESISTANCE in user.mutations)) if (!(COLD_RESISTANCE in user.mutations))
user.mutations.Add(COLD_RESISTANCE) user.mutations.Add(COLD_RESISTANCE)
to_chat(user, "<span class='notice'>Your body feels warm.</span>") to_chat(user, "<span class='notice'>Your body feels warm.</span>")
if (!(XRAY in user.mutations)) if (!(XRAY in user.mutations))
user.mutations.Add(XRAY) user.mutations.Add(XRAY)
user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) user.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
user.see_in_dark = 8 user.see_in_dark = 8
user.see_invisible = SEE_INVISIBLE_LEVEL_TWO user.see_invisible = SEE_INVISIBLE_LEVEL_TWO
to_chat(user, "<span class='notice'>The walls suddenly disappear.</span>") to_chat(user, "<span class='notice'>The walls suddenly disappear.</span>")
user.dna.mutantrace = "shadow" user.dna.mutantrace = "shadow"
user.update_mutantrace() user.update_mutantrace()
if("Wealth") if("Wealth")
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>") to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.") to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.")
new /obj/structure/closet/syndicate/resources/everything(loc) new /obj/structure/closet/syndicate/resources/everything(loc)
user.dna.mutantrace = "shadow" user.dna.mutantrace = "shadow"
user.update_mutantrace() user.update_mutantrace()
if("Immortality") if("Immortality")
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>") to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.") to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.")
user.verbs += /mob/living/carbon/proc/immortality user.verbs += /mob/living/carbon/proc/immortality
user.dna.mutantrace = "shadow" user.dna.mutantrace = "shadow"
user.update_mutantrace() user.update_mutantrace()
if("To Kill") if("To Kill")
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>") to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
to_chat(user, "The Wish Granter punishes you for your wickedness, claiming your soul and warping your body to match the darkness in your heart.") to_chat(user, "The Wish Granter punishes you for your wickedness, claiming your soul and warping your body to match the darkness in your heart.")
ticker.mode.traitors += user.mind ticker.mode.traitors += user.mind
user.mind.special_role = "traitor" user.mind.special_role = "traitor"
var/datum/objective/hijack/hijack = new var/datum/objective/hijack/hijack = new
hijack.owner = user.mind hijack.owner = user.mind
user.mind.objectives += hijack user.mind.objectives += hijack
to_chat(user, "<B>Your inhibitions are swept away, the bonds of loyalty broken, you are free to murder as you please!</B>") to_chat(user, "<B>Your inhibitions are swept away, the bonds of loyalty broken, you are free to murder as you please!</B>")
var/obj_count = 1 var/obj_count = 1
for(var/datum/objective/OBJ in user.mind.objectives) for(var/datum/objective/OBJ in user.mind.objectives)
to_chat(user, "<B>Objective #[obj_count]</B>: [OBJ.explanation_text]") to_chat(user, "<B>Objective #[obj_count]</B>: [OBJ.explanation_text]")
obj_count++ obj_count++
user.dna.mutantrace = "shadow" user.dna.mutantrace = "shadow"
user.update_mutantrace() user.update_mutantrace()
if("Peace") if("Peace")
to_chat(user, "<B>Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence.</B>") to_chat(user, "<B>Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence.</B>")
to_chat(user, "You feel as if you just narrowly avoided a terrible fate...") to_chat(user, "You feel as if you just narrowly avoided a terrible fate...")
for(var/mob/living/simple_mob/faithless/F in living_mob_list) for(var/mob/living/simple_mob/faithless/F in living_mob_list)
F.health = -10 F.health = -10
F.set_stat(DEAD) F.set_stat(DEAD)
F.icon_state = "faithless_dead" F.icon_state = "faithless_dead"
///////////////Meatgrinder////////////// ///////////////Meatgrinder//////////////
/obj/effect/meatgrinder /obj/effect/meatgrinder
name = "Meat Grinder" name = "Meat Grinder"
desc = "What is that thing?" desc = "What is that thing?"
density = 1 density = 1
anchored = 1 anchored = 1
icon = 'icons/mob/critter.dmi' icon = 'icons/mob/critter.dmi'
icon_state = "blob" icon_state = "blob"
var/triggerproc = "explode" //name of the proc thats called when the mine is triggered var/triggerproc = "explode" //name of the proc thats called when the mine is triggered
var/triggered = 0 var/triggered = 0
/obj/effect/meatgrinder/New() /obj/effect/meatgrinder/New()
icon_state = "blob" icon_state = "blob"
/obj/effect/meatgrinder/HasEntered(AM as mob|obj) /obj/effect/meatgrinder/HasEntered(AM as mob|obj)
Bumped(AM) Bumped(AM)
/obj/effect/meatgrinder/Bumped(mob/M as mob|obj) /obj/effect/meatgrinder/Bumped(mob/M as mob|obj)
if(triggered) return if(triggered) return
if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey)) if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))
for(var/mob/O in viewers(world.view, src.loc)) for(var/mob/O in viewers(world.view, src.loc))
to_chat(O, "<font color='red'>[M] triggered the \icon[src] [src]</font>") to_chat(O, "<font color='red'>[M] triggered the \icon[src] [src]</font>")
triggered = 1 triggered = 1
call(src,triggerproc)(M) call(src,triggerproc)(M)
/obj/effect/meatgrinder/proc/triggerrad1(mob) /obj/effect/meatgrinder/proc/triggerrad1(mob)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
for(var/mob/O in viewers(world.view, src.loc)) for(var/mob/O in viewers(world.view, src.loc))
s.set_up(3, 1, src) s.set_up(3, 1, src)
s.start() s.start()
explosion(mob, 1, 0, 0, 0) explosion(mob, 1, 0, 0, 0)
spawn(0) spawn(0)
qdel(src) qdel(src)
/obj/effect/meatgrinder /obj/effect/meatgrinder
name = "Meat Grinder" name = "Meat Grinder"
icon_state = "blob" icon_state = "blob"
triggerproc = "triggerrad1" triggerproc = "triggerrad1"
/////For the Wishgranter/////////// /////For the Wishgranter///////////
/mob/living/carbon/proc/immortality() /mob/living/carbon/proc/immortality()
set category = "Immortality" set category = "Immortality"
set name = "Resurrection" set name = "Resurrection"
var/mob/living/carbon/C = usr var/mob/living/carbon/C = usr
if(!C.stat) if(!C.stat)
to_chat(C, "<span class='notice'>You're not dead yet!</span>") to_chat(C, "<span class='notice'>You're not dead yet!</span>")
return return
to_chat(C, "<span class='notice'>Death is not your end!</span>") to_chat(C, "<span class='notice'>Death is not your end!</span>")
spawn(rand(800,1200)) spawn(rand(800,1200))
if(C.stat == DEAD) if(C.stat == DEAD)
dead_mob_list -= C dead_mob_list -= C
living_mob_list += C living_mob_list += C
C.set_stat(CONSCIOUS) C.set_stat(CONSCIOUS)
C.tod = null C.tod = null
C.setToxLoss(0) C.setToxLoss(0)
C.setOxyLoss(0) C.setOxyLoss(0)
C.setCloneLoss(0) C.setCloneLoss(0)
C.SetParalysis(0) C.SetParalysis(0)
C.SetStunned(0) C.SetStunned(0)
C.SetWeakened(0) C.SetWeakened(0)
C.radiation = 0 C.radiation = 0
C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss()) C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss())
C.reagents.clear_reagents() C.reagents.clear_reagents()
to_chat(C, "<span class='notice'>You have regenerated.</span>") to_chat(C, "<span class='notice'>You have regenerated.</span>")
C.visible_message("<span class='warning'>[usr] appears to wake from the dead, having healed all wounds.</span>") C.visible_message("<span class='warning'>[usr] appears to wake from the dead, having healed all wounds.</span>")
C.update_canmove() C.update_canmove()
return 1 return 1

View File

@@ -24,7 +24,7 @@
music = list('sound/music/elevator.ogg') // Woo elevator music! music = list('sound/music/elevator.ogg') // Woo elevator music!
/obj/machinery/atmospherics/unary/vent_pump/positive /obj/machinery/atmospherics/unary/vent_pump/positive
use_power = 1 use_power = USE_POWER_IDLE
icon_state = "map_vent_out" icon_state = "map_vent_out"
external_pressure_bound = ONE_ATMOSPHERE * 1.1 external_pressure_bound = ONE_ATMOSPHERE * 1.1

View File

@@ -738,8 +738,8 @@
#include "code\game\machinery\adv_med.dm" #include "code\game\machinery\adv_med.dm"
#include "code\game\machinery\adv_med_vr.dm" #include "code\game\machinery\adv_med_vr.dm"
#include "code\game\machinery\ai_slipper.dm" #include "code\game\machinery\ai_slipper.dm"
#include "code\game\machinery\air_alarm.dm"
#include "code\game\machinery\airconditioner_vr.dm" #include "code\game\machinery\airconditioner_vr.dm"
#include "code\game\machinery\alarm.dm"
#include "code\game\machinery\atmo_control.dm" #include "code\game\machinery\atmo_control.dm"
#include "code\game\machinery\autolathe.dm" #include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\Beacon.dm" #include "code\game\machinery\Beacon.dm"
@@ -758,6 +758,7 @@
#include "code\game\machinery\doorbell_vr.dm" #include "code\game\machinery\doorbell_vr.dm"
#include "code\game\machinery\doppler_array.dm" #include "code\game\machinery\doppler_array.dm"
#include "code\game\machinery\exonet_node.dm" #include "code\game\machinery\exonet_node.dm"
#include "code\game\machinery\fire_alarm.dm"
#include "code\game\machinery\flasher.dm" #include "code\game\machinery\flasher.dm"
#include "code\game\machinery\floodlight.dm" #include "code\game\machinery\floodlight.dm"
#include "code\game\machinery\floor_light.dm" #include "code\game\machinery\floor_light.dm"