Skip to content

Commit

Permalink
QoL Changes (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
DTraitor authored Aug 4, 2023
1 parent ac75bd7 commit 0395768
Show file tree
Hide file tree
Showing 24 changed files with 106 additions and 41 deletions.
2 changes: 1 addition & 1 deletion code/modules/mob/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
if(zMove(DOWN, z_move_flags = ZMOVE_FEEDBACK))
to_chat(src, span_notice("You move down."))

/mob/camera/can_z_move(direction, turf/start, turf/destination, z_move_flags = NONE, mob/living/rider)
/mob/camera/can_z_move(direction, turf/start, z_move_flags = NONE, mob/living/rider)
z_move_flags |= ZMOVE_IGNORE_OBSTACLES //cameras do not respect these FLOORS you speak so much of
return ..()

Expand Down
3 changes: 2 additions & 1 deletion daedalus.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4729,7 +4729,8 @@
#include "deadspace\code\game\objects\structures\obstacles.dm"
#include "deadspace\code\game\turfs\floors.dm"
#include "deadspace\code\game\turfs\walls.dm"
#include "deadspace\code\marker\hud.dm"
#include "deadspace\code\marker\hud_marker.dm"
#include "deadspace\code\marker\hud_signal.dm"
#include "deadspace\code\marker\marker.dm"
#include "deadspace\code\marker\marker_defines.dm"
#include "deadspace\code\marker\abilities\absorb.dm"
Expand Down
10 changes: 10 additions & 0 deletions deadspace/code/corruption/action.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/datum/action/cooldown/necro/corruption
name = "Generic corruption placement ability"
button_icon = 'deadspace/icons/hud/action_corruption.dmi'
cooldown_time = 0.1 SECONDS
click_to_activate = TRUE
var/cost = 0
Expand All @@ -25,6 +26,15 @@
owner.client.images -= template
template.loc = null

/datum/action/cooldown/necro/corruption/InterceptClickOn(mob/living/caller, params, atom/target)
var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, RIGHT_CLICK))
if(unset_after_click)
unset_click_ability(caller, refund_cooldown = TRUE)
caller.next_click = world.time + click_cd_override
return
return ..()

/datum/action/cooldown/necro/corruption/Activate(atom/target)
var/mob/camera/marker_signal/signal = owner
var/current_biomass = istype(signal, /mob/camera/marker_signal/marker) ? signal.marker.marker_biomass : signal.marker.signal_biomass
Expand Down
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/bioluminescence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@

/datum/action/cooldown/necro/corruption/lamp
name = "Bioluminescence"
button_icon_state = "bioluminescence"
place_structure = /obj/structure/necromorph/lamp
cost = 10
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/branch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@

/datum/action/cooldown/necro/corruption/branch
name = "Branch"
button_icon_state = "minigrowth"
place_structure = /obj/structure/necromorph/node/branch
cost = 5
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/cyst.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

/datum/action/cooldown/necro/corruption/cyst
name = "Cyst"
button_icon_state = "cyst"
place_structure = /obj/structure/necromorph/cyst
cost = 50

Expand Down
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/eye.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

/datum/action/cooldown/necro/corruption/eye
name = "Eye"
button_icon_state = "eye"
place_structure = /obj/structure/necromorph/eye
cost = 50

Expand Down
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/harvester.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@

/datum/action/cooldown/necro/corruption/harvester
name = "Harvester"
button_icon_state = "harvester"
place_structure = /obj/structure/necromorph/harvester
cost = 50
marker_only = TRUE
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/nest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

/datum/action/cooldown/necro/corruption/nest
name = "Nest"
button_icon_state = "nest"
place_structure = /obj/structure/necromorph/nest
cost = 110
marker_only = TRUE
Expand Down
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/propagator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

/datum/action/cooldown/necro/corruption/propagator
name = "Propagator"
button_icon_state = "propagator"
place_structure = /obj/structure/necromorph/node/propagator
cost = 20
marker_only = TRUE
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/root.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@

/datum/action/cooldown/necro/corruption/root
name = "Root"
button_icon_state = "minigrowth"
place_structure = /obj/structure/necromorph/node/root
cost = 10
1 change: 1 addition & 0 deletions deadspace/code/corruption/structures/snare.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

/datum/action/cooldown/necro/corruption/snare
name = "Snare"
button_icon_state = "snare"
place_structure = /obj/structure/necromorph/snare
cost = 40
1 change: 1 addition & 0 deletions deadspace/code/marker/abilities/bloody_rune.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum/action/cooldown/necro/psy/rune
name = "Bloody Rune"
desc = "Creates a spooky rune. Has no functional effects, just for decoration. Should be at least 3 tiles away from another bloody rune!"
button_icon_state = "rune"
cost = 16

