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,7 +91,8 @@ var/global/datum/controller/processScheduler/processScheduler
/datum/controller/processScheduler/proc/callPreStart()
for (var/datum/controller/process/P in processes)
P.preStart()
if (!P.disabled)
P.preStart()
/datum/controller/processScheduler/proc/process()
while(isRunning)

View File

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

View File

@@ -145,6 +145,7 @@ var/list/gamemode_cache = list()
var/walk_speed = 0
var/walk_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
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.
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")
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")
config.human_delay = value

View File

@@ -290,22 +290,20 @@
move_delay += 2
return mob.buckled.relaymove(mob,direct)
var/mob/living/carbon/human/H
var/tally = mob.movement_delay() + config.walk_speed
// Apply huuman specific modifiers.
if (ishuman(mob))
H = mob
var/tally = mob.movement_delay() + config.walk_speed
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)
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
tally = max(tally, H.min_walk_delay)//clamp walking speed if its limited
move_delay += tally
tally = max(tally * config.walk_delay_multiplier, H.min_walk_delay) //clamp walking speed if its limited
else
move_delay += config.walk_speed
move_delay += mob.movement_delay()
tally *= config.walk_delay_multiplier
move_delay += tally
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
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(mob.machine.relaymove(mob,direct))
return

View File

@@ -168,24 +168,38 @@
..()
/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)
for(var/atom/T in range(range, epicenter))
var/distance = get_dist(epicenter, T)
if(distance < 0)
for (var/mob/living/M in range(range, epicenter))
var/distance = get_dist(epicenter, M)
if (distance < 0)
distance = 0
if(distance <= range)
var/mob/living/M = T
if ((istype(M)) && M.mob_size <= 2 && (M.find_type() & TYPE_ORGANIC))
if (distance <= range)
if (M.mob_size <= 2 && (M.find_type() & TYPE_ORGANIC))
M.visible_message("<span class='danger'>[M] bursts like a balloon!</span>")
M.gib()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, M)
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
/obj/item/projectile/beam/shotgun

View File

@@ -56,7 +56,7 @@
move_delay = 999999999
return 0
move_delay = (1 / move_speed) * 10
move_delay = (1 / move_speed) * 10 * config.vehicle_delay_multiplier
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.
WALK_DELAY_MULTIPLIER 1
RUN_DELAY_MULTIPLIER 1
VEHICLE_DELAY_MULTIPLIER 1
## The variables below affect the movement of specific mob types.
HUMAN_DELAY 1