Fixes more CanPass misuse (#30493)
* Fixes more CanPass misuse * Let's not give wrong impression * spans
This commit is contained in:
committed by
CitadelStationBot
parent
1769b0272a
commit
317958fb5c
@@ -215,7 +215,7 @@
|
||||
//to differentiate it, naturally everyone forgot about this immediately and so some things
|
||||
//would bump twice, so now it's called Collide
|
||||
/atom/movable/proc/Collide(atom/A)
|
||||
if((A))
|
||||
if(A)
|
||||
if(throwing)
|
||||
throwing.hit_atom(A)
|
||||
. = 1
|
||||
|
||||
@@ -120,17 +120,15 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target)
|
||||
if (isitem(mover) && mover.throwing)
|
||||
var/obj/item/I = mover
|
||||
if(istype(I, /obj/item/projectile))
|
||||
return
|
||||
/obj/structure/holohoop/hitby(atom/movable/AM)
|
||||
if (isitem(AM) && !istype(AM,/obj/item/projectile))
|
||||
if(prob(50))
|
||||
I.forceMove(get_turf(src))
|
||||
visible_message("<span class='warning'>Swish! [I] lands in [src].</span>")
|
||||
AM.forceMove(get_turf(src))
|
||||
visible_message("<span class='warning'>Swish! [AM] lands in [src].</span>")
|
||||
return
|
||||
else
|
||||
visible_message("<span class='danger'>[I] bounces off of [src]'s rim!</span>")
|
||||
return 0
|
||||
visible_message("<span class='danger'>[AM] bounces off of [src]'s rim!</span>")
|
||||
return ..()
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -335,20 +335,18 @@
|
||||
eject()
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/disposal/bin/CanPass(atom/movable/mover, turf/target)
|
||||
if (isitem(mover) && mover.throwing)
|
||||
var/obj/item/I = mover
|
||||
if(istype(I, /obj/item/projectile))
|
||||
return
|
||||
|
||||
/obj/machinery/disposal/bin/hitby(atom/movable/AM)
|
||||
if(isitem(AM) && AM.CanEnterDisposals())
|
||||
if(prob(75))
|
||||
I.forceMove(src)
|
||||
visible_message("<span class='notice'>[I] lands in [src].</span>")
|
||||
AM.forceMove(src)
|
||||
visible_message("<span class='notice'>[AM] lands in [src].</span>")
|
||||
update_icon()
|
||||
else
|
||||
visible_message("<span class='notice'>[I] bounces off of [src]'s rim!</span>")
|
||||
return 0
|
||||
visible_message("<span class='notice'>[AM] bounces off of [src]'s rim!</span>")
|
||||
return ..()
|
||||
else
|
||||
return ..(mover, target)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/disposal/bin/flush()
|
||||
..()
|
||||
@@ -457,12 +455,12 @@
|
||||
trunk.linked = src // link the pipe trunk to self
|
||||
|
||||
/obj/machinery/disposal/deliveryChute/place_item_in_disposal(obj/item/I, mob/user)
|
||||
if(I.disposalEnterTry())
|
||||
if(I.CanEnterDisposals())
|
||||
..()
|
||||
flush()
|
||||
|
||||
/obj/machinery/disposal/deliveryChute/CollidedWith(atom/movable/AM) //Go straight into the chute
|
||||
if(!AM.disposalEnterTry())
|
||||
if(!AM.CanEnterDisposals())
|
||||
return
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
@@ -485,16 +483,16 @@
|
||||
M.forceMove(src)
|
||||
flush()
|
||||
|
||||
/atom/movable/proc/disposalEnterTry()
|
||||
/atom/movable/proc/CanEnterDisposals()
|
||||
return 1
|
||||
|
||||
/obj/item/projectile/disposalEnterTry()
|
||||
/obj/item/projectile/CanEnterDisposals()
|
||||
return
|
||||
|
||||
/obj/effect/disposalEnterTry()
|
||||
/obj/effect/CanEnterDisposals()
|
||||
return
|
||||
|
||||
/obj/mecha/disposalEnterTry()
|
||||
/obj/mecha/CanEnterDisposals()
|
||||
return
|
||||
|
||||
/obj/machinery/disposal/deliveryChute/newHolderDestination(obj/structure/disposalholder/H)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user