Renamed the prisoner computer's file to prisoner and added a sanity check.

The singularity is now able to eat things like signs and chameleon projectors' projections.
A few other misc runtime fixes.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2916 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2012-01-05 05:26:13 +00:00
parent 4d1d38d5f3
commit 2ea375091e
9 changed files with 153 additions and 196 deletions

View File

@@ -500,43 +500,6 @@
access = get_all_centcom_access()
..()
/obj/item/weapon/cleaner
desc = "Space Cleaner!"
icon = 'janitor.dmi'
name = "space cleaner"
icon_state = "cleaner"
item_state = "cleaner"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
throwforce = 3
w_class = 2.0
throw_speed = 2
throw_range = 10
/obj/item/weapon/chemsprayer
desc = "A utility used to spray large amounts of reagent in a given area."
icon = 'gun.dmi'
name = "chem sprayer"
icon_state = "chemsprayer"
item_state = "chemsprayer"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
throwforce = 3
w_class = 3.0
throw_speed = 2
throw_range = 10
origin_tech = "combat=3;materials=3;engineering=3"
/obj/item/weapon/pepperspray
desc = "Manufactred by UhangInc., used to blind and down an opponent quickly."
icon = 'weapons.dmi'
name = "pepperspray"
icon_state = "pepperspray"
item_state = "pepperspray"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
throwforce = 3
w_class = 2.0
throw_speed = 2
throw_range = 10
/obj/item/weapon/clipboard
name = "clipboard"
desc = "Apply paper to this to write better. Can also hold pens."
@@ -773,21 +736,6 @@
origin_tech = "magnets=1"
/obj/item/weapon/mop
desc = "The world of janitalia wouldn't be complete without a mop."
name = "mop"
icon = 'janitor.dmi'
icon_state = "mop"
var/mopping = 0
var/mopcount = 0
force = 3.0
throwforce = 10.0
throw_speed = 5
throw_range = 10
w_class = 3.0
flags = FPRINT | TABLEPASS
/obj/item/weapon/caution
desc = "Caution! Wet Floor!"
name = "wet floor sign"

View File

@@ -77,15 +77,15 @@
if(href_list["inject1"])
var/obj/item/weapon/implant/I = locate(href_list["inject1"])
I.activate(1)
if(I) I.activate(1)
else if(href_list["inject5"])
var/obj/item/weapon/implant/I = locate(href_list["inject5"])
I.activate(5)
if(I) I.activate(5)
else if(href_list["inject10"])
var/obj/item/weapon/implant/I = locate(href_list["inject10"])
I.activate(10)
if(I) I.activate(10)
else if(href_list["lock"])
if(src.allowed(usr))

View File

@@ -466,6 +466,7 @@
return
var/obj/item/device/pda/P = locate(href_list["target"])
if(!istype(P)) return
if(istype(P, /obj/item/device/pda))
if (isnull(P)||P.toff || toff)

View File

