Skip to content

Commit

Permalink
Minor fixes for Slime Grinder and Slime Market Pad (#4743)
Browse files Browse the repository at this point in the history
* Fixing tool interaction and Slimes hitting.

* Removes user double text when opening hatch.
  • Loading branch information
Coll6 authored Jan 1, 2025
1 parent 1637dc4 commit 96e9588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
. += mutable_appearance(icon, "slime_grinder_overlay", layer + 0.1, src)

/obj/machinery/plumbing/slime_grinder/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
. = ..()
if(isslime(AM))
if(!poster_boy)
poster_boy = AM
Expand All @@ -102,3 +101,5 @@
soon_to_be_crushed |= AM
AM.forceMove(src)
update_appearance()
return // Stops slime from actually hitting the machine
return ..() // If it is anything else handle being hit normally.
13 changes: 8 additions & 5 deletions monkestation/code/modules/slimecore/machines/slime_market.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
base_icon_state = "market_pad"
density = TRUE
use_power = IDLE_POWER_USE
interaction_flags_machine = INTERACT_MACHINE_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OFFLINE|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_WIRES_IF_OPEN
idle_power_usage = BASE_MACHINE_IDLE_CONSUMPTION
active_power_usage = BASE_MACHINE_ACTIVE_CONSUMPTION
circuit = /obj/item/circuitboard/machine/slime_market_pad
Expand Down Expand Up @@ -42,15 +43,16 @@
break

/obj/machinery/slime_market_pad/attackby(obj/item/item, mob/living/user, params)
. = ..()
if(. || !can_interact(user))
return
if(HAS_TRAIT(user, TRAIT_CANT_ATTACK) || !can_interact(user))
return ..() // Little wasteful to call HAS_TRAIT twice here and parent but the parent will apply damage if we call it
if(default_deconstruction_screwdriver(user, icon_state, icon_state, item))
user.visible_message(span_notice("\The [user] [panel_open ? "opens" : "closes"] the hatch on \the [src]."), span_notice("You [panel_open ? "open" : "close"] the hatch on \the [src]."))
user.visible_message(span_notice("\The [user] [panel_open ? "opens" : "closes"] the hatch on \the [src]."))
update_appearance()
return TRUE
if(default_unfasten_wrench(user, item) || default_deconstruction_crowbar(item))
return TRUE
if(machine_stat & (NOPOWER|BROKEN))
return ..()
if(QDELETED(console))
to_chat(user, span_warning("[src] does not have a console linked to it!"))
return
Expand All @@ -74,7 +76,8 @@
sold_extracts++
if(sold_extracts > 0)
user.balloon_alert_to_viewers("sold [sold_extracts] extracts")
return
return TRUE
return ..()

/obj/machinery/slime_market_pad/proc/sell_extract(obj/item/slime_extract/extract)
SSresearch.xenobio_points += round(SSresearch.slime_core_prices[extract.type])
Expand Down

0 comments on commit 96e9588

Please sign in to comment.