Skip to content

Commit

Permalink
Build mode light maker (shiptest-ss13#2905)
Browse files Browse the repository at this point in the history
## About The Pull Request
Hello dear comrades! Adds new submode for admins buildmode. You can
create lights on any turf/mob/obj with different range, power and color.
based on: shiptest-ss13#2902 because it's changes the same .dmi file with sprites

## Why It's Good For The Game
Here is how it work in the video: https://youtu.be/Ias2_tdiLeU
Admins can light up fast any areas and points of interest or just dark
places that needs to be lit. A very handy tool for events and stuff.
1. Go to build mode and select my little lightbulb icon

![image](https://github.com/shiptest-ss13/Shiptest/assets/105150564/7c391e51-056f-43cb-be0e-6c1277aa632b)
2. Already you can place light with power 1, range 3 and white color.
Press Build Mode button to change this settings.

![image](https://github.com/shiptest-ss13/Shiptest/assets/105150564/8c6eb212-42f4-48e8-8557-a940c5af3b6a)

![image](https://github.com/shiptest-ss13/Shiptest/assets/105150564/ad0b44fa-96e5-43ef-9d18-3245d857ed16)
3. Enjoy this great tool for events and points of interest

![image](https://github.com/shiptest-ss13/Shiptest/assets/105150564/c884ba28-8bac-488a-88ca-5973b29306d0)

## Changelog

:cl:
admin: new light maker subtype for build mode
/:cl:

---------

Signed-off-by: cuddleandtea <[email protected]>
  • Loading branch information
cuddleandtea authored and MysticalFaceLesS committed Jul 13, 2024
1 parent 24ffddd commit a51a051
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions code/modules/buildmode/submodes/lightmaker.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/datum/buildmode_mode/lightmaker
key = "lightmaker"

var/light_range = 3
var/light_power = 1
var/light_color = COLOR_WHITE

/datum/buildmode_mode/lightmaker/show_help(client/target_client)
to_chat(target_client, span_purple(examine_block(
"[span_bold("Left Click")] -> Create light\n\
[span_bold("Right Click")] -> Delete light\n\
[span_bold("Right Click on Build Mode Button")] -> Change light properties"))
)

/datum/buildmode_mode/lightmaker/change_settings(client/target_client)
var/choice = alert("Change the new light range, power or color?", "Light Maker", "Range", "Power", "Color", "Cancel")
switch(choice)
if("Range")
light_range = input(target_client, "Range of light", text("Input")) as num|null
if("Power")
light_power = input(target_client, "Power of light", text("Input")) as num|null
if("Color")
light_color = input(target_client, "Light color", text("Input")) as color|null

/datum/buildmode_mode/lightmaker/handle_click(client/target_client, params, obj/object)
var/list/modifiers = params2list(params)

if(LAZYACCESS(modifiers, LEFT_CLICK))
object.set_light(light_range, light_power, light_color)
if(LAZYACCESS(modifiers, RIGHT_CLICK))
object.set_light(0,0,COLOR_WHITE)
Binary file modified icons/misc/buildmode.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,7 @@
#include "code\modules\buildmode\submodes\basic.dm"
#include "code\modules\buildmode\submodes\boom.dm"
#include "code\modules\buildmode\submodes\copy.dm"
#include "code\modules\buildmode\submodes\lightmaker.dm"
#include "code\modules\buildmode\submodes\delete.dm"
#include "code\modules\buildmode\submodes\fill.dm"
#include "code\modules\buildmode\submodes\map_export.dm"
Expand Down

0 comments on commit a51a051

Please sign in to comment.