Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into upstream-merge-27728

This commit is contained in:
LetterJay
2017-06-05 23:07:52 -05:00
376 changed files with 404568 additions and 231827 deletions
+2 -2
View File
@@ -32,7 +32,7 @@
var/list/symptoms = list() // The symptoms of the disease.
var/id = ""
var/processing = 0
// The order goes from easy to cure to hard to cure.
var/static/list/advance_cures = list(
"sodiumchloride", "sugar", "orangejuice",
@@ -399,7 +399,7 @@
AD.Refresh()
for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list))
if(H.z != 1)
if(H.z != ZLEVEL_STATION)
continue
if(!H.HasDisease(D))
H.ForceContractDisease(D)
+399
View File
@@ -0,0 +1,399 @@
#define EXPLOSION_THROW_SPEED 4
GLOBAL_LIST_EMPTY(explosions)
//Against my better judgement, I will return the explosion datum
//If I see any GC errors for it I will find you
//and I will gib you
/proc/explosion(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = TRUE, ignorecap = FALSE, flame_range = 0 , silent = FALSE, smoke = FALSE)
return new /datum/explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog, ignorecap, flame_range, silent, smoke)
//This datum creates 3 async tasks
//1 GatherSpiralTurfsProc runs spiral_range_turfs(tick_checked = TRUE) to populate the affected_turfs list
//2 CaculateExplosionBlock adds the blockings to the cached_exp_block list
//3 The main thread explodes the prepared turfs
/datum/explosion
var/explosion_id
var/started_at
var/running = TRUE
var/stopped = 0 //This is the number of threads stopped !DOESN'T COUNT THREAD 2!
var/static/id_counter = 0
#define EX_PREPROCESS_EXIT_CHECK \
if(!running) {\
stopped = 2;\
qdel(src);\
return;\
}
#define EX_PREPROCESS_CHECK_TICK \
if(TICK_CHECK) {\
stoplag();\
EX_PREPROCESS_EXIT_CHECK\
}
/datum/explosion/New(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog, ignorecap, flame_range, silent, smoke)
set waitfor = FALSE
var/id = ++id_counter
explosion_id = id
epicenter = get_turf(epicenter)
if(!epicenter)
return
GLOB.explosions += src
if(isnull(flame_range))
flame_range = light_impact_range
if(isnull(flash_range))
flash_range = devastation_range
// Archive the uncapped explosion for the doppler array
var/orig_dev_range = devastation_range
var/orig_heavy_range = heavy_impact_range
var/orig_light_range = light_impact_range
if(!ignorecap && epicenter.z != ZLEVEL_MINING)
//Clamp all values to MAX_EXPLOSION_RANGE
devastation_range = min(GLOB.MAX_EX_DEVESTATION_RANGE, devastation_range)
heavy_impact_range = min(GLOB.MAX_EX_HEAVY_RANGE, heavy_impact_range)
light_impact_range = min(GLOB.MAX_EX_LIGHT_RANGE, light_impact_range)
flash_range = min(GLOB.MAX_EX_FLASH_RANGE, flash_range)
flame_range = min(GLOB.MAX_EX_FLAME_RANGE, flame_range)
//DO NOT REMOVE THIS SLEEP, IT BREAKS THINGS
//not sleeping causes us to ex_act() the thing that triggered the explosion
//doing that might cause it to trigger another explosion
//this is bad
//I would make this not ex_act the thing that triggered the explosion,
//but everything that explodes gives us their loc or a get_turf()
//and somethings expect us to ex_act them so they can qdel()
stoplag() //tldr, let the calling proc call qdel(src) before we explode
EX_PREPROCESS_EXIT_CHECK
started_at = REALTIMEOFDAY
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
if(adminlog)
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area: [get_area(epicenter)] [ADMIN_COORDJMP(epicenter)]")
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z])")
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
// Stereo users will also hear the direction of the explosion!
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
// 3/7/14 will calculate to 80 + 35
var/far_dist = 0
far_dist += heavy_impact_range * 5
far_dist += devastation_range * 20
var/x0 = epicenter.x
var/y0 = epicenter.y
var/z0 = epicenter.z
if(!silent)
var/frequency = get_rand_frequency()
var/ex_sound = get_sfx("explosion")
for(var/mob/M in GLOB.player_list)
// Double check for client
var/turf/M_turf = get_turf(M)
if(M_turf && M_turf.z == z0)
var/dist = get_dist(M_turf, epicenter)
// If inside the blast radius + world.view - 2
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, ex_sound, 100, 1, frequency, falloff = 5)
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = Clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
EX_PREPROCESS_CHECK_TICK
//postpone processing for a bit
var/postponeCycles = max(round(devastation_range/8),1)
SSlighting.postpone(postponeCycles)
SSmachines.postpone(postponeCycles)
if(heavy_impact_range > 1)
var/datum/effect_system/explosion/E
if(smoke)
E = new /datum/effect_system/explosion/smoke
else
E = new
E.set_up(epicenter)
E.start()
EX_PREPROCESS_CHECK_TICK
//flash mobs
if(flash_range)
for(var/mob/living/L in viewers(flash_range, epicenter))
L.flash_act()
EX_PREPROCESS_CHECK_TICK
var/list/exploded_this_tick = list() //open turfs that need to be blocked off while we sleep
var/list/affected_turfs = GatherSpiralTurfs(max_range, epicenter)
var/reactionary = config.reactionary_explosions
var/list/cached_exp_block
if(reactionary)
cached_exp_block = CaculateExplosionBlock(affected_turfs)
//lists are guaranteed to contain at least 1 turf at this point
var/iteration = 0
var/affTurfLen = affected_turfs.len
var/expBlockLen = cached_exp_block.len
for(var/TI in affected_turfs)
var/turf/T = TI
++iteration
var/init_dist = cheap_hypotenuse(T.x, T.y, x0, y0)
var/dist = init_dist
if(reactionary)
var/turf/Trajectory = T
while(Trajectory != epicenter)
Trajectory = get_step_towards(Trajectory, epicenter)
dist += cached_exp_block[Trajectory]
var/flame_dist = dist < flame_range
var/throw_dist = dist
if(dist < devastation_range)
dist = 1
else if(dist < heavy_impact_range)
dist = 2
else if(dist < light_impact_range)
dist = 3
else
dist = 0
//------- EX_ACT AND TURF FIRES -------
if(flame_dist && prob(40) && !isspaceturf(T) && !T.density)
new /obj/effect/hotspot(T) //Mostly for ambience!
if(dist > 0)
T.explosion_level = max(T.explosion_level, dist) //let the bigger one have it
T.explosion_id = id
T.ex_act(dist)
exploded_this_tick += T
//--- THROW ITEMS AROUND ---
var/throw_dir = get_dir(epicenter,T)
for(var/obj/item/I in T)
if(!I.anchored)
var/throw_range = rand(throw_dist, max_range)
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
I.throw_speed = EXPLOSION_THROW_SPEED //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything)
I.throw_at(throw_at, throw_range, EXPLOSION_THROW_SPEED)
//wait for the lists to repop
var/break_condition
if(reactionary)
//If we've caught up to the density checker thread and there are no more turfs to process
break_condition = iteration == expBlockLen && iteration < affTurfLen
else
//If we've caught up to the turf gathering thread and it's still running
break_condition = iteration == affTurfLen && !stopped
if(break_condition || TICK_CHECK)
stoplag()
if(!running)
break
//update the trackers
affTurfLen = affected_turfs.len
expBlockLen = cached_exp_block.len
if(break_condition)
if(reactionary)
//until there are more block checked turfs than what we are currently at
//or the explosion has stopped
UNTIL(iteration < affTurfLen || !running)
else
//until there are more gathered turfs than what we are currently at
//or there are no more turfs to gather/the explosion has stopped
UNTIL(iteration < expBlockLen || stopped)
if(!running)
break
//update the trackers
affTurfLen = affected_turfs.len
expBlockLen = cached_exp_block.len
var/circumference = (PI * (init_dist + 4) * 2) //+4 to radius to prevent shit gaps
if(exploded_this_tick.len > circumference) //only do this every revolution
for(var/Unexplode in exploded_this_tick)
var/turf/UnexplodeT = Unexplode
UnexplodeT.explosion_level = 0
exploded_this_tick.Cut()
//unfuck the shit
for(var/Unexplode in exploded_this_tick)
var/turf/UnexplodeT = Unexplode
UnexplodeT.explosion_level = 0
exploded_this_tick.Cut()
var/took = (REALTIMEOFDAY - started_at) / 10
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
if(GLOB.Debug2)
log_world("## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds.")
if(running) //if we aren't in a hurry
//Machines which report explosions.
for(var/array in GLOB.doppler_arrays)
var/obj/machinery/doppler_array/A = array
A.sense_explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, took,orig_dev_range, orig_heavy_range, orig_light_range)
++stopped
qdel(src)
#undef EX_PREPROCESS_EXIT_CHECK
#undef EX_PREPROCESS_CHECK_TICK
//asyncly populate the affected_turfs list
/datum/explosion/proc/GatherSpiralTurfs(range, turf/epicenter)
set waitfor = FALSE
. = list()
spiral_range_turfs(range, epicenter, outlist = ., tick_checked = TRUE)
++stopped
/datum/explosion/proc/CaculateExplosionBlock(list/affected_turfs)
set waitfor = FALSE
. = list()
var/processed = 0
while(!stopped && running)
var/I
for(I in (processed + 1) to affected_turfs.len) // we cache the explosion block rating of every turf in the explosion area
var/turf/T = affected_turfs[I]
var/current_exp_block = T.density ? T.explosion_block : 0
for(var/obj/machinery/door/D in T)
if(D.density)
current_exp_block += D.explosion_block
for(var/obj/structure/window/W in T)
if(W.reinf && W.fulltile)
current_exp_block += W.explosion_block
for(var/obj/structure/blob/B in T)
current_exp_block += B.explosion_block
.[T] = current_exp_block
if(TICK_CHECK)
break
processed = I
stoplag()
/datum/explosion/Destroy()
running = FALSE
if(stopped < 2) //wait for main thread and spiral_range thread
return QDEL_HINT_IWILLGC
GLOB.explosions -= src
return ..()
/client/proc/check_bomb_impacts()
set name = "Check Bomb Impact"
set category = "Debug"
var/newmode = alert("Use reactionary explosions?","Check Bomb Impact", "Yes", "No")
var/turf/epicenter = get_turf(mob)
if(!epicenter)
return
var/dev = 0
var/heavy = 0
var/light = 0
var/list/choices = list("Small Bomb","Medium Bomb","Big Bomb","Custom Bomb")
var/choice = input("Bomb Size?") in choices
switch(choice)
if(null)
return 0
if("Small Bomb")
dev = 1
heavy = 2
light = 3
if("Medium Bomb")
dev = 2
heavy = 3
light = 4
if("Big Bomb")
dev = 3
heavy = 5
light = 7
if("Custom Bomb")
dev = input("Devestation range (Tiles):") as num
heavy = input("Heavy impact range (Tiles):") as num
light = input("Light impact range (Tiles):") as num
var/max_range = max(dev, heavy, light)
var/x0 = epicenter.x
var/y0 = epicenter.y
var/list/wipe_colours = list()
for(var/turf/T in spiral_range_turfs(max_range, epicenter))
wipe_colours += T
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
if(newmode == "Yes")
var/turf/TT = T
while(TT != epicenter)
TT = get_step_towards(TT,epicenter)
if(TT.density && TT.explosion_block)
dist += TT.explosion_block
for(var/obj/machinery/door/D in TT)
if(D.density && D.explosion_block)
dist += D.explosion_block
for(var/obj/structure/window/W in TT)
if(W.explosion_block && W.fulltile)
dist += W.explosion_block
for(var/obj/structure/blob/B in T)
dist += B.explosion_block
if(dist < dev)
T.color = "red"
T.maptext = "Dev"
else if (dist < heavy)
T.color = "yellow"
T.maptext = "Heavy"
else if (dist < light)
T.color = "blue"
T.maptext = "Light"
else
continue
sleep(100)
for(var/turf/T in wipe_colours)
T.color = null
T.maptext = ""
/proc/dyn_explosion(turf/epicenter, power, flash_range, adminlog = 1, ignorecap = 1, flame_range = 0 ,silent = 0, smoke = 1)
if(!power)
return
var/range = 0
range = round((2 * power)**GLOB.DYN_EX_SCALE)
explosion(epicenter, round(range * 0.25), round(range * 0.5), round(range), flash_range*range, adminlog, ignorecap, flame_range*range, silent, smoke)
// Using default dyn_ex scale:
// 100 explosion power is a (5, 10, 20) explosion.
// 75 explosion power is a (4, 8, 17) explosion.
// 50 explosion power is a (3, 7, 14) explosion.
// 25 explosion power is a (2, 5, 10) explosion.
// 10 explosion power is a (1, 3, 6) explosion.
// 5 explosion power is a (0, 1, 3) explosion.
// 1 explosion power is a (0, 0, 1) explosion.
+38 -28
View File
@@ -1,37 +1,44 @@
/datum/getrev
var/originmastercommit
var/originmastercommit
var/commit
var/list/testmerge = list()
var/has_pr_details = FALSE //example data in a testmerge entry when this is true: https://api.github.com/repositories/3234987/pulls/22586
var/has_pr_details = FALSE //tgs2 support
var/date
/datum/getrev/New()
if(SERVERTOOLS && fexists("..\\prtestjob.lk"))
if(fexists(SERVICE_PR_TEST_JSON))
testmerge = json_decode(file2text(SERVICE_PR_TEST_JSON))
else if(!world.RunningService() && fexists("../prtestjob.lk")) //tgs2 support
var/list/tmp = world.file2list("..\\prtestjob.lk")
for(var/I in tmp)
if(I)
testmerge |= I
log_world("Running /tg/ revision:")
var/list/logs = world.file2list(".git/logs/HEAD")
if(logs)
logs = splittext(logs[logs.len - 1], " ")
date = unix2date(text2num(logs[5]))
commit = logs[2]
log_world("[date]")
logs = world.file2list(".git/logs/refs/remotes/origin/master")
if(logs)
originmastercommit = splittext(logs[logs.len - 1], " ")[2]
var/list/logs = world.file2list(".git/logs/HEAD")
if(logs)
logs = splittext(logs[logs.len - 1], " ")
date = unix2date(text2num(logs[5]))
commit = logs[2]
log_world("[date]")
logs = world.file2list(".git/logs/refs/remotes/origin/master")
if(logs)
originmastercommit = splittext(logs[logs.len - 1], " ")[2]
if(testmerge.len)
log_world(commit)
for(var/line in testmerge)
if(line)
log_world("Test merge active of PR #[line]")
SSblackbox.add_details("testmerged_prs","[line]")
log_world("Based off origin/master commit [originmastercommit]")
if(world.RunningService())
var/tmcommit = testmerge[line]["commit"]
log_world("Test merge active of PR #[line] commit [tmcommit]")
SSblackbox.add_details("testmerged_prs","[line]|[tmcommit]")
else //tgs2 support
log_world("Test merge active of PR #[line]")
SSblackbox.add_details("testmerged_prs","[line]")
log_world("Based off origin/master commit [originmastercommit]")
else
log_world(originmastercommit)
log_world(originmastercommit)
/datum/getrev/proc/DownloadPRDetails()
if(!config.githubrepoid)
@@ -66,8 +73,11 @@
return ""
. = header ? "The following pull requests are currently test merged:<br>" : ""
for(var/line in testmerge)
var/details = ""
if(has_pr_details)
var/cm = testmerge[line]["commit"]
var/details
if(world.RunningService())
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["author"]) + " at commit " + html_encode(copytext(cm, 1, min(length(cm), 7)))
else if(has_pr_details) //tgs2 support
details = ": '" + html_encode(testmerge[line]["title"]) + "' by " + html_encode(testmerge[line]["user"]["login"])
. += "<a href='[config.githuburl]/pull/[line]'>#[line][details]</a><br>"
@@ -76,14 +86,14 @@
set name = "Show Server Revision"
set desc = "Check the current server code revision"
if(GLOB.revdata.originmastercommit)
if(GLOB.revdata.originmastercommit)
to_chat(src, "<b>Server revision compiled on:</b> [GLOB.revdata.date]")
var/prefix = ""
var/prefix = ""
if(GLOB.revdata.testmerge.len)
to_chat(src, GLOB.revdata.GetTestMergeInfo())
prefix = "Based off origin/master commit: "
var/pc = GLOB.revdata.originmastercommit
to_chat(src, "[prefix]<a href='[config.githuburl]/commit/[pc]'>[copytext(pc, 1, min(length(pc), 7))]</a>")
prefix = "Based off origin/master commit: "
var/pc = GLOB.revdata.originmastercommit
to_chat(src, "[prefix]<a href='[config.githuburl]/commit/[pc]'>[copytext(pc, 1, min(length(pc), 7))]</a>")
else
to_chat(src, "Revision unknown")
to_chat(src, "<b>Current Infomational Settings:</b>")
@@ -94,7 +104,7 @@
to_chat(src, "Enforce Continuous Rounds: [config.continuous.len] of [config.modes.len] roundtypes")
to_chat(src, "Allow Midround Antagonists: [config.midround_antag.len] of [config.modes.len] roundtypes")
if(config.show_game_type_odds)
if(SSticker.IsRoundInProgress())
if(SSticker.IsRoundInProgress())
var/prob_sum = 0
var/current_odds_differ = FALSE
var/list/probs = list()
@@ -110,13 +120,13 @@
probs[ctag] = 1
prob_sum += config.probabilities[ctag]
if(current_odds_differ)
to_chat(src, "<b>Game Mode Odds for current round:</b>")
to_chat(src, "<b>Game Mode Odds for current round:</b>")
for(var/ctag in probs)
if(config.probabilities[ctag] > 0)
var/percentage = round(config.probabilities[ctag] / prob_sum * 100, 0.1)
to_chat(src, "[ctag] [percentage]%")
to_chat(src, "<b>All Game Mode Odds:</b>")
to_chat(src, "<b>All Game Mode Odds:</b>")
var/sum = 0
for(var/ctag in config.probabilities)
sum += config.probabilities[ctag]
+3 -2
View File
@@ -44,11 +44,12 @@
//cleans up ALL references :)
/datum/holocall/Destroy()
user.reset_perspective()
if(user.client)
if(!QDELETED(eye) && user.client)
for(var/datum/camerachunk/chunk in eye.visibleCameraChunks)
chunk.remove(eye)
qdel(eye)
eye = null
user.remote_control = null
QDEL_NULL(eye)
user = null
if(hologram)
+2 -2
View File
@@ -11,8 +11,8 @@
var/minetype = "lavaland"
var/list/transition_config = list(MAIN_STATION = CROSSLINKED,
CENTCOMM = SELFLOOPING,
var/list/transition_config = list(CENTCOMM = SELFLOOPING,
MAIN_STATION = CROSSLINKED,
EMPTY_AREA_1 = CROSSLINKED,
EMPTY_AREA_2 = CROSSLINKED,
MINING = SELFLOOPING,
+2 -2
View File
@@ -68,6 +68,7 @@
/datum/mind/New(var/key)
src.key = key
soulOwner = src
martial_art = default_martial_art
/datum/mind/Destroy()
SSticker.minds -= src
@@ -1288,7 +1289,6 @@
else if (istype(M) && length(M.viruses))
for(var/datum/disease/D in M.viruses)
D.cure(0)
sleep(0) //because deleting of virus is done through spawn(0)
if("infected")
if (check_rights(R_ADMIN, 0))
var/mob/living/carbon/human/H = current
@@ -1447,7 +1447,7 @@
special_role = "Wizard"
assigned_role = "Wizard"
if(!GLOB.wizardstart.len)
current.loc = pick(GLOB.latejoin)
SSjob.SendToLateJoin(current)
to_chat(current, "HOT INSERTION, GO GO GO")
else
current.loc = pick(GLOB.wizardstart)
+17
View File
@@ -608,6 +608,23 @@ GLOBAL_LIST_EMPTY(mutations_list)
message = replacetext(message," muh valids "," getting my kicks ")
return trim(message)
/datum/mutation/human/stoner
name = "Stoner"
quality = NEGATIVE
dna_block = NON_SCANNABLE
text_gain_indication = "<span class='notice'>You feel...totally chill, man!</span>"
text_lose_indication = "<span class='notice'>You feel like you have a better sense of time.</span>"
/datum/mutation/human/stoner/on_acquiring(mob/living/carbon/human/owner)
..()
owner.grant_language(/datum/language/beachbum)
owner.remove_language(/datum/language/common)
/datum/mutation/human/stoner/on_losing(mob/living/carbon/human/owner)
..()
owner.grant_language(/datum/language/common)
owner.remove_language(/datum/language/beachbum)
/datum/mutation/human/laser_eyes
name = "Laser Eyes"
quality = POSITIVE
+13 -6
View File
@@ -20,7 +20,10 @@
var/r_hand = null
var/l_hand = null
var/internals_slot = null //ID of slot containing a gas tank
var/list/backpack_contents = list() // In the list(path=count,otherpath=count) format
var/list/backpack_contents = null // In the list(path=count,otherpath=count) format
var/list/implants = null
var/can_be_admin_equipped = TRUE // Set to FALSE if your outfit requires runtime parameters
/datum/outfit/proc/pre_equip(mob/living/carbon/human/H, visualsOnly = FALSE)
//to be overriden for customization depending on client prefs,species etc
@@ -71,11 +74,11 @@
H.equip_to_slot_or_del(new l_pocket(H),slot_l_store)
if(r_pocket)
H.equip_to_slot_or_del(new r_pocket(H),slot_r_store)
for(var/path in backpack_contents)
var/number = backpack_contents[path]
for(var/i=0,i<number,i++)
H.equip_to_slot_or_del(new path(H),slot_in_backpack)
if(backpack_contents)
for(var/path in backpack_contents)
var/number = backpack_contents[path]
for(var/i=0,i<number,i++)
H.equip_to_slot_or_del(new path(H),slot_in_backpack)
if(!H.head && toggle_helmet && istype(H.wear_suit, /obj/item/clothing/suit/space/hardsuit))
var/obj/item/clothing/suit/space/hardsuit/HS = H.wear_suit
@@ -88,6 +91,10 @@
if(internals_slot)
H.internal = H.get_item_by_slot(internals_slot)
H.update_action_buttons_icon()
if(implants)
for(var/implant_type in implants)
var/obj/item/weapon/implant/I = new implant_type(H)
I.implant(H, null, silent=TRUE)
H.update_body()
return 1
+59 -116
View File
@@ -1,6 +1,4 @@
/datum/riding
var/generic_pixel_x = 0 //All dirs show this pixel_x for the driver
var/generic_pixel_y = 0 //All dirs show this pixel_y for the driver, use these vars if the pixel shift is stable across all dir, override handle_vehicle_offsets otherwise.
var/next_vehicle_move = 0 //used for move delays
var/vehicle_move_delay = 2 //tick delay between movements, lower = faster, higher = slower
var/keytype = null
@@ -34,16 +32,29 @@
/datum/riding/proc/force_dismount(mob/living/M)
ridden.unbuckle_mob(M)
//Override this to set your vehicle's various pixel offsets
//if they differ between directions, otherwise use the
//generic variables
/datum/riding/proc/handle_vehicle_offsets()
var/ridden_dir = "[ridden.dir]"
var/passindex = 0
if(ridden.has_buckled_mobs())
for(var/m in ridden.buckled_mobs)
passindex++
var/mob/living/buckled_mob = m
buckled_mob.setDir(ridden.dir)
buckled_mob.pixel_x = generic_pixel_x
buckled_mob.pixel_y = generic_pixel_y
var/list/offsets = get_offsets(passindex)
dir_loop:
for(var/offsetdir in offsets)
if(offsetdir == ridden_dir)
var/list/diroffsets = offsets[offsetdir]
buckled_mob.pixel_x = diroffsets[1]
if(diroffsets.len >= 2)
buckled_mob.pixel_y = diroffsets[2]
if(diroffsets.len == 3)
buckled_mob.layer = diroffsets[3]
break dir_loop
//Override this to set your vehicle's various pixel offsets
/datum/riding/proc/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 0), "[SOUTH]" = list(0, 0), "[EAST]" = list(0, 0), "[WEST]" = list(0, 0))
//KEYS
/datum/riding/proc/keycheck(mob/user)
@@ -100,10 +111,12 @@
//atv
/datum/riding/atv
keytype = /obj/item/key
generic_pixel_x = 0
generic_pixel_y = 4
vehicle_move_delay = 1
/datum/riding/atv/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 4), "[SOUTH]" = list(0, 4), "[EAST]" = list(0, 4), "[WEST]" = list( 0, 4))
/datum/riding/atv/handle_vehicle_layer()
if(ridden.dir == SOUTH)
ridden.layer = ABOVE_MOB_LAYER
@@ -150,24 +163,9 @@
keytype = /obj/item/key/janitor
/datum/riding/janicart/handle_vehicle_offsets()
..()
if(ridden.has_buckled_mobs())
for(var/m in ridden.buckled_mobs)
var/mob/living/buckled_mob = m
switch(buckled_mob.dir)
if(NORTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 4
if(EAST)
buckled_mob.pixel_x = -12
buckled_mob.pixel_y = 7
if(SOUTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 7
if(WEST)
buckled_mob.pixel_x = 12
buckled_mob.pixel_y = 7
/datum/riding/janicart/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 4), "[SOUTH]" = list(0, 7), "[EAST]" = list(-12, 7), "[WEST]" = list( 12, 7))
//scooter
/datum/riding/scooter/handle_vehicle_layer()
if(ridden.dir == SOUTH)
@@ -175,20 +173,14 @@
else
ridden.layer = OBJ_LAYER
/datum/riding/scooter/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0), "[SOUTH]" = list(-2), "[EAST]" = list(0), "[WEST]" = list( 2))
/datum/riding/scooter/handle_vehicle_offsets()
..()
if(ridden.has_buckled_mobs())
for(var/m in ridden.buckled_mobs)
var/mob/living/buckled_mob = m
switch(buckled_mob.dir)
if(NORTH)
buckled_mob.pixel_x = 0
if(EAST)
buckled_mob.pixel_x = -2
if(SOUTH)
buckled_mob.pixel_x = 0
if(WEST)
buckled_mob.pixel_x = 2
if(buckled_mob.get_num_legs() > 0)
buckled_mob.pixel_y = 5
else
@@ -209,16 +201,18 @@
//secway
/datum/riding/secway
keytype = /obj/item/key/security
generic_pixel_x = 0
generic_pixel_y = 4
/datum/riding/secway/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 4), "[SOUTH]" = list(0, 4), "[EAST]" = list(0, 4), "[WEST]" = list( 0, 4))
//i want to ride my
/datum/riding/bicycle
keytype = null
generic_pixel_x = 0
generic_pixel_y = 4
vehicle_move_delay = 0
/datum/riding/bicycle/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 4), "[SOUTH]" = list(0, 4), "[EAST]" = list(0, 4), "[WEST]" = list( 0, 4))
//speedbike
/datum/riding/space/speedbike
keytype = null
@@ -233,54 +227,28 @@
ridden.pixel_x = -18
ridden.pixel_y = 0
/datum/riding/space/speedbike/handle_vehicle_offsets()
if(ridden.has_buckled_mobs())
for(var/m in ridden.buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.setDir(ridden.dir)
switch(ridden.dir)
if(NORTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = -8
if(SOUTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 4
if(EAST)
buckled_mob.pixel_x = -10
buckled_mob.pixel_y = 5
if(WEST)
buckled_mob.pixel_x = 10
buckled_mob.pixel_y = 5
/datum/riding/space/speedbike/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, -8), "[SOUTH]" = list(0, 4), "[EAST]" = list(-10, 5), "[WEST]" = list( 10, 5))
//SPEEDUWAGON
/datum/riding/space/speedwagon
vehicle_move_delay = 0
/datum/riding/space/speedwagon/handle_vehicle_offsets()
if(ridden.has_buckled_mobs())
for(var/m in ridden.buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.setDir(ridden.dir)
ridden.pixel_x = -48
ridden.pixel_y = -48
switch(ridden.dir)
if(NORTH)
buckled_mob.pixel_x = -10
buckled_mob.pixel_y = -3
if(SOUTH)
buckled_mob.pixel_x = 16
buckled_mob.pixel_y = 3
if(EAST)
buckled_mob.pixel_x = -4
buckled_mob.pixel_y = 30
if(WEST)
buckled_mob.pixel_x = 4
buckled_mob.pixel_y = -1
/datum/riding/space/speedwagon/handle_vehicle_layer()
ridden.layer = BELOW_MOB_LAYER
/datum/riding/space/speedwagon/get_offsets(pass_index) // list(dir = x, y, layer)
switch(pass_index)
if(1)
return list("[NORTH]" = list(-10, -4), "[SOUTH]" = list(16, 3), "[EAST]" = list(-4, 30), "[WEST]" = list(4, -3))
if(2)
return list("[NORTH]" = list(19, -5, 4), "[SOUTH]" = list(-13, 3, 4), "[EAST]" = list(-4, -3, 4.1), "[WEST]" = list(4, 28, 3.9))
if(3)
return list("[NORTH]" = list(-10, -18, 4.2), "[SOUTH]" = list(16, 25, 3.9), "[EAST]" = list(-22, 30), "[WEST]" = list(22, -3, 4.1))
if(4)
return list("[NORTH]" = list(19, -18, 4.2), "[SOUTH]" = list(-13, 25, 3.9), "[EAST]" = list(-22, 3, 3.9), "[WEST]" = list(22, 28))
///////////////BOATS////////////
/datum/riding/boat
keytype = /obj/item/weapon/oar
@@ -297,17 +265,15 @@
/datum/riding/boat/dragon
keytype = null
generic_pixel_y = 2
generic_pixel_x = 1
vehicle_move_delay = 1
/datum/riding/boat/dragon/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(1, 2), "[SOUTH]" = list(1, 2), "[EAST]" = list(1, 2), "[WEST]" = list( 1, 2))
///////////////ANIMALS////////////
//general animals
/datum/riding/animal
keytype = null
generic_pixel_x = 0
generic_pixel_y = 4
/datum/riding/animal/handle_ride(mob/user, direction)
if(user.incapacitated())
@@ -335,7 +301,7 @@
/datum/riding/human/ride_check(mob/living/M)
var/mob/living/carbon/human/H = ridden //IF this runtimes I'm blaming the admins.
if(M.incapacitated(FALSE, TRUE) || H.incapacitated(FALSE, TRUE))
M.visible_message("<span class='warning'>[M] falls off [ridden]!</span>")
M.visible_message("<span class='boldwarning'>[M] falls off of [ridden]!</span>")
Unbuckle(M)
return FALSE
if(M.restrained(TRUE))
@@ -345,22 +311,8 @@
if(H.pulling == M)
H.stop_pulling()
/datum/riding/human/handle_vehicle_offsets()
for(var/mob/living/M in ridden.buckled_mobs)
M.setDir(ridden.dir)
switch(ridden.dir)
if(NORTH)
M.pixel_x = 0
M.pixel_y = 6
if(SOUTH)
M.pixel_x = 0
M.pixel_y = 6
if(EAST)
M.pixel_x = -6
M.pixel_y = 4
if(WEST)
M.pixel_x = 6
M.pixel_y = 4
/datum/riding/human/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 6), "[SOUTH]" = list(0, 6), "[EAST]" = list(-6, 4), "[WEST]" = list( 6, 4))
/datum/riding/human/handle_vehicle_layer()
if(ridden.buckled_mobs && ridden.buckled_mobs.len)
@@ -375,7 +327,7 @@
ridden.unbuckle_mob(user)
user.Weaken(3)
user.Stun(3)
user.visible_message("<span class='warning'>[ridden] pushes [user] off of them!</span>")
user.visible_message("<span class='boldwarning'>[ridden] pushes [user] off of them!</span>")
/datum/riding/cyborg
keytype = null
@@ -407,6 +359,9 @@
else
ridden.layer = MOB_LAYER
/datum/riding/cyborg/get_offsets(pass_index) // list(dir = x, y, layer)
return list("[NORTH]" = list(0, 4), "[SOUTH]" = list(0, 4), "[EAST]" = list(-6, 3), "[WEST]" = list( 6, 3))
/datum/riding/cyborg/handle_vehicle_offsets()
if(ridden.has_buckled_mobs())
for(var/mob/living/M in ridden.buckled_mobs)
@@ -417,26 +372,14 @@
M.pixel_x = R.module.ride_offset_x[dir2text(ridden.dir)]
M.pixel_y = R.module.ride_offset_y[dir2text(ridden.dir)]
else
switch(ridden.dir)
if(NORTH)
M.pixel_x = 0
M.pixel_y = 4
if(SOUTH)
M.pixel_x = 0
M.pixel_y = 4
if(EAST)
M.pixel_x = -6
M.pixel_y = 3
if(WEST)
M.pixel_x = 6
M.pixel_y = 3
..()
/datum/riding/cyborg/force_dismount(mob/living/M)
ridden.unbuckle_mob(M)
var/turf/target = get_edge_target_turf(ridden, ridden.dir)
var/turf/targetm = get_step(get_turf(ridden), ridden.dir)
M.Move(targetm)
M.visible_message("<span class='warning'>[M] is thrown clear of [ridden]!</span>")
M.visible_message("<span class='boldwarning'>[M] is thrown clear of [ridden]!</span>")
M.throw_at(target, 14, 5, ridden)
M.Weaken(3)
+1 -7
View File
@@ -241,10 +241,4 @@
id = "miracle"
suffix = "miracle.dmm"
name = "Ordinary Space Tile"
description = "Absolutely nothing strange going on here please move along, plenty more space to see right this way!"
/datum/map_template/ruin/space/dragoon
id = "dragoon"
suffix = "dragoontomb.dmm"
name = "Sky Bulge Tomb"
description = "A tomb of a dice-loving dragoon in space. Turns out he got too good and jumped too high. Contains the Sky Bulge, which when thrown, warps the thrower."
description = "Absolutely nothing strange going on here please move along, plenty more space to see right this way!"
+1 -1
View File
@@ -134,7 +134,7 @@
area_type = /area
protected_areas = list(/area/maintenance, /area/ai_monitored/turret_protected/ai_upload, /area/ai_monitored/turret_protected/ai_upload_foyer,
/area/ai_monitored/turret_protected/ai, /area/storage/emergency, /area/storage/emergency2, /area/shuttle)
/area/ai_monitored/turret_protected/ai, /area/storage/emergency/starboard, /area/storage/emergency/port, /area/shuttle)
target_z = ZLEVEL_STATION
immunity_type = "rad"
+6 -3
View File
@@ -50,9 +50,9 @@
R.show_laws()
if(WIRE_LOCKDOWN)
R.SetLockdown(!R.lockcharge) // Toggle
if(WIRE_RESET_MODULE)
if(R.has_module())
R.ResetModule()
if(WIRE_RESET_MODULE)
if(R.has_module())
R.visible_message("[R]'s module servos twitch.", "Your module display flickers.")
/datum/wires/robot/on_cut(wire, mend)
var/mob/living/silicon/robot/R = holder
@@ -74,3 +74,6 @@
R.visible_message("[R]'s camera lense focuses loudly.", "Your camera lense focuses loudly.")
if(WIRE_LOCKDOWN) // Simple lockdown.
R.SetLockdown(!mend)
if(WIRE_RESET_MODULE)
if(R.has_module() && !mend)
R.ResetModule()