@@ -1,18 +1,28 @@
/*
CONTAINS:
SPACE CLEANER
MOP
*/
/obj/item/weapon/cleaner
desc = "Space Cleaner!"
icon = 'janitor.dmi'
name = "space cleaner"
icon_state = "cleaner"
item_state = "cleaner"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
throwforce = 3
w_class = 2.0
throw_speed = 2
throw_range = 10
/obj/item/weapon/cleaner/New()
var/datum/reagents/R = new/datum/reagents(250)
reagents = R
R.my_atom = src
R.add_reagent("cleaner", 250)
/obj/item/weapon/cleaner/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
/obj/item/weapon/cleaner/afterattack(atom/A as mob|obj, mob/user as mob)
if (istype(A, /obj/item/weapon/storage ))
return
@@ -71,15 +81,15 @@ MOP
spawn(600)
src.reagents.add_reagent(refill, 10)
if((src.reagents.has_reagent("pacid")) || (src.reagents.has_reagent("lube"))) // Messages admins if someone sprays polyacid or space lube from a Cleaner bottle.
message_admins("[key_name_admin(user)] fired Polyacid/Space lube from a Cleaner bottle.") // Polymorph
log_game("[key_name(user)] fired Polyacid/Space lube from a Cleaner bottle.")
if(src.reagents.has_reagent("pacid"))
message_admins("[key_name_admin(user)] fired Polyacid from a Cleaner bottle.")
log_game("[key_name(user)] fired Polyacid from a Cleaner bottle.")
if(src.reagents.has_reagent("lube"))
message_admins("[key_name_admin(user)] fired Space lube from a Cleaner bottle.")
log_game("[key_name(user)] fired Space lube from a Cleaner bottle.")
return
/obj/item/weapon/cleaner/examine()
set src in usr
for(var/datum/reagent/R in reagents.reagent_list)
@@ -88,15 +98,33 @@ MOP
..()
return
/obj/item/weapon/chemsprayer//Another copy paste with a tiny change it seems
desc = "A utility used to spray large amounts of reagent in a given area."
icon = 'gun.dmi'
name = "chem sprayer"
icon_state = "chemsprayer"
item_state = "chemsprayer"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
throwforce = 3
w_class = 3.0
throw_speed = 2
throw_range = 10
origin_tech = "combat=3;materials=3;engineering=3"
/obj/item/weapon/chemsprayer/New()
var/datum/reagents/R = new/datum/reagents(1000)
reagents = R
R.my_atom = src
R.add_reagent("cleaner", 10)
/obj/item/weapon/chemsprayer/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
/obj/item/weapon/chemsprayer/afterattack(atom/A as mob|obj, mob/user as mob)
if (istype(A, /obj/item/weapon/storage ))
return
@@ -170,23 +198,38 @@ MOP
spawn(600)
src.reagents.add_reagent(refill, 10)
if((src.reagents.has_reagent("pacid")) || (src.reagents.has_reagent("lube"))) // Messages admins if someone sprays polyacid or space lube from a Chem Sprayer.
message_admins("[key_name_admin(user)] fired Polyacid/Space lube from a Chem Sprayer.") // Polymorph
log_game("[key_name(user)] fired Polyacid/Space lube from a Chem Sprayer.")
return
//A direct copy paste of the cleaner, fantastic.
/obj/item/weapon/pepperspray
desc = "Manufactred by UhangInc., used to blind and down an opponent quickly."
icon = 'weapons.dmi'
name = "pepperspray"
icon_state = "pepperspray"
item_state = "pepperspray"
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
throwforce = 3
w_class = 2.0
throw_speed = 2
throw_range = 10
/obj/item/weapon/pepperspray/New()
var/datum/reagents/R = new/datum/reagents(45)
reagents = R
R.my_atom = src
R.add_reagent("condensedcapsaicin", 45)
/obj/item/weapon/pepperspray/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
/obj/item/weapon/pepperspray/afterattack(atom/A as mob|obj, mob/user as mob)
if (istype(A, /obj/item/weapon/storage ))
return
@@ -263,22 +306,39 @@ MOP
var/refill = src.reagents.get_master_reagent_id()
spawn(600)
src.reagents.add_reagent(refill, 10)
return
/obj/item/weapon/pepperspray/examine()
set src in usr
usr << text("\icon[] [] units of spray left!", src, src.reagents.total_volume)
..()
return
// MOP
/obj/item/weapon/mop
desc = "The world of janitalia wouldn't be complete without a mop."
name = "mop"
icon = 'janitor.dmi'
icon_state = "mop"
var/mopping = 0
var/mopcount = 0
force = 3.0
throwforce = 10.0
throw_speed = 5
throw_range = 10
w_class = 3.0
flags = FPRINT | TABLEPASS
/obj/item/weapon/mop/New()
var/datum/reagents/R = new/datum/reagents(5)
reagents = R
R.my_atom = src
obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
src.reagents.reaction(A,1,10)
A.clean_blood()
@@ -289,11 +349,13 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
for(var/obj/effect/overlay/R in A)
del(R)
/obj/effect/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/mop))
return
..()
/obj/item/weapon/mop/afterattack(atom/A, mob/user as mob)
if (src.reagents.total_volume < 1 || mopcount >= 5)
user << "\blue Your mop is dry!"
@@ -318,7 +380,6 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
spawn(5)
src.reagents.clear_reagents()
mopcount = 0
return
@@ -327,18 +388,18 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
* Hope it's okay to stick this shit here: it basically just turns a hexadecimal color into rgb
*/
proc/GetColors(hex)
hex = uppertext(hex)
var
hi1 = text2ascii(hex, 2)
lo1 = text2ascii(hex, 3)
hi2 = text2ascii(hex, 4)
lo2 = text2ascii(hex, 5)
hi3 = text2ascii(hex, 6)
lo3 = text2ascii(hex, 7)
return list(((hi1>= 65 ? hi1-55 : hi1-48)<<4) | (lo1 >= 65 ? lo1-55 : lo1-48),
((hi2 >= 65 ? hi2-55 : hi2-48)<<4) | (lo2 >= 65 ? lo2-55 : lo2-48),
((hi3 >= 65 ? hi3-55 : hi3-48)<<4) | (lo3 >= 65 ? lo3-55 : lo3-48))
/proc/GetColors(hex)
hex = uppertext(hex)
var
hi1 = text2ascii(hex, 2)
lo1 = text2ascii(hex, 3)
hi2 = text2ascii(hex, 4)
lo2 = text2ascii(hex, 5)
hi3 = text2ascii(hex, 6)
lo3 = text2ascii(hex, 7)
return list(((hi1>= 65 ? hi1-55 : hi1-48)<<4) | (lo1 >= 65 ? lo1-55 : lo1-48),
((hi2 >= 65 ? hi2-55 : hi2-48)<<4) | (lo2 >= 65 ? lo2-55 : lo2-48),
((hi3 >= 65 ? hi3-55 : hi3-48)<<4) | (lo3 >= 65 ? lo3-55 : lo3-48))

