Development Fixes - 06NOV2016 (#1120)

Fixes the mousebeam for more gibbings and ensures that nowhere is safe.
Fixes the multipliers because fuck.
Makes the night lighting process not runtime if night lighting is disabled. Note to Bed: del()-ing processes is bad, they should be disabled instead.
This commit is contained in:
skull132
2016-11-06 20:14:38 +02:00
committed by GitHub
parent faf81f15a1
commit ad1042d033
7 changed files with 58 additions and 36 deletions

View File

@@ -91,6 +91,7 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/callPreStart() /datum/controller/processScheduler/proc/callPreStart()
for (var/datum/controller/process/P in processes) for (var/datum/controller/process/P in processes)
if (!P.disabled)
P.preStart() P.preStart()
/datum/controller/processScheduler/proc/process() /datum/controller/processScheduler/proc/process()

View File

@@ -28,10 +28,11 @@
/datum/controller/process/night_lighting/setup() /datum/controller/process/night_lighting/setup()
name = "night lighting controller" name = "night lighting controller"
schedule_interval = 100 // every 5 seconds schedule_interval = 3600 // Every 5 minutes.
if (!config.night_lighting) if (!config.night_lighting)
del(src) // Stop trying to delete processes. Not how it goes.
disabled = 1
/datum/controller/process/night_lighting/preStart() /datum/controller/process/night_lighting/preStart()
@@ -64,16 +65,25 @@
APC.toggle_nightlight("on") APC.toggle_nightlight("on")
isactive = 1 isactive = 1
SCHECK
/datum/controller/process/night_lighting/proc/deactivate() /datum/controller/process/night_lighting/proc/deactivate()
for (var/obj/machinery/power/apc/APC in get_apc_list()) for (var/obj/machinery/power/apc/APC in get_apc_list())
APC.toggle_nightlight("off") APC.toggle_nightlight("off")
isactive = 0 isactive = 0
SCHECK
/datum/controller/process/night_lighting/proc/get_apc_list() /datum/controller/process/night_lighting/proc/get_apc_list()
var/list/obj/machinery/power/apc/lighting_apcs = list() var/list/obj/machinery/power/apc/lighting_apcs = list()
for (var/area/A in all_areas)
if (!(A.type in lighting_areas)) for (var/A in all_areas)
var/area/B = A
if (!(B.type in lighting_areas))
continue continue
for (var/obj/machinery/power/apc/B in A) if (B.apc)
lighting_apcs += B lighting_apcs += B.apc
SCHECK
return lighting_apcs return lighting_apcs

View File

@@ -145,6 +145,7 @@ var/list/gamemode_cache = list()
var/walk_speed = 0 var/walk_speed = 0
var/walk_delay_multiplier = 1 var/walk_delay_multiplier = 1
var/run_delay_multiplier = 1 var/run_delay_multiplier = 1
var/vehicle_delay_multiplier = 1
//Mob specific modifiers. NOTE: These will affect different mob types in different ways //Mob specific modifiers. NOTE: These will affect different mob types in different ways
var/human_delay = 0 var/human_delay = 0
@@ -788,9 +789,11 @@ var/list/gamemode_cache = list()
// These should never go to 0 or below. So, we clamp them. // These should never go to 0 or below. So, we clamp them.
if("walk_delay_multiplier") if("walk_delay_multiplier")
config.walk_delay_multiplier = max(0.1, text2num(value)) config.walk_delay_multiplier = max(0.1, value)
if("run_delay_multiplier") if("run_delay_multiplier")
config.run_delay_multiplier = max(0.1, text2num(value)) config.run_delay_multiplier = max(0.1, value)
if("vehicle_delay_multiplier")
config.vehicle_delay_multiplier = max(0.1, value)
if("human_delay") if("human_delay")
config.human_delay = value config.human_delay = value

View File

@@ -290,22 +290,20 @@
move_delay += 2 move_delay += 2
return mob.buckled.relaymove(mob,direct) return mob.buckled.relaymove(mob,direct)
var/mob/living/carbon/human/H
if (ishuman(mob))
H = mob
var/tally = mob.movement_delay() + config.walk_speed var/tally = mob.movement_delay() + config.walk_speed
//If we're sprinting and able to continue sprinting, then apply the sprint bonus ontop of this
if (H.m_intent == "run" && H.species.handle_sprint_cost(H, tally))//This will return false if we collapse from exhaustion
tally = tally/(1+H.sprint_speed_factor)
else
tally = max(tally, H.min_walk_delay)//clamp walking speed if its limited
move_delay += tally
// Apply huuman specific modifiers.
if (ishuman(mob))
var/mob/living/carbon/human/H = mob
//If we're sprinting and able to continue sprinting, then apply the sprint bonus ontop of this
if (H.m_intent == "run" && H.species.handle_sprint_cost(H, tally)) //This will return false if we collapse from exhaustion
tally = (tally / (1 + H.sprint_speed_factor)) * config.run_delay_multiplier
else else
move_delay += config.walk_speed tally = max(tally * config.walk_delay_multiplier, H.min_walk_delay) //clamp walking speed if its limited
move_delay += mob.movement_delay() else
tally *= config.walk_delay_multiplier
move_delay += tally
var/tickcomp = 0 //moved this out here so we can use it for vehicles var/tickcomp = 0 //moved this out here so we can use it for vehicles
@@ -314,11 +312,6 @@
tickcomp = ((1/(world.tick_lag))*1.3) - 1.3 tickcomp = ((1/(world.tick_lag))*1.3) - 1.3
move_delay = move_delay + tickcomp move_delay = move_delay + tickcomp
if (H && H.m_intent == "run")
move_delay *= config.run_delay_multiplier
else
move_delay *= config.walk_delay_multiplier
if(istype(mob.machine, /obj/machinery)) if(istype(mob.machine, /obj/machinery))
if(mob.machine.relaymove(mob,direct)) if(mob.machine.relaymove(mob,direct))
return return

View File

@@ -168,24 +168,38 @@
..() ..()
/obj/item/projectile/beam/mousegun/proc/mousepulse(turf/epicenter, range, log=0) /obj/item/projectile/beam/mousegun/proc/mousepulse(turf/epicenter, range, log=0)
if(!epicenter) return if (!epicenter)
return
if(!istype(epicenter, /turf)) if (!istype(epicenter, /turf))
epicenter = get_turf(epicenter.loc) epicenter = get_turf(epicenter.loc)
for(var/atom/T in range(range, epicenter)) for (var/mob/living/M in range(range, epicenter))
var/distance = get_dist(epicenter, T) var/distance = get_dist(epicenter, M)
if(distance < 0) if (distance < 0)
distance = 0 distance = 0
if(distance <= range) if (distance <= range)
var/mob/living/M = T if (M.mob_size <= 2 && (M.find_type() & TYPE_ORGANIC))
if ((istype(M)) && M.mob_size <= 2 && (M.find_type() & TYPE_ORGANIC))
M.visible_message("<span class='danger'>[M] bursts like a balloon!</span>") M.visible_message("<span class='danger'>[M] bursts like a balloon!</span>")
M.gib() M.gib()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, M) s.set_up(3, 1, M)
s.start() s.start()
T << 'sound/effects/basscannon.ogg' else if (iscarbon(M) && M.contents.len)
for (var/obj/item/weapon/holder/H in M.contents)
if (!H.contained)
continue
var/mob/living/A = H.contained
if (!istype(A))
continue
if (A.mob_size <= 2 && (A.find_type() & TYPE_ORGANIC))
H.release_mob()
A.visible_message("<span class='danger'>[A] bursts like a balloon!</span>")
A.gib()
M << 'sound/effects/basscannon.ogg'
return 1 return 1
/obj/item/projectile/beam/shotgun /obj/item/projectile/beam/shotgun

View File

@@ -56,7 +56,7 @@
move_delay = 999999999 move_delay = 999999999
return 0 return 0
move_delay = (1 / move_speed) * 10 move_delay = (1 / move_speed) * 10 * config.vehicle_delay_multiplier
return 1 return 1

View File

@@ -52,6 +52,7 @@ WALK_SPEED 4
## Ideally, you want to modify these. Any value between 0 and 1 will increase speed by decreasing the movement delay, anything above 1 will slow everyone down by increasing the delay. ## Ideally, you want to modify these. Any value between 0 and 1 will increase speed by decreasing the movement delay, anything above 1 will slow everyone down by increasing the delay.
WALK_DELAY_MULTIPLIER 1 WALK_DELAY_MULTIPLIER 1
RUN_DELAY_MULTIPLIER 1 RUN_DELAY_MULTIPLIER 1
VEHICLE_DELAY_MULTIPLIER 1
## The variables below affect the movement of specific mob types. ## The variables below affect the movement of specific mob types.
HUMAN_DELAY 1 HUMAN_DELAY 1