/datum/action/cooldown/necro/psy/rune/Activate(atom/target)
Expand Down
1 change: 1 addition & 0 deletions deadspace/code/marker/abilities/bloody_scrawl.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum/action/cooldown/necro/psy/scrawl
name = "Bloody Scrawl"
desc = "Writes a message in blood. Should be at least 3 tiles away from another bloody scrawl!"
button_icon_state = "writing"
cost = 15

/datum/action/cooldown/necro/psy/scrawl/Activate(atom/target)
Expand Down
2 changes: 1 addition & 1 deletion deadspace/code/marker/abilities/false_sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
if(!target)
return
//Add more necromorphs here, perhaps we should make it a define to make sure it's updated
var/list/category = GLOB.necromorph_sounds[tgui_input_list(owner, "Pick a necromorph type", "False Sound", GLOB.necromorph_sounds)]
var/list/category = tgui_input_list(owner, "Pick a necromorph type", "False Sound", GLOB.necromorph_sounds)
if(!category)
return TRUE
var/list/picked_sound = tgui_input_list(owner, "Pick sound type to play", "False Sound", category)
Expand Down
9 changes: 8 additions & 1 deletion deadspace/code/marker/abilities/psy_ability.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

/// Intercepts client owner clicks to activate the ability
/datum/action/cooldown/necro/psy/InterceptClickOn(mob/camera/marker_signal/caller, params, atom/target)
var/list/modifiers = params2list(params)

if(LAZYACCESS(modifiers, RIGHT_CLICK))
if(unset_after_click)
unset_click_ability(caller, refund_cooldown = TRUE)
caller.next_click = world.time + click_cd_override
return

if(!IsAvailable())
return FALSE
if(!target)
Expand All @@ -24,7 +32,6 @@
if(istype(target, /atom/movable/screen/cameranet_static))
if(!click_through_static)
return FALSE
var/list/modifiers = params2list(params)
var/new_target = parse_caught_click_modifiers(modifiers, get_turf(caller), caller.client)
params = list2params(modifiers)
if(!new_target)
Expand Down
2 changes: 2 additions & 0 deletions deadspace/code/marker/hud_marker.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/datum/hud/marker_signal/marker
var/atom/movable/screen/marker_control
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/datum/hud/marker
/datum/hud/marker_signal
var/atom/movable/screen/meter/background/psy/background_psy
var/atom/movable/screen/meter/foreground/psy/foreground_psy
var/atom/movable/screen/meter/background/bio/background_bio
Expand All @@ -7,7 +7,7 @@
var/atom/movable/screen/meter/biomass/biomass
var/atom/movable/screen/cameranet_static/cameranet_static

/datum/hud/marker/New(mob/camera/marker_signal/owner)
/datum/hud/marker_signal/New(mob/camera/marker_signal/owner)
cameranet_static = new(null, owner)
background_psy = new
foreground_psy = new
Expand All @@ -32,7 +32,7 @@
infodisplay += foreground_bio
..()

/datum/hud/marker/show_hud(version, mob/viewmob)
/datum/hud/marker_signal/show_hud(version, mob/viewmob)
if(!..())
return FALSE
var/mob/screenmob = viewmob || mymob
Expand Down
20 changes: 0 additions & 20 deletions deadspace/code/marker/marker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
markernet = new
markernet.addVisionSource(src, VISION_SOURCE_RANGE)

marker_ui_action = new(src)

for(var/datum/necro_class/class as anything in subtypesof(/datum/necro_class))
//Temp check to see if this class is implemented
if(initial(class.implemented))
Expand All @@ -22,7 +20,6 @@
START_PROCESSING(SSobj, src)

/obj/structure/marker/Destroy()
QDEL_NULL(marker_ui_action)
STOP_PROCESSING(SSobj, src)
for(var/datum/biomass_source/source as anything in biomass_sources)
remove_biomass_source(source)
Expand Down Expand Up @@ -209,20 +206,3 @@
/obj/structure/marker/proc/remove_biomass_source(datum/biomass_source/source)
biomass_sources -= source
qdel(source)

/datum/action/marker_ui
name = "Open Marker UI"

/datum/action/marker_ui/Trigger(trigger_flags)
if(!..())
return FALSE
target.ui_interact(owner)
return TRUE