View File

@@ -6,79 +6,69 @@ SHARDS
*/
/proc/construct_window(mob/usr as mob, obj/item/stack/sheet/src as obj)
if (!( istype(usr.loc, /turf/simulated) ))
return
if ( ! (istype(usr, /mob/living/carbon/human) || \
istype(usr, /mob/living/silicon) || \
istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
usr << "\red You don't have the dexterity to do this!"
return 1
/proc/construct_window(mob/user as mob, obj/item/stack/sheet/src as obj)//Why is this a general proc and not on the glass sheet?
if(!user || !src) return 0
if(!user.IsAdvancedToolUser())
user << "\red You don't have the dexterity to do this!"
return 0
var/reinf = istype(src, /obj/item/stack/sheet/rglass)
var/title = reinf?"Sheet Reinf. Glass":"Sheet-Glass"
title += " ([src.amount] sheet\s left)"
switch(alert(title, "Would you like full tile glass or one direction?", "one direct", "full (2 sheets)", "cancel", null))
if("one direct")
if (src.loc != usr)
return 1
if (src.amount < 1)
return 1
if(!src) return 1
if(src.loc != user || !src.use(1)) return 1
var/list/directions = new/list(cardinal)
for (var/obj/structure/window/win in usr.loc)
for (var/obj/structure/window/win in user.loc)
directions-=win.dir
if(!(win.ini_dir in cardinal))
usr << "\red Can't let you do that."
user << "\red Can't let you do that."
return 1
var/dir_to_set = 2
//yes, this could probably be done better but hey... it works...
for(var/obj/structure/window/WT in usr.loc)
for(var/obj/structure/window/WT in user.loc)
if (WT.dir == dir_to_set)
dir_to_set = 4
for(var/obj/structure/window/WT in usr.loc)
for(var/obj/structure/window/WT in user.loc)
if (WT.dir == dir_to_set)
dir_to_set = 1
for(var/obj/structure/window/WT in usr.loc)
for(var/obj/structure/window/WT in user.loc)
if (WT.dir == dir_to_set)
dir_to_set = 8
for(var/obj/structure/window/WT in usr.loc)
for(var/obj/structure/window/WT in user.loc)
if (WT.dir == dir_to_set)
dir_to_set = 2
var/obj/structure/window/W
if(reinf)
W = new /obj/structure/window/reinforced( usr.loc, reinf )
W = new /obj/structure/window/reinforced( user.loc, reinf )
W.state = 0
else
W = new /obj/structure/window/basic( usr.loc, reinf )
W = new /obj/structure/window/basic( user.loc, reinf )
W.dir = dir_to_set
W.ini_dir = W.dir
W.anchored = 0
src.use(1)
if("full (2 sheets)")
if (src.loc != usr)
return 1
if (src.amount < 2)
return 1
if (locate(/obj/structure/window) in usr.loc)
usr << "\red Can't let you do that."
if(!src) return 1
if(src.loc != user || !src.use(2)) return 1
if(locate(/obj/structure/window) in user.loc)
user << "\red There is a window in the way."
return 1
var/obj/structure/window/W
if(reinf)
W = new /obj/structure/window/reinforced( usr.loc, reinf )
W = new /obj/structure/window/reinforced( user.loc, reinf )
W.state = 0
else
W = new /obj/structure/window/basic( usr.loc, reinf )
W = new /obj/structure/window/basic( user.loc, reinf )
W.dir = SOUTHWEST
W.ini_dir = SOUTHWEST
W.anchored = 0
src.use(2)
else
//do nothing
return
return 0
// GLASS
/obj/item/stack/sheet/glass/attack_self(mob/user as mob)
construct_window(usr, src)
construct_window(user, src)
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user)
..()
@@ -115,7 +105,7 @@ SHARDS
// REINFORCED GLASS
/obj/item/stack/sheet/rglass/attack_self(mob/user as mob)
construct_window(usr, src)
construct_window(user, src)

View File

@@ -629,12 +629,14 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm != "Yes") return
//Due to the delay here its easy for something to have happened to the mob
if(!M) return
if(usr.key != M.key && M.client)
log_admin("[key_name(usr)] has gibbed [key_name(M)]")
message_admins("[key_name_admin(usr)] has gibbed [key_name_admin(M)]", 1)
if (istype(M, /mob/dead/observer))
if(istype(M, /mob/dead/observer))
gibs(M.loc, M.viruses)
return

