Skip to content

Commit

Permalink
Tweaks space wind probability curve.
Browse files Browse the repository at this point in the history
Basically, before move_prob would be 50% if the pressure was exactly equal to the atoms resistance value, 100% if it was exactly double, etc.

Now that number is 75% if the difference is exactly pressure_resistance, but we minus 25% from the number, meaning it's still 50% if the difference is exactly pressure_resistance, but it raises and lowers fasters otherwise.

We also don't even attempt to move if the move_prob is lower than 25%, to avoid the issue where even small differences make everything move over time.
  • Loading branch information
MrStonedOne authored Aug 8, 2016
1 parent db94623 commit ce5d98c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/modules/atmospherics/environmental/LINDA_turf_tile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,18 @@
/atom/movable/var/last_high_pressure_movement_air_cycle = 0

/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0)
var/const/PROBABILITY_OFFSET = 25
var/const/PROBABILITY_BASE_PRECENT = 75
set waitfor = 0
. = 0
if (!anchored && !pulledby)
. = 1
if (last_high_pressure_movement_air_cycle < SSair.times_fired)
var/move_prob = 100
if (pressure_resistance > 0)
move_prob = pressure_difference/pressure_resistance*50
move_prob = (pressure_difference/pressure_resistance*PROBABILITY_BASE_PRECENT)-PROBABILITY_OFFSET
move_prob += pressure_resistance_prob_delta
if (prob(move_prob))
if (move_prob > PROBABILITY_OFFSET && prob(move_prob))
step(src, direction)
last_high_pressure_movement_air_cycle = SSair.times_fired

Expand Down

0 comments on commit ce5d98c

Please sign in to comment.