mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 13:09:11 +01:00
Mop do_after multi use
(#18485) * Mop do_after Makes mop do after allow multiple uses * Update mop.dm * fixes * Gets rid of these unused vars * cleanup --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
f7f1f23be5
commit
0a2d3a8cf6
@@ -15,8 +15,8 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
flags = NOCONDUCT
|
||||
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
|
||||
var/mopping = 0
|
||||
var/mopcount = 0
|
||||
///How long it takes to mop a tile.
|
||||
var/mop_time = 4 SECONDS
|
||||
|
||||
/obj/item/mop/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -31,7 +31,7 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
|
||||
|
||||
user.visible_message(span_warning("[user] begins to clean \the [get_turf(A)]."))
|
||||
|
||||
if(do_after(user, 4 SECONDS, target = src))
|
||||
if(do_after(user, mop_time, target = src, max_interact_count = 9))
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
T.wash(CLEAN_SCRUB)
|
||||
@@ -59,23 +59,4 @@ GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/mop)
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
flags = NOCONDUCT
|
||||
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
|
||||
|
||||
/obj/item/mop/advanced/Initialize(mapload)
|
||||
. = ..()
|
||||
create_reagents(30)
|
||||
|
||||
/obj/item/mop/advanced/afterattack(atom/A, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
if(istype(A, /turf) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay) || istype(A, /obj/effect/rune))
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, span_notice("Your mop is dry!"))
|
||||
return
|
||||
|
||||
user.visible_message(span_warning("[user] begins to clean \the [get_turf(A)]."))
|
||||
|
||||
if(do_after(user, 2 SECONDS, target = src))
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
T.wash(CLEAN_SCRUB)
|
||||
reagents.trans_to_turf(T, 1, 10)
|
||||
to_chat(user, span_notice("You have finished mopping!"))
|
||||
mop_time = 2 SECONDS
|
||||
|
||||
@@ -33,14 +33,19 @@
|
||||
healthcheck()
|
||||
return
|
||||
|
||||
/obj/structure/alien/hitby(AM as mob|obj)
|
||||
/obj/structure/alien/hitby(atom/movable/source)
|
||||
..()
|
||||
visible_message(span_danger("\The [src] was hit by \the [AM]."))
|
||||
var/tforce = 0
|
||||
if(ismob(AM))
|
||||
tforce = 10
|
||||
else
|
||||
tforce = AM:throwforce
|
||||
visible_message(span_danger("\The [src] was hit by \the [source]."))
|
||||
var/tforce
|
||||
if(ismob(source))
|
||||
tforce = 15
|
||||
else if(isobj(source))
|
||||
var/obj/object = source
|
||||
if(isitem(object))
|
||||
var/obj/item/our_item = object
|
||||
tforce = our_item.throwforce
|
||||
else
|
||||
tforce = object.w_class
|
||||
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
|
||||
health = max(0, health - tforce)
|
||||
healthcheck()
|
||||
|
||||
@@ -285,17 +285,17 @@
|
||||
tail_image.layer = BODY_LAYER + ((dir in tail_lower_dirs) ? TAIL_LOWER_LAYER : tail_layering)
|
||||
add_overlay(tail_image)
|
||||
|
||||
/obj/structure/gargoyle/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)
|
||||
/obj/structure/gargoyle/hitby(atom/movable/source ,var/speed = THROWFORCE_SPEED_DIVISOR)
|
||||
var/mob/living/carbon/human/gargoyle = WR_gargoyle.resolve()
|
||||
if(!gargoyle)
|
||||
return
|
||||
if(istype(AM,/obj/item) && gargoyle.vore_selected && gargoyle.trash_catching)
|
||||
var/obj/item/I = AM
|
||||
if(isitem(source) && gargoyle.vore_selected && gargoyle.trash_catching)
|
||||
var/obj/item/I = source
|
||||
if(gargoyle.adminbus_trash || is_type_in_list(I, GLOB.edible_trash) && I.trash_eatable && !is_type_in_list(I, GLOB.item_vore_blacklist))
|
||||
gargoyle.hitby(AM, speed)
|
||||
gargoyle.hitby(source, speed)
|
||||
return
|
||||
else if(isliving(AM))
|
||||
var/mob/living/L = AM
|
||||
else if(isliving(source))
|
||||
var/mob/living/L = source
|
||||
if(gargoyle.throw_vore && L.throw_vore && gargoyle.can_be_drop_pred && L.can_be_drop_prey)
|
||||
var/drop_prey_temp = FALSE
|
||||
if(gargoyle.can_be_drop_prey)
|
||||
|
||||
@@ -257,14 +257,14 @@
|
||||
take_damage(damage)
|
||||
return
|
||||
|
||||
/obj/structure/low_wall/hitby(AM as mob|obj, var/speed)
|
||||
/obj/structure/low_wall/hitby(atom/movable/source, var/speed)
|
||||
..()
|
||||
var/tforce = 0
|
||||
if(ismob(AM)) // All mobs have a multiplier and a size according to mob_defines.dm
|
||||
var/mob/I = AM
|
||||
if(ismob(source)) // All mobs have a multiplier and a size according to mob_defines.dm
|
||||
var/mob/I = source
|
||||
tforce = I.mob_size * (speed/THROWFORCE_SPEED_DIVISOR)
|
||||
else if(isitem(AM))
|
||||
var/obj/item/O = AM
|
||||
else if(isitem(source))
|
||||
var/obj/item/O = source
|
||||
tforce = O.throwforce * (speed/THROWFORCE_SPEED_DIVISOR)
|
||||
if (tforce < 15)
|
||||
return
|
||||
|
||||
@@ -156,21 +156,21 @@
|
||||
return !anchored // If it's anchored, it'll block air.
|
||||
return TRUE // Don't stop airflow from the other sides.
|
||||
|
||||
/obj/structure/window/hitby(AM as mob|obj)
|
||||
/obj/structure/window/hitby(atom/movable/source)
|
||||
..()
|
||||
visible_message(span_danger("[src] was hit by [AM]."))
|
||||
visible_message(span_danger("[src] was hit by [source]."))
|
||||
var/tforce = 0
|
||||
if(ismob(AM))
|
||||
if(ismob(source))
|
||||
tforce = 40
|
||||
else if(isobj(AM))
|
||||
var/obj/item/I = AM
|
||||
else if(isobj(source))
|
||||
var/obj/item/I = source
|
||||
tforce = I.throwforce
|
||||
if(reinf) tforce *= 0.25
|
||||
if(health - tforce <= 7 && !reinf)
|
||||
anchored = FALSE
|
||||
update_verbs()
|
||||
update_nearby_icons()
|
||||
step(src, get_dir(AM, src))
|
||||
step(src, get_dir(source, src))
|
||||
take_damage(tforce)
|
||||
|
||||
/obj/structure/window/attack_tk(mob/user as mob)
|
||||
|
||||
Reference in New Issue
Block a user