Whitespace Standardization [MDB IGNORE] (#15748)

* Update settings

* Whitespace changes

* Comment out merger hooks in gitattributes

Corrupt maps would have to be resolved in repo before hooks could be updated

* Revert "Whitespace changes"

This reverts commit afbdd1d844.

* Whitespace again minus example

* Gitignore example changelog

* Restore changelog merge setting

* Keep older dmi hook attribute until hooks can be updated

* update vscode settings too

* Renormalize remaining

* Revert "Gitignore example changelog"

This reverts commit de22ad375d.

* Attempt to normalize example.yml (and another file I guess)

* Try again
This commit is contained in:
Drathek
2024-02-20 11:28:51 +01:00
committed by GitHub
parent 3b61f677b3
commit 7c8bb85de3
1175 changed files with 818171 additions and 818145 deletions
+160 -160
View File
@@ -1,161 +1,161 @@
#define FORWARD -1
#define BACKWARD 1
// As of August 4th, 2018, these datums are only used in Mech construction.
/datum/construction
var/list/steps
var/atom/holder
var/result
var/list/steps_desc
/datum/construction/New(atom)
..()
holder = atom
if(!holder) //don't want this without a holder
spawn
qdel(src)
set_desc(steps.len)
return
/datum/construction/proc/next_step()
steps.len--
if(!steps.len)
spawn_result()
else
set_desc(steps.len)
return
/datum/construction/proc/action(var/obj/item/I,mob/user as mob)
return
/datum/construction/proc/check_step(var/obj/item/I,mob/user as mob) //check last step only
var/valid_step = is_right_key(I)
if(valid_step)
if(custom_action(valid_step, I, user))
next_step()
return 1
return 0
/datum/construction/proc/is_right_key(var/obj/item/I) // returns current step num if I is of the right type.
var/list/L = steps[steps.len]
switch(L["key"])
if(IS_SCREWDRIVER)
if(I.has_tool_quality(TOOL_SCREWDRIVER))
return steps.len
if(IS_CROWBAR)
if(I.has_tool_quality(TOOL_CROWBAR))
return steps.len
if(IS_WIRECUTTER)
if(I.has_tool_quality(TOOL_WIRECUTTER))
return steps.len
if(IS_WRENCH)
if(I.has_tool_quality(TOOL_WRENCH))
return steps.len
if(IS_WELDER)
if(I.has_tool_quality(IS_WELDER))
return steps.len
if(istype(I, L["key"]))
return steps.len
return 0
/datum/construction/proc/custom_action(step, I, user)
return 1
/datum/construction/proc/check_all_steps(var/obj/item/I,mob/user as mob) //check all steps, remove matching one.
for(var/i=1;i<=steps.len;i++)
var/list/L = steps[i];
if(istype(I, L["key"]))
if(custom_action(i, I, user))
steps[i]=null;//stupid byond list from list removal...
listclearnulls(steps);
if(!steps.len)
spawn_result()
return 1
return 0
/datum/construction/proc/spawn_result()
if(result)
new result(get_turf(holder))
spawn()
qdel(holder)
return
/datum/construction/proc/set_desc(index as num)
var/list/step = steps[index]
holder.desc = step["desc"]
return
// Reversible
/datum/construction/reversible
var/index
/datum/construction/reversible/New(atom)
..()
index = steps.len
return
/datum/construction/reversible/proc/update_index(diff as num)
index+=diff
if(index==0)
spawn_result()
else
set_desc(index)
return
/datum/construction/reversible/is_right_key(var/obj/item/I) // returns index step
var/list/L = steps[index]
switch(L["key"])
if(IS_SCREWDRIVER)
if(I.has_tool_quality(TOOL_SCREWDRIVER))
return FORWARD
if(IS_CROWBAR)
if(I.has_tool_quality(TOOL_CROWBAR))
return FORWARD
if(IS_WIRECUTTER)
if(I.has_tool_quality(TOOL_WIRECUTTER))
return FORWARD
if(IS_WRENCH)
if(I.has_tool_quality(TOOL_WRENCH))
return FORWARD
if(IS_WELDER)
if(I.has_tool_quality(IS_WELDER))
return FORWARD
switch(L["backkey"])
if(IS_SCREWDRIVER)
if(I.has_tool_quality(TOOL_SCREWDRIVER))
return BACKWARD
if(IS_CROWBAR)
if(I.has_tool_quality(TOOL_CROWBAR))
return BACKWARD
if(IS_WIRECUTTER)
if(I.has_tool_quality(TOOL_WIRECUTTER))
return BACKWARD
if(IS_WRENCH)
if(I.has_tool_quality(TOOL_WRENCH))
return BACKWARD
if(IS_WELDER)
if(I.has_tool_quality(IS_WELDER))
return BACKWARD
if(istype(I, L["key"]))
return FORWARD //to the first step -> forward
else if(L["backkey"] && istype(I, L["backkey"]))
return BACKWARD //to the last step -> backwards
return 0
/datum/construction/reversible/check_step(var/obj/item/I,mob/user as mob)
var/diff = is_right_key(I)
if(diff)
if(custom_action(index, diff, I, user))
update_index(diff)
return 1
return 0
/datum/construction/reversible/custom_action(index, diff, I, user)
#define FORWARD -1
#define BACKWARD 1
// As of August 4th, 2018, these datums are only used in Mech construction.
/datum/construction
var/list/steps
var/atom/holder
var/result
var/list/steps_desc
/datum/construction/New(atom)
..()
holder = atom
if(!holder) //don't want this without a holder
spawn
qdel(src)
set_desc(steps.len)
return
/datum/construction/proc/next_step()
steps.len--
if(!steps.len)
spawn_result()
else
set_desc(steps.len)
return
/datum/construction/proc/action(var/obj/item/I,mob/user as mob)
return
/datum/construction/proc/check_step(var/obj/item/I,mob/user as mob) //check last step only
var/valid_step = is_right_key(I)
if(valid_step)
if(custom_action(valid_step, I, user))
next_step()
return 1
return 0
/datum/construction/proc/is_right_key(var/obj/item/I) // returns current step num if I is of the right type.
var/list/L = steps[steps.len]
switch(L["key"])
if(IS_SCREWDRIVER)
if(I.has_tool_quality(TOOL_SCREWDRIVER))
return steps.len
if(IS_CROWBAR)
if(I.has_tool_quality(TOOL_CROWBAR))
return steps.len
if(IS_WIRECUTTER)
if(I.has_tool_quality(TOOL_WIRECUTTER))
return steps.len
if(IS_WRENCH)
if(I.has_tool_quality(TOOL_WRENCH))
return steps.len
if(IS_WELDER)
if(I.has_tool_quality(IS_WELDER))
return steps.len
if(istype(I, L["key"]))
return steps.len
return 0
/datum/construction/proc/custom_action(step, I, user)
return 1
/datum/construction/proc/check_all_steps(var/obj/item/I,mob/user as mob) //check all steps, remove matching one.
for(var/i=1;i<=steps.len;i++)
var/list/L = steps[i];
if(istype(I, L["key"]))
if(custom_action(i, I, user))
steps[i]=null;//stupid byond list from list removal...
listclearnulls(steps);
if(!steps.len)
spawn_result()
return 1
return 0
/datum/construction/proc/spawn_result()
if(result)
new result(get_turf(holder))
spawn()
qdel(holder)
return
/datum/construction/proc/set_desc(index as num)
var/list/step = steps[index]
holder.desc = step["desc"]
return
// Reversible
/datum/construction/reversible
var/index
/datum/construction/reversible/New(atom)
..()
index = steps.len
return
/datum/construction/reversible/proc/update_index(diff as num)
index+=diff
if(index==0)
spawn_result()
else
set_desc(index)
return
/datum/construction/reversible/is_right_key(var/obj/item/I) // returns index step
var/list/L = steps[index]
switch(L["key"])
if(IS_SCREWDRIVER)
if(I.has_tool_quality(TOOL_SCREWDRIVER))
return FORWARD
if(IS_CROWBAR)
if(I.has_tool_quality(TOOL_CROWBAR))
return FORWARD
if(IS_WIRECUTTER)
if(I.has_tool_quality(TOOL_WIRECUTTER))
return FORWARD
if(IS_WRENCH)
if(I.has_tool_quality(TOOL_WRENCH))
return FORWARD
if(IS_WELDER)
if(I.has_tool_quality(IS_WELDER))
return FORWARD
switch(L["backkey"])
if(IS_SCREWDRIVER)
if(I.has_tool_quality(TOOL_SCREWDRIVER))
return BACKWARD
if(IS_CROWBAR)
if(I.has_tool_quality(TOOL_CROWBAR))
return BACKWARD
if(IS_WIRECUTTER)
if(I.has_tool_quality(TOOL_WIRECUTTER))
return BACKWARD
if(IS_WRENCH)
if(I.has_tool_quality(TOOL_WRENCH))
return BACKWARD
if(IS_WELDER)
if(I.has_tool_quality(IS_WELDER))
return BACKWARD
if(istype(I, L["key"]))
return FORWARD //to the first step -> forward
else if(L["backkey"] && istype(I, L["backkey"]))
return BACKWARD //to the last step -> backwards
return 0
/datum/construction/reversible/check_step(var/obj/item/I,mob/user as mob)
var/diff = is_right_key(I)
if(diff)
if(custom_action(index, diff, I, user))
update_index(diff)
return 1
return 0
/datum/construction/reversible/custom_action(index, diff, I, user)
return 1
+66 -66
View File
@@ -1,67 +1,67 @@
/*
* WARRANTY VOID IF CODE USED
*/
/datum/events
var/list/events
/datum/events/New()
..()
events = new
/datum/events/proc/addEventType(event_type as text)
if(!(event_type in events) || !islist(events[event_type]))
events[event_type] = list()
return 1
return
// Arguments: event_type as text, proc_holder as datum, proc_name as text
// Returns: New event, null on error.
/datum/events/proc/addEvent(event_type as text, proc_holder, proc_name as text)
if(!event_type || !proc_holder || !proc_name)
return
addEventType(event_type)
var/list/event = events[event_type]
var/datum/event/E = new /datum/event(proc_holder,proc_name)
event += E
return E
// Arguments: event_type as text, any number of additional arguments to pass to event handler
// Returns: null
/datum/events/proc/fireEvent()
//to_world("Events in [args[1]] called")
var/list/event = listgetindex(events,args[1])
if(istype(event))
spawn(-1)
for(var/datum/event/E in event)
if(!E.Fire(arglist(args.Copy(2))))
clearEvent(args[1],E)
return
// Arguments: event_type as text, E as /datum/event
// Returns: 1 if event cleared, null on error
/datum/events/proc/clearEvent(event_type as text, datum/event/E)
if(!event_type || !E)
return
var/list/event = listgetindex(events,event_type)
event -= E
return 1
/datum/event
var/listener
var/proc_name
/datum/event/New(tlistener,tprocname)
listener = tlistener
proc_name = tprocname
return ..()
/datum/event/proc/Fire()
//to_world("Event fired")
if(listener)
call(listener,proc_name)(arglist(args))
return 1
/*
* WARRANTY VOID IF CODE USED
*/
/datum/events
var/list/events
/datum/events/New()
..()
events = new
/datum/events/proc/addEventType(event_type as text)
if(!(event_type in events) || !islist(events[event_type]))
events[event_type] = list()
return 1
return
// Arguments: event_type as text, proc_holder as datum, proc_name as text
// Returns: New event, null on error.
/datum/events/proc/addEvent(event_type as text, proc_holder, proc_name as text)
if(!event_type || !proc_holder || !proc_name)
return
addEventType(event_type)
var/list/event = events[event_type]
var/datum/event/E = new /datum/event(proc_holder,proc_name)
event += E
return E
// Arguments: event_type as text, any number of additional arguments to pass to event handler
// Returns: null
/datum/events/proc/fireEvent()
//to_world("Events in [args[1]] called")
var/list/event = listgetindex(events,args[1])
if(istype(event))
spawn(-1)
for(var/datum/event/E in event)
if(!E.Fire(arglist(args.Copy(2))))
clearEvent(args[1],E)
return
// Arguments: event_type as text, E as /datum/event
// Returns: 1 if event cleared, null on error
/datum/events/proc/clearEvent(event_type as text, datum/event/E)
if(!event_type || !E)
return
var/list/event = listgetindex(events,event_type)
event -= E
return 1
/datum/event
var/listener
var/proc_name
/datum/event/New(tlistener,tprocname)
listener = tlistener
proc_name = tprocname
return ..()
/datum/event/proc/Fire()
//to_world("Event fired")
if(listener)
call(listener,proc_name)(arglist(args))
return 1
return
+84 -84
View File
@@ -1,84 +1,84 @@
GLOBAL_DATUM(revdata, /datum/getrev)
/datum/getrev
var/branch
var/revision
var/date
var/showinfo
var/list/testmerge = list()
/datum/getrev/New()
if(world.TgsAvailable()) // Try TGS maybe
testmerge = world.TgsTestMerges()
var/datum/tgs_revision_information/REV = world.TgsRevision()
if(REV)
revision = REV.origin_commit || REV.commit
branch = "-Using TGS-" // TGS doesn't provide branch info yet
date = "-Using TGS-" // Or date
if(!revision) // File parse method
var/list/head_branch = file2list(".git/HEAD", "\n")
if(head_branch.len)
branch = copytext(head_branch[1], 17)
var/list/head_log = file2list(".git/logs/HEAD", "\n")
for(var/line=head_log.len, line>=1, line--)
if(head_log[line])
var/list/last_entry = splittext(head_log[line], " ")
if(last_entry.len < 2) continue
revision = last_entry[2]
// Get date/time
if(last_entry.len >= 5)
var/unix_time = text2num(last_entry[5])
if(unix_time)
date = unix2date(unix_time)
break
to_world_log("-Revision Info-")
to_world_log("Branch: [branch]")
to_world_log("Date: [date]")
to_world_log("Revision: [revision]")
/datum/getrev/proc/GetTestMergeInfo(header = TRUE)
. = list()
if(!testmerge.len)
return
if(header)
. += "The following pull requests are currently test merged:"
for(var/datum/tgs_revision_information/test_merge/tm as anything in testmerge)
var/cm = tm.pull_request_commit
var/details = ": '" + html_encode(tm.title) + "' by " + html_encode(tm.author) + " at commit " + html_encode(copytext_char(cm, 1, 11))
if(details && findtext(details, "\[s\]") && (!usr || !usr.client.holder))
continue
. += "<a href=\"[config.githuburl]/pull/[tm.number]\">#[tm.number][details]</a>"
/client/verb/showrevinfo()
set category = "OOC"
set name = "Show Server Revision"
set desc = "Check the current server code revision"
if(!GLOB.revdata)
to_chat(src, "<span class='warning'>Please wait until server initializations are complete.</span>")
return
var/list/msg = list()
if(GLOB.revdata.revision)
msg += "<b>Server revision:</b> B:[GLOB.revdata.branch] D:[GLOB.revdata.date]"
if(config.githuburl)
msg += "<b>Commit:</b> <a href='[config.githuburl]/commit/[GLOB.revdata.revision]'>[GLOB.revdata.revision]</a>"
else
msg += "<b>Commit:</b> GLOB.revdata.revision"
else
msg += "<b>Server revision:</b> Unknown"
if(world.TgsAvailable())
var/datum/tgs_version/version = world.TgsVersion()
msg += "<b>TGS version:</b> [version.raw_parameter]"
var/datum/tgs_version/api_version = world.TgsApiVersion()
msg += "<b>DMAPI version:</b> [api_version.raw_parameter]"
if(GLOB.revdata.testmerge.len)
msg += GLOB.revdata.GetTestMergeInfo()
to_chat(src, msg.Join("<br>"))
GLOBAL_DATUM(revdata, /datum/getrev)
/datum/getrev
var/branch
var/revision
var/date
var/showinfo
var/list/testmerge = list()
/datum/getrev/New()
if(world.TgsAvailable()) // Try TGS maybe
testmerge = world.TgsTestMerges()
var/datum/tgs_revision_information/REV = world.TgsRevision()
if(REV)
revision = REV.origin_commit || REV.commit
branch = "-Using TGS-" // TGS doesn't provide branch info yet
date = "-Using TGS-" // Or date
if(!revision) // File parse method
var/list/head_branch = file2list(".git/HEAD", "\n")
if(head_branch.len)
branch = copytext(head_branch[1], 17)
var/list/head_log = file2list(".git/logs/HEAD", "\n")
for(var/line=head_log.len, line>=1, line--)
if(head_log[line])
var/list/last_entry = splittext(head_log[line], " ")
if(last_entry.len < 2) continue
revision = last_entry[2]
// Get date/time
if(last_entry.len >= 5)
var/unix_time = text2num(last_entry[5])
if(unix_time)
date = unix2date(unix_time)
break
to_world_log("-Revision Info-")
to_world_log("Branch: [branch]")
to_world_log("Date: [date]")
to_world_log("Revision: [revision]")
/datum/getrev/proc/GetTestMergeInfo(header = TRUE)
. = list()
if(!testmerge.len)
return
if(header)
. += "The following pull requests are currently test merged:"
for(var/datum/tgs_revision_information/test_merge/tm as anything in testmerge)
var/cm = tm.pull_request_commit
var/details = ": '" + html_encode(tm.title) + "' by " + html_encode(tm.author) + " at commit " + html_encode(copytext_char(cm, 1, 11))
if(details && findtext(details, "\[s\]") && (!usr || !usr.client.holder))
continue
. += "<a href=\"[config.githuburl]/pull/[tm.number]\">#[tm.number][details]</a>"
/client/verb/showrevinfo()
set category = "OOC"
set name = "Show Server Revision"
set desc = "Check the current server code revision"
if(!GLOB.revdata)
to_chat(src, "<span class='warning'>Please wait until server initializations are complete.</span>")
return
var/list/msg = list()
if(GLOB.revdata.revision)
msg += "<b>Server revision:</b> B:[GLOB.revdata.branch] D:[GLOB.revdata.date]"
if(config.githuburl)
msg += "<b>Commit:</b> <a href='[config.githuburl]/commit/[GLOB.revdata.revision]'>[GLOB.revdata.revision]</a>"
else
msg += "<b>Commit:</b> GLOB.revdata.revision"
else
msg += "<b>Server revision:</b> Unknown"
if(world.TgsAvailable())
var/datum/tgs_version/version = world.TgsVersion()
msg += "<b>TGS version:</b> [version.raw_parameter]"
var/datum/tgs_version/api_version = world.TgsApiVersion()
msg += "<b>DMAPI version:</b> [api_version.raw_parameter]"
if(GLOB.revdata.testmerge.len)
msg += GLOB.revdata.GetTestMergeInfo()
to_chat(src, msg.Join("<br>"))
+233 -233
View File
@@ -1,234 +1,234 @@
var/bluespace_item_types = newlist(/obj/item/weapon/storage/backpack/holding,
/obj/item/weapon/storage/bag/trash/holding,
/obj/item/weapon/storage/pouch/holding,
/obj/item/weapon/storage/belt/utility/holding,
/obj/item/weapon/storage/belt/medical/holding
)
//wrapper
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) //VOREStation Edit
new /datum/teleport/instant/science(arglist(args))
return
/datum/teleport
var/atom/movable/teleatom //atom to teleport
var/atom/destination //destination to teleport to
var/precision = 0 //teleport precision
var/datum/effect/effect/system/effectin //effect to show right before teleportation
var/datum/effect/effect/system/effectout //effect to show right after teleportation
var/soundin //soundfile to play before teleportation
var/soundout //soundfile to play after teleportation
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
var/local = TRUE //VOREStation Add - If false, can teleport from/to any z-level
/datum/teleport/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) //VOREStation Edit
..()
if(!initTeleport(arglist(args)))
return 0
return 1
/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout,local) //VOREStation Edit
if(!setTeleatom(ateleatom))
return 0
if(!setDestination(adestination))
return 0
if(!setPrecision(aprecision))
return 0
setEffects(aeffectin,aeffectout)
setForceTeleport(afteleport)
setSounds(asoundin,asoundout)
src.local = local // VOREStation Add
return 1
//must succeed
/datum/teleport/proc/setPrecision(aprecision)
if(isnum(aprecision))
precision = aprecision
return 1
return 0
//must succeed
/datum/teleport/proc/setDestination(atom/adestination)
if(istype(adestination))
destination = adestination
return 1
return 0
//must succeed in most cases
/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
qdel(ateleatom)
return 0
if(istype(ateleatom))
teleatom = ateleatom
return 1
return 0
//custom effects must be properly set up first for instant-type teleports
//optional
/datum/teleport/proc/setEffects(datum/effect/effect/system/aeffectin=null,datum/effect/effect/system/aeffectout=null)
effectin = istype(aeffectin) ? aeffectin : null
effectout = istype(aeffectout) ? aeffectout : null
return 1
//optional
/datum/teleport/proc/setForceTeleport(afteleport)
force_teleport = afteleport
return 1
//optional
/datum/teleport/proc/setSounds(asoundin=null,asoundout=null)
soundin = isfile(asoundin) ? asoundin : null
soundout = isfile(asoundout) ? asoundout : null
return 1
//placeholder
/datum/teleport/proc/teleportChecks()
return 1
/datum/teleport/proc/playSpecials(atom/location,datum/effect/effect/system/effect,sound)
if(location)
if(effect)
spawn(-1)
src = null
effect.attach(location)
effect.start()
if(sound)
spawn(-1)
src = null
playsound(location,sound,60,1)
return
//do the monkey dance
/datum/teleport/proc/doTeleport()
var/turf/destturf
var/turf/curturf = get_turf(teleatom)
if(precision)
var/list/posturfs = circlerangeturfs(destination,precision)
destturf = safepick(posturfs)
else
destturf = get_turf(destination)
if(!destturf || !curturf)
return 0
playSpecials(curturf,effectin,soundin)
var/obj/structure/bed/chair/C = null
if(isliving(teleatom))
var/mob/living/L = teleatom
if(L.buckled)
C = L.buckled
if(attempt_vr(src,"try_televore",args)) return //VOREStation Edit - Telenoms.
if(force_teleport)
teleatom.forceMove(destturf)
playSpecials(destturf,effectout,soundout)
else
if(teleatom.Move(destturf))
playSpecials(destturf,effectout,soundout)
if(C)
C.forceMove(destturf)
return 1
/datum/teleport/proc/teleport()
if(teleportChecks())
return doTeleport()
return 0
/datum/teleport/instant //teleports when datum is created
/datum/teleport/instant/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
if(..())
teleport()
return
/datum/teleport/instant/science/setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout)
if(!aeffectin || !aeffectout)
var/datum/effect/effect/system/spark_spread/aeffect = new
aeffect.set_up(5, 1, teleatom)
effectin = effectin || aeffect
effectout = effectout || aeffect
return 1
else
return ..()
/datum/teleport/instant/science/setPrecision(aprecision)
..()
var/list/bluespace_things = newlist()
for (var/item in bluespace_item_types)
if (istype(teleatom, item))
precision = rand(1, 100)
bluespace_things |= teleatom.search_contents_for(item)
//VOREStation Addition Start: Prevent taurriding abuse
if(istype(teleatom, /mob/living))
var/mob/living/L = teleatom
if(LAZYLEN(L.buckled_mobs))
for(var/mob/rider in L.buckled_mobs)
for (var/item in bluespace_item_types)
bluespace_things |= rider.search_contents_for(item)
//VOREStation Addition End: Prevent taurriding abuse
if(bluespace_things.len)
precision = max(rand(1,100)*bluespace_things.len,100)
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
to_chat(MM, "<span class='danger'>The Bluespace interface on your [teleatom] interferes with the teleport!</span>")
return 1
/datum/teleport/instant/science/teleportChecks()
if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
MM.visible_message("<span class='danger'>\The [MM] bounces off of the portal!</span>","<span class='warning'>Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.</span>")
else
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
return 0
/* VOREStation Removal
if(destination.z in using_map.admin_levels) //CentCom z-level
if(istype(teleatom, /obj/mecha))
var/obj/mecha/MM = teleatom
to_chat(MM.occupant, "<span class='danger'>\The [MM] would not survive the jump to a location so far away!</span>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)))
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
return 0
*/ //VOREStation Removal End
//VOREStation Edit Start
var/obstructed = 0
var/turf/dest_turf = get_turf(destination)
if(local && !(dest_turf.z in using_map.player_levels))
if(istype(teleatom, /mob/living))
to_chat(teleatom, "<span class='warning'>The portal refuses to carry you that far away!</span>")
return 0
else if(istype(destination.loc, /obj/belly))
var/obj/belly/destination_belly = destination.loc
var/mob/living/telenommer = destination_belly.owner
if(istype(telenommer))
if(istype(teleatom, /obj/machinery) || istype(teleatom, /obj/structure))
return 0
else if(!isliving(teleatom))
return 1
else
var/mob/living/telemob = teleatom
if(telemob.can_be_drop_prey && telenommer.can_be_drop_pred)
return 1
obstructed = 1
else if(!((isturf(destination) && !destination.density) || (isturf(destination.loc) && !destination.loc.density)) || !destination.x || !destination.y || !destination.z) //If we're inside something or outside universe
obstructed = 1
to_chat(teleatom, "<span class='warning'>Something is blocking way on the other side!</span>")
if(obstructed)
return 0
else
return 1
var/bluespace_item_types = newlist(/obj/item/weapon/storage/backpack/holding,
/obj/item/weapon/storage/bag/trash/holding,
/obj/item/weapon/storage/pouch/holding,
/obj/item/weapon/storage/belt/utility/holding,
/obj/item/weapon/storage/belt/medical/holding
)
//wrapper
/proc/do_teleport(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) //VOREStation Edit
new /datum/teleport/instant/science(arglist(args))
return
/datum/teleport
var/atom/movable/teleatom //atom to teleport
var/atom/destination //destination to teleport to
var/precision = 0 //teleport precision
var/datum/effect/effect/system/effectin //effect to show right before teleportation
var/datum/effect/effect/system/effectout //effect to show right after teleportation
var/soundin //soundfile to play before teleportation
var/soundout //soundfile to play after teleportation
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
var/local = TRUE //VOREStation Add - If false, can teleport from/to any z-level
/datum/teleport/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null, local=TRUE) //VOREStation Edit
..()
if(!initTeleport(arglist(args)))
return 0
return 1
/datum/teleport/proc/initTeleport(ateleatom,adestination,aprecision,afteleport,aeffectin,aeffectout,asoundin,asoundout,local) //VOREStation Edit
if(!setTeleatom(ateleatom))
return 0
if(!setDestination(adestination))
return 0
if(!setPrecision(aprecision))
return 0
setEffects(aeffectin,aeffectout)
setForceTeleport(afteleport)
setSounds(asoundin,asoundout)
src.local = local // VOREStation Add
return 1
//must succeed
/datum/teleport/proc/setPrecision(aprecision)
if(isnum(aprecision))
precision = aprecision
return 1
return 0
//must succeed
/datum/teleport/proc/setDestination(atom/adestination)
if(istype(adestination))
destination = adestination
return 1
return 0
//must succeed in most cases
/datum/teleport/proc/setTeleatom(atom/movable/ateleatom)
if(istype(ateleatom, /obj/effect) && !istype(ateleatom, /obj/effect/dummy/chameleon))
qdel(ateleatom)
return 0
if(istype(ateleatom))
teleatom = ateleatom
return 1
return 0
//custom effects must be properly set up first for instant-type teleports
//optional
/datum/teleport/proc/setEffects(datum/effect/effect/system/aeffectin=null,datum/effect/effect/system/aeffectout=null)
effectin = istype(aeffectin) ? aeffectin : null
effectout = istype(aeffectout) ? aeffectout : null
return 1
//optional
/datum/teleport/proc/setForceTeleport(afteleport)
force_teleport = afteleport
return 1
//optional
/datum/teleport/proc/setSounds(asoundin=null,asoundout=null)
soundin = isfile(asoundin) ? asoundin : null
soundout = isfile(asoundout) ? asoundout : null
return 1
//placeholder
/datum/teleport/proc/teleportChecks()
return 1
/datum/teleport/proc/playSpecials(atom/location,datum/effect/effect/system/effect,sound)
if(location)
if(effect)
spawn(-1)
src = null
effect.attach(location)
effect.start()
if(sound)
spawn(-1)
src = null
playsound(location,sound,60,1)
return
//do the monkey dance
/datum/teleport/proc/doTeleport()
var/turf/destturf
var/turf/curturf = get_turf(teleatom)
if(precision)
var/list/posturfs = circlerangeturfs(destination,precision)
destturf = safepick(posturfs)
else
destturf = get_turf(destination)
if(!destturf || !curturf)
return 0
playSpecials(curturf,effectin,soundin)
var/obj/structure/bed/chair/C = null
if(isliving(teleatom))
var/mob/living/L = teleatom
if(L.buckled)
C = L.buckled
if(attempt_vr(src,"try_televore",args)) return //VOREStation Edit - Telenoms.
if(force_teleport)
teleatom.forceMove(destturf)
playSpecials(destturf,effectout,soundout)
else
if(teleatom.Move(destturf))
playSpecials(destturf,effectout,soundout)
if(C)
C.forceMove(destturf)
return 1
/datum/teleport/proc/teleport()
if(teleportChecks())
return doTeleport()
return 0
/datum/teleport/instant //teleports when datum is created
/datum/teleport/instant/New(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
if(..())
teleport()
return
/datum/teleport/instant/science/setEffects(datum/effect/effect/system/aeffectin,datum/effect/effect/system/aeffectout)
if(!aeffectin || !aeffectout)
var/datum/effect/effect/system/spark_spread/aeffect = new
aeffect.set_up(5, 1, teleatom)
effectin = effectin || aeffect
effectout = effectout || aeffect
return 1
else
return ..()
/datum/teleport/instant/science/setPrecision(aprecision)
..()
var/list/bluespace_things = newlist()
for (var/item in bluespace_item_types)
if (istype(teleatom, item))
precision = rand(1, 100)
bluespace_things |= teleatom.search_contents_for(item)
//VOREStation Addition Start: Prevent taurriding abuse
if(istype(teleatom, /mob/living))
var/mob/living/L = teleatom
if(LAZYLEN(L.buckled_mobs))
for(var/mob/rider in L.buckled_mobs)
for (var/item in bluespace_item_types)
bluespace_things |= rider.search_contents_for(item)
//VOREStation Addition End: Prevent taurriding abuse
if(bluespace_things.len)
precision = max(rand(1,100)*bluespace_things.len,100)
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
to_chat(MM, "<span class='danger'>The Bluespace interface on your [teleatom] interferes with the teleport!</span>")
return 1
/datum/teleport/instant/science/teleportChecks()
if(istype(teleatom, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks get teleported --NeoFite
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
MM.visible_message("<span class='danger'>\The [MM] bounces off of the portal!</span>","<span class='warning'>Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.</span>")
else
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
return 0
/* VOREStation Removal
if(destination.z in using_map.admin_levels) //CentCom z-level
if(istype(teleatom, /obj/mecha))
var/obj/mecha/MM = teleatom
to_chat(MM.occupant, "<span class='danger'>\The [MM] would not survive the jump to a location so far away!</span>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/storage/backpack/holding)))
teleatom.visible_message("<span class='danger'>\The [teleatom] bounces off of the portal!</span>")
return 0
*/ //VOREStation Removal End
//VOREStation Edit Start
var/obstructed = 0
var/turf/dest_turf = get_turf(destination)
if(local && !(dest_turf.z in using_map.player_levels))
if(istype(teleatom, /mob/living))
to_chat(teleatom, "<span class='warning'>The portal refuses to carry you that far away!</span>")
return 0
else if(istype(destination.loc, /obj/belly))
var/obj/belly/destination_belly = destination.loc
var/mob/living/telenommer = destination_belly.owner
if(istype(telenommer))
if(istype(teleatom, /obj/machinery) || istype(teleatom, /obj/structure))
return 0
else if(!isliving(teleatom))
return 1
else
var/mob/living/telemob = teleatom
if(telemob.can_be_drop_prey && telenommer.can_be_drop_pred)
return 1
obstructed = 1
else if(!((isturf(destination) && !destination.density) || (isturf(destination.loc) && !destination.loc.density)) || !destination.x || !destination.y || !destination.z) //If we're inside something or outside universe
obstructed = 1
to_chat(teleatom, "<span class='warning'>Something is blocking way on the other side!</span>")
if(obstructed)
return 0
else
return 1
//VOREStation Edit End
+59 -59
View File
@@ -1,60 +1,60 @@
/datum/topic_input
var/href
var/list/href_list
/datum/topic_input/New(thref,list/thref_list)
href = thref
href_list = thref_list.Copy()
return
/datum/topic_input/proc/get(i)
return listgetindex(href_list,i)
/datum/topic_input/proc/getAndLocate(i)
var/t = get(i)
if(t)
t = locate(t)
return t || null
/datum/topic_input/proc/getNum(i)
var/t = get(i)
if(t)
t = text2num(t)
return isnum(t) ? t : null
/datum/topic_input/proc/getObj(i)
var/t = getAndLocate(i)
return isobj(t) ? t : null
/datum/topic_input/proc/getMob(i)
var/t = getAndLocate(i)
return ismob(t) ? t : null
/datum/topic_input/proc/getTurf(i)
var/t = getAndLocate(i)
return isturf(t) ? t : null
/datum/topic_input/proc/getAtom(i)
return getType(i,/atom)
/datum/topic_input/proc/getArea(i)
var/t = getAndLocate(i)
return isarea(t) ? t : null
/datum/topic_input/proc/getStr(i)//params should always be text, but...
var/t = get(i)
return istext(t) ? t : null
/datum/topic_input/proc/getType(i,type)
var/t = getAndLocate(i)
return istype(t,type) ? t : null
/datum/topic_input/proc/getPath(i)
var/t = get(i)
if(t)
t = text2path(t)
return ispath(t) ? t : null
/datum/topic_input/proc/getList(i)
var/t = getAndLocate(i)
/datum/topic_input
var/href
var/list/href_list
/datum/topic_input/New(thref,list/thref_list)
href = thref
href_list = thref_list.Copy()
return
/datum/topic_input/proc/get(i)
return listgetindex(href_list,i)
/datum/topic_input/proc/getAndLocate(i)
var/t = get(i)
if(t)
t = locate(t)
return t || null
/datum/topic_input/proc/getNum(i)
var/t = get(i)
if(t)
t = text2num(t)
return isnum(t) ? t : null
/datum/topic_input/proc/getObj(i)
var/t = getAndLocate(i)
return isobj(t) ? t : null
/datum/topic_input/proc/getMob(i)
var/t = getAndLocate(i)
return ismob(t) ? t : null
/datum/topic_input/proc/getTurf(i)
var/t = getAndLocate(i)
return isturf(t) ? t : null
/datum/topic_input/proc/getAtom(i)
return getType(i,/atom)
/datum/topic_input/proc/getArea(i)
var/t = getAndLocate(i)
return isarea(t) ? t : null
/datum/topic_input/proc/getStr(i)//params should always be text, but...
var/t = get(i)
return istext(t) ? t : null
/datum/topic_input/proc/getType(i,type)
var/t = getAndLocate(i)
return istype(t,type) ? t : null
/datum/topic_input/proc/getPath(i)
var/t = get(i)
if(t)
t = text2path(t)
return ispath(t) ? t : null
/datum/topic_input/proc/getList(i)
var/t = getAndLocate(i)
return islist(t) ? t : null