mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
TG: 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. r2916
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
/*
|
||||
CONTAINS:
|
||||
SPACE CLEANER
|
||||
MOP
|
||||
/obj/item/weapon/cleaner
|
||||
desc = "A chemical that cleans messes."
|
||||
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
|
||||
var/catch = 1
|
||||
|
||||
*/
|
||||
/obj/item/weapon/cleaner/New()
|
||||
var/datum/reagents/R = new/datum/reagents(250)
|
||||
reagents = R
|
||||
@@ -84,13 +91,12 @@ 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()
|
||||
@@ -101,6 +107,21 @@ 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
|
||||
@@ -183,15 +204,44 @@ 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
|
||||
|
||||
|
||||
return
|
||||
|
||||
//Pepper spray, set up to make the 2 different types
|
||||
/obj/item/weapon/pepperspray //This is riot control
|
||||
desc = "Manufactured 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
|
||||
var/catch = 1
|
||||
var/BottleSize = 1
|
||||
var/ReagentAmount = 30
|
||||
|
||||
/obj/item/weapon/pepperspray/small //And this is for personal defense.
|
||||
desc = "This appears to be a small, nonlethal, single use personal defense weapon. Hurts like a bitch, though."
|
||||
icon = 'weapons.dmi'
|
||||
name = "mace"
|
||||
icon_state = "pepperspray"
|
||||
item_state = "pepperspray"
|
||||
flags = ONBELT|TABLEPASS|OPENCONTAINER|FPRINT|USEDELAY
|
||||
throwforce = 3
|
||||
w_class = 1.0
|
||||
throw_speed = 2
|
||||
throw_range = 10
|
||||
catch = 1
|
||||
BottleSize = 0
|
||||
ReagentAmount = 1
|
||||
|
||||
/obj/item/weapon/pepperspray/New()
|
||||
var/datum/reagents/R = new/datum/reagents(ReagentAmount)
|
||||
@@ -331,12 +381,26 @@ MOP
|
||||
return
|
||||
|
||||
// MOP
|
||||
/obj/item/weapon/mop
|
||||
desc = "The world of the janitor 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()
|
||||
@@ -347,6 +411,7 @@ 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
|
||||
@@ -380,7 +445,6 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
|
||||
spawn(5)
|
||||
src.reagents.clear_reagents()
|
||||
mopcount = 0
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -389,18 +453,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))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,79 +6,10 @@ 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
|
||||
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
|
||||
var/list/directions = new/list(cardinal)
|
||||
for (var/obj/structure/window/win in usr.loc)
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
usr << "\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)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 4
|
||||
for(var/obj/structure/window/WT in usr.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 1
|
||||
for(var/obj/structure/window/WT in usr.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 8
|
||||
for(var/obj/structure/window/WT in usr.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.state = 0
|
||||
else
|
||||
W = new /obj/structure/window/basic( usr.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."
|
||||
return 1
|
||||
var/obj/structure/window/W
|
||||
if(reinf)
|
||||
W = new /obj/structure/window/reinforced( usr.loc, reinf )
|
||||
W.state = 0
|
||||
else
|
||||
W = new /obj/structure/window/basic( usr.loc, reinf )
|
||||
W.dir = SOUTHWEST
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
else
|
||||
//do nothing
|
||||
return
|
||||
|
||||
// GLASS
|
||||
|
||||
/obj/item/stack/sheet/glass/attack_self(mob/user as mob)
|
||||
construct_window(usr, src)
|
||||
construct_window(user)
|
||||
|
||||
/obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user)
|
||||
..()
|
||||
@@ -111,16 +42,117 @@ SHARDS
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/sheet/glass/proc/construct_window(mob/user as mob)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return 0
|
||||
var/title = "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) return 1
|
||||
if(src.loc != user) return 1
|
||||
var/list/directions = new/list(cardinal)
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
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 user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 4
|
||||
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 user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 8
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 2
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/basic( user.loc, 0 )
|
||||
W.dir = dir_to_set
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
if("full (2 sheets)")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) 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
|
||||
W = new /obj/structure/window/basic( user.loc, 0 )
|
||||
W.dir = SOUTHWEST
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
return 0
|
||||
|
||||
|
||||
// REINFORCED GLASS
|
||||
|
||||
/obj/item/stack/sheet/rglass/attack_self(mob/user as mob)
|
||||
construct_window(usr, src)
|
||||
|
||||
|
||||
|
||||
|
||||
construct_window(user)
|
||||
|
||||
/obj/item/stack/sheet/rglass/proc/construct_window(mob/user as mob)
|
||||
if(!user || !src) return 0
|
||||
if(!istype(user.loc,/turf)) return 0
|
||||
if(!user.IsAdvancedToolUser())
|
||||
user << "\red You don't have the dexterity to do this!"
|
||||
return 0
|
||||
var/title = "Sheet Reinf. 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) return 1
|
||||
if(src.loc != user) return 1
|
||||
var/list/directions = new/list(cardinal)
|
||||
for (var/obj/structure/window/win in user.loc)
|
||||
directions-=win.dir
|
||||
if(!(win.ini_dir in cardinal))
|
||||
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 user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 4
|
||||
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 user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 8
|
||||
for(var/obj/structure/window/WT in user.loc)
|
||||
if (WT.dir == dir_to_set)
|
||||
dir_to_set = 2
|
||||
var/obj/structure/window/W
|
||||
W = new /obj/structure/window/reinforced( user.loc, 1 )
|
||||
W.state = 0
|
||||
W.dir = dir_to_set
|
||||
W.ini_dir = W.dir
|
||||
W.anchored = 0
|
||||
src.use(1)
|
||||
if("full (2 sheets)")
|
||||
if(!src) return 1
|
||||
if(src.loc != user) 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
|
||||
W = new /obj/structure/window/reinforced( user.loc, 1 )
|
||||
W.state = 0
|
||||
W.dir = SOUTHWEST
|
||||
W.ini_dir = SOUTHWEST
|
||||
W.anchored = 0
|
||||
src.use(2)
|
||||
return 0
|
||||
|
||||
// SHARDS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user