Skip to content

Commit

Permalink
Commits reviews per feedback, thanks Vero and Harry!
Browse files Browse the repository at this point in the history
  • Loading branch information
GrrrKitten committed Jun 15, 2024
1 parent 293f989 commit 9abfb20
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 51 deletions.
8 changes: 8 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@

//=================================================

/* SPECIAL LIGHTING DEFINES */

#define SPECIAL_LIGHTING_PREROUND "preround"
#define SPECIAL_LIGHTING_SUNSET "sunset"
#define SPECIAL_LIGHTING_SUNRISE "sunrise"

//=================================================

//Languages!
#define LANGUAGE_HUMAN 1
#define LANGUAGE_ALIEN 2
Expand Down
78 changes: 39 additions & 39 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

#define Z_CHANGE_CALL "z_change"
#define AREA_CHANGE_CALL "area_change"

/mob
var/list/fullscreens = list()
Expand Down Expand Up @@ -71,28 +73,28 @@
if(special_lighting)
return
SSticker.OnRoundstart(CALLBACK(src, PROC_REF(initialize_special_lighting)))
special_lighting = "pre_round" // do not let a special_lighting get called before roundstart
special_lighting = SPECIAL_LIGHTING_PREROUND // do not let a special_lighting get called before roundstart
return
if(SSticker.mode.flags_round_type & MODE_SUNSET)
if(!fullscreens["lighting_backdrop"] || special_lighting == "sunset" || special_lighting_active_timer)
if(!fullscreens["lighting_backdrop"] || special_lighting == SPECIAL_LIGHTING_SUNSET || special_lighting_active_timer)
return
special_lighting = "sunset"
special_lighting = SPECIAL_LIGHTING_SUNSET
special_lighting_active_timer = TRUE
if(ROUND_TIME < 4 SECONDS) //if you're in before full setup, dont let special lightings get called prior, it gets messy
addtimer(CALLBACK(src, PROC_REF(special_lighting_animate), "sunset", 30 SECONDS, 9, 10 SECONDS, 0, null, 1, FALSE, TRUE, TRUE), 3 SECONDS)
addtimer(CALLBACK(src, PROC_REF(special_lighting_animate), SPECIAL_LIGHTING_SUNSET, 30 SECONDS, 9, 10 SECONDS, 0, null, 1, FALSE, TRUE, TRUE), 3 SECONDS)
addtimer(CALLBACK(src, PROC_REF(special_lighting_register_signals)), 3 SECONDS)
else if(ROUND_TIME < 280 SECONDS)
special_lighting = "sunset"
special_lighting = SPECIAL_LIGHTING_SUNSET
special_lighting_active_timer = TRUE
special_lighting_animate("sunset", 30 SECONDS, 9, 10 SECONDS, 0, 0.1 SECONDS, 1, TRUE, TRUE, TRUE)
special_lighting_animate(SPECIAL_LIGHTING_SUNSET, 30 SECONDS, 9, 10 SECONDS, 0, 0.1 SECONDS, 1, TRUE, TRUE, TRUE)
special_lighting_register_signals()
return
if(GLOB.sunrise_starting_time)
if(!fullscreens["lighting_backdrop"] || special_lighting == "sunrise" || special_lighting == "sunset" || special_lighting_active_timer)
if(!fullscreens["lighting_backdrop"] || special_lighting == SPECIAL_LIGHTING_SUNRISE || special_lighting == SPECIAL_LIGHTING_SUNSET || special_lighting_active_timer)
return
special_lighting = "sunrise"
special_lighting = SPECIAL_LIGHTING_SUNRISE
special_lighting_active_timer = TRUE
special_lighting_animate("sunrise", 30 SECONDS, 6, 1 SECONDS, 0.1 SECONDS, -1, TRUE, TRUE, FALSE)
special_lighting_animate(SPECIAL_LIGHTING_SUNRISE, 30 SECONDS, 6, 1 SECONDS, 0.1 SECONDS, -1, TRUE, TRUE, FALSE)
special_lighting_register_signals() //sunrise is permanent, you wont need to unregister


Expand Down Expand Up @@ -265,10 +267,9 @@
/mob/proc/special_lighting_animate(p_special_lighting_type = null, p_stage_time, p_max_stages, p_startup_delay = 1 SECONDS, p_special_start_time = 0, p_special_stage_time = null, p_special_tick_dir, p_special_call = FALSE, p_create_new_lighting_timer = FALSE, p_lighting_deactivates = TRUE)

var/atom/movable/screen/fullscreen/screen = fullscreens["lighting_backdrop"]
var/mob/lighting_mob = src
var/area/lighting_mob_area = get_area(lighting_mob)
var/area/lighting_mob_area = get_area(src)

if(p_special_lighting_type != lighting_mob.special_lighting)
if(p_special_lighting_type != special_lighting)
return

var/lighting_color = "#000" /// used in the animation, set by the special_lighting_type
Expand Down Expand Up @@ -297,28 +298,28 @@
if(time_til_next_lighting_call < special_stage_time)
time_til_next_lighting_call = time_til_next_lighting_call + special_stage_time //delays main anims until the special call anim is done