/datum/action/marker_ui/IsAvailable(feedback)
if(!istype(owner, /mob/camera/marker_signal/marker))
if(feedback)
to_chat(owner, span_warning("You can't open the marker UI!"))
return FALSE
return ..()

4 changes: 2 additions & 2 deletions deadspace/code/marker/marker_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ GLOBAL_LIST_EMPTY(necromorph_markers)
move_resist = MOVE_FORCE_OVERPOWERING
density = TRUE
var/active = FALSE
///Whether we should us necroqueue when spawning necromorphs
///Whether we should use necroqueue when spawning necromorphs
var/use_necroqueue = TRUE
var/list/necroqueue = list()
var/mob/camera/marker_signal/marker/camera_mob
var/datum/markernet/markernet
var/list/marker_signals = list()
Expand All @@ -43,4 +44,3 @@ GLOBAL_LIST_EMPTY(necromorph_markers)
var/list/corruption_eyes
/// When was the last time all signals were alerted by an eye
var/last_eye_notify
var/datum/action/marker_ui/marker_ui_action
74 changes: 64 additions & 10 deletions deadspace/code/marker/markernet/marker_eye.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GLOBAL_LIST_EMPTY(markers_signals)
sight = SEE_MOBS|SEE_OBJS|SEE_TURFS
mouse_opacity = MOUSE_OPACITY_ICON
movement_type = GROUND|FLYING
hud_type = /datum/hud/marker
hud_type = /datum/hud/marker_signal
interaction_range = null
var/psy_energy = 0
var/psy_energy_maximum = 900
Expand Down Expand Up @@ -185,6 +185,46 @@ GLOBAL_LIST_EMPTY(markers_signals)

qdel(src)

/mob/camera/marker_signal/verb/switch_necroqueue()
set name = "Join/Leave Necroqueue"
set category = "Necromorph"

if(!marker.active)
to_chat(src, span_notice("Marker is not active yet!"))
return
if(src in marker.necroqueue)
to_chat(src, span_notice("You have left the necroqueue."))
marker.necroqueue -= src
else
to_chat(src, span_notice("You are now in the necroqueue. When a necromorph vessel is available, you will be automatically placed in control of it. You can still manually posess necromorphs."))
marker.necroqueue += src

/mob/camera/marker_signal/verb/jump_to_maker()
set name = "Jump to Marker"
set category = "Necromorph"

forceMove(get_turf(marker))

/mob/camera/marker_signal/verb/jump_to_necro()
set name = "Jump to Necromorph"
set category = "Necromorph"

if(!length(marker.necromorphs))
to_chat(src, span_notice("There are no necromorphs to jump to!"))
return

var/mob/living/carbon/human/necromorph/necro = tgui_input_list(src, "Select necromorph to jump to", "Jump To Necromorph", marker.necromorphs)
if(necro)
forceMove(get_turf(necro))

/mob/camera/marker_signal/verb/jump_to_span_locs()
set name = "Jump to Necromorph Spawn Locs"
set category = "Necromorph"

var/atom/location = tgui_input_list(src, "Select object to jump to", "Jump To Spawn Loc", marker.necro_spawn_atoms)
if(location)
forceMove(get_turf(location))

/mob/camera/marker_signal/verb/possess_necromorph(mob/living/carbon/human/necromorph/necro in world)
set name = "Possess Necromorph"
set category = "Object"
Expand All @@ -201,13 +241,13 @@ GLOBAL_LIST_EMPTY(markers_signals)
/mob/camera/marker_signal/proc/change_psy_energy(amount)
psy_energy = clamp(psy_energy+amount, 0, psy_energy_maximum)
if(hud_used)
var/datum/hud/marker/our_hud = hud_used
var/datum/hud/marker_signal/our_hud = hud_used
var/filter = our_hud.psy_energy.get_filter("alpha_filter")
animate(filter, x = clamp(HUD_METER_PIXEL_WIDTH*(psy_energy/psy_energy_maximum), 0, HUD_METER_PIXEL_WIDTH), time = 0.5 SECONDS)
our_hud.foreground_psy.maptext = MAPTEXT("[round(psy_energy, 1)]/[psy_energy_maximum] | +[psy_energy_generation] psy/sec")

/mob/camera/marker_signal/proc/update_biomass_hud(hud_override)
var/datum/hud/marker/our_hud = hud_override || hud_used
var/datum/hud/marker_signal/our_hud = hud_override || hud_used
our_hud?.foreground_bio.maptext = MAPTEXT("[round(marker.signal_biomass, 1)] | +[marker.last_biomass_income*marker.signal_biomass_percent] bio/sec")

