Skip to content

Commit

Permalink
Makes some things attackable via melee, code tweaks (#6576)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

- Rocks are attackable.
- Outcrops are attackable.
- The two above can also be instantly destroyed by a proto-kinetic
accelerator.
- "Ausbushes" are attackable.
- Floodlights are attackable.
- Curtains are attackable.
- Fences are attackable.
- some other random things are attackable.
- gives feedback when using the fossil machine
- removed redundant code from curtains

## Why It's Good For The Game

get this snowflake no-melee nonsense out of my way.

there's probably a lot more to be sorted out but some of these are the
more egregious examples because they're usually obstructive in some way.

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
fix: A few rocks, plants, and some other things are able to be removed
via harm intent melee. You can now blast rocks with PKAs as well.
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
BlueWildrose committed Jul 13, 2024
1 parent ab5695c commit 013e23d
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 25 deletions.
3 changes: 3 additions & 0 deletions code/game/machinery/floodlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
var/unlocked = FALSE
var/open = FALSE
var/brightness_on = 8 //can't remember what the maxed out value is
climb_allowed = TRUE

/obj/machinery/floodlight/Initialize(mapload)
. = ..()
Expand Down Expand Up @@ -89,6 +90,8 @@
update_icon()

/obj/machinery/floodlight/attackby(obj/item/W, mob/user)
if(user.a_intent == INTENT_HARM)
return ..()
if(W.is_screwdriver())
if(!open)
if(unlocked)
Expand Down
2 changes: 2 additions & 0 deletions code/game/machinery/fossilrevive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
var/obj/item/fossil/mosquito = I
if(mosquito.processable == "seed")
addtimer(CALLBACK(src, PROC_REF(findsaway), "seed"), 100)
to_chat(user, SPAN_NOTICE("[src] begins processing [mosquito]."))
reviving = TRUE
mosquito.processable = FALSE
else
to_chat(user, SPAN_WARNING("That fossil has either already been processed, or does not contain valid genetic material."))
. = ..()

/obj/machinery/fossilrevive/proc/findsaway(generatetype)
var/droploc = get_turf(src)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/holoposter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ GLOBAL_LIST_EMPTY(holoposters)
machine_stat &= ~BROKEN
update_icon()
return
. = ..()

/obj/machinery/holoposter/attack_ai(mob/user)
return attack_hand(user)
Expand Down
25 changes: 7 additions & 18 deletions code/game/objects/structures/curtains.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
opacity = 1
density = 0
anchored = TRUE
var/obj/item/stack/mat = /obj/item/stack/material/plastic

/obj/structure/curtain/open
icon_state = "open"
Expand Down Expand Up @@ -38,13 +39,14 @@
layer = 3.3

/obj/structure/curtain/attackby(obj/item/P, mob/user)
if(user.a_intent == INTENT_HARM)
return ..()
if(P.is_wirecutter())
playsound(src, P.tool_sound, 50, 1)
to_chat(user, "<span class='notice'>You start to cut the shower curtains.</span>")
to_chat(user, "<span class='notice'>You start to cut [src].</span>")
if(do_after(user, 10))
to_chat(user, "<span class='notice'>You cut the shower curtains.</span>")
var/obj/item/stack/material/plastic/A = new /obj/item/stack/material/plastic( src.loc )
A.amount = 3
to_chat(user, "<span class='notice'>You cut [src].</span>")
new mat(src.loc, 3)
qdel(src)
return
else
Expand Down Expand Up @@ -97,6 +99,7 @@
desc = "A curtain fasioned out of Goliath hide - frequently used to keep flying ash out of a building."
icon = 'icons/obj/lavaland.dmi'
icon_state = "goliath_closed"
mat = /obj/item/stack/animalhide/goliath_hide

/obj/structure/curtain/ashlander/toggle()
set_opacity(!opacity)
Expand All @@ -109,17 +112,3 @@
plane = OBJ_PLANE
layer = 3.3

/obj/structure/curtain/ashlander/attackby(obj/item/P, mob/user)
if(P.is_wirecutter())
playsound(src, P.tool_sound, 50, 1)
to_chat(user, "<span class='notice'>You start to cut the hide curtain.</span>")
if(do_after(user, 10))
to_chat(user, "<span class='notice'>You cut the hide curtain.</span>")
var/obj/item/stack/animalhide/goliath_hide/A = new /obj/item/stack/animalhide/goliath_hide( src.loc )
A.amount = 3
qdel(src)
return
else
src.attack_hand(user)
return

3 changes: 3 additions & 0 deletions code/game/objects/structures/dancepole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
anchored = 1

/obj/structure/dancepole/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(user.a_intent == INTENT_HARM)
return ..()

if(O.is_wrench())
anchored = !anchored
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/structures/fence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
return ..()

/obj/structure/fence/attackby(obj/item/W, mob/user)
if(user.a_intent == INTENT_HARM)
return ..()
if(W.is_wirecutter())
if(!cuttable)
to_chat(user, SPAN_WARNING( "This section of the fence can't be cut."))
Expand All @@ -98,7 +100,7 @@
visible_message(SPAN_NOTICE("\The [user] completely cuts through \the [src]."))
to_chat(user, SPAN_NOTICE("The hole in \the [src] is now big enough to walk through."))
update_cut_status()
return TRUE
return TRUE

/obj/structure/fence/proc/update_cut_status()
if(!cuttable)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@

/obj/structure/flora/ausbushes/attackby(obj/item/W as obj, mob/user as mob)
// Dismantle
if(user.a_intent == INTENT_HARM) // who said you CAN'T touch grass (violently)?
return ..()
if(istype(W, /obj/item/shovel))
playsound(src.loc, W.tool_sound, 50, 1)
if(do_after(user, 10, src))
Expand Down
19 changes: 16 additions & 3 deletions code/game/objects/structures/flora/rocks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,22 @@

/obj/structure/flora/rock/attackby(obj/item/W as obj, mob/user as mob) //Shamelessly copied from mine_outcrops.dm
if (istype(W, /obj/item/pickaxe))
var/obj/item/pickaxe/P = W
to_chat(user, "<span class='notice'>[user] begins to hack away at \the [src].</span>")
if(do_after(user,40))
if(do_after(user,P.digspeed))
to_chat(user, "<span class='notice'>You have finished digging!</span>")
new outcropdrop(get_turf(src),rand(mindrop,upperdrop))
qdel(src)
GetDrilled()
return
return
. = ..()

/obj/structure/flora/rock/bullet_act(obj/projectile/P, def_zone)
if(P.damage_flag == ARMOR_BOMB) //Intended for kinetic accelerators/daggers to just get rid of this stuff quickly. They're rocks.
GetDrilled()
return
. = ..()

/obj/structure/flora/rock/proc/GetDrilled()
new outcropdrop(get_turf(src),rand(mindrop,upperdrop))
qdel(src)

18 changes: 15 additions & 3 deletions code/modules/mining/mine_outcrops.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,24 @@

/obj/structure/outcrop/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W, /obj/item/pickaxe))
var/obj/item/pickaxe/P = W
to_chat(user, "<span class='notice'>[user] begins to hack away at \the [src].</span>")
if(do_after(user,40))
if(do_after(user,P.digspeed))
to_chat(user, "<span class='notice'>You have finished digging!</span>")
new outcropdrop(get_turf(src), rand(mindrop,upperdrop))
qdel(src)
GetDrilled()
return
return
. = ..()

/obj/structure/outcrop/bullet_act(obj/projectile/P, def_zone)
if(P.damage_flag == ARMOR_BOMB) //Intended for kinetic accelerators/daggers to just get rid of this stuff quickly. They're rocks.
GetDrilled()
return
. = ..()

/obj/structure/outcrop/proc/GetDrilled()
new outcropdrop(get_turf(src), rand(mindrop,upperdrop))
qdel(src)

/obj/random/outcrop //In case you want an outcrop without pre-determining the type of ore.
name = "random rock outcrop"
Expand Down

0 comments on commit 013e23d

Please sign in to comment.