mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
Screwdriver Pen (#70467)
* base * bam * icon and element fix * terminate * Update code/modules/paperwork/pen.dm * Update code/modules/paperwork/pen.dm * sigh * Update code/_globalvars/lists/maintenance_loot.dm Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> * Update code/modules/paperwork/pen.dm Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com> * Update code/modules/paperwork/pen.dm Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> * factoring * escapism * balloon notif * bottom vars * Update code/modules/paperwork/pen.dm * Update code/modules/paperwork/pen.dm * Apply suggestions from code review * updates the sprite to be based on new pen icon * pushes the comsig call to an attack_self * Update code/modules/paperwork/pen.dm * Update code/modules/paperwork/pen.dm * imagos icon Co-authored-by: etherware-novice <candy@notarealaddr.com> Co-authored-by: ShizCalev <ShizCalev@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com> Co-authored-by: Candycaneannihalator <candycane@thisisnotarealaddr.com>
This commit is contained in:
co-authored by
MrMelbert
ShizCalev
Fikou
etherware-novice
Candycaneannihalator
parent
cbb7f14e53
commit
e056997093
@@ -188,6 +188,7 @@ GLOBAL_LIST_INIT(uncommon_loot, list(//uncommon: useful items
|
||||
/obj/item/clothing/suit/armor/vest/old = 1,
|
||||
/obj/item/storage/belt/medical = 1,
|
||||
/obj/item/storage/belt/utility = 1,
|
||||
/obj/item/pen/screwdriver = 1,
|
||||
) = 8,
|
||||
|
||||
list(//strange objects
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
if(is_type_in_list(W, contained_item))
|
||||
if(W.w_class >= WEIGHT_CLASS_SMALL) // Anything equal to or larger than small won't work
|
||||
user.balloon_alert(user, "too big!")
|
||||
return
|
||||
if(inserted_item)
|
||||
to_chat(user, span_warning("There is already \a [inserted_item] in \the [src]!"))
|
||||
|
||||
@@ -339,3 +339,53 @@
|
||||
force = 5
|
||||
wound_bonus = 100
|
||||
demolition_mod = 9000
|
||||
|
||||
// screwdriver pen!
|
||||
|
||||
/obj/item/pen/screwdriver
|
||||
desc = "A pen with an extendable screwdriver tip. This one has a yellow cap."
|
||||
icon_state = "pendriver"
|
||||
toolspeed = 1.2 // gotta have some downside
|
||||
/// whether the pen is extended
|
||||
var/extended = FALSE
|
||||
|
||||
/obj/item/pen/screwdriver/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/transforming, \
|
||||
throwforce_on = 5, \
|
||||
w_class_on = WEIGHT_CLASS_SMALL, \
|
||||
sharpness_on = TRUE)
|
||||
|
||||
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, .proc/toggle_screwdriver)
|
||||
AddElement(/datum/element/update_icon_updates_onmob)
|
||||
|
||||
|
||||
/obj/item/pen/screwdriver/vv_edit_var(var_name, var_value)
|
||||
if(var_name == NAMEOF(src, extended))
|
||||
if(var_value != extended)
|
||||
var/datum/component/transforming/transforming_comp = GetComponent(/datum/component/transforming)
|
||||
transforming_comp.on_attack_self(src)
|
||||
datum_flags |= DF_VAR_EDITED
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/pen/screwdriver/proc/toggle_screwdriver(mob/user, active)
|
||||
SIGNAL_HANDLER
|
||||
extended = active
|
||||
if(user)
|
||||
balloon_alert(user, "[extended ? "extended" : "retracted"]!")
|
||||
|
||||
if(!extended)
|
||||
tool_behaviour = initial(tool_behaviour)
|
||||
RemoveElement(/datum/element/eyestab)
|
||||
else
|
||||
tool_behaviour = TOOL_SCREWDRIVER
|
||||
AddElement(/datum/element/eyestab)
|
||||
|
||||
update_appearance(UPDATE_ICON)
|
||||
return COMPONENT_NO_DEFAULT_MESSAGE
|
||||
|
||||
/obj/item/pen/screwdriver/update_icon_state()
|
||||
. = ..()
|
||||
icon_state = "[initial(icon_state)][extended ? "_out":null]"
|
||||
inhand_icon_state = initial(inhand_icon_state) //since transforming component switches the icon.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 25 KiB |
Reference in New Issue
Block a user