fixes shadekin abilities and ai darksight overlay (#4990)

Co-authored-by: silicons <no@you.cat>
This commit is contained in:
silicons
2023-01-25 18:20:12 +01:00
committed by GitHub
co-authored by silicons
parent 52cbc793ad
commit e47e0f0246
7 changed files with 30 additions and 15 deletions
+1
View File
@@ -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"
+14 -8
View File
@@ -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)
@@ -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
+1
View File
@@ -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
+2
View File
@@ -230,6 +230,8 @@
return FALSE
/mob/living/proc/handle_darksight()
if(!dsoverlay)
return
if(!seedarkness) //Cheap 'always darksight' var
dsoverlay.alpha = 255
return
+8 -6
View File
@@ -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")
+2 -1
View File
@@ -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()