mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 14:39:58 +01:00
Merge pull request #15673 from phil235/ActionButtonUpdateRefactor
Action buttons will now only update when needed instead of every Life().
This commit is contained in:
@@ -78,6 +78,7 @@
|
||||
handle_move(get_turf(loc))
|
||||
|
||||
/obj/item/device/assembly/prox_sensor/dropped()
|
||||
..()
|
||||
if(scanning)
|
||||
spawn(0)
|
||||
sense()
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
SSobj.processing.Remove(src)
|
||||
|
||||
/obj/item/weapon/twohanded/required/ctf/dropped(mob/user)
|
||||
..()
|
||||
reset_cooldown = world.time + 200 //20 seconds
|
||||
SSobj.processing |= src
|
||||
for(var/mob/M in player_list)
|
||||
|
||||
@@ -116,7 +116,6 @@ BLIND // can't see anything
|
||||
strip_delay = 40
|
||||
put_on_delay = 40
|
||||
var/mask_adjusted = 0
|
||||
var/ignore_maskadjust = 1
|
||||
var/adjusted_flags = null
|
||||
|
||||
|
||||
@@ -132,30 +131,32 @@ BLIND // can't see anything
|
||||
|
||||
//Proc that moves gas/breath masks out of the way, disabling them and allowing pill/food consumption
|
||||
/obj/item/clothing/mask/proc/adjustmask(mob/living/user)
|
||||
if(!ignore_maskadjust)
|
||||
if(user.incapacitated())
|
||||
return
|
||||
mask_adjusted = !mask_adjusted
|
||||
if(!mask_adjusted)
|
||||
src.icon_state = initial(icon_state)
|
||||
gas_transfer_coefficient = initial(gas_transfer_coefficient)
|
||||
permeability_coefficient = initial(permeability_coefficient)
|
||||
flags |= visor_flags
|
||||
flags_inv |= visor_flags_inv
|
||||
flags_cover = initial(flags_cover)
|
||||
user << "<span class='notice'>You push \the [src] back into place.</span>"
|
||||
slot_flags = initial(slot_flags)
|
||||
else
|
||||
icon_state += "_up"
|
||||
user << "<span class='notice'>You push \the [src] out of the way.</span>"
|
||||
gas_transfer_coefficient = null
|
||||
permeability_coefficient = null
|
||||
flags &= ~visor_flags
|
||||
flags_inv &= ~visor_flags_inv
|
||||
flags_cover &= 0
|
||||
if(adjusted_flags)
|
||||
slot_flags = adjusted_flags
|
||||
user.wear_mask_update(src, toggle_off = mask_adjusted)
|
||||
if(user.incapacitated())
|
||||
return
|
||||
mask_adjusted = !mask_adjusted
|
||||
if(!mask_adjusted)
|
||||
src.icon_state = initial(icon_state)
|
||||
gas_transfer_coefficient = initial(gas_transfer_coefficient)
|
||||
permeability_coefficient = initial(permeability_coefficient)
|
||||
flags |= visor_flags
|
||||
flags_inv |= visor_flags_inv
|
||||
flags_cover = initial(flags_cover)
|
||||
user << "<span class='notice'>You push \the [src] back into place.</span>"
|
||||
slot_flags = initial(slot_flags)
|
||||
else
|
||||
icon_state += "_up"
|
||||
user << "<span class='notice'>You push \the [src] out of the way.</span>"
|
||||
gas_transfer_coefficient = null
|
||||
permeability_coefficient = null
|
||||
flags &= ~visor_flags
|
||||
flags_inv &= ~visor_flags_inv
|
||||
flags_cover &= 0
|
||||
if(adjusted_flags)
|
||||
slot_flags = adjusted_flags
|
||||
user.wear_mask_update(src, toggle_off = mask_adjusted)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
|
||||
|
||||
@@ -515,6 +516,9 @@ BLIND // can't see anything
|
||||
if(istype(usr, /mob/living/carbon))
|
||||
var/mob/living/carbon/C = usr
|
||||
C.head_update(src, forced = 1)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/proc/can_use(mob/user)
|
||||
if(user && ismob(user))
|
||||
|
||||
@@ -4,16 +4,13 @@
|
||||
name = "Engineering Scanner Goggles"
|
||||
desc = "Goggles used by engineers. The Meson Scanner mode lets you see basic structural and terrain layouts through walls, regardless of lighting condition. The T-ray Scanner mode lets you see underfloor objects such as cables and pipes."
|
||||
icon_state = "trayson-meson"
|
||||
action_button_name = "Change Scanning Mode"
|
||||
actions_types = list(/datum/action/item_action/toggle_mode)
|
||||
|
||||
var/mode = 0 //0 - regular mesons mode 1 - t-ray mode
|
||||
var/invis_objects = list()
|
||||
var/range = 1
|
||||
|
||||
/obj/item/clothing/glasses/meson/engine/attack_self()
|
||||
ui_action_click()
|
||||
|
||||
/obj/item/clothing/glasses/meson/engine/ui_action_click()
|
||||
/obj/item/clothing/glasses/meson/engine/attack_self(mob/user)
|
||||
mode = !mode
|
||||
|
||||
if(mode)
|
||||
@@ -21,7 +18,7 @@
|
||||
vision_flags = 0
|
||||
darkness_view = 2
|
||||
invis_view = SEE_INVISIBLE_LIVING
|
||||
loc << "<span class='notice'>You toggle the goggles' scanning mode to \[T-Ray].</span>"
|
||||
user << "<span class='notice'>You toggle the goggles' scanning mode to \[T-Ray].</span>"
|
||||
else
|
||||
SSobj.processing.Remove(src)
|
||||
vision_flags = SEE_TURFS
|
||||
@@ -30,11 +27,15 @@
|
||||
loc << "<span class='notice'>You toggle the goggles' scanning mode to \[Meson].</span>"
|
||||
invis_update()
|
||||
|
||||
if(istype(loc,/mob/living/carbon))
|
||||
var/mob/living/carbon/C = loc
|
||||
C.update_sight()
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.glasses == src)
|
||||
H.update_sight()
|
||||
|
||||
update_icon()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/glasses/meson/engine/process()
|
||||
if(!mode)
|
||||
@@ -94,7 +95,6 @@
|
||||
name = "Optical T-Ray Scanner"
|
||||
desc = "Used by engineering staff to see underfloor objects such as cables and pipes."
|
||||
icon_state = "trayson-tray_off"
|
||||
action_button_name = "Toggle Scanner Power"
|
||||
|
||||
mode = 1
|
||||
var/on = 0
|
||||
@@ -115,18 +115,21 @@
|
||||
if(user.glasses == src)
|
||||
user.update_inv_glasses()
|
||||
|
||||
/obj/item/clothing/glasses/meson/engine/tray/ui_action_click()
|
||||
/obj/item/clothing/glasses/meson/engine/tray/attack_self(mob/user)
|
||||
on = !on
|
||||
|
||||
if(on)
|
||||
SSobj.processing |= src
|
||||
loc << "<span class='notice'>You turn the goggles on.</span>"
|
||||
user << "<span class='notice'>You turn the goggles on.</span>"
|
||||
else
|
||||
SSobj.processing.Remove(src)
|
||||
loc << "<span class='notice'>You turn the goggles off.</span>"
|
||||
user << "<span class='notice'>You turn the goggles off.</span>"
|
||||
invis_update()
|
||||
|
||||
update_icon()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/glasses/meson/engine/tray/t_ray_on()
|
||||
return on && ..()
|
||||
@@ -50,16 +50,11 @@
|
||||
item_state = "glasses"
|
||||
origin_tech = "magnets=2;engineering=2"
|
||||
scan_reagents = 1 //You can see reagents while wearing science goggles
|
||||
actions_types = list(/datum/action/item_action/toggle_research_scanner)
|
||||
|
||||
/obj/item/clothing/glasses/science/equipped(mob/user, slot)
|
||||
/obj/item/clothing/glasses/science/item_action_slot_check(slot)
|
||||
if(slot == slot_glasses)
|
||||
user.scanner.devices += 1
|
||||
user.scanner.Grant(user)
|
||||
..(user, slot)
|
||||
|
||||
/obj/item/clothing/glasses/science/dropped(mob/user)
|
||||
user.scanner.devices = max(0, user.scanner.devices - 1)
|
||||
..()
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/glasses/night
|
||||
name = "Night Vision Goggles"
|
||||
@@ -170,7 +165,7 @@
|
||||
desc = "Protects the eyes from welders; approved by the mad scientist association."
|
||||
icon_state = "welding-g"
|
||||
item_state = "welding-g"
|
||||
action_button_name = "Toggle Welding Goggles"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
materials = list(MAT_METAL = 250)
|
||||
flash_protect = 2
|
||||
tint = 2
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
H.add_hud_to(user)
|
||||
|
||||
/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user)
|
||||
..()
|
||||
if(hud_type && istype(user) && user.glasses == src)
|
||||
var/datum/atom_hud/H = huds[hud_type]
|
||||
H.remove_hud_from(user)
|
||||
@@ -113,7 +114,7 @@
|
||||
/obj/item/clothing/glasses/hud/toggle
|
||||
name = "Toggle Hud"
|
||||
desc = "A hud with multiple functions."
|
||||
action_button_name = "Switch HUD"
|
||||
actions_types = list(/datum/action/item_action/switch_hud)
|
||||
|
||||
/obj/item/clothing/glasses/hud/toggle/attack_self(mob/user)
|
||||
if(!ishuman(user))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
item_color = "yellow" //Determines used sprites: hardhat[on]_[item_color] and hardhat[on]_[item_color]2 (lying down sprite)
|
||||
armor = list(melee = 15, bullet = 5, laser = 20,energy = 10, bomb = 20, bio = 10, rad = 20)
|
||||
flags_inv = 0
|
||||
action_button_name = "Toggle Helmet Light"
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light)
|
||||
burn_state = FIRE_PROOF
|
||||
|
||||
/obj/item/clothing/head/hardhat/attack_self(mob/user)
|
||||
@@ -24,13 +24,18 @@
|
||||
turn_on(user)
|
||||
else
|
||||
turn_off(user)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/hardhat/pickup(mob/user)
|
||||
..()
|
||||
if(on)
|
||||
user.AddLuminosity(brightness_on)
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/item/clothing/head/hardhat/dropped(mob/user)
|
||||
..()
|
||||
if(on)
|
||||
user.AddLuminosity(-brightness_on)
|
||||
SetLuminosity(brightness_on)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
armor = list(melee = 41, bullet = 15, laser = 5,energy = 5, bomb = 5, bio = 2, rad = 0)
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEFACE
|
||||
strip_delay = 80
|
||||
action_button_name = "Toggle Helmet Visor"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
visor_flags_inv = HIDEMASK|HIDEFACE
|
||||
toggle_cooldown = 0
|
||||
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
|
||||
@@ -75,7 +75,7 @@
|
||||
icon_state = "justice"
|
||||
toggle_message = "You turn off the lights on"
|
||||
alt_toggle_message = "You turn on the lights on"
|
||||
action_button_name = "Toggle Justice Lights"
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light)
|
||||
can_toggle = 1
|
||||
toggle_cooldown = 20
|
||||
active_sound = 'sound/items/WEEOO1.ogg'
|
||||
@@ -86,7 +86,6 @@
|
||||
icon_state = "justice2"
|
||||
toggle_message = "You turn off the light on"
|
||||
alt_toggle_message = "You turn on the light on"
|
||||
action_button_name = "Toggle Alarm Lights"
|
||||
|
||||
/obj/item/clothing/head/helmet/swat
|
||||
name = "\improper SWAT helmet"
|
||||
@@ -210,28 +209,33 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/item/clothing/head/helmet/ui_action_click()
|
||||
toggle_helmlight()
|
||||
..()
|
||||
/obj/item/clothing/head/helmet/ui_action_click(mob/user, actiontype)
|
||||
if(actiontype == /datum/action/item_action/toggle_helmet_flashlight)
|
||||
toggle_helmlight()
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/head/helmet/attackby(obj/item/A, mob/user, params)
|
||||
if(istype(A, /obj/item/device/flashlight/seclite))
|
||||
var/obj/item/device/flashlight/seclite/S = A
|
||||
/obj/item/clothing/head/helmet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/device/flashlight/seclite))
|
||||
var/obj/item/device/flashlight/seclite/S = I
|
||||
if(can_flashlight)
|
||||
if(!F)
|
||||
if(!user.unEquip(A))
|
||||
if(!user.unEquip(S))
|
||||
return
|
||||
user << "<span class='notice'>You click [S] into place on [src].</span>"
|
||||
if(S.on)
|
||||
SetLuminosity(0)
|
||||
F = S
|
||||
A.loc = src
|
||||
S.loc = src
|
||||
update_icon()
|
||||
update_helmlight(user)
|
||||
verbs += /obj/item/clothing/head/helmet/proc/toggle_helmlight
|
||||
var/datum/action/A = new /datum/action/item_action/toggle_helmet_flashlight(src)
|
||||
if(loc == user)
|
||||
A.Grant(user)
|
||||
return
|
||||
|
||||
if(istype(A, /obj/item/weapon/screwdriver))
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(F)
|
||||
for(var/obj/item/device/flashlight/seclite/S in src)
|
||||
user << "<span class='notice'>You unscrew the seclite from [src].</span>"
|
||||
@@ -242,10 +246,11 @@
|
||||
update_icon()
|
||||
usr.update_inv_head()
|
||||
verbs -= /obj/item/clothing/head/helmet/proc/toggle_helmlight
|
||||
for(var/datum/action/item_action/toggle_helmet_flashlight/THL in actions)
|
||||
qdel(THL)
|
||||
return
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/clothing/head/helmet/proc/toggle_helmlight()
|
||||
set name = "Toggle Helmetlight"
|
||||
@@ -269,7 +274,6 @@
|
||||
|
||||
/obj/item/clothing/head/helmet/proc/update_helmlight(mob/user = null)
|
||||
if(F)
|
||||
action_button_name = "Toggle Helmetlight"
|
||||
if(F.on)
|
||||
if(loc == user)
|
||||
user.AddLuminosity(F.brightness_on)
|
||||
@@ -281,15 +285,18 @@
|
||||
else if(isturf(loc))
|
||||
SetLuminosity(0)
|
||||
update_icon()
|
||||
|
||||
else
|
||||
action_button_name = null
|
||||
if(loc == user)
|
||||
user.AddLuminosity(-5)
|
||||
else if(isturf(loc))
|
||||
SetLuminosity(0)
|
||||
return
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/helmet/pickup(mob/user)
|
||||
..()
|
||||
if(F)
|
||||
if(F.on)
|
||||
user.AddLuminosity(F.brightness_on)
|
||||
@@ -297,6 +304,7 @@
|
||||
|
||||
|
||||
/obj/item/clothing/head/helmet/dropped(mob/user)
|
||||
..()
|
||||
if(F)
|
||||
if(F.on)
|
||||
user.AddLuminosity(-F.brightness_on)
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
tint = 2
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
|
||||
action_button_name = "Toggle Welding Helmet"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
visor_flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
|
||||
burn_state = FIRE_PROOF
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
item_state = "hardhat0_cakehat"
|
||||
item_color = "cakehat"
|
||||
flags_inv = HIDEEARS|HIDEHAIR
|
||||
action_button_name = "Toggle Candle"
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
brightness_on = 2 //luminosity when on
|
||||
flags_cover = HEADCOVERSEYES
|
||||
@@ -116,7 +115,6 @@
|
||||
item_state = "hardhat0_pumpkin"
|
||||
item_color = "pumpkin"
|
||||
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
|
||||
action_button_name = "Toggle Pumpkin Light"
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
brightness_on = 2 //luminosity when on
|
||||
flags_cover = HEADCOVERSEYES
|
||||
@@ -147,6 +145,5 @@
|
||||
item_state = "hardhat0_reindeer"
|
||||
item_color = "reindeer"
|
||||
flags_inv = 0
|
||||
action_button_name = "Toggle Nose Light"
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
brightness_on = 1 //luminosity when on
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
flags_inv = HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
|
||||
visor_flags_inv = HIDEFACE|HIDEFACIALHAIR
|
||||
w_class = 2
|
||||
action_button_name = "Adjust Balaclava"
|
||||
ignore_maskadjust = 0
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
|
||||
/obj/item/clothing/mask/balaclava/attack_self(mob/user)
|
||||
adjustmask(user)
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
w_class = 2
|
||||
gas_transfer_coefficient = 0.10
|
||||
permeability_coefficient = 0.50
|
||||
action_button_name = "Adjust Breath Mask"
|
||||
ignore_maskadjust = 0
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
flags_cover = MASKCOVERSMOUTH
|
||||
burn_state = FIRE_PROOF
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
tint = 2
|
||||
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
origin_tech = "materials=2;engineering=2"
|
||||
action_button_name = "Toggle Welding Mask"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
|
||||
flags_cover = MASKCOVERSEYES
|
||||
visor_flags_inv = HIDEEYES
|
||||
@@ -60,7 +60,7 @@
|
||||
var/voice = "Unknown"
|
||||
var/vchange = 0//This didn't do anything before. It now checks if the mask has special functions/N
|
||||
origin_tech = "syndicate=4"
|
||||
action_button_name = "Toggle mask"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
|
||||
/obj/item/clothing/mask/gas/voice/attack_self(mob/user)
|
||||
vchange = !vchange
|
||||
@@ -109,14 +109,11 @@
|
||||
item_state = "mime"
|
||||
flags_cover = MASKCOVERSEYES
|
||||
burn_state = FLAMMABLE
|
||||
action_button_name = "Adjust Mask"
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
|
||||
/obj/item/clothing/mask/gas/mime/ui_action_click()
|
||||
/obj/item/clothing/mask/gas/mime/attack_self(mob/user)
|
||||
cycle_mask(usr)
|
||||
|
||||
/obj/item/clothing/mask/gas/mime/AltClick(mob/user)
|
||||
cycle_mask(user)
|
||||
|
||||
/obj/item/clothing/mask/gas/mime/proc/cycle_mask(mob/user)
|
||||
switch(icon_state)
|
||||
if("mime")
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
/obj/item/clothing/mask/gas/sechailer
|
||||
name = "security gas mask"
|
||||
desc = "A standard issue Security gas mask with integrated 'Compli-o-nator 3000' device. Plays over a dozen pre-recorded compliance phrases designed to get scumbags to stand still whilst you taze them. Do not tamper with the device."
|
||||
action_button_name = "HALT!"
|
||||
actions_types = list(/datum/action/item_action/halt, /datum/action/item_action/adjust)
|
||||
icon_state = "sechailer"
|
||||
ignore_maskadjust = 0
|
||||
flags = BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS
|
||||
flags_inv = HIDEFACIALHAIR|HIDEFACE
|
||||
w_class = 2
|
||||
@@ -21,10 +20,9 @@
|
||||
/obj/item/clothing/mask/gas/sechailer/swat
|
||||
name = "\improper SWAT mask"
|
||||
desc = "A close-fitting tactical mask with an especially aggressive Compli-o-nator 3000."
|
||||
action_button_name = "HALT!"
|
||||
actions_types = list(/datum/action/item_action/halt)
|
||||
icon_state = "swat"
|
||||
aggressiveness = 3
|
||||
ignore_maskadjust = 1
|
||||
flags_inv = HIDEFACIALHAIR|HIDEFACE|HIDEEYES|HIDEEARS
|
||||
visor_flags_inv = 0
|
||||
|
||||
@@ -34,11 +32,7 @@
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "taperecorder_idle"
|
||||
aggressiveness = 1 //Borgs are nicecurity!
|
||||
ignore_maskadjust = 1
|
||||
|
||||
/obj/item/clothing/mask/gas/sechailer/cyborg/New()
|
||||
..()
|
||||
verbs -= /obj/item/clothing/mask/gas/sechailer/verb/adjust
|
||||
actions_types = list(/datum/action/item_action/halt)
|
||||
|
||||
/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
@@ -61,10 +55,11 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/clothing/mask/gas/sechailer/verb/adjust()
|
||||
set category = "Object"
|
||||
set name = "Adjust Mask"
|
||||
adjustmask(usr)
|
||||
/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, actiontype)
|
||||
if(actiontype == /datum/action/item_action/halt)
|
||||
halt()
|
||||
else
|
||||
adjustmask(user)
|
||||
|
||||
/obj/item/clothing/mask/gas/sechailer/attack_self()
|
||||
halt()
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
gas_transfer_coefficient = 0.90
|
||||
permeability_coefficient = 0.01
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 25, rad = 0)
|
||||
action_button_name = "Adjust Sterile Mask"
|
||||
ignore_maskadjust = 0
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
|
||||
/obj/item/clothing/mask/surgical/attack_self(mob/user)
|
||||
adjustmask(user)
|
||||
@@ -47,7 +46,7 @@
|
||||
item_state = "pig"
|
||||
flags_inv = HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
|
||||
w_class = 2
|
||||
action_button_name = "Toggle Voice Box"
|
||||
actions_types = list(/datum/action/item_action/toggle_voice_box)
|
||||
var/voicechange = 0
|
||||
|
||||
/obj/item/clothing/mask/pig/attack_self(mob/user)
|
||||
@@ -110,7 +109,6 @@
|
||||
flags_inv = HIDEFACE|HIDEFACIALHAIR
|
||||
visor_flags_inv = HIDEFACE|HIDEFACIALHAIR
|
||||
slot_flags = SLOT_MASK
|
||||
ignore_maskadjust = 0
|
||||
adjusted_flags = SLOT_HEAD
|
||||
icon_state = "bandbotany"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
icon_state = "clown_prototype_off"
|
||||
var/on = 0
|
||||
var/datum/material_container/bananium
|
||||
action_button_name = "Toggle Shoes"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
|
||||
/obj/item/clothing/shoes/clown_shoes/banana_shoes/New()
|
||||
..()
|
||||
@@ -58,13 +58,13 @@
|
||||
var/ban_amt = bananium.amount(MAT_BANANIUM)
|
||||
user << "<span class='notice'>The shoes are [on ? "enabled" : "disabled"]. There is [ban_amt ? ban_amt : "no"] bananium left.</span>"
|
||||
|
||||
/obj/item/clothing/shoes/clown_shoes/banana_shoes/ui_action_click()
|
||||
/obj/item/clothing/shoes/clown_shoes/banana_shoes/ui_action_click(mob/user)
|
||||
if(bananium.amount(MAT_BANANIUM))
|
||||
on = !on
|
||||
update_icon()
|
||||
loc << "<span class='notice'>You [on ? "activate" : "deactivate"] the prototype shoes.</span>"
|
||||
user << "<span class='notice'>You [on ? "activate" : "deactivate"] the prototype shoes.</span>"
|
||||
else
|
||||
loc << "<span class='warning'>You need bananium to turn the prototype shoes on!</span>"
|
||||
user << "<span class='warning'>You need bananium to turn the prototype shoes on!</span>"
|
||||
|
||||
/obj/item/clothing/shoes/clown_shoes/banana_shoes/update_icon()
|
||||
if(on)
|
||||
@@ -72,3 +72,6 @@
|
||||
else
|
||||
icon_state = "clown_prototype_off"
|
||||
usr.update_inv_shoes()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
var/magboot_state = "magboots"
|
||||
var/magpulse = 0
|
||||
var/slowdown_active = 2
|
||||
action_button_name = "Toggle Magboots"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
strip_delay = 70
|
||||
put_on_delay = 70
|
||||
burn_state = FIRE_PROOF
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
desc = "An advanced spacesuit equipped with teleportation and anti-compression technology"
|
||||
icon_state = "chronosuit"
|
||||
item_state = "chronosuit"
|
||||
action_button_name = "Toggle Chronosuit"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
armor = list(melee = 60, bullet = 60, laser = 60, energy = 60, bomb = 30, bio = 90, rad = 90)
|
||||
var/list/chronosafe_items = list(/obj/item/weapon/chrono_eraser, /obj/item/weapon/gun/energy/chrono_gun)
|
||||
var/hands_nodrop_states
|
||||
@@ -93,8 +93,7 @@
|
||||
if(camera)
|
||||
camera.remove_target_ui()
|
||||
camera.loc = user
|
||||
if(teleport_now.button)
|
||||
teleport_now.button.UpdateIcon()
|
||||
teleport_now.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/suit/space/chronos/proc/chronowalk(atom/location)
|
||||
var/mob/living/carbon/human/user = src.loc
|
||||
@@ -108,8 +107,7 @@
|
||||
if(camera)
|
||||
camera.remove_target_ui()
|
||||
|
||||
if(teleport_now.button)
|
||||
teleport_now.button.UpdateIcon()
|
||||
teleport_now.UpdateButtonIcon()
|
||||
|
||||
var/list/nonsafe_slots = list(slot_belt, slot_back, slot_l_hand, slot_r_hand)
|
||||
for(var/slot in nonsafe_slots)
|
||||
@@ -331,16 +329,13 @@
|
||||
/datum/action/innate/chrono_teleport
|
||||
name = "Teleport Now"
|
||||
button_icon_state = "chrono_phase"
|
||||
check_flags = AB_CHECK_ALIVE|AB_CHECK_INSIDE
|
||||
check_flags = AB_CHECK_CONSCIOUS //|AB_CHECK_INSIDE
|
||||
var/obj/item/clothing/suit/space/chronos/chronosuit = null
|
||||
|
||||
/datum/action/innate/chrono_teleport/IsAvailable()
|
||||
return (!CheckRemoval(owner) && !chronosuit.teleporting)
|
||||
return (chronosuit && chronosuit.activated && chronosuit.camera && !chronosuit.teleporting)
|
||||
|
||||
/datum/action/innate/chrono_teleport/Activate()
|
||||
if(IsAvailable())
|
||||
if(chronosuit.camera)
|
||||
chronosuit.chronowalk(chronosuit.camera)
|
||||
|
||||
/datum/action/innate/chrono_teleport/CheckRemoval()
|
||||
return (..() && !(chronosuit && chronosuit.activated && chronosuit.camera))
|
||||
@@ -10,7 +10,7 @@
|
||||
var/on = 0
|
||||
var/obj/item/clothing/suit/space/hardsuit/suit
|
||||
item_color = "engineering" //Determines used sprites: hardsuit[on]-[color] and hardsuit[on]-[color]2 (lying down sprite)
|
||||
action_button_name = "Toggle Helmet Light"
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light)
|
||||
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/attack_self(mob/user)
|
||||
@@ -25,21 +25,31 @@
|
||||
user.AddLuminosity(brightness_on)
|
||||
else
|
||||
user.AddLuminosity(-brightness_on)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/pickup(mob/user)
|
||||
..()
|
||||
if(on)
|
||||
user.AddLuminosity(brightness_on)
|
||||
SetLuminosity(0)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/dropped(mob/user)
|
||||
..()
|
||||
if(on)
|
||||
user.AddLuminosity(-brightness_on)
|
||||
SetLuminosity(brightness_on)
|
||||
if(suit)
|
||||
suit.RemoveHelmet()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/item_action_slot_check(slot)
|
||||
if(slot == slot_head)
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/equipped(mob/user, slot)
|
||||
..()
|
||||
if(slot != slot_head)
|
||||
if(suit)
|
||||
suit.RemoveHelmet()
|
||||
@@ -69,19 +79,28 @@
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals,/obj/item/device/t_scanner, /obj/item/weapon/rcd, /obj/item/weapon/pipe_dispenser)
|
||||
siemens_coefficient = 0
|
||||
var/obj/item/clothing/head/helmet/space/hardsuit/helmet
|
||||
action_button_name = "Toggle Helmet"
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet)
|
||||
var/helmettype = /obj/item/clothing/head/helmet/space/hardsuit
|
||||
var/obj/item/weapon/tank/jetpack/suit/jetpack = null
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/equipped(mob/user, slot)
|
||||
..()
|
||||
if(slot == slot_wear_suit && jetpack)
|
||||
jetpack.cycle_action.Grant(user)
|
||||
if(jetpack)
|
||||
if(slot == slot_wear_suit)
|
||||
for(var/X in jetpack.actions)
|
||||
var/datum/action/A = X
|
||||
A.Grant(user)
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/dropped(mob/user)
|
||||
..()
|
||||
if(jetpack)
|
||||
jetpack.cycle_action.Remove(user)
|
||||
for(var/X in jetpack.actions)
|
||||
var/datum/action/A = X
|
||||
A.Remove(user)
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/item_action_slot_check(slot)
|
||||
if(slot == slot_wear_suit) //we only give the mob the ability to toggle the helmet if he's wearing the hardsuit.
|
||||
return 1
|
||||
|
||||
//Engineering
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/engine
|
||||
@@ -184,7 +203,7 @@
|
||||
armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
|
||||
on = 1
|
||||
var/obj/item/clothing/suit/space/hardsuit/syndi/linkedsuit = null
|
||||
action_button_name = "Toggle Helmet Mode"
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_mode)
|
||||
visor_flags_inv = HIDEMASK|HIDEEYES|HIDEFACE|HIDEFACIALHAIR
|
||||
visor_flags = STOPSPRESSUREDMAGE
|
||||
|
||||
@@ -226,6 +245,9 @@
|
||||
if(istype(user, /mob/living/carbon))
|
||||
var/mob/living/carbon/C = user
|
||||
C.head_update(src, forced = 1)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/syndi/proc/toggle_hardsuit_mode(mob/user) //Helmet Toggles Suit Mode
|
||||
if(linkedsuit)
|
||||
@@ -256,7 +278,6 @@
|
||||
item_state = "syndie_hardsuit"
|
||||
item_color = "syndi"
|
||||
w_class = 3
|
||||
action_button_name = "Toggle Helmet"
|
||||
armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
|
||||
allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword/saber,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/tank/internals)
|
||||
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/syndi
|
||||
@@ -373,15 +394,14 @@
|
||||
armor = list(melee = 30, bullet = 5, laser = 10, energy = 5, bomb = 100, bio = 100, rad = 60)
|
||||
var/obj/machinery/doppler_array/integrated/bomb_radar
|
||||
scan_reagents = 1
|
||||
actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/toggle_research_scanner)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/rd/New()
|
||||
..()
|
||||
bomb_radar = new /obj/machinery/doppler_array/integrated(src)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/rd/equipped(mob/living/carbon/human/user, slot)
|
||||
..(user, slot)
|
||||
user.scanner.Grant(user)
|
||||
user.scanner.devices += 1
|
||||
..()
|
||||
if(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic))
|
||||
user << ("<span class='warning'>Your [user.glasses] prevents you using [src]'s diagnostic visor HUD.</span>")
|
||||
else
|
||||
@@ -390,8 +410,7 @@
|
||||
DHUD.add_hud_to(user)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/rd/dropped(mob/living/carbon/human/user)
|
||||
..(user)
|
||||
user.scanner.devices = max(0, user.scanner.devices - 1)
|
||||
..()
|
||||
if(onboard_hud_enabled && !(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic)))
|
||||
var/datum/atom_hud/DHUD = huds[DATA_HUD_DIAGNOSTIC]
|
||||
DHUD.remove_hud_from(user)
|
||||
|
||||
@@ -44,7 +44,7 @@ Contains:
|
||||
strip_delay = 130
|
||||
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
|
||||
unacidable = 1
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/clothing/head/helmet/space/hardsuit/deathsquad/attack_self(mob/user)
|
||||
return
|
||||
@@ -262,7 +262,7 @@ Contains:
|
||||
item_state = "syndicate"
|
||||
armor = list(melee = -20, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 100, rad = 75) //As whimpy as a space carp
|
||||
brightness_on = 0 //luminosity when on
|
||||
action_button_name = ""
|
||||
actions_types = list()
|
||||
flags = STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ Contains:
|
||||
item_state = "hardsuit0-prt"
|
||||
item_color = "knight_grey"
|
||||
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/ert/paranormal
|
||||
name = "paranormal response team suit"
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
item_state = "reactiveoff"
|
||||
blood_overlay_type = "armor"
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
|
||||
action_button_name = "Toggle Armor"
|
||||
actions_types = list(/datum/action/item_action/toggle)
|
||||
unacidable = 1
|
||||
hit_reaction_chance = 50
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
body_parts_covered = CHEST|GROIN|LEGS|ARMS
|
||||
allowed = list(/obj/item/weapon/storage/book/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/internals/emergency_oxygen)
|
||||
hooded = 1
|
||||
action_button_name = "Toggle Chaplain Hoodie"
|
||||
hoodtype = /obj/item/clothing/head/chaplain_hood
|
||||
|
||||
/obj/item/clothing/head/chaplain_hood
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
togglename = "wings"
|
||||
body_parts_covered = ARMS|CHEST
|
||||
allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/weapon/gun/projectile,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/device/flashlight/seclite,/obj/item/weapon/melee/classic_baton/telescopic)
|
||||
action_button_name = "Toggle Owl Wings"
|
||||
actions_types = list(/datum/action/item_action/toggle_wings)
|
||||
|
||||
/obj/item/clothing/suit/toggle/owlwings/griffinwings
|
||||
name = "griffon cloak"
|
||||
@@ -215,7 +215,6 @@
|
||||
min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT //Space carp like space, so you should too
|
||||
allowed = list(/obj/item/weapon/tank/internals/emergency_oxygen, /obj/item/weapon/gun/projectile/automatic/speargun)
|
||||
hooded = 1
|
||||
action_button_name = "Toggle Carp Hood"
|
||||
hoodtype = /obj/item/clothing/head/carp_hood
|
||||
|
||||
/obj/item/clothing/head/carp_hood
|
||||
@@ -238,7 +237,6 @@
|
||||
//min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
|
||||
allowed = list(,)
|
||||
hooded = 1
|
||||
action_button_name = "Toggle Ian Hood"
|
||||
hoodtype = /obj/item/clothing/head/ian_hood
|
||||
|
||||
/obj/item/clothing/head/ian_hood
|
||||
@@ -259,7 +257,7 @@
|
||||
body_parts_covered = CHEST|GROIN|ARMS
|
||||
allowed = list(,)
|
||||
hooded = 1
|
||||
action_button_name = "Toggle Human Head"
|
||||
actions_types = list(/datum/action/item_action/toggle_human_head)
|
||||
hoodtype = /obj/item/clothing/head/human_head
|
||||
|
||||
/obj/item/clothing/head/human_head
|
||||
@@ -374,7 +372,6 @@
|
||||
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 10, rad = 0)
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/toy,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter)
|
||||
hooded = 1
|
||||
action_button_name = "Toggle Winter Hood"
|
||||
|
||||
/obj/item/clothing/head/winterhood
|
||||
name = "winter hood"
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
/obj/item/clothing/suit/hooded/ui_action_click()
|
||||
ToggleHood()
|
||||
|
||||
/obj/item/clothing/suit/hooded/item_action_slot_check(slot, mob/user)
|
||||
if(slot == slot_wear_suit)
|
||||
return 1
|
||||
|
||||
/obj/item/clothing/suit/hooded/equipped(mob/user, slot)
|
||||
if(slot != slot_wear_suit)
|
||||
RemoveHood()
|
||||
@@ -33,8 +37,12 @@
|
||||
H.unEquip(hood, 1)
|
||||
H.update_inv_wear_suit()
|
||||
hood.loc = src
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/suit/hooded/dropped()
|
||||
..()
|
||||
RemoveHood()
|
||||
|
||||
/obj/item/clothing/suit/hooded/proc/ToggleHood()
|
||||
@@ -52,6 +60,9 @@
|
||||
suittoggled = 1
|
||||
src.icon_state = "[initial(icon_state)]_t"
|
||||
H.update_inv_wear_suit()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
else
|
||||
RemoveHood()
|
||||
|
||||
@@ -84,6 +95,9 @@
|
||||
src.icon_state = "[initial(icon_state)]_t"
|
||||
src.suittoggled = 1
|
||||
usr.update_inv_wear_suit()
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/clothing/suit/toggle/examine(mob/user)
|
||||
..()
|
||||
@@ -140,6 +154,7 @@
|
||||
helmet.loc = src
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/dropped()
|
||||
..()
|
||||
RemoveHelmet()
|
||||
|
||||
/obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
item_state = "bl_suit"
|
||||
item_color = "black"
|
||||
desc = "It's a plain jumpsuit. It has a small dial on the wrist."
|
||||
action_button_name = "Change"
|
||||
actions_types = list(/datum/action/item_action/change)
|
||||
origin_tech = "syndicate=3"
|
||||
sensor_mode = 0 //Hey who's this guy on the Syndicate Shuttle??
|
||||
random_sensor = 0
|
||||
|
||||
@@ -308,10 +308,12 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow/pickup(mob/user)
|
||||
..()
|
||||
src.SetLuminosity(0)
|
||||
user.AddLuminosity(round(potency / 5,1))
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/berries/glow/dropped(mob/user)
|
||||
..()
|
||||
user.AddLuminosity(round(-potency / 5,1))
|
||||
src.SetLuminosity(round(potency / 5,1))
|
||||
|
||||
@@ -1222,10 +1224,12 @@ obj/item/weapon/reagent_containers/food/snacks/grown/shell/eggy/add_juice()
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user)
|
||||
..()
|
||||
SetLuminosity(0)
|
||||
user.AddLuminosity(round(potency / 10,1))
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
|
||||
..()
|
||||
user.AddLuminosity(round(-potency / 10,1))
|
||||
SetLuminosity(round(potency / 10,1))
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/grown/novaflower/pickup(mob/living/carbon/human/user)
|
||||
..()
|
||||
if(!user.gloves)
|
||||
user << "<span class='danger'>The [name] burns your bare hand!</span>"
|
||||
user.adjustFireLoss(rand(1, 5))
|
||||
@@ -184,6 +185,7 @@
|
||||
return (BRUTELOSS|TOXLOSS)
|
||||
|
||||
/obj/item/weapon/grown/nettle/pickup(mob/living/user)
|
||||
..()
|
||||
if(!iscarbon(user))
|
||||
return 0
|
||||
var/mob/living/carbon/C = user
|
||||
|
||||
@@ -263,4 +263,11 @@
|
||||
|
||||
var/obj/item/I = get_active_hand()
|
||||
if (I)
|
||||
I.equip_to_best_slot(src)
|
||||
I.equip_to_best_slot(src)
|
||||
|
||||
//used in code for items usable by both carbon and drones, this gives the proper back slot for each mob.(defibrillator, backpack watertank, ...)
|
||||
/mob/proc/getBackSlot()
|
||||
return slot_back
|
||||
|
||||
/mob/proc/getBeltSlot()
|
||||
return slot_belt
|
||||
@@ -5,34 +5,6 @@ These are general powers. Specific powers are stored under the appropriate alien
|
||||
/*Alien spit now works like a taser shot. It won't home in on the target but will act the same once it does hit.
|
||||
Doesn't work on other aliens/AI.*/
|
||||
|
||||
/datum/action/spell_action/alien
|
||||
|
||||
/datum/action/spell_action/alien/UpdateName()
|
||||
var/obj/effect/proc_holder/alien/ab = target
|
||||
return ab.name
|
||||
|
||||
/datum/action/spell_action/alien/IsAvailable()
|
||||
if(!target)
|
||||
return 0
|
||||
var/obj/effect/proc_holder/alien/ab = target
|
||||
|
||||
if(usr)
|
||||
return ab.cost_check(ab.check_turf,usr,1)
|
||||
else
|
||||
if(owner)
|
||||
return ab.cost_check(ab.check_turf,owner,1)
|
||||
return 1
|
||||
|
||||
/datum/action/spell_action/alien/CheckRemoval()
|
||||
if(!iscarbon(owner))
|
||||
return 1
|
||||
|
||||
var/mob/living/carbon/C = owner
|
||||
if(target.loc && !(target.loc in C.internal_organs))
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
/obj/effect/proc_holder/alien
|
||||
name = "Alien Power"
|
||||
@@ -46,6 +18,10 @@ Doesn't work on other aliens/AI.*/
|
||||
var/action_icon_state = "spell_default"
|
||||
var/action_background_icon_state = "bg_alien"
|
||||
|
||||
/obj/effect/proc_holder/alien/New()
|
||||
..()
|
||||
action = new(src)
|
||||
|
||||
/obj/effect/proc_holder/alien/Click()
|
||||
if(!istype(usr,/mob/living/carbon))
|
||||
return 1
|
||||
@@ -319,6 +295,10 @@ Doesn't work on other aliens/AI.*/
|
||||
if(!vessel) return 0
|
||||
vessel.storedPlasma = max(vessel.storedPlasma + amount,0)
|
||||
vessel.storedPlasma = min(vessel.storedPlasma, vessel.max_plasma) //upper limit of max_plasma, lower limit of 0
|
||||
for(var/X in abilities)
|
||||
var/obj/effect/proc_holder/alien/APH = X
|
||||
if(APH.has_action)
|
||||
APH.action.UpdateButtonIcon()
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/adjustPlasma(amount)
|
||||
|
||||
@@ -555,13 +555,6 @@ var/const/GALOSHES_DONT_HELP = 4
|
||||
abilities.Add(A)
|
||||
A.on_gain(src)
|
||||
if(A.has_action)
|
||||
if(!A.action)
|
||||
A.action = new/datum/action/spell_action/alien
|
||||
A.action.target = A
|
||||
A.action.name = A.name
|
||||
A.action.button_icon = A.action_icon
|
||||
A.action.button_icon_state = A.action_icon_state
|
||||
A.action.background_icon_state = A.action_background_icon_state
|
||||
A.action.Grant(src)
|
||||
sortInsert(abilities, /proc/cmp_abilities_cost, 0)
|
||||
|
||||
@@ -789,6 +782,7 @@ var/const/GALOSHES_DONT_HELP = 4
|
||||
throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed)
|
||||
else
|
||||
clear_alert("handcuffed")
|
||||
update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
|
||||
update_inv_handcuffed()
|
||||
update_hud_handcuffed()
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@
|
||||
wear_suit = I
|
||||
if(I.flags_inv & HIDEJUMPSUIT)
|
||||
update_inv_w_uniform()
|
||||
if(wear_suit.breakouttime) //when equipping a straightjacket
|
||||
update_action_buttons_icon() //certain action buttons will no longer be usable.
|
||||
update_inv_wear_suit()
|
||||
if(slot_w_uniform)
|
||||
w_uniform = I
|
||||
@@ -113,6 +115,8 @@
|
||||
if(I == wear_suit)
|
||||
if(s_store)
|
||||
unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.
|
||||
if(wear_suit.breakouttime) //when unequipping a straightjacket
|
||||
update_action_buttons_icon() //certain action buttons may be usable again.
|
||||
wear_suit = null
|
||||
if(I.flags_inv & HIDEJUMPSUIT)
|
||||
update_inv_w_uniform()
|
||||
|
||||
@@ -119,6 +119,12 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/species/proc/on_species_loss(mob/living/carbon/C)
|
||||
if(C.dna.species)
|
||||
if(C.dna.species.exotic_blood)
|
||||
var/datum/reagent/EB = C.dna.species.exotic_blood
|
||||
C.reagents.del_reagent(initial(EB.id))
|
||||
|
||||
/datum/species/proc/update_base_icon_state(mob/living/carbon/human/H)
|
||||
if(H.disabilities & HUSK)
|
||||
H.remove_overlay(SPECIES_LAYER) // races lose their color
|
||||
|
||||
@@ -240,11 +240,23 @@ var/regex/lizard_hiSS = new("S+", "g")
|
||||
burnmod = 0.5
|
||||
coldmod = 2
|
||||
heatmod = 0.5
|
||||
var/datum/action/innate/split_body/slime_split
|
||||
var/datum/action/innate/swap_body/callforward
|
||||
var/datum/action/innate/swap_body/callback
|
||||
|
||||
/datum/species/jelly/slime/on_species_loss(mob/living/carbon/C)
|
||||
if(slime_split)
|
||||
slime_split.Remove(C)
|
||||
if(callforward)
|
||||
callforward.Remove(C)
|
||||
if(callback)
|
||||
callback.Remove(C)
|
||||
..()
|
||||
|
||||
/datum/species/jelly/slime/spec_life(mob/living/carbon/human/H)
|
||||
if(recently_changed)
|
||||
var/datum/action/innate/split_body/S = new
|
||||
S.Grant(H)
|
||||
slime_split = new
|
||||
slime_split.Grant(H)
|
||||
|
||||
for(var/datum/reagent/toxin/slimejelly/S in H.reagents.reagent_list)
|
||||
if(S.volume >= 200)
|
||||
@@ -259,16 +271,10 @@ var/regex/lizard_hiSS = new("S+", "g")
|
||||
|
||||
/datum/action/innate/split_body
|
||||
name = "Split Body"
|
||||
check_flags = AB_CHECK_ALIVE
|
||||
check_flags = AB_CHECK_CONSCIOUS
|
||||
button_icon_state = "slimesplit"
|
||||
background_icon_state = "bg_alien"
|
||||
|
||||
/datum/action/innate/split_body/CheckRemoval()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!ishuman(H) || !H.dna || !H.dna.species || H.dna.species.id != "slime")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/action/innate/split_body/Activate()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
H << "<span class='notice'>You focus intently on moving your body while standing perfectly still...</span>"
|
||||
@@ -286,12 +292,13 @@ var/regex/lizard_hiSS = new("S+", "g")
|
||||
spare.Move(get_step(H.loc, pick(NORTH,SOUTH,EAST,WEST)))
|
||||
S.volume = 80
|
||||
H.notransform = 0
|
||||
var/datum/action/innate/swap_body/callforward = new /datum/action/innate/swap_body()
|
||||
var/datum/action/innate/swap_body/callback = new /datum/action/innate/swap_body()
|
||||
callforward.body = spare
|
||||
callforward.Grant(H)
|
||||
callback.body = H
|
||||
callback.Grant(spare)
|
||||
var/datum/species/jelly/slime/SS = H.dna.species
|
||||
SS.callforward = new
|
||||
SS.callforward.body = spare
|
||||
SS.callforward.Grant(H)
|
||||
SS.callback = new
|
||||
SS.callback.body = H
|
||||
SS.callback.Grant(spare)
|
||||
H.mind.transfer_to(spare)
|
||||
spare << "<span class='notice'>...and after a moment of disorentation, you're besides yourself!</span>"
|
||||
return
|
||||
@@ -301,17 +308,11 @@ var/regex/lizard_hiSS = new("S+", "g")
|
||||
|
||||
/datum/action/innate/swap_body
|
||||
name = "Swap Body"
|
||||
check_flags = AB_CHECK_ALIVE
|
||||
check_flags = AB_CHECK_CONSCIOUS
|
||||
button_icon_state = "slimeswap"
|
||||
background_icon_state = "bg_alien"
|
||||
var/mob/living/carbon/human/body
|
||||
|
||||
/datum/action/innate/swap_body/CheckRemoval()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!ishuman(H) || !H.dna || !H.dna.species || H.dna.species.id != "slime")
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/action/innate/swap_body/Activate()
|
||||
if(!body || !istype(body) || !body.dna || !body.dna.species || body.dna.species.id != "slime" || body.stat == DEAD || qdeleted(body))
|
||||
owner << "<span class='warning'>Something is wrong, you cannot sense your other body!</span>"
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
update_inv_back()
|
||||
if(slot_wear_mask)
|
||||
wear_mask = I
|
||||
wear_mask_update(I, toggle_off=0)
|
||||
wear_mask_update(I, toggle_off = 0)
|
||||
if(slot_head)
|
||||
head = I
|
||||
head_update(I)
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
|
||||
/mob/living/carbon/proc/get_breath_from_internal(volume_needed)
|
||||
if(internal)
|
||||
if (!contents.Find(internal))
|
||||
if(internal.loc != src)
|
||||
internal = null
|
||||
update_internals_hud_icon(0)
|
||||
else
|
||||
@@ -382,9 +382,3 @@
|
||||
if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects.
|
||||
//We totally need a sweat system cause it totally makes sense...~
|
||||
bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
|
||||
|
||||
|
||||
/mob/living/carbon/handle_actions()
|
||||
..()
|
||||
for(var/obj/item/I in internal_organs)
|
||||
give_action_button(I, 1)
|
||||
@@ -52,6 +52,7 @@
|
||||
blind_eyes(1)
|
||||
reset_perspective(null)
|
||||
hide_fullscreens()
|
||||
update_action_buttons_icon()
|
||||
update_damage_hud()
|
||||
update_health_hud()
|
||||
update_canmove()
|
||||
|
||||
@@ -49,10 +49,6 @@
|
||||
handle_disabilities() // eye, ear, brain damages
|
||||
handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
|
||||
|
||||
handle_actions()
|
||||
|
||||
handle_regular_hud_updates()
|
||||
|
||||
|
||||
|
||||
/mob/living/proc/handle_breathing()
|
||||
@@ -117,92 +113,7 @@
|
||||
if(ear_damage < 100)
|
||||
adjustEarDamage(-0.05,-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)
|
||||
give_action_button(I, 1)
|
||||
return
|
||||
|
||||
/mob/living/proc/give_action_button(var/obj/item/I, recursive = 0)
|
||||
if(I.action_button_name)
|
||||
if(!I.action)
|
||||
if(istype(I, /obj/item/organ/internal))
|
||||
I.action = new/datum/action/item_action/organ_action
|
||||
else 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)
|
||||
|
||||
if(recursive)
|
||||
for(var/obj/item/T in I)
|
||||
give_action_button(T, recursive - 1)
|
||||
|
||||
|
||||
/mob/living/proc/update_damage_hud()
|
||||
return
|
||||
|
||||
//this handles hud updates.
|
||||
/mob/living/proc/handle_regular_hud_updates()
|
||||
if(!client)
|
||||
return 0
|
||||
update_action_buttons()
|
||||
return 1
|
||||
|
||||
/mob/living/update_action_buttons()
|
||||
if(!hud_used) return
|
||||
if(!client) return
|
||||
|
||||
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
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
update_gravity(mob_has_gravity())
|
||||
|
||||
update_action_buttons()
|
||||
|
||||
if(malfhack)
|
||||
if(malfhack.aidisabled)
|
||||
src << "<span class='danger'>ERROR: APC access disabled, hack attempt canceled.</span>"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
handle_robot_hud_updates()
|
||||
handle_robot_cell()
|
||||
|
||||
/mob/living/silicon/robot/proc/handle_robot_cell()
|
||||
@@ -30,7 +30,7 @@
|
||||
update_headlamp()
|
||||
diag_hud_set_borgcell()
|
||||
|
||||
/mob/living/silicon/robot/handle_regular_hud_updates()
|
||||
/mob/living/silicon/robot/proc/handle_robot_hud_updates()
|
||||
if(!client)
|
||||
return
|
||||
|
||||
@@ -49,8 +49,7 @@
|
||||
if(!mind.special_role)
|
||||
mind.special_role = "traitor"
|
||||
ticker.mode.traitors += mind
|
||||
..()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/silicon/robot/update_health_hud()
|
||||
if(!client || !hud_used)
|
||||
@@ -117,4 +116,5 @@
|
||||
else
|
||||
canmove = 1
|
||||
update_transform()
|
||||
update_action_buttons_icon()
|
||||
return canmove
|
||||
|
||||
@@ -80,7 +80,6 @@
|
||||
equip_to_slot_or_del(I, slot_head)
|
||||
|
||||
access_card.flags |= NODROP
|
||||
scanner.Grant(src)
|
||||
|
||||
alert_drones(DRONE_NET_CONNECT)
|
||||
|
||||
|
||||
@@ -115,3 +115,9 @@
|
||||
|
||||
/mob/living/simple_animal/drone/stripPanelEquip(obj/item/what, mob/who, where)
|
||||
..(what, who, where, 1)
|
||||
|
||||
/mob/living/simple_animal/drone/getBackSlot()
|
||||
return slot_drone_storage
|
||||
|
||||
/mob/living/simple_animal/drone/getBeltSlot()
|
||||
return slot_drone_storage
|
||||
|
||||
@@ -586,6 +586,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/guardian_bomb/pickup(mob/living/user)
|
||||
..()
|
||||
detonate(user)
|
||||
return
|
||||
|
||||
|
||||
@@ -535,6 +535,7 @@
|
||||
else
|
||||
canmove = 1
|
||||
update_transform()
|
||||
update_action_buttons_icon()
|
||||
return canmove
|
||||
|
||||
/mob/living/simple_animal/update_transform()
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
M.regenerate_icons()
|
||||
is_adult = 0
|
||||
maxHealth = 150
|
||||
for(var/datum/action/innate/slime/reproduce/R in actions)
|
||||
R.Remove(src)
|
||||
var/datum/action/innate/slime/evolve/E = new
|
||||
E.Grant(src)
|
||||
revive(full_heal = 1)
|
||||
|
||||
@@ -230,6 +230,7 @@
|
||||
else if (nutrition >= get_grow_nutrition() && amount_grown < SLIME_EVOLUTION_THRESHOLD)
|
||||
nutrition -= 20
|
||||
amount_grown++
|
||||
update_action_buttons_icon()
|
||||
|
||||
if(amount_grown >= SLIME_EVOLUTION_THRESHOLD && !buckled && !Target && !ckey)
|
||||
if(is_adult)
|
||||
|
||||
@@ -6,22 +6,10 @@
|
||||
#define GROWTH_NEEDED 1
|
||||
|
||||
/datum/action/innate/slime
|
||||
check_flags = AB_CHECK_ALIVE
|
||||
check_flags = AB_CHECK_CONSCIOUS
|
||||
background_icon_state = "bg_alien"
|
||||
var/adult_action = SIZE_DOESNT_MATTER
|
||||
var/needs_growth = NO_GROWTH_NEEDED
|
||||
|
||||
/datum/action/innate/slime/CheckRemoval()
|
||||
if(!isslime(owner))
|
||||
return 1
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
if(adult_action != SIZE_DOESNT_MATTER)
|
||||
if(adult_action == ADULTS_ONLY && !S.is_adult)
|
||||
return 1
|
||||
else if(adult_action == BABIES_ONLY && S.is_adult)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/action/innate/slime/IsAvailable()
|
||||
if(..())
|
||||
var/mob/living/simple_animal/slime/S = owner
|
||||
@@ -120,6 +108,8 @@
|
||||
is_adult = 1
|
||||
maxHealth = 200
|
||||
amount_grown = 0
|
||||
for(var/datum/action/innate/slime/evolve/E in actions)
|
||||
E.Remove(src)
|
||||
regenerate_icons()
|
||||
name = text("[colour] [is_adult ? "adult" : "baby"] slime ([number])")
|
||||
else
|
||||
@@ -130,7 +120,6 @@
|
||||
/datum/action/innate/slime/evolve
|
||||
name = "Evolve"
|
||||
button_icon_state = "slimegrow"
|
||||
adult_action = BABIES_ONLY
|
||||
needs_growth = GROWTH_NEEDED
|
||||
|
||||
/datum/action/innate/slime/evolve/Activate()
|
||||
@@ -191,7 +180,6 @@
|
||||
/datum/action/innate/slime/reproduce
|
||||
name = "Reproduce"
|
||||
button_icon_state = "slimesplit"
|
||||
adult_action = ADULTS_ONLY
|
||||
needs_growth = GROWTH_NEEDED
|
||||
|
||||
/datum/action/innate/slime/reproduce/Activate()
|
||||
|
||||
+4
-12
@@ -708,6 +708,7 @@ var/next_mob_id = 0
|
||||
if(layer == MOB_LAYER - 0.2)
|
||||
layer = initial(layer)
|
||||
update_transform()
|
||||
update_action_buttons_icon()
|
||||
lying_prev = lying
|
||||
return canmove
|
||||
|
||||
@@ -887,18 +888,9 @@ var/next_mob_id = 0
|
||||
/mob/proc/setEarDamage()
|
||||
return
|
||||
|
||||
/mob/proc/AddSpell(obj/effect/proc_holder/spell/spell)
|
||||
mob_spell_list += spell
|
||||
if(!spell.action)
|
||||
spell.action = new/datum/action/spell_action
|
||||
spell.action.target = spell
|
||||
spell.action.name = spell.name
|
||||
spell.action.button_icon = spell.action_icon
|
||||
spell.action.button_icon_state = spell.action_icon_state
|
||||
spell.action.background_icon_state = spell.action_background_icon_state
|
||||
if(isliving(src))
|
||||
spell.action.Grant(src)
|
||||
return
|
||||
/mob/proc/AddSpell(obj/effect/proc_holder/spell/S)
|
||||
mob_spell_list += S
|
||||
S.action.Grant(src)
|
||||
|
||||
//override to avoid rotating pixel_xy on mobs
|
||||
/mob/shuttleRotate(rotation)
|
||||
|
||||
@@ -84,7 +84,6 @@
|
||||
var/datum/hud/hud_used = null
|
||||
|
||||
var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining.
|
||||
var/datum/action/innate/scan_mode/scanner = new
|
||||
|
||||
var/list/grabbed_by = list( )
|
||||
var/list/requests = list( )
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
add_logs(user, affecting, "attempted to put", src, "into [M]")
|
||||
|
||||
/obj/item/weapon/grab/dropped()
|
||||
..()
|
||||
qdel(src)
|
||||
|
||||
#undef UPGRADE_COOLDOWN
|
||||
|
||||
@@ -257,23 +257,26 @@ obj/item/weapon/gun/proc/newshot()
|
||||
else
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/attackby(obj/item/A, mob/user, params)
|
||||
if(istype(A, /obj/item/device/flashlight/seclite))
|
||||
var/obj/item/device/flashlight/seclite/S = A
|
||||
/obj/item/weapon/gun/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/device/flashlight/seclite))
|
||||
var/obj/item/device/flashlight/seclite/S = I
|
||||
if(can_flashlight)
|
||||
if(!F)
|
||||
if(!user.unEquip(A))
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
user << "<span class='notice'>You click [S] into place on [src].</span>"
|
||||
if(S.on)
|
||||
SetLuminosity(0)
|
||||
F = S
|
||||
A.loc = src
|
||||
I.loc = src
|
||||
update_icon()
|
||||
update_gunlight(user)
|
||||
verbs += /obj/item/weapon/gun/proc/toggle_gunlight
|
||||
var/datum/action/A = new /datum/action/item_action/toggle_gunlight(src)
|
||||
if(loc == user)
|
||||
A.Grant(user)
|
||||
|
||||
if(istype(A, /obj/item/weapon/screwdriver))
|
||||
if(istype(I, /obj/item/weapon/screwdriver))
|
||||
if(F)
|
||||
for(var/obj/item/device/flashlight/seclite/S in src)
|
||||
user << "<span class='notice'>You unscrew the seclite from [src].</span>"
|
||||
@@ -283,13 +286,13 @@ obj/item/weapon/gun/proc/newshot()
|
||||
S.update_brightness(user)
|
||||
update_icon()
|
||||
verbs -= /obj/item/weapon/gun/proc/toggle_gunlight
|
||||
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
|
||||
qdel(TGL)
|
||||
|
||||
if(unique_rename)
|
||||
if(istype(A, /obj/item/weapon/pen))
|
||||
if(istype(I, /obj/item/weapon/pen))
|
||||
rename_gun(user)
|
||||
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/proc/toggle_gunlight()
|
||||
set name = "Toggle Gunlight"
|
||||
@@ -311,7 +314,6 @@ obj/item/weapon/gun/proc/newshot()
|
||||
|
||||
/obj/item/weapon/gun/proc/update_gunlight(mob/user = null)
|
||||
if(F)
|
||||
action_button_name = "Toggle Gunlight"
|
||||
if(F.on)
|
||||
if(loc == user)
|
||||
user.AddLuminosity(F.brightness_on)
|
||||
@@ -324,14 +326,17 @@ obj/item/weapon/gun/proc/newshot()
|
||||
SetLuminosity(0)
|
||||
update_icon()
|
||||
else
|
||||
action_button_name = null
|
||||
if(loc == user)
|
||||
user.AddLuminosity(-5)
|
||||
else if(isturf(loc))
|
||||
SetLuminosity(0)
|
||||
return
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
|
||||
/obj/item/weapon/gun/pickup(mob/user)
|
||||
..()
|
||||
if(F)
|
||||
if(F.on)
|
||||
user.AddLuminosity(F.brightness_on)
|
||||
@@ -340,6 +345,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
azoom.Grant(user)
|
||||
|
||||
/obj/item/weapon/gun/dropped(mob/user)
|
||||
..()
|
||||
if(F)
|
||||
if(F.on)
|
||||
user.AddLuminosity(-F.brightness_on)
|
||||
@@ -426,7 +432,7 @@ obj/item/weapon/gun/proc/newshot()
|
||||
|
||||
/datum/action/toggle_scope_zoom
|
||||
name = "Toggle Scope"
|
||||
check_flags = AB_CHECK_ALIVE|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING
|
||||
check_flags = AB_CHECK_CONSCIOUS|AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING
|
||||
button_icon_state = "sniper_zoom"
|
||||
var/obj/item/weapon/gun/gun = null
|
||||
|
||||
@@ -443,7 +449,6 @@ obj/item/weapon/gun/proc/newshot()
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/gun/proc/zoom(mob/living/user, forced_zoom)
|
||||
if(!user || !user.client)
|
||||
return
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
can_flashlight = 0
|
||||
|
||||
/obj/item/weapon/gun/energy/gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow...
|
||||
..()
|
||||
src.loc = null//send it to nullspace to get retrieved by the implant later on. gotta cover those edge cases.
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted
|
||||
@@ -25,4 +26,5 @@
|
||||
materials = null
|
||||
|
||||
/obj/item/weapon/gun/energy/laser/mounted/dropped()
|
||||
..()
|
||||
src.loc = null
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
can_suppress = 1
|
||||
burst_size = 3
|
||||
fire_delay = 2
|
||||
action_button_name = "Toggle Firemode"
|
||||
actions_types = list(/datum/action/item_action/toggle_firemode)
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/proto
|
||||
name = "\improper NanoTrasen Saber SMG"
|
||||
@@ -67,7 +67,9 @@
|
||||
|
||||
playsound(user, 'sound/weapons/empty.ogg', 100, 1)
|
||||
update_icon()
|
||||
return
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/can_shoot()
|
||||
return get_ammo()
|
||||
@@ -118,7 +120,7 @@
|
||||
fire_delay = 2
|
||||
can_suppress = 0
|
||||
burst_size = 0
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/wt550/update_icon()
|
||||
..()
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
mag_type = /obj/item/ammo_box/magazine/m75
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/gyropistol/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
..()
|
||||
@@ -62,7 +62,7 @@
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
select = 0
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/speargun/update_icon()
|
||||
return
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
can_suppress = 1
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/pistol/update_icon()
|
||||
..()
|
||||
@@ -55,4 +55,4 @@
|
||||
can_suppress = 0
|
||||
burst_size = 3
|
||||
fire_delay = 2
|
||||
action_button_name = "Toggle Firemode"
|
||||
actions_types = list(/datum/action/item_action/toggle_firemode)
|
||||
@@ -36,7 +36,7 @@
|
||||
fire_delay = 2
|
||||
can_suppress = 0
|
||||
burst_size = 0
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
fire_sound = 'sound/weapons/Laser.ogg'
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/laser/process_chamber(eject_casing = 0, empty_chamber = 1)
|
||||
|
||||
@@ -134,6 +134,7 @@
|
||||
pump()
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/dropped()
|
||||
..()
|
||||
guns_left = 0
|
||||
|
||||
/obj/item/weapon/gun/projectile/shotgun/boltaction/enchanted/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
|
||||
@@ -311,7 +312,7 @@
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
pin = /obj/item/device/firing_pin/implant/pindicate
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/shotgun/bulldog/unrestricted
|
||||
pin = /obj/item/device/firing_pin
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
can_suppress = 0
|
||||
burst_size = 1
|
||||
fire_delay = 0
|
||||
action_button_name = null
|
||||
actions_types = list()
|
||||
|
||||
/obj/item/weapon/gun/projectile/automatic/toy/pistol/update_icon()
|
||||
..()
|
||||
|
||||
@@ -156,6 +156,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
|
||||
/obj/effect/proc_holder/spell/New()
|
||||
..()
|
||||
action = new(src)
|
||||
|
||||
still_recharging_msg = "<span class='notice'>[name] is still recharging.</span>"
|
||||
charge_counter = charge_max
|
||||
@@ -169,9 +170,13 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
return
|
||||
|
||||
/obj/effect/proc_holder/spell/proc/start_recharge()
|
||||
if(action)
|
||||
action.UpdateButtonIcon()
|
||||
while(charge_counter < charge_max && isnull(gc_destroyed))
|
||||
sleep(1)
|
||||
charge_counter++
|
||||
if(action)
|
||||
action.UpdateButtonIcon()
|
||||
|
||||
/obj/effect/proc_holder/spell/proc/perform(list/targets, recharge = 1, mob/user = usr) //if recharge is started is important for the trigger spells
|
||||
before_cast(targets)
|
||||
|
||||
@@ -31,12 +31,13 @@
|
||||
name = "Activate Pill"
|
||||
|
||||
/datum/action/item_action/hands_free/activate_pill/Trigger()
|
||||
if(!..() || CheckRemoval(owner))
|
||||
if(!..())
|
||||
return 0
|
||||
owner << "<span class='caution'>You grit your teeth and burst the implanted [target]!</span>"
|
||||
add_logs(owner, null, "swallowed an implanted pill", target)
|
||||
if(target.reagents.total_volume)
|
||||
target.reagents.reaction(owner, INGEST)
|
||||
target.reagents.trans_to(owner, target.reagents.total_volume)
|
||||
Remove(owner)
|
||||
qdel(target)
|
||||
return 1
|
||||
@@ -47,7 +47,7 @@
|
||||
implant_color = "#DE7E00"
|
||||
slot = "brain_antidrop"
|
||||
origin_tech = "materials=5;programming=4;biotech=4"
|
||||
organ_action_name = "Toggle Anti-Drop"
|
||||
actions_types = list(/datum/action/item_action/organ_action/toggle)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/brain/anti_drop/ui_action_click()
|
||||
active = !active
|
||||
@@ -260,7 +260,7 @@
|
||||
implant_color = "#007ACC"
|
||||
slot = "shoulders"
|
||||
origin_tech = "materials=5;biotech=4;powerstorage=4"
|
||||
organ_action_name = "Toggle Arm Mod"
|
||||
actions_types = list(/datum/action/item_action/organ_action/toggle)
|
||||
var/obj/holder//is defined as the retractable item itself. ensure this is defined somewhere!
|
||||
var/out = 0//determines if the item is in the owner's hand or not
|
||||
var/overloaded = 0//is set to 1 when owner gets EMPed. if set to 1, implant doesn't work.
|
||||
@@ -309,7 +309,7 @@
|
||||
desc = "A variant of the arm cannon implant that fires electrodes and disabler shots. The cannon emerges from the subject's arms and remains in the shoulders when not in use."
|
||||
icon_state = "armcannon_tase_implant"
|
||||
origin_tech = "materials=5;combat=5;biotech=4;powerstorage=4"
|
||||
organ_action_name = "Toggle Arm Cannon Taser"
|
||||
actions_types = list(/datum/action/item_action/organ_action/toggle)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/arm_mod/tase/New()//when the implant is created...
|
||||
holder = new /obj/item/weapon/gun/energy/gun/advtaser/mounted(src)//assign a brand new item to it. (in this case, a gun)
|
||||
@@ -319,7 +319,7 @@
|
||||
desc = "A variant of the arm cannon implant that fires lethal laser beams. The cannon emerges from the subject's arms and remains in the shoulders when not in use."
|
||||
icon_state = "armcannon_lase_implant"
|
||||
origin_tech = "materials=5;combat=5;biotech=4;powerstorage=4;syndicate=5"//this is kinda nutty and i might lower it
|
||||
organ_action_name = "Toggle Arm Cannon Laser"
|
||||
actions_types = list(/datum/action/item_action/organ_action/toggle)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/arm_mod/lase/New()
|
||||
holder = new /obj/item/weapon/gun/energy/laser/mounted(src)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
var/zone = "chest"
|
||||
var/slot
|
||||
var/vital = 0
|
||||
var/organ_action_name = null
|
||||
|
||||
/obj/item/organ/internal/proc/Insert(mob/living/carbon/M, special = 0)
|
||||
if(!iscarbon(M) || owner == M)
|
||||
@@ -19,9 +18,9 @@
|
||||
owner = M
|
||||
M.internal_organs |= src
|
||||
loc = null
|
||||
if(organ_action_name)
|
||||
action_button_name = organ_action_name
|
||||
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Grant(src)
|
||||
|
||||
/obj/item/organ/internal/proc/Remove(mob/living/carbon/M, special = 0)
|
||||
owner = null
|
||||
@@ -29,9 +28,9 @@
|
||||
M.internal_organs -= src
|
||||
if(vital && !special)
|
||||
M.death()
|
||||
|
||||
if(organ_action_name)
|
||||
action_button_name = null
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Remove(M)
|
||||
|
||||
/obj/item/organ/internal/proc/on_find(mob/living/finder)
|
||||
return
|
||||
@@ -76,6 +75,9 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/item_action_slot_check(slot,mob/user)
|
||||
return //so we don't grant the organ's action to mobs who pick up the organ.
|
||||
|
||||
//Looking for brains?
|
||||
//Try code/modules/mob/living/carbon/brain/brain_item.dm
|
||||
|
||||
|
||||
Reference in New Issue
Block a user