diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 7bb4ab99dee..3d75812908e 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -167,6 +167,7 @@ #define ui_spell_master "RIGHT-1:16,TOP-1:16" #define ui_genetic_master "RIGHT-1:16,TOP-2:16" +#define ui_ability_master "RIGHT-1:16,TOP-3:16" #define ui_shadekin_display "RIGHT-1:28,CENTER-3:15" #define ui_xenochimera_danger_display "RIGHT-1:28,CENTER-3:15" diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm index e78a6dcf08f..f0ed59a261e 100644 --- a/code/_onclick/hud/ability_screen_objects.dm +++ b/code/_onclick/hud/ability_screen_objects.dm @@ -1,3 +1,5 @@ +// TODO: KILL THIS SHIT FOR ACTION BUTTONS +// TODO: NEW SCREEN LOC DECODING PROCS. /atom/movable/screen/movable/ability_master name = "Abilities" icon = 'icons/mob/screen_spells.dmi' @@ -8,9 +10,11 @@ var/open_state = "master_open" // What the button looks like when it's 'open', showing the other buttons. var/closed_state = "master_closed" // Button when it's 'closed', hiding everything else. - screen_loc = ui_spell_master // TODO: Rename + screen_loc = ui_ability_master // TODO: Rename var/mob/my_mob = null // The mob that possesses this hud object. + var/opens_to_left = TRUE + var/opens_downwards = TRUE /atom/movable/screen/movable/ability_master/Initialize(mapload) . = ..() @@ -70,20 +74,22 @@ //Create list of X offsets var/list/screen_loc_X = splittext(screen_loc_xy[1],":") var/x_position = decode_screen_X(screen_loc_X[1]) - var/x_pix = screen_loc_X[2] + var/x_pix = text2num(screen_loc_X[2]) //Create list of Y offsets var/list/screen_loc_Y = splittext(screen_loc_xy[2],":") var/y_position = decode_screen_Y(screen_loc_Y[1]) - var/y_pix = screen_loc_Y[2] + var/y_pix = text2num(screen_loc_Y[2]) for(var/i = 1; i <= ability_objects.len; i++) - var/atom/movable/screen/ability/A = ability_objects[i] - var/xpos = x_position + (x_position < 8 ? 1 : -1)*(i%7) - var/ypos = y_position + (y_position < 8 ? round(i/7) : -round(i/7)) - A.screen_loc = "[encode_screen_X(xpos)]:[x_pix],[encode_screen_Y(ypos)]:[y_pix]" + var/atom/movable/screen/ability/S = ability_objects[i] + // TODO: WARNING THIS IS SHITCODE AND MONKEY PATCHED AND WILL BREAK VERY SOON + // Pray we finish abilities refactor by then! + var/xpos = x_position + (opens_to_left? -1 : 1) * ((i % 7) + 1) - 1 + var/ypos = y_position + (opens_downwards? -1 : 1) * (round(i / 7) + 0) - 1 + S.screen_loc = "[encode_screen_X(xpos)]:[x_pix],[encode_screen_Y(ypos)]:[y_pix]" if(my_mob && my_mob.client) - my_mob.client.screen += A + my_mob.client.screen += S // A.handle_icon_updates = 1 /atom/movable/screen/movable/ability_master/proc/update_abilities(forced = 0, mob/user) diff --git a/code/game/landmarks/spawnpoint/station/jobs.dm b/code/game/landmarks/spawnpoint/station/jobs.dm index dddf503c4c5..d7f14cdac44 100644 --- a/code/game/landmarks/spawnpoint/station/jobs.dm +++ b/code/game/landmarks/spawnpoint/station/jobs.dm @@ -217,6 +217,8 @@ latejoin = TRUE // AIize in transform_procs.dm uses get_latejoin_spawnpoint() for spawning in a AI -- including at roundstart. delete_on_roundstart = TRUE job_path = /datum/job/station/ai + prevent_mob_stack = FALSE + spawns_left = 1 var/primary_ai = TRUE var/latejoin_active = TRUE diff --git a/code/modules/mob/life.dm b/code/modules/mob/life.dm index d546415ac35..4b910cb7f72 100644 --- a/code/modules/mob/life.dm +++ b/code/modules/mob/life.dm @@ -29,6 +29,7 @@ if(spell_masters && spell_masters.len) for(var/atom/movable/screen/movable/spell_master/spell_master in spell_masters) spell_master.update_spells(0, src) + ability_master?.update_abilities(0, src) /** * processes physical life processes like being on fire diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 4258ec20099..4bb9bc31a8a 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -230,6 +230,8 @@ return FALSE /mob/living/proc/handle_darksight() + if(!dsoverlay) + return if(!seedarkness) //Cheap 'always darksight' var dsoverlay.alpha = 255 return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 22bb9bb67a9..3517ec2c2c4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -3,12 +3,14 @@ AddElement(/datum/element/z_radiation_listener) //I'll just hang my coat up over here - dsoverlay = image('icons/mob/darksight.dmi', GLOB.global_hud.darksight) //This is a secret overlay! Go look at the file, you'll see. - var/mutable_appearance/dsma = new(dsoverlay) //Changing like ten things, might as well. - dsma.alpha = 0 - dsma.plane = LIGHTING_PLANE - dsma.blend_mode = BLEND_ADD - dsoverlay.appearance = dsma + // TODO: REFACTOR + if(!isAI(src)) + dsoverlay = image('icons/mob/darksight.dmi', GLOB.global_hud.darksight) //This is a secret overlay! Go look at the file, you'll see. + var/mutable_appearance/dsma = new(dsoverlay) //Changing like ten things, might as well. + dsma.alpha = 0 + dsma.plane = LIGHTING_PLANE + dsma.blend_mode = BLEND_ADD + dsoverlay.appearance = dsma selected_image = image(icon = 'icons/mob/screen1.dmi', loc = src, icon_state = "centermarker") diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 63e2cf5f2f9..6747e9ddcb1 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -7,7 +7,8 @@ //If they're SSD, remove it so they can wake back up. update_antag_icons(mind) client.screen |= GLOB.global_hud.darksight - client.images |= dsoverlay + if(dsoverlay) + client.images |= dsoverlay if(ai_holder && !ai_holder.autopilot) ai_holder.go_sleep()