Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes the Light Replacer more easily attainable + Allows broken light recycling #7381

Closed
wants to merge 5 commits into from

Conversation

TheKillfish
Copy link
Contributor

@TheKillfish TheKillfish commented Oct 25, 2024

About the pull request

Adds the Light Replacer to both ComTech and normal tool storage vendors, and adds it to the autolathe recipe list. Allows the Light Replacer to recycle broken lights either when replacing bulbs or inserting a broken one by hand, converting 5 broken ones to 1 usable light.

Also cleaned up a grammar mistake when shattering a lightbulb.

Explain why it's good for the game

The Light Replacer is a niche but handy tool for lighting places a bit more effectively than flares or flashlights can (provided the local APC is still functioning or that there even is one) but has very limited avaliability. Though not a major issue, it'd be nicer to have a way of replacing/aquiring one than having to steal one of the limited few from Upper Engineering, hunting for one groundside, or bugging your local engineers for theirs if they aren't using it (most of whom probably ditched it in their prep area anyway). Plus, it'd make sense that tool vendors would have them in stock and that the autolathe can print replacements.

The minor rework improves functionality and makes using it a smoother process.

Bad grammar is bad.

Testing Photographs and Procedure

Added it to autolathe recipes and vendors. Found out it didn't have material costs, so added matter values.

Changelog

🆑 Killfish
add: Added the Light Replacer to tool storage and to the autolathe. The Light Replacer can now also recycle broken bulbs, either directly when replacing or when inserted by hand.
spellcheck: Fixes missing 'the' when shattering a light bulb, so it no longer says 'light tube smashes' in all lower case.
/:cl:

@TheKillfish TheKillfish changed the title Makes the Light Replacer more normally attainable Makes the Light Replacer more easily attainable Oct 25, 2024
@cmss13-ci cmss13-ci bot added the Feature Feature coder badge label Oct 25, 2024
@TheKillfish TheKillfish changed the title Makes the Light Replacer more easily attainable Makes the Light Replacer more easily attainable + Allows broken light recycling Oct 25, 2024
@TheKillfish
Copy link
Contributor Author

Blundir suggested broken light recycling, so I've done that now.

@cmss13-ci cmss13-ci bot added the Grammar and Formatting Fixes the codebase's tpyos and grammatical's errors label Oct 25, 2024
@@ -758,7 +758,7 @@

/obj/item/light_bulb/proc/shatter()
if(status == LIGHT_OK || status == LIGHT_BURNED)
src.visible_message(SPAN_DANGER("[name] shatters."),SPAN_DANGER("You hear a small glass object shatter."))
src.visible_message(SPAN_DANGER("The [name] shatters."),SPAN_DANGER("You hear a small glass object shatter."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
src.visible_message(SPAN_DANGER("The [name] shatters."),SPAN_DANGER("You hear a small glass object shatter."))
visible_message(SPAN_DANGER("[src] shatters."), SPAN_DANGER("You hear a small glass object shatter."))

if(recycle == max_recycle)
recycle = 0
AddUses(1)
playsound(src.loc, 'sound/machines/ding.ogg', 5, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
playsound(src.loc, 'sound/machines/ding.ogg', 5, 1)
playsound(src, 'sound/machines/ding.ogg', 5, 1)

playsound(src.loc, 'sound/machines/ding.ogg', 5, 1)
return
else
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
playsound(src, 'sound/machines/click.ogg', 25, 1)

AddUses(-1)
return 1

// Negative numbers will subtract
/obj/item/device/lightreplacer/proc/AddUses(amount = 1)
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
playsound(src, 'sound/machines/click.ogg', 25, 1)

user.drop_held_item()
qdel(L)
return
else
to_chat(user, "You need a working light.")
Recycle()
to_chat(user, SPAN_NOTICE("You insert the [L.name] into the [src.name] for recycling."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to_chat(user, SPAN_NOTICE("You insert the [L.name] into the [src.name] for recycling."))
to_chat(user, SPAN_NOTICE("You insert [L] into [src] for recycling."))

@@ -83,31 +91,34 @@
if(L.status == 0) // LIGHT OKAY
if(uses < max_uses)
AddUses(1)
to_chat(user, "You insert the [L.name] into the [src.name]. You have [uses] lights remaining.")
to_chat(user, SPAN_NOTICE("You insert the [L.name] into the [src.name]. You have [uses] lights remaining."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to_chat(user, SPAN_NOTICE("You insert the [L.name] into the [src.name]. You have [uses] lights remaining."))
to_chat(user, SPAN_NOTICE("You insert [L] into [src]. You have [uses] lights remaining."))

Comment on lines +136 to +139
else
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
recycle += 1
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
else
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
recycle += 1
return
playsound(src.loc, 'sound/machines/click.ogg', 25, 1)
recycle += 1

the else clause is redundant as the previous condition returns

@harryob harryob marked this pull request as draft October 26, 2024 10:42
@harryob
Copy link
Member

harryob commented Nov 19, 2024

pr appears to be stale with unaddressed requested changes, feel free to address the changes and ask us to reopen. or just make a new pr

@harryob harryob closed this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature coder badge Grammar and Formatting Fixes the codebase's tpyos and grammatical's errors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants