mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-30 02:52:30 +00:00
Removes a version of atom/movable/Move() that was in mob_movement.dm. New proc called newtonian_move() that's called as a result of things like shooting a gun or spraying a fire extinguisher and as part of atom/movable/Move(). It pushes src if it's not under gravity and gives the object a chance to stop itself. As a result, inertial_drift() is kill. Moved Process_Spacemove() out to atom/movable. It does the same thing, it's called whenever a drift is attempted and stops the drift if it returns 1. Default check is to look for nearby lattices to make dragging shit around the station less annoying. Mobs still call it in Client/Move() The mob version of Process_Spacemove() will shove non-anchored nearby objects out of the way if you try to move like that. For example if you're free-floating in space next to a closet and try to move right, the closet will drift off to the left. Mechs call their occupant's version of Process_Spacemove() so mining with a mech isn't retarded. The pussy wagon does the same thing and thus no longer works like a jetpack. Will it be making a comeback?!?! (no) Any move will attempt to keep dragging your pulled object, not just ones initiated by the client. Should make space wind a little less annoying. Was needed to make drifting not break your drags. Mechs drift correctly without any special snowflake crap. Spaceslipping is gone because fuck that shit Space movement is now slow instead of fast. Having a jetpack helps go faster but even that's slower than current. Hopefully means nuke ops can see each other as they move to the station instead of losing sight of each other instantly. Having your hands full makes spacemovement even slower. You can drift in office chairs and drag mobs in beds or the bed itself. Currently drifting diagonally while in an office chair is bugged and I need help to solve it. It winds up in cardinal movement instead of a diagonal one. Changes up the jetpacking effects system to cause fewer errant ion trails but it's still awful code. In hindsight I shouldn't have bothered but here we go.
287 lines
8.0 KiB
Plaintext
287 lines
8.0 KiB
Plaintext
/obj/structure/janitorialcart
|
|
name = "janitorial cart"
|
|
desc = "This is the alpha and omega of sanitation."
|
|
icon = 'icons/obj/janitor.dmi'
|
|
icon_state = "cart"
|
|
anchored = 0
|
|
density = 1
|
|
flags = OPENCONTAINER
|
|
//copypaste sorry
|
|
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
|
|
var/obj/item/weapon/storage/bag/trash/mybag = null
|
|
var/obj/item/weapon/mop/mymop = null
|
|
var/obj/item/weapon/reagent_containers/spray/cleaner/myspray = null
|
|
var/obj/item/device/lightreplacer/myreplacer = null
|
|
var/signs = 0
|
|
var/const/max_signs = 4
|
|
|
|
|
|
/obj/structure/janitorialcart/New()
|
|
create_reagents(100)
|
|
|
|
|
|
/obj/structure/janitorialcart/proc/wet_mop(obj/item/weapon/mop, mob/user)
|
|
if(reagents.total_volume < 1)
|
|
user << "[src] is out of water!</span>"
|
|
else
|
|
reagents.trans_to(mop, 5) //
|
|
user << "<span class='notice'>You wet [mop] in [src].</span>"
|
|
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
|
|
|
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
|
|
user.drop_item()
|
|
I.loc = src
|
|
updateUsrDialog()
|
|
user << "<span class='notice'>You put [I] into [src].</span>"
|
|
return
|
|
|
|
|
|
/obj/structure/janitorialcart/attackby(obj/item/I, mob/user)
|
|
var/fail_msg = "<span class='notice'>There is already one of those in [src].</span>"
|
|
|
|
if(istype(I, /obj/item/weapon/mop))
|
|
var/obj/item/weapon/mop/m=I
|
|
if(m.reagents.total_volume < m.reagents.maximum_volume)
|
|
wet_mop(m, user)
|
|
return
|
|
if(!mymop)
|
|
m.janicart_insert(user, src)
|
|
else
|
|
user << fail_msg
|
|
|
|
else if(istype(I, /obj/item/weapon/storage/bag/trash))
|
|
if(!mybag)
|
|
var/obj/item/weapon/storage/bag/trash/t=I
|
|
t.janicart_insert(user, src)
|
|
else
|
|
user << fail_msg
|
|
else if(istype(I, /obj/item/weapon/reagent_containers/spray/cleaner))
|
|
if(!myspray)
|
|
put_in_cart(I, user)
|
|
myspray=I
|
|
update_icon()
|
|
else
|
|
user << fail_msg
|
|
else if(istype(I, /obj/item/device/lightreplacer))
|
|
if(!myreplacer)
|
|
var/obj/item/device/lightreplacer/l=I
|
|
l.janicart_insert(user,src)
|
|
else
|
|
user << fail_msg
|
|
else if(istype(I, /obj/item/weapon/caution))
|
|
if(signs < max_signs)
|
|
put_in_cart(I, user)
|
|
signs++
|
|
update_icon()
|
|
else
|
|
user << "<span class='notice'>[src] can't hold any more signs.</span>"
|
|
else if(mybag)
|
|
mybag.attackby(I, user)
|
|
|
|
/obj/structure/janitorialcart/attack_hand(mob/user)
|
|
user.set_machine(src)
|
|
var/dat
|
|
if(mybag)
|
|
dat += "<a href='?src=\ref[src];garbage=1'>[mybag.name]</a><br>"
|
|
if(mymop)
|
|
dat += "<a href='?src=\ref[src];mop=1'>[mymop.name]</a><br>"
|
|
if(myspray)
|
|
dat += "<a href='?src=\ref[src];spray=1'>[myspray.name]</a><br>"
|
|
if(myreplacer)
|
|
dat += "<a href='?src=\ref[src];replacer=1'>[myreplacer.name]</a><br>"
|
|
if(signs)
|
|
dat += "<a href='?src=\ref[src];sign=1'>[signs] sign\s</a><br>"
|
|
var/datum/browser/popup = new(user, "janicart", name, 240, 160)
|
|
popup.set_content(dat)
|
|
popup.open()
|
|
|
|
|
|
/obj/structure/janitorialcart/Topic(href, href_list)
|
|
if(!in_range(src, usr))
|
|
return
|
|
if(!isliving(usr))
|
|
return
|
|
var/mob/living/user = usr
|
|
if(href_list["garbage"])
|
|
if(mybag)
|
|
user.put_in_hands(mybag)
|
|
user << "<span class='notice'>You take [mybag] from [src].</span>"
|
|
mybag = null
|
|
if(href_list["mop"])
|
|
if(mymop)
|
|
user.put_in_hands(mymop)
|
|
user << "<span class='notice'>You take [mymop] from [src].</span>"
|
|
mymop = null
|
|
if(href_list["spray"])
|
|
if(myspray)
|
|
user.put_in_hands(myspray)
|
|
user << "<span class='notice'>You take [myspray] from [src].</span>"
|
|
myspray = null
|
|
if(href_list["replacer"])
|
|
if(myreplacer)
|
|
user.put_in_hands(myreplacer)
|
|
user << "<span class='notice'>You take [myreplacer] from [src].</span>"
|
|
myreplacer = null
|
|
if(href_list["sign"])
|
|
if(signs)
|
|
var/obj/item/weapon/caution/Sign = locate() in src
|
|
if(Sign)
|
|
user.put_in_hands(Sign)
|
|
user << "<span class='notice'>You take \a [Sign] from [src].</span>"
|
|
signs--
|
|
else
|
|
WARNING("Signs ([signs]) didn't match contents")
|
|
signs = 0
|
|
|
|
update_icon()
|
|
updateUsrDialog()
|
|
|
|
|
|
/obj/structure/janitorialcart/update_icon()
|
|
overlays = null
|
|
if(mybag)
|
|
overlays += "cart_garbage"
|
|
if(mymop)
|
|
overlays += "cart_mop"
|
|
if(myspray)
|
|
overlays += "cart_spray"
|
|
if(myreplacer)
|
|
overlays += "cart_replacer"
|
|
if(signs)
|
|
overlays += "cart_sign[signs]"
|
|
|
|
|
|
//old style retardo-cart
|
|
/obj/structure/stool/bed/chair/janicart
|
|
name = "janicart"
|
|
icon = 'icons/obj/vehicles.dmi'
|
|
icon_state = "pussywagon"
|
|
anchored = 0
|
|
density = 1
|
|
flags = OPENCONTAINER
|
|
//copypaste sorry
|
|
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
|
|
var/obj/item/weapon/storage/bag/trash/mybag = null
|
|
var/callme = "pimpin' ride" //how do people refer to it?
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/New()
|
|
handle_rotation()
|
|
create_reagents(100)
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/examine(mob/user)
|
|
..()
|
|
if(mybag)
|
|
user << "\A [mybag] is hanging on \the [callme]."
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/attackby(obj/item/I, mob/user)
|
|
if(istype(I, /obj/item/weapon/mop))
|
|
if(reagents.total_volume > 1)
|
|
reagents.trans_to(I, 2)
|
|
user << "<span class='notice'>You wet [I] in the [callme].</span>"
|
|
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
|
else
|
|
user << "<span class='notice'>This [callme] is out of water!</span>"
|
|
else if(istype(I, /obj/item/key))
|
|
user << "Hold [I] in one of your hands while you drive this [callme]."
|
|
else if(istype(I, /obj/item/weapon/storage/bag/trash))
|
|
user << "<span class='notice'>You hook the trashbag onto the [callme].</span>"
|
|
user.drop_item()
|
|
I.loc = src
|
|
mybag = I
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/attack_hand(mob/user)
|
|
if(mybag)
|
|
mybag.loc = get_turf(user)
|
|
user.put_in_hands(mybag)
|
|
mybag = null
|
|
else
|
|
..()
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/relaymove(mob/user, direction)
|
|
if(user.stat || user.stunned || user.weakened || user.paralysis)
|
|
unbuckle()
|
|
if(istype(user.l_hand, /obj/item/key) || istype(user.r_hand, /obj/item/key))
|
|
if(!Process_Spacemove(direction))
|
|
return
|
|
step(src, direction)
|
|
update_mob()
|
|
handle_rotation()
|
|
else
|
|
user << "<span class='notice'>You'll need the keys in one of your hands to drive this [callme].</span>"
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/buckle_mob(mob/M, mob/user)
|
|
if(M != user || !ismob(M) || get_dist(src, user) > 1 || user.restrained() || user.lying || user.stat || M.buckled || istype(user, /mob/living/silicon))
|
|
return
|
|
|
|
unbuckle()
|
|
|
|
M.visible_message(\
|
|
"<span class='notice'>[M] climbs onto the [callme]!</span>",\
|
|
"<span class='notice'>You climb onto the [callme]!</span>")
|
|
M.buckled = src
|
|
M.loc = loc
|
|
M.dir = dir
|
|
M.update_canmove()
|
|
buckled_mob = M
|
|
update_mob()
|
|
add_fingerprint(user)
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/unbuckle()
|
|
if(buckled_mob)
|
|
buckled_mob.pixel_x = 0
|
|
buckled_mob.pixel_y = 0
|
|
..()
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/handle_rotation()
|
|
if(dir == SOUTH)
|
|
layer = FLY_LAYER
|
|
else
|
|
layer = OBJ_LAYER
|
|
|
|
if(buckled_mob)
|
|
if(buckled_mob.loc != loc)
|
|
buckled_mob.buckled = null //Temporary, so Move() succeeds.
|
|
buckled_mob.buckled = src //Restoring
|
|
|
|
update_mob()
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/proc/update_mob()
|
|
if(buckled_mob)
|
|
buckled_mob.dir = dir
|
|
switch(dir)
|
|
if(SOUTH)
|
|
buckled_mob.pixel_x = 0
|
|
buckled_mob.pixel_y = 7
|
|
if(WEST)
|
|
buckled_mob.pixel_x = 13
|
|
buckled_mob.pixel_y = 7
|
|
if(NORTH)
|
|
buckled_mob.pixel_x = 0
|
|
buckled_mob.pixel_y = 4
|
|
if(EAST)
|
|
buckled_mob.pixel_x = -13
|
|
buckled_mob.pixel_y = 7
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/bullet_act(var/obj/item/projectile/Proj)
|
|
if(buckled_mob)
|
|
if(prob(85))
|
|
return buckled_mob.bullet_act(Proj)
|
|
visible_message("<span class='warning'>[Proj] ricochets off the [callme]!</span>")
|
|
|
|
|
|
/obj/item/key
|
|
name = "key"
|
|
desc = "A keyring with a small steel key, and a pink fob reading \"Pussy Wagon\"."
|
|
icon = 'icons/obj/vehicles.dmi'
|
|
icon_state = "keys"
|
|
w_class = 1 |