if(lighting_mob.special_lighting == "sunset")
lighting_color = lighting_mob.special_lighting_sunset(lighting_stage)
if(lighting_mob.special_lighting == "sunrise")
lighting_color = lighting_mob.special_lighting_sunrise(lighting_stage)
if(special_lighting == SPECIAL_LIGHTING_SUNSET)
lighting_color = special_lighting_sunset(lighting_stage)
if(special_lighting == SPECIAL_LIGHTING_SUNRISE)
lighting_color = special_lighting_sunrise(lighting_stage)

if(lighting_stage == 0) //there aren't any cases you won't want these coming up fast
special_stage_time = 0.5 SECONDS
time_til_next_lighting_call = startup_delay + special_start_time - ROUND_TIME

if(create_new_lighting_timer) // if create_new_lighting_timer = TRUE, a new timer gets set
lighting_mob.special_lighting_active_timer = FALSE
special_lighting_active_timer = FALSE

if(!lighting_mob.special_lighting_active_timer)
if(!special_lighting_active_timer)
if(lighting_stage < max_stages)
addtimer(CALLBACK(lighting_mob, PROC_REF(special_lighting_animate), special_lighting, stage_time, max_stages, startup_delay, special_start_time, null, special_tick_dir, FALSE, TRUE, lighting_deactivates), time_til_next_lighting_call, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_DELETE_ME)
lighting_mob.special_lighting_active_timer = TRUE
addtimer(CALLBACK(src, PROC_REF(special_lighting_animate), special_lighting, stage_time, max_stages, startup_delay, special_start_time, null, special_tick_dir, FALSE, TRUE, lighting_deactivates), time_til_next_lighting_call, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_DELETE_ME)
special_lighting_active_timer = TRUE
if(lighting_stage == max_stages && lighting_deactivates) // deactives special lighting when the sun hits #000
addtimer(CALLBACK(lighting_mob, PROC_REF(special_lighting_unregister_signals)), time_til_next_lighting_call, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_DELETE_ME)
addtimer(CALLBACK(src, PROC_REF(special_lighting_unregister_signals)), time_til_next_lighting_call, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_DELETE_ME)

if(CEILING_IS_PROTECTED(lighting_mob_area?.ceiling, CEILING_PROTECTION_TIER_2)) //if underground, don't animate, this is needed in combo with the special area check
return
if(!is_ground_level(lighting_mob.z) && special_call != "z_change") // dont animate if not groundlevel
if(!is_ground_level(z) && special_call != Z_CHANGE_CALL) // dont animate if not groundlevel
return

if(special_stage_time)
Expand Down Expand Up @@ -405,20 +406,16 @@

/mob/proc/special_lighting_register_signals()

var/mob/signaling_mob = src

RegisterSignal(signaling_mob, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(special_lighting_z_change), TRUE)
RegisterSignal(signaling_mob, COMSIG_MOVABLE_ENTERED_AREA, PROC_REF(special_lighting_area_change), TRUE)
RegisterSignal(src, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(special_lighting_z_change), TRUE)
RegisterSignal(src, COMSIG_MOVABLE_ENTERED_AREA, PROC_REF(special_lighting_area_change), TRUE)


/mob/proc/special_lighting_unregister_signals()

var/mob/signaling_mob = src
special_lighting = null //clears special lighting

signaling_mob.special_lighting = null //clears special lighting

UnregisterSignal(signaling_mob, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(special_lighting_z_change))
UnregisterSignal(signaling_mob, COMSIG_MOVABLE_ENTERED_AREA, PROC_REF(special_lighting_area_change))
UnregisterSignal(src, COMSIG_MOVABLE_Z_CHANGED, PROC_REF(special_lighting_z_change))
UnregisterSignal(src, COMSIG_MOVABLE_ENTERED_AREA, PROC_REF(special_lighting_area_change))


/mob/proc/special_lighting_z_change(atom/source, old_z, new_z)
Expand All @@ -432,18 +429,18 @@
var/special_start_time = 0
var/special_stage_time = 0.1 SECONDS
var/special_tick_dir = 0
var/special_call = "z_change"
var/special_call = Z_CHANGE_CALL
var/create_new_lighting_timer = FALSE
var/lighting_deactivates = TRUE

if(!special_lighting || special_lighting == "pre_round")
if(!special_lighting || special_lighting == SPECIAL_LIGHTING_PREROUND)
return

switch(special_lighting) //figure out a way of handling this better if possible
if("sunset")
if(SPECIAL_LIGHTING_SUNSET)
max_stages = 9
special_tick_dir = 1
if("sunrise")
if(SPECIAL_LIGHTING_SUNRISE)
max_stages = 6
special_start_time = GLOB.sunrise_starting_time
special_tick_dir = -1
Expand All @@ -467,19 +464,19 @@
var/special_start_time = 0
var/special_stage_time = 4 SECONDS
var/special_tick_dir = 0
var/special_call = "area_change"
var/special_call = AREA_CHANGE_CALL
var/create_new_lighting_timer = FALSE
var/lighting_deactivates = TRUE


