Merge pull request #16096 from SandPoot/actions
Fixes MAJOR (maybe not) issues with actions
This commit is contained in:
@@ -254,7 +254,7 @@
|
||||
/datum/team/cult
|
||||
name = "Cult"
|
||||
|
||||
var/blood_target
|
||||
var/atom/blood_target
|
||||
var/image/blood_target_image
|
||||
var/blood_target_reset_timer
|
||||
|
||||
|
||||
@@ -363,8 +363,8 @@
|
||||
addtimer(CALLBACK(owner, TYPE_PROC_REF(/mob, update_action_buttons_icon)), base_cooldown)
|
||||
C.cult_team.blood_target_image = image('icons/effects/cult_target.dmi', target, "glow", ABOVE_MOB_LAYER)
|
||||
C.cult_team.blood_target_image.appearance_flags = RESET_COLOR
|
||||
C.cult_team.blood_target_image.pixel_x = -target.pixel_x
|
||||
C.cult_team.blood_target_image.pixel_y = -target.pixel_y
|
||||
C.cult_team.blood_target_image.pixel_x = -C.cult_team.blood_target.pixel_x
|
||||
C.cult_team.blood_target_image.pixel_y = -C.cult_team.blood_target.pixel_y
|
||||
SEND_SOUND(owner, sound(pick('sound/hallucinations/over_here2.ogg','sound/hallucinations/over_here3.ogg'),0,1,75))
|
||||
owner.client.images += C.cult_team.blood_target_image
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
|
||||
@@ -212,13 +212,15 @@
|
||||
UpdateButtons()
|
||||
|
||||
/datum/action/item_action/chameleon/change/proc/update_item(obj/item/picked_item)
|
||||
target.name = initial(picked_item.name)
|
||||
target.desc = initial(picked_item.desc)
|
||||
target.icon_state = initial(picked_item.icon_state)
|
||||
if(isitem(target))
|
||||
var/obj/item/I = target
|
||||
var/obj/item/chameleon_item = target
|
||||
|
||||
chameleon_item.name = initial(picked_item.name)
|
||||
chameleon_item.desc = initial(picked_item.desc)
|
||||
chameleon_item.icon_state = initial(picked_item.icon_state)
|
||||
if(isitem(chameleon_item))
|
||||
var/obj/item/I = chameleon_item
|
||||
I.item_state = initial(picked_item.item_state)
|
||||
var/obj/item/clothing/CL = target
|
||||
var/obj/item/clothing/CL = chameleon_item
|
||||
var/obj/item/clothing/PCL = new picked_item
|
||||
if(istype(CL) && istype(PCL))
|
||||
CL.flags_cover = PCL.flags_cover
|
||||
@@ -226,7 +228,7 @@
|
||||
CL.mutantrace_variation = PCL.mutantrace_variation
|
||||
CL.mob_overlay_icon = PCL.mob_overlay_icon
|
||||
qdel(PCL)
|
||||
target.icon = initial(picked_item.icon)
|
||||
chameleon_item.icon = initial(picked_item.icon)
|
||||
|
||||
/datum/action/item_action/chameleon/change/pda/update_item(obj/item/pda/picked_item)
|
||||
if(!istype(target, /obj/item/pda))
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
networks = list("ss13")
|
||||
var/obj/item/construction/rcd/internal/RCD //Internal RCD. The computer passes user commands to this in order to avoid massive copypaste.
|
||||
circuit = /obj/item/circuitboard/computer/base_construction
|
||||
off_action = new/datum/action/innate/camera_off/base_construction
|
||||
off_action = /datum/action/innate/camera_off/base_construction
|
||||
jump_action = null
|
||||
var/datum/action/innate/aux_base/switch_mode/switch_mode_action = new //Action for switching the RCD's build modes
|
||||
var/datum/action/innate/aux_base/build/build_action = new //Action for using the RCD
|
||||
var/datum/action/innate/aux_base/airlock_type/airlock_mode_action = new //Action for setting the airlock type
|
||||
var/datum/action/innate/aux_base/window_type/window_action = new //Action for setting the window type
|
||||
var/datum/action/innate/aux_base/place_fan/fan_action = new //Action for spawning fans
|
||||
var/datum/action/innate/aux_base/switch_mode/switch_mode_action = /datum/action/innate/aux_base/switch_mode //Action for switching the RCD's build modes
|
||||
var/datum/action/innate/aux_base/build/build_action = /datum/action/innate/aux_base/build //Action for using the RCD
|
||||
var/datum/action/innate/aux_base/airlock_type/airlock_mode_action = /datum/action/innate/aux_base/airlock_type //Action for setting the airlock type
|
||||
var/datum/action/innate/aux_base/window_type/window_action = /datum/action/innate/aux_base/window_type //Action for setting the window type
|
||||
var/datum/action/innate/aux_base/place_fan/fan_action = /datum/action/innate/aux_base/place_fan //Action for spawning fans
|
||||
var/fans_remaining = 0 //Number of fans in stock.
|
||||
var/datum/action/innate/aux_base/install_turret/turret_action = new //Action for spawning turrets
|
||||
var/datum/action/innate/aux_base/install_turret/turret_action = /datum/action/innate/aux_base/install_turret //Action for spawning turrets
|
||||
var/turret_stock = 0 //Turrets in stock
|
||||
var/obj/machinery/computer/auxillary_base/found_aux_console //Tracker for the Aux base console, so the eye can always find it.
|
||||
|
||||
@@ -58,6 +58,9 @@
|
||||
|
||||
/obj/machinery/computer/camera_advanced/base_construction/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
populate_actions_list()
|
||||
|
||||
RCD = new(src)
|
||||
RCD.console = src
|
||||
if(mapload) //Map spawned consoles have a filled RCD and stocked special structures
|
||||
@@ -65,6 +68,20 @@
|
||||
fans_remaining = 4
|
||||
turret_stock = 4
|
||||
|
||||
/**
|
||||
* Fill the construction_actios list with actions
|
||||
*
|
||||
* Instantiate each action object that we'll be giving to users of
|
||||
* this console, and put it in the actions list
|
||||
*/
|
||||
/obj/machinery/computer/camera_advanced/base_construction/proc/populate_actions_list()
|
||||
actions += new switch_mode_action(src)
|
||||
actions += new build_action(src)
|
||||
actions += new airlock_mode_action(src)
|
||||
actions += new window_action(src)
|
||||
actions += new fan_action(src)
|
||||
actions += new turret_action(src)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/base_construction/CreateEye()
|
||||
|
||||
var/spawn_spot
|
||||
@@ -94,43 +111,12 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/base_construction/GrantActions(mob/living/user)
|
||||
..()
|
||||
|
||||
if(switch_mode_action)
|
||||
switch_mode_action.target = src
|
||||
switch_mode_action.Grant(user)
|
||||
actions += switch_mode_action
|
||||
|
||||
if(build_action)
|
||||
build_action.target = src
|
||||
build_action.Grant(user)
|
||||
actions += build_action
|
||||
|
||||
if(airlock_mode_action)
|
||||
airlock_mode_action.target = src
|
||||
airlock_mode_action.Grant(user)
|
||||
actions += airlock_mode_action
|
||||
|
||||
if(window_action)
|
||||
window_action.target = src
|
||||
window_action.Grant(user)
|
||||
actions += window_action
|
||||
|
||||
if(fan_action)
|
||||
fan_action.target = src
|
||||
fan_action.Grant(user)
|
||||
actions += fan_action
|
||||
|
||||
if(turret_action)
|
||||
turret_action.target = src
|
||||
turret_action.Grant(user)
|
||||
actions += turret_action
|
||||
|
||||
eyeobj.invisibility = 0 //When the eye is in use, make it visible to players so they know when someone is building.
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/camera_advanced/base_construction/remove_eye_control(mob/living/user)
|
||||
..()
|
||||
eyeobj.invisibility = INVISIBILITY_MAXIMUM //Hide the eye when not in use.
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/aux_base //Parent aux base action
|
||||
icon_icon = 'icons/mob/actions/actions_construction.dmi'
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
desc = "A computer used for remotely handling slimes."
|
||||
networks = list("ss13")
|
||||
circuit = /obj/item/circuitboard/computer/xenobiology
|
||||
var/datum/action/innate/slime_place/slime_place_action
|
||||
var/datum/action/innate/slime_pick_up/slime_up_action
|
||||
var/datum/action/innate/feed_slime/feed_slime_action
|
||||
var/datum/action/innate/monkey_recycle/monkey_recycle_action
|
||||
var/datum/action/innate/slime_scan/scan_action
|
||||
var/datum/action/innate/feed_potion/potion_action
|
||||
var/datum/action/innate/hotkey_help/hotkey_help
|
||||
var/datum/action/innate/slime_place/slime_place_action = /datum/action/innate/slime_place
|
||||
var/datum/action/innate/slime_pick_up/slime_up_action = /datum/action/innate/slime_pick_up
|
||||
var/datum/action/innate/feed_slime/feed_slime_action = /datum/action/innate/feed_slime
|
||||
var/datum/action/innate/monkey_recycle/monkey_recycle_action = /datum/action/innate/monkey_recycle
|
||||
var/datum/action/innate/slime_scan/scan_action = /datum/action/innate/slime_scan
|
||||
var/datum/action/innate/feed_potion/potion_action = /datum/action/innate/feed_potion
|
||||
var/datum/action/innate/hotkey_help/hotkey_help = /datum/action/innate/hotkey_help
|
||||
|
||||
var/list/stored_slimes
|
||||
var/obj/item/slimepotion/slime/current_potion
|
||||
@@ -43,16 +43,16 @@
|
||||
|
||||
/obj/machinery/computer/camera_advanced/xenobio/Initialize(mapload)
|
||||
. = ..()
|
||||
slime_place_action = new
|
||||
slime_up_action = new
|
||||
feed_slime_action = new
|
||||
monkey_recycle_action = new
|
||||
scan_action = new
|
||||
potion_action = new
|
||||
hotkey_help = new
|
||||
|
||||
generate_actions()
|
||||
|
||||
stored_slimes = list()
|
||||
RegisterSignal(src, COMSIG_ATOM_CONTENTS_DEL, PROC_REF(on_contents_del))
|
||||
|
||||
/obj/machinery/computer/camera_advanced/xenobio/proc/generate_actions()
|
||||
actions += new scan_action(src)
|
||||
actions += new hotkey_help(src)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/xenobio/Destroy()
|
||||
stored_slimes = null
|
||||
QDEL_NULL(current_potion)
|
||||
@@ -72,41 +72,6 @@
|
||||
/obj/machinery/computer/camera_advanced/xenobio/GrantActions(mob/living/user)
|
||||
..()
|
||||
|
||||
if(slime_up_action && (upgradetier & XENOBIO_UPGRADE_SLIMEBASIC)) //CIT CHANGE - makes slime-related actions require XENOBIO_UPGRADE_SLIMEBASIC
|
||||
slime_up_action.target = src
|
||||
slime_up_action.Grant(user)
|
||||
actions += slime_up_action
|
||||
|
||||
if(slime_place_action && (upgradetier & XENOBIO_UPGRADE_SLIMEBASIC)) //CIT CHANGE - makes slime-related actions require XENOBIO_UPGRADE_SLIMEBASIC
|
||||
slime_place_action.target = src
|
||||
slime_place_action.Grant(user)
|
||||
actions += slime_place_action
|
||||
|
||||
if(feed_slime_action && (upgradetier & XENOBIO_UPGRADE_MONKEYS)) //CIT CHANGE - makes monkey-related actions require XENOBIO_UPGRADE_MONKEYS
|
||||
feed_slime_action.target = src
|
||||
feed_slime_action.Grant(user)
|
||||
actions += feed_slime_action
|
||||
|
||||
if(monkey_recycle_action && (upgradetier & XENOBIO_UPGRADE_MONKEYS)) //CIT CHANGE - makes monkey-related actions require XENOBIO_UPGRADE_MONKEYS
|
||||
monkey_recycle_action.target = src
|
||||
monkey_recycle_action.Grant(user)
|
||||
actions += monkey_recycle_action
|
||||
|
||||
if(scan_action)
|
||||
scan_action.target = src
|
||||
scan_action.Grant(user)
|
||||
actions += scan_action
|
||||
|
||||
if(potion_action && (upgradetier & XENOBIO_UPGRADE_SLIMEADV)) // CIT CHANGE - makes giving slimes potions via console require XENOBIO_UPGRADE_SLIMEADV
|
||||
potion_action.target = src
|
||||
potion_action.Grant(user)
|
||||
actions += potion_action
|
||||
|
||||
if(hotkey_help)
|
||||
hotkey_help.target = src
|
||||
hotkey_help.Grant(user)
|
||||
actions += hotkey_help
|
||||
|
||||
RegisterSignal(user, COMSIG_XENO_SLIME_CLICK_CTRL, PROC_REF(XenoSlimeClickCtrl))
|
||||
RegisterSignal(user, COMSIG_XENO_SLIME_CLICK_ALT, PROC_REF(XenoSlimeClickAlt))
|
||||
RegisterSignal(user, COMSIG_XENO_SLIME_CLICK_SHIFT, PROC_REF(XenoSlimeClickShift))
|
||||
@@ -139,10 +104,21 @@
|
||||
else
|
||||
upgradetier |= I
|
||||
successfulupgrade = TRUE
|
||||
if(I == XENOBIO_UPGRADE_SLIMEBASIC)
|
||||
actions += new slime_up_action(src)
|
||||
actions += new slime_place_action(src)
|
||||
if(I == XENOBIO_UPGRADE_SLIMEADV)
|
||||
actions += new potion_action(src)
|
||||
max_slimes = 10
|
||||
if(I == XENOBIO_UPGRADE_MONKEYS)
|
||||
actions += new feed_slime_action(src)
|
||||
actions += new monkey_recycle_action(src)
|
||||
if(successfulupgrade)
|
||||
to_chat(user, "<span class='notice'>You have successfully upgraded [src] with [O].</span>")
|
||||
|
||||
for(var/datum/action/actions_removed as anything in actions)
|
||||
actions_removed.Remove(current_user)
|
||||
GrantActions(current_user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] already has the contents of [O] installed!</span>")
|
||||
return
|
||||
|
||||
@@ -33,10 +33,11 @@
|
||||
/datum/action/item_action/hands_free/activate_pill/Trigger()
|
||||
if(!..())
|
||||
return FALSE
|
||||
to_chat(owner, "<span class='caution'>You grit your teeth and burst the implanted [target.name]!</span>")
|
||||
var/obj/item/item_target = target
|
||||
to_chat(owner, span_notice("You grit your teeth and burst the implanted [item_target.name]!"))
|
||||
log_combat(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, log = "dental pill swallow")
|
||||
if(item_target.reagents.total_volume)
|
||||
item_target.reagents.reaction(owner, INGEST)
|
||||
item_target.reagents.trans_to(owner, item_target.reagents.total_volume, log = "dental pill swallow")
|
||||
qdel(target)
|
||||
return TRUE
|
||||
|
||||
Reference in New Issue
Block a user