Skip to content

Commit 17e6006

Browse files
Merge branch 'Bleeding-Edge' into b-ball-improvements
2 parents 522bac0 + 93a427b commit 17e6006

File tree

140 files changed

+1514
-695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1514
-695
lines changed

__DEFINES/mobs.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#define VOXLGREEN 4
3737
#define VOXAZURE 5
3838
#define VOXEMERALD 6
39+
#define VOXPLUCKED 7
3940

4041
#define GREYGRAY 1
4142
#define GREYLIGHT 2

code/controllers/subsystem/weather.dm

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var/datum/subsystem/weather/SSweather
2-
2+
var/list/climates = list()
33

44
/datum/subsystem/weather
55
name = "weather"
@@ -15,10 +15,25 @@ var/datum/subsystem/weather/SSweather
1515
/datum/subsystem/weather/fire(resumed = FALSE)
1616
if(flags & SS_NO_FIRE)
1717
return
18-
if(map.climate)
19-
var/datum/climate/C = map.climate
20-
C.tick()
18+
if(climates.len)
19+
for(var/datum/climate/C in climates)
20+
C.tick()
2121
else
2222
flags |= SS_NO_FIRE
2323
pause()
2424
message_admins("Weather subsystem was paused due to lack of climate.")
25+
26+
/datum/subsystem/weather/proc/get_climate(var/z)
27+
for(var/datum/climate/C in climates)
28+
if(C.z == z)
29+
return C
30+
if(climates?.len)
31+
return climates[1] //failsafe
32+
else
33+
return null //even more powerful failsave
34+
35+
/datum/subsystem/weather/proc/set_climate(var/datum/climate/climate_type, var/z = 1)
36+
if(!climate_type)
37+
CRASH("Failed to set climate: climate_type was null.")
38+
var/datum/climate/C = new climate_type(z)
39+
climates += C

code/datums/cargo_forwarding.dm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,23 @@
251251
if(current_crate && current_crate.loc != src.loc)
252252
remove_crate()
253253

254+
/obj/machinery/crate_weigher/MouseDropTo(var/obj/structure/C, mob/user)
255+
..()
256+
if(!istype(C))
257+
return
258+
if(!isturf(C.loc))
259+
return
260+
if(user.incapacitated() || user.lying)
261+
return
262+
if(!Adjacent(user) || !Adjacent(C) || !user.Adjacent(C))
263+
return
264+
if(C.anchored)
265+
to_chat(user, "\The [C] is fastened to the floor!")
266+
return
267+
if(C.locked_to || C.is_locking())
268+
return
269+
C.Move(loc)
270+
254271
/obj/machinery/crate_weigher/proc/remove_crate()
255272
current_crate = null
256273
icon_state = "up"

code/datums/climate.dm

Lines changed: 100 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,46 @@ var/list/weathertracker = list() //associative list, gathers time spent one each
2020
var/datum/weather/current_weather
2121
var/list/datum/weather/forecasts = list()
2222
var/cycle_freq = list(3 MINUTES,6 MINUTES) //shortest possible time, longest possible time until next weather
23+
var/z //z-level the climate is occupying
24+
var/list/allowed_weather_types = list() // List of weather types this climate can have
25+
var/list/weather_transitions = list() // Associative list: weather_type = list(possible_transitions)
26+
var/list/weather_intensities = list() // Associative list: weather_type = intensity_level
27+
var/starting_weather_type = null // The initial weather type for this climate
2328

24-
/datum/climate/New()
29+
/datum/climate/New(var/active_z)
2530
..()
26-
if(current_weather)
31+
if(active_z)
32+
z = active_z
33+
else
34+
z = map.zMainStation
35+
setup_weather_system()
36+
if(starting_weather_type)
37+
current_weather = new starting_weather_type(src)
2738
forecast()
2839
else
2940
WARNING("Climate tried to forecast without a starting weather.")
3041
message_admins("Climate tried to forecast without a starting weather.")
3142

