Merge pull request #14322 from MrStonedOne/spawnremovals

removes a bunch of unneeded timer less spawns
This commit is contained in:
Jordie
2016-01-04 18:21:36 +11:00
47 changed files with 460 additions and 472 deletions
+5 -4
View File
@@ -93,10 +93,7 @@
for(var/datum/d in objs)
for(var/v in call_list)
// To stop any procs which sleep from executing slowly.
if(d)
if(hascall(d, v))
spawn() call(d, v)(arglist(args_list)) // Spawn in case the function sleeps.
SDQL_callproc(d, v, args_list)
if("delete")
for(var/datum/d in objs)
@@ -147,6 +144,10 @@
/proc/SDQL_callproc(thing, procname, args_list)
set waitfor = 0
if(hascall(thing, procname))
call(thing, procname)(arglist(args_list))
/proc/SDQL_parse(list/query_list)
var/datum/SDQL_parser/parser = new()
+69 -68
View File
@@ -28,78 +28,78 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
/client/proc/callproc()
set category = "Debug"
set name = "Advanced ProcCall"
set waitfor = 0
if(!check_rights(R_DEBUG)) return
spawn(0)
var/target = null
var/targetselected = 0
var/returnval = null
var/class = null
var/target = null
var/targetselected = 0
var/returnval = null
var/class = null
switch(alert("Proc owned by something?",,"Yes","No"))
if("Yes")
targetselected = 1
if(src.holder && src.holder.marked_datum)
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client","Marked datum ([holder.marked_datum.type])")
if(class == "Marked datum ([holder.marked_datum.type])")
class = "Marked datum"
switch(alert("Proc owned by something?",,"Yes","No"))
if("Yes")
targetselected = 1
if(src.holder && src.holder.marked_datum)
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client","Marked datum ([holder.marked_datum.type])")
if(class == "Marked datum ([holder.marked_datum.type])")
class = "Marked datum"
else
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client")
switch(class)
if("Obj")
target = input("Enter target:","Target",usr) as obj in world
if("Mob")
target = input("Enter target:","Target",usr) as mob in world
if("Area or Turf")
target = input("Enter target:","Target",usr.loc) as area|turf in world
if("Client")
var/list/keys = list()
for(var/client/C)
keys += C
target = input("Please, select a player!", "Selection", null, null) as null|anything in keys
if("Marked datum")
target = holder.marked_datum
else
class = input("Proc owned by...","Owner",null) as null|anything in list("Obj","Mob","Area or Turf","Client")
switch(class)
if("Obj")
target = input("Enter target:","Target",usr) as obj in world
if("Mob")
target = input("Enter target:","Target",usr) as mob in world
if("Area or Turf")
target = input("Enter target:","Target",usr.loc) as area|turf in world
if("Client")
var/list/keys = list()
for(var/client/C)
keys += C
target = input("Please, select a player!", "Selection", null, null) as null|anything in keys
if("Marked datum")
target = holder.marked_datum
else
return
if("No")
target = null
targetselected = 0
return
if("No")
target = null
targetselected = 0
var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null
if(!procname) return
if(targetselected && !hascall(target,procname))
usr << "<font color='red'>Error: callproc(): target has no such call [procname].</font>"
var/procname = input("Proc path, eg: /proc/fake_blood","Path:", null) as text|null
if(!procname) return
if(targetselected && !hascall(target,procname))
usr << "<font color='red'>Error: callproc(): target has no such call [procname].</font>"
return
else
var/procpath = text2path(procname)
if (!procpath)
usr << "<font color='red'>Error: callproc(): proc [procname] does not exist. (Did you forget the /proc/ part?)</font>"
return
else
var/procpath = text2path(procname)
if (!procpath)
usr << "<font color='red'>Error: callproc(): proc [procname] does not exist. (Did you forget the /proc/ part?)</font>"
return
procname = procpath
var/list/lst = get_callproc_args()
if(!lst)
var/list/lst = get_callproc_args()
if(!lst)
return
if(targetselected)
if(!target)
usr << "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>"
return
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
else
//this currently has no hascall protection. wasn't able to get it working.
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
if(targetselected)
if(!target)
usr << "<font color='red'>Error: callproc(): owner of proc no longer exists.</font>"
return
log_admin("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [target]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(target,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
else
//this currently has no hascall protection. wasn't able to get it working.
log_admin("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
returnval = call(procname)(arglist(lst)) // Pass the lst as an argument list to the proc
usr << "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
usr << "<font color='blue'>[procname] returned: [returnval ? returnval : "null"]</font>"
feedback_add_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/callproc_datum(A as null|area|mob|obj|turf)
set category = "Debug"
set name = "Atom ProcCall"
set waitfor = 0
if(!check_rights(R_DEBUG))
return
@@ -119,12 +119,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
log_admin("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
message_admins("[key_name(src)] called [A]'s [procname]() with [lst.len ? "the arguments [list2params(lst)]":"no arguments"].")
spawn()
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
usr << "<span class='notice'>[procname] returned: [returnval ? returnval : "null"]</span>"
feedback_add_details("admin_verb","DPC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
var/returnval = call(A,procname)(arglist(lst)) // Pass the lst as an argument list to the proc
usr << "<span class='notice'>[procname] returned: [returnval ? returnval : "null"]</span>"
/client/proc/get_callproc_args()
var/argnum = input("Number of arguments","Number:",0) as num|null
if(!argnum && (argnum!=0)) return
@@ -213,7 +214,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has robotized [M.key].")
var/mob/living/carbon/human/H = M
spawn(10)
spawn(0)
H.Robotize()
else
@@ -229,7 +230,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(istype(M, /mob/living/carbon/human))
log_admin("[key_name(src)] has blobized [M.key].")
var/mob/living/carbon/human/H = M
spawn(10)
spawn(0)
H.Blobize()
else
@@ -253,7 +254,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
log_admin("[key_name(src)] has animalized [M.key].")
spawn(10)
spawn(0)
M.Animalize()
@@ -293,7 +294,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
if(ishuman(M))
log_admin("[key_name(src)] has alienized [M.key].")
spawn(10)
spawn(0)
M:Alienize()
feedback_add_details("admin_verb","MKAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] made [key_name(M)] into an alien.")
@@ -310,7 +311,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
if(ishuman(M))
log_admin("[key_name(src)] has slimeized [M.key].")
spawn(10)
spawn(0)
M:slimeize()
feedback_add_details("admin_verb","MKMET") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] made [key_name(M)] into a slime.")
-2
View File
@@ -76,7 +76,6 @@
if (M.id == src.id)
spawn( 0 )
M.open()
return
sleep(10)
@@ -90,7 +89,6 @@
if (M.id == src.id)
spawn( 0 )
M.close()
return
sleep(10)
cooldown = 0
+1 -4
View File
@@ -56,7 +56,6 @@
cooldown = 2
spawn(10)
process_cooldown()
return
/obj/item/device/assembly/prox_sensor/process()
@@ -71,15 +70,13 @@
/obj/item/device/assembly/prox_sensor/dropped()
spawn(0)
sense()
return
return
/obj/item/device/assembly/prox_sensor/toggle_scan()
if(!secured) return 0
scanning = !scanning
update_icon()
return
/obj/item/device/assembly/prox_sensor/update_icon()
+1 -1
View File
@@ -17,7 +17,7 @@
..()
spawn(40)
set_frequency(frequency)
return
/obj/item/device/assembly/signaler/Destroy()
if(SSradio)
+1 -1
View File
@@ -334,6 +334,6 @@ var/next_external_rsc = 0
'html/browser/scannernew.css',
'html/browser/playeroptions.css',
)
spawn (10)
spawn (10) //removing this spawn causes all clients to not get verbs.
//Precache the client with all other assets slowly, so as to not block other browse() calls
getFilesSlow(src, SSasset.cache, register_asset = FALSE)
+1 -1
View File
@@ -18,7 +18,7 @@
if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/T = pick(turfs)
spawn(0) new/obj/effect/spacevine_controller(T) //spawn a controller at turf
new/obj/effect/spacevine_controller(T) //spawn a controller at turf
/datum/spacevine_mutation
+11 -11
View File
@@ -1,4 +1,5 @@
/mob/living/carbon/proc/dream()
set waitfor = 0
dreaming = 1
var/list/dreams = list(
"an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain",
@@ -8,17 +9,16 @@
"a blue light","an abandoned laboratory","Nanotrasen","The Syndicate","blood","healing","power","respect",
"riches","space","a crash","happiness","pride","a fall","water","flames","ice","melons","flying"
)
spawn(0)
for(var/i = rand(1,4),i > 0, i--)
var/dream_image = pick(dreams)
dreams -= dream_image
src << "<span class='notice'><i>... [dream_image] ...</i></span>"
sleep(rand(40,70))
if(paralysis <= 0)
dreaming = 0
return 0
dreaming = 0
return 1
for(var/i = rand(1,4),i > 0, i--)
var/dream_image = pick(dreams)
dreams -= dream_image
src << "<span class='notice'><i>... [dream_image] ...</i></span>"
sleep(rand(40,70))
if(paralysis <= 0)
dreaming = 0
return 0
dreaming = 0
return 1
/mob/living/carbon/proc/handle_dreams()
if(prob(5) && !dreaming) dream()
+3 -4
View File
@@ -377,7 +377,7 @@
harvest = 0
weedlevel = 0 // Reset
spawn(5) // Wait a while
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>[oldPlantName] suddenly mutated into [myseed.plantname]!</span>")
@@ -397,7 +397,7 @@
harvest = 0
weedlevel = 0 // Reset
spawn(5) // Wait a while
sleep(5) // Wait a while
update_icon()
visible_message("<span class='warning'>The mutated weeds in [src] spawned a [myseed.plantname]!</span>")
else
@@ -798,8 +798,7 @@
user << "<span class='notice'>You reconnect \the [src]'s hoses.</span>"
for(var/obj/machinery/hydroponics/h in range(1,src))
spawn()
h.update_icon()
h.update_icon()
return
+8 -10
View File
@@ -284,16 +284,14 @@ var/global/list/rockTurfEdgeCache
countdown(notify_admins)
/turf/simulated/mineral/gibtonite/proc/countdown(notify_admins = 0)
spawn(0)
while(stage == 1 && det_time > 0 && mineralAmt >= 1)
det_time--
sleep(5)
if(stage == 1 && det_time <= 0 && mineralAmt >= 1)
var/turf/bombturf = get_turf(src)
mineralAmt = 0
explosion(bombturf,1,3,5, adminlog = notify_admins)
if(stage == 0 || stage == 2)
return
set waitfor = 0
while(stage == 1 && det_time > 0 && mineralAmt >= 1)
det_time--
sleep(5)
if(stage == 1 && det_time <= 0 && mineralAmt >= 1)
var/turf/bombturf = get_turf(src)
mineralAmt = 0
explosion(bombturf,1,3,5, adminlog = notify_admins)
/turf/simulated/mineral/gibtonite/proc/defuse()
if(stage == 1)
@@ -182,9 +182,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!istype(usr, /mob/dead/observer))
usr << "Not when you're not dead!"
return
usr.verbs -= /mob/dead/observer/proc/dead_tele
spawn(30)
usr.verbs += /mob/dead/observer/proc/dead_tele
var/A
A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas
var/area/thearea = A
+5 -2
View File
@@ -324,8 +324,8 @@
//proc functions
for(var/Proc in functions)
if(!isnotfunc())
spawn(1)
call(src,Proc)(src)
callfunction(Proc)
//target interaction stays hardcoded
@@ -411,6 +411,9 @@
tryWalk(TARGET)
LAST_TARGET = TARGET
/mob/living/carbon/human/interactive/proc/callfunction(Proc)
set waitfor = 0
call(src,Proc)(src)
/mob/living/carbon/human/interactive/proc/tryWalk(turf/TARGET)
if(!isnotfunc())
if(!walk2derpless(TARGET))
+15 -16
View File
@@ -364,22 +364,21 @@ var/const/GALOSHES_DONT_HELP = 4
adjustBruteLoss(10)
/mob/living/carbon/proc/spin(spintime, speed)
spawn()
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
dir = D
spintime -= speed
return
set waitfor = 0
var/D = dir
while(spintime >= speed)
sleep(speed)
switch(D)
if(NORTH)
D = EAST
if(SOUTH)
D = WEST
if(EAST)
D = SOUTH
if(WEST)
D = NORTH
dir = D
spintime -= speed
/mob/living/carbon/resist_buckle()
if(restrained())
@@ -1215,7 +1215,7 @@
H.adjustOxyLoss(8)
H.throw_alert("too_much_co2", /obj/screen/alert/too_much_co2)
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
spawn(0) H.emote("cough")
H.emote("cough")
else
H.co2overloadtime = 0
@@ -1279,7 +1279,7 @@
H.sleeping = max(H.sleeping+2, 10)
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) H.emote(pick("giggle", "laugh"))
H.emote(pick("giggle", "laugh"))
handle_breath_temperature(breath, H)
@@ -1294,8 +1294,7 @@
if(!(NOBREATH in specflags) || (H.health <= config.health_threshold_crit))
if(prob(20))
spawn(0)
H.emote("gasp")
H.emote("gasp")
if(breath_pp > 0)
var/ratio = safe_breath_min/breath_pp
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!
+18 -20
View File
@@ -48,7 +48,7 @@
if(losebreath > 0)
losebreath--
if(prob(10))
spawn emote("gasp")
emote("gasp")
if(istype(loc, /obj/))
var/obj/loc_as_obj = loc
loc_as_obj.handle_internal_lifeform(src,0)
@@ -113,8 +113,7 @@
//OXYGEN
if(O2_partialpressure < safe_oxy_min) //Not enough oxygen
if(prob(20))
spawn(0)
emote("gasp")
emote("gasp")
if(O2_partialpressure > 0)
var/ratio = safe_oxy_min/O2_partialpressure
adjustOxyLoss(min(5*ratio, 3))
@@ -144,7 +143,7 @@
if(world.time - co2overloadtime > 300)
adjustOxyLoss(8)
if(prob(20))
spawn(0) emote("cough")
emote("cough")
else
co2overloadtime = 0
@@ -168,7 +167,7 @@
sleeping = max(sleeping+2, 10)
else if(SA_partialpressure > 0.01)
if(prob(20))
spawn(0) emote(pick("giggle","laugh"))
emote(pick("giggle","laugh"))
//BREATH TEMPERATURE
handle_breath_temperature(breath)
@@ -264,21 +263,21 @@
/mob/living/carbon/handle_stomach()
spawn(0)
for(var/mob/living/M in stomach_contents)
if(M.loc != src)
set waitfor = 0
for(var/mob/living/M in stomach_contents)
if(M.loc != src)
stomach_contents.Remove(M)
continue
if(istype(M, /mob/living/carbon) && stat != 2)
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
qdel(M)
continue
if(istype(M, /mob/living/carbon) && stat != 2)
if(M.stat == 2)
M.death(1)
stomach_contents.Remove(M)
qdel(M)
continue
if(SSmob.times_fired%3==1)
if(!(M.status_flags & GODMODE))
M.adjustBruteLoss(5)
nutrition += 10
if(SSmob.times_fired%3==1)
if(!(M.status_flags & GODMODE))
M.adjustBruteLoss(5)
nutrition += 10
//This updates the health and status of the mob (conscious, unconscious, dead)
/mob/living/carbon/handle_regular_status_updates()
@@ -320,8 +319,7 @@
adjustStaminaLoss(-10)
sleeping = max(sleeping-1, 0)
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
emote("snore")
else
clear_alert("asleep")
@@ -139,9 +139,7 @@
/mob/living/carbon/monkey/handle_random_events()
if (prob(1) && prob(2))
spawn(0)
emote("scratch")
return
emote("scratch")
/mob/living/carbon/monkey/has_smoke_protection()
if(wear_mask)
@@ -96,10 +96,8 @@
damage = rand(10, 15)
if ( (paralysis < 5) && (health > 0) )
Paralyse(rand(10, 15))
spawn( 0 )
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
visible_message("<span class='danger'>[M] has knocked out [name]!</span>", \
"<span class='userdanger'>[M] has knocked out [name]!</span>")
return
adjustBruteLoss(damage)
add_logs(M, src, "attacked")
updatehealth()
@@ -41,7 +41,6 @@
for(var/obj/machinery/ai_status_display/O in world) //change status
if(src.key)
spawn( 0 )
O.mode = 2
if (istype(loc, /obj/item/device/aicard))
loc.icon_state = "aicard-404"
@@ -153,7 +153,7 @@
dat += "Critical Patient Alerts: <a href='?src=\ref[src];critalerts=1'>[declare_crit ? "Yes" : "No"]</a><br>"
dat += "Patrol Station: <a href='?src=\ref[src];operation=patrol'>[auto_patrol ? "Yes" : "No"]</a><br>"
dat += "Stationary Mode: <a href='?src=\ref[src];stationary=1'>[stationary_mode ? "Yes" : "No"]</a><br>"
return dat
/mob/living/simple_animal/bot/medbot/Topic(href, href_list)
@@ -229,8 +229,7 @@
declare_crit = 0
if(user)
user << "<span class='notice'>You short out [src]'s reagent synthesis circuits.</span>"
spawn(0)
audible_message("<span class='danger'>[src] buzzes oddly!</span>")
audible_message("<span class='danger'>[src] buzzes oddly!</span>")
flick("medibot_spark", src)
if(user)
oldpatient = user
@@ -116,13 +116,11 @@
//second, spin a sticky spiderweb on this tile
var/obj/effect/spider/stickyweb/W = locate() in get_turf(src)
if(!W)
spawn()
Web()
Web()
else
//third, lay an egg cluster there
if(fed)
spawn()
LayEggs()
LayEggs()
else
//fourthly, cocoon any nearby items so those pesky pinkskins can't use them
for(var/obj/O in can_see)
@@ -140,8 +138,7 @@
else if(busy == MOVING_TO_TARGET && cocoon_target)
if(get_dist(src, cocoon_target) <= 1)
spawn()
Wrap()
Wrap()
else
busy = 0
+6 -7
View File
@@ -275,13 +275,12 @@
else
return
L.loc = locate(locx,locy,mobloc.z)
spawn(0)
var/limit = 2//For only two trailing shadows.
for(var/turf/T in getline(mobloc, L.loc))
spawn(0)
anim(T,L,'icons/mob/mob.dmi',,"shadow",,L.dir)
limit--
if(limit<=0) break
var/limit = 2//For only two trailing shadows.
for(var/turf/T in getline(mobloc, L.loc))
spawn(0)
anim(T,L,'icons/mob/mob.dmi',,"shadow",,L.dir)
limit--
if(limit<=0) break
else
spawn(0)
anim(mobloc,mob,'icons/mob/mob.dmi',,"shadow",,L.dir)
+15 -15
View File
@@ -365,18 +365,18 @@
return A.master.lightswitch && A.master.power_light
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
set waitfor = 0
if(flickering) return
flickering = 1
spawn(0)
if(on && status == LIGHT_OK)
for(var/i = 0; i < amount; i++)
if(status != LIGHT_OK) break
on = !on
update(0)
sleep(rand(5, 15))
on = (status == LIGHT_OK)
if(on && status == LIGHT_OK)
for(var/i = 0; i < amount; i++)
if(status != LIGHT_OK) break
on = !on
update(0)
flickering = 0
sleep(rand(5, 15))
on = (status == LIGHT_OK)
update(0)
flickering = 0
// ai attack - make lights flicker, because why not
@@ -539,13 +539,13 @@
// explode the light
/obj/machinery/light/proc/explode()
set waitfor = 0
var/turf/T = get_turf(src.loc)
spawn(0)
broken() // break it first to give a warning
sleep(2)
explosion(T, 0, 0, 2, 2)
sleep(1)
qdel(src)
broken() // break it first to give a warning
sleep(2)
explosion(T, 0, 0, 2, 2)
sleep(1)
qdel(src)
// the light item
// can be tube or bulb subtypes
+1 -2
View File
@@ -80,8 +80,7 @@ var/list/blacklisted_tesla_types = list(/obj/machinery/atmospherics,
var/orbitsize = (I.Width()+I.Height())*pick(0.5,0.6,0.7)
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
spawn(1)
EB.orbit(src,orbitsize, pick(FALSE,TRUE), rand(10,25), pick(3,4,5,6,36))
EB.orbit(src,orbitsize, pick(FALSE,TRUE), rand(10,25), pick(3,4,5,6,36))
+1 -2
View File
@@ -105,8 +105,7 @@
/obj/item/weapon/gun/proc/shoot_live_shot(mob/living/user as mob|obj, pointblank = 0, mob/pbtarget = null, message = 1)
if(recoil)
spawn()
shake_camera(user, recoil + 1, recoil)
shake_camera(user, recoil + 1, recoil)
if(suppressed)
playsound(user, fire_sound, 10, 1)
@@ -41,7 +41,7 @@
return
if(grenades.len)
spawn(0) fire_grenade(target,user)
fire_grenade(target,user)
else
usr << "<span class='danger'>The grenade launcher is empty.</span>"
@@ -51,7 +51,7 @@
var/obj/item/weapon/grenade/chem_grenade/F = grenades[1] //Now with less copypasta!
grenades -= F
F.loc = user.loc
F.throw_at(target, 30, 2,user)
F.throw_at_fast(target, 30, 2,user)
message_admins("[key_name_admin(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
log_game("[key_name(user)] fired a grenade ([F.name]) from a grenade launcher ([src.name]).")
F.active = 1
+12 -12
View File
@@ -122,18 +122,18 @@
/obj/item/projectile/proc/fire()
spawn(1)
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
step_towards(src, current)
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(1)
set waitfor = 0
while(loc)
if(!paused)
if((!( current ) || loc == current))
current = locate(Clamp(x+xo,1,world.maxx),Clamp(y+yo,1,world.maxy),z)
step_towards(src, current)
if(original && (original.layer>=2.75) || ismob(original))
if(loc == get_turf(original))
if(!(original in permutated))
Bump(original, 1)
Range()
sleep(1)
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
@@ -334,15 +334,15 @@
if(!X.anchored)
var/distance = get_dist(X, pull)
var/moving_power = max(range_power - distance, 1)
spawn(0)
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, pull)))
var/throw_range = 5 - distance
X.throw_at(throw_target, throw_range, 1)
else
X.throw_at(pull, distance, 1)
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, pull)))
var/throw_range = 5 - distance
X.throw_at_fast(throw_target, throw_range, 1)
else
X.throw_at_fast(pull, distance, 1)
else
spawn(0)
if(setting_type)
for(var/i in 0 to moving_power-1)
sleep(2)
+7 -7
View File
@@ -70,14 +70,14 @@ var/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs
if(!X.anchored)
var/distance = get_dist(X, T)
var/moving_power = max(range - distance, 1)
spawn(0) //so everything moves at the same time.
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, T)))
X.throw_at(throw_target, moving_power, 1)
else
X.throw_at(T, moving_power, 1)
if(moving_power > 2) //if the vortex is powerful and we're close, we get thrown
if(setting_type)
var/atom/throw_target = get_edge_target_turf(X, get_dir(X, get_step_away(X, T)))
X.throw_at_fast(throw_target, moving_power, 1)
else
X.throw_at_fast(T, moving_power, 1)
else
spawn(0) //so everything moves at the same time.
if(setting_type)
for(var/i = 0, i < moving_power, i++)
sleep(2)
+9 -9
View File
@@ -104,15 +104,15 @@
use_power(100)
affecting = loc.contents - src // moved items will be all in loc
spawn(1) // slight delay to prevent infinite propagation due to map order //TODO: please no spawn() in process(). It's a very bad idea
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)
if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
step(A,movedir)
items_moved++
if(items_moved >= 10)
break
sleep(1) // slight delay to prevent infinite propagation due to map order
var/items_moved = 0
for(var/atom/movable/A in affecting)
if(!A.anchored)
if(A.loc == src.loc) // prevents the object from being affected if it's not currently here.
step(A,movedir)
items_moved++
if(items_moved >= 10)
break
// attack with item, place item on conveyor
/obj/machinery/conveyor/attackby(obj/item/I, mob/user, params)
@@ -62,13 +62,13 @@
loc = D.trunk
active = 1
dir = DOWN
spawn(1)
move() // spawn off the movement process
move()
return
// movement process, persists while holder is moving through pipes
/obj/structure/disposalholder/proc/move()
set waitfor = 0
var/obj/structure/disposalpipe/last
while(active)
var/obj/structure/disposalpipe/curr = loc
+4 -5
View File
@@ -385,11 +385,10 @@
//docking turbulence
if(M.client)
spawn(0)
if(M.buckled)
shake_camera(M, 2, 1) // turn it down a bit come on
else
shake_camera(M, 7, 1)
if(M.buckled)
shake_camera(M, 2, 1) // turn it down a bit come on
else
shake_camera(M, 7, 1)
if(istype(M, /mob/living/carbon))
if(!M.buckled)
M.Weaken(3)