/mob/camera/marker_signal/say(message, bubble_type, list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null, filterproof = null)
Expand Down Expand Up @@ -256,7 +296,7 @@ GLOBAL_LIST_EMPTY(markers_signals)
icon = 'deadspace/icons/signals/mastersignal.dmi'
invisibility = INVISIBILITY_OBSERVER
see_invisible = SEE_INVISIBLE_OBSERVER
hud_type = /datum/hud/marker
hud_type = /datum/hud/marker_signal/marker
interaction_range = null
pixel_x = -7
pixel_y = -7
Expand All @@ -270,16 +310,18 @@ GLOBAL_LIST_EMPTY(markers_signals)

/mob/camera/marker_signal/marker/Initialize(mapload, obj/structure/marker/master)
. = ..()
master?.marker_ui_action.Grant(src)
icon_state = "mastersignal"
verbs -= /mob/camera/marker_signal/verb/become_master
remove_verb(src, list(
/mob/camera/marker_signal/verb/become_master,
/mob/camera/marker_signal/verb/switch_necroqueue,
))

/mob/camera/marker_signal/marker/Destroy()
marker?.camera_mob = null
return ..()

/mob/camera/marker_signal/marker/update_biomass_hud(hud_override)
var/datum/hud/marker/our_hud = hud_override || hud_used
var/datum/hud/marker_signal/our_hud = hud_override || hud_used
our_hud?.foreground_bio.maptext = MAPTEXT("[round(marker.marker_biomass, 1)] | +[marker.last_biomass_income*(1-marker.signal_biomass_percent)] bio/sec")

/mob/camera/marker_signal/marker/verb/downgrade()
Expand All @@ -292,6 +334,12 @@ GLOBAL_LIST_EMPTY(markers_signals)
signal.change_psy_energy(psy_energy)
qdel(src)

/mob/camera/marker_signal/marker/verb/open_marker_ui()
set name = "Open Marker UI"
set category = "Necromorph"

marker.ui_interact(src)

/mob/camera/marker_signal/marker/ClickOn(atom/A, params)
if(check_click_intercept(params,A))
return
Expand Down Expand Up @@ -364,9 +412,15 @@ GLOBAL_LIST_EMPTY(markers_signals)
marker.biomass_invested += marker.necro_classes[spawning_necromorph].biomass_cost
var/path = marker.necro_classes[spawning_necromorph].necromorph_type_path
var/mob/living/carbon/human/necromorph/mob = new path(A, marker)
if(marker.use_necroqueue && length(marker.marker_signals-src))
var/mob/camera/marker_signal/signal = pick(marker.marker_signals-src)
signal.possess_necromorph(mob)
if(marker.use_necroqueue && length(marker.necroqueue))
var/list/necroqueue_copy = marker.necroqueue.Copy()
//If current signal has no key and there are other signals in the queue, pick another one
while(length(necroqueue_copy))
var/mob/camera/marker_signal/signal = pick_n_take(necroqueue_copy)
signal = pick_n_take(necroqueue_copy)
if(signal.key)
signal.possess_necromorph(mob)
return
return
if(!spawnloc_cantsee)
to_chat(src, span_warning("There are no possible spawn locations nearby!"))
Expand Down
4 changes: 2 additions & 2 deletions deadspace/code/marker/markernet/marker_static.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/cameranet_static)

/mob/camera/marker_signal/reload_fullscreen()
if(..())
var/datum/hud/marker/our_hud = hud_used
var/datum/hud/marker_signal/our_hud = hud_used
our_hud.cameranet_static.update_o(client.view)

/mob/camera/marker_signal/proc/update_static(turf/previous_turf)
Expand All @@ -71,7 +71,7 @@ INITIALIZE_IMMEDIATE(/atom/movable/screen/cameranet_static)
if(!offset_x && !offset_y && !force)
return

var/datum/hud/marker/our_hud = hud_used
var/datum/hud/marker_signal/our_hud = hud_used
var/atom/movable/screen/cameranet_static/cameranet_static = our_hud.cameranet_static

var/glide_rate = round(world.icon_size / glide_size * world.tick_lag, world.tick_lag)
Expand Down
Binary file added deadspace/icons/hud/action_corruption.dmi
Binary file not shown.
Binary file modified deadspace/icons/hud/signal_icons.dmi
Binary file not shown.

0 comments on commit 0395768

Please sign in to comment.