diff --git a/code/controllers/subsystem/sunlighting.dm b/code/controllers/subsystem/sunlighting.dm index bea7af38f0ad..6579b93fec20 100644 --- a/code/controllers/subsystem/sunlighting.dm +++ b/code/controllers/subsystem/sunlighting.dm @@ -94,8 +94,6 @@ SUBSYSTEM_DEF(sunlighting) var/list/datum/time_of_day/steps = list() - var/allow_updates = TRUE - var/next_day = FALSE var/current_color = "" var/weather_blend_ammount = 0.3 @@ -103,7 +101,7 @@ SUBSYSTEM_DEF(sunlighting) var/custom_time_offset = 0 /datum/controller/subsystem/sunlighting/stat_entry(msg) - msg = "W:[GLOB.sunlight_queue_work.len]|U:[GLOB.sunlight_queue_update.len]|C:[GLOB.sunlight_queue_corner.len]" + msg = "W:[length(GLOB.sunlight_queue_work)]|U:[length(GLOB.sunlight_queue_update)]|C:[length(GLOB.sunlight_queue_corner)]" return ..() /datum/controller/subsystem/sunlighting/Initialize(timeofday) @@ -126,7 +124,8 @@ SUBSYSTEM_DEF(sunlighting) custom_time_offset = new_value /datum/controller/subsystem/sunlighting/proc/game_time_offseted() - return (REALTIMEOFDAY + custom_time_offset) % game_time_length + return 0 // Idk, maintainers not alowed it and I don't asked, so some time later I'll ask 200%, rn just dead end for daytime change +// return (REALTIMEOFDAY + custom_time_offset) % game_time_length /datum/controller/subsystem/sunlighting/proc/create_steps() for(var/path in typesof(/datum/time_of_day)) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index d4f755742f9e..bb7a6b05f867 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -109,6 +109,8 @@ var/area/current_area = loc if(current_area?.lighting_effect) overlays += current_area.lighting_effect + else + GLOB.sunlight_queue_work |= src if(opacity) directional_opacity = ALL_CARDINALS diff --git a/code/game/turfs/walls/wall_icon.dm b/code/game/turfs/walls/wall_icon.dm index 344e9b4792ab..d544bbe9618e 100644 --- a/code/game/turfs/walls/wall_icon.dm +++ b/code/game/turfs/walls/wall_icon.dm @@ -25,9 +25,9 @@ return if(damage) - var/current_dmg_overlay = round(damage / damage_cap * damage_overlays.len) + 1 - if(current_dmg_overlay > damage_overlays.len) - current_dmg_overlay = damage_overlays.len + var/current_dmg_overlay = round(damage / damage_cap * length(damage_overlays)) + 1 + if(current_dmg_overlay > length(damage_overlays)) + current_dmg_overlay = length(damage_overlays) damage_overlay = current_dmg_overlay overlays += damage_overlays[damage_overlay] @@ -42,9 +42,9 @@ #undef cur_increment /turf/closed/wall/proc/generate_damage_overlays() - var/alpha_inc = 256 / damage_overlays.len + var/alpha_inc = 256 / length(damage_overlays) - for(var/i = 1; i <= damage_overlays.len; i++) + for(var/i = 1; i <= length(damage_overlays); i++) var/image/img = image(icon = 'icons/turf/walls/walls.dmi', icon_state = "overlay_damage") img.blend_mode = BLEND_MULTIPLY img.appearance_flags = NO_CLIENT_COLOR diff --git a/code/modules/shuttle/docking.dm b/code/modules/shuttle/docking.dm index df89ee5bdf42..023925ff2298 100644 --- a/code/modules/shuttle/docking.dm +++ b/code/modules/shuttle/docking.dm @@ -66,8 +66,8 @@ new_hidden_turfs = list() for(var/i in 1 to length(old_turfs)) CHECK_TICK - var/turf/oldT = old_turfs[i] - if(old_turfs[oldT] & MOVE_TURF) + var/turf/old_turf = old_turfs[i] + if(old_turfs[old_turf] & MOVE_TURF) new_hidden_turfs += new_turfs[i] SSshuttle.update_hidden_docking_ports(null, new_hidden_turfs) /***************************************************************************************************************/ @@ -110,49 +110,49 @@ /obj/docking_port/mobile/proc/preflight_check(list/old_turfs, list/new_turfs, list/areas_to_move, rotation) for(var/i in 1 to length(old_turfs)) CHECK_TICK - var/turf/oldT = old_turfs[i] - var/turf/newT = new_turfs[i] - if(!newT) + var/turf/old_turf = old_turfs[i] + var/turf/new_turf = new_turfs[i] + if(!new_turf) return DOCKING_NULL_DESTINATION - if(!oldT) + if(!old_turf) return DOCKING_NULL_SOURCE - var/area/old_area = oldT.loc + var/area/old_area = old_turf.loc var/move_mode = old_area.beforeShuttleMove(shuttle_areas) //areas - for(var/atom/movable/moving_atom as anything in oldT.contents) + for(var/atom/movable/moving_atom as anything in old_turf.contents) CHECK_TICK - if(moving_atom.loc != oldT) //fix for multi-tile objects + if(moving_atom.loc != old_turf) //fix for multi-tile objects continue - move_mode = moving_atom.beforeShuttleMove(newT, rotation, move_mode, src) //atoms + move_mode = moving_atom.beforeShuttleMove(new_turf, rotation, move_mode, src) //atoms - move_mode = oldT.fromShuttleMove(newT, move_mode) //turfs - move_mode = newT.toShuttleMove(oldT, move_mode, src) //turfs + move_mode = old_turf.fromShuttleMove(new_turf, move_mode) //turfs + move_mode = new_turf.toShuttleMove(old_turf, move_mode, src) //turfs if(move_mode & MOVE_AREA) areas_to_move[old_area] = TRUE - old_turfs[oldT] = move_mode + old_turfs[old_turf] = move_mode /obj/docking_port/mobile/proc/takeoff(list/old_turfs, list/new_turfs, list/moved_atoms, rotation, movement_direction, old_dock, area/underlying_old_area) for(var/i in 1 to length(old_turfs)) - var/turf/oldT = old_turfs[i] - var/turf/newT = new_turfs[i] - var/move_mode = old_turfs[oldT] + var/turf/old_turf = old_turfs[i] + var/turf/new_turf = new_turfs[i] + var/move_mode = old_turfs[old_turf] if(move_mode & MOVE_CONTENTS) - for(var/k in oldT) + for(var/k in old_turf) var/atom/movable/moving_atom = k - if(moving_atom.loc != oldT) //fix for multi-tile objects + if(moving_atom.loc != old_turf) //fix for multi-tile objects continue - moving_atom.onShuttleMove(newT, oldT, movement_force, movement_direction, old_dock, src) //atoms - moved_atoms[moving_atom] = oldT + if(moving_atom.onShuttleMove(new_turf, old_turf, movement_force, movement_direction, old_dock, src)) //atoms + moved_atoms[moving_atom] = old_turf if(move_mode & MOVE_TURF) - oldT.onShuttleMove(newT, movement_force, movement_direction) //turfs + old_turf.onShuttleMove(new_turf, movement_force, movement_direction, src) //turfs if(move_mode & MOVE_AREA) - var/area/shuttle_area = oldT.loc - shuttle_area.onShuttleMove(oldT, newT, underlying_old_area) //areas + var/area/shuttle_area = old_turf.loc + shuttle_area.onShuttleMove(old_turf, new_turf, underlying_old_area) //areas /obj/docking_port/mobile/proc/cleanup_runway(obj/docking_port/stationary/new_dock, list/old_turfs, list/new_turfs, list/areas_to_move, list/moved_atoms, rotation, movement_direction, area/underlying_old_area) underlying_old_area.afterShuttleMove() @@ -170,18 +170,57 @@ for(var/i in 1 to length(old_turfs)) CHECK_TICK if(!(old_turfs[old_turfs[i]] & MOVE_TURF)) + GLOB.sunlight_queue_work |= old_turfs[i] + GLOB.sunlight_queue_work |= new_turfs[i] continue - var/turf/oldT = old_turfs[i] - var/turf/newT = new_turfs[i] - newT.afterShuttleMove(oldT, rotation) //turfs + + var/turf/old_turf = old_turfs[i] + var/turf/new_turf = new_turfs[i] +// var/turf/new_ceiling = get_step_multiz(new_turf, UP) + if(new_turf.outdoor_effect) + qdel(new_turf.outdoor_effect, TRUE) + if(old_turf.outdoor_effect) + qdel(old_turf.outdoor_effect, TRUE) +//silent fix + new_turf.pseudo_roof = custom_ceiling +/* + if(new_ceiling) + if(!new_ceiling.baseturfs || !(new_ceiling.turf_flags & TURF_WEATHER_PROOF)) + new_ceiling.ChangeTurf(custom_ceiling) + else + if(length(new_ceiling.baseturfs) > 1) + new_ceiling.baseturfs = list(new_ceiling.baseturfs[1], custom_ceiling) + new_ceiling.baseturfs.Copy(2, length(new_ceiling.baseturfs)) + else + new_ceiling.baseturfs = list(custom_ceiling) + new_ceiling.baseturfs + else + new_turf.pseudo_roof = custom_ceiling +*/ + new_turf.afterShuttleMove(old_turf, rotation) + GLOB.sunlight_queue_work |= new_turf + +//silent fix + var/obj/effect/mapping_helpers/sunlight/pseudo_roof_setter/presetted_pseudo = locate(/obj/effect/mapping_helpers/sunlight/pseudo_roof_setter) in old_turf + old_turf.pseudo_roof = presetted_pseudo ? presetted_pseudo.pseudo_roof : initial(old_turf.pseudo_roof) +/* + var/turf/old_ceiling = get_step_multiz(old_turf, UP) + if(!old_ceiling) + var/obj/effect/mapping_helpers/sunlight/pseudo_roof_setter/presetted_pseudo = locate(/obj/effect/mapping_helpers/sunlight/pseudo_roof_setter) in old_turf + old_turf.pseudo_roof = presetted_pseudo ? presetted_pseudo.pseudo_roof : initial(old_turf.pseudo_roof) + else if(istype(old_ceiling, custom_ceiling)) + var/turf/open/floor/roof/old_shuttle_ceiling = old_ceiling + old_shuttle_ceiling.ScrapeAway() + else + old_ceiling.baseturfs -= custom_ceiling +*/ + GLOB.sunlight_queue_work |= old_turf for(var/i in 1 to length(moved_atoms)) CHECK_TICK var/atom/movable/moved_object = moved_atoms[i] if(QDELETED(moved_object)) continue - var/turf/oldT = moved_atoms[moved_object] - moved_object.afterShuttleMove(oldT, movement_force, dir, preferred_direction, movement_direction, rotation)//atoms + var/turf/old_turf = moved_atoms[moved_object] + moved_object.afterShuttleMove(old_turf, movement_force, dir, preferred_direction, movement_direction, rotation)//atoms // lateShuttleMove (There had better be a really good reason for additional stages beyond this) @@ -196,15 +235,15 @@ CHECK_TICK if(!(old_turfs[old_turfs[i]] & MOVE_CONTENTS | MOVE_TURF)) continue - var/turf/oldT = old_turfs[i] - var/turf/newT = new_turfs[i] - newT.lateShuttleMove(oldT) + var/turf/old_turf = old_turfs[i] + var/turf/new_turf = new_turfs[i] + new_turf.lateShuttleMove(old_turf) + old_turf.get_sky_and_weather_states() for(var/i in 1 to length(moved_atoms)) CHECK_TICK var/atom/movable/moved_object = moved_atoms[i] if(QDELETED(moved_object)) continue - var/turf/oldT = moved_atoms[moved_object] - moved_object.lateShuttleMove(oldT, movement_force, movement_direction) - + var/turf/old_turf = moved_atoms[moved_object] + moved_object.lateShuttleMove(old_turf, movement_force, movement_direction) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 4a990ea7d1ae..a5788611a987 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -374,6 +374,8 @@ var/can_move_docking_ports = FALSE //if this shuttle can move docking ports other than the one it is docked at var/list/hidden_turfs = list() + var/custom_ceiling = /turf/open/floor/roof/ship_hull + var/crashing = FALSE var/shuttle_flags = NONE diff --git a/maps/bigredv2.json b/maps/bigredv2.json index 996d0d44422d..ae3990524cca 100644 --- a/maps/bigredv2.json +++ b/maps/bigredv2.json @@ -3,7 +3,9 @@ "map_path": "map_files/BigRed", "map_file": "BigRed.dmm", "webmap_url": "Solaris", - "weather_holder": "/datum/weather_ss_map_holder/big_red", + "weather": [ + "weather_dust" + ], "survivor_types": [ "/datum/equipment_preset/survivor/scientist/solaris", "/datum/equipment_preset/survivor/doctor/solaris", @@ -45,5 +47,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 2422075 } diff --git a/maps/corsat.json b/maps/corsat.json index 87a41e840d61..a1ba022f300c 100644 --- a/maps/corsat.json +++ b/maps/corsat.json @@ -50,5 +50,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 129609 } diff --git a/maps/desert_dam.json b/maps/desert_dam.json index b40e9887d15b..104616e5982a 100644 --- a/maps/desert_dam.json +++ b/maps/desert_dam.json @@ -3,6 +3,10 @@ "map_path": "map_files/DesertDam", "map_file": "Desert_Dam.dmm", "webmap_url": "Trijent", + "weather": [ + "weather_rain", + "weather_dust" + ], "survivor_types": [ "/datum/equipment_preset/survivor/doctor/trijent", "/datum/equipment_preset/survivor/scientist/trijent", @@ -45,5 +49,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 1483564 } diff --git a/maps/fiorina_sciannex.json b/maps/fiorina_sciannex.json index 61212c433be0..2c16224b284b 100644 --- a/maps/fiorina_sciannex.json +++ b/maps/fiorina_sciannex.json @@ -41,5 +41,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 65520 } diff --git a/maps/ice_colony_v2.json b/maps/ice_colony_v2.json index d8baaab7dcd4..0e8edd5bbc87 100644 --- a/maps/ice_colony_v2.json +++ b/maps/ice_colony_v2.json @@ -5,6 +5,9 @@ "environment_traits": { "COLD": true }, + "weather": [ + "weather_snow" + ], "survivor_types": [ "/datum/equipment_preset/survivor/corporate/shiva", "/datum/equipment_preset/survivor/doctor/shiva", @@ -42,5 +45,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 788466 } diff --git a/maps/kutjevo.json b/maps/kutjevo.json index 83a0ff90c575..ea32f5e62dcc 100644 --- a/maps/kutjevo.json +++ b/maps/kutjevo.json @@ -3,7 +3,9 @@ "map_path": "map_files/Kutjevo", "map_file": "Kutjevo.dmm", "webmap_url": "Kutjevo", - + "weather": [ + "weather_dust" + ], "survivor_types": [ "/datum/equipment_preset/survivor/doctor/kutjevo", "/datum/equipment_preset/survivor/chaplain/kutjevo", @@ -36,5 +38,19 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 1438344, + "map_corpses": 30 } diff --git a/maps/lv522_chances_claim.json b/maps/lv522_chances_claim.json index ac7dfa5f1dcd..bc198bef8b05 100644 --- a/maps/lv522_chances_claim.json +++ b/maps/lv522_chances_claim.json @@ -4,8 +4,10 @@ "map_path": "map_files/LV522_Chances_Claim", "map_file": "LV522_Chances_Claim.dmm", "webmap_url": "LV552", - - "weather_holder": "/datum/weather_ss_map_holder/lv522_chances_claim", + "weather": [ + "weather_rain", + "weather_dust" + ], "survivor_types": [ "/datum/equipment_preset/survivor/forecon/standard" ], @@ -44,5 +46,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 777248 } diff --git a/maps/lv624.json b/maps/lv624.json index 7c782c0a43bf..147e5233bc11 100644 --- a/maps/lv624.json +++ b/maps/lv624.json @@ -3,7 +3,9 @@ "map_path": "map_files/LV624", "map_file": "LV624.dmm", "webmap_url": "LV624", - "weather_holder": "/datum/weather_ss_map_holder/lv624", + "weather": [ + "weather_rain" + ], "survivor_types": [ "/datum/equipment_preset/survivor/scientist/lv", "/datum/equipment_preset/survivor/doctor/lv", @@ -40,5 +42,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 533527 } diff --git a/maps/new_varadero.json b/maps/new_varadero.json index ec90142c2295..090f4af8f642 100644 --- a/maps/new_varadero.json +++ b/maps/new_varadero.json @@ -3,8 +3,10 @@ "map_path": "map_files/New_Varadero", "map_file": "New_Varadero.dmm", "webmap_url": "NewVaradero", - "weather_holder": "/datum/weather_ss_map_holder/new_varadero", - + "weather": [ + "weather_rain", + "weather_dust" + ], "survivor_types": [ "/datum/equipment_preset/survivor/scientist/nv", "/datum/equipment_preset/survivor/doctor/nv", @@ -49,5 +51,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 1870272 } diff --git a/maps/prison_station_fop.json b/maps/prison_station_fop.json index 69469ea2fd03..80be0a514e5d 100644 --- a/maps/prison_station_fop.json +++ b/maps/prison_station_fop.json @@ -42,5 +42,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 34488 } diff --git a/maps/shivas_snowball.json b/maps/shivas_snowball.json index 412f0e35ff41..3eb7e170d3d7 100644 --- a/maps/shivas_snowball.json +++ b/maps/shivas_snowball.json @@ -6,6 +6,10 @@ "environment_traits": { "COLD": true }, + "weather": [ + "weather_rain", + "weather_snow" + ], "survivor_types": [ "/datum/equipment_preset/survivor/corporate/shiva", "/datum/equipment_preset/survivor/doctor/shiva", @@ -44,5 +48,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 1065248 } diff --git a/maps/sorokyne_strata.json b/maps/sorokyne_strata.json index 5a0f6d67c410..cb6d051e6080 100644 --- a/maps/sorokyne_strata.json +++ b/maps/sorokyne_strata.json @@ -6,7 +6,9 @@ "environment_traits": { "COLD": true }, - "weather_holder": "/datum/weather_ss_map_holder/sorokyne", + "weather": [ + "weather_snow" + ], "survivor_types": [ "/datum/equipment_preset/survivor/scientist/soro", "/datum/equipment_preset/survivor/doctor/soro", @@ -41,5 +43,18 @@ "Hive Wars", "Faction Clash", "Infection" - ] + ], + "map_day_night_modificator": { + "Midnight": 1, + "Night": 0.083, + "Dawn": 0.16, + "Sunrise": 0.25, + "Sunrise-Morning": 0.29, + "Morning": 0.33, + "Daytime": 0.416, + "Evening": 0.66, + "Sunset": 0.7916, + "Dusk": 0.916 + }, + "custom_time_length": 1483925 }