requested changes

This commit is contained in:
ancientpower
2020-02-04 16:58:24 -06:00
parent 0d6ffbc432
commit a85f05a628
4 changed files with 68 additions and 61 deletions
+43 -44
View File
@@ -139,58 +139,57 @@
/obj/item/reagent_containers/food/drinks/MouseDrop(atom/over, atom/src_location, atom/over_location, src_control, over_control, params)
var/mob/user = usr
. = ..()
if (!istype(src_location))
return
if (!user || user.incapacitated())
if (!user || user.incapacitated() || !user.Adjacent(src))
return
// Attempted drink sliding
if (locate(/obj/structure/table) in src_location)
//Are we an expert slider?
for(var/datum/action/innate/drink_fling/D in user.actions)
if(D.active)
if (!user.Adjacent(src))
return
var/distance = MANHATTAN_DISTANCE(over_location, src)
if (distance >= 8 || distance == 0) // More than a full screen to go, or trying to slide to the same tile
return ..()
if (!locate(/obj/structure/table) in src_location)
return
//Are we an expert slider?
var/datum/action/innate/D = get_action_of_type(user, /datum/action/innate/drink_fling)
if(D.active)
var/distance = MANHATTAN_DISTANCE(over_location, src)
if (distance >= 8 || distance == 0) // More than a full screen to go, or trying to slide to the same tile
return
// Geometrically checking if we're on a straight line.
var/vector/V = atoms2vector(src, over_location)
var/vector/V_norm = V.duplicate()
V_norm.normalize()
if (!V_norm.is_integer())
return ..() // Only a cardinal vector (north, south, east, west) can pass this test
// Geometrically checking if we're on a straight line.
var/datum/vector/V = atoms2vector(src, over_location)
var/datum/vector/V_norm = V.duplicate()
V_norm.normalize()
if (!V_norm.is_integer())
return // Only a cardinal vector (north, south, east, west) can pass this test
// Checks if there's tables on the path.
var/turf/dest = get_translated_turf(V)
var/turf/temp_turf = src_location
// Checks if there's tables on the path.
var/turf/dest = get_translated_turf(V)
var/turf/temp_turf = src_location
do
temp_turf = temp_turf.get_translated_turf(V_norm)
if (!locate(/obj/structure/table) in temp_turf)
var/vector/V2 = atoms2vector(src, temp_turf)
vector_translate(V2, 0.1 SECONDS)
user.visible_message("<span class='warning'>\The [user] slides \the [src] down the table... and straight into the ground!</span>", "<span class='warning'>You slide \the [src] down the table, and straight into the ground!</span>")
smash(over_location, user, FALSE)
return
while (temp_turf != dest)
vector_translate(V, 0.1 SECONDS)
user.visible_message("<span class='notice'>\The [user] expertly slides \the [src] down the table.</span>", "<span class='notice'>You slide \the [src] down the table. What a pro.</span>")
do
temp_turf = temp_turf.get_translated_turf(V_norm)
if (!locate(/obj/structure/table) in temp_turf)
var/datum/vector/V2 = atoms2vector(src, temp_turf)
vector_translate(V2, 0.1 SECONDS)
user.visible_message("<span class='warning'>\The [user] slides \the [src] down the table... and straight into the ground!</span>", "<span class='warning'>You slide \the [src] down the table, and straight into the ground!</span>")
smash(over_location, user, FALSE)
return
else
if (!(locate(/obj/structure/table) in over_location))
return ..()
if (!user.Adjacent(src) || !src_location.Adjacent(over_location)) // Regular users can only do short slides.
return ..()
if (prob(10))
user.visible_message("<span class='warning'>\The [user] tries to slide \the [src] down the table, but fails miserably.</span>", "<span class='warning'>You <b>fail</b> to slide \the [src] down the table!</span>")
smash(over_location, user, FALSE)
return
user.visible_message("<span class='notice'>\The [user] slides \the [src] down the table.</span>", "<span class='notice'>You slide \the [src] down the table!</span>")
forceMove(over_location)
return
return ..()
while (temp_turf != dest)
vector_translate(V, 0.1 SECONDS)
user.visible_message("<span class='notice'>\The [user] expertly slides \the [src] down the table.</span>", "<span class='notice'>You slide \the [src] down the table. What a pro.</span>")
return
else
if (!(locate(/obj/structure/table) in over_location))
return
if (!user.Adjacent(src) || !src_location.Adjacent(over_location)) // Regular users can only do short slides.
return
if (prob(10))
user.visible_message("<span class='warning'>\The [user] tries to slide \the [src] down the table, but fails miserably.</span>", "<span class='warning'>You <b>fail</b> to slide \the [src] down the table!</span>")
smash(over_location, user, FALSE)
return
user.visible_message("<span class='notice'>\The [user] slides \the [src] down the table.</span>", "<span class='notice'>You slide \the [src] down the table!</span>")
forceMove(over_location)
return
+3 -3
View File
@@ -107,9 +107,9 @@
var/turf/T = get_turf(src)
if(!T || !target.CanPass(src, T) || !thrownby || !thrownby.actions)
return
for(var/datum/action/innate/drink_fling/D in thrownby.actions)
if(D.active)
return TRUE
var/datum/action/innate/D = get_action_of_type(thrownby, /datum/action/innate/drink_fling)
if(D.active)
return TRUE
/obj/item/reagent_containers/proc/ForceResetRotation()
transform = initial(transform)