43+
// Override this in climate subtypes to define the weather system
44+
/datum/climate/proc/setup_weather_system()
45+
return
46+
3247
/datum/climate/proc/forecast()
3348
var/cycle = 1
3449
clear_forecast()
3550
forecasts = list(current_weather) //project based on current weather
3651
while(forecasts.len <= PREDICTION_MINIMUM+1 && cycle <= PREDICTION_MAXIMUM)
3752
var/datum/weather/W = forecasts[forecasts.len]
38-
var/path = pickweight(W.next_weather)
53+
var/list/possible_transitions = weather_transitions[W.type]
54+
if(!possible_transitions || !possible_transitions.len)
55+
break //No further transitions possible
56+
var/path = pickweight(possible_transitions)
3957
if(path == W.type)
4058
W.timeleft += round(rand(cycle_freq[1],cycle_freq[2]),SS_WAIT_WEATHER)
4159
else
4260
var/datum/weather/future = new path(src)
4361
forecasts += future
44-
if(W.next_weather.len == 1)
62+
if(possible_transitions.len == 1)
4563
break //Forecast no further.
4664
cycle++
4765
forecasts -= current_weather //remove it from our future weather
@@ -57,7 +75,7 @@ var/list/weathertracker = list() //associative list, gathers time spent one each
5775
return
5876
current_weather.tick()
5977
if(current_weather.timeleft <= 0)
60-
change_weather(forecasts[1])
78+
change_weather(forecasts[1],force = TRUE)
6179
forecasts -= forecasts[1]
6280
if(forecasts.len < PREDICTION_MINIMUM)
6381
forecast()
@@ -69,59 +87,106 @@ var/list/weathertracker = list() //associative list, gathers time spent one each
6987
if(direction**2 != 1)
7088
return INVALID_STEP //must be 1 or -1
7189
if(current_weather)
72-
var/weathers = current_weather.next_weather.len
73-
if(weathers == 1)
90+
var/current_intensity = weather_intensities[current_weather.type]
91+
if(isnull(current_intensity))
92+
return CANNOT_CHANGE
93+
var/target_intensity = current_intensity + direction
94+
var/preferred_weather = null
95+
for(var/weather_type in allowed_weather_types)
96+
if(weather_intensities[weather_type] == target_intensity)
97+
var/list/possible_transitions = weather_transitions[current_weather.type]
98+
if(possible_transitions && (weather_type in possible_transitions))
99+
preferred_weather = weather_type
100+
break
101+
if(!preferred_weather)
74102
return CANNOT_CHANGE
75-
var/preferred_weather
76-
if(direction == INTENSIFY)
77-
preferred_weather = current_weather.next_weather[weathers] //the last value
78-
else if(direction == ABATE)
79-
preferred_weather = current_weather.next_weather[1] //the first value
80103
if(preferred_weather == current_weather.type)
81104
return FALSE
82105
current_weather.timeleft = min(1 MINUTES, current_weather.timeleft)
83-
current_weather.next_weather.Cut()
84-
current_weather.next_weather[preferred_weather] = 100
106+
var/list/old_transitions = weather_transitions[current_weather.type]
107+
weather_transitions[current_weather.type] = list()
108+
weather_transitions[current_weather.type][preferred_weather] = 100
85109
forecast()
110+
weather_transitions[current_weather.type] = old_transitions
86111
return TRUE
87112

88-
/datum/climate/proc/change_weather(weather)
113+
/datum/climate/proc/change_weather(weather, force = FALSE)
89114
if(ispath(weather))
90115
//We have been provided a path. Let's see if it's identical to the one we have.
91116
if(ispath(weather, current_weather.type)) //This is a separate check so that we can have our warning work.
92117
return //No need to change, this is our current type.
93118
else
94-
qdel(current_weather)
95-
current_weather = new weather(src)
96-
current_weather.execute()
119+
if(force)
120+
qdel(current_weather)
121+
current_weather = new weather(src)
122+
current_weather.execute()
123+
else
124+
weather_transitions[current_weather.type] = list(weather = 100)
97125

