Fixes more CanPass misuse (#30493)

* Fixes more CanPass misuse

* Let's not give wrong impression

* spans
This commit is contained in:
AnturK
2017-09-09 19:41:02 -05:00
committed by CitadelStationBot
parent 1769b0272a
commit 317958fb5c
4 changed files with 46 additions and 35 deletions
+1 -1
View File
@@ -215,7 +215,7 @@
//to differentiate it, naturally everyone forgot about this immediately and so some things //to differentiate it, naturally everyone forgot about this immediately and so some things
//would bump twice, so now it's called Collide //would bump twice, so now it's called Collide
/atom/movable/proc/Collide(atom/A) /atom/movable/proc/Collide(atom/A)
if((A)) if(A)
if(throwing) if(throwing)
throwing.hit_atom(A) throwing.hit_atom(A)
. = 1 . = 1
+7 -9
View File
@@ -120,17 +120,15 @@
else else
..() ..()
/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target) /obj/structure/holohoop/hitby(atom/movable/AM)
if (isitem(mover) && mover.throwing) if (isitem(AM) && !istype(AM,/obj/item/projectile))
var/obj/item/I = mover
if(istype(I, /obj/item/projectile))
return
if(prob(50)) if(prob(50))
I.forceMove(get_turf(src)) AM.forceMove(get_turf(src))
visible_message("<span class='warning'>Swish! [I] lands in [src].</span>") visible_message("<span class='warning'>Swish! [AM] lands in [src].</span>")
return
else else
visible_message("<span class='danger'>[I] bounces off of [src]'s rim!</span>") visible_message("<span class='danger'>[AM] bounces off of [src]'s rim!</span>")
return 0 return ..()
else else
return ..() return ..()
+14 -16
View File
@@ -335,20 +335,18 @@
eject() eject()
. = TRUE . = TRUE
/obj/machinery/disposal/bin/CanPass(atom/movable/mover, turf/target)
if (isitem(mover) && mover.throwing) /obj/machinery/disposal/bin/hitby(atom/movable/AM)
var/obj/item/I = mover if(isitem(AM) && AM.CanEnterDisposals())
if(istype(I, /obj/item/projectile))
return
if(prob(75)) if(prob(75))
I.forceMove(src) AM.forceMove(src)
visible_message("<span class='notice'>[I] lands in [src].</span>") visible_message("<span class='notice'>[AM] lands in [src].</span>")
update_icon() update_icon()
else else
visible_message("<span class='notice'>[I] bounces off of [src]'s rim!</span>") visible_message("<span class='notice'>[AM] bounces off of [src]'s rim!</span>")
return 0 return ..()
else else
return ..(mover, target) return ..()
/obj/machinery/disposal/bin/flush() /obj/machinery/disposal/bin/flush()
..() ..()
@@ -457,12 +455,12 @@
trunk.linked = src // link the pipe trunk to self trunk.linked = src // link the pipe trunk to self
/obj/machinery/disposal/deliveryChute/place_item_in_disposal(obj/item/I, mob/user) /obj/machinery/disposal/deliveryChute/place_item_in_disposal(obj/item/I, mob/user)
if(I.disposalEnterTry()) if(I.CanEnterDisposals())
..() ..()
flush() flush()
/obj/machinery/disposal/deliveryChute/CollidedWith(atom/movable/AM) //Go straight into the chute /obj/machinery/disposal/deliveryChute/CollidedWith(atom/movable/AM) //Go straight into the chute
if(!AM.disposalEnterTry()) if(!AM.CanEnterDisposals())
return return
switch(dir) switch(dir)
if(NORTH) if(NORTH)
@@ -485,16 +483,16 @@
M.forceMove(src) M.forceMove(src)
flush() flush()
/atom/movable/proc/disposalEnterTry() /atom/movable/proc/CanEnterDisposals()
return 1 return 1
/obj/item/projectile/disposalEnterTry() /obj/item/projectile/CanEnterDisposals()
return return
/obj/effect/disposalEnterTry() /obj/effect/CanEnterDisposals()
return return
/obj/mecha/disposalEnterTry() /obj/mecha/CanEnterDisposals()
return return
/obj/machinery/disposal/deliveryChute/newHolderDestination(obj/structure/disposalholder/H) /obj/machinery/disposal/deliveryChute/newHolderDestination(obj/structure/disposalholder/H)
+24 -9
View File
@@ -215,23 +215,37 @@
/obj/effect/forcefield/luxury_shuttle /obj/effect/forcefield/luxury_shuttle
var/threshold = 500 var/threshold = 500
var/static/list/approved_passengers = list() var/static/list/approved_passengers = list()
var/static/list/check_times = list()
/obj/effect/forcefield/luxury_shuttle/CanPass(atom/movable/mover, turf/target) /obj/effect/forcefield/luxury_shuttle/CanPass(atom/movable/mover, turf/target)
if(mover in approved_passengers) if(mover in approved_passengers)
return 1 return TRUE
if(!isliving(mover)) //No stowaways 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/total_cash = 0
var/list/counted_money = list() 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 total_cash += C.value
counted_money += C counted_money += C
if(total_cash >= threshold) if(total_cash >= threshold)
break 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 total_cash += S.value * S.amount
counted_money += S counted_money += S
if(total_cash >= threshold) if(total_cash >= threshold)
@@ -241,12 +255,13 @@
for(var/obj/I in counted_money) for(var/obj/I in counted_money)
qdel(I) qdel(I)
to_chat(mover, "Thank you for your payment! Please enjoy your flight.") to_chat(AM, "Thank you for your payment! Please enjoy your flight.")
approved_passengers += mover approved_passengers += AM
return 1 check_times -= AM
return
else else
to_chat(mover, "You don't have enough money to enter the main shuttle. You'll have to fly coach.") 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 0 return ..()
/mob/living/simple_animal/hostile/bear/fightpit /mob/living/simple_animal/hostile/bear/fightpit
name = "fight pit bear" name = "fight pit bear"