if(!special_lighting || special_lighting == "pre_round")
if(!special_lighting || special_lighting == SPECIAL_LIGHTING_PREROUND)
return

switch(special_lighting)
if("sunset")
if(SPECIAL_LIGHTING_SUNSET)
max_stages = 9
special_tick_dir = 1
if("sunrise")
if(SPECIAL_LIGHTING_SUNRISE)
max_stages = 6
special_start_time = GLOB.sunrise_starting_time
special_tick_dir = -1
Expand Down Expand Up @@ -509,3 +506,6 @@
layer = LIGHTING_PRIMARY_LAYER
blend_mode = BLEND_ADD
show_when_dead = TRUE

#undef Z_CHANGE_CALL
#undef AREA_CHANGE_CALL
12 changes: 6 additions & 6 deletions code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@
SSticker.roundend_check_paused = TRUE
round_finished = MODE_INFESTATION_M_MAJOR //Humans destroyed the xenomorphs.
if(!GLOB.sunrise_starting_time)
(GLOB.sunrise_starting_time = ROUND_TIME)
GLOB.sunrise_starting_time = ROUND_TIME
for(var/mob/lighting_mob as anything in GLOB.player_list)
if(!lighting_mob.special_lighting && lighting_mob.fullscreens["lighting_backdrop"])
lighting_mob.special_lighting = "sunrise"
lighting_mob.special_lighting = SPECIAL_LIGHTING_SUNRISE
lighting_mob.special_lighting_active_timer = TRUE
lighting_mob.special_lighting_animate("sunrise", 30 SECONDS, 6, 10 SECONDS, GLOB.sunrise_starting_time, null, -1, FALSE, TRUE, FALSE)
lighting_mob.special_lighting_animate(SPECIAL_LIGHTING_SUNRISE, 30 SECONDS, 6, 10 SECONDS, GLOB.sunrise_starting_time, null, -1, FALSE, TRUE, FALSE)
ares_conclude()
addtimer(VARSET_CALLBACK(SSticker, roundend_check_paused, FALSE), MARINE_MAJOR_ROUND_END_DELAY)
else if(!num_humans && !num_xenos)
Expand All @@ -344,12 +344,12 @@
else
round_finished = MODE_INFESTATION_M_MINOR
if(!GLOB.sunrise_starting_time) //putting a sunset call here too
(GLOB.sunrise_starting_time = ROUND_TIME)
GLOB.sunrise_starting_time = ROUND_TIME
for(var/mob/lighting_mob as anything in GLOB.player_list)
if(!lighting_mob.special_lighting && lighting_mob.fullscreens["lighting_backdrop"])
lighting_mob.special_lighting = "sunrise"
lighting_mob.special_lighting = SPECIAL_LIGHTING_SUNRISE
lighting_mob.special_lighting_active_timer = TRUE
lighting_mob.special_lighting_animate("sunrise", 30 SECONDS, 6, 10 SECONDS, GLOB.sunrise_starting_time, null, -1, FALSE, TRUE, FALSE)
lighting_mob.special_lighting_animate(SPECIAL_LIGHTING_SUNRISE, 30 SECONDS, 6, 10 SECONDS, GLOB.sunrise_starting_time, null, -1, FALSE, TRUE, FALSE)

///////////////////////////////
//Checks if the round is over//
Expand Down
11 changes: 5 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/hive_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@

if(SSticker.mode.flags_round_type & MODE_INFESTATION) //checks if gamemode is a xeno gamemode before calling, will roar with no queen cause of implied queen existence
zlevel_evo_echo()
if(initial_screech)
if(initial_screech) //set to false after the first screech is called
initial_screech = FALSE

/datum/hive_status/proc/zlevel_evo_echo()
Expand All @@ -210,11 +210,10 @@
to_chat(groundmob, SPAN_HIGHDANGER("You hear the distant call of an unknown bioform, it sounds like they're informing others to change form. You begin to analyze and decrypt the strange vocalization."))
return
var/area/queen_area = get_area(living_xeno_queen)
if(!initial_screech)
if(CEILING_IS_PROTECTED(queen_area?.ceiling, CEILING_PROTECTION_TIER_3) || !queen_area)
playsound_client(groundmob.client, 'sound/voice/alien_echoroar_2.ogg', groundmob.loc, 70, "minor") //if queen is underground or there is no queen
else
playsound_client(groundmob.client, 'sound/voice/alien_echoroar_3.ogg', groundmob.loc, 75, FALSE) //if queen is outside
if(CEILING_IS_PROTECTED(queen_area?.ceiling, CEILING_PROTECTION_TIER_3) || !queen_area)
playsound_client(groundmob.client, 'sound/voice/alien_echoroar_2.ogg', groundmob.loc, 70, "minor") //if queen is underground or there is no queen
else
playsound_client(groundmob.client, 'sound/voice/alien_echoroar_3.ogg', groundmob.loc, 75, FALSE) //if queen is outside

// Adds a xeno to this hive
/datum/hive_status/proc/add_xeno(mob/living/carbon/xenomorph/X)
Expand Down

0 comments on commit 9abfb20

Please sign in to comment.