View File

@@ -911,85 +911,43 @@ note dizziness decrements automatically in the mob's Life() proc.
statpanel("Spells","[S.charge_counter]/[S.charge_max]",S)
if("holdervar")
statpanel("Spells","[S.holder_var_type] [S.holder_var_amount]",S)
#if 1
/client/proc/station_explosion_cinematic(var/derp)
if(mob)
var/mob/M = mob
M.loc = null // HACK, but whatever, this works
if (M.client&&M.hud_used)//They may some times not have a hud, apparently.
var/obj/screen/boom = M.hud_used.station_explosion
M.client.screen += boom
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
flick("start_nuke", boom)
if("AI malfunction")
flick("start_malf", boom)
else
boom.icon_state = "start"
sleep(40)
M << sound('explosionfar.ogg')
boom.icon_state = "end"
if(!derp) flick("explode", boom)
else flick("explode2", boom)
sleep(40)
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
if(!derp) boom.icon_state = "loss_nuke"
else boom.icon_state = "loss_nuke2"
if("malfunction")
boom.icon_state = "loss_malf"
if("blob")
return//Nothin here yet and the general one does not fit.
else
boom.icon_state = "loss_general"
#elif
/client/proc/station_explosion_cinematic(var/derp)
if(!src.mob)
return
var/mob/M = src.mob
M.loc = null // HACK, but whatever, this works
/client/proc/station_explosion_cinematic(var/station_missed)
if(!mob || !ticker) return
if(!mob.client || !mob.hud_used || !ticker.mode) return
// M.loc = null this might make it act weird but fuck putting them in nullspace, it causes issues.
var/obj/screen/boom = mob.hud_used.station_explosion
if(!istype(boom)) return
if(!M.hud_used)
return
mob.client.screen += boom
switch(ticker.mode.name)
if("nuclear emergency")
flick("start_nuke", boom)
if("AI malfunction")
flick("start_malf", boom)
else
boom.icon_state = "start"
var/obj/screen/boom = M.hud_used.station_explosion
src.screen += boom
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
flick("start_nuke", boom)
if("AI malfunction")
flick("start_malf", boom)
else
boom.icon_state = "start"
sleep(40)
M << sound('explosionfar.ogg')
mob << sound('explosionfar.ogg')
boom.icon_state = "end"
if(!derp)
flick("explode", boom)
else
flick("explode2", boom)
if(!station_missed) flick("explode", boom)
else flick("explode2", boom)
sleep(40)
if(ticker)
switch(ticker.mode.name)
if("nuclear emergency")
if (!derp)
boom.icon_state = "loss_nuke"
else
boom.icon_state = "loss_nuke2"
if("AI malfunction")
boom.icon_state = "loss_malf"
else
boom.icon_state = "loss_general"
#endif
switch(ticker.mode.name)
if("nuclear emergency")
if(!station_missed) boom.icon_state = "loss_nuke"
else boom.icon_state = "loss_nuke2"
if("malfunction")
boom.icon_state = "loss_malf"
if("blob")
return//Nothin here yet and the general one does not fit.
else
boom.icon_state = "loss_general"
return
// facing verbs
@@ -1039,6 +997,7 @@ note dizziness decrements automatically in the mob's Life() proc.
/mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check
return 0
/mob/proc/Stun(amount)
if(canstun)
stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun
@@ -1046,7 +1005,6 @@ note dizziness decrements automatically in the mob's Life() proc.
if(istype(src, /mob/living/carbon/alien)) // add some movement delay
var/mob/living/carbon/alien/Alien = src
Alien.move_delay_add = min(Alien.move_delay_add + round(amount / 5), 10) // a maximum delay of 10
return
/mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"

View File

@@ -1,9 +1,6 @@
var/global/list/uneatable = list(
/turf/space,
/obj/effect,
/obj/effect/overlay,
/obj/effect/decal/cleanable,
/obj/effect/rune
/obj/effect/overlay
)
/obj/machinery/singularity/