mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-25 17:02:04 +00:00
Improved the janicart a bit. It should be less cursed now. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5264 316c924e-a436-60f5-8080-3fe189b3f50e
133 lines
3.9 KiB
Plaintext
133 lines
3.9 KiB
Plaintext
/obj/structure/stool/bed/chair/janicart
|
|
name = "janicart"
|
|
icon = 'icons/obj/vehicles.dmi'
|
|
icon_state = "pussywagon"
|
|
anchored = 1
|
|
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/trashbag/mybag = null
|
|
|
|
/obj/structure/stool/bed/chair/janicart/New()
|
|
handle_rotation()
|
|
|
|
var/datum/reagents/R = new/datum/reagents(100)
|
|
reagents = R
|
|
R.my_atom = src
|
|
|
|
|
|
/obj/structure/stool/bed/chair/janicart/examine()
|
|
set src in usr
|
|
usr << "\icon[src] This pimpin' ride contains [reagents.total_volume] unit\s of water!"
|
|
if(mybag)
|
|
usr << "\A [mybag] is hanging on the pimpin' ride."
|
|
|
|
/obj/structure/stool/bed/chair/janicart/attackby(obj/item/W, mob/user)
|
|
if(istype(W, /obj/item/weapon/mop))
|
|
if(reagents.total_volume >= 2)
|
|
reagents.trans_to(W, 2)
|
|
user << "<span class='notice'>You wet the mop in the pimpin' ride.</span>"
|
|
playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
|
|
if(reagents.total_volume < 1)
|
|
user << "<span class='notice'>This pimpin' ride is out of water!</span>"
|
|
else if(istype(W, /obj/item/key))
|
|
user << "Hold [W] in one of your hands while you drive this pimpin' ride."
|
|
else if(istype(W, /obj/item/weapon/trashbag))
|
|
user << "<span class='notice'>You hook the trashbag onto the pimpin' ride.</span>"
|
|
user.drop_item()
|
|
W.loc = src
|
|
mybag = W
|
|
|
|
|
|
/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))
|
|
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 pimpin' ride.</span>"
|
|
|
|
/obj/structure/stool/bed/chair/janicart/Move()
|
|
..()
|
|
if(buckled_mob)
|
|
if(buckled_mob.buckled == src)
|
|
buckled_mob.loc = loc
|
|
|
|
/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 pimpin' ride!</span>",\
|
|
"<span class='notice'>You climb onto the pimpin' ride!</span>")
|
|
M.buckled = src
|
|
M.loc = loc
|
|
M.dir = dir
|
|
M.update_canmove()
|
|
buckled_mob = M
|
|
update_mob()
|
|
add_fingerprint(user)
|
|
return
|
|
|
|
/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(50))
|
|
return buckled_mob.bullet_act(Proj)
|
|
visible_message("<span class='warning'>[Proj] ricochets off the pimpin' ride!</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 |