Skip to content

Commit

Permalink
I See Clearly Now: Laser pointer balance adjustments (#1173)
Browse files Browse the repository at this point in the history
* Laser pointer fixes: remove felinid forced movement, chat notifications, add limited laser pointer type

* Comment formatting fixes



* Trailing formatting fix



* Modularise

* Make GCF vendor sell limited laserpointers

* Apply suggestions from code review

---------

Co-authored-by: Ephemeralis <[email protected]>
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent 01313cc commit 6801cdd
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
12 changes: 7 additions & 5 deletions code/game/objects/items/devices/laserpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,14 @@
continue
if(target_felinid.body_position == STANDING_UP)
target_felinid.setDir(get_dir(target_felinid, targloc)) // kitty always looks at the light
if(prob(effectchance * diode.rating))
//SKYRAT EDIT REMOVAL BEGIN (removes forced felinid movement from laserpointers, also fixes the longstanding windoor negation glitch)
/* if(prob(effectchance * diode.rating))
target_felinid.visible_message(span_warning("[target_felinid] makes a grab for the light!"), span_userdanger("LIGHT!"))
target_felinid.Move(targloc)
log_combat(user, target_felinid, "moved with a laser pointer", src)
else
target_felinid.visible_message(span_notice("[target_felinid] looks briefly distracted by the light."), span_warning("You're briefly tempted by the shiny light..."))
else
SKYRAT EDIT REMOVAL END */
target_felinid.visible_message(span_notice("[target_felinid] looks briefly distracted by the light."), span_warning("You're briefly tempted by the shiny light...")) //SKYRAT EDIT CHANGE : indent this block if re-enabling above
else
target_felinid.visible_message(span_notice("[target_felinid] stares at the light."), span_warning("You stare at the light..."))
//The pointer is shining, change its sprite to show
Expand All @@ -290,9 +292,9 @@
laser.pixel_y = target.pixel_y + rand(-5,5)

if(outmsg)
to_chat(user, outmsg)
user.visible_message(span_danger("[user] points [src] at [target]!"), outmsg) //SKYRAT EDIT CHANGE - ORIGINAL: to_chat(user, outmsg)
else
to_chat(user, span_info("You point [src] at [target]."))
user.visible_message(span_notice("[user] points [src] at [target]."), span_notice("You point [src] at [target].")) //SKYRAT EDIT CHANGE - ORIGINAL: to_chat(user, span_info("You point [src] at [target]."))

//we have successfully shone our pointer, reduce our battery depending on whether we have an extra lens or not
energy -= crystal_lens ? 2 : 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/obj/item/laser_pointer
//Whether the laser pointer is capable of receiving upgrades
var/upgradable = TRUE

/obj/item/laser_pointer/limited
//limited laser pointers cannot receive upgrades, mostly used in loadout
upgradable = FALSE

/obj/item/laser_pointer/limited/red
pointer_icon_state = "red_laser"

/obj/item/laser_pointer/limited/green
pointer_icon_state = "green_laser"

/obj/item/laser_pointer/limited/blue
pointer_icon_state = "blue_laser"

/obj/item/laser_pointer/limited/purple
pointer_icon_state = "purple_laser"

/obj/item/laser_pointer/screwdriver_act(mob/living/user, obj/item/tool)
if(!upgradable)
balloon_alert(user, "can't remove integrated diode!")
return
return ..()

/obj/item/laser_pointer/attackby(obj/item/attack_item, mob/user, params)
if(istype(attack_item, /obj/item/stock_parts/micro_laser) || istype(attack_item, /obj/item/stack/ore/bluespace_crystal))
if(!upgradable)
balloon_alert(user, "can't upgrade integrated parts!")
return
return ..()

/obj/item/laser_pointer/examine(mob/user)
. = ..()
if(!upgradable)
. += span_notice("The diode and the lens are both cheap, integrated components. This pointer cannot be upgraded.")
Original file line number Diff line number Diff line change
Expand Up @@ -406,16 +406,16 @@ GLOBAL_LIST_INIT(loadout_toys, generate_loadout_items(/datum/loadout_item/toys))

/datum/loadout_item/toys/red_laser
name = "Red Laser Pointer"
item_path = /obj/item/laser_pointer/red
item_path = /obj/item/laser_pointer/limited/red

/datum/loadout_item/toys/green_laser
name = "Green Laser Pointer"
item_path = /obj/item/laser_pointer/green
item_path = /obj/item/laser_pointer/limited/green

/datum/loadout_item/toys/blue_laser
name = "Blue Laser Pointer"
item_path = /obj/item/laser_pointer/blue
item_path = /obj/item/laser_pointer/limited/blue

/datum/loadout_item/toys/purple_laser
name = "Purple Laser Pointer"
item_path = /obj/item/laser_pointer/purple
item_path = /obj/item/laser_pointer/limited/purple
2 changes: 1 addition & 1 deletion modular_skyrat/modules/modular_vending/code/games.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon" = "hat-wizard",
"products" = list(
/obj/item/storage/briefcase/secure/white/wargame_kit = 3,
/obj/item/laser_pointer = 3,
/obj/item/laser_pointer/limited = 3,
),
),
list(
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6205,6 +6205,7 @@
#include "modular_skyrat\master_files\code\game\objects\items\wiki_manuals.dm"
#include "modular_skyrat\master_files\code\game\objects\items\devices\anomaly_neutralizer.dm"
#include "modular_skyrat\master_files\code\game\objects\items\devices\chameleonproj.dm"
#include "modular_skyrat\master_files\code\game\objects\items\devices\laserpointer.dm"
#include "modular_skyrat\master_files\code\game\objects\items\devices\mod_link.dm"
#include "modular_skyrat\master_files\code\game\objects\items\devices\traitordevices.dm"
#include "modular_skyrat\master_files\code\game\objects\items\stacks\sheets\sheet_types.dm"
Expand Down

0 comments on commit 6801cdd

Please sign in to comment.