98126
else if(istype(weather,/datum/weather))
99127
//We have been given a specific weather datum. It may be modified, so run it no matter what.
100-
qdel(current_weather)
101-
current_weather = weather
102-
current_weather.execute()
128+
if(force)
129+
qdel(current_weather)
130+
current_weather = weather
131+
current_weather.execute()
132+
else
133+
var/datum/weather/W = weather
134+
weather_transitions[current_weather.type] = list(W.type = 100)
103135

104136
else
105137
WARNING("Change weather was called with [weather], neither a weather datum nor a path.")
106138

107139
/datum/climate/arctic
108140
name = "snow" //what scoreboard displays
109-
//some day this may not be the norm
141+
142+
starting_weather_type = /datum/weather/snow/calm
143+
allowed_weather_types = list(
144+
/datum/weather/snow/calm,
145+
/datum/weather/snow/light,
146+
/datum/weather/snow/heavy,
147+
/datum/weather/snow/blizzard,
148+
/datum/weather/snow/blizzard/omega
149+
)
150+
weather_intensities = list(
151+
/datum/weather/snow/calm = 0,
152+
/datum/weather/snow/light = 1,
153+
/datum/weather/snow/heavy = 2,
154+
/datum/weather/snow/blizzard = 3,
155+
/datum/weather/snow/blizzard/omega = 4
156+
)
157+
weather_transitions = list(
158+
/datum/weather/snow/calm = list(
159+
/datum/weather/snow/calm = 60,
160+
/datum/weather/snow/light = 40
161+
),
162+
/datum/weather/snow/light = list(
163+
/datum/weather/snow/calm = 25,
164+
/datum/weather/snow/light = 55,
165+
/datum/weather/snow/heavy = 20
166+
),
167+
/datum/weather/snow/heavy = list(
168+
/datum/weather/snow/light = 30,
169+
/datum/weather/snow/heavy = 60,
170+
/datum/weather/snow/blizzard = 10
171+
),
172+
/datum/weather/snow/blizzard = list(
173+
/datum/weather/snow/heavy = 65,
174+
/datum/weather/snow/blizzard = 35
175+
),
176+
/datum/weather/snow/blizzard/omega = list(
177+
/datum/weather/snow/heavy = 100
178+
)
179+
)
110180

111181
/datum/climate/arctic/New()
112-
current_weather = new /datum/weather/snow/calm(src)
182+
..()
113183
if(!blizzard_image)
114-
blizzard_image = new
184+
blizzard_image = new(src)
115185
blizzard_image.UpdateSnowfall(SNOW_CALM)
116-
..()
117186

118187
/////////////////////////////////// WEATHER DATUMS //////////////////////////////
119-
120188
/datum/weather
121189
var/name = "weather"
122-
var/list/next_weather = list() //associative list
123-
//for next_weather, order matters: put in order of weather intensity, so that step() will work
124-
//only one in list means it can't be changed by the weather control device
125190
var/timeleft = 1
126191
var/datum/climate/parent
127192
var/temperature = T20C
@@ -141,13 +206,19 @@ var/list/global_snowtiles = list()
141206
var/list/environment_snowtiles = list()
142207
var/list/snow_state_to_texture = list()
143208

209+
/datum/weather/proc/weather_details()
210+
return //additional info to report to the climate computer
211+
144212
/datum/weather/snow
145213
var/snow_intensity = SNOW_CALM
146214
var/tile_interval = 5
147215
var/snowfall_prob = 0
148216
var/snowfall_rate = list(0,0)
149217
var/snow_fluff_estimate = "snowing"
150218

219+
/datum/weather/snow/weather_details()
220+
return "<b>Snowfall:</b> <div class='line'>[snow_fluff_estimate] </div>"
221+
151222
var/obj/effect/blizzard_holder/blizzard_image = null
152223

153224
/datum/weather/snow/New(var/datum/climate/C)
@@ -190,7 +261,6 @@ var/list/snowstorm_ambience_volumes = list(30,40,60,80)
190261
/datum/weather/snow/calm
191262
name = "calm"
192263
snow_intensity = SNOW_CALM
193-
next_weather = list(/datum/weather/snow/calm = 60, /datum/weather/snow/light = 40)
194264
snowfall_prob = 3
195265
snowfall_rate = list(-1,0)
196266
temperature = T_ARCTIC
@@ -205,7 +275,6 @@ var/list/snowstorm_ambience_volumes = list(30,40,60,80)
205275
/datum/weather/snow/light
206276
name = "light"
207277
snow_intensity = SNOW_AVERAGE
208-
next_weather = list(/datum/weather/snow/calm = 25, /datum/weather/snow/light = 55, /datum/weather/snow/heavy = 20)
209278
snowfall_prob = 5
210279
snowfall_rate = list(1,8)
211280
temperature = T_ARCTIC - 5
@@ -220,7 +289,6 @@ var/list/snowstorm_ambience_volumes = list(30,40,60,80)
220289
/datum/weather/snow/heavy
221290
name = "<font color='orange'>heavy</font>"
222291
snow_intensity = SNOW_HARD
223-
next_weather = list(/datum/weather/snow/light = 30, /datum/weather/snow/heavy = 60, /datum/weather/snow/blizzard = 10)
224292
snowfall_prob = 8
225293
snowfall_rate = list(2,15)
226294
temperature = T_ARCTIC - 10
@@ -235,7 +303,6 @@ var/list/snowstorm_ambience_volumes = list(30,40,60,80)
235303
/datum/weather/snow/blizzard
236304
name = "<font color='red'>blizzard</font>"
237305
snow_intensity = SNOW_BLIZZARD
238-
next_weather = list(/datum/weather/snow/heavy = 65, /datum/weather/snow/blizzard = 35)
239306
tile_interval = 3
240307
snowfall_prob = 12
241308
snowfall_rate = list(3,20)
@@ -250,7 +317,6 @@ var/list/snowstorm_ambience_volumes = list(30,40,60,80)
250317

251318
/datum/weather/snow/blizzard/omega
252319
name = "<font color='purple'>dark season</font>"
253-
next_weather = list(/datum/weather/snow/heavy = 100)
254320
snowfall_prob = 15
255321
snow_fluff_estimate = "<font color='purple'>more than 13.5cm/minute (Dark Season)</font>"
256322

code/datums/gamemode/factions/bloodcult/bloodrealm/fauna/bloodrealm_meatblob.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@
834834
//"Corpse" that spawns when a meatblob tile gets destroyed, meant to be butchered
835835
/mob/living/simple_animal/meat_blob_chunk
836836
name = "meat blob chunk"
837-
desc = "The remains of a meat blob, waiting to be butchered"
837+
desc = "The remains of a meat blob, waiting to be butchered."
838838
icon = 'icons/mob/meatblob.dmi'
839839
icon_state = "blob_corpse"
840840
icon_living = "blob_corpse"

code/datums/gamemode/role/judge.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
ID = JUSTICE_DEPARTMENT
8989
initial_role = JUDGE
9090
late_role = JUDGE
91-
desc = "I AM THE LAW"
91+
desc = "I AM THE LAW!"
9292
logo_state = "gun-logo"
9393
initroletype = /datum/role/judge
9494
roletype = /datum/role/judge

code/datums/gamemode/role/madmonkey.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
spread_type = SPECIAL
77
affected_species = list("Monkey", "Human")
88
curable = 0
9-
desc = "monkeys with this disease will bite humans, causing humans to spontaneously mutate into a monkey."
9+
desc = "Monkeys with this disease will bite humans, causing humans to spontaneously mutate into a monkey."
1010
severity = "Medium"
1111
//stage_prob = 100
1212
agent = "Kongey Vibrion M-909"

0 commit comments

Comments
 (0)