April sync (#360)

* Maps and things no code/icons

* helpers defines globalvars

* Onclick world.dm orphaned_procs

* subsystems

Round vote and shuttle autocall done here too

* datums

* Game folder

* Admin - chatter modules

* clothing - mining

* modular computers - zambies

* client

* mob level 1

* mob stage 2 + simple_animal

* silicons n brains

* mob stage 3 + Alien/Monkey

* human mobs

* icons updated

* some sounds

* emitter y u no commit

* update tgstation.dme

* compile fixes

* travis fixes

Also removes Fast digest mode, because reasons.

* tweaks for travis Mentors are broke again

Also fixes Sizeray guns

* oxygen loss fix for vore code.

* removes unused code

* some code updates

* bulk fixes

* further fixes

* outside things

* whoops.

* Maint bar ported

* GLOBs.
This commit is contained in:
Poojawa
2017-04-13 23:37:00 -05:00
committed by GitHub
parent cdc32c98fa
commit 7e9b96a00f
1322 changed files with 174827 additions and 23888 deletions
+37 -18
View File
@@ -7,17 +7,16 @@
var/icon
var/icon_state = "" //icon state of the main segments of the beam
var/max_distance = 0
var/endtime = 0
var/sleep_time = 3
var/finished = 0
var/target_oldloc = null
var/origin_oldloc = null
var/static_beam = 0
var/beam_type = /obj/effect/ebeam //must be subtype
var/timing_id = null
var/recalculating = FALSE
/datum/beam/New(beam_origin,beam_target,beam_icon='icons/effects/beam.dmi',beam_icon_state="b_beam",time=50,maxdistance=10,btype = /obj/effect/ebeam,beam_sleep_time=3)
endtime = world.time+time
origin = beam_origin
origin_oldloc = get_turf(origin)
target = beam_target
@@ -30,11 +29,19 @@
icon = beam_icon
icon_state = beam_icon_state
beam_type = btype
addtimer(CALLBACK(src,.proc/End), time)
/datum/beam/proc/Start()
Draw()
while(!finished && origin && target && world.time < endtime && get_dist(origin,target)<max_distance && origin.z == target.z)
recalculate_in(sleep_time)
/datum/beam/proc/recalculate()
if(recalculating)
recalculate_in(sleep_time)
return
recalculating = TRUE
timing_id = null
if(origin && target && get_dist(origin,target)<max_distance && origin.z == target.z)
var/origin_turf = get_turf(origin)
var/target_turf = get_turf(target)
if(!static_beam && (origin_turf != origin_oldloc || target_turf != target_oldloc))
@@ -42,19 +49,36 @@
target_oldloc = target_turf
Reset()
Draw()
sleep(sleep_time)
if(!QDELETED(src))
qdel(src)
after_calculate()
recalculating = FALSE
else
End()
/datum/beam/proc/afterDraw()
return
/datum/beam/proc/End()
/datum/beam/proc/recalculate_in(time)
if(timing_id)
deltimer(timing_id)
timing_id = addtimer(CALLBACK(src, .proc/recalculate), time, TIMER_STOPPABLE)
/datum/beam/proc/after_calculate()
if((sleep_time == null) || finished) //Does not automatically recalculate.
return
if(isnull(timing_id))
timing_id = addtimer(CALLBACK(src, .proc/recalculate), sleep_time, TIMER_STOPPABLE)
/datum/beam/proc/End(destroy_self = TRUE)
finished = TRUE
if(!isnull(timing_id))
deltimer(timing_id)
if(!QDELETED(src) && destroy_self)
qdel(src)
/datum/beam/proc/Reset()
for(var/obj/effect/ebeam/B in elements)
qdel(B)
elements.Cut()
/datum/beam/Destroy()
Reset()
@@ -62,10 +86,8 @@
origin = null
return ..()
/datum/beam/proc/Draw()
var/Angle = round(Get_Angle(origin,target))
var/matrix/rot_matrix = matrix()
rot_matrix.Turn(Angle)
@@ -78,7 +100,7 @@
for(N in 0 to length-1 step 32)//-1 as we want < not <=, but we want the speed of X in Y to Z and step X
var/obj/effect/ebeam/X = new beam_type(origin_oldloc)
X.owner = src
elements |= X
elements += X
//Assign icon, for main segments it's base_icon, for the end, it's icon+icon_state
//cropped by a transparent box of length-N pixel size
@@ -116,21 +138,18 @@
X.pixel_x = Pixel_x
X.pixel_y = Pixel_y
CHECK_TICK
afterDraw()
/obj/effect/ebeam
mouse_opacity = 0
anchored = 1
var/datum/beam/owner
/obj/effect/ebeam/Destroy()
owner = null
return ..()
/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10,beam_type=/obj/effect/ebeam,beam_sleep_time = 3)
var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type,beam_sleep_time)
INVOKE_ASYNC(newbeam, /datum/beam/.proc/Start)
return newbeam