Ports tgstation/tgstation/pull/15673 (#16495)

* Ports tgstation/tgstation/pull/15673

* Add a small delay to icon updating to cover up SSoverlays

* Fix actions on robot modules
This commit is contained in:
ShadowLarkens
2024-10-20 17:12:24 +02:00
committed by GitHub
parent 37891ba647
commit bcc107c7cd
67 changed files with 562 additions and 384 deletions
+1 -7
View File
@@ -1,10 +1,4 @@
#define AB_CHECK_RESTRAINED 1
#define AB_CHECK_STUNNED 2
#define AB_CHECK_LYING 4
#define AB_CHECK_ALIVE 8
#define AB_CHECK_INSIDE 16
#define AB_ITEM 1
#define AB_SPELL 2
#define AB_INNATE 3
#define AB_GENERIC 4
#define AB_CHECK_CONSCIOUS 8
+97 -142
View File
@@ -1,20 +1,19 @@
/datum/action
var/name = "Generic Action"
var/action_type = AB_ITEM
var/procname = null
var/atom/movable/target = null
var/check_flags = 0
var/processing = 0
var/active = 0
var/obj/screen/movable/action_button/button = null
var/button_icon = 'icons/mob/actions.dmi'
var/button_icon_state = "default"
var/background_icon_state = "bg_default"
var/mob/living/owner
/datum/action/New(var/Target)
/datum/action/New(Target)
target = Target
button = new
button.linked_action = src
button.name = name
/datum/action/Destroy()
if(owner)
@@ -23,64 +22,34 @@
QDEL_NULL(button)
return ..()
/datum/action/proc/Grant(mob/living/T)
/datum/action/proc/Grant(mob/living/L)
if(owner)
if(owner == T)
if(owner == L)
return
Remove(owner)
owner = T
owner.actions.Add(src)
owner.update_action_buttons()
return
owner = L
L.actions += src
if(L.client)
L.client.screen += button
L.update_action_buttons(TRUE)
/datum/action/proc/Remove(mob/living/T)
if(button)
if(T.client)
T.client.screen -= button
QDEL_NULL(button)
T.actions.Remove(src)
T.update_action_buttons()
/datum/action/proc/Remove(mob/living/L)
if(L.client)
L.client.screen -= button
button.moved = FALSE
L.actions -= src
L.update_action_buttons(TRUE)
owner = null
return
/datum/action/proc/Trigger()
if(!Checks())
return
switch(action_type)
if(AB_ITEM)
if(target)
var/obj/item/item = target
item.ui_action_click()
//if(AB_SPELL)
// if(target)
// var/obj/effect/proc_holder/spell = target
// spell.Click()
if(AB_INNATE)
if(!active)
Activate()
else
Deactivate()
if(AB_GENERIC)
if(target && procname)
call(target,procname)(usr)
return
/datum/action/proc/Activate()
return
/datum/action/proc/Deactivate()
return
if(!IsAvailable())
return 0
return 1
/datum/action/process()
return
/datum/action/proc/CheckRemoval(mob/living/user) // 1 if action is no longer valid for this mob and should be removed
return 0
/datum/action/proc/IsAvailable()
return Checks()
/datum/action/proc/Checks()// returns 1 if all checks pass
if(!owner)
return 0
if(check_flags & AB_CHECK_RESTRAINED)
@@ -92,110 +61,96 @@
if(check_flags & AB_CHECK_LYING)
if(owner.lying)
return 0
if(check_flags & AB_CHECK_ALIVE)
if(check_flags & AB_CHECK_CONSCIOUS)
if(owner.stat)
return 0
if(check_flags & AB_CHECK_INSIDE)
if(!(target in owner))
return 0
return 1
/datum/action/proc/UpdateName()
return name
/datum/action/proc/UpdateButtonIcon()
if(button)
button.icon = button_icon
button.icon_state = background_icon_state
//This is the proc used to update all the action buttons. Properly defined in /mob/living/
/mob/proc/update_action_buttons()
return
ApplyIcon(button)
/mob/living/update_action_buttons()
if(!hud_used) return
if(!client) return
if(!IsAvailable())
button.color = rgb(128, 0, 0, 128)
else
button.color = rgb(255, 255, 255, 255)
return 1
if(hud_used.hud_shown != 1) //Hud toggled to minimal
return
client.screen -= hud_used.hide_actions_toggle
for(var/datum/action/A in actions)
if(A.button)
client.screen -= A.button
if(hud_used.action_buttons_hidden)
if(!hud_used.hide_actions_toggle)
hud_used.hide_actions_toggle = new(hud_used)
hud_used.hide_actions_toggle.UpdateIcon()
if(!hud_used.hide_actions_toggle.moved)
hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1)
//hud_used.SetButtonCoords(hud_used.hide_actions_toggle,1)
client.screen += hud_used.hide_actions_toggle
return
var/button_number = 0
for(var/datum/action/A in actions)
button_number++
if(A.button == null)
var/obj/screen/movable/action_button/N = new(hud_used)
N.owner = A
A.button = N
var/obj/screen/movable/action_button/B = A.button
B.UpdateIcon()
B.name = A.UpdateName()
client.screen += B
if(!B.moved)
B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number)
//hud_used.SetButtonCoords(B,button_number)
if(button_number > 0)
if(!hud_used.hide_actions_toggle)
hud_used.hide_actions_toggle = new(hud_used)
hud_used.hide_actions_toggle.InitialiseIcon(src)
if(!hud_used.hide_actions_toggle.moved)
hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1)
//hud_used.SetButtonCoords(hud_used.hide_actions_toggle,button_number+1)
client.screen += hud_used.hide_actions_toggle
#define AB_WEST_OFFSET 4
#define AB_NORTH_OFFSET 26
#define AB_MAX_COLUMNS 10
/datum/hud/proc/ButtonNumberToScreenCoords(var/number) // TODO : Make this zero-indexed for readabilty
var/row = round((number-1)/AB_MAX_COLUMNS)
var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1
var/coord_col = "+[col-1]"
var/coord_col_offset = AB_WEST_OFFSET+2*col
var/coord_row = "[-1 - row]"
var/coord_row_offset = AB_NORTH_OFFSET
return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:[coord_row_offset]"
/datum/hud/proc/SetButtonCoords(var/obj/screen/button,var/number)
var/row = round((number-1)/AB_MAX_COLUMNS)
var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1
var/x_offset = 32*(col-1) + AB_WEST_OFFSET + 2*col
var/y_offset = -32*(row+1) + AB_NORTH_OFFSET
var/matrix/M = matrix()
M.Translate(x_offset,y_offset)
button.transform = M
/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.cut_overlays()
if(button_icon && button_icon_state)
var/image/img
img = image(button_icon, current_button, button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
current_button.add_overlay(img)
//Presets for item actions
/datum/action/item_action
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_ALIVE|AB_CHECK_INSIDE
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
/datum/action/item_action/CheckRemoval(mob/living/user)
return !(target in user)
/datum/action/item_action/New(Target)
. = ..()
var/obj/item/I = target
I.actions += src
/datum/action/item_action/Destroy()
var/obj/item/I = target
I.actions -= src
return ..()
/datum/action/item_action/Trigger()
if(!..())
return 0
if(target)
var/obj/item/I = target
I.ui_action_click(owner, src.type)
return 1
/datum/action/item_action/ApplyIcon(obj/screen/movable/action_button/current_button)
current_button.cut_overlays()
if(target)
var/mutable_appearance/ma = new(target.appearance)
ma.plane = FLOAT_PLANE
ma.layer = FLOAT_LAYER
ma.pixel_x = 0
ma.pixel_y = 0
current_button.add_overlay(ma)
/datum/action/item_action/hands_free
check_flags = AB_CHECK_ALIVE|AB_CHECK_INSIDE
check_flags = AB_CHECK_CONSCIOUS
#undef AB_WEST_OFFSET
#undef AB_NORTH_OFFSET
#undef AB_MAX_COLUMNS
/datum/action/innate
action_type = AB_INNATE
check_flags = 0
var/active = 0
/datum/action/innate/Trigger()
if(!..())
return 0
if(!active)
Activate()
else
Deactivate()
return 1
/datum/action/innate/proc/Activate()
return
/datum/action/innate/proc/Deactivate()
return
//Preset for action that call specific procs (consider innate).
/datum/action/generic
check_flags = 0
var/procname
/datum/action/generic/Trigger()
if(!..())
return 0
if(target && procname)
call(target, procname)(usr)
return 1
@@ -1,41 +1,18 @@
/obj/screen/movable/action_button
var/datum/action/owner
screen_loc = "WEST,NORTH"
var/datum/action/linked_action
screen_loc = null
/obj/screen/movable/action_button/Click(location,control,params)
var/list/modifiers = params2list(params)
if(modifiers["shift"])
moved = FALSE
owner?.owner?.update_action_buttons()
usr.update_action_buttons()
return 1
if(!usr.checkClickCooldown())
return
owner.Trigger()
linked_action.Trigger()
return 1
/obj/screen/movable/action_button/proc/UpdateIcon()
if(!owner)
return
icon = owner.button_icon
icon_state = owner.background_icon_state
cut_overlays()
var/image/img
if(owner.action_type == AB_ITEM && owner.target)
var/obj/item/I = owner.target
img = image(I.icon, src , I.icon_state)
else if(owner.button_icon && owner.button_icon_state)
img = image(owner.button_icon,src,owner.button_icon_state)
img.pixel_x = 0
img.pixel_y = 0
add_overlay(img)
if(!owner.IsAvailable())
color = rgb(128,0,0,128)
else
color = rgb(255,255,255,255)
//Hide/Show Action Buttons ... Button
/obj/screen/movable/action_button/hide_toggle
name = "Hide Buttons"
@@ -60,10 +37,96 @@
else
icon_state = "bg_default"
UpdateIcon()
/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon()
cut_overlays()
var/image/img = image(icon, src, hidden ? "show" : "hide")
add_overlay(img)
/obj/screen/movable/action_button/MouseEntered(location, control, params)
openToolTip(usr, src, params, title = name, content = desc)
/obj/screen/movable/action_button/MouseExited(location, control, params)
closeToolTip(usr)
//used to update the buttons icon.
/mob/proc/update_action_buttons_icon()
return
/obj/screen/movable/action_button/hide_toggle/UpdateIcon()
cut_overlays()
var/image/img = image(icon,src,hidden?"show":"hide")
add_overlay(img)
/mob/living/update_action_buttons_icon()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
//This is the proc used to update all the action buttons. Properly defined in /mob/living/
/mob/proc/update_action_buttons(reload_screen)
return
/mob/living/update_action_buttons(reload_screen)
if(!hud_used || !client)
return
if(!hud_used.hud_shown) //Hud toggled to minimal
return
var/button_number = 0
if(hud_used.action_buttons_hidden)
for(var/datum/action/A in actions)
A.button.screen_loc = null
if(reload_screen)
client.screen += A.button
else
for(var/datum/action/A in actions)
button_number++
A.UpdateButtonIcon()
var/obj/screen/movable/action_button/B = A.button
if(!B.moved)
B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number)
else
B.screen_loc = B.moved
if(reload_screen)
client.screen += B
if(!button_number)
hud_used.hide_actions_toggle?.screen_loc = null
return
// not exactly sure how this happens but it does
if(hud_used.hide_actions_toggle)
if(!hud_used.hide_actions_toggle.moved)
hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1)
else
hud_used.hide_actions_toggle.screen_loc = hud_used.hide_actions_toggle.moved
if(reload_screen)
client.screen += hud_used.hide_actions_toggle
#define AB_WEST_OFFSET 4
#define AB_NORTH_OFFSET 26
#define AB_MAX_COLUMNS 10
/datum/hud/proc/ButtonNumberToScreenCoords(var/number) // TODO : Make this zero-indexed for readabilty
var/row = round((number-1)/AB_MAX_COLUMNS)
var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1
var/coord_col = "+[col-1]"
var/coord_col_offset = AB_WEST_OFFSET+2*col
var/coord_row = "[-1 - row]"
var/coord_row_offset = AB_NORTH_OFFSET
return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:[coord_row_offset]"
/datum/hud/proc/SetButtonCoords(var/obj/screen/button,var/number)
var/row = round((number-1)/AB_MAX_COLUMNS)
var/col = ((number - 1)%(AB_MAX_COLUMNS)) + 1
var/x_offset = 32*(col-1) + AB_WEST_OFFSET + 2*col
var/y_offset = -32*(row+1) + AB_NORTH_OFFSET
var/matrix/M = matrix()
M.Translate(x_offset,y_offset)
button.transform = M
#undef AB_WEST_OFFSET
#undef AB_NORTH_OFFSET
#undef AB_MAX_COLUMNS
+161
View File
@@ -0,0 +1,161 @@
// Generic Classes
/datum/action/item_action/activate
/datum/action/item_action/activate/New(Target, name)
. = ..()
src.name = name
button.name = name
// Specific names
/datum/action/item_action/toggle_grippers
name = "Toggle Grippers"
/datum/action/item_action/toggle_talons
name = "Toggle Talons"
/datum/action/item_action/toggle_goggles
name = "Toggle Goggles"
/datum/action/item_action/toggle_shield_projector
name = "Toggle Shield Projector"
/datum/action/item_action/toggle_tesla_armor
name = "Toggle Tesla Armor"
/datum/action/item_action/remove_replace_paddles
name = "Remove/Replace Paddles"
/datum/action/item_action/toggle_flashlight
name = "Toggle Flashlight"
/datum/action/item_action/toggle_shield
name = "Toggle Shield"
/datum/action/item_action/toggle_heatsink
name = "Toggle Heatsink"
/datum/action/item_action/remove_replace_handset
name = "Remove/Replace Handset"
/datum/action/item_action/command
name = "Command"
/datum/action/item_action/toggle_jetpack
name = "Toggle Jetpack"
/datum/action/item_action/toggle_cataloguer
name = "Toggle Cataloguer"
/datum/action/item_action/toggle_eyepatch
name = "Toggle Eyepatch"
/datum/action/item_action/hands_free/change_scanning_pattern
name = "Change Scanning Pattern"
/datum/action/item_action/toggle_hud
name = "Toggle HUD"
/datum/action/item_action/toggle_mode
name = "Toggle Mode"
/datum/action/item_action/flip_welding_goggles
name = "Flip Welding Goggles"
/datum/action/item_action/toggle_monocle
name = "Toggle Monocle"
/datum/action/item_action/adjust_orange_goggles
name = "Adjust Orange Goggles"
/datum/action/item_action/ar_console_crew
name = "AR Console (Crew Monitor)"
/datum/action/item_action/ar_console_security_alerts
name = "AR Console (Security Alerts)"
/datum/action/item_action/ar_console_station_alerts
name = "AR Console (Station Alerts)"
/datum/action/item_action/ar_console_all_alerts
name = "AR Console (All Alerts)"
/datum/action/item_action/toggle_head_light
name = "Toggle Head-light"
/datum/action/item_action/toggle_visor
name = "Toggle Visor"
/datum/action/item_action/flip_welding_mask
name = "Flip Welding Mask"
/datum/action/item_action/adjust_breath_mask
name = "Adjust Breath Mask"
/datum/action/item_action/toggle_feeding_port
name = "Toggle Feeding Port"
/datum/action/item_action/halt
name = "HALT!"
/datum/action/item_action/hands_free/redraw_design
name = "Redraw Design"
/datum/action/item_action/toggle_magboots
name = "Toggle Magboots"
/datum/action/item_action/toggle_magclaws
name = "Toggle Magclaws"
/datum/action/item_action/activate_jump_boots
name = "Activate Jump Boots"
/datum/action/item_action/toggle_helmet_light
name = "Toggle Helmet Light"
/datum/action/item_action/hardsuit_interface
name = "Hardsuit Interface"
/datum/action/item_action/toggle_helmet
name = "Toggle Helmet"
/datum/action/item_action/toggle_knight_headgear
name = "Toggle Knight Headgear"
/datum/action/item_action/toggle_hood
name = "Toggle Hood"
/datum/action/item_action/adjust_cloak
name = "Adjust Cloak"
/datum/action/item_action/adjust_poncho
name = "Adjust Poncho"
/datum/action/item_action/pull_on_gaiter
name = "Pull On Gaiter"
/datum/action/item_action/toggle_uv_light
name = "Toggle UV Light"
/datum/action/item_action/toggle_light
name = "Toggle Light"
/datum/action/item_action/use_scope
name = "Use Scope"
/datum/action/item_action/aim_down_sights
name = "Aim Down Sights"
/datum/action/item_action/toggle_gunlight
name = "Toggle Gun-light"
/datum/action/item_action/toggle_internal_generator
name = "Toggle Internal Generator"
/datum/action/item_action/toggle_stock
name = "Toggle Stock"
/datum/action/item_action/toggle_pom_pom
name = "Toggle Pom-Pom"
/datum/action/item_action/toggle_mlembulance
name = "Toggle Mlembulance Mode"
+7 -3
View File
@@ -207,6 +207,7 @@ var/list/global_huds = list(
/datum/hud/Destroy()
. = ..()
QDEL_NULL_LIST(minihuds)
QDEL_NULL(hide_actions_toggle)
grab_intent = null
hurt_intent = null
disarm_intent = null
@@ -322,10 +323,12 @@ var/list/global_huds = list(
return 0
mymob.create_mob_hud(src)
hide_actions_toggle = new()
hide_actions_toggle.InitialiseIcon(mymob)
persistant_inventory_update()
mymob.reload_fullscreen() // Reload any fullscreen overlays this mob has.
mymob.update_action_buttons()
mymob.update_action_buttons(TRUE)
reorganize_alerts()
/mob/proc/create_mob_hud(datum/hud/HUD, apply_to_client = TRUE)
@@ -404,10 +407,11 @@ var/list/global_huds = list(
hud_used?.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
client.screen += zone_sel //This one is a special snowflake
client.screen += hud_used.hide_actions_toggle
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
update_action_buttons(TRUE)
hud_used.reorganize_alerts()
return TRUE
@@ -467,7 +471,7 @@ var/list/global_huds = list(
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
update_action_buttons(TRUE)
/mob/proc/add_click_catcher()
client.screen += client.void
+1 -1
View File
@@ -28,7 +28,7 @@
return
screen_loc = position
moved = TRUE
moved = screen_loc
/// Takes mouse parmas as input, returns a string representing the appropriate mouse position
/obj/screen/movable/proc/mouse_params_to_position(params)
@@ -67,7 +67,7 @@
desc = "A suction cupped mass of flesh, shaped like a foot."
name = "fleshy grippers"
icon_state = "lingspacesuit"
action_button_name = "Toggle Grippers"
actions_types = list(/datum/action/item_action/toggle_grippers)
canremove = FALSE
/obj/item/clothing/shoes/magboots/changeling/set_slowdown()
@@ -124,7 +124,7 @@
desc = "A tough, hard mass of chitin, with long talons for digging into terrain."
name = "chitinous talons"
icon_state = "lingarmor"
action_button_name = "Toggle Talons"
actions_types = list(/datum/action/item_action/toggle_talons)
/obj/item/clothing/gloves/combat/changeling //Combined insulated/fireproof gloves
name = "chitinous gauntlets"
@@ -18,7 +18,7 @@
blood_overlay_type = "armor"
slowdown = 0
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
action_button_name = "Toggle Shield Projector"
actions_types = list(/datum/action/item_action/toggle_shield_projector)
var/active = 0
var/damage_to_energy_multiplier = 50.0 //Determines how much energy to charge for blocking, e.g. 20 damage attack = 750 energy cost
var/datum/effect/effect/system/spark_spread/spark_system = null
@@ -78,7 +78,7 @@
to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src]."))
update_icon()
user.update_inv_wear_suit()
user.update_action_buttons()
user.update_action_buttons_icon()
/obj/item/clothing/suit/armor/shield/update_icon()
icon_state = "shield_armor_[active]"
@@ -14,7 +14,7 @@
blood_overlay_type = "armor"
slowdown = 0.5
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
action_button_name = "Toggle Tesla Armor"
actions_types = list(/datum/action/item_action/toggle_tesla_armor)
var/active = 1 //Determines if the armor will zap or block
var/ready = 1 //Determines if the next attack will be blocked, as well if a strong lightning bolt is sent out at the attacker.
var/ready_icon_state = "tesla_armor_1" //also wip
@@ -57,7 +57,7 @@
to_chat(user, span_notice("You [active ? "" : "de"]activate \the [src]."))
update_icon()
user.update_inv_wear_suit()
user.update_action_buttons()
user.update_action_buttons_icon()
/obj/item/clothing/suit/armor/tesla/update_icon()
if(active && ready)
@@ -72,7 +72,7 @@
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.update_inv_wear_suit(0)
H.update_action_buttons()
H.update_action_buttons_icon()
..()
/obj/item/clothing/suit/armor/tesla/proc/shoot_lightning(mob/target, power)
@@ -160,7 +160,7 @@
capabilities. The lens appear to be multiple optical matrices layered together, allowing the wearer to see almost anything \
across physical barriers."
icon_state = "uzenwa_sissra_1"
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
origin_tech = list(TECH_MAGNET = 6, TECH_ENGINEERING = 6)
toggleable = 1
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
+18 -14
View File
@@ -62,10 +62,14 @@
//
/datum/action/innate/mecha
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_ALIVE
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS
button_icon = 'icons/effects/actions_mecha.dmi'
var/obj/mecha/chassis
/datum/action/innate/mecha/Destroy()
chassis = null
return ..()
/datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M)
if(M)
chassis = M
@@ -78,7 +82,7 @@
/datum/action/innate/mecha/mech_toggle_lights/Activate()
button_icon_state = "mech_lights_[chassis.lights ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.lights()
@@ -89,7 +93,7 @@
/datum/action/innate/mecha/mech_toggle_internals/Activate()
button_icon_state = "mech_internals_[chassis.use_internal_tank ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.internal_tank()
@@ -118,7 +122,7 @@
/datum/action/innate/mecha/strafe/Activate()
button_icon_state = "mech_strafe_[chassis.strafing ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.strafing()
@@ -129,7 +133,7 @@
/datum/action/innate/mecha/mech_defence_mode/Activate()
button_icon_state = "mech_defense_mode_[chassis.defence_mode ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.defence_mode()
@@ -140,7 +144,7 @@
/datum/action/innate/mecha/mech_overload_mode/Activate()
button_icon_state = "mech_overload_[chassis.overload ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.overload()
@@ -151,7 +155,7 @@
/datum/action/innate/mecha/mech_smoke/Activate()
//button_icon_state = "mech_smoke_[chassis.smoke ? "off" : "on"]"
//button.UpdateIcon() //Dual colors notneeded ATM
//UpdateButtonIcon() //Dual colors notneeded ATM
chassis.smoke()
@@ -162,7 +166,7 @@
/datum/action/innate/mecha/mech_zoom/Activate()
button_icon_state = "mech_zoom_[chassis.zoom ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.zoom()
@@ -173,7 +177,7 @@
/datum/action/innate/mecha/mech_toggle_thrusters/Activate()
button_icon_state = "mech_thrusters_[chassis.thrusters ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.thrusters()
@@ -198,7 +202,7 @@
chassis.occupant_message("You select [chassis.selected]")
send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list())
button_icon_state = "mech_cycle_equip_on"
button.UpdateIcon()
UpdateButtonIcon()
return
var/number = 0
for(var/A in available_equipment)
@@ -213,7 +217,7 @@
chassis.occupant_message("You switch to [chassis.selected]")
button_icon_state = "mech_cycle_equip_on"
send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list())
button.UpdateIcon()
UpdateButtonIcon()
return
@@ -228,7 +232,7 @@
button_icon_state = "mech_damtype_[chassis.damtype]"
playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1)
button.UpdateIcon()
UpdateButtonIcon()
chassis.query_damtype()
@@ -239,7 +243,7 @@
/datum/action/innate/mecha/mech_toggle_phasing/Activate()
button_icon_state = "mech_phasing_[chassis.phasing ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.phasing()
@@ -250,7 +254,7 @@
/datum/action/innate/mecha/mech_toggle_cloaking/Activate()
button_icon_state = "mech_phasing_[chassis.cloaked ? "off" : "on"]"
button.UpdateIcon()
UpdateButtonIcon()
chassis.toggle_cloaking()
+22 -7
View File
@@ -35,10 +35,8 @@
var/max_pressure_protection // Set this variable if the item protects its wearer against high pressures below an upper bound. Keep at null to disable protection.
var/min_pressure_protection // Set this variable if the item protects its wearer against low pressures above a lower bound. Keep at null to disable protection. 0 represents protection against hard vacuum.
var/datum/action/item_action/action = null
var/action_button_name //It is also the text which gets displayed on the action button. If not set it defaults to 'Use [name]'. If it's not set, there'll be no button.
var/action_button_is_hands_free = 0 //If 1, bypass the restrained, lying, and stunned checks action buttons normally test for
var/list/actions = list() //list of /datum/action's that this item has.
var/list/actions_types = list() //list of paths of action datums to give to the item on New().
//This flag is used to determine when items in someone's inventory cover others. IE helmets making it so you can't see glasses, etc.
//It should be used purely for appearance. For gameplay effects caused by items covering body parts, use body_parts_covered.
@@ -117,6 +115,8 @@
/obj/item/New()
..()
for(var/path in actions_types)
new path(src)
if(embed_chance < 0)
if(sharp)
embed_chance = max(5, round(force/w_class))
@@ -137,6 +137,8 @@
m.update_inv_r_hand()
m.update_inv_l_hand()
src.loc = null
for(var/X in actions)
qdel(X)
return ..()
// Check if target is reasonable for us to operate on.
@@ -333,6 +335,9 @@
if(zoom)
zoom() //binoculars, scope, etc
appearance_flags &= ~NO_CLIENT_COLOR
for(var/X in actions)
var/datum/action/A = X
A.Remove(user)
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
@@ -358,6 +363,10 @@
// for items that can be placed in multiple slots
// note this isn't called during the initial dressing of a player
/obj/item/proc/equipped(var/mob/user, var/slot)
for(var/X in actions)
var/datum/action/A = X
if(item_action_slot_check(slot, user)) //some items only give their actions buttons when in a specific slot.
A.Grant(user)
hud_layerise()
user.position_hud_item(src,slot)
if(user.client) user.client.screen |= src
@@ -371,6 +380,12 @@
playsound(src, pickup_sound, 20, preference = /datum/preference/toggle/pickup_sounds)
return
//sometimes we only want to grant the item's action if it's equipped in a specific slot.
/obj/item/proc/item_action_slot_check(slot, mob/user)
if(slot == SLOT_BACK || slot == LEGS) //these aren't true slots, so avoid granting actions there
return FALSE
return TRUE
// As above but for items being equipped to an active module on a robot.
/obj/item/proc/equipped_robot(var/mob/user)
return
@@ -534,11 +549,11 @@ var/list/global/slot_flags_enumeration = list(
return
//This proc is executed when someone clicks the on-screen UI button. To make the UI button show, set the 'icon_action_button' to the icon_state of the image of the button in screen1_action.dmi
//This proc is executed when someone clicks the on-screen UI button.
//The default action is attack_self().
//Checks before we get to here are: mob is alive, mob is not restrained, paralyzed, asleep, resting, laying, item is on the mob.
/obj/item/proc/ui_action_click()
attack_self(usr)
/obj/item/proc/ui_action_click(mob/user, actiontype)
attack_self(user)
//RETURN VALUES
//handle_shield should return a positive value to indicate that the attack is blocked and should be prevented.
+2 -2
View File
@@ -15,7 +15,7 @@
w_class = ITEMSIZE_LARGE
unacidable = TRUE
origin_tech = list(TECH_BIO = 4, TECH_POWER = 2)
action_button_name = "Remove/Replace Paddles"
actions_types = list(/datum/action/item_action/remove_replace_paddles)
var/obj/item/shockpaddles/linked/paddles
var/obj/item/cell/bcell = null
@@ -64,7 +64,7 @@
else
add_overlay("[initial(icon_state)]-nocell")
/obj/item/defib_kit/ui_action_click()
/obj/item/defib_kit/ui_action_click(mob/user, actiontype)
toggle_paddles()
/obj/item/defib_kit/attack_hand(mob/user)
@@ -19,7 +19,7 @@
w_class = ITEMSIZE_SMALL
slot_flags = SLOT_BELT
matter = list(MAT_STEEL = 50,MAT_GLASS = 20)
action_button_name = "Toggle Flashlight"
actions_types = list(/datum/action/item_action/toggle_flashlight)
light_system = MOVABLE_LIGHT_DIRECTIONAL
light_range = 4 //luminosity when on
@@ -102,7 +102,7 @@
STOP_PROCESSING(SSobj, src)
playsound(src, 'sound/weapons/empty.ogg', 15, 1, -3) // VOREStation Edit
update_brightness()
user.update_action_buttons()
user.update_action_buttons_icon()
return 1
/obj/item/flashlight/emp_act(severity)
@@ -355,7 +355,7 @@
light_color = LIGHT_COLOR_FLARE
icon_state = "flare"
item_state = "flare"
action_button_name = null //just pull it manually, neckbeard.
actions_types = list() //just pull it manually, neckbeard.
var/fuel = 0
var/on_damage = 7
var/produce_heat = 1500
@@ -26,7 +26,7 @@
w_class = ITEMSIZE_HUGE //It's a giant shield generator!!!
unacidable = TRUE
origin_tech = list(TECH_MATERIAL = 6, TECH_COMBAT = 8, TECH_POWER = 6, TECH_DATA = 4) //These are limited AND high tech. Breaking one of them down is massive.
action_button_name = "Toggle Shield"
actions_types = list(/datum/action/item_action/toggle_shield)
var/obj/item/gun/energy/gun/generator/active_weapon
var/obj/item/cell/device/bcell = null
var/upgraded = 0 // If the PSG has been upgraded by some method or not. Only used for the mining belt ATM.
@@ -138,7 +138,7 @@
bcell.emp_act(severity)
..()
/obj/item/personal_shield_generator/ui_action_click()
/obj/item/personal_shield_generator/ui_action_click(mob/user, actiontype)
toggle_shield()
/obj/item/personal_shield_generator/attack_hand(mob/user)
@@ -10,7 +10,7 @@
throwforce = 6
preserve_item = 1
w_class = ITEMSIZE_LARGE
action_button_name = "Remove/Replace Handset"
actions_types = list(/datum/action/item_action/remove_replace_handset)
var/obj/item/radio/bluespacehandset/linked/handset = /obj/item/radio/bluespacehandset/linked
@@ -23,7 +23,7 @@
. = ..()
QDEL_NULL(handset)
/obj/item/bluespaceradio/ui_action_click()
/obj/item/bluespaceradio/ui_action_click(mob/user, actiontype)
toggle_handset()
/obj/item/bluespaceradio/attack_hand(var/mob/user)
@@ -12,7 +12,7 @@
throwforce = 10.0
throw_speed = 1
throw_range = 4
action_button_name = "Toggle Heatsink"
actions_types = list(/datum/action/item_action/toggle_heatsink)
matter = list(MAT_STEEL = 15000, MAT_GLASS = 3500)
origin_tech = list(TECH_MAGNET = 2, TECH_MATERIAL = 2)
@@ -28,8 +28,8 @@
//TODO: make it heat up the surroundings when not in space
/obj/item/suit_cooling_unit/ui_action_click()
toggle(usr)
/obj/item/suit_cooling_unit/ui_action_click(mob/user, actiontype)
toggle(user)
/obj/item/suit_cooling_unit/Initialize()
. = ..()
@@ -7,7 +7,7 @@
pickup_sound = 'sound/items/pickup/ring.ogg'
throwforce = 0
force = 0
action_button_name = "Command"
actions_types = list(/datum/action/item_action/command)
var/active = FALSE //Is it set up?
var/mob/living/owner //Reference to the owner
@@ -48,7 +48,7 @@
. += span_deptradio("<a href='?src=\ref[bound_mob];vore_prefs=1'>\[Mechanical Vore Preferences\]</a>")
//Command! This lets the owner toggle hostile on AI controlled mobs, or send a silent command message to your bound mob, wherever they may be.
/obj/item/capture_crystal/ui_action_click()
/obj/item/capture_crystal/ui_action_click(mob/user, actiontype)
if(!ismob(loc))
return
var/mob/living/M = src.loc
@@ -67,7 +67,7 @@
to_chat(M, span_notice("\The [bound_mob] is now [AI.hostile ? "hostile" : "passive"]."))
log_admin("[key_name_admin(M)] set [bound_mob] to [AI.hostile].")
else if(bound_mob.client)
var/transmit_msg = tgui_input_text(usr, "What is your command?", "Command")
var/transmit_msg = tgui_input_text(user, "What is your command?", "Command")
if(length(transmit_msg) >= MAX_MESSAGE_LEN)
to_chat(M, span_danger("Your message was TOO LONG!:[transmit_msg]"))
return
@@ -64,7 +64,7 @@
set_light(0)
light_applied = 0
update_icon(user)
user.update_action_buttons()
user.update_action_buttons_icon()
playsound(src, 'sound/weapons/empty.ogg', 15, 1, -3)
/obj/item/shield/riot/explorer/update_icon()
@@ -17,7 +17,7 @@
var/on = 0.0
var/stabilization_on = 0
var/volume_rate = 500 //Needed for borg jetpack transfer
action_button_name = "Toggle Jetpack"
actions_types = list(/datum/action/item_action/toggle_jetpack)
/obj/item/tank/jetpack/New()
..()
@@ -55,7 +55,7 @@
if (ismob(usr))
var/mob/M = usr
M.update_inv_back()
M.update_action_buttons()
M.update_action_buttons_icon()
to_chat(usr, "You toggle the thrusters [on? "on":"off"].")
@@ -81,7 +81,7 @@
fuel.remove(num)
return 1
/obj/item/tank/jetpack/ui_action_click()
/obj/item/tank/jetpack/ui_action_click(mob/user, actiontype)
toggle()
/obj/item/tank/jetpack/void
+3 -3
View File
@@ -326,7 +326,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers)
Alt+click to highlight scannable objects around you."
icon = 'icons/obj/device_vr.dmi'
icon_state = "compact"
action_button_name = "Toggle Cataloguer"
actions_types = list(/datum/action/item_action/toggle_cataloguer)
var/deployed = TRUE
scan_range = 1
toolspeed = 1.2
@@ -346,7 +346,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers)
else
icon_state = initial(icon_state)
/obj/item/cataloguer/compact/ui_action_click()
/obj/item/cataloguer/compact/ui_action_click(mob/user, actiontype)
toggle()
/obj/item/cataloguer/compact/verb/toggle()
@@ -368,7 +368,7 @@ GLOBAL_LIST_EMPTY(all_cataloguers)
if (ismob(usr))
var/mob/M = usr
M.update_action_buttons()
M.update_action_buttons_icon()
/obj/item/cataloguer/compact/afterattack(atom/target, mob/user, proximity_flag)
if(!deployed)
+2 -1
View File
@@ -485,7 +485,8 @@
update_light()
update_icon(user)
user.update_action_buttons()
spawn(10) // FIXME: Remove when SSoverlays stops queueing overlay changes
user.update_action_buttons_icon()
/obj/item/clothing/head/attack_ai(var/mob/user)
if(!mob_wear_hat(user))
+18 -18
View File
@@ -71,7 +71,7 @@ BLIND // can't see anything
tint = initial(tint)
enables_planes = away_planes
away_planes = null
user.update_action_buttons()
user.update_action_buttons_icon()
user.recalculate_vis()
/obj/item/clothing/glasses/attack_self(mob/user)
@@ -91,7 +91,7 @@ BLIND // can't see anything
desc = "Used for seeing walls, floors, and stuff through anything."
icon_state = "meson"
item_state_slots = list(slot_r_hand_str = "meson", slot_l_hand_str = "meson")
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
origin_tech = list(TECH_MAGNET = 2, TECH_ENGINEERING = 2)
toggleable = 1
vision_flags = SEE_TURFS
@@ -111,7 +111,7 @@ BLIND // can't see anything
icon_state = "aviator_eng"
off_state = "aviator"
item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses")
action_button_name = "Toggle HUD"
actions_types = list(/datum/action/item_action/toggle_hud)
activation_sound = 'sound/effects/pop.ogg'
/obj/item/clothing/glasses/meson/aviator/prescription
@@ -124,7 +124,7 @@ BLIND // can't see anything
desc = "Modified aviator glasses with a toggled health HUD."
icon_state = "aviator_med"
off_state = "aviator"
action_button_name = "Toggle Mode"
actions_types = list(/datum/action/item_action/toggle_mode)
toggleable = 1
activation_sound = 'sound/effects/pop.ogg'
@@ -139,7 +139,7 @@ BLIND // can't see anything
icon_state = "purple"
item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses")
toggleable = 1
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
item_flags = AIRTIGHT
/obj/item/clothing/glasses/science/New()
@@ -162,7 +162,7 @@ BLIND // can't see anything
origin_tech = list(TECH_MAGNET = 2)
darkness_view = 7
toggleable = 1
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
off_state = "denight"
flash_protection = FLASH_PROTECTION_REDUCED
enables_planes = list(VIS_FULLBRIGHT)
@@ -238,7 +238,7 @@ BLIND // can't see anything
item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses")
origin_tech = list(TECH_MAGNET = 3, TECH_ENGINEERING = 3)
toggleable = 1
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
vision_flags = SEE_OBJS
enables_planes = list(VIS_FULLBRIGHT)
@@ -258,7 +258,7 @@ BLIND // can't see anything
origin_tech = list(TECH_MAGNET = 2, TECH_BLUESPACE = 1)
darkness_view = 5
toggleable = 1
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
off_state = "denight"
vision_flags = SEE_OBJS | SEE_TURFS
flash_protection = FLASH_PROTECTION_REDUCED
@@ -375,7 +375,7 @@ BLIND // can't see anything
desc = "Protects the eyes from welders, approved by the mad scientist association."
icon_state = "welding-g"
item_state_slots = list(slot_r_hand_str = "welding-g", slot_l_hand_str = "welding-g")
action_button_name = "Flip Welding Goggles"
actions_types = list(/datum/action/item_action/flip_welding_goggles)
matter = list(MAT_STEEL = 1500, MAT_GLASS = 1000)
item_flags = AIRTIGHT
var/up = 0
@@ -408,7 +408,7 @@ BLIND // can't see anything
tint = TINT_NONE
to_chat(usr, "You push \the [src] up out of your face.")
update_clothing_icon()
usr.update_action_buttons()
usr.update_action_buttons_icon()
/obj/item/clothing/glasses/welding/superior
name = "superior welding goggles"
@@ -481,7 +481,7 @@ BLIND // can't see anything
desc = "Modified aviator glasses that can be switch between HUD and flash protection modes."
icon_state = "aviator_sec"
off_state = "aviator"
action_button_name = "Toggle Mode"
actions_types = list(/datum/action/item_action/toggle_mode)
var/on = 1
toggleable = 1
activation_sound = 'sound/effects/pop.ogg'
@@ -503,7 +503,7 @@ BLIND // can't see anything
user << activation_sound
user.recalculate_vis()
user.update_inv_glasses()
user.update_action_buttons()
user.update_action_buttons_icon()
/obj/item/clothing/glasses/sunglasses/sechud/aviator/update_icon()
if(on)
@@ -529,7 +529,7 @@ BLIND // can't see anything
item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses")
origin_tech = list(TECH_MAGNET = 3)
toggleable = 1
action_button_name = "Toggle Goggles"
actions_types = list(/datum/action/item_action/toggle_goggles)
vision_flags = SEE_MOBS
enables_planes = list(VIS_FULLBRIGHT, VIS_CLOAKED)
flash_protection = FLASH_PROTECTION_REDUCED
@@ -562,7 +562,7 @@ BLIND // can't see anything
/obj/item/clothing/glasses/thermal/plain
toggleable = 0
activation_sound = null
action_button_name = null
actions_types = list()
/obj/item/clothing/glasses/thermal/plain/monocle
name = "thermonocle"
@@ -570,7 +570,7 @@ BLIND // can't see anything
icon_state = "thermoncle"
item_state_slots = list(slot_r_hand_str = "sunglasses", slot_l_hand_str = "sunglasses")
toggleable = 1
action_button_name = "Toggle Monocle"
actions_types = list(/datum/action/item_action/toggle_monocle)
flags = null //doesn't protect eyes because it's a monocle, duh
body_parts_covered = 0
@@ -582,7 +582,7 @@ BLIND // can't see anything
item_state_slots = list(slot_r_hand_str = "blindfold", slot_l_hand_str = "blindfold")
body_parts_covered = 0
toggleable = 1
action_button_name = "Toggle Eyepatch"
actions_types = list(/datum/action/item_action/toggle_eyepatch)
/obj/item/clothing/glasses/thermal/plain/jensen
name = "optical thermal implants"
@@ -595,7 +595,7 @@ BLIND // can't see anything
desc = "Teshari designed lightweight goggles."
icon_state = "orange-g"
item_state_slots = list(slot_r_hand_str = "glasses", slot_l_hand_str = "glasses")
action_button_name = "Adjust Orange Goggles"
actions_types = list(/datum/action/item_action/adjust_orange_goggles)
var/up = 0
item_flags = AIRTIGHT
body_parts_covered = EYES
@@ -623,4 +623,4 @@ BLIND // can't see anything
icon_state = "[initial(icon_state)]up"
to_chat(usr, "You push \the [src] up from in front of your eyes.")
update_clothing_icon()
usr.update_action_buttons()
usr.update_action_buttons_icon()
+3 -4
View File
@@ -68,7 +68,7 @@
icon_override = 'icons/inventory/eyes/mob_vr.dmi'
icon_state = "medgravpatch"
item_state_slots = list(slot_r_hand_str = "blindfold", slot_l_hand_str = "blindfold")
action_button_name = "Toggle Eyepatch"
actions_types = list(/datum/action/item_action/toggle_eyepatch)
off_state = "eyepatch"
enables_planes = list(VIS_CH_STATUS,VIS_CH_HEALTH,VIS_FULLBRIGHT,VIS_MESONS)
@@ -82,8 +82,7 @@
flash_protection = FLASH_PROTECTION_MODERATE
item_flags = AIRTIGHT
body_parts_covered = EYES
action_button_name = "Change scanning pattern"
action_button_is_hands_free = TRUE
actions_types = list(/datum/action/item_action/hands_free/change_scanning_pattern)
var/static/list/tac_sec_vis_anim = list()
/obj/item/clothing/glasses/sunglasses/sechud/tactical_sec_vis/Initialize(mapload)
@@ -107,7 +106,7 @@
if(src && choice && !user.incapacitated() && in_range(user,src))
icon_state = options[choice]
user.update_inv_glasses()
user.update_action_buttons()
user.update_action_buttons_icon()
to_chat(user, span_notice("Your [src] now displays [choice] ."))
return 1
+6 -6
View File
@@ -141,7 +141,7 @@
away_planes = null
to_chat(usr, span_notice("You enabled the Augmented Reality HUD of your [src.name]."))
ar_toggled = !ar_toggled
usr.update_action_buttons()
usr.update_action_buttons_icon()
usr.recalculate_vis()
@@ -167,7 +167,7 @@
These have been upgraded with medical records access and virus database integration. \
They can also read data from active suit sensors using the crew monitoring system."
mode = "med"
action_button_name = "AR Console (Crew Monitor)"
actions_types = list(/datum/action/item_action/ar_console_crew)
tgarscreen_path = /datum/tgui_module/crew_monitor/glasses
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_AUGMENTED)
@@ -183,7 +183,7 @@
They also have access to security alerts such as camera and motion sensor alarms."
mode = "sec"
flash_protection = FLASH_PROTECTION_MODERATE //weld protection is a little too widespread
action_button_name = "AR Console (Security Alerts)"
actions_types = list(/datum/action/item_action/ar_console_security_alerts)
tgarscreen_path = /datum/tgui_module/alarm_monitor/security/glasses
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_WANTED,VIS_AUGMENTED)
@@ -199,7 +199,7 @@
and can also display a list of atmospheric, fire, and power alarms."
mode = "eng"
flash_protection = FLASH_PROTECTION_MAJOR
action_button_name = "AR Console (Station Alerts)"
actions_types = list(/datum/action/item_action/ar_console_station_alerts)
tgarscreen_path = /datum/tgui_module/alarm_monitor/engineering/glasses
/obj/item/clothing/glasses/omnihud/eng/ar_interact(var/mob/living/carbon/human/user)
@@ -249,7 +249,7 @@
item_state = initial(item_state)
usr.update_inv_glasses()
to_chat(usr, "You activate the retinal projector on the [src].")
usr.update_action_buttons()
usr.update_action_buttons_icon()
/obj/item/clothing/glasses/omnihud/all
name = "\improper AR-B glasses"
@@ -259,7 +259,7 @@
mode = "best"
flash_protection = FLASH_PROTECTION_MAJOR
enables_planes = list(VIS_CH_ID,VIS_CH_HEALTH_VR,VIS_CH_STATUS_R,VIS_CH_BACKUP,VIS_CH_WANTED,VIS_AUGMENTED)
action_button_name = "AR Console (All Alerts)"
actions_types = list(/datum/action/item_action/ar_console_all_alerts)
tgarscreen_path = /datum/tgui_module/alarm_monitor/all/glasses
/obj/item/clothing/glasses/omnihud/all/ar_interact(var/mob/living/carbon/human/user)
+1 -1
View File
@@ -19,7 +19,7 @@
armor = list(melee = 30, bullet = 5, laser = 20,energy = 10, bomb = 20, bio = 10, rad = 20)
flags_inv = 0
siemens_coefficient = 0.9
action_button_name = "Toggle Head-light"
actions_types = list(/datum/action/item_action/toggle_head_light)
w_class = ITEMSIZE_NORMAL
ear_protection = 1
drop_sound = 'sound/items/drop/helm.ogg'
+2 -2
View File
@@ -66,7 +66,7 @@
armor = list(melee = 80, bullet = 10, laser = 10, energy = 10, bomb = 0, bio = 0, rad = 0)
siemens_coefficient = 0.7
valid_accessory_slots = null
action_button_name = "Toggle Visor"
actions_types = list(/datum/action/item_action/toggle_visor)
/obj/item/clothing/head/helmet/riot/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
@@ -113,7 +113,7 @@
siemens_coefficient = 0.6
light_range = 6
light_overlay = "helmet_light_dual_green"
action_button_name = "Toggle Head-light"
actions_types = list(/datum/action/item_action/toggle_head_light)
min_cold_protection_temperature = T0C - 20
cold_protection = HEAD
+8 -8
View File
@@ -28,7 +28,7 @@
icon = 'icons/inventory/head/item_vr.dmi'
icon_override = 'icons/inventory/head/mob_vr.dmi'
// Armor Versions Here
// Armor Versions Here
/obj/item/clothing/head/helmet/combat/crusader
name = "crusader helmet"
desc = "ye olde armored helmet"
@@ -47,10 +47,10 @@
armor = list(melee = 80, bullet = 50, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0)
tint = TINT_HEAVY
siemens_coefficient = 2
var/base_state
var/up = FALSE
/obj/item/clothing/head/helmet/combat/bedevere/attack_self()
toggle()
@@ -83,8 +83,8 @@
if (ismob(src.loc)) //should allow masks to update when it is opened/closed
var/mob/M = src.loc
M.update_inv_wear_mask()
usr.update_action_buttons()
usr.update_action_buttons_icon()
// Costume Versions Here
/obj/item/clothing/head/helmet/combat/crusader_costume
name = "crusader costume helmet"
@@ -104,10 +104,10 @@
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
tint = TINT_HEAVY
siemens_coefficient = 1
var/base_state
var/up = FALSE
/obj/item/clothing/head/helmet/combat/bedevere_costume/attack_self()
toggle()
@@ -140,4 +140,4 @@
if (ismob(src.loc)) //should allow masks to update when it is opened/closed
var/mob/M = src.loc
M.update_inv_wear_mask()
usr.update_action_buttons()
usr.update_action_buttons_icon()
+2 -2
View File
@@ -23,7 +23,7 @@
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
flags_inv = (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
body_parts_covered = HEAD|FACE|EYES
action_button_name = "Flip Welding Mask"
actions_types = list(/datum/action/item_action/flip_welding_mask)
siemens_coefficient = 0.9
w_class = ITEMSIZE_NORMAL
var/base_state
@@ -65,7 +65,7 @@
if (ismob(src.loc)) //should allow masks to update when it is opened/closed
var/mob/M = src.loc
M.update_inv_wear_mask()
usr.update_action_buttons()
usr.update_action_buttons_icon()
/obj/item/clothing/head/welding/demon
name = "demonic welding helmet"
+2 -2
View File
@@ -188,7 +188,7 @@
name = "pilot helmet"
desc = "Standard pilot gear. Protects the head from impacts. This one has a retractable visor"
icon_state = "pilot_helmet2"
action_button_name = "Toggle Visor"
actions_types = list(/datum/action/item_action/toggle_visor)
/obj/item/clothing/head/pilot/alt/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
@@ -197,4 +197,4 @@
else
src.icon_state = initial(icon_state)
to_chat(user, "You lower the visor on the pilot helmet.")
update_clothing_icon() //so our mob-overlays update
update_clothing_icon() //so our mob-overlays update
@@ -15,7 +15,7 @@
sprite_sheets = list(
SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi'
)
action_button_name = "Toggle Visor"
actions_types = list(/datum/action/item_action/toggle_visor)
/obj/item/clothing/head/pilot_vr/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
@@ -34,7 +34,7 @@
sprite_sheets = list(
SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi'
)
action_button_name = "Toggle Visor"
actions_types = list(/datum/action/item_action/toggle_visor)
/obj/item/clothing/head/pilot_vr/alt/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
@@ -55,7 +55,7 @@
sprite_sheets = list(
SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi'
)
action_button_name = "Toggle Visor"
actions_types = list(/datum/action/item_action/toggle_visor)
/obj/item/clothing/head/pilot_vr/talon/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
@@ -77,7 +77,7 @@
sprite_sheets = list(
SPECIES_TESHARI = 'icons/inventory/head/mob_vr_teshari.dmi'
)
action_button_name = "Toggle Visor"
actions_types = list(/datum/action/item_action/toggle_visor)
/obj/item/clothing/head/pilot_vr/mbill/attack_self(mob/user as mob)
if(src.icon_state == initial(icon_state))
@@ -86,4 +86,4 @@
else
src.icon_state = initial(icon_state)
to_chat(user, "You lower the visor on the pilot helmet.")
update_clothing_icon() //so our mob-overlays update
update_clothing_icon() //so our mob-overlays update
+1 -1
View File
@@ -9,7 +9,7 @@
gas_transfer_coefficient = 0.10
permeability_coefficient = 0.50
var/hanging = 0
action_button_name = "Adjust Breath Mask"
actions_types = list(/datum/action/item_action/adjust_breath_mask)
pickup_sound = 'sound/items/pickup/component.ogg'
drop_sound = 'sound/items/drop/component.ogg'
+1 -1
View File
@@ -90,7 +90,7 @@
species_restricted = list(SPECIES_VOX)
filtered_gases = list("oxygen", "nitrous_oxide")
var/mask_open = FALSE // Controls if the Vox can eat through this mask
action_button_name = "Toggle Feeding Port"
actions_types = list(/datum/action/item_action/toggle_feeding_port)
/obj/item/clothing/mask/gas/swat/vox/proc/feeding_port(mob/user)
if(user.canmove && !user.stat)
+2 -2
View File
@@ -4,7 +4,7 @@
description_info = "This mask has a hailer attached, you can activate it on the button or use the Halt! verb, for switching phrases you can alt+click it or change it using the change phrase verb."
icon_state = "halfgas"
armor = list(melee = 10, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 55, rad = 0)
action_button_name = "HALT!"
actions_types = list(/datum/action/item_action/halt)
body_parts_covered = FACE
var/obj/item/hailer/hailer
var/cooldown = 0
@@ -53,7 +53,7 @@
phrase = 12
/obj/item/clothing/mask/gas/sechailer/ui_action_click()
/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, actiontype)
halt()
/obj/item/clothing/mask/gas/sechailer/AltClick(mob/user)
+4 -6
View File
@@ -320,8 +320,7 @@
w_class = ITEMSIZE_SMALL
body_parts_covered = FACE
icon_state = "papermask"
action_button_name = "Redraw Design"
action_button_is_hands_free = TRUE
actions_types = list(/datum/action/item_action/hands_free/redraw_design)
var/list/papermask_designs = list()
/obj/item/clothing/mask/paper/Initialize(mapload)
@@ -374,7 +373,7 @@
if(src && choice && !user.incapacitated() && in_range(user,src))
icon_state = options[choice]
user.update_inv_wear_mask()
user.update_action_buttons()
user.update_action_buttons_icon()
to_chat(user, span_notice("Your paper mask now is now [choice]."))
return 1
@@ -384,8 +383,7 @@
w_class = ITEMSIZE_SMALL
body_parts_covered = FACE
icon_state = "joy"
action_button_name = "Redraw Design"
action_button_is_hands_free = TRUE
actions_types = list(/datum/action/item_action/hands_free/redraw_design)
var/static/list/joymask_designs = list()
@@ -410,7 +408,7 @@
if(src && choice && !user.incapacitated() && in_range(user,src))
icon_state = options[choice]
user.update_inv_wear_mask()
user.update_action_buttons()
user.update_action_buttons_icon()
to_chat(user, span_notice("Your [src] now displays a [choice] emotion."))
return 1
+5 -6
View File
@@ -12,7 +12,7 @@
preserve_item = 1
var/magpulse = 0
var/icon_base = "magboots"
action_button_name = "Toggle Magboots"
actions_types = list(/datum/action/item_action/toggle_magboots)
var/obj/item/clothing/shoes/shoes = null //Undershoes
var/mob/living/carbon/human/wearer = null //For shoe procs
step_volume_mod = 1.3
@@ -41,7 +41,7 @@
playsound(src, 'sound/effects/magnetclamp.ogg', 20)
to_chat(user, "You enable the mag-pulse traction system.")
user.update_inv_shoes() //so our mob-overlays update
user.update_action_buttons()
user.update_action_buttons_icon()
/obj/item/clothing/shoes/magboots/mob_can_equip(mob/user, slot, disable_warning = FALSE)
var/mob/living/carbon/human/H = user
@@ -90,8 +90,7 @@
icon_state = "boots-vox"
flags = PHORONGUARD
species_restricted = list(SPECIES_VOX)
action_button_name = "Toggle the magclaws"
actions_types = list(/datum/action/item_action/toggle_magclaws)
/obj/item/clothing/shoes/magboots/vox/attack_self(mob/user)
if(src.magpulse)
@@ -112,7 +111,7 @@
magpulse = 1
canremove = FALSE //kinda hard to take off magclaws when you are gripping them tightly.
to_chat(user, "You dig your claws deeply into the flooring, bracing yourself.")
user.update_action_buttons()
user.update_action_buttons_icon()
//In case they somehow come off while enabled.
/obj/item/clothing/shoes/magboots/vox/dropped(mob/user as mob)
@@ -126,4 +125,4 @@
/obj/item/clothing/shoes/magboots/vox/examine(mob/user)
. = ..()
if(magpulse)
. += "It would be hard to take these off without relaxing your grip first." // Theoretically this message should only be seen by the wearer when the claws are equipped.
. += "It would be hard to take these off without relaxing your grip first." // Theoretically this message should only be seen by the wearer when the claws are equipped.
@@ -14,7 +14,7 @@
icon = 'icons/inventory/feet/item_vr.dmi'
icon_override = 'icons/inventory/feet/mob_vr.dmi'
// resistance_flags = FIRE_PROOF
action_button_name = "Activate Jump Boots"
actions_types = list(/datum/action/item_action/activate_jump_boots)
permeability_coefficient = 0.05
var/jumpdistance = 5 //-1 from to see the actual distance, e.g 4 goes over 3 tiles
var/jumpspeed = 3
@@ -22,7 +22,7 @@
var/recharging_time = 0 //time until next dash
// var/jumping = FALSE //are we mid-jump? We have no throw_at callback, so we have to check user.throwing.
/obj/item/clothing/shoes/bhop/ui_action_click()
/obj/item/clothing/shoes/bhop/ui_action_click(mob/unused_user, actiontype)
var/mob/living/user = loc
if(!isliving(user))
return
+2 -5
View File
@@ -15,7 +15,7 @@
req_one_access = list()
req_access = list()
w_class = ITEMSIZE_HUGE
action_button_name = "Toggle Heatsink"
actions_types = list(/datum/action/item_action/toggle_heatsink)
// These values are passed on to all component pieces.
armor = list(melee = 40, bullet = 5, laser = 20,energy = 5, bomb = 35, bio = 100, rad = 20)
@@ -98,7 +98,7 @@
var/datum/mini_hud/rig/minihud
// Action button
action_button_name = "Hardsuit Interface"
actions_types = list(/datum/action/item_action/hardsuit_interface)
/obj/item/rig/New()
..()
@@ -407,9 +407,6 @@
else
update_airtight(piece, 1) // Seal
/obj/item/rig/ui_action_click()
toggle_cooling(usr)
/obj/item/rig/proc/toggle_cooling(var/mob/user)
if(cooling_on)
turn_cooling_off(user)
@@ -10,9 +10,9 @@
tgui_interact(usr)
// So the UI button clicks come here
/obj/item/rig/ui_action_click()
if(usr == wearer && (wearer.back == src || wearer.belt == src))
tgui_interact(usr)
/obj/item/rig/ui_action_click(mob/user, actiontype)
if(user == wearer && (wearer.back == src || wearer.belt == src))
tgui_interact(user)
/obj/item/rig/verb/toggle_vision()
@@ -27,7 +27,7 @@
var/obj/machinery/camera/camera
var/list/camera_networks
action_button_name = "Toggle Helmet Light"
actions_types = list(/datum/action/item_action/toggle_helmet_light)
light_overlay = "helmet_light"
light_range = 4
@@ -32,7 +32,7 @@
max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
min_pressure_protection = 0 * ONE_ATMOSPHERE
max_pressure_protection = 10 * ONE_ATMOSPHERE
action_button_name = "Toggle Helmet"
actions_types = list(/datum/action/item_action/toggle_helmet)
species_restricted = list("Human", SPECIES_SKRELL, "Promethean")
sprite_sheets = VR_SPECIES_SPRITE_SHEETS_SUIT_MOB
sprite_sheets_obj = VR_SPECIES_SPRITE_SHEETS_SUIT_ITEM
@@ -256,7 +256,7 @@
item_state_slots = list(slot_r_hand_str = "tesh_hcloak_bo", slot_l_hand_str = "tesh_hcloak_bo")
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
flags_inv = HIDEHOLSTER|HIDETIE
action_button_name = "Toggle Cloak Hood"
actions_types = list(/datum/action/item_action/toggle_hood)
hoodtype = /obj/item/clothing/head/tesh_hood
allowed = list (/obj/item/pen, /obj/item/paper, /obj/item/flashlight,/obj/item/tank/emergency/oxygen, /obj/item/storage/fancy/cigarettes, /obj/item/storage/box/matches, /obj/item/reagent_containers/food/drinks/flask)
+3 -3
View File
@@ -7,7 +7,7 @@
var/hoodtype = null //so the chaplain hoodie or other hoodies can override this
var/hood_up = FALSE
var/toggleicon
action_button_name = "Toggle Hood"
actions_types = list(/datum/action/item_action/toggle_hood)
/obj/item/clothing/suit/storage/hooded/New()
toggleicon = "[initial(icon_state)]"
@@ -23,7 +23,7 @@
var/obj/item/clothing/head/hood/H = new hoodtype(src)
hood = H
/obj/item/clothing/suit/storage/hooded/ui_action_click()
/obj/item/clothing/suit/storage/hooded/ui_action_click(mob/user, actiontype)
ToggleHood()
/obj/item/clothing/suit/storage/hooded/equipped(mob/user, slot)
@@ -74,7 +74,7 @@
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
flags_inv = HIDEJUMPSUIT|HIDETIE|HIDEHOLSTER
cold_protection = UPPER_TORSO|LOWER_TORSO|ARMS
action_button_name = "Toggle Hood"
actions_types = list(/datum/action/item_action/toggle_hood)
/obj/item/clothing/suit/storage/hooded/costume/siffet
name = "siffet costume"
+3 -3
View File
@@ -22,7 +22,7 @@
hoodtype = /obj/item/clothing/head/hood/galahad
armor = list(melee = 80, bullet = 50, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0)
siemens_coefficient = 2
action_button_name = "Toggle Knight Headgear"
actions_types = list(/datum/action/item_action/toggle_knight_headgear)
/obj/item/clothing/suit/storage/hooded/knight/galahad
name = "crusader's armor"
@@ -53,7 +53,7 @@
icon = 'icons/obj/clothing/knights_vr.dmi'
icon_override = 'icons/obj/clothing/knights_vr.dmi'
hoodtype = /obj/item/clothing/head/hood/galahad_costume
action_button_name = "Toggle Knight Headgear"
actions_types = list(/datum/action/item_action/toggle_knight_headgear)
/obj/item/clothing/suit/storage/hooded/knight_costume/galahad
icon_state = "galahad"
@@ -84,7 +84,7 @@
body_parts_covered = UPPER_TORSO|LOWER_TORSO
flags_inv = HIDETIE|HIDEHOLSTER
cold_protection = UPPER_TORSO|LOWER_TORSO
action_button_name = "Toggle Hood"
actions_types = list(/datum/action/item_action/toggle_hood)
/obj/item/clothing/suit/storage/hooded/foodcostume/hotdog //Belly filler uniform :^).
name = "hotdog costume"
@@ -557,7 +557,7 @@
item_flags = FLEXIBLEMATERIAL
var/breath_masked = FALSE
var/obj/item/clothing/mask/breath/breathmask
action_button_name = "Pull On Gaiter"
actions_types = list(/datum/action/item_action/pull_on_gaiter)
/obj/item/clothing/accessory/gaiter/update_clothing_icon()
. = ..()
@@ -714,7 +714,7 @@
desc = "The latest fashion innovations by the Nanotrasen Uniform & Fashion Department have provided the brilliant invention of slicing a regular cloak in half! All the ponce, half the cost!"
icon_state = "roughcloak"
item_state = "roughcloak"
action_button_name = "Adjust Cloak"
actions_types = list(/datum/action/item_action/adjust_cloak)
/obj/item/clothing/accessory/poncho/roles/cloak/half/update_clothing_icon()
. = ..()
@@ -985,7 +985,7 @@
desc = "Aim for the Heart, Ramon."
icon_state = "neo_ranger"
item_state = "neo_ranger"
action_button_name = "Adjust Poncho"
actions_types = list(/datum/action/item_action/adjust_poncho)
/obj/item/clothing/accessory/poncho/roles/neo_ranger/update_clothing_icon()
. = ..()
+1 -1
View File
@@ -5,7 +5,7 @@
slot_flags = SLOT_BELT
w_class = ITEMSIZE_SMALL
item_state = "electronic"
action_button_name = "Toggle UV light"
actions_types = list(/datum/action/item_action/toggle_uv_light)
matter = list(MAT_STEEL = 150)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINEERING = 1)
@@ -76,7 +76,8 @@
// Clothing assemblies can be triggered by clicking on the HUD. This allows that to occur.
action_circuit = new(src.IC)
IC.force_add_circuit(action_circuit)
action_button_name = "Activate [name]"
new /datum/action/item_action/activate(src, name)
/obj/item/clothing/Destroy()
if(IC)
@@ -177,4 +178,4 @@
/obj/item/clothing/suit/circuitry/Initialize()
setup_integrated_circuit(/obj/item/electronic_assembly/clothing/large)
return ..()
return ..()
+1 -2
View File
@@ -27,8 +27,7 @@
sharp = TRUE
edge = TRUE
// sharpness = SHARP_EDGED
action_button_name = "Toggle Light"
// actions_types = list(/datum/action/item_action/toggle_light)
actions_types = list(/datum/action/item_action/toggle_light)
// var/list/trophies = list()
var/charged = TRUE
var/charge_time = 15
-6
View File
@@ -208,12 +208,6 @@ var/list/slot_equipment_priority = list( \
/mob/proc/temporarilyRemoveItemFromInventory(obj/item/I, force = FALSE, idrop = TRUE)
return u_equip(I, force, null, TRUE, idrop)
///sometimes we only want to grant the item's action if it's equipped in a specific slot.
/obj/item/proc/item_action_slot_check(slot, mob/user)
if(slot == SLOT_BACK || slot == LEGS) //these aren't true slots, so avoid granting actions there
return FALSE
return TRUE
///Get the item on the mob in the storage slot identified by the id passed in
/mob/proc/get_item_by_slot(slot_id)
return null
+1 -1
View File
@@ -455,7 +455,7 @@
throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = handcuffed)
else
clear_alert("handcuffed")
update_action_buttons() //some of our action buttons might be unusable when we're handcuffed.
update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
// Clears blood overlays
@@ -222,7 +222,6 @@ This saves us from having to call add_fingerprint() any time something is put in
else
return 0
update_action_buttons()
return 1
@@ -369,9 +368,6 @@ This saves us from having to call add_fingerprint() any time something is put in
W.hud_layerise()
if(W.action_button_name)
update_action_buttons()
if(W.zoom)
W.zoom()
+1
View File
@@ -1,5 +1,6 @@
/mob/living/death(gibbed)
clear_fullscreens()
update_action_buttons_icon()
if(ai_holder)
ai_holder.go_sleep()
-2
View File
@@ -75,8 +75,6 @@
handle_disabilities() // eye, ear, brain damages
handle_statuses() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
handle_actions()
update_canmove()
handle_regular_hud_updates()
-16
View File
@@ -524,22 +524,6 @@
/mob/living/proc/reagent_permeability()
return 1
/mob/living/proc/handle_actions()
//Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent
for(var/datum/action/A in actions)
if(A.CheckRemoval(src))
A.Remove(src)
for(var/obj/item/I in src)
if(I.action_button_name)
if(!I.action)
if(I.action_button_is_hands_free)
I.action = new/datum/action/item_action/hands_free
else
I.action = new/datum/action/item_action
I.action.name = I.action_button_name
I.action.target = I
I.action.Grant(src)
return
// Returns a number to determine if something is harder or easier to hit than normal.
/mob/living/proc/get_evasion()
@@ -21,6 +21,9 @@
/mob/living/silicon/robot/proc/uneq_active()
if(isnull(module_active))
return
var/obj/item/I = module_active
for(var/datum/action/A as anything in I.actions)
A.Remove(src)
if(module_state_1 == module_active)
if(istype(module_state_1,/obj/item/borg/sight))
sight_mode &= ~module_state_1:sight_mode
@@ -64,6 +67,9 @@
if (client)
client.screen -= module_state_1
contents -= module_state_1
var/obj/item/I = module_state_1
for(var/datum/action/A as anything in I.actions)
A.Remove(src)
module_state_1:loc = module
module_state_1 = null
inv1.icon_state = "inv1"
@@ -72,6 +78,9 @@
sight_mode &= ~module_state_2:sight_mode
if (client)
client.screen -= module_state_2
var/obj/item/I = module_state_2
for(var/datum/action/A as anything in I.actions)
A.Remove(src)
contents -= module_state_2
module_state_2:loc = module
module_state_2 = null
@@ -81,6 +90,9 @@
sight_mode &= ~module_state_3:sight_mode
if (client)
client.screen -= module_state_3
var/obj/item/I = module_state_3
for(var/datum/action/A as anything in I.actions)
A.Remove(src)
contents -= module_state_3
module_state_3:loc = module
module_state_3 = null
@@ -276,6 +288,9 @@
pounce.icon_state = initial(pounce.icon_state)
pounce.desc = initial(pounce.desc)
pounce.bluespace = initial(pounce.bluespace)
if(O)
for(var/datum/action/A as anything in O.actions)
A.Grant(src)
/mob/living/silicon/robot/put_in_hands(var/obj/item/W) // No hands.
W.forceMove(get_turf(src))
@@ -10,7 +10,6 @@
//Status updates, death etc.
clamp_values()
handle_regular_status_updates()
handle_actions()
handle_instability()
// For some reason borg Life() doesn't call ..()
handle_modifiers()
@@ -319,7 +319,7 @@
origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 5, TECH_POWER = 4)
projectile_type = /obj/item/projectile/beam/sniper
slot_flags = SLOT_BACK
action_button_name = "Use Scope"
actions_types = list(/datum/action/item_action/use_scope)
battery_lock = 1
charge_cost = 600
fire_delay = 35
@@ -329,7 +329,7 @@
scoped_accuracy = 50
one_handed_penalty = 60 // The weapon itself is heavy, and the long barrel makes it hard to hold steady with just one hand.
/obj/item/gun/energy/sniperrifle/ui_action_click()
/obj/item/gun/energy/sniperrifle/ui_action_click(mob/user, actiontype)
scope()
/obj/item/gun/energy/sniperrifle/verb/scope()
@@ -424,7 +424,7 @@
origin_tech = list(TECH_COMBAT = 6, TECH_MATERIAL = 4, TECH_POWER = 3)
projectile_type = /obj/item/projectile/beam/sniper
slot_flags = SLOT_BACK
action_button_name = "Aim Down Sights"
actions_types = list(/datum/action/item_action/aim_down_sights)
charge_cost = 2400
fire_delay = 20
force = 8
@@ -434,7 +434,7 @@
charge_meter = FALSE
var/scope_multiplier = 1.5
/obj/item/gun/energy/monorifle/ui_action_click()
/obj/item/gun/energy/monorifle/ui_action_click(mob/user, actiontype)
sights()
/obj/item/gun/energy/monorifle/verb/sights()
@@ -27,7 +27,7 @@
light_state = "prot_light"
flight_x_offset = 0
flight_y_offset = 0
action_button_name = "Toggle gun-light"
actions_types = list(/datum/action/item_action/toggle_gunlight)
var/gun_light_icon = TRUE
var/gun_light_on = FALSE
var/brightness_on = 5
+2 -2
View File
@@ -176,7 +176,7 @@
item_state = "lsniper"
item_state_slots = list(slot_r_hand_str = "lsniper", slot_l_hand_str = "lsniper")
wielded_item_state = "lsniper-wielded"
action_button_name = "Use Scope"
actions_types = list(/datum/action/item_action/use_scope)
w_class = ITEMSIZE_LARGE
item_icons = list(slot_l_hand_str = 'icons/mob/items/lefthand_guns.dmi', slot_r_hand_str = 'icons/mob/items/righthand_guns.dmi')
accuracy = -15 //better than most snipers but still has penalty
@@ -194,7 +194,7 @@
list(mode_name="lethal", fire_delay=12, projectile_type=/obj/item/projectile/beam, modifystate="phriflekill", charge_cost = 200),
)
/obj/item/gun/energy/locked/frontier/rifle/ui_action_click()
/obj/item/gun/energy/locked/frontier/rifle/ui_action_click(mob/user, actiontype)
scope()
/obj/item/gun/energy/locked/frontier/rifle/verb/scope()
@@ -173,7 +173,7 @@
power_cost = 100
ammo_material = MAT_PHORON
action_button_name = "Toggle internal generator"
actions_types = list(/datum/action/item_action/toggle_internal_generator)
var/generator_state = GEN_OFF
var/datum/looping_sound/small_motor/soundloop
@@ -204,8 +204,8 @@
QDEL_NULL(soundloop)
. = ..()
/obj/item/gun/magnetic/matfed/phoronbore/ui_action_click()
toggle_generator(usr)
/obj/item/gun/magnetic/matfed/phoronbore/ui_action_click(mob/user, actiontype)
toggle_generator(user)
/obj/item/gun/magnetic/matfed/phoronbore/process()
if(generator_state && !mat_storage)
@@ -141,7 +141,7 @@
action_sound = 'sound/weapons/riflebolt.ogg'
pump_animation = "scoped-boltaction-cycling"
/obj/item/gun/projectile/shotgun/pump/rifle/ui_action_click()
/obj/item/gun/projectile/shotgun/pump/rifle/ui_action_click(mob/user, actiontype)
scope()
/obj/item/gun/projectile/shotgun/pump/rifle/verb/scope()
@@ -37,7 +37,7 @@
projectile_type = /obj/item/projectile/bullet/shotgun
one_handed_penalty = 30 //You madman, one-handing a 12g shotgun.
recoil = 5 //Unfold the damn stock you fool!
action_button_name = "Toggle stock"
actions_types = list(/datum/action/item_action/toggle_stock)
var/stock = FALSE
@@ -69,7 +69,7 @@
H.update_inv_r_hand()
playsound(src, 'sound/weapons/targeton.ogg', 50, 1)
user.update_action_buttons()
user.update_action_buttons_icon()
/obj/item/gun/projectile/shotgun/compact/verb/verb_toggle_stock(mob/user as mob)
set category = "Object"
@@ -94,7 +94,7 @@
else
to_chat(usr, span_notice("You cannot do this in your current state."))
/obj/item/gun/projectile/shotgun/compact/ui_action_click()
/obj/item/gun/projectile/shotgun/compact/ui_action_click(mob/unused_user, actiontype)
var/mob/living/user = loc
if(!isliving(user))
return
@@ -9,7 +9,7 @@
w_class = ITEMSIZE_HUGE // So it can't fit in a backpack.
force = 10
slot_flags = SLOT_BACK
action_button_name = "Use Scope"
actions_types = list(/datum/action/item_action/use_scope)
origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 2, TECH_ILLEGAL = 8)
caliber = "14.5mm"
recoil = 5 //extra kickback
@@ -63,7 +63,7 @@
return
..()
/obj/item/gun/projectile/heavysniper/ui_action_click()
/obj/item/gun/projectile/heavysniper/ui_action_click(mob/user, actiontype)
scope()
/obj/item/gun/projectile/heavysniper/verb/scope()
@@ -84,7 +84,7 @@
w_class = ITEMSIZE_HUGE // So it can't fit in a backpack.
force = 10
slot_flags = SLOT_BACK // Needs a sprite.
action_button_name = "Use Scope"
actions_types = list(/datum/action/item_action/use_scope)
origin_tech = list(TECH_COMBAT = 8, TECH_MATERIAL = 2, TECH_ILLEGAL = 8)
caliber = "7.62mm"
load_method = MAGAZINE
@@ -102,7 +102,7 @@
else
icon_state = "SVD-empty"
/obj/item/gun/projectile/SVD/ui_action_click()
/obj/item/gun/projectile/SVD/ui_action_click(mob/user, actiontype)
scope()
/obj/item/gun/projectile/SVD/verb/scope()
@@ -68,7 +68,7 @@
icon_override = 'icons/vore/custom_clothes_vr.dmi'
item_state = "coatroiz_mob"
/obj/item/clothing/suit/storage/hooded/wintercoat/roiz/ui_action_click()
/obj/item/clothing/suit/storage/hooded/wintercoat/roiz/ui_action_click(mob/user, actiontype)
ToggleHood_roiz()
/obj/item/clothing/suit/storage/hooded/wintercoat/roiz/equipped(mob/user, slot)
@@ -783,7 +783,7 @@
light_overlay = null
light_system = MOVABLE_LIGHT
action_button_name = "Toggle pom-pom"
actions_types = list(/datum/action/item_action/toggle_pom_pom)
/obj/item/clothing/head/fluff/pompom/digest_act(var/atom/movable/item_storage = null)
return FALSE
@@ -1129,7 +1129,7 @@
if (ismob(loc)) //should allow masks to update when it is opened/closed
var/mob/M = loc
M.update_inv_wear_mask()
usr.update_action_buttons()
usr.update_action_buttons_icon()
//Vorrarkul: Theodora Lindt
/obj/item/clothing/suit/chococoat
@@ -1541,7 +1541,7 @@ Departamental Swimsuits, for general use
icon_override = 'icons/vore/custom_clothes_vr.dmi'
item_state = "kilanocoat_mob"
/obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat/ui_action_click()
/obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat/ui_action_click(mob/user, actiontype)
ToggleHood_kilano()
/obj/item/clothing/suit/storage/hooded/wintercoat/kilanocoat/equipped(mob/user, slot)
@@ -2353,7 +2353,7 @@ Departamental Swimsuits, for general use
icon_override = 'icons/vore/custom_onmob_vr.dmi'
item_state = "mechahood_mob"
/obj/item/clothing/suit/storage/hooded/wintercoat/fluff/mechanic/ui_action_click()
/obj/item/clothing/suit/storage/hooded/wintercoat/fluff/mechanic/ui_action_click(mob/user, actiontype)
ToggleHood_mechacoat()
/obj/item/clothing/suit/storage/hooded/wintercoat/fluff/mechanic/equipped(mob/user, slot)
@@ -2411,7 +2411,7 @@ Departamental Swimsuits, for general use
icon_override = 'icons/vore/custom_onmob_vr.dmi'
item_state = "evelynhood_mob"
/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/ui_action_click()
/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/ui_action_click(mob/user, actiontype)
ToggleHood_evelyn()
/obj/item/clothing/suit/storage/hooded/wintercoat/security/fluff/evelyn/equipped(mob/user, slot)
@@ -2635,7 +2635,7 @@ Departamental Swimsuits, for general use
if (ismob(loc)) //should allow masks to update when it is opened/closed
var/mob/M = loc
M.update_inv_wear_mask()
usr.update_action_buttons()
usr.update_action_buttons_icon()
/obj/item/clothing/suit/storage/toggle/labcoat/fluff/zeracloak
name = "Grand Purple Cloak"
@@ -689,7 +689,7 @@
slowdown = 0
taurtype = /datum/sprite_accessory/tail/taur/feline/tempest
no_message = "These saddlebags seem to be fitted for someone else, and keep slipping off!"
action_button_name = "Toggle Mlembulance Mode"
actions_types = list(/datum/action/item_action/toggle_mlembulance)
var/ambulance = FALSE
var/datum/looping_sound/ambulance/soundloop
var/ambulance_state = FALSE
@@ -703,7 +703,7 @@
QDEL_NULL(soundloop)
return ..()
/obj/item/storage/backpack/saddlebag/tempest/ui_action_click()
/obj/item/storage/backpack/saddlebag/tempest/ui_action_click(mob/user, actiontype)
ambulance = !(ambulance)
if(ambulance)
START_PROCESSING(SSobj, src)
+1
View File
@@ -252,6 +252,7 @@
#include "code\_onclick\hud\spell_screen_objects.dm"
#include "code\_onclick\hud\action\action.dm"
#include "code\_onclick\hud\action\action_screen_objects.dm"
#include "code\_onclick\hud\action\types\item.dm"
#include "code\ATMOSPHERICS\_atmos_setup.dm"
#include "code\ATMOSPHERICS\_atmospherics_helpers.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"