From 380334259ea8f52894c7811d7eea452bb18de411 Mon Sep 17 00:00:00 2001 From: coiax Date: Fri, 10 Feb 2017 16:03:39 +0000 Subject: [PATCH] Luxury shuttle changes (#23903) :cl: coiax add: The Luxury Shuttle grabs cash in your wallet and backpack, and shares approval between the entrance gates. /:cl: - Luxury Shuttle grabbing cash in your wallet is self explanatory, although we lack a "proper" cash spending system on /tg/. --- code/modules/admin/fun_balloon.dm | 40 +------------------------------ code/modules/shuttle/special.dm | 39 ++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index ee9b3f26c56..e3037274af0 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -100,44 +100,6 @@ qdel(src) -//Luxury Shuttle Blockers - -/obj/effect/forcefield/luxury_shuttle - var/threshhold = 500 - var/list/approved_passengers = list() - -/obj/effect/forcefield/luxury_shuttle/CanPass(atom/movable/mover, turf/target, height=0) - if(mover in approved_passengers) - return 1 - - if(!isliving(mover)) //No stowaways - return 0 - - var/total_cash = 0 - var/list/counted_money = list() - - for(var/obj/item/weapon/coin/C in mover) - total_cash += C.value - counted_money += C - if(total_cash >= threshhold) - break - for(var/obj/item/stack/spacecash/S in mover) - total_cash += S.value * S.amount - counted_money += S - if(total_cash >= threshhold) - break - - if(total_cash >= threshhold) - for(var/obj/I in counted_money) - qdel(I) - - mover << "Thank you for your payment! Please enjoy your flight." - approved_passengers += mover - return 1 - else - mover << "You don't have enough money to enter the main shuttle. You'll have to fly coach." - return 0 - //Shuttle Build /obj/effect/shuttle_build @@ -149,4 +111,4 @@ /obj/effect/shuttle_build/New() SSshuttle.emergency.dock(SSshuttle.getDock("emergency_home")) - qdel(src) \ No newline at end of file + qdel(src) diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index fd82fb70327..c724fbb35ce 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -216,3 +216,42 @@ var/obj/item/weapon/card/id/ID = user.get_idcard() if(ID && (access_cent_bar in ID.access)) return TRUE + +//Luxury Shuttle Blockers + +/obj/effect/forcefield/luxury_shuttle + var/threshhold = 500 + var/static/list/approved_passengers = list() + +/obj/effect/forcefield/luxury_shuttle/CanPass(atom/movable/mover, turf/target, height=0) + if(mover in approved_passengers) + return 1 + + if(!isliving(mover)) //No stowaways + return 0 + + var/total_cash = 0 + var/list/counted_money = list() + + for(var/obj/item/weapon/coin/C in mover.GetAllContents()) + total_cash += C.value + counted_money += C + if(total_cash >= threshhold) + break + for(var/obj/item/stack/spacecash/S in mover.GetAllContents()) + total_cash += S.value * S.amount + counted_money += S + if(total_cash >= threshhold) + break + + if(total_cash >= threshhold) + for(var/obj/I in counted_money) + qdel(I) + + mover << "Thank you for your payment! Please enjoy your flight." + approved_passengers += mover + return 1 + else + mover << "You don't have enough money to enter the main shuttle. You'll have to fly coach." + return 0 +