Merge remote-tracking branch 'Upstream/master' into Map-Development

This commit is contained in:
LordFowl
2016-08-15 04:19:23 -04:00
190 changed files with 3601 additions and 546 deletions
@@ -343,28 +343,33 @@
return 1
/obj/structure/closet/proc/req_breakout()
if(breakout)
return 0 //Already breaking out.
if(opened)
return 0 //Door's open... wait, why are you in it's contents then?
if(!welded)
return 0 //closed but not welded...
return 1
if(welded)
return 1 //closed but not welded...
if(breakout)
return -1 //Already breaking out.
return 0
/obj/structure/closet/proc/mob_breakout(var/mob/living/escapee)
var/breakout_time = 2 //2 minutes by default
if(!req_breakout())
//Improved by nanako
//Now it actually works, also locker breakout time stacks with locking and welding
//This means secure lockers are more useful for imprisoning people
var/breakout_time = 1.5 * req_breakout()//1.5 minutes if locked or welded, 3 minutes if both
if(breakout_time <= 0)
return
//okay, so the closet is either welded or locked... resist!!!
escapee.next_move = world.time + 100
escapee.last_special = world.time + 100
escapee << "<span class='warning'>You lean on the back of \the [src] and start pushing the door open. (this will take about [breakout_time] minutes)</span>"
visible_message("<span class='danger'>The [src] begins to shake violently!</span>")
breakout = 1 //can't think of a better way to do this right now.
breakout = 1
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
playsound(src.loc, 'sound/effects/grillehit.ogg', 100, 1)
animate_shake()
@@ -78,7 +78,12 @@
new /obj/item/weapon/storage/bag/trash(src)
new /obj/item/clothing/shoes/galoshes(src)
new /obj/item/weapon/storage/belt/janitor(src)
new /obj/item/weapon/storage/box/lights/mixed(src)
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
new /obj/item/weapon/reagent_containers/spray/cleaner(src)
/*
* Lawyer
*/
@@ -141,7 +141,8 @@
new /obj/item/clothing/accessory/storage/brown_vest(src)
else
new /obj/item/clothing/accessory/storage/webbing(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/suit/fire/atmos(src)
new /obj/item/clothing/head/hardhat/red/atmos(src)
new /obj/item/device/flashlight(src)
new /obj/item/weapon/extinguisher(src)
new /obj/item/device/radio/headset/headset_eng(src)
@@ -118,6 +118,8 @@
if(ishuman(usr))
src.add_fingerprint(usr)
src.togglelock(usr)
else if(istype(usr, /mob/living/silicon/robot) && Adjacent(usr))
src.togglelock(usr)
else
usr << "<span class='warning'>This mob type can't use this verb.</span>"
@@ -135,8 +137,13 @@
/obj/structure/closet/secure_closet/req_breakout()
if(!opened && locked) return 1
return ..() //It's a secure closet, but isn't locked.
if(!opened && locked)
if (welded)
return 2
else
return 1
else
return ..() //It's a secure closet, but isn't locked.
/obj/structure/closet/secure_closet/break_open()
desc += " It appears to be broken."
@@ -147,6 +154,7 @@
flick(icon_broken, src)
sleep(10)
broken = 1
welded = 0
locked = 0
update_icon()
//Do this to prevent contents from being opened into nullspace (read: bluespace)
@@ -259,10 +259,10 @@
new /obj/item/weapon/storage/box/evidence(src)
new /obj/item/device/radio/headset/headset_sec(src)
new /obj/item/clothing/suit/storage/vest/detective(src)
new /obj/item/ammo_magazine/c45m/rubber(src)
new /obj/item/ammo_magazine/c45m/rubber(src)
new /obj/item/ammo_magazine/c38(src)
new /obj/item/ammo_magazine/c38(src)
new /obj/item/taperoll/police(src)
new /obj/item/weapon/gun/projectile/colt/detective(src)
new /obj/item/weapon/gun/projectile/revolver/detective(src)
new /obj/item/clothing/accessory/holster/armpit(src)
return
+59
View File
@@ -76,6 +76,37 @@
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/melee/energy))
var/obj/item/weapon/melee/energy/WT = W
if(WT.active)
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
if(!src) return
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else
user << "<span class='notice'>You need to activate the weapon to do that!</span>"
return
else if(istype(W, /obj/item/weapon/melee/energy/blade))
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
if(!src) return
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/melee/chainsword))
var/obj/item/weapon/melee/chainsword/WT = W
if(WT.active)
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,60))
if(!src) return
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else
user << "<span class='notice'>You need to activate the weapon to do that!</span>"
return
else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill))
user << "<span class='notice'>You drill through the girder!</span>"
dismantle()
@@ -252,3 +283,31 @@
user << "<span class='notice'>You drill through the girder!</span>"
new /obj/effect/decal/remains/human(get_turf(src))
dismantle()
else if(istype(W, /obj/item/weapon/melee/energy))
var/obj/item/weapon/melee/energy/WT = W
if(WT.active)
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else
user << "<span class='notice'>You need to activate the weapon to do that!</span>"
return
else if(istype(W, /obj/item/weapon/melee/energy/blade))
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,30))
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else if(istype(W, /obj/item/weapon/melee/chainsword))
var/obj/item/weapon/melee/chainsword/WT = W
if(WT.active)
user << "<span class='notice'>Now slicing apart the girder...</span>"
if(do_after(user,60))
user << "<span class='notice'>You slice apart the girder!</span>"
dismantle()
else
user << "<span class='notice'>You need to activate the weapon to do that!</span>"
return
+148 -27
View File
@@ -5,6 +5,7 @@
icon_state = "cart"
anchored = 0
density = 1
climbable = 1
flags = OPENCONTAINER
//copypaste sorry
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
@@ -12,74 +13,179 @@
var/obj/item/weapon/mop/mymop = null
var/obj/item/weapon/reagent_containers/spray/myspray = null
var/obj/item/device/lightreplacer/myreplacer = null
var/obj/structure/mopbucket/mybucket = null
var/signs = 0 //maximum capacity hardcoded below
var/has_items = 0//This is set true whenever the cart has anything loaded/mounted on it
var/dismantled = 0//This is set true after the object has been dismantled to avoid an infintie loop
/obj/structure/janitorialcart/New()
create_reagents(100)
///obj/structure/janitorialcart/New()
/obj/structure/janitorialcart/examine(mob/user)
if(..(user, 1))
user << "[src] \icon[src] contains [reagents.total_volume] unit\s of liquid!"
if (mybucket)
user << "[src] \icon The bucket contains [mybucket.reagents.total_volume] unit\s of liquid!"
else
user << "[src] \icon There is no bucket mounted on it!"
//everything else is visible, so doesn't need to be mentioned
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/storage/bag/trash) && !mybag)
user.drop_item()
mybag = I
I.loc = src
/obj/structure/janitorialcart/MouseDrop_T(atom/movable/O as mob|obj, mob/living/user as mob)
if (istype(O, /obj/structure/mopbucket) && !mybucket)
O.loc = src
mybucket = O
user << "You mount the [O] on the janicart."
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
else
..()
else if(istype(I, /obj/item/weapon/mop))
if(I.reagents.total_volume < I.reagents.maximum_volume) //if it's not completely soaked we assume they want to wet it, otherwise store it
if(reagents.total_volume < 1)
user << "[src] is out of water!</span>"
else
reagents.trans_to_obj(I, 5) //
user << "<span class='notice'>You wet [I] in [src].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
//New Altclick functionality!
//Altclick the cart with a mop to stow the mop away
//Altclick the cart with a reagent container to pour things into the bucket without putting the bottle in trash
/obj/structure/janitorialcart/AltClick()
var/obj/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/mop))
if(!mymop)
user.drop_item()
usr.drop_item()
mymop = I
I.loc = src
I.forceMove(src)
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
usr << "<span class='notice'>You put [I] into [src].</span>"
else
usr << "<span class='notice'>The cart already has a mop attached</span>"
return
else if(istype(I, /obj/item/weapon/reagent_containers) && mybucket)
var/obj/item/weapon/reagent_containers/C = I
C.afterattack(mybucket, usr, 1)
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/mop) || istype(I, /obj/item/weapon/reagent_containers/glass/rag) || istype(I, /obj/item/weapon/soap))
if (mybucket)
if(I.reagents.total_volume < I.reagents.maximum_volume)
if(mybucket.reagents.total_volume < 1)
user << "<span class='notice'>[mybucket] is empty!</span>"
else
mybucket.reagents.trans_to_obj(I, 5) //
user << "<span class='notice'>You wet [I] in [mybucket].</span>"
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
user << "<span class='notice'>[I] can't absorb anymore liquid!</span>"
else
user << "<span class='notice'>There is no bucket mounted here to dip [I] into!</span>"
return 1
else if(istype(I, /obj/item/weapon/reagent_containers/spray) && !myspray)
user.drop_item()
myspray = I
I.loc = src
I.forceMove(src)
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
return 1
else if(istype(I, /obj/item/device/lightreplacer) && !myreplacer)
user.drop_item()
myreplacer = I
I.loc = src
I.forceMove(src)
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
return 1
else if(istype(I, /obj/item/weapon/storage/bag/trash) && !mybag)
user.drop_item()
mybag = I
I.forceMove(src)
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
return 1
else if(istype(I, /obj/item/weapon/caution))
if(signs < 4)
user.drop_item()
I.loc = src
I.forceMove(src)
signs++
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
else
user << "<span class='notice'>[src] can't hold any more signs.</span>"
return 1
else if(mybag)
mybag.attackby(I, user)
return mybag.attackby(I, user)
//This return will prevent afterattack from executing if the object goes into the trashbag,
//This prevents dumb stuff like splashing the cart with the contents of a container, after putting said container into trash
else if (!has_items && (istype(I, /obj/item/weapon/wrench) || istype(I, /obj/item/weapon/weldingtool) || istype(I, /obj/item/weapon/pickaxe/plasmacutter)))
dismantle(user)
return
..()
/obj/structure/janitorialcart/proc/dismantle(var/mob/user = null)
if (!dismantled)
if (has_items)
spill()
if (user)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message("[user] starts taking apart the [src]", "You start disasembling the [src]")
if (!do_after(user, 30, needhand = 0))
return
new /obj/item/stack/material/steel(src.loc, 15)
dismantled = 1
qdel(src)
/obj/structure/janitorialcart/ex_act(severity)
spill(100 / severity)
..()
//This is called if the cart is caught in an explosion, or destroyed by weapon fire
/obj/structure/janitorialcart/proc/spill(var/chance = 100)
var/turf/dropspot = get_turf(src)
if (mymop && prob(chance))
mymop.forceMove(dropspot)
mymop.tumble(2)
mymop = null
if (myspray && prob(chance))
myspray.forceMove(dropspot)
myspray.tumble(3)
myspray = null
if (myreplacer && prob(chance))
myreplacer.forceMove(dropspot)
myreplacer.tumble(3)
myreplacer = null
if (mybucket && prob(chance*0.5))//bucket is heavier, harder to knock off
mybucket.forceMove(dropspot)
mybucket.tumble(1)
mybucket = null
if (signs)
for (var/obj/item/weapon/caution/Sign in src)
if (prob(min((chance*2),100)))
signs--
Sign.forceMove(dropspot)
Sign.tumble(3)
if (signs < 0)//safety for something that shouldn't happen
signs = 0
update_icon()
return
if (mybag && prob(min((chance*2),100)))//Bag is flimsy
mybag.forceMove(dropspot)
mybag.tumble(1)
mybag.spill()//trashbag spills its contents too
mybag = null
update_icon()
/obj/structure/janitorialcart/attack_hand(mob/user)
@@ -90,6 +196,7 @@
var/data[0]
data["name"] = capitalize(name)
data["bag"] = mybag ? capitalize(mybag.name) : null
data["bucket"] = mybucket ? capitalize(mybucket.name) : null
data["mop"] = mymop ? capitalize(mymop.name) : null
data["spray"] = myspray ? capitalize(myspray.name) : null
data["replacer"] = myreplacer ? capitalize(myreplacer.name) : null
@@ -107,7 +214,7 @@
if(!isliving(usr))
return
var/mob/living/user = usr
if(href_list["take"])
switch(href_list["take"])
if("garbage")
@@ -140,6 +247,11 @@
else
warning("[src] signs ([signs]) didn't match contents")
signs = 0
if("bucket")
if(mybucket)
mybucket.forceMove(get_turf(user))
user << "<span class='notice'>You unmount [mybucket] from [src].</span>"
mybucket = null
update_icon()
updateUsrDialog()
@@ -147,16 +259,25 @@
/obj/structure/janitorialcart/update_icon()
overlays = null
has_items = 0
if(mybucket)
overlays += "cart_bucket"
has_items = 1
if(mybag)
overlays += "cart_garbage"
has_items = 1
if(mymop)
overlays += "cart_mop"
has_items = 1
if(myspray)
overlays += "cart_spray"
has_items = 1
if(myreplacer)
overlays += "cart_replacer"
has_items = 1
if(signs)
overlays += "cart_sign[signs]"
has_items = 1
//old style retardo-cart