Fixes more CanPass misuse (#30493)

* Fixes more CanPass misuse

* Let's not give wrong impression

* spans
This commit is contained in:
AnturK
2017-09-10 02:40:23 +02:00
committed by CitadelStationBot
parent 1769b0272a
commit 317958fb5c
4 changed files with 46 additions and 35 deletions
+24 -9
View File
@@ -215,23 +215,37 @@
/obj/effect/forcefield/luxury_shuttle
var/threshold = 500
var/static/list/approved_passengers = list()
var/static/list/check_times = list()
/obj/effect/forcefield/luxury_shuttle/CanPass(atom/movable/mover, turf/target)
if(mover in approved_passengers)
return 1
return TRUE
if(!isliving(mover)) //No stowaways
return 0
return FALSE
return FALSE
#define LUXURY_MESSAGE_COOLDOWN 100
/obj/effect/forcefield/luxury_shuttle/CollidedWith(atom/movable/AM)
if(!isliving(AM))
return ..()
if(check_times[AM] && check_times[AM] > world.time) //Let's not spam the message
return ..()
check_times[AM] = world.time + LUXURY_MESSAGE_COOLDOWN
var/total_cash = 0
var/list/counted_money = list()
for(var/obj/item/coin/C in mover.GetAllContents())
for(var/obj/item/coin/C in AM.GetAllContents())
total_cash += C.value
counted_money += C
if(total_cash >= threshold)
break
for(var/obj/item/stack/spacecash/S in mover.GetAllContents())
for(var/obj/item/stack/spacecash/S in AM.GetAllContents())
total_cash += S.value * S.amount
counted_money += S
if(total_cash >= threshold)
@@ -241,12 +255,13 @@
for(var/obj/I in counted_money)
qdel(I)
to_chat(mover, "Thank you for your payment! Please enjoy your flight.")
approved_passengers += mover
return 1
to_chat(AM, "Thank you for your payment! Please enjoy your flight.")
approved_passengers += AM
check_times -= AM
return
else
to_chat(mover, "You don't have enough money to enter the main shuttle. You'll have to fly coach.")
return 0
to_chat(AM, "<span class='warning'>You don't have enough money to enter the main shuttle. You'll have to fly coach.</span>")
return ..()
/mob/living/simple_animal/hostile/bear/fightpit
name = "fight pit bear"