mirror of
https://github.com/goonstation/goonstation-2016.git
synced 2026-08-27 07:56:12 +01:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,224 @@
|
||||
// TO DO:
|
||||
/*
|
||||
epilepsy flash on lights
|
||||
delay round message
|
||||
microwave makes robots
|
||||
dampen radios
|
||||
reactivate cameras - done
|
||||
eject engine
|
||||
core sheild
|
||||
cable stun
|
||||
rcd light flash thingy on matter drain
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module
|
||||
var/uses = 0
|
||||
var/module_name
|
||||
var/mod_pick_name
|
||||
var/description = ""
|
||||
var/engaged = 0
|
||||
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/large/
|
||||
uses = 1
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/small/
|
||||
uses = 5
|
||||
//
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/large/fireproof_core
|
||||
module_name = "Core upgrade"
|
||||
mod_pick_name = "coreup"
|
||||
|
||||
/client/proc/fireproof_core()
|
||||
set category = "AI Modules"
|
||||
set name = "Fireproof Core"
|
||||
for(var/mob/living/silicon/ai/ai in mobs)
|
||||
ai.fire_res_on_core = 1
|
||||
usr.verbs -= /client/proc/fireproof_core
|
||||
boutput(usr, "<span style=\"color:red\">Core fireproofed.</span>")
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/large/upgrade_turrets
|
||||
module_name = "AI Turret upgrade"
|
||||
mod_pick_name = "turret"
|
||||
|
||||
/client/proc/upgrade_turrets()
|
||||
set category = "AI Modules"
|
||||
set name = "Upgrade Turrets"
|
||||
usr.verbs -= /client/proc/upgrade_turrets
|
||||
for(var/obj/machinery/turret/turret in machines)
|
||||
turret.health += 30
|
||||
turret.shot_delay = 20
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/large/disable_rcd
|
||||
module_name = "RCD disable"
|
||||
mod_pick_name = "rcd"
|
||||
|
||||
/client/proc/disable_rcd()
|
||||
set category = "AI Modules"
|
||||
set name = "Disable RCDs"
|
||||
for(var/obj/item/weapon/rcd/rcd in world)
|
||||
rcd = new /obj/item/weapon/rcd_fake(rcd)
|
||||
usr.verbs -= /client/proc/disable_rcd
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/small/overload_machine
|
||||
module_name = "Machine overload"
|
||||
mod_pick_name = "overload"
|
||||
uses = 2
|
||||
|
||||
/client/proc/overload_machine(obj/machinery/M in world)
|
||||
set category = null
|
||||
set name = "Overload Machine"
|
||||
for(var/datum/game_mode/malfunction/AI_Module/small/overload_machine/overload in usr:current_modules)
|
||||
if(overload.uses > 0)
|
||||
overload.uses --
|
||||
for(var/mob/V in hearers(7, M))
|
||||
V.show_message(text("<span style=\"color:blue\">You hear a loud electrical buzzing sound!</span>"))
|
||||
spawn(50)
|
||||
explosion(M, get_turf(M), 0,1,1,0)
|
||||
if(overload.uses <= 0)
|
||||
usr.verbs -= /client/proc/overload_machine
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/small/blackout
|
||||
module_name = "Blackout"
|
||||
mod_pick_name = "blackout"
|
||||
uses = 3
|
||||
|
||||
/client/proc/blackout()
|
||||
set category = "AI Modules"
|
||||
set name = "Blackout"
|
||||
for(var/datum/game_mode/malfunction/AI_Module/small/blackout/blackout in usr:current_modules)
|
||||
if(blackout.uses > 0)
|
||||
blackout.uses --
|
||||
for(var/obj/machinery/power/apc/apc in machines)
|
||||
if(prob(30))
|
||||
apc.overload_lighting()
|
||||
if(blackout.uses <= 0)
|
||||
usr.verbs -= /client/proc/blackout
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/small/interhack
|
||||
module_name = "Hack intercept"
|
||||
mod_pick_name = "interhack"
|
||||
|
||||
/client/proc/interhack()
|
||||
set category = "AI Modules"
|
||||
set name = "Hack intercept"
|
||||
usr.verbs -= /client/proc/interhack
|
||||
ticker.mode:hack_intercept()
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/small/reactivate_camera
|
||||
module_name = "Recam"
|
||||
mod_pick_name = "recam"
|
||||
uses = 10
|
||||
|
||||
/client/proc/reactivate_camera(obj/machinery/camera/C in world)
|
||||
set name = "Reactivate Camera"
|
||||
for(var/datum/game_mode/malfunction/AI_Module/small/reactivate_camera/camera in usr:current_modules)
|
||||
if(camera.uses > 0)
|
||||
if(!C.status)
|
||||
C.status = !C.status
|
||||
camera.uses --
|
||||
for(var/mob/V in hearers(3, C))
|
||||
V.show_message(text("<span style=\"color:blue\">You hear a quiet click.</span>"))
|
||||
else
|
||||
boutput(usr, "This camera is either active, or not repairable.")
|
||||
if(camera.uses == 0)
|
||||
usr.verbs -= /client/proc/reactivate_camera
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/small/attack_shuttle
|
||||
module_name = "Attack Shuttle"
|
||||
mod_pick_name = "attsh"
|
||||
uses = 1
|
||||
|
||||
/client/proc/attack_shuttle()
|
||||
for (var/obj/landmark/A in world)
|
||||
if (A.name == "AIgunbotshuttle")
|
||||
new /obj/critter/gunbot(A.loc)
|
||||
qdel(A)
|
||||
usr.verbs -= /client/proc/attack_shuttle
|
||||
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/module_picker
|
||||
var/temp = null
|
||||
var/processing_time = 100
|
||||
var/list/possible_modules = list()
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/module_picker/New()
|
||||
// src.possible_modules += new /datum/game_mode/malfunction/AI_Module/large/fireproof_core
|
||||
src.possible_modules += new /datum/game_mode/malfunction/AI_Module/large/upgrade_turrets
|
||||
src.possible_modules += new /datum/game_mode/malfunction/AI_Module/large/disable_rcd
|
||||
src.possible_modules += new /datum/game_mode/malfunction/AI_Module/small/overload_machine
|
||||
// src.possible_modules += new /datum/game_mode/malfunction/AI_Module/small/interhack
|
||||
src.possible_modules += new /datum/game_mode/malfunction/AI_Module/small/blackout
|
||||
src.possible_modules += new /datum/game_mode/malfunction/AI_Module/small/reactivate_camera
|
||||
src.possible_modules += new /datum/game_mode/malfunction/AI_Module/small/attack_shuttle
|
||||
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/module_picker/proc/use(user as mob)
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "[src.temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
|
||||
else if(src.processing_time <= 0)
|
||||
dat = "<B> No processing time is left available. No more modules are able to be chosen at this time."
|
||||
else
|
||||
dat = "<B>Select use of processing time: (currently [src.processing_time] left.)</B><BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<B>Install Module:</B><BR>"
|
||||
dat += "<I>The number afterwards is the amount of processing time it consumes.</I><BR>"
|
||||
for(var/datum/game_mode/malfunction/AI_Module/large/module in src.possible_modules)
|
||||
dat += "<A href='byond://?src=\ref[src];[module.mod_pick_name]=1'>[module.module_name]</A> (50)<BR>"
|
||||
for(var/datum/game_mode/malfunction/AI_Module/small/module in src.possible_modules)
|
||||
dat += "<A href='byond://?src=\ref[src];[module.mod_pick_name]=1'>[module.module_name]</A> (15)<BR>"
|
||||
dat += "<HR>"
|
||||
|
||||
user << browse(dat, "window=modpicker")
|
||||
onclose(user, "modpicker")
|
||||
return
|
||||
|
||||
/datum/game_mode/malfunction/AI_Module/module_picker/Topic(href, href_list)
|
||||
..()
|
||||
// if (href_list["coreup"])
|
||||
// usr.verbs += /client/proc/fireproof_core
|
||||
// src.temp = "An upgrade to improve core resistance, making it immune to fire and heat. This effect is permanent. One use."
|
||||
// src.processing_time -= 50
|
||||
if (href_list["turret"])
|
||||
usr.verbs += /client/proc/upgrade_turrets
|
||||
src.temp = "Improves the firing speed and health of all AI turrets. This effect is permanent. One use."
|
||||
src.processing_time -= 50
|
||||
else if (href_list["rcd"])
|
||||
usr.verbs += /client/proc/disable_rcd
|
||||
src.temp = "Send a specialised pulse to break all RCD devices on the station. One use."
|
||||
src.processing_time -= 50
|
||||
else if (href_list["overload"])
|
||||
usr.verbs += /client/proc/overload_machine
|
||||
usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/overload_machine
|
||||
src.temp = "Overloads an electrical machine, causing a small explosion. 2 uses."
|
||||
src.processing_time -= 15
|
||||
else if (href_list["blackout"])
|
||||
usr.verbs += /client/proc/blackout
|
||||
src.temp = "Attempts to overload the lighting circuits on the station, destroying some bulbs. 3 uses."
|
||||
usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/blackout
|
||||
src.processing_time -= 15
|
||||
// else if (href_list["interhack"])
|
||||
// usr.verbs += /client/proc/interhack
|
||||
// src.temp = "Hacks the status upgrade from Cent. Com, removing any information about malfunctioning electrical systems. One use."
|
||||
// usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/interhack
|
||||
// src.processing_time -= 15
|
||||
else if (href_list["recam"])
|
||||
usr.verbs += /client/proc/reactivate_camera
|
||||
src.temp = "Reactivates a currently disabled camera. 10 uses."
|
||||
usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/reactivate_camera
|
||||
src.processing_time -= 15
|
||||
else if (href_list["attsh"])
|
||||
usr.verbs += /client/proc/attack_shuttle
|
||||
src.temp = "A killbot boards the attack shuttle. 1 use."
|
||||
usr:current_modules += new /datum/game_mode/malfunction/AI_Module/small/attack_shuttle
|
||||
src.processing_time -= 15
|
||||
else
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
src.use(usr)
|
||||
return
|
||||
@@ -0,0 +1,281 @@
|
||||
/*
|
||||
/obj/npcmonkeyspawner/New()
|
||||
var/mob/living/carbon/monkey/M = new /mob/living/carbon/monkey ( loc )
|
||||
M.AIactive = 1
|
||||
M.think()
|
||||
qdel(src)
|
||||
|
||||
/obj/npcmonkeyspawner/angry/New()
|
||||
var/mob/living/carbon/monkey/M = new /mob/living/carbon/monkey ( loc )
|
||||
M.AIactive = 1
|
||||
M.aggressiveness = 22
|
||||
M.think()
|
||||
qdel(src)
|
||||
|
||||
/obj/npcmonkeyspawner/special/New()
|
||||
var/mob/living/carbon/monkey/special/M = new /mob/living/carbon/monkey/special ( loc )
|
||||
M.AIactive = 1
|
||||
M.think()
|
||||
qdel(src)
|
||||
|
||||
/mob/living/carbon/monkey/proc/helpme(mob/M as mob) // GANGBANG
|
||||
target = M
|
||||
mainstate = 3
|
||||
|
||||
/mob/living/carbon/monkey/proc/think()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/nolos = 0
|
||||
var/cantact = 0
|
||||
|
||||
//emote("EMOTENAME")
|
||||
//var/count = 0
|
||||
//var/friend // His friend . real_name .
|
||||
//var/mainstate = 0
|
||||
// 0 = Idle
|
||||
// 1 = Targeting
|
||||
// 2 = Angry
|
||||
// 3 = Attacking
|
||||
// 4 = Moving out of Danger.
|
||||
// 5 = Run awayyy
|
||||
// 6 = Following
|
||||
//var/substate = 0
|
||||
//var/target = null // His target .
|
||||
//var/AIactive = 0 // Is the AI on or off?
|
||||
|
||||
if (special) // Just testing
|
||||
HealDamage("All", 10000, 10000)
|
||||
weakened = 0
|
||||
drowsyness = 0
|
||||
stunned = 0
|
||||
paralysis = 0
|
||||
toxloss = 0
|
||||
oxyloss = 0
|
||||
|
||||
if (!AIactive) return
|
||||
if (transforming) return
|
||||
|
||||
if (stat || stunned || weakened || paralysis) cantact = 1
|
||||
|
||||
if(target && (mainstate == 2 || mainstate == 3))
|
||||
var/list/L = new/list()
|
||||
L = getline(get_turf(src), get_turf(target))
|
||||
for (var/turf/Trf as turf in L)
|
||||
if (Trf.density) nolos = 1
|
||||
for (var/atom/C in Trf)
|
||||
if (!istype(C,/mob/living) && C.density) // Somethings blocking our way
|
||||
nolos = 1
|
||||
|
||||
switch(mainstate)
|
||||
|
||||
if(0)
|
||||
|
||||
if(target)
|
||||
target = null
|
||||
|
||||
if((T.sl_gas || T.poison) && !special) // ahaha what a shitty workaround.
|
||||
mainstate = 4
|
||||
SaferTurf()
|
||||
spawn(5) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
var/mob/Temp
|
||||
var/TempHp = 100
|
||||
|
||||
for(var/mob/M as mob in oview(world.view-3,src))
|
||||
if(!M.client || !istype(M,/mob/living/carbon/human)) continue
|
||||
if(M.health <= TempHp && !M.stat)
|
||||
Temp = M
|
||||
TempHp = M.health
|
||||
if ((Temp && prob( ( (100 - TempHp) * 2) + aggressiveness )) || Temp && health < 90 + (aggressiveness / 2) )
|
||||
if (!istype(Temp, /mob/living))
|
||||
spawn(5) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
mainstate = 1
|
||||
target = Temp
|
||||
else
|
||||
if(!cantact && canmove)
|
||||
step_rand(src)
|
||||
|
||||
|
||||
if(1)
|
||||
|
||||
if(!target || cantact || target:stat)
|
||||
mainstate = 0
|
||||
target = null
|
||||
spawn(5) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] stares at [target]</span>")
|
||||
if (prob(10) && !special) emote("gnarl")
|
||||
mainstate = 2
|
||||
spawn(15) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
if(2)
|
||||
|
||||
if(!target)
|
||||
mainstate = 0
|
||||
spawn(5) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
if( (get_dist(src,target) >= world.view - 2) && !cantact)
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] calms down.</span>")
|
||||
target = null
|
||||
count = 0
|
||||
mainstate = 0
|
||||
spawn(10) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
if ((prob(33) || health < 50) && !cantact)
|
||||
if (prob(10) && !special) emote("paw")
|
||||
for(var/mob/living/carbon/monkey/M as mob in oview(world.view,src))
|
||||
if (istype(M,/mob/living/carbon/monkey)) // BYOND SUCKS ARRRGH
|
||||
if(M.AIactive && !M.stat && M.canmove)
|
||||
M.helpme(target)
|
||||
|
||||
if (!nolos && canmove && !cantact)
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] lunges at [target].</span>")
|
||||
if (prob(10) && !special) emote("roar")
|
||||
while(get_dist(src,target) > 2)
|
||||
step_towards(src,target)
|
||||
sleep(2)
|
||||
|
||||
mainstate = 3
|
||||
|
||||
if(3)
|
||||
|
||||
if( ( (target:stat && prob(50-aggressiveness) ) && !cantact) || count > 300 )
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] loses interest in its target.</span>")
|
||||
target = null
|
||||
count = 0
|
||||
mainstate = 0
|
||||
spawn(10) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
if(get_dist(src,target) > world.view + 2 && !cantact)
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] calms down.</span>")
|
||||
target = null
|
||||
count = 0
|
||||
mainstate = 0
|
||||
spawn(10) //////////////////////////////////////!!!
|
||||
think()
|
||||
return
|
||||
|
||||
if(get_dist(src,target) > 1 && !cantact && canmove)
|
||||
count++
|
||||
step_towards(src,target)
|
||||
|
||||
if((T.sl_gas > 3000 || T.poison > 3000 ) && !special) // ahaha what a shitty workaround.
|
||||
mainstate = 4
|
||||
SaferTurf()
|
||||
|
||||
if(get_dist(src,target) == 2 && prob(50) && (!cantact && canmove))
|
||||
|
||||
if(!nolos)
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] pounces [target].</span>")
|
||||
target:weakened += 3
|
||||
step_towards(src,target)
|
||||
step_towards(src,target)
|
||||
spawn(10)
|
||||
think()
|
||||
return
|
||||
|
||||
|
||||
if(get_dist(src,target) < 2 && (!cantact && !istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) )
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">The [src.name] bites [target].</span>")
|
||||
if(prob(15) && special)
|
||||
randmutb(target)
|
||||
for(var/mob/M as mob in oview(world.view,src))
|
||||
boutput(M, "<span style=\"color:red\">[target] has been infected.</span>")
|
||||
target:TakeDamage("chest", 5, 0)
|
||||
spawn(20)
|
||||
think()
|
||||
return
|
||||
|
||||
|
||||
|
||||
if(4)
|
||||
if (prob(5) && !special) emote("whimper")
|
||||
if((T.sl_gas || T.poison || t_oxygen) && !special)
|
||||
SaferTurf()
|
||||
else
|
||||
if(target) mainstate = 2
|
||||
if(!target) mainstate = 0
|
||||
|
||||
spawn(5)
|
||||
think()
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/proc/SaferTurf()
|
||||
var/turf/Current = get_turf(src)
|
||||
var/turf/Temp = Current
|
||||
var/turf/Check = Current
|
||||
var/blocked = 0
|
||||
var/cantact = 0
|
||||
|
||||
if (stat || stunned || weakened || paralysis) cantact = 1
|
||||
|
||||
if(Current.sl_gas && canmove && !cantact)
|
||||
Current = get_turf(src)
|
||||
Temp = Current
|
||||
Check = Current
|
||||
for(var/A in alldirs)
|
||||
Check = get_step(src, A)
|
||||
if(!istype(Check,/turf)) continue
|
||||
if (Check.sl_gas < Current.sl_gas && Check.sl_gas < Temp.sl_gas && !Check.density)
|
||||
blocked = 0
|
||||
for (var/atom/B in Check)
|
||||
if(B.density)
|
||||
blocked = 1
|
||||
if(!blocked)
|
||||
Temp = Check
|
||||
step_towards(src,Temp)
|
||||
|
||||
if(Current.poison && canmove && !cantact)
|
||||
Current = get_turf(src)
|
||||
Temp = Current
|
||||
Check = Current
|
||||
for(var/A in alldirs)
|
||||
Check = get_step(src, A)
|
||||
if(!istype(Check,/turf)) continue
|
||||
if (Check.poison < Current.poison && Check.poison < Temp.poison && !Check.density)
|
||||
blocked = 0
|
||||
for (var/atom/B in Check)
|
||||
if(B.density)
|
||||
blocked = 1
|
||||
if(!blocked)
|
||||
Temp = Check
|
||||
step_towards(src,Temp)
|
||||
|
||||
|
||||
if(t_oxygen && canmove && !cantact)
|
||||
Current = get_turf(src)
|
||||
Temp = Current
|
||||
Check = Current
|
||||
for(var/A in alldirs)
|
||||
Check = get_step(src, A)
|
||||
if(!istype(Check,/turf)) continue
|
||||
if (Check.oxygen > Current.oxygen && Check.oxygen > Temp.oxygen && !Check.density)
|
||||
blocked = 0
|
||||
for (var/atom/B in Check)
|
||||
if(B.density)
|
||||
blocked = 1
|
||||
if(!blocked)
|
||||
Temp = Check
|
||||
step_towards(src,Temp)
|
||||
*/
|
||||
@@ -0,0 +1,588 @@
|
||||
// NOTE WELL!
|
||||
// Only include this file when debugging locally
|
||||
// Do not include in release versions
|
||||
|
||||
|
||||
#define VARSICON 1
|
||||
#define SDEBUG 1
|
||||
|
||||
/client/verb/Debug()
|
||||
set category = "Debug"
|
||||
set name = "Debug-Debug"
|
||||
if(src.holder.rank == "Coder")
|
||||
Debug = !Debug
|
||||
|
||||
boutput(world, "Debugging [Debug ? "On" : "Off"]")
|
||||
else
|
||||
alert("Coders only baby")
|
||||
return
|
||||
|
||||
/turf/verb/Flow()
|
||||
set category = "Debug"
|
||||
//set hidden = 1
|
||||
if(Debug)
|
||||
for(var/turf/T in range(5))
|
||||
|
||||
var/obj/mark/O = locate(/obj/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/mark(T)
|
||||
else
|
||||
O.overlays = null
|
||||
|
||||
var/obj/move/OM = locate(/obj/move/, T)
|
||||
|
||||
if(OM)
|
||||
|
||||
if(! OM.updatecell)
|
||||
O.icon_state = "x2"
|
||||
else
|
||||
O.icon_state = "blank"
|
||||
/*
|
||||
Doing this because FindTurfs() isn't even used
|
||||
for(var/atom/U in OM.FindTurfs() )
|
||||
var/dirn = get_dir(OM, U)
|
||||
if(dirn == 1)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==1?"up":"fup")
|
||||
else if(dirn == 2)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==2?"dn":"fdn")
|
||||
else if(dirn == 4)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==4?"rt":"frt")
|
||||
else if(dirn == 8)
|
||||
O.overlays += image('icons/misc/mark.dmi', OM.airdir==8?"lf":"flf")
|
||||
*/
|
||||
else
|
||||
|
||||
if(!(T.updatecell))
|
||||
O.icon_state = "x2"
|
||||
else
|
||||
O.icon_state = "blank"
|
||||
|
||||
if(T.airN)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==1?"up":"fup")
|
||||
|
||||
if(T.airS)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==2?"dn":"fdn")
|
||||
|
||||
if(T.airW)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==8?"lf":"flf")
|
||||
|
||||
if(T.airE)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.airdir==4?"rt":"frt")
|
||||
|
||||
|
||||
if(T.condN)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condN == 1?"yup":"rup")
|
||||
|
||||
if(T.condS)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condS == 1?"ydn":"rdn")
|
||||
|
||||
if(T.condE)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condE == 1?"yrt":"rrt")
|
||||
|
||||
if(T.condW)
|
||||
O.overlays += image('icons/misc/mark.dmi', T.condW == 1?"ylf":"rlf")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/turf/verb/Clear()
|
||||
set category = "Debug"
|
||||
//set hidden = 1
|
||||
if(Debug)
|
||||
for(var/obj/mark/O in world)
|
||||
qdel(O)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/proc/numbericon(var/tn as text,var/s = 0)
|
||||
if(Debug)
|
||||
var/image/I = image('icons/misc/mark.dmi', "blank")
|
||||
|
||||
if(lentext(tn)>8)
|
||||
tn = "*"
|
||||
|
||||
var/len = lentext(tn)
|
||||
|
||||
for(var/d = 1 to lentext(tn))
|
||||
|
||||
|
||||
var/char = copytext(tn, len-d+1, len-d+2)
|
||||
|
||||
if(char == " ")
|
||||
continue
|
||||
|
||||
var/image/ID = image('icons/misc/mark.dmi', char)
|
||||
|
||||
ID.pixel_x = -(d-1)*4
|
||||
ID.pixel_y = s
|
||||
//if(d>1) I.Shift(WEST, (d-1)*8)
|
||||
|
||||
I.overlays += ID
|
||||
|
||||
|
||||
|
||||
return I
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/*/turf/verb/Stats()
|
||||
set category = "Debug"
|
||||
for(var/turf/T in range(5))
|
||||
|
||||
var/obj/mark/O = locate(/obj/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/mark(T)
|
||||
else
|
||||
O.overlays = null
|
||||
|
||||
|
||||
var/temp = round(T.temp-T0C, 0.1)
|
||||
|
||||
O.overlays += numbericon("[temp]C")
|
||||
|
||||
var/pres = round(T.tot_gas() / CELLSTANDARD * 100, 0.1)
|
||||
|
||||
O.overlays += numbericon("[pres]", -8)
|
||||
O.mark = "[temp]/[pres]"
|
||||
*/
|
||||
/*
|
||||
/turf/verb/Pipes()
|
||||
set category = "Debug"
|
||||
|
||||
for(var/turf/T in range(6))
|
||||
|
||||
//boutput(world, "Turf [T] at ([T.x],[T.y])")
|
||||
|
||||
for(var/obj/machinery/M in T)
|
||||
//boutput(world, " Mach [M] with pdir=[M.p_dir]")
|
||||
|
||||
if(M && M.p_dir)
|
||||
|
||||
//boutput(world, "Accepted")
|
||||
var/obj/mark/O = locate(/obj/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/mark(T)
|
||||
else
|
||||
O.overlays = null
|
||||
|
||||
if(istype(M, /obj/machinery/pipes))
|
||||
var/obj/machinery/pipes/P = M
|
||||
O.overlays += numbericon("[P.plnum] ", -20)
|
||||
M = P.pl
|
||||
|
||||
|
||||
var/obj/substance/gas/G = M.get_gas()
|
||||
|
||||
if(G)
|
||||
|
||||
var/cap = round( 100*(G.tot_gas()/ M.capmult / 6e6), 0.1)
|
||||
var/temp = round(G.temperature - T0C, 0.1)
|
||||
O.overlays += numbericon("[temp]C", 0)
|
||||
O.overlays += numbericon("[cap]", -8)
|
||||
|
||||
break
|
||||
*/
|
||||
/turf/verb/Cables()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
for(var/turf/T in range(6))
|
||||
|
||||
//boutput(world, "Turf [T] at ([T.x],[T.y])")
|
||||
|
||||
var/obj/mark/O = locate(/obj/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/mark(T)
|
||||
else
|
||||
O.overlays = null
|
||||
|
||||
var/marked = 0
|
||||
for(var/obj/M in T)
|
||||
//boutput(world, " Mach [M] with pdir=[M.p_dir]")
|
||||
|
||||
|
||||
if(M && istype(M, /obj/cable/))
|
||||
|
||||
|
||||
var/obj/cable/C = M
|
||||
//boutput(world, "Accepted")
|
||||
|
||||
O.overlays += numbericon("[C.netnum] " , marked)
|
||||
|
||||
marked -= 8
|
||||
|
||||
else if(M && istype(M, /obj/machinery/power/))
|
||||
|
||||
var/obj/machinery/power/P = M
|
||||
O.overlays += numbericon("*[P.netnum] " , marked)
|
||||
marked -= 8
|
||||
|
||||
if(!marked)
|
||||
qdel(O)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/turf/verb/Solar()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
|
||||
for(var/turf/T in range(6))
|
||||
|
||||
//boutput(world, "Turf [T] at ([T.x],[T.y])")
|
||||
|
||||
var/obj/mark/O = locate(/obj/mark/, T)
|
||||
|
||||
if(!O)
|
||||
O = new /obj/mark(T)
|
||||
else
|
||||
O.overlays = null
|
||||
|
||||
|
||||
var/obj/machinery/power/solar/S
|
||||
|
||||
S = locate(/obj/machinery/power/solar, T)
|
||||
|
||||
if(S)
|
||||
|
||||
O.overlays += numbericon("[S.obscured] " , 0)
|
||||
O.overlays += numbericon("[round(S.sunfrac*100,0.1)] " , -12)
|
||||
|
||||
else
|
||||
qdel(O)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/mob/verb/Showports()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
var/turf/T
|
||||
var/obj/machinery/pipes/P
|
||||
var/list/ndirs
|
||||
|
||||
for(var/obj/machinery/pipeline/PL in plines)
|
||||
|
||||
var/num = plines.Find(PL)
|
||||
|
||||
P = PL.nodes[1] // 1st node in list
|
||||
ndirs = P.get_node_dirs()
|
||||
|
||||
T = get_step(P, ndirs[1])
|
||||
|
||||
var/obj/mark/O = new(T)
|
||||
|
||||
O.overlays += numbericon("[num] * 1 ", -4)
|
||||
O.overlays += numbericon("[ndirs[1]] - [ndirs[2]]",-16)
|
||||
|
||||
|
||||
P = PL.nodes[PL.nodes.len] // last node in list
|
||||
|
||||
ndirs = P.get_node_dirs()
|
||||
T = get_step(P, ndirs[2])
|
||||
|
||||
O = new(T)
|
||||
|
||||
O.overlays += numbericon("[num] * 2 ", -4)
|
||||
O.overlays += numbericon("[ndirs[1]] - [ndirs[2]]", -16)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/atom/verb/delete()
|
||||
set category = "Debug"
|
||||
set src in view()
|
||||
if(Debug)
|
||||
qdel(src)
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/area/verb/dark()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
if(src.icon_state == "dark")
|
||||
icon_state = null
|
||||
else
|
||||
icon_state = "dark"
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/area/verb/power()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
power_equip = !power_equip
|
||||
power_environ = !power_environ
|
||||
|
||||
boutput(world, "Power ([src]) = [power_equip]")
|
||||
|
||||
power_change()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
// *****RM
|
||||
|
||||
// *****
|
||||
|
||||
|
||||
/mob/verb/ShowPlasma()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
Plasma()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Blobcount()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
boutput(world, "Blob count: [blobs.len]")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/mob/verb/Blobkill()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
blobs = list()
|
||||
boutput(world, "Blob killed.")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Blobmode()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
boutput(world, "Event=[ticker.event]")
|
||||
boutput(world, "Time =[(ticker.event_time - world.realtime)/10]s")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Blobnext()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
ticker.event_time = world.realtime
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/mob/verb/callshuttle()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
ticker.timeleft = 300
|
||||
ticker.timing = 1
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/apcs()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
for(var/obj/machinery/power/apc/APC in machines)
|
||||
boutput(world, APC.report())
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Globals()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
debugobj = new()
|
||||
|
||||
debugobj.debuglist = list( powernets, plines, vote, config, admins, ticker, SS13_airtunnel, sun )
|
||||
|
||||
|
||||
boutput(world, "<A href='?src=\ref[debugobj];Vars=1'>Debug</A>")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
/*for(var/obj/O in plines)
|
||||
|
||||
boutput(world, "<A href='?src=\ref[O];Vars=1'>[O.name]</A>")
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/verb/Mach()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
var/n = 0
|
||||
for(var/obj/machinery/M in machines)
|
||||
n++
|
||||
if(! (M in machines) && ! (M in atmos_machines))
|
||||
boutput(world, "[M] [M.type]: not in list")
|
||||
|
||||
boutput(world, "in world: [n]; in list:[machines.len + atmos_machines.len]")
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
|
||||
/*/mob/verb/air()
|
||||
set category = "Debug"
|
||||
|
||||
Air()
|
||||
|
||||
/proc/Air()
|
||||
|
||||
|
||||
var/area/A = locate(/area/airintake)
|
||||
|
||||
var/atot = 0
|
||||
for(var/turf/T in A)
|
||||
atot += T.tot_gas()
|
||||
|
||||
var/ptot = 0
|
||||
for(var/obj/machinery/pipeline/PL in plines)
|
||||
if(PL.suffix == "d")
|
||||
ptot += PL.ngas.tot_gas()
|
||||
|
||||
var/vtot = 0
|
||||
for(var/obj/machinery/atmoalter/V in machines)
|
||||
if(V.suffix == "d")
|
||||
vtot += V.gas.tot_gas()
|
||||
|
||||
var/ctot = 0
|
||||
for(var/obj/machinery/connector/C in machines)
|
||||
if(C.suffix == "d")
|
||||
ctot += C.ngas.tot_gas()
|
||||
|
||||
|
||||
var/tot = atot + ptot + vtot + ctot
|
||||
|
||||
diary << "A=[num2text(atot,10)] P=[num2text(ptot,10)] V=[num2text(vtot,10)] C=[num2text(ctot,10)] : Total=[num2text(tot,10)]"
|
||||
*/
|
||||
/mob/verb/Revive()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
HealDamage("All", 10000, 10000)
|
||||
toxloss = 0
|
||||
oxyloss = 0
|
||||
paralysis = 0
|
||||
stunned = 0
|
||||
weakened = 0
|
||||
health = 100
|
||||
if(stat > 1) stat=0
|
||||
disabilities = initial(disabilities)
|
||||
sdisabilities = initial(sdisabilities)
|
||||
for(var/obj/item/organ/e in src)
|
||||
e.brute_dam = 0.0
|
||||
e.burn_dam = 0.0
|
||||
e.bandaged = 0.0
|
||||
e.wound_size = 0.0
|
||||
e.max_damage = initial(e.max_damage)
|
||||
e.update_icon()
|
||||
if(src.type == /mob/living/carbon/human)
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.UpdateDamageIcon()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/Smoke()
|
||||
set category = "Debug"
|
||||
if(Debug)
|
||||
var/obj/effects/smoke/O = new /obj/effects/smoke( src.loc )
|
||||
O.dir = pick(NORTH, SOUTH, EAST, WEST)
|
||||
spawn( 0 )
|
||||
O.Life()
|
||||
else
|
||||
alert("Debugging off")
|
||||
return
|
||||
|
||||
/mob/verb/revent(number as num)
|
||||
set category = "Debug"
|
||||
set name = "Change event %"
|
||||
if(!src.holder)
|
||||
boutput(src, "Only administrators may use this command.")
|
||||
return
|
||||
if(src.authenticated && src.holder)
|
||||
eventchance = number
|
||||
logTheThing("admin", src, null, "set the random event chance to [eventchance]%")
|
||||
logTheThing("diary", src, null, "set the random event chance to [eventchance]%", "admin")
|
||||
message_admins("[src.key] set the random event chance to [eventchance]%")
|
||||
|
||||
/mob/verb/removeplasma()
|
||||
set category = "Debug"
|
||||
set name = "Stabilize Atmos."
|
||||
if(!src.holder)
|
||||
boutput(src, "Only administrators may use this command.")
|
||||
return
|
||||
spawn(0)
|
||||
for(var/turf/T in view())
|
||||
T.poison = 0
|
||||
T.oldpoison = 0
|
||||
T.tmppoison = 0
|
||||
T.oxygen = 755985
|
||||
T.oldoxy = 755985
|
||||
T.tmpoxy = 755985
|
||||
T.co2 = 14.8176
|
||||
T.oldco2 = 14.8176
|
||||
T.tmpco2 = 14.8176
|
||||
T.n2 = 2.844e+006
|
||||
T.on2 = 2.844e+006
|
||||
T.tn2 = 2.844e+006
|
||||
T.tsl_gas = 0
|
||||
T.osl_gas = 0
|
||||
T.sl_gas = 0
|
||||
T.temp = 293.15
|
||||
T.otemp = 293.15
|
||||
T.ttemp = 293.15
|
||||
|
||||
/mob/verb/fire(turf/T as turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create Fire"
|
||||
if(!src.holder)
|
||||
boutput(src, "Only administrators may use this command.")
|
||||
return
|
||||
boutput(world, "[usr.key] created fire")
|
||||
spawn(0)
|
||||
T.poison += 30000000
|
||||
T.firelevel = T.poison
|
||||
|
||||
/mob/verb/co2(turf/T as turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create CO2"
|
||||
if(!src.holder)
|
||||
boutput(src, "Only administrators may use this command.")
|
||||
return
|
||||
boutput(world, "[usr.key] created CO2")
|
||||
spawn(0)
|
||||
T.co2 += 300000000
|
||||
|
||||
/mob/verb/n2o(turf/T as turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create N2O"
|
||||
if(!src.holder)
|
||||
boutput(src, "Only administrators may use this command.")
|
||||
return
|
||||
boutput(world, "[usr.key] created N2O")
|
||||
spawn(0)
|
||||
T.sl_gas += 30000000
|
||||
|
||||
/mob/verb/explosion(T as obj|mob|turf in world)
|
||||
set category = "Special Verbs"
|
||||
set name = "Create Explosion"
|
||||
if(!src.holder)
|
||||
boutput(src, "Only administrators may use this command.")
|
||||
return
|
||||
boutput(world, "[usr.key] created an explosion")
|
||||
var/obj/item/weapon/tank/plasmatank/pt = new /obj/item/weapon/tank/plasmatank( T )
|
||||
playsound(pt.loc, "explosion", 100, 1,3)
|
||||
playsound(pt.loc, "sound/effects/explosionfar.ogg", 100, 1,10)
|
||||
pt.gas.temperature = 500+T0C
|
||||
pt.ignite()
|
||||
@@ -0,0 +1,212 @@
|
||||
/obj/machinery/ai_bot
|
||||
name = "Robot"
|
||||
icon = 'icons/mob/robots.dmi'
|
||||
icon_state = "ro"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
var/obj/item/weapon/cell/cell
|
||||
var/charge = 0
|
||||
var/operating = 1
|
||||
var/health = 150
|
||||
var/opened = 0
|
||||
var/locked = 1
|
||||
var/coverlocked = 0
|
||||
var/emagged = 0
|
||||
var/wiresexposed = 0
|
||||
|
||||
var/now_pushing = null
|
||||
var/last_b_state = 1.0
|
||||
|
||||
pressure_resistance = 3*ONE_ATMOSPHERE
|
||||
|
||||
var/list/body_standing = list( )
|
||||
var/list/body_lying = list( )
|
||||
|
||||
/obj/machinery/ai_bot/proc/update()
|
||||
|
||||
if(src.stat & BROKEN)
|
||||
if(src.health > 0)
|
||||
stat &= ~BROKEN
|
||||
else
|
||||
return
|
||||
if(src.health < 0)
|
||||
src.set_broken()
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/ai_bot/proc/updateicon()
|
||||
if(src.stat & BROKEN)
|
||||
icon_state = "ro+b"
|
||||
return
|
||||
if(opened)
|
||||
icon_state = "[ cell ? "apc2" : "apc1" ]" // if opened, show cell if it's inserted
|
||||
src.overlays = null // also delete all overlays
|
||||
|
||||
else if(emagged)
|
||||
icon_state = "apcemag"
|
||||
src.overlays = null
|
||||
return
|
||||
|
||||
else if(wiresexposed)
|
||||
icon_state = "ro+o"
|
||||
src.overlays = null
|
||||
return
|
||||
|
||||
else
|
||||
icon_state = "ro"
|
||||
|
||||
// if closed, update overlays for channel status
|
||||
|
||||
src.overlays = null
|
||||
|
||||
// overlays += image('icons/obj/power.dmi', "apcox-[locked]") // 0=blue 1=red
|
||||
// overlays += image('icons/obj/power.dmi', "apco3-[charging]") // 0=red, 1=yellow/black 2=green
|
||||
|
||||
|
||||
/* if(operating)
|
||||
|
||||
overlays += image('icons/obj/power.dmi', "apco0-[equipment]") // 0=red, 1=green, 2=blue
|
||||
overlays += image('icons/obj/power.dmi', "apco1-[lighting]")
|
||||
overlays += image('icons/obj/power.dmi', "apco2-[environ]")
|
||||
Yes yes stolen from APC code I know!
|
||||
To-do: Add overlays here */
|
||||
|
||||
/obj/machinery/ai_bot/attackby(obj/item/weapon/W, mob/user)
|
||||
|
||||
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
|
||||
if (W:get_fuel() > 2)
|
||||
W:use_fuel(2)
|
||||
else
|
||||
boutput(user, "Need more welding fuel!")
|
||||
return
|
||||
src.health += 30
|
||||
src.add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("<span style=\"color:red\">[user] has mended the robot!</span>"), 1)
|
||||
src.update()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
|
||||
if(opened)
|
||||
opened = 0
|
||||
updateicon()
|
||||
else
|
||||
if(coverlocked)
|
||||
boutput(user, "The cover is locked and cannot be opened.")
|
||||
else
|
||||
opened = 1
|
||||
updateicon()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/cell) && opened) // trying to put a cell inside
|
||||
if(cell)
|
||||
boutput(user, "There is a power cell already installed.")
|
||||
else
|
||||
user.drop_item()
|
||||
W.set_loc(src)
|
||||
cell = W
|
||||
boutput(user, "You insert the power cell.")
|
||||
// chargecount = 0
|
||||
updateicon()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
|
||||
if(opened)
|
||||
boutput(user, "Close the Robot first")
|
||||
else if(emagged)
|
||||
boutput(user, "The interface is broken")
|
||||
else
|
||||
wiresexposed = !wiresexposed
|
||||
boutput(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
|
||||
updateicon()
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/id)) // trying to unlock the interface with an ID card
|
||||
if(emagged)
|
||||
boutput(user, "The interface is broken")
|
||||
else if(opened)
|
||||
boutput(user, "You must close the cover to swipe an ID card.")
|
||||
else if(wiresexposed)
|
||||
boutput(user, "You must close the panel")
|
||||
else
|
||||
if(src.allowed(usr))
|
||||
locked = !locked
|
||||
boutput(user, "You [ locked ? "lock" : "unlock"] the APC interface.")
|
||||
updateicon()
|
||||
else
|
||||
boutput(user, "<span style=\"color:red\">Access denied.</span>")
|
||||
|
||||
else if (istype(W, /obj/item/weapon/card/emag) && !emagged) // trying to unlock with an emag card
|
||||
if(opened)
|
||||
boutput(user, "You must close the cover to swipe an ID card.")
|
||||
else if(wiresexposed)
|
||||
boutput(user, "You must close the panel first")
|
||||
else
|
||||
flick("apc-spark", src)
|
||||
sleep(6)
|
||||
if(prob(50))
|
||||
emagged = 1
|
||||
locked = 0
|
||||
boutput(user, "You emag the APC interface.")
|
||||
updateicon()
|
||||
else
|
||||
boutput(user, "You fail to [ locked ? "unlock" : "lock"] the APC interface.")
|
||||
|
||||
else
|
||||
src.health -= W.force
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("<span style=\"color:red\">[src] has been attacked by [user] with the [W]!</span>"), 5)
|
||||
src.update()
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/ai_bot/ex_act(severity)
|
||||
switch(severity)
|
||||
if (1)
|
||||
qdel(src)
|
||||
if (2)
|
||||
if(prob(50))
|
||||
src.health -= 200
|
||||
else
|
||||
qdel(src)
|
||||
if (3)
|
||||
if(prob(50))
|
||||
src.health -= 150
|
||||
else
|
||||
src.health -= 50
|
||||
src.update()
|
||||
|
||||
/obj/machinery/ai_bot/bullet_act(flag)
|
||||
if(src.material) src.material.triggerOnAttacked(src, P.shooter, src, P.shooter.equipped())
|
||||
for(var/atom/A in src)
|
||||
if(A.material)
|
||||
A.material.triggerOnAttacked(A, P.shooter, src, P.shooter.equipped())
|
||||
|
||||
if (flag == PROJECTILE_BULLET)
|
||||
src.health -= 10
|
||||
|
||||
else if (flag != PROJECTILE_LASER)
|
||||
src.health -= 20
|
||||
|
||||
else
|
||||
src.health -= 40
|
||||
|
||||
src.update()
|
||||
return
|
||||
|
||||
/obj/machinery/ai_bot/blob_act(var/power)
|
||||
if (prob(power * 2.5))
|
||||
src.health -= 40
|
||||
update()
|
||||
return
|
||||
|
||||
/obj/machinery/ai_bot/meteorhit(obj/O as obj)
|
||||
src.health -= 100
|
||||
src.update()
|
||||
return
|
||||
|
||||
/obj/machinery/ai_bot/proc/set_broken()
|
||||
stat |= BROKEN
|
||||
icon_state = "ro+b"
|
||||
overlays = null
|
||||
|
||||
operating = 0
|
||||
update()
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
|
||||
This shit isn't good for anything and lags like fuck. Commented it out for now.
|
||||
|
||||
/mob/living/silicon/ai/proc/lockdown()
|
||||
set category = "AI Commands"
|
||||
set name = "Lockdown"
|
||||
|
||||
if(usr.stat == 2)
|
||||
boutput(usr, "You cannot initiate lockdown because you are dead!")
|
||||
return
|
||||
|
||||
boutput(world, "<span style=\"color:red\">Lockdown initiated by [usr.name]!</span>")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in machines) //activate firealarms
|
||||
spawn( 0 )
|
||||
if(FA.lockdownbyai == 0)
|
||||
FA.lockdownbyai = 1
|
||||
FA.alarm()
|
||||
for(var/obj/machinery/door/airlock/AL) //close airlocks
|
||||
spawn( 0 )
|
||||
if(AL.canAIControl() && AL.icon_state == "door0" && AL.lockdownbyai == 0)
|
||||
AL.close()
|
||||
AL.lockdownbyai = 1
|
||||
|
||||
var/obj/machinery/computer/communications/C = locate() in world
|
||||
if(C)
|
||||
C.post_status("alert", "lockdown")
|
||||
|
||||
/* src.verbs -= /mob/living/silicon/ai/proc/lockdown
|
||||
src.verbs += /mob/living/silicon/ai/proc/disablelockdown
|
||||
boutput(usr, "<span style=\"color:red\">Disable lockdown command enabled!</span>")
|
||||
winshow(usr,"rpane",1)
|
||||
*/
|
||||
|
||||
/mob/living/silicon/ai/proc/disablelockdown()
|
||||
set category = "AI Commands"
|
||||
set name = "Disable Lockdown"
|
||||
|
||||
if(usr.stat == 2)
|
||||
boutput(usr, "You cannot disable lockdown because you are dead!")
|
||||
return
|
||||
|
||||
boutput(world, "<span style=\"color:red\">Lockdown cancelled by [usr.name]!</span>")
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in machines) //deactivate firealarms
|
||||
spawn( 0 )
|
||||
if(FA.lockdownbyai == 1)
|
||||
FA.lockdownbyai = 0
|
||||
FA.reset()
|
||||
for(var/obj/machinery/door/airlock/AL) //open airlocks
|
||||
spawn ( 0 )
|
||||
if(AL.canAIControl() && AL.lockdownbyai == 1)
|
||||
AL.open()
|
||||
AL.lockdownbyai = 0
|
||||
|
||||
src.verbs -= /mob/living/silicon/ai/proc/disablelockdown
|
||||
src.verbs += /mob/living/silicon/ai/proc/lockdown
|
||||
boutput(usr, "<span style=\"color:red\">Disable lockdown command removed until lockdown initiated again!</span>")
|
||||
winshow(usr,"rpane",1)
|
||||
*/
|
||||
@@ -0,0 +1,444 @@
|
||||
/obj/move/airtunnel/process()
|
||||
if (!( src.deployed ))
|
||||
return null
|
||||
else
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/create()
|
||||
src.current = src
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
spawn( 0 )
|
||||
src.next.create(airtunnel_start - airtunnel_stop, src.y)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/connector/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/create(num, y_coord)
|
||||
if (((num < 7 || (num > 16 && num < 23)) && y_coord == airtunnel_bottom))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/wall/move_right()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/move_left()
|
||||
flick("wall-m", src)
|
||||
return ..()
|
||||
|
||||
/obj/move/airtunnel/wall/process()
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_left()
|
||||
src.relocate(get_step(src, WEST))
|
||||
if ((src.next && src.next.deployed))
|
||||
return src.next.move_left()
|
||||
else
|
||||
return src.next
|
||||
return
|
||||
|
||||
/obj/move/airtunnel/proc/move_right()
|
||||
src.relocate(get_step(src, EAST))
|
||||
if ((src.previous && src.previous.deployed))
|
||||
src.previous.move_right()
|
||||
return src.previous
|
||||
|
||||
/obj/move/airtunnel/proc/create(num, y_coord)
|
||||
if (y_coord == airtunnel_bottom)
|
||||
if ((num < 7 || (num > 16 && num < 23)))
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel/wall( null )
|
||||
else
|
||||
src.next = new /obj/move/airtunnel( null )
|
||||
src.next.master = src.master
|
||||
src.next.previous = src
|
||||
if (num > 1)
|
||||
spawn( 0 )
|
||||
src.next.create(num - 1, y_coord)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/blob_act(var/power)
|
||||
if (prob(power * 2.5))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "reader_broken"
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/at_indicator/proc/update_icon()
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
icon_state = "reader_broken"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
if(!SS13_airtunnel.connectors)
|
||||
return
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("reader[][]", (SS13_airtunnel.siphon_status == 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/at_indicator/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
src.update_icon()
|
||||
return
|
||||
use_power(5, ENVIRON)
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
obj/machinery/computer/airtunnel/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Air Tunnel Controls</B><BR>"
|
||||
user.machine = src
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
dat += "<B>Status:</B> RETRACTING<BR>"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
dat += "<B>Status:</B> EXPANDING<BR>"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
dat += "<B>Status:</B> Fully Retracted<BR>"
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
dat += "<B>Status:</B> Fully Extended<BR>"
|
||||
else
|
||||
dat += "<B>Status:</B> Stopped Midway<BR>"
|
||||
dat += text("<A href='?src=\ref[];retract=1'>Retract</A> <A href='?src=\ref[];stop=1'>Stop</A> <A href='?src=\ref[];extend=1'>Extend</A><BR>", src, src, src)
|
||||
dat += text("<BR><B>Air Level:</B> []<BR>", (SS13_airtunnel.air_stat ? "Acceptable" : "DANGEROUS"))
|
||||
dat += "<B>Air System Status:</B> "
|
||||
switch(SS13_airtunnel.siphon_status)
|
||||
if(0.0)
|
||||
dat += "Stopped "
|
||||
if(1.0)
|
||||
dat += "Siphoning (Siphons only) "
|
||||
if(2.0)
|
||||
dat += "Regulating (BOTH) "
|
||||
if(3.0)
|
||||
dat += "RELEASING MAX (Siphons only) "
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];refresh=1'>(Refresh)</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];release=1'>RELEASE (Siphons only)</A> <A href='?src=\ref[];siphon=1'>Siphon (Siphons only)</A> <A href='?src=\ref[];stop_siph=1'>Stop</A> <A href='?src=\ref[];auto=1'>Regulate</A><BR>", src, src, src, src)
|
||||
dat += text("<BR><BR><A href='?action=mach_close&window=computer'>Close</A></TT></BODY></HTML>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
onclose(user, "computer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/proc/update_icon()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("console[][]", (SS13_airtunnel.siphon_status >= 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/process()
|
||||
src.update_icon()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["retract"])
|
||||
SS13_airtunnel.retract()
|
||||
else if (href_list["stop"])
|
||||
SS13_airtunnel.operating = 0
|
||||
else if (href_list["extend"])
|
||||
SS13_airtunnel.extend()
|
||||
else if (href_list["release"])
|
||||
SS13_airtunnel.siphon_status = 3
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["siphon"])
|
||||
SS13_airtunnel.siphon_status = 1
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["stop_siph"])
|
||||
SS13_airtunnel.siphon_status = 0
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["auto"])
|
||||
SS13_airtunnel.siphon_status = 2
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["refresh"])
|
||||
SS13_airtunnel.siphons()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/sec_lock/attack_ai(user as mob)
|
||||
return //src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/attack_hand(var/mob/user as mob)
|
||||
if (ismonkey(user))
|
||||
return
|
||||
if(..())
|
||||
return
|
||||
use_power(10)
|
||||
|
||||
if (src.loc == user.loc)
|
||||
var/dat = text("<B>Security Pad:</B><BR><br>Keycard: []<BR><br><A href='?src=\ref[];door1=1'>Toggle Outer Door</A><BR><br><A href='?src=\ref[];door2=1'>Toggle Inner Door</A><BR><br><BR><br><A href='?src=\ref[];em_cl=1'>Emergency Close</A><BR><br><A href='?src=\ref[];em_op=1'>Emergency Open</A><BR>", (src.scan ? text("<A href='?src=\ref[];card=1'>[]</A>", src, src.scan.name) : text("<A href='?src=\ref[];card=1'>-----</A>", src)), src, src, src, src)
|
||||
user << browse(dat, "window=sec_lock")
|
||||
onclose(user, "sec_lock")
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/attackby(nothing, user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/sec_lock/New()
|
||||
..()
|
||||
spawn( 2 )
|
||||
if (src.a_type == 1)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y - 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTHWEST))
|
||||
else
|
||||
if (src.a_type == 2)
|
||||
src.d2 = locate(/obj/machinery/door, locate(src.x - 2, src.y + 1, src.z))
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, NORTHWEST))
|
||||
else
|
||||
src.d1 = locate(/obj/machinery/door, get_step(src, SOUTH))
|
||||
src.d2 = locate(/obj/machinery/door, get_step(src, SOUTHEAST))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/sec_lock/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((!( src.d1 ) || !( src.d2 )))
|
||||
boutput(usr, "<span style=\"color:red\">Error: Cannot interface with door security!</span>")
|
||||
return
|
||||
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon))))
|
||||
usr.machine = src
|
||||
if (href_list["card"])
|
||||
if (src.scan)
|
||||
src.scan.set_loc(src.loc)
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/weapon/card/id/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.set_loc(src)
|
||||
src.scan = I
|
||||
if (href_list["door1"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d1.density)
|
||||
spawn( 0 )
|
||||
src.d1.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d1.close()
|
||||
return
|
||||
if (href_list["door2"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (src.d2.density)
|
||||
spawn( 0 )
|
||||
src.d2.open()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_cl"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
if (!( src.d1.density ))
|
||||
src.d1.close()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (!( src.d2.density ))
|
||||
src.d2.close()
|
||||
return
|
||||
if (href_list["em_op"])
|
||||
if (src.scan)
|
||||
if (src.check_access(src.scan))
|
||||
spawn( 0 )
|
||||
if (src.d1.density)
|
||||
src.d1.open()
|
||||
return
|
||||
sleep(1)
|
||||
spawn( 0 )
|
||||
if (src.d2.density)
|
||||
src.d2.open()
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/datum/air_tunnel/air_tunnel1/New()
|
||||
..()
|
||||
for(var/obj/move/airtunnel/A in locate(/area/airtunnel1))
|
||||
A.master = src
|
||||
A.create()
|
||||
src.connectors += A
|
||||
//Foreach goto(21)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/siphons()
|
||||
switch(src.siphon_status)
|
||||
if(0.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(1.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 2
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
if(2.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/S in locate(/area/airtunnel1))
|
||||
S.t_status = 4
|
||||
if(3.0)
|
||||
for(var/obj/machinery/atmoalter/siphs/fullairsiphon/S in locate(/area/airtunnel1))
|
||||
S.t_status = 1
|
||||
S.t_per = 1000000.0
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in locate(/area/airtunnel1))
|
||||
S.t_status = 3
|
||||
else
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/stop()
|
||||
src.operating = 0
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/extend()
|
||||
if (src.operating)
|
||||
return
|
||||
|
||||
spawn(0)
|
||||
src.operating = 2
|
||||
while(src.operating == 2)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.next ))
|
||||
src.operating = 0
|
||||
return
|
||||
if (!( A.move_left() ))
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current)
|
||||
A.current.next.set_loc(get_step(A.current.loc, EAST))
|
||||
A.current = A.current.next
|
||||
A.current.deployed = 1
|
||||
else
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
|
||||
/datum/air_tunnel/proc/retract()
|
||||
if (src.operating)
|
||||
return
|
||||
spawn(0)
|
||||
src.operating = 1
|
||||
while(src.operating == 1)
|
||||
var/ok = 1
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (A.current == A)
|
||||
src.operating = 0
|
||||
return
|
||||
if (A.current)
|
||||
A.current.set_loc(null)
|
||||
A.current.deployed = 0
|
||||
A.current = A.current.previous
|
||||
else
|
||||
ok = 0
|
||||
if (!( ok ))
|
||||
src.operating = 0
|
||||
else
|
||||
for(var/obj/move/airtunnel/connector/A in src.connectors)
|
||||
if (!( A.current.move_right() ))
|
||||
src.operating = 0
|
||||
sleep(20)
|
||||
return
|
||||
@@ -0,0 +1,3 @@
|
||||
/obj/machinery/atmos
|
||||
name = "Atmos"
|
||||
desc = "You should not see me"
|
||||
@@ -0,0 +1,74 @@
|
||||
datum/atmos/pipeline
|
||||
var/datum/gas_mixture/Gasses = null
|
||||
var/list/obj/machinery/atmos/pipe/pipelist = new/list()
|
||||
var/list/obj/machinery/atmos/node/nodelist = new/list()
|
||||
|
||||
var/Percent_Avail = 0
|
||||
var/Max = 0
|
||||
|
||||
|
||||
New()
|
||||
Gasses = new
|
||||
return
|
||||
|
||||
///MERGE
|
||||
///Takes two pipelines and puts them together
|
||||
proc/merge(datum/atmos/pipeline/slave)
|
||||
if(slave == src)
|
||||
return
|
||||
for(var/obj/machinery/atmos/pipe/P in slave.pipelist)
|
||||
src.pipelist.Add(P)
|
||||
slave.pipelist.Remove(P)
|
||||
for(var/obj/machinery/atmos/node/N in slave.nodelist)
|
||||
src.nodelist.Add(N)
|
||||
slave.nodelist.Remove(N)
|
||||
|
||||
|
||||
///SPLIT
|
||||
///Takes this pipeline and turns it into two
|
||||
proc/split()
|
||||
return
|
||||
|
||||
///ADD_GAS
|
||||
///Adds some gas into this pipeline's gas_mixture object
|
||||
proc/add_gas(var/plasma, var/oxy, var/co2, var/n2o, var/obj/Giver)
|
||||
return
|
||||
|
||||
///REMOVE_GAS
|
||||
///Takes some gas from this pipeline's gas_mixture object
|
||||
proc/remove_gas(var/plasma, var/oxy, var/co2, var/n2o, var/obj/Taker)
|
||||
return
|
||||
|
||||
///ADD_PIPE
|
||||
///Adds a pipe object to the line, will call MERGE if it has a parent other than this one
|
||||
proc/add_pipe(var/obj/machinery/atmos/pipe/P)
|
||||
if(P.parent)
|
||||
if(P.parent != src)
|
||||
src.merge(P.parent)
|
||||
return
|
||||
else
|
||||
pipelist.add(P)
|
||||
P.parent = src
|
||||
return
|
||||
|
||||
///ADD_PIPE
|
||||
///Adds a node object to the line
|
||||
proc/add_node(var/obj/machinery/atmos/node/N)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
datum/gas_mixture
|
||||
|
||||
oxygen = 0
|
||||
carbon_dioxide = 0
|
||||
nitrogen = 0
|
||||
toxins = 0
|
||||
|
||||
volume = CELL_VOLUME
|
||||
|
||||
temperature = 0 //in Kelvin, use calculate_temperature() to modify
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,478 @@
|
||||
//DEFINES ETC
|
||||
|
||||
/obj/machinery/engine_laser_spawner
|
||||
name = "Engine Laser Emitter"
|
||||
desc = "This is what it is."
|
||||
icon = 'engine_stuff.dmi'
|
||||
icon_state = "engine_laser_spawner0"
|
||||
var/obj/beam/engine_laser/first = null
|
||||
var/id = 1
|
||||
var/state = 0.0
|
||||
var/energy = 0
|
||||
var/health = 100
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
m_amt = 150
|
||||
|
||||
/obj/beam/engine_laser
|
||||
name = "engine laser"
|
||||
icon = 'engine_stuff.dmi'
|
||||
icon_state = "engine_laser"
|
||||
var/obj/beam/engine_laser/next = null
|
||||
var/obj/machinery/engine_laser_spawner/master = null
|
||||
var/limit = null
|
||||
var/visible = 0.0
|
||||
var/left = null
|
||||
var/energy = 20
|
||||
anchored = 1.0
|
||||
flags = TABLEPASS
|
||||
|
||||
/obj/beam/focused_laser
|
||||
name = "focused laser"
|
||||
icon = 'engine_stuff.dmi'
|
||||
icon_state = "focused_laser"
|
||||
var/obj/beam/focused_laser/next = null
|
||||
var/obj/machinery/focusing_mirror/master = null
|
||||
var/limit = null
|
||||
var/visible = 0.0
|
||||
var/left = null
|
||||
var/energy = 0
|
||||
anchored = 1.0
|
||||
flags = TABLEPASS
|
||||
|
||||
/obj/machinery/focusing_mirror
|
||||
name = "focusing mirror"
|
||||
icon = 'engine_stuff.dmi'
|
||||
icon_state = "focus_mirror"
|
||||
var/obj/beam/focused_laser/first = null
|
||||
var/b_number = 0
|
||||
var/energy = 0
|
||||
var/on = 1
|
||||
density = 0
|
||||
|
||||
/obj/machinery/computer/laser_computer
|
||||
name = "laser computer"
|
||||
icon = 'engine_stuff.dmi'
|
||||
icon_state = "laser_computer"
|
||||
var/id = 1
|
||||
var/list/emitters = list()
|
||||
var/pattern = "Single"
|
||||
var/started = 0
|
||||
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// MIRROR STUFF
|
||||
//////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/focusing_mirror/proc/opp_dir(var/dir)
|
||||
if(dir == 1)
|
||||
return 2
|
||||
if(dir == 2)
|
||||
return 1
|
||||
if(dir == 3)
|
||||
return 4
|
||||
if(dir == 4)
|
||||
return 3
|
||||
if(dir == 5)
|
||||
return 8
|
||||
if(dir == 6)
|
||||
return 7
|
||||
if(dir == 7)
|
||||
return 6
|
||||
if(dir == 8)
|
||||
return 5
|
||||
|
||||
/obj/machinery/focusing_mirror/process()
|
||||
if(src.on && src.b_number)
|
||||
src.shoot()
|
||||
src.b_number = 0
|
||||
src.energy = 0
|
||||
return
|
||||
else
|
||||
qdel(src.first)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/focusing_mirror/proc/shoot()
|
||||
if(!b_number)
|
||||
qdel(src.first)
|
||||
return null
|
||||
if(src.first)
|
||||
return
|
||||
var/obj/beam/focused_laser/I = new /obj/beam/focused_laser( (src.loc) )
|
||||
I.master = src
|
||||
I.density = 1
|
||||
I.dir = opp_dir(src.dir)
|
||||
I.energy = src.energy
|
||||
step(I, I.dir)
|
||||
if (I)
|
||||
I.dir = opp_dir(src.dir)
|
||||
I.density = 0
|
||||
src.first = I
|
||||
I.vis_spread(1)
|
||||
spawn( 0 )
|
||||
if (I)
|
||||
I.limit = 20
|
||||
I.process()
|
||||
return
|
||||
if (!( b_number ))
|
||||
qdel(src.first)
|
||||
src.b_number = 0
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/focusing_mirror/proc/hit()
|
||||
return
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// MIRROR LASER BEAM STUFF
|
||||
/////////////////////////////////////////////
|
||||
|
||||
|
||||
/obj/beam/focused_laser/proc/hit()
|
||||
if (src.master)
|
||||
src.master.hit()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/beam/focused_laser/proc/vis_spread(v)
|
||||
src.visible = v
|
||||
spawn( 0 )
|
||||
if (src.next)
|
||||
src.next.vis_spread(v)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/focused_laser/proc/process()
|
||||
if ((src.loc.density || !( src.master )))
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if (src.left > 0)
|
||||
src.left--
|
||||
if (src.left < 1)
|
||||
if (!( src.visible ))
|
||||
src.invisibility = 101
|
||||
else
|
||||
src.invisibility = 0
|
||||
else
|
||||
src.invisibility = 0
|
||||
|
||||
var/obj/beam/focused_laser/I = new /obj/beam/focused_laser( src.loc )
|
||||
I.master = src.master
|
||||
//I.density = 1
|
||||
I.dir = src.dir
|
||||
I.energy = src.energy
|
||||
step(I, I.dir)
|
||||
|
||||
if (I)
|
||||
if (!( src.next ) && I)
|
||||
I.dir = src.dir
|
||||
I.density = 0
|
||||
I.vis_spread(src.visible)
|
||||
src.next = I
|
||||
spawn( 0 )
|
||||
if ((I && src.limit > 0))
|
||||
I.limit = src.limit - 1
|
||||
I.process()
|
||||
return
|
||||
else
|
||||
if(I)
|
||||
qdel(I)
|
||||
else
|
||||
qdel(src.next)
|
||||
spawn( 10 )
|
||||
src.process()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/focused_laser/Bump()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/beam/focused_laser/Bumped()
|
||||
src.hit()
|
||||
return
|
||||
|
||||
/obj/beam/focused_laser/HasEntered(atom/movable/AM as mob|obj)
|
||||
if (istype(AM, /obj/beam))
|
||||
return
|
||||
spawn( 0 )
|
||||
src.hit()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/focused_laser/disposing()
|
||||
if (src.next)
|
||||
src.next.dispose()
|
||||
src.next = null
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// ENGINE LASER BEAM STUFF
|
||||
/////////////////////////////////////////////
|
||||
|
||||
|
||||
/obj/beam/engine_laser/proc/hit()
|
||||
if (src.master)
|
||||
src.master.hit()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/beam/engine_laser/proc/vis_spread(v)
|
||||
src.visible = v
|
||||
spawn( 0 )
|
||||
if (src.next)
|
||||
src.next.vis_spread(v)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/engine_laser/proc/process()
|
||||
|
||||
if ((src.loc.density || !( src.master )))
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if (src.left > 0)
|
||||
src.left--
|
||||
if (src.left < 1)
|
||||
if (!( src.visible ))
|
||||
src.invisibility = 101
|
||||
else
|
||||
src.invisibility = 0
|
||||
else
|
||||
src.invisibility = 0
|
||||
|
||||
var/obj/beam/engine_laser/I = new /obj/beam/engine_laser( src.loc )
|
||||
I.master = src.master
|
||||
//I.density = 1
|
||||
I.dir = src.dir
|
||||
I.energy = src.energy
|
||||
step(I, I.dir)
|
||||
|
||||
if (I)
|
||||
for(var/obj/machinery/focusing_mirror/M in I.loc)
|
||||
if(I.dir != M.dir)
|
||||
M.b_number++
|
||||
M.energy += I.energy
|
||||
qdel(src.next)
|
||||
qdel(I)
|
||||
break
|
||||
if (!( src.next ) && I)
|
||||
I.dir = src.dir
|
||||
I.density = 0
|
||||
I.vis_spread(src.visible)
|
||||
src.next = I
|
||||
spawn( 0 )
|
||||
if ((I && src.limit > 0))
|
||||
I.limit = src.limit - 1
|
||||
I.process()
|
||||
return
|
||||
else
|
||||
if(I)
|
||||
qdel(I)
|
||||
else
|
||||
qdel(src.next)
|
||||
spawn( 10 )
|
||||
src.process()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/engine_laser/Bump()
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/beam/engine_laser/Bumped()
|
||||
src.hit()
|
||||
return
|
||||
|
||||
/obj/beam/engine_laser/HasEntered(atom/movable/AM as mob|obj)
|
||||
if (istype(AM, /obj/beam))
|
||||
return
|
||||
spawn( 0 )
|
||||
src.hit()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/beam/engine_laser/Del()
|
||||
if (src.next)
|
||||
src.next.dispose()
|
||||
src.next = null
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
// LASER SPAWNER STUFF
|
||||
//////////////////////////////////////////
|
||||
|
||||
/obj/machinery/engine_laser_spawner/proc/hit()
|
||||
return
|
||||
|
||||
/obj/machinery/engine_laser_spawner/process()
|
||||
if(!state)
|
||||
qdel(src.first)
|
||||
return null
|
||||
|
||||
if ((!( src.first ) && (src.state && (istype(src.loc, /turf)))))
|
||||
var/obj/beam/engine_laser/I = new /obj/beam/engine_laser( (src.loc) )
|
||||
I.master = src
|
||||
I.density = 1
|
||||
I.dir = src.dir
|
||||
step(I, I.dir)
|
||||
if (I)
|
||||
I.dir = src.dir
|
||||
I.density = 0
|
||||
src.first = I
|
||||
I.vis_spread(1)
|
||||
spawn( 0 )
|
||||
if (I)
|
||||
I.limit = 20
|
||||
I.process()
|
||||
return
|
||||
if (!( src.state ))
|
||||
qdel(src.first)
|
||||
spawn(3)
|
||||
src.state = 0
|
||||
return
|
||||
|
||||
/obj/machinery/engine_laser_spawner/attack_hand()
|
||||
qdel(src.first)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/engine_laser_spawner/Move()
|
||||
var/t = src.dir
|
||||
..()
|
||||
src.dir = t
|
||||
qdel(src.first)
|
||||
return
|
||||
|
||||
/obj/machinery/engine_laser_spawner/verb/rotate()
|
||||
set src in usr
|
||||
|
||||
src.dir = turn(src.dir, 45)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
// COMPUTER STUFF
|
||||
//////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/laser_computer/New()
|
||||
..()
|
||||
spawn(100)
|
||||
for(var/obj/machinery/engine_laser_spawner/M in machines)
|
||||
if(src.id == M.id)
|
||||
src.emitters += M
|
||||
|
||||
/obj/machinery/computer/laser_computer/attack_ai(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/laser_computer/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/computer/laser_computer/proc/interact(mob/user)
|
||||
user.machine = src
|
||||
var/polledemitters
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
if(M.health < 20)
|
||||
polledemitters += "<FONT color = 'red'>"
|
||||
polledemitters += "<BR>[M]<FONT color = 'black'>"
|
||||
if(M.state)
|
||||
polledemitters += "<FONT color = 'red'> Firing<FONT color = 'black'>"
|
||||
var/dat = text({"<TT>
|
||||
<TT><B><FONT color = 'blue'>Loaded Laser Emitter Control Computer</B></TT><BR><BR>
|
||||
<B><FONT color = 'black'>Emitters: [polledemitters] </B><BR>
|
||||
Test: []<BR>
|
||||
Start Pattern: []<BR>
|
||||
Stop Pattern: []<BR>
|
||||
Firing Pattern: []"},
|
||||
text("<A href='?src=\ref[];testfire=1'>Fire</A>", src),
|
||||
text("<A href='?src=\ref[];realfire=1'>Fire</A>", src),
|
||||
text("<A href='?src=\ref[];stop=1'>Stop</A>", src),
|
||||
text("<A href='?src=\ref[];pattern=1'>[src.pattern]</A>", src))
|
||||
user << browse("<HEAD><TITLE>Laser Emitter Control Computer</TITLE></HEAD>[dat]", "window=lasercomputer")
|
||||
onclose(user, "lasercomputer")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/laser_computer/Topic(href, href_list)
|
||||
boutput(world, "Topic, [href_list]")
|
||||
usr.machine = src
|
||||
if (href_list["testfire"])
|
||||
if(!src.started)
|
||||
src.testfire()
|
||||
if (href_list["realfire"])
|
||||
src.started = 1
|
||||
src.realfire()
|
||||
if (href_list["stop"])
|
||||
src.started = 0
|
||||
if (href_list["pattern"])
|
||||
if(src.pattern == "Single")
|
||||
src.pattern = "Double"
|
||||
else if(src.pattern == "Double")
|
||||
src.pattern = "Quad"
|
||||
else
|
||||
src.pattern = "Single"
|
||||
if (istype(src.loc, /mob))
|
||||
attack_hand(src.loc)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/laser_computer/proc/testfire()
|
||||
spawn(0)
|
||||
if(src.pattern == "Single")
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
M.state = 1
|
||||
sleep(30)
|
||||
else if(src.pattern == "Double")
|
||||
var/double = 0
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
M.state = 1
|
||||
if(double)
|
||||
sleep(20)
|
||||
double = 0
|
||||
else
|
||||
double = 1
|
||||
else
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
M.state = 1
|
||||
|
||||
/obj/machinery/computer/laser_computer/proc/realfire()
|
||||
spawn(0)
|
||||
while(src.started)
|
||||
if(src.pattern == "Single")
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
M.state = 1
|
||||
sleep(30)
|
||||
else if(src.pattern == "Double")
|
||||
var/double = 0
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
M.state = 1
|
||||
if(double)
|
||||
sleep(30)
|
||||
double = 0
|
||||
else
|
||||
double = 1
|
||||
else
|
||||
for(var/obj/machinery/engine_laser_spawner/M in src.emitters)
|
||||
M.state = 1
|
||||
sleep(30)
|
||||
|
||||
|
||||
/obj/machinery/computer/laser_computer/process()
|
||||
spawn(2)
|
||||
src.updateDialog()
|
||||
|
||||
@@ -0,0 +1,685 @@
|
||||
//Super secret message here.
|
||||
|
||||
/obj/machinery/dna_scannernew/allow_drop()
|
||||
return 0
|
||||
|
||||
/obj/machinery/dna_scannernew/relaymove(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/verb/eject()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/verb/move_inside()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (src.occupant)
|
||||
boutput(usr, "<span style=\"color:blue\"><B>The scanner is already occupied!</B></span>")
|
||||
return
|
||||
usr.pulling = null
|
||||
usr.set_loc(src)
|
||||
src.occupant = usr
|
||||
src.icon_state = "scanner_1"
|
||||
for(var/obj/O in src)
|
||||
//O = null
|
||||
qdel(O)
|
||||
//Foreach goto(124)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/attackby(obj/item/weapon/grab/G as obj, user as mob)
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
boutput(user, "<span style=\"color:blue\"><B>The scanner is already occupied!</B></span>")
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
M.set_loc(src)
|
||||
src.occupant = M
|
||||
src.icon_state = "scanner_1"
|
||||
for(var/obj/O in src)
|
||||
O.set_loc(src.loc)
|
||||
//Foreach goto(154)
|
||||
src.add_fingerprint(user)
|
||||
//G = null
|
||||
qdel(G)
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/proc/go_out()
|
||||
if ((!( src.occupant ) || src.locked))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.set_loc(src.loc)
|
||||
//Foreach goto(30)
|
||||
src.occupant.set_loc(src.loc)
|
||||
src.occupant = null
|
||||
src.icon_state = "scanner_0"
|
||||
return
|
||||
|
||||
/obj/machinery/dna_scannernew/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
ex_act(severity)
|
||||
//Foreach goto(35)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
ex_act(severity)
|
||||
//Foreach goto(108)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
ex_act(severity)
|
||||
//Foreach goto(181)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/dna_scannernew/blob_act(var/power)
|
||||
if(prob(power * 2.5))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/scan_consolenew/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/scan_consolenew/blob_act(var/power)
|
||||
|
||||
if(prob(power * 2.5))
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/scan_consolenew/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else if(powered())
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/scan_consolenew/New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
src.connected = locate(/obj/machinery/dna_scannernew, get_step(src, WEST))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/scan_consolenew/process() //not really used right now
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250) // power stuff
|
||||
|
||||
var/mob/M //occupant
|
||||
if (!( src.status )) //remove this
|
||||
return
|
||||
if ((src.connected && src.connected.occupant)) //connected & occupant ok
|
||||
M = src.connected.occupant
|
||||
if (src.status == "something") // remove this
|
||||
//something else
|
||||
else
|
||||
if (src.status == "placeholder")
|
||||
if (istype(M, /mob))
|
||||
//do stuff
|
||||
else
|
||||
src.temphtml = "Process terminated due to lack of occupant in DNA chamber."
|
||||
src.status = null
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/scan_consolenew/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/scan_consolenew/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
var/dat
|
||||
if (src.delete && src.temphtml) //Window in buffer but its just simple message, so nothing
|
||||
src.delete = src.delete
|
||||
else if (!src.delete && src.temphtml) //Window in buffer - its a menu, dont add clear message
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];clear=1'>Main Menu</A>", src.temphtml, src)
|
||||
else
|
||||
if (src.connected) //Is something connected?
|
||||
var/mob/occupant = src.connected.occupant
|
||||
dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>" //Blah obvious
|
||||
if (occupant) //is there REALLY someone in there?
|
||||
if (!istype(occupant,/mob/living/carbon/human))
|
||||
sleep(1)
|
||||
var/t1
|
||||
switch(occupant.stat) // obvious, see what their status is
|
||||
if(0)
|
||||
t1 = "Conscious"
|
||||
if(1)
|
||||
t1 = "Unconscious"
|
||||
else
|
||||
t1 = "*dead*"
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), occupant.health, t1)
|
||||
dat += text("<font color='green'>Radiation Level: []%</FONT><BR><BR>", occupant.radiation)
|
||||
dat += text("Unique Enzymes : <font color='blue'>[]</FONT><BR>", uppertext(occupant.primarynew.use_enzyme))
|
||||
dat += text("Unique Identifier: <font color='blue'>[]</FONT><BR>", occupant.primarynew.uni_identity)
|
||||
dat += text("Structural Enzymes: <font color='blue'>[]</FONT><BR><BR>", occupant.primarynew.struc_enzyme)
|
||||
dat += text("<A href='?src=\ref[];unimenu=1'>Modify Unique Identifier</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];strucmenu=1'>Modify Structural Enzymes</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];buffermenu=1'>View/Edit/Transfer Buffer</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];genpulse=1'>Pulse Radiation</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];radset=1'>Radiation Emitter Settings</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];rejuv=1'>Inject Rejuvenators</A><BR><BR>", src)
|
||||
else
|
||||
dat += "The scanner is empty.<BR><BR>"
|
||||
dat += text("<A href='?src=\ref[];buffermenu=1'>View/Edit/Transfer Buffer</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];radset=1'>Radiation Emitter Settings</A><BR><BR>", src)
|
||||
if (!( src.connected.locked ))
|
||||
dat += text("<A href='?src=\ref[];locked=1'>Lock (Unlocked)</A><BR>", src)
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];locked=1'>Unlock (Locked)</A><BR>", src)
|
||||
//Other stuff goes here
|
||||
dat += text("<BR><BR><A href='?action=mach_close&window=scannernew'>Close</A>", user)
|
||||
else
|
||||
dat = "<font color='red'> Error: No DNA Modifier connected. </FONT>"
|
||||
user << browse(dat, "window=scannernew;size=550x625")
|
||||
onclose(user, "scannernew")
|
||||
return
|
||||
|
||||
/obj/machinery/scan_consolenew/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["locked"])
|
||||
if ((src.connected && src.connected.occupant))
|
||||
src.connected.locked = !( src.connected.locked )
|
||||
////////////////////////////////////////////////////////
|
||||
if (href_list["genpulse"])
|
||||
src.delete = 1
|
||||
src.temphtml = text("Working ... Please wait ([] Seconds)", src.radduration)
|
||||
usr << browse(temphtml, "window=scannernew;size=550x650")
|
||||
onclose(usr, "scannernew")
|
||||
sleep(10*src.radduration)
|
||||
if (!src.connected.occupant)
|
||||
temphtml = null
|
||||
delete = 0
|
||||
return null
|
||||
if (prob(95))
|
||||
if(prob(75))
|
||||
randmutb(src.connected.occupant)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
else
|
||||
if(prob(95))
|
||||
randmutg(src.connected.occupant)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
src.connected.occupant.radiation += ((src.radstrength*3)+src.radduration*3)
|
||||
temphtml = null
|
||||
delete = 0
|
||||
if (href_list["radset"])
|
||||
src.temphtml = text("Radiation Duration: <B><font color='green'>[]</B></FONT><BR>", src.radduration)
|
||||
src.temphtml += text("Radiation Intensity: <font color='green'><B>[]</B></FONT><BR><BR>", src.radstrength)
|
||||
src.temphtml += text("<A href='?src=\ref[];radleminus=1'>--</A> Duration <A href='?src=\ref[];radleplus=1'>++</A><BR>", src, src)
|
||||
src.temphtml += text("<A href='?src=\ref[];radinminus=1'>--</A> Intesity <A href='?src=\ref[];radinplus=1'>++</A><BR>", src, src)
|
||||
src.delete = 0
|
||||
if (href_list["radleplus"])
|
||||
if (src.radduration < 20)
|
||||
src.radduration++
|
||||
src.radduration++
|
||||
dopage(src,"radset")
|
||||
if (href_list["radleminus"])
|
||||
if (src.radduration > 2)
|
||||
src.radduration--
|
||||
src.radduration--
|
||||
dopage(src,"radset")
|
||||
if (href_list["radinplus"])
|
||||
if (src.radstrength < 10)
|
||||
src.radstrength++
|
||||
dopage(src,"radset")
|
||||
if (href_list["radinminus"])
|
||||
if (src.radstrength > 1)
|
||||
src.radstrength--
|
||||
dopage(src,"radset")
|
||||
////////////////////////////////////////////////////////
|
||||
if (href_list["unimenu"])
|
||||
//src.temphtml = text("Unique Identifier: <font color='blue'>[]</FONT><BR><BR>", src.connected.occupant.primarynew.uni_identity)
|
||||
src.temphtml = text("Unique Identifier: <font color='blue'>[getleftblocks(src.connected.occupant.primarynew.uni_identity,uniblock,3)][src.subblock == 1 ? "<U><B>"+getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),1,1)+"</U></B>" : getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),1,1)][src.subblock == 2 ? "<U><B>"+getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),2,1)+"</U></B>" : getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),2,1)][src.subblock == 3 ? "<U><B>"+getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),3,1)+"</U></B>" : getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),3,1)][getrightblocks(src.connected.occupant.primarynew.uni_identity,uniblock,3)]</FONT><BR><BR>")
|
||||
src.temphtml += text("Selected Block: <font color='blue'><B>[]</B></FONT><BR>", src.uniblock)
|
||||
src.temphtml += text("<A href='?src=\ref[];unimenuminus=1'><-</A> Block <A href='?src=\ref[];unimenuplus=1'>-></A><BR><BR>", src, src)
|
||||
src.temphtml += text("Selected Sub-Block: <font color='blue'><B>[]</B></FONT><BR>", src.subblock)
|
||||
src.temphtml += text("<A href='?src=\ref[];unimenusubminus=1'><-</A> Sub-Block <A href='?src=\ref[];unimenusubplus=1'>-></A><BR><BR>", src, src)
|
||||
src.temphtml += "<B>Modify Block:</B><BR>"
|
||||
src.temphtml += text("<A href='?src=\ref[];unipulse=1'>Radiation</A><BR>", src)
|
||||
src.delete = 0
|
||||
if (href_list["unimenuplus"])
|
||||
if (src.uniblock < 13)
|
||||
src.uniblock++
|
||||
dopage(src,"unimenu")
|
||||
if (href_list["unimenuminus"])
|
||||
if (src.uniblock > 1)
|
||||
src.uniblock--
|
||||
dopage(src,"unimenu")
|
||||
if (href_list["unimenusubplus"])
|
||||
if (src.subblock < 3)
|
||||
src.subblock++
|
||||
dopage(src,"unimenu")
|
||||
if (href_list["unimenusubminus"])
|
||||
if (src.subblock > 1)
|
||||
src.subblock--
|
||||
dopage(src,"unimenu")
|
||||
if (href_list["unipulse"])
|
||||
var/block
|
||||
var/newblock
|
||||
var/tstructure2
|
||||
block = getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),src.subblock,1)
|
||||
src.delete = 1
|
||||
src.temphtml = text("Working ... Please wait ([] Seconds)", src.radduration)
|
||||
usr << browse(temphtml, "window=scannernew;size=550x650")
|
||||
onclose(usr, "scannernew")
|
||||
sleep(10*src.radduration)
|
||||
if (!src.connected.occupant)
|
||||
temphtml = null
|
||||
delete = 0
|
||||
return null
|
||||
///
|
||||
if (prob((80 + (src.radduration / 2))))
|
||||
block = miniscramble(block, src.radstrength, src.radduration)
|
||||
newblock = null
|
||||
if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),2,1) + getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),3,1)
|
||||
if (src.subblock == 2) newblock = getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),1,1) + block + getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),3,1)
|
||||
if (src.subblock == 3) newblock = getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),1,1) + getblock(getblock(src.connected.occupant.primarynew.uni_identity,src.uniblock,3),2,1) + block
|
||||
tstructure2 = setblock(src.connected.occupant.primarynew.uni_identity, src.uniblock, newblock,3)
|
||||
src.connected.occupant.primarynew.uni_identity = tstructure2
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.primarynew.uni_identity)
|
||||
src.connected.occupant.radiation += (src.radstrength+src.radduration)
|
||||
else
|
||||
if (prob(20+src.radstrength))
|
||||
randmutb(src.connected.occupant)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.primarynew.uni_identity)
|
||||
src.connected.occupant.radiation += ((src.radstrength*2)+src.radduration)
|
||||
dopage(src,"unimenu")
|
||||
src.delete = 0
|
||||
////////////////////////////////////////////////////////
|
||||
if (href_list["rejuv"])
|
||||
if (src.connected.occupant.rejuv < 30)
|
||||
src.connected.occupant.rejuv += 10
|
||||
src.temphtml = text("Occupant now has [] units of rejuvenation in his/her bloodstream.", src.connected.occupant.rejuv)
|
||||
src.delete = 0
|
||||
////////////////////////////////////////////////////////
|
||||
if (href_list["strucmenu"])
|
||||
src.temphtml = text("Structural Enzymes: <font color='blue'>[getleftblocks(src.connected.occupant.primarynew.struc_enzyme,strucblock,3)][src.subblock == 1 ? "<U><B>"+getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),1,1)+"</U></B>" : getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),1,1)][src.subblock == 2 ? "<U><B>"+getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),2,1)+"</U></B>" : getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),2,1)][src.subblock == 3 ? "<U><B>"+getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),3,1)+"</U></B>" : getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),3,1)][getrightblocks(src.connected.occupant.primarynew.struc_enzyme,strucblock,3)]</FONT><BR><BR>")
|
||||
//src.temphtml = text("Structural Enzymes: <font color='blue'>[]</FONT><BR><BR>", src.connected.occupant.primarynew.struc_enzyme)
|
||||
src.temphtml += text("Selected Block: <font color='blue'><B>[]</B></FONT><BR>", src.strucblock)
|
||||
src.temphtml += text("<A href='?src=\ref[];strucmenuminus=1'><-</A> Block <A href='?src=\ref[];strucmenuplus=1'>-></A><BR><BR>", src, src)
|
||||
src.temphtml += text("Selected Sub-Block: <font color='blue'><B>[]</B></FONT><BR>", src.subblock)
|
||||
src.temphtml += text("<A href='?src=\ref[];strucmenusubminus=1'><-</A> Sub-Block <A href='?src=\ref[];strucmenusubplus=1'>-></A><BR><BR>", src, src)
|
||||
src.temphtml += "<B>Modify Block:</B><BR>"
|
||||
src.temphtml += text("<A href='?src=\ref[];strucpulse=1'>Radiation</A><BR>", src)
|
||||
src.delete = 0
|
||||
if (href_list["strucmenuplus"])
|
||||
if (src.strucblock < 14)
|
||||
src.strucblock++
|
||||
dopage(src,"strucmenu")
|
||||
if (href_list["strucmenuminus"])
|
||||
if (src.strucblock > 1)
|
||||
src.strucblock--
|
||||
dopage(src,"strucmenu")
|
||||
if (href_list["strucmenusubplus"])
|
||||
if (src.subblock < 3)
|
||||
src.subblock++
|
||||
dopage(src,"strucmenu")
|
||||
if (href_list["strucmenusubminus"])
|
||||
if (src.subblock > 1)
|
||||
src.subblock--
|
||||
dopage(src,"strucmenu")
|
||||
if (href_list["strucpulse"])
|
||||
var/block
|
||||
var/newblock
|
||||
var/tstructure2
|
||||
var/oldblock
|
||||
block = getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),src.subblock,1)
|
||||
src.delete = 1
|
||||
src.temphtml = text("Working ... Please wait ([] Seconds)", src.radduration)
|
||||
usr << browse(temphtml, "window=scannernew;size=550x650")
|
||||
onclose(usr, "scannernew")
|
||||
sleep(10*src.radduration)
|
||||
if (!src.connected.occupant)
|
||||
temphtml = null
|
||||
delete = 0
|
||||
return null
|
||||
///
|
||||
if (prob((80 + (src.radduration / 2))))
|
||||
if ((src.strucblock != 2 || src.strucblock != 12 || src.strucblock != 8 || src.strucblock || 10) && prob (20))
|
||||
oldblock = src.strucblock
|
||||
block = miniscramble(block, src.radstrength, src.radduration)
|
||||
newblock = null
|
||||
if (src.strucblock > 1 && src.strucblock < 5)
|
||||
src.strucblock++
|
||||
else if (src.strucblock > 5 && src.strucblock < 14)
|
||||
src.strucblock--
|
||||
if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),2,1) + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),3,1)
|
||||
if (src.subblock == 2) newblock = getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),1,1) + block + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),3,1)
|
||||
if (src.subblock == 3) newblock = getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),1,1) + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),2,1) + block
|
||||
tstructure2 = setblock(src.connected.occupant.primarynew.struc_enzyme, src.strucblock, newblock,3)
|
||||
src.connected.occupant.primarynew.struc_enzyme = tstructure2
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += (src.radstrength+src.radduration)
|
||||
src.strucblock = oldblock
|
||||
else
|
||||
//
|
||||
block = miniscramble(block, src.radstrength, src.radduration)
|
||||
newblock = null
|
||||
if (src.subblock == 1) newblock = block + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),2,1) + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),3,1)
|
||||
if (src.subblock == 2) newblock = getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),1,1) + block + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),3,1)
|
||||
if (src.subblock == 3) newblock = getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),1,1) + getblock(getblock(src.connected.occupant.primarynew.struc_enzyme,src.strucblock,3),2,1) + block
|
||||
tstructure2 = setblock(src.connected.occupant.primarynew.struc_enzyme, src.strucblock, newblock,3)
|
||||
src.connected.occupant.primarynew.struc_enzyme = tstructure2
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.connected.occupant.radiation += (src.radstrength+src.radduration)
|
||||
else
|
||||
if (prob(80-src.radduration))
|
||||
randmutb(src.connected.occupant)
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
else
|
||||
randmuti(src.connected.occupant)
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.primarynew.uni_identity)
|
||||
src.connected.occupant.radiation += ((src.radstrength*2)+src.radduration)
|
||||
///
|
||||
dopage(src,"strucmenu")
|
||||
src.delete = 0
|
||||
////////////////////////////////////////////////////////
|
||||
if (href_list["buffermenu"])
|
||||
src.temphtml = "<B>Buffer 1:</B><BR>"
|
||||
if (!(src.buffer1))
|
||||
src.temphtml += "Buffer Empty<BR>"
|
||||
else
|
||||
src.temphtml += text("Data: <font color='blue'>[]</FONT><BR>", src.buffer1)
|
||||
src.temphtml += text("By: <font color='blue'>[]</FONT><BR>", src.buffer1owner)
|
||||
src.temphtml += text("Label: <font color='blue'>[]</FONT><BR>", src.buffer1label)
|
||||
if (src.connected.occupant) src.temphtml += text("Save : <A href='?src=\ref[];b1addui=1'>UI</A> - <A href='?src=\ref[];b1adduiue=1'>UI+UE</A> - <A href='?src=\ref[];b1addse=1'>SE</A><BR>", src, src, src)
|
||||
if (src.buffer1) src.temphtml += text("Transfer to: <A href='?src=\ref[];b1transfer=1'>Occupant</A> - <A href='?src=\ref[];b1injector=1'>Injector</A><BR>", src, src)
|
||||
//if (src.buffer1) src.temphtml += text("<A href='?src=\ref[];b1iso=1'>Isolate Block</A><BR>", src)
|
||||
if (src.buffer1) src.temphtml += text("<A href='?src=\ref[];b1label=1'>Edit Label</A><BR>", src)
|
||||
if (src.buffer1) src.temphtml += text("<A href='?src=\ref[];b1clear=1'>Clear Buffer</A><BR><BR>", src)
|
||||
if (!src.buffer1) src.temphtml += "<BR>"
|
||||
src.temphtml += "<B>Buffer 2:</B><BR>"
|
||||
if (!(src.buffer2))
|
||||
src.temphtml += "Buffer Empty<BR>"
|
||||
else
|
||||
src.temphtml += text("Data: <font color='blue'>[]</FONT><BR>", src.buffer2)
|
||||
src.temphtml += text("By: <font color='blue'>[]</FONT><BR>", src.buffer2owner)
|
||||
src.temphtml += text("Label: <font color='blue'>[]</FONT><BR>", src.buffer2label)
|
||||
if (src.connected.occupant) src.temphtml += text("Save : <A href='?src=\ref[];b2addui=1'>UI</A> - <A href='?src=\ref[];b2adduiue=1'>UI+UE</A> - <A href='?src=\ref[];b2addse=1'>SE</A><BR>", src, src, src)
|
||||
if (src.buffer2) src.temphtml += text("Transfer to: <A href='?src=\ref[];b2transfer=1'>Occupant</A> - <A href='?src=\ref[];b2injector=1'>Injector</A><BR>", src, src)
|
||||
//if (src.buffer2) src.temphtml += text("<A href='?src=\ref[];b2iso=1'>Isolate Block</A><BR>", src)
|
||||
if (src.buffer2) src.temphtml += text("<A href='?src=\ref[];b2label=1'>Edit Label</A><BR>", src)
|
||||
if (src.buffer2) src.temphtml += text("<A href='?src=\ref[];b2clear=1'>Clear Buffer</A><BR><BR>", src)
|
||||
if (!src.buffer2) src.temphtml += "<BR>"
|
||||
src.temphtml += "<B>Buffer 3:</B><BR>"
|
||||
if (!(src.buffer3))
|
||||
src.temphtml += "Buffer Empty<BR>"
|
||||
else
|
||||
src.temphtml += text("Data: <font color='blue'>[]</FONT><BR>", src.buffer3)
|
||||
src.temphtml += text("By: <font color='blue'>[]</FONT><BR>", src.buffer3owner)
|
||||
src.temphtml += text("Label: <font color='blue'>[]</FONT><BR>", src.buffer3label)
|
||||
if (src.connected.occupant) src.temphtml += text("Save : <A href='?src=\ref[];b3addui=1'>UI</A> - <A href='?src=\ref[];b3adduiue=1'>UI+UE</A> - <A href='?src=\ref[];b3addse=1'>SE</A><BR>", src, src, src)
|
||||
if (src.buffer3) src.temphtml += text("Transfer to: <A href='?src=\ref[];b3transfer=1'>Occupant</A> - <A href='?src=\ref[];b3injector=1'>Injector</A><BR>", src, src)
|
||||
//if (src.buffer3) src.temphtml += text("<A href='?src=\ref[];b3iso=1'>Isolate Block</A><BR>", src)
|
||||
if (src.buffer3) src.temphtml += text("<A href='?src=\ref[];b3label=1'>Edit Label</A><BR>", src)
|
||||
if (src.buffer3) src.temphtml += text("<A href='?src=\ref[];b3clear=1'>Clear Buffer</A><BR><BR>", src)
|
||||
if (!src.buffer3) src.temphtml += "<BR>"
|
||||
if (href_list["b1addui"])
|
||||
src.buffer1iue = 0
|
||||
src.buffer1 = src.connected.occupant.primarynew.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer1owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer1owner = src.connected.occupant.real_name
|
||||
src.buffer1label = "Unique Identifier"
|
||||
src.buffer1type = "ui"
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b1adduiue"])
|
||||
src.buffer1 = src.connected.occupant.primarynew.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer1owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer1owner = src.connected.occupant.real_name
|
||||
src.buffer1label = "Unique Identifier & Unique Enzymes"
|
||||
src.buffer1type = "ui"
|
||||
src.buffer1iue = 1
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b2adduiue"])
|
||||
src.buffer2 = src.connected.occupant.primarynew.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer2owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer2owner = src.connected.occupant.real_name
|
||||
src.buffer2label = "Unique Identifier & Unique Enzymes"
|
||||
src.buffer2type = "ui"
|
||||
src.buffer2iue = 1
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b3adduiue"])
|
||||
src.buffer3 = src.connected.occupant.primarynew.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer3owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer3owner = src.connected.occupant.real_name
|
||||
src.buffer3label = "Unique Identifier & Unique Enzymes"
|
||||
src.buffer3type = "ui"
|
||||
src.buffer3iue = 1
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b2addui"])
|
||||
src.buffer2iue = 0
|
||||
src.buffer2 = src.connected.occupant.primarynew.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer2owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer2owner = src.connected.occupant.real_name
|
||||
src.buffer2label = "Unique Identifier"
|
||||
src.buffer2type = "ui"
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b3addui"])
|
||||
src.buffer3iue = 0
|
||||
src.buffer3 = src.connected.occupant.primarynew.uni_identity
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer3owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer3owner = src.connected.occupant.real_name
|
||||
src.buffer3label = "Unique Identifier"
|
||||
src.buffer3type = "ui"
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b1addse"])
|
||||
src.buffer1iue = 0
|
||||
src.buffer1 = src.connected.occupant.primarynew.struc_enzyme
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer1owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer1owner = src.connected.occupant.real_name
|
||||
src.buffer1label = "Structural Enzymes"
|
||||
src.buffer1type = "se"
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b2addse"])
|
||||
src.buffer2iue = 0
|
||||
src.buffer2 = src.connected.occupant.primarynew.struc_enzyme
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer2owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer2owner = src.connected.occupant.real_name
|
||||
src.buffer2label = "Structural Enzymes"
|
||||
src.buffer2type = "se"
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b3addse"])
|
||||
src.buffer3iue = 0
|
||||
src.buffer3 = src.connected.occupant.primarynew.struc_enzyme
|
||||
if (!istype(src.connected.occupant,/mob/living/carbon/human))
|
||||
src.buffer3owner = src.connected.occupant.name
|
||||
else
|
||||
src.buffer3owner = src.connected.occupant.real_name
|
||||
src.buffer3label = "Structural Enzymes"
|
||||
src.buffer3type = "se"
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b1clear"])
|
||||
src.buffer1 = null
|
||||
src.buffer1owner = null
|
||||
src.buffer1label = null
|
||||
src.buffer1iue = null
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b2clear"])
|
||||
src.buffer2 = null
|
||||
src.buffer2owner = null
|
||||
src.buffer2label = null
|
||||
src.buffer2iue = null
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b3clear"])
|
||||
src.buffer3 = null
|
||||
src.buffer3owner = null
|
||||
src.buffer3label = null
|
||||
src.buffer3iue = null
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b1label"])
|
||||
src.buffer1label = input("New Label:","Edit Label","Infos here") as text
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b2label"])
|
||||
src.buffer2label = input("New Label:","Edit Label","Infos here") as text
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b3label"])
|
||||
src.buffer3label = input("New Label:","Edit Label","Infos here") as text
|
||||
dopage(src,"buffermenu")
|
||||
if (href_list["b1transfer"])
|
||||
if (!src.connected.occupant)
|
||||
return
|
||||
if (src.buffer1type == "ui")
|
||||
if (src.buffer1iue)
|
||||
src.connected.occupant.real_name = src.buffer1owner
|
||||
src.connected.occupant.name = src.buffer1owner
|
||||
src.connected.occupant.primarynew.uni_identity = src.buffer1
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.primarynew.uni_identity)
|
||||
else if (src.buffer1type == "se")
|
||||
src.connected.occupant.primarynew.struc_enzyme = src.buffer1
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.temphtml = "Transfered."
|
||||
src.connected.occupant.radiation += rand(20,50)
|
||||
src.delete = 0
|
||||
if (href_list["b2transfer"])
|
||||
if (!src.connected.occupant)
|
||||
return
|
||||
if (src.buffer2type == "ui")
|
||||
if (src.buffer2iue)
|
||||
src.connected.occupant.real_name = src.buffer2owner
|
||||
src.connected.occupant.name = src.buffer2owner
|
||||
src.connected.occupant.primarynew.uni_identity = src.buffer2
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.primarynew.uni_identity)
|
||||
else if (src.buffer2type == "se")
|
||||
src.connected.occupant.primarynew.struc_enzyme = src.buffer2
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.temphtml = "Transfered."
|
||||
src.connected.occupant.radiation += rand(20,50)
|
||||
src.delete = 0
|
||||
if (href_list["b3transfer"])
|
||||
if (!src.connected.occupant)
|
||||
return
|
||||
if (src.buffer3type == "ui")
|
||||
if (src.buffer3iue)
|
||||
src.connected.occupant.real_name = src.buffer3owner
|
||||
src.connected.occupant.name = src.buffer3owner
|
||||
src.connected.occupant.primarynew.uni_identity = src.buffer3
|
||||
updateappearance(src.connected.occupant,src.connected.occupant.primarynew.uni_identity)
|
||||
else if (src.buffer3type == "se")
|
||||
src.connected.occupant.primarynew.struc_enzyme = src.buffer3
|
||||
domutcheck(src.connected.occupant,src.connected)
|
||||
src.temphtml = "Transfered."
|
||||
src.connected.occupant.radiation += rand(20,50)
|
||||
src.delete = 0
|
||||
if (href_list["b1injector"])
|
||||
if (src.injectorready)
|
||||
var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector
|
||||
I.dna = src.buffer1
|
||||
I.dnatype = src.buffer1type
|
||||
I.set_loc(src.loc)
|
||||
I.name += " ([src.buffer1label])"
|
||||
if (src.buffer1iue) I.ue = src.buffer1owner //lazy haw haw
|
||||
src.temphtml = "Injector created."
|
||||
src.delete = 0
|
||||
src.injectorready = 0
|
||||
spawn(1200)
|
||||
src.injectorready = 1
|
||||
else
|
||||
src.temphtml = "Replicator not ready yet."
|
||||
src.delete = 0
|
||||
if (href_list["b2injector"])
|
||||
if (src.injectorready)
|
||||
var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector
|
||||
I.dna = src.buffer2
|
||||
I.dnatype = src.buffer2type
|
||||
I.set_loc(src.loc)
|
||||
I.name += " ([src.buffer2label])"
|
||||
if (src.buffer2iue) I.ue = src.buffer2owner //lazy haw haw
|
||||
src.temphtml = "Injector created."
|
||||
src.delete = 0
|
||||
src.injectorready = 0
|
||||
spawn(1200)
|
||||
src.injectorready = 1
|
||||
else
|
||||
src.temphtml = "Replicator not ready yet."
|
||||
src.delete = 0
|
||||
if (href_list["b3injector"])
|
||||
if (src.injectorready)
|
||||
var/obj/item/weapon/dnainjector/I = new /obj/item/weapon/dnainjector
|
||||
I.dna = src.buffer3
|
||||
I.dnatype = src.buffer3type
|
||||
I.set_loc(src.loc)
|
||||
I.name += " ([src.buffer3label])"
|
||||
if (src.buffer3iue) I.ue = src.buffer3owner //lazy haw haw
|
||||
src.temphtml = "Injector created."
|
||||
src.delete = 0
|
||||
src.injectorready = 0
|
||||
spawn(1200)
|
||||
src.injectorready = 1
|
||||
else
|
||||
src.temphtml = "Replicator not ready yet."
|
||||
src.delete = 0
|
||||
////////////////////////////////////////////////////////
|
||||
if (href_list["clear"])
|
||||
src.temphtml = null
|
||||
src.delete = 0
|
||||
if (href_list["update"]) //ignore
|
||||
src.temphtml = src.temphtml
|
||||
src.add_fingerprint(usr)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
@@ -0,0 +1,23 @@
|
||||
// Made during the internet outage caused by hurricane ike
|
||||
// fuck you ike
|
||||
// love persh
|
||||
///client/proc/grillify()
|
||||
// set category = "Debug"
|
||||
// set name = "spawn grilles"
|
||||
// set desc="it spawns grilles okay fuck if I know"
|
||||
// if(Debug2)
|
||||
// if(!src.holder)
|
||||
// boutput(src, "Only administrators may use this command.")
|
||||
// return
|
||||
//
|
||||
// logTheThing("admin", src, null, "used the grillify verb")
|
||||
// logTheThing("diary", src, null, "used the grillify verb", "admin")
|
||||
// boutput(world, "<span style=\"color:blue\"><big><B>[src.key] used the grillify verb/bitches better get yellow gloves verb!</big></B></span>")
|
||||
//
|
||||
// for(var/turf/T in world)
|
||||
// if(!T.density)
|
||||
// spawn(-1)
|
||||
// new /obj/grille(locate(T.x,T.y,T.z))
|
||||
// else
|
||||
// alert("Debugging is disabled")
|
||||
// return
|
||||
@@ -0,0 +1,204 @@
|
||||
/obj/machinery/atmoalter/heater/proc/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "heater-p"
|
||||
return
|
||||
|
||||
if (src.holding)
|
||||
src.icon_state = "heater1-h"
|
||||
else
|
||||
src.icon_state = "heater1"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/heater/process()
|
||||
/*
|
||||
if(stat & NOPOWER) return
|
||||
use_power(5)
|
||||
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
else
|
||||
T = null
|
||||
if (src.h_status)
|
||||
var/t1 = src.gas.total_moles()
|
||||
if ((t1 > 0 && src.gas.temperature < (src.h_tar+T0C)))
|
||||
var/increase = src.heatrate / t1
|
||||
var/n_temp = src.gas.temperature + increase
|
||||
src.gas.temperature = min(n_temp, (src.h_tar+T0C))
|
||||
use_power( src.h_tar*8)
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.holding.gas.transfer_from(src.gas, t)
|
||||
else
|
||||
src.t_status = 3
|
||||
if(2.0)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.transfer_from(src.holding.gas, t)
|
||||
else
|
||||
src.t_status = 3
|
||||
else
|
||||
|
||||
src.updateDialog()
|
||||
src.setstate()
|
||||
return
|
||||
*/
|
||||
|
||||
/obj/machinery/atmoalter/heater/New()
|
||||
..()
|
||||
gas = unpool(/datum/gas_mixture)
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/heater/disposing()
|
||||
if(gas)
|
||||
pool(gas)
|
||||
gas = null
|
||||
..()
|
||||
|
||||
/obj/machinery/atmoalter/heater/attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmoalter/heater/attack_hand(var/mob/user as mob)
|
||||
/*
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/tt
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
tt = text("Releasing <A href='?src=\ref[];t=2'>Siphon</A> <A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> Siphoning<A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> <A href='?src=\ref[];t=2'>Siphon</A> Stopped", src, src)
|
||||
else
|
||||
var/ht = null
|
||||
if (src.h_status)
|
||||
ht = text("Heating <A href='?src=\ref[];h=2'>Stop</A>", src)
|
||||
else
|
||||
ht = text("<A href='?src=\ref[];h=1'>Heat</A> Stopped", src)
|
||||
var/ct = null
|
||||
switch(src.c_status)
|
||||
if(1.0)
|
||||
ct = text("Releasing <A href='?src=\ref[];c=2'>Accept</A> <A href='?src=\ref[];ct=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> Accepting <A href='?src=\ref[];c=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> <A href='?src=\ref[];c=2'>Accept</A> Stopped", src, src)
|
||||
else
|
||||
ct = "Disconnected"
|
||||
var/dat = text("<TT><B>Canister Valves</B><BR><br><FONT color = 'blue'><B>Contains/Capacity</B> [] / []</FONT><BR><br>Upper Valve Status: [][]<BR><br> <A href='?src=\ref[];tp=-[]'>M</A> <A href='?src=\ref[];tp=-10000'>-</A> <A href='?src=\ref[];tp=-1000'>-</A> <A href='?src=\ref[];tp=-100'>-</A> <A href='?src=\ref[];tp=-1'>-</A> [] <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=100'>+</A> <A href='?src=\ref[];tp=1000'>+</A> <A href='?src=\ref[];tp=10000'>+</A> <A href='?src=\ref[];tp=[]'>M</A><BR><br>Heater Status: [] - []<BR><br> Trg Tmp: <A href='?src=\ref[];ht=-50'>-</A> <A href='?src=\ref[];ht=-5'>-</A> <A href='?src=\ref[];ht=-1'>-</A> [] <A href='?src=\ref[];ht=1'>+</A> <A href='?src=\ref[];ht=5'>+</A> <A href='?src=\ref[];ht=50'>+</A><BR><br><BR><br>Pipe Valve Status: []<BR><br> <A href='?src=\ref[];cp=-[]'>M</A> <A href='?src=\ref[];cp=-10000'>-</A> <A href='?src=\ref[];cp=-1000'>-</A> <A href='?src=\ref[];cp=-100'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=100'>+</A> <A href='?src=\ref[];cp=1000'>+</A> <A href='?src=\ref[];cp=10000'>+</A> <A href='?src=\ref[];cp=[]'>M</A><BR><br><BR><br><A href='?action=mach_close&window=canister&user=[]'>Close</A><BR><br></TT>", src.gas.total_moles(), src.maximum, tt, (src.holding ? text("<BR><A href='?src=\ref[];tank=1'>Tank ([]</A>)", src, src.holding.gas.total_moles()) : null), src, num2text(1000000.0, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(1000000.0, 7), ht, (src.gas.total_moles() ? (src.gas.temperature-T0C) : 20), src, src, src, src.h_tar, src, src, src, ct, src, num2text(1000000.0, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(1000000.0, 7), user)
|
||||
user << browse(dat, "window=canister;size=600x300")
|
||||
onclose(user, "canister")
|
||||
return */ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/heater/Topic(href, href_list)
|
||||
..()
|
||||
if (stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if (((get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["c"])
|
||||
var/c = text2num(href_list["c"])
|
||||
switch(c)
|
||||
if(1.0)
|
||||
src.c_status = 1
|
||||
if(2.0)
|
||||
src.c_status = 2
|
||||
if(3.0)
|
||||
src.c_status = 3
|
||||
else
|
||||
else
|
||||
if (href_list["t"])
|
||||
var/t = text2num(href_list["t"])
|
||||
if (src.t_status == 0)
|
||||
return
|
||||
switch(t)
|
||||
if(1.0)
|
||||
src.t_status = 1
|
||||
if(2.0)
|
||||
src.t_status = 2
|
||||
if(3.0)
|
||||
src.t_status = 3
|
||||
else
|
||||
else
|
||||
if (href_list["h"])
|
||||
var/h = text2num(href_list["h"])
|
||||
if (h == 1)
|
||||
src.h_status = 1
|
||||
else
|
||||
src.h_status = null
|
||||
else
|
||||
if (href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
src.t_per += tp
|
||||
src.t_per = min(max(round(src.t_per), 0), 1000000.0)
|
||||
else
|
||||
if (href_list["cp"])
|
||||
var/cp = text2num(href_list["cp"])
|
||||
src.c_per += cp
|
||||
src.c_per = min(max(round(src.c_per), 0), 1000000.0)
|
||||
else
|
||||
if (href_list["ht"])
|
||||
var/cp = text2num(href_list["ht"])
|
||||
src.h_tar += cp
|
||||
src.h_tar = min(max(round(src.h_tar), 0), 500)
|
||||
else
|
||||
if (href_list["tank"])
|
||||
var/cp = text2num(href_list["tank"])
|
||||
if ((cp == 1 && src.holding))
|
||||
src.holding.set_loc(src.loc)
|
||||
src.holding = null
|
||||
if (src.t_status == 2)
|
||||
src.t_status = 3
|
||||
src.updateUsrDialog()
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=canister")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/heater/attackby(var/obj/W as obj, var/mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/tank))
|
||||
if (src.holding)
|
||||
return
|
||||
var/obj/item/weapon/tank/T = W
|
||||
user.drop_item()
|
||||
T.set_loc(src)
|
||||
src.holding = T
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
var/obj/machinery/connector/con = locate(/obj/machinery/connector, src.loc)
|
||||
|
||||
if (src.c_status)
|
||||
src.anchored = initial(src.anchored)
|
||||
src.c_status = 0
|
||||
user.show_message("<span style=\"color:blue\">You have disconnected the heater.</span>", 1)
|
||||
if(con)
|
||||
con.connected = null
|
||||
else
|
||||
if (con && !con.connected)
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
user.show_message("<span style=\"color:blue\">You have connected the heater.</span>", 1)
|
||||
con.connected = src
|
||||
else
|
||||
user.show_message("<span style=\"color:blue\">There is no connector here to attach the heater to.</span>", 1)
|
||||
return
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// this toggle doesn't save across rounds
|
||||
/mob/verb/musictoggle()
|
||||
set name = "Music Toggle"
|
||||
if(src.be_music == 0)
|
||||
src.be_music = 1
|
||||
boutput(src, "<span style=\"color:blue\">Music toggled on!</span>")
|
||||
return
|
||||
src.be_music = 0
|
||||
boutput(src, "<span style=\"color:blue\">Music toggled off!</span>")
|
||||
|
||||
// This checks a var on each area and plays that var
|
||||
/area/Entered(mob/A as mob)
|
||||
if (A && src.music != "" && A.client && A.be_music != 0 && (A.music_lastplayed != src.music))
|
||||
A.music_lastplayed = src.music
|
||||
A << sound(src.music, repeat = 0, wait = 0, volume = 20, channel = 1)
|
||||
@@ -0,0 +1,20 @@
|
||||
/obj/machinery/atmos/node
|
||||
name = "Pipe Node"
|
||||
desc = "attaches to a pipe and interacts with the air"
|
||||
icon = 'icons/obj/atmospherics/pipes.dmi'
|
||||
icon_state = "pipe"
|
||||
opacity = 0
|
||||
density = 0
|
||||
layer = PIPE_LAYER//Change this to wires+-1
|
||||
|
||||
m_amt = 50 // metal
|
||||
g_amt = 10 // glass
|
||||
w_amt = 80 // waster amounts
|
||||
|
||||
|
||||
//What dir\s the pipe can connect with
|
||||
var/obj/machinery/atmos/up = null
|
||||
var/obj/machinery/atmos/down = null
|
||||
var/obj/machinery/atmos/left = null
|
||||
var/obj/machinery/atmos/right = null
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
obj/movable
|
||||
|
||||
icon = 'icons/turf/shuttle.dmi'
|
||||
|
||||
anchored = 1
|
||||
|
||||
var/tmp/obj/hotspot/active_hotspot
|
||||
var/blocks_air = 0
|
||||
|
||||
proc
|
||||
teleport(turf/destination)
|
||||
for(var/atom/movable/AM in loc)
|
||||
AM.set_loc(destination)
|
||||
|
||||
CanPass(atom/movable/mover, turf/target, height, air_group)
|
||||
if(!height || air_group)
|
||||
return !blocks_air
|
||||
else return ..()
|
||||
|
||||
New()
|
||||
..()
|
||||
air = unpool(/datum/gas_mixture)
|
||||
|
||||
disposing()
|
||||
if(air)
|
||||
pool(air)
|
||||
air = null
|
||||
..()
|
||||
|
||||
|
||||
wall
|
||||
icon_state = "wall"
|
||||
opacity = 1
|
||||
density = 1
|
||||
blocks_air = 1
|
||||
|
||||
floor
|
||||
|
||||
icon_state = "floor"
|
||||
|
||||
var
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
carbon_dioxide = 0
|
||||
toxins = 0
|
||||
|
||||
temperature = T20C
|
||||
|
||||
tmp
|
||||
air_check_directions = 0
|
||||
group_border = 0
|
||||
processing
|
||||
archived_cycle = 0
|
||||
current_cycle = 0
|
||||
|
||||
datum/air_group/object/parent
|
||||
datum/gas_mixture/air
|
||||
|
||||
proc
|
||||
process_cell()
|
||||
update_air_properties()
|
||||
|
||||
archive()
|
||||
mimic_air_with_tile()
|
||||
share_air_with_tile()
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
/obj/item/weapon/pipe
|
||||
name = "Pipe"
|
||||
desc = "a pipe for holding gas"
|
||||
icon = 'icons/obj/atmospherics/pipes.dmi'
|
||||
icon_state = "pipe"
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 0.0
|
||||
|
||||
var/storage = 1 //How much gas it can hold (in moles)?
|
||||
|
||||
//What dir\s the pipe can connect with
|
||||
var/up = 0
|
||||
var/down = 0
|
||||
var/left = 0
|
||||
var/right = 0
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
..()
|
||||
return
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
var/turf/T = get_turf(src.loc)
|
||||
if(istype(T,/turf/simulated/floor/plating))
|
||||
var/obj/machinery/atmos/pipe/P = new/obj/machinery/atmos/pipe(T)
|
||||
P.set_dir(up,down,left,right)
|
||||
spawn(1)
|
||||
qdel(src)//This might need to be changed to have them drop it first
|
||||
else
|
||||
boutput(user, "<span style=\"color:red\">You are unable to place the pipe there.</span>")
|
||||
else
|
||||
..()//Add ID swipe
|
||||
|
||||
proc/set_dir(var/u, var/d, var/l, var/r)//For the moment just going to have the pipe machine call this
|
||||
up = u
|
||||
down = d
|
||||
left = l
|
||||
right = r
|
||||
update_icon()
|
||||
return
|
||||
|
||||
proc/update_icon()
|
||||
overlays = null
|
||||
if(up)
|
||||
overlays += "+u"
|
||||
if(down)
|
||||
overlays += "+d"
|
||||
if(left)
|
||||
overlays += "+l"
|
||||
if(right)
|
||||
overlays += "+r"
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/atmos/pipe
|
||||
name = "Pipe"
|
||||
desc = "a pipe for holding gas, currently attached to the flooring"
|
||||
icon = 'icons/obj/atmospherics/pipes.dmi'
|
||||
icon_state = "pipe"
|
||||
opacity = 0
|
||||
density = 0
|
||||
layer = PIPE_LAYER//Change this to wires+-1
|
||||
|
||||
m_amt = 50 // metal
|
||||
g_amt = 10 // glass
|
||||
w_amt = 80 // waster amounts
|
||||
|
||||
|
||||
var/datum/atmos/pipeline/parent = null
|
||||
|
||||
//What dir\s the pipe can connect with
|
||||
var/up = 0
|
||||
var/down = 0
|
||||
var/left = 0
|
||||
var/right = 0
|
||||
|
||||
New()
|
||||
spawn(5)
|
||||
build()
|
||||
return//Dont need to be on the gameticker so dont add us
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
return
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
|
||||
else
|
||||
..()//Add ID swipe
|
||||
|
||||
proc/set_dir(var/u, var/d, var/l, var/r)
|
||||
up = u
|
||||
down = d
|
||||
left = l
|
||||
right = r
|
||||
update_icon()
|
||||
return
|
||||
|
||||
///Clears the overlays then add newones
|
||||
proc/update_icon()
|
||||
overlays = null
|
||||
if(up)
|
||||
overlays += "+u"
|
||||
if(down)
|
||||
overlays += "+d"
|
||||
if(left)
|
||||
overlays += "+l"
|
||||
if(right)
|
||||
overlays += "+r"
|
||||
return
|
||||
|
||||
///This will check tiles based upon the udlr vars to see if we have pipes/nodes to connect to
|
||||
proc/build()
|
||||
if(parent)//We have a pipeline, don't need to go looking
|
||||
return
|
||||
|
||||
if(up)
|
||||
var/turf/T = get_step(get_turf(src.loc), 1)//Take a step
|
||||
if(locate(var/obj/machinery/atmos/A) in T)
|
||||
if(istype(A, /obj/machinery/atmos/pipe))//Found a pipe
|
||||
var/obj/machinery/atmos/pipe/P = A
|
||||
if(P.parent)//Do you have a line?
|
||||
P.parent.add_pipe(src)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmos/node))//Found a node
|
||||
var/obj/machinery/atmos/node/N = A
|
||||
if(N.up)
|
||||
if(N.up.parent)
|
||||
N.up.parent.add_pipe(src)
|
||||
if(N.down)
|
||||
if(N.down.parent)
|
||||
N.down.parent.add_pipe(src)
|
||||
if(N.left)
|
||||
if(N.left.parent)
|
||||
N.left.parent.add_pipe(src)
|
||||
if(N.right)
|
||||
if(N.right.parent)
|
||||
N.right.parent.add_pipe(src)
|
||||
N.down = src
|
||||
|
||||
if(down)
|
||||
var/turf/T = get_step(get_turf(src.loc), 2)//Take a step
|
||||
if(locate(var/obj/machinery/atmos/A) in T)
|
||||
if(istype(A, /obj/machinery/atmos/pipe))//Found a pipe
|
||||
var/obj/machinery/atmos/pipe/P = A
|
||||
if(P.parent)//Do you have a line?
|
||||
P.parent.add_pipe(src)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmos/node))//Found a node
|
||||
var/obj/machinery/atmos/node/N = A
|
||||
if(N.up)
|
||||
if(N.up.parent)
|
||||
N.up.parent.add_pipe(src)
|
||||
if(N.down)
|
||||
if(N.down.parent)
|
||||
N.down.parent.add_pipe(src)
|
||||
if(N.left)
|
||||
if(N.left.parent)
|
||||
N.left.parent.add_pipe(src)
|
||||
if(N.right)
|
||||
if(N.right.parent)
|
||||
N.right.parent.add_pipe(src)
|
||||
N.up = src
|
||||
|
||||
if(left)
|
||||
var/turf/T = get_step(get_turf(src.loc), 4)//Take a step
|
||||
if(locate(var/obj/machinery/atmos/A) in T)
|
||||
if(istype(A, /obj/machinery/atmos/pipe))//Found a pipe
|
||||
var/obj/machinery/atmos/pipe/P = A
|
||||
if(P.parent)//Do you have a line?
|
||||
P.parent.add_pipe(src)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmos/node))//Found a node
|
||||
var/obj/machinery/atmos/node/N = A
|
||||
if(N.up)
|
||||
if(N.up.parent)
|
||||
N.up.parent.add_pipe(src)
|
||||
if(N.down)
|
||||
if(N.down.parent)
|
||||
N.down.parent.add_pipe(src)
|
||||
if(N.left)
|
||||
if(N.left.parent)
|
||||
N.left.parent.add_pipe(src)
|
||||
if(N.right)
|
||||
if(N.right.parent)
|
||||
N.right.parent.add_pipe(src)
|
||||
N.right = src
|
||||
|
||||
if(right)
|
||||
var/turf/T = get_step(get_turf(src.loc), 8)//Take a step
|
||||
if(locate(var/obj/machinery/atmos/A) in T)
|
||||
if(istype(A, /obj/machinery/atmos/pipe))//Found a pipe
|
||||
var/obj/machinery/atmos/pipe/P = A
|
||||
if(P.parent)//Do you have a line?
|
||||
P.parent.add_pipe(src)
|
||||
|
||||
else if(istype(A, /obj/machinery/atmos/node))//Found a node
|
||||
var/obj/machinery/atmos/node/N = A
|
||||
if(N.up)
|
||||
if(N.up.parent)
|
||||
N.up.parent.add_pipe(src)
|
||||
if(N.down)
|
||||
if(N.down.parent)
|
||||
N.down.parent.add_pipe(src)
|
||||
if(N.left)
|
||||
if(N.left.parent)
|
||||
N.left.parent.add_pipe(src)
|
||||
if(N.right)
|
||||
if(N.right.parent)
|
||||
N.right.parent.add_pipe(src)
|
||||
N.left = src
|
||||
|
||||
if(!parent)
|
||||
parent = new/datum/atmos/pipeline()
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* new portable generator - work in progress
|
||||
|
||||
/obj/machinery/power/port_gen
|
||||
name = "portable generator"
|
||||
desc = "A portable generator used for emergency backup power."
|
||||
icon = 'generator.dmi'
|
||||
icon_state = "off"
|
||||
density = 1
|
||||
anchored = 0
|
||||
directwired = 0
|
||||
var/t_status = 0
|
||||
var/t_per = 5000
|
||||
var/filter = 1
|
||||
var/tank = null
|
||||
var/turf/inturf
|
||||
var/starter = 0
|
||||
var/rpm = 0
|
||||
var/rpmtarget = 0
|
||||
var/capacity = 1e6
|
||||
var/turf/outturf
|
||||
var/lastgen
|
||||
|
||||
|
||||
/obj/machinery/power/port_gen/process()
|
||||
ideally we're looking to generate 5000
|
||||
|
||||
/obj/machinery/power/port_gen/attackby(obj/item/W, mob/user)
|
||||
tank [un]loading stuff
|
||||
|
||||
/obj/machinery/power/port_gen/attack_hand(mob/user)
|
||||
turn on/off
|
||||
|
||||
/obj/machinery/power/port_gen/examine()
|
||||
display round(lastgen) and plasmatank amount
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,516 @@
|
||||
/obj/machinery/atmoalter/siphs/New()
|
||||
..()
|
||||
gas = unpool(/datum/gas_mixture)
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/disposing()
|
||||
if(gas)
|
||||
pool(gas)
|
||||
gas = null
|
||||
..()
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/releaseall()
|
||||
src.t_status = 1
|
||||
src.t_per = max_valve
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/reset(valve, auto)
|
||||
if(c_status!=0)
|
||||
return
|
||||
|
||||
if (valve < 0)
|
||||
src.t_per = -valve
|
||||
src.t_status = 1
|
||||
else
|
||||
if (valve > 0)
|
||||
src.t_per = valve
|
||||
src.t_status = 2
|
||||
else
|
||||
src.t_status = 3
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/release(amount, flag)
|
||||
/*
|
||||
var/T = src.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
if (!( amount ))
|
||||
return
|
||||
if (!( flag ))
|
||||
amount = min(amount, max_valve)
|
||||
src.gas.turf_add(T, amount)
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/siphon(amount, flag)
|
||||
/*
|
||||
var/T = src.loc
|
||||
if (!( istype(T, /turf) ))
|
||||
return
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
if (!( amount ))
|
||||
return
|
||||
if (!( flag ))
|
||||
amount = min(amount, 900000.0)
|
||||
src.gas.turf_take(T, amount)
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/proc/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "siphon:0"
|
||||
return
|
||||
|
||||
if (src.holding)
|
||||
src.icon_state = "siphon:T"
|
||||
else
|
||||
if (src.t_status != 3)
|
||||
src.icon_state = "siphon:1"
|
||||
else
|
||||
src.icon_state = "siphon:0"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/New()
|
||||
/*
|
||||
..()
|
||||
if(!empty)
|
||||
src.gas.oxygen = 2.73E7
|
||||
src.gas.n2 = 1.027E8
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/port/reset(valve, auto)
|
||||
|
||||
if (valve < 0)
|
||||
src.t_per = -valve
|
||||
src.t_status = 1
|
||||
else
|
||||
if (valve > 0)
|
||||
src.t_per = valve
|
||||
src.t_status = 2
|
||||
else
|
||||
src.t_status = 3
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent/attackby(W as obj, user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
if (src.c_status)
|
||||
src.anchored = 1
|
||||
src.c_status = 0
|
||||
else
|
||||
if (locate(/obj/machinery/connector, src.loc))
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
src.alterable = !( src.alterable )
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent/setstate()
|
||||
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "vent-p"
|
||||
return
|
||||
|
||||
if (src.t_status == 4)
|
||||
src.icon_state = "vent2"
|
||||
else
|
||||
if (src.t_status == 3)
|
||||
src.icon_state = "vent0"
|
||||
else
|
||||
src.icon_state = "vent1"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/fullairsiphon/air_vent/reset(valve, auto)
|
||||
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/process()
|
||||
/*
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if(src.gas.temperature >= 3000)
|
||||
src.melt()
|
||||
|
||||
if (src.t_status != 3)
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
if (T.firelevel < 900000.0)
|
||||
src.gas.turf_add_all_oxy(T)
|
||||
|
||||
else
|
||||
T = null
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.holding.gas.transfer_from(src.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.turf_add(T, t)
|
||||
if(2.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.transfer_from(src.holding.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (t > t2)
|
||||
t = t2
|
||||
src.gas.turf_take(T, t)
|
||||
if(4.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (T)
|
||||
if (T.firelevel > 900000.0)
|
||||
src.f_time = world.time + 400
|
||||
else
|
||||
if (world.time > src.f_time)
|
||||
src.gas.extract_toxs(T)
|
||||
if( !portable() ) use_power(150, ENVIRON)
|
||||
var/contain = src.gas.total_moles()
|
||||
if (contain > 1.3E8)
|
||||
src.gas.turf_add(T, 1.3E8 - contain)
|
||||
|
||||
src.setstate()
|
||||
src.updateDialog()
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/air_filter/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "vent-p"
|
||||
return
|
||||
|
||||
if (src.t_status == 4)
|
||||
src.icon_state = "vent2"
|
||||
else
|
||||
if (src.t_status == 3)
|
||||
src.icon_state = "vent0"
|
||||
else
|
||||
src.icon_state = "vent1"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/air_filter/attackby(W as obj, user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
if (src.c_status)
|
||||
src.anchored = 1
|
||||
src.c_status = 0
|
||||
else
|
||||
if (locate(/obj/machinery/connector, src.loc))
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
src.alterable = !( src.alterable )
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/air_filter/reset(valve, auto)
|
||||
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/port/setstate()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "scrubber:0"
|
||||
return
|
||||
|
||||
if (src.holding)
|
||||
src.icon_state = "scrubber:T"
|
||||
else
|
||||
if (src.t_status != 3)
|
||||
src.icon_state = "scrubber:1"
|
||||
else
|
||||
src.icon_state = "scrubber:0"
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/scrubbers/port/reset(valve, auto)
|
||||
|
||||
if (valve < 0)
|
||||
src.t_per = -valve
|
||||
src.t_status = 1
|
||||
else
|
||||
if (valve > 0)
|
||||
src.t_per = valve
|
||||
src.t_status = 2
|
||||
else
|
||||
src.t_status = 3
|
||||
if (auto)
|
||||
src.t_status = 4
|
||||
src.setstate()
|
||||
return
|
||||
|
||||
//true if the siphon is portable (therfore no power needed)
|
||||
|
||||
/obj/machinery/proc/portable()
|
||||
return istype(src, /obj/machinery/atmoalter/siphs/fullairsiphon/port) || istype(src, /obj/machinery/atmoalter/siphs/scrubbers/port)
|
||||
|
||||
/obj/machinery/atmoalter/siphs/power_change()
|
||||
|
||||
if( portable() )
|
||||
return
|
||||
|
||||
if(!powered(ENVIRON))
|
||||
spawn(rand(0,15))
|
||||
stat |= NOPOWER
|
||||
setstate()
|
||||
else
|
||||
stat &= ~NOPOWER
|
||||
setstate()
|
||||
|
||||
|
||||
/obj/machinery/atmoalter/siphs/process()
|
||||
/*
|
||||
// var/dbg = (suffix=="d") && Debug
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if (src.t_status != 3)
|
||||
var/turf/T = src.loc
|
||||
if (istype(T, /turf))
|
||||
if (locate(/obj/move, T))
|
||||
T = locate(/obj/move, T)
|
||||
else
|
||||
T = null
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.holding.gas.transfer_from(src.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.turf_add(T, t)
|
||||
if(2.0)
|
||||
if( !portable() ) use_power(50, ENVIRON)
|
||||
if (src.holding)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (src.t_per > t2)
|
||||
t = t2
|
||||
src.gas.transfer_from(src.holding.gas, t)
|
||||
else
|
||||
if (T)
|
||||
var/t1 = src.gas.total_moles()
|
||||
var/t2 = src.maximum - t1
|
||||
var/t = src.t_per
|
||||
if (t > t2)
|
||||
t = t2
|
||||
//var/g = gas.total_moles()
|
||||
//if(dbg) world.log << "VP0 : [t] from turf: [gas.total_moles()]"
|
||||
//if(dbg) Air()
|
||||
|
||||
src.gas.turf_take(T, t)
|
||||
//if(dbg) world.log << "VP1 : now [gas.total_moles()]"
|
||||
|
||||
//if(dbg) world.log << "[gas.total_moles()-g] ([t]) from turf to siph"
|
||||
|
||||
//if(dbg) Air()
|
||||
if(4.0)
|
||||
if( !portable() )
|
||||
use_power(50, ENVIRON)
|
||||
|
||||
if (T)
|
||||
if (T.firelevel > 900000.0)
|
||||
src.f_time = world.time + 300
|
||||
else
|
||||
if (world.time > src.f_time)
|
||||
var/difference = CELLSTANDARD - (T.oxygen + T.n2)
|
||||
if (difference > 0)
|
||||
var/t1 = src.gas.total_moles()
|
||||
if (difference > t1)
|
||||
difference = t1
|
||||
src.gas.turf_add(T, difference)
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
src.setstate()
|
||||
return
|
||||
*/ //TODO: FIX
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attack_ai(user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attack_hand(var/mob/user as mob)
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if(src.portable() && istype(user, /mob/living/silicon/ai)) //AI can't use portable siphons
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/tt
|
||||
switch(src.t_status)
|
||||
if(1.0)
|
||||
tt = text("Releasing <A href='?src=\ref[];t=2'>Siphon</A> <A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> Siphoning <A href='?src=\ref[];t=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
tt = text("<A href='?src=\ref[];t=1'>Release</A> <A href='?src=\ref[];t=2'>Siphon</A> Stopped <A href='?src=\ref[];t=4'>Automatic</A>", src, src, src)
|
||||
else
|
||||
tt = "Automatic equalizers are on!"
|
||||
var/ct = null
|
||||
switch(src.c_status)
|
||||
if(1.0)
|
||||
ct = text("Releasing <A href='?src=\ref[];c=2'>Accept</A> <A href='?src=\ref[];c=3'>Stop</A>", src, src)
|
||||
if(2.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> Accepting <A href='?src=\ref[];c=3'>Stop</A>", src, src)
|
||||
if(3.0)
|
||||
ct = text("<A href='?src=\ref[];c=1'>Release</A> <A href='?src=\ref[];c=2'>Accept</A> Stopped", src, src)
|
||||
else
|
||||
ct = "Disconnected"
|
||||
var/at = null
|
||||
if (src.t_status == 4)
|
||||
at = text("Automatic On <A href='?src=\ref[];t=3'>Stop</A>", src)
|
||||
var/dat = text("<TT><B>Canister Valves</B> []<BR><br> <FONT color = 'blue'><B>Contains/Capacity</B> [] / []</FONT><BR><br> Upper Valve Status: [] []<BR><br>  <A href='?src=\ref[];tp=-[]'>M</A> <A href='?src=\ref[];tp=-10000'>-</A> <A href='?src=\ref[];tp=-1000'>-</A> <A href='?src=\ref[];tp=-100'>-</A> <A href='?src=\ref[];tp=-1'>-</A> [] <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=100'>+</A> <A href='?src=\ref[];tp=1000'>+</A> <A href='?src=\ref[];tp=10000'>+</A> <A href='?src=\ref[];tp=[]'>M</A><BR><br> Pipe Valve Status: []<BR><br>  <A href='?src=\ref[];cp=-[]'>M</A> <A href='?src=\ref[];cp=-10000'>-</A> <A href='?src=\ref[];cp=-1000'>-</A> <A href='?src=\ref[];cp=-100'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=100'>+</A> <A href='?src=\ref[];cp=1000'>+</A> <A href='?src=\ref[];cp=10000'>+</A> <A href='?src=\ref[];cp=[]'>M</A><BR><br><BR><br><br><A href='?action=mach_close&window=&user=[]siphon'>Close</A><BR><br> </TT>", (!( src.alterable ) ? "<B>Valves are locked. Unlock with wrench!</B>" : "You can lock this interface with a wrench."), num2text(src.gas.return_pressure(), 10), num2text(src.maximum, 10), (src.t_status == 4 ? text("[]", at) : text("[]", tt)), (src.holding ? text("<BR>(<A href='?src=\ref[];tank=1'>Tank ([]</A>)", src, src.holding.air_contents.return_pressure()) : null), src, num2text(max_valve, 7), src, src, src, src, src.t_per, src, src, src, src, src, num2text(max_valve, 7), ct, src, num2text(max_valve, 7), src, src, src, src, src.c_per, src, src, src, src, src, num2text(max_valve, 7), user)
|
||||
user << browse(dat, "window=siphon;size=600x300")
|
||||
onclose(user, "siphon")
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if ((!( src.alterable )) && (!istype(usr, /mob/living/silicon/ai)))
|
||||
return
|
||||
if (((get_dist(src, usr) <= 1 || usr.telekinesis == 1) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon/ai)))
|
||||
usr.machine = src
|
||||
if (href_list["c"])
|
||||
var/c = text2num(href_list["c"])
|
||||
switch(c)
|
||||
if(1.0)
|
||||
src.c_status = 1
|
||||
if(2.0)
|
||||
src.c_status = 2
|
||||
if(3.0)
|
||||
src.c_status = 3
|
||||
else
|
||||
else
|
||||
if (href_list["t"])
|
||||
var/t = text2num(href_list["t"])
|
||||
if (src.t_status == 0)
|
||||
return
|
||||
switch(t)
|
||||
if(1.0)
|
||||
src.t_status = 1
|
||||
if(2.0)
|
||||
src.t_status = 2
|
||||
if(3.0)
|
||||
src.t_status = 3
|
||||
if(4.0)
|
||||
src.t_status = 4
|
||||
src.f_time = 1
|
||||
else
|
||||
else
|
||||
if (href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
src.t_per += tp
|
||||
src.t_per = min(max(round(src.t_per), 0), max_valve)
|
||||
else
|
||||
if (href_list["cp"])
|
||||
var/cp = text2num(href_list["cp"])
|
||||
src.c_per += cp
|
||||
src.c_per = min(max(round(src.c_per), 0), max_valve)
|
||||
else
|
||||
if (href_list["tank"])
|
||||
var/cp = text2num(href_list["tank"])
|
||||
if (cp == 1)
|
||||
src.holding.set_loc(src.loc)
|
||||
src.holding = null
|
||||
if (src.t_status == 2)
|
||||
src.t_status = 3
|
||||
src.updateUsrDialog()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=canister")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/atmoalter/siphs/attackby(var/obj/W as obj, mob/user as mob)
|
||||
|
||||
if (istype(W, /obj/item/weapon/tank))
|
||||
if (src.holding)
|
||||
return
|
||||
var/obj/item/weapon/tank/T = W
|
||||
user.drop_item()
|
||||
T.set_loc(src)
|
||||
src.holding = T
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/screwdriver))
|
||||
var/obj/machinery/connector/con = locate(/obj/machinery/connector, src.loc)
|
||||
if (src.c_status)
|
||||
src.anchored = 0
|
||||
src.c_status = 0
|
||||
user.show_message("<span style=\"color:blue\">You have disconnected the siphon.</span>")
|
||||
if(con)
|
||||
con.connected = null
|
||||
else
|
||||
if (con && !con.connected)
|
||||
src.anchored = 1
|
||||
src.c_status = 3
|
||||
user.show_message("<span style=\"color:blue\">You have connected the siphon.</span>")
|
||||
con.connected = src
|
||||
else
|
||||
user.show_message("<span style=\"color:blue\">There is nothing here to connect to the siphon.</span>")
|
||||
|
||||
|
||||
else
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
src.alterable = !( src.alterable )
|
||||
if (src.alterable)
|
||||
boutput(user, "<span style=\"color:blue\">You unlock the interface!</span>")
|
||||
else
|
||||
boutput(user, "<span style=\"color:blue\">You lock the interface!</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
/obj/machinery/vehicle/process()
|
||||
if (src.speed)
|
||||
if (src.speed <= 10)
|
||||
var/t1 = 10 - src.speed
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
sleep(1)
|
||||
t1--
|
||||
else
|
||||
var/t1 = round(src.speed / 5)
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
t1--
|
||||
return
|
||||
|
||||
/obj/machinery/vehicle/meteorhit(var/obj/O as obj)
|
||||
for (var/obj/item/I in src)
|
||||
I.set_loc(src.loc)
|
||||
|
||||
for (var/mob/M in src)
|
||||
M.set_loc(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/vehicle/ex_act(severity)
|
||||
switch (severity)
|
||||
if (1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
ex_act(severity)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
ex_act(severity)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/vehicle/blob_act(var/power)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.set_loc(src.loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/vehicle/Bump(var/atom/A)
|
||||
//boutput(world, "[src] bumped into [A]")
|
||||
spawn (0)
|
||||
..()
|
||||
src.speed = 0
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/vehicle/relaymove(mob/user as mob, direction)
|
||||
if (user.stat)
|
||||
return
|
||||
|
||||
if ((user in src))
|
||||
if (direction & 1)
|
||||
src.speed = max(src.speed - 1, 1)
|
||||
else if (direction & 2)
|
||||
src.speed = min(src.maximum_speed, src.speed + 1)
|
||||
else if (src.can_rotate && direction & 4)
|
||||
src.dir = turn(src.dir, -90.0)
|
||||
else if (src.can_rotate && direction & 8)
|
||||
src.dir = turn(src.dir, 90)
|
||||
else if (direction & 16 && src.can_maximize_speed)
|
||||
src.speed = src.maximum_speed
|
||||
|
||||
/obj/machinery/vehicle/verb/eject()
|
||||
set src = usr.loc
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
var/mob/M = usr
|
||||
M.set_loc(src.loc)
|
||||
step(M, turn(src.dir, 180))
|
||||
return
|
||||
|
||||
/obj/machinery/vehicle/verb/board()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat || istype(usr, /mob/living/intangible))
|
||||
return
|
||||
|
||||
if (src.one_person_only && locate(/mob, src))
|
||||
boutput(usr, "There is no room! You can only fit one person.")
|
||||
return
|
||||
|
||||
var/mob/M = usr
|
||||
M.set_loc(src)
|
||||
|
||||
/obj/machinery/vehicle/verb/unload(var/atom/movable/A in src)
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
if (istype(A, /atom/movable))
|
||||
A.set_loc(src.loc)
|
||||
for(var/mob/O in view(src, null))
|
||||
if ((O.client && !(O.blinded)))
|
||||
boutput(O, text("<span style=\"color:blue\"><B> [] unloads [] from []!</B></span>", usr, A, src))
|
||||
|
||||
if (ismob(A))
|
||||
var/mob/M = A
|
||||
|
||||
/obj/machinery/vehicle/verb/load()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
|
||||
if (ishuman(usr))
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
if ((H.pulling && !(H.pulling.anchored)))
|
||||
if (src.one_person_only && !(istype(H.pulling, /obj/item/weapon)))
|
||||
boutput(usr, "You may only place items in.")
|
||||
else
|
||||
H.pulling.set_loc(src)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
boutput(O, text("<span style=\"color:blue\"><B> [] loads [] into []!</B></span>", H, H.pulling, src))
|
||||
|
||||
H.pulling = null
|
||||
Reference in New Issue
Block a user