Merge pull request #13535 from Hatterhat/energy-sabres

[READY] Energy Sabers - an elegant esword skin for a more civilized age
This commit is contained in:
silicons
2020-10-10 22:04:17 -07:00
committed by GitHub
9 changed files with 120 additions and 32 deletions
+1 -1
View File
@@ -318,4 +318,4 @@ GLOBAL_LIST_EMPTY(radial_menus)
if(istype(custom_check))
if(!custom_check.Invoke())
return
return answer
return answer
+6 -6
View File
@@ -4,7 +4,7 @@
/obj/item/defibrillator
name = "defibrillator"
desc = "A device that delivers powerful shocks to detachable paddles that resuscitate incapacitated patients."
icon = 'icons/obj/items_and_weapons.dmi'
icon = 'icons/obj/defibrillators.dmi'
icon_state = "defibunit"
item_state = "defibunit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
@@ -23,8 +23,8 @@
var/obj/item/stock_parts/cell/cell
var/combat = FALSE //can we revive through space suits?
var/grab_ghost = FALSE // Do we pull the ghost back into their body?
var/healdisk = FALSE // Will we shock people dragging the body?
var/pullshocksafely = FALSE //Dose the unit have the healdisk upgrade?
var/healdisk = FALSE // Does the unit have the healdisk upgrade?
var/pullshocksafely = FALSE // Will we shock people dragging the body?
var/primetime = 0 // is the defib faster
var/timedeath = 10
var/disarm_shock_time = 10
@@ -261,7 +261,7 @@
/obj/item/shockpaddles
name = "defibrillator paddles"
desc = "A pair of plastic-gripped paddles with flat metal surfaces that are used to deliver powerful electric shocks."
icon = 'icons/obj/items_and_weapons.dmi'
icon = 'icons/obj/defibrillators.dmi'
icon_state = "defibpaddles0"
item_state = "defibpaddles0"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
@@ -682,7 +682,7 @@
/obj/item/shockpaddles/cyborg
name = "cyborg defibrillator paddles"
icon = 'icons/obj/items_and_weapons.dmi'
icon = 'icons/obj/defibrillators.dmi'
icon_state = "defibpaddles0"
item_state = "defibpaddles0"
req_defib = FALSE
@@ -703,7 +703,7 @@
name = "syndicate defibrillator paddles"
desc = "A pair of paddles used to revive deceased operatives. It possesses both the ability to penetrate armor and to deliver powerful shocks offensively."
combat = TRUE
icon = 'icons/obj/items_and_weapons.dmi'
icon = 'icons/obj/defibrillators.dmi'
icon_state = "defibpaddles0"
item_state = "defibpaddles0"
req_defib = FALSE
+82 -12
View File
@@ -190,12 +190,53 @@
/obj/item/melee/transforming/energy/sword/saber
possible_colors = list("red" = LIGHT_COLOR_RED, "blue" = LIGHT_COLOR_LIGHT_CYAN, "green" = LIGHT_COLOR_GREEN, "purple" = LIGHT_COLOR_LAVENDER)
unique_reskin = list("Sword" = "sword0", "saber" = "esaber0")
var/hacked = FALSE
var/saber = FALSE
/obj/item/melee/transforming/energy/sword/saber/set_sword_color()
if(LAZYLEN(possible_colors))
/obj/item/melee/transforming/energy/sword/saber/transform_weapon(mob/living/user, supress_message_text)
. = ..()
if(.)
if(active)
if(sword_color)
if(saber)
icon_state = "esaber[sword_color]"
else
icon_state = "sword[sword_color]"
else
if(saber)
icon_state = "esaber0"
else
icon_state = "sword0"
/obj/item/melee/transforming/energy/sword/saber/reskin_obj(mob/M)
. = ..()
if(icon_state == "esaber0")
saber = TRUE
if(active)
if(saber)
icon_state = "esaber[sword_color]"
else
icon_state = "sword[sword_color]"
/obj/item/melee/transforming/energy/sword/saber/set_sword_color(var/color_forced)
if(color_forced) // wow i really do not like this at fucking all holy SHIT
if(color_forced == "red")
sword_color = "red"
light_color = LIGHT_COLOR_RED
else if(color_forced == "blue")
sword_color = "blue"
light_color = LIGHT_COLOR_LIGHT_CYAN
else if(color_forced == "green")
sword_color = "green"
light_color = LIGHT_COLOR_GREEN
else if(color_forced == "purple")
sword_color = "purple"
light_color = LIGHT_COLOR_LAVENDER
else if(LAZYLEN(possible_colors))
sword_color = pick(possible_colors)
light_color = possible_colors[sword_color]
return
/obj/item/melee/transforming/energy/sword/saber/process()
. = ..()
@@ -204,30 +245,59 @@
light_color = possible_colors[set_color]
update_light()
/obj/item/melee/transforming/energy/sword/saber/red
possible_colors = list("red" = LIGHT_COLOR_RED)
/obj/item/melee/transforming/energy/sword/saber/red/Initialize(mapload)
. = ..()
set_sword_color("red")
/obj/item/melee/transforming/energy/sword/saber/blue
possible_colors = list("blue" = LIGHT_COLOR_LIGHT_CYAN)
/obj/item/melee/transforming/energy/sword/saber/blue/Initialize(mapload)
. = ..()
set_sword_color("blue")
/obj/item/melee/transforming/energy/sword/saber/green
possible_colors = list("green" = LIGHT_COLOR_GREEN)
/obj/item/melee/transforming/energy/sword/saber/green/Initialize(mapload)
. = ..()
set_sword_color("green")
/obj/item/melee/transforming/energy/sword/saber/purple
possible_colors = list("purple" = LIGHT_COLOR_LAVENDER)
/obj/item/melee/transforming/energy/sword/saber/purple/Initialize(mapload)
. = ..()
set_sword_color("purple")
/obj/item/melee/transforming/energy/sword/saber/proc/select_sword_color(mob/user) /// this is for the radial
if(!istype(user) || user.incapacitated())
return
var/static/list/options = list(
"red" = image(icon = 'icons/obj/items_and_weapons.dmi', icon_state = "swordred-blade"),
"blue" = image(icon = 'icons/obj/items_and_weapons.dmi', icon_state = "swordblue-blade"),
"green" = image(icon = 'icons/obj/items_and_weapons.dmi', icon_state = "swordgreen-blade"),
"purple" = image(icon = 'icons/obj/items_and_weapons.dmi', icon_state = "swordpurple-blade")
)
var/choice = show_radial_menu(user, src, options, custom_check = FALSE, radius = 36, require_near = TRUE)
if(src && choice && !user.incapacitated() && in_range(user,src))
set_sword_color(choice)
to_chat(user, "<span class='notice'>[src] is now [choice].</span>")
/obj/item/melee/transforming/energy/sword/saber/attackby(obj/item/W, mob/living/user, params)
if(istype(W, /obj/item/multitool))
if(user.a_intent == INTENT_DISARM)
if(!active)
to_chat(user, "<span class='warning'>COLOR_SET</span>")
hacked = FALSE
select_sword_color(user)
return
else
to_chat(user, "<span class='notice'>Turn it off first - getting that close to an active sword is not a great idea.</span>")
return
if(!hacked)
hacked = TRUE
sword_color = "rainbow"
to_chat(user, "<span class='warning'>RNBW_ENGAGE</span>")
if(active)
icon_state = "swordrainbow"
user.update_inv_hands()
else
to_chat(user, "<span class='warning'>It's already fabulous!</span>")
to_chat(user, "<span class='warning'>It's already fabulous!</span> <span class='notice'>If you wanted to reset the color, though, try a disarming intent while it's off.</span>")
else
return ..()
+29 -11
View File
@@ -304,18 +304,36 @@
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/list/skins = list()
for(var/S in unique_reskin)
skins[S] = image(icon = icon, icon_state = unique_reskin[S])
var/choice = show_radial_menu(M, src, skins, custom_check = CALLBACK(src, .proc/check_skinnable, M), radius = 40, require_near = TRUE)
if(!choice)
return FALSE
icon_state = unique_reskin[choice]
current_skin = choice
return
/obj/proc/check_skinnable(/mob/M)
if(current_skin || !always_reskinnable)
var/list/items = list()
for(var/reskin_option in unique_reskin)
var/image/item_image = image(icon = src.icon, icon_state = unique_reskin[reskin_option])
items += list("[reskin_option]" = item_image)
sortList(items)
var/pick = show_radial_menu(M, src, items, custom_check = CALLBACK(src, .proc/check_reskin_menu, M), radius = 38, require_near = TRUE)
if(!pick)
return
if(!unique_reskin[pick])
return
current_skin = pick
icon_state = unique_reskin[pick]
to_chat(M, "[src] is now skinned as '[pick].'")
/**
* Checks if we are allowed to interact with a radial menu for reskins
*
* Arguments:
* * user The mob interacting with the menu
*/
/obj/proc/check_reskin_menu(mob/user)
if(QDELETED(src))
return FALSE
if(current_skin)
return FALSE
if(!istype(user))
return FALSE
if(user.incapacitated())
return FALSE
return TRUE
+2 -2
View File
@@ -355,7 +355,7 @@
/obj/item/clothing/mask/paper/Initialize(mapload)
.=..()
. = ..()
papermask_designs = list(
"Blank" = image(icon = src.icon, icon_state = "plainmask"),
"Neutral" = image(icon = src.icon, icon_state = "neutralmask"),
@@ -384,7 +384,7 @@
"Vertical" = "verticalmask", "Horizontal" = "horizontalmask", "X" ="xmask",
"Bugeyes" = "bugmask", "Double" = "doublemask", "Mark" = "markmask")
var/choice = show_radial_menu(user,src, papermask_designs, custom_check = FALSE, radius = 36, require_near = TRUE)
var/choice = show_radial_menu(user, src, papermask_designs, custom_check = FALSE, radius = 36, require_near = TRUE)
if(src && choice && !user.incapacitated() && in_range(user,src))
icon_state = options[choice